Problem getting new commits via svnkit api.

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

Problem getting new commits via svnkit api.

by fantastic_ray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys,
I'm trying to track new commits to the project by specifying a date.
what I'm doing is:
I create a calendar object like:

Calendar cal = new GregorianCalendar(2008, 7, 12);
and then:
Date date = cal.getTime();
and:
Collection logEntries =
                        repository.log( new String[] { "" } , null , entry.getRevision() , repository.getDatedRevision(date) , true , true );

and pretty much use the code from this http://svn.svnkit.com/repos/svnkit/trunk/doc/examples/src/org/tmatesoft/svn/examples/repository/History.java
class from the svnkit wiki.
The problem is that the code seems to extract info from March/June or whatever instead of just getting commits made after July 12,2008.

Can someone please help and let me know how to fix this?

Ray.

Re: Problem getting new commits via svnkit api.

by fantastic_ray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is this because repository.getDatedRevision(date) might return a revision value which coresponds to a older date(closest to 7/12/2008) ??

Can someone please help me understand this.

Ray.

fantastic_ray wrote:
Hi guys,
I'm trying to track new commits to the project by specifying a date.
what I'm doing is:
I create a calendar object like:

Calendar cal = new GregorianCalendar(2008, 7, 12);
and then:
Date date = cal.getTime();
and:
Collection logEntries =
                        repository.log( new String[] { "" } , null , entry.getRevision() , repository.getDatedRevision(date) , true , true );

and pretty much use the code from this http://svn.svnkit.com/repos/svnkit/trunk/doc/examples/src/org/tmatesoft/svn/examples/repository/History.java
class from the svnkit wiki.
The problem is that the code seems to extract info from March/June or whatever instead of just getting commits made after July 12,2008.

Can someone please help and let me know how to fix this?

Ray.

Re: Problem getting new commits via svnkit api.

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

 > Collection logEntries =
 >  repository.log( new String[] { "" } , null ,
 >           entry.getRevision() ,
 >           repository.getDatedRevision(date) ,
 >           true , true );

Above call will return log entries for all revisions between
"entry.getRevision()" and revision that repository had at "date".

 > I'm trying to track new commits to the project by specifying a date.
 > what I'm doing is:
If you'd like to get all log entries _after_ certain date, then the
follow revisions pair should be used:

long revEnd = repository.getLatestRevision();
long revStart = repository.getDatedRevision();

repository.log(..., revStart, revEnd, ...);


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

fantastic_ray wrote:

> Is this because repository.getDatedRevision(date) might return a revision
> value which coresponds to a older date(closest to 7/12/2008) ??
>
> Can someone please help me understand this.
>
> Ray.
>
>
> fantastic_ray wrote:
>> Hi guys,
>> I'm trying to track new commits to the project by specifying a date.
>> what I'm doing is:
>> I create a calendar object like:
>>
>> Calendar cal = new GregorianCalendar(2008, 7, 12);
>> and then:
>> Date date = cal.getTime();
>> and:
>> Collection logEntries =
>> repository.log( new String[] { "" } , null , entry.getRevision() ,
>> repository.getDatedRevision(date) , true , true );
>>
>> and pretty much use the code from this
>> http://svn.svnkit.com/repos/svnkit/trunk/doc/examples/src/org/tmatesoft/svn/examples/repository/History.java
>> class from the svnkit wiki.
>> The problem is that the code seems to extract info from March/June or
>> whatever instead of just getting commits made after July 12,2008.
>>
>> Can someone please help and let me know how to fix this?
>>
>> Ray.
>>
>>
>

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