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

Re: svn log and revision date ranges

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-06-25 05:23:38 CEST

On Jun 24, 2007, at 17:45, Hari Kodungallur wrote:

> On 6/23/07, Ryan Schmidt wrote:
>>
>> On Jun 23, 2007, at 07:20, Karl Heinz Marbaise wrote:
>>
>> > i'm a little bit confused, cause i'm trying to do some scripting
>> with
>> > the following:
>> > (LC_ALL and TZ used, cause in germany i have different time zone).
>> >
>> >
>> > export LC_ALL=en_US;export TZ=UTC; \
>> > svn log -q http://svn.traveler/jagosi \
>> > --revision "{2007-06-21 00:00:00 +0000}":"{2007-06-21 23:59:59
>> > +0000}"
>> >
>> > What i get as output by the above command was the following:
>> >
>> >
>> ---------------------------------------------------------------------
>> -
>> > --
>> > r61 | kama | 2007-06-19 16:26:34 +0000 (Tue, 19 Jun 2007)
>> >
>> ---------------------------------------------------------------------
>> -
>> > --
>> > r62 | kama | 2007-06-21 17:11:46 +0000 (Thu, 21 Jun 2007)
>> >
>> ---------------------------------------------------------------------
>> -
>> > --
>> > r63 | kama | 2007-06-21 17:13:24 +0000 (Thu, 21 Jun 2007)
>> >
>> ---------------------------------------------------------------------
>> -
>> > --
>> > r64 | kama | 2007-06-21 18:14:49 +0000 (Thu, 21 Jun 2007)
>> >
>> ---------------------------------------------------------------------
>> -
>> > --
>> > r65 | kama | 2007-06-21 18:26:09 +0000 (Thu, 21 Jun 2007)
>> >
>> ---------------------------------------------------------------------
>> -
>> > --
>> >
>> > I didn't expect to get the revision 61, cause it's completley out
>> > of the
>> > range of the given timeframe...of June 21
>> >
>> > I have read in book may be i didn't understand that well,
>> > but i think this is a little bit confusing.
>>
>> When you ask for revision "{2007-06-21 00:00:00 +0000}", Subversion
>> gives you the closest revision on or _before_ that date and time,
>> which is r61 in your case.
>>
>> It's explained here, in the box titled "Is Subversion a Day Early?"
>>
>> http://svnbook.red-bean.com/en/1.2/
>> svn.tour.revs.html#svn.tour.revs.dates
>
> Actually, the "day early" thing is applicable only if the time is
> not specified. Isn't that true? In this case the time and the
> timezone offset are both provided and so, it should not be the
> case, I thought.
> And from my understanding, even if the time is not provided, the
> "day early" thing happens only because the time defaults to
> 00:00:00. So, if the revision range is say:
>
> -r {2007-06-21}:{2007-06-22}
>
> then, what you actually get is
>
> -r {"2007-06-21 00:00:00"}:{"2007-06-22 00:00:00"}
>
> This essentially means, the search will limit to all the check-in
> on 21st (plus anything that happened at the stroke of midnight
> between 21st and 22nd).
>
> The timezone offset is something that I have not understood well.
> But my guess is that, if you do provide the offset, the time is
> calculated as UTC plus whatever offset is provided.
>
> So, {"2007-06-21 00:00:00"} becomes local time 21st midnight.
> And {"2007-06-21 00:00:00 +0700"} becomes UTC + 7 hours. I am in
> PDT, which is UTC - 7 hours. So, the time in local time becomes
> {"2007-06-20 10:00:00"}.
> It seems to me that this assumption is right. But I am not entirely
> sure.
>
>
> Anyway, about the original email from Karl, I think that r61 should
> not have been shown in the log.

Hari, I stand by my original reply. It is expected that r61 is
included in the output, though at first it does not seem like it
should be. I do not believe Subversion works the way you have described.

True, when you request

-r {2007-06-21}:{2007-06-22}

what you actually get is

-r {"2007-06-21 00:00:00"}:{"2007-06-22 00:00:00"}

But Subversion does not give you all revisions that occur between
those dates/times, though at first that's what you might think you'd
get.

Instead, Subversion converts each date/time to a revision, by finding
the newest revision at or before that time.

Going back to Karl's original situation, r61 was committed at
2007-06-19 16:26:34 and r62 at 2007-06-21 17:11:46, so the
{"2007-06-21 00:00:00"} part of the revision argument is converted to
61, because r61 is the newest revision committed at or before the
specified time. Similarly, the {"2007-06-22 00:00:00"} part is
converted to 65, because, though we don't see it, r66 was presumably
committed after 2007-06-22 00:00:00.

Perhaps the little box in the book should be expanded to explain this
better, but I'm pretty sure that's the way it works.

I haven't experimented with the timezone part of the date/time
specifier so I have no comment there.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Jun 25 05:23:45 2007

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.