How can I get the commit comments?

View: New views
3 Messages — Rating Filter:   Alert me  

How can I get the commit comments?

by citron :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I would like to print out the comments of the head revision for a file, using the SVNKit for java/groovy.

Its simple to get the info for an Author or the commit date:

             import org.tmatesoft.svn.core.wc.*;

             def mgr = SVNClientManager.newInstance();

             def lastCommitedBy = mgr.statusClient.doStatus(new File("c:/somefile.txt"), false).getAuthor()
             def lastCommitedDate = mgr.statusClient.doStatus(new File("c:/somefile.txt"), false).getCommittedDate()



.. but how can I get the commit comments?


Thanks for any help!

Re: How can I get the commit comments?

by Dale Anson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The status client won't get you what you want.  There is an example
here of how to get the log comments:

https://wiki.svnkit.com/Printing_Out_Repository_History

Dale


On Sun, Nov 8, 2009 at 9:08 AM, citron <viklund_anders@...> wrote:

>
> Hi,
>
> I would like to print out the comments of the head revision for a file,
> using the SVNKit for java/groovy.
>
> Its simple to get the info for an Author or the commit date:
>
>             import org.tmatesoft.svn.core.wc.*;
>
>             def mgr = SVNClientManager.newInstance();
>
>             def lastCommitedBy = mgr.statusClient.doStatus(new
> File("c:/somefile.txt"), false).getAuthor()
>             def lastCommitedDate = mgr.statusClient.doStatus(new
> File("c:/somefile.txt"), false).getCommittedDate()
>
>
>
> .. but how can I get the commit comments?
>
>
> Thanks for any help!
> --
> View this message in context: http://old.nabble.com/How-can-I-get-the-commit-comments--tp26255101p26255101.html
> Sent from the SVNKit - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svnkit-users-unsubscribe@...
> For additional commands, e-mail: svnkit-users-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...


Re: How can I get the commit comments?

by Alexander Sinyushkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello!

I think you could use the following code for your needs:

            SVNRepository repository =
SVNRepositoryFactory.create(SVNURL.parseURIEncoded("http://svn.svnkit.com/repos/svnkit/trunk"));
           
            SVNDirEntry entry = repository.info("README.txt", -1/*get
HEAD*/);
            long rev = entry.getRevision();
            Date date = entry.getDate();
           
            String logMessage = repository.getRevisionPropertyValue(rev,
SVNRevisionProperty.LOG).getString();

----
Alexander Sinyushkin,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
http://sqljet.com/ - Java SQLite Library!



citron wrote:

> Hi,
>
> I would like to print out the comments of the head revision for a file,
> using the SVNKit for java/groovy.
>
> Its simple to get the info for an Author or the commit date:
>
>     import org.tmatesoft.svn.core.wc.*;
>
>     def mgr = SVNClientManager.newInstance();
>
>              def lastCommitedBy = mgr.statusClient.doStatus(new
> File("c:/somefile.txt"), false).getAuthor()
>              def lastCommitedDate = mgr.statusClient.doStatus(new
> File("c:/somefile.txt"), false).getCommittedDate()
>
>
>
> .. but how can I get the commit comments?
>
>
> Thanks for any help!
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...