[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn log get revisions by date

From: hashb <pakoamerican_at_gmail.com>
Date: Tue, 26 Apr 2011 17:45:10 -0700 (PDT)

Johan,

I've seen this referenced wherever the issue arises. Pasting what I assume
is the portion that is of interest:

Is Subversion a Day Early?

If you specify a single date as a revision without specifying a time of day
(for example 2006-11-27), you may think that Subversion should give you the
last revision that took place on the 27th of November. Instead, you'll get
back a revision from the 26th, or even earlier. Remember that Subversion
will find the most recent revision of the repository as of the date you
give. If you give a date without a timestamp, such as 2006-11-27, Subversion
assumes a time of 00:00:00, so looking for the most recent revision won't
return anything on the 27th.

If you want to include the 27th in your search, you can either specify the
27th with the time ({"2006-11-27 23:59"}), or just specify the next day
({2006-11-28}).

You can also use a range of dates. Subversion will find all revisions
between both dates, inclusive:

$ svn log -r {2006-11-20}:{2006-11-29}

This lead me to believe that by specifying a date and time range, I could be
sure that I only received commits made between the two. My post is
addressing an issue that arises despite doing this. If this is not
considered a bug (although I personally feel that it is), then perhaps it
could at least be clarified a bit further in the documentation.

-hb

Johan Corveleyn-3 wrote:
>
> Yes, what you describe is indeed how it works. It's not a bug. See:
>
>
> http://svnbook.red-bean.com/nightly/en/svn.tour.revs.specifiers.html#svn.tour.revs.dates
>
> for some more information (more specifically in the section "Is
> Subversion a Day Early?")
>
> Cheers,
> Johan
>
> On Wed, Apr 27, 2011 at 2:05 AM, hashb wrote:
>>
>> I just ran into (at least one variation of) this phenomena and believe I
>> know
>> what's going on.
>>
>> When a date range is used, the first thing that svn does is decide which
>> revision to start the log from. It does this by taking a snapshot of the
>> HEAD revision AT THE START TIME specified. Not the first revision AFTER
>> the
>> start time, but the HEAD revision AT the start time.
>>
>> So, as an example. If I give the command:
>>
>> svn log URL -r {2011-04-25T11:00:00}:{2011-04-26T11:00:00}
>>
>> then the first thing that svn does is take the head revision at 11:00 on
>> April 25th. The head revision at this time will obviously be the last
>> commit
>> BEFORE this point. From there, svn determines the last revision within
>> the
>> time frame and displays the logs. Unfortunately, that first commit will
>> be
>> before the specified start point.
>>
>> I tested this by issuing an svn log command from the root of my
>> repository
>> with matching start and end times:
>>
>> svn log URL -r {2011-04-25T11:00:00}:{2011-04-25T11:00:00}
>>
>> and then saw that a single log statement was returned - the commit made
>> last
>> before this point in time. I should have received no such log statement.
>>
>> One last important point. The behavior above can SEEM to be sporadic.
>> Sometimes an out-of-range revision is displayed, and sometimes it isn't.
>> The
>> reason for this is that if you run the log command in a branch, we'll
>> call
>> it BranchA, but the head revision that svn determines the start point
>> from
>> is in another branch, BranchB, it will be filtered out of the log
>> results.
>> Because the out-of-range head revision is in another branch and gets
>> filtered out of the results, the user never sees it and thinks that they
>> luckily got a correct output.
>>
>> Why this issue hasn't been resolved yet (I am running version 1.6.13
>> (r1002816)) is for a different thread.
>>
>> Hope this helps
>> -hb
>>
>>
>>
>> Eric White-11 wrote:
>>>
>>> Good day all,
>>> I am working on an application that uses information from an svn log
>>> between
>>> two dates. After searching around I have found the following is supposed
>>> to
>>> work (according to the SVN book)
>>>
>>> svn log --revision {2002-11-20}:{2002-11-29} URL
>>>
>>> I have tried this and although it does indeed give me results between
>>> the two dates, it also gives me many values outside that range.
>>>
>>> Try for example svn log --revision {2008-11-02}:{2008-11-04}
>>> http://svn.apache.org/repos/asf
>>> and you can grep 2008-01
>>>
>>> You will find a handful of lines that contain 2008-01-* which is quite
>>> clearly outside the range given. I am looking for values between
>>> November 2nd 2008 and November 4th 2008.
>>>
>>> You can even grep 2007 and you will find many entries that aren't even
>>> in the same year that I have specified.
>>>
>>> This is a problem. Now I can go ahead and double check the dates
>>> against the desired range. I can very easily exclude the January dates
>>> when the range is for November. But how do I know that I am actually
>>> getting all the results and not just a subgroup?
>>>
>>> Any insight would be appreciated!
>>>
>>> Cheers
>>> Eric
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/svn-log-get-revisions-by-date-tp20543137p31483092.html
>> Sent from the Subversion Users mailing list archive at Nabble.com.
>>
>>
>
>

-- 
View this message in context: http://old.nabble.com/svn-log-get-revisions-by-date-tp20543137p31483337.html
Sent from the Subversion Users mailing list archive at Nabble.com.
Received on 2011-04-27 02:45:37 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.