You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Karl Heinz Marbaise <kh...@gmx.de> on 2007/06/23 12:20:02 UTC

svn log and revision date ranges

Hi there,

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.

Can someone explain me this a little bit...

thanks in advance..

BTW: I'm working on Linux with Subversion 1.4.2

Kind regards
Karl Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn log and revision date ranges

Posted by Hari Kodungallur <hk...@gmail.com>.
On 6/24/07, Ryan Schmidt <su...@ryandesign.com> wrote:
>
> <..snip..>
>
> 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.
>


First of all, I am sorry, I did not mean to say you are wrong. Only wanted
to point out that there is some inconsistency with what you expect svn log
to do (from the documentation) and what it actually does. In fact, I am
trying it now, and it gets more interesting. The last revision *before* the
given date/time is not consistent either. At least it is not what I
expected.


[~] > svn log -q -r{"2007-06-21"}:{"2007-06-21"} $SVNROOT
------------------------------------------------------------------------
r80919 | author | 2007-06-20 23:42:16 -0700 (Wed, 20 Jun 2007)
------------------------------------------------------------------------
[~] >


This is as explained by you, Ryan.
[FYI: r80919 is a change to file under $SVNROOT/branches -- this info will
be useful below]


[~] > svn log -q -r{"2007-06-21"}:{"2007-06-21"} $SVNROOT/trunk
------------------------------------------------------------------------
[~] >


I would've expected that that I will see at least one revision even for
$SVNROOT/trunk. But not so. [I actually did a longer range and from 21st
till HEAD and it did start from a revision after 21st 00:00:00].


[~] > svn log -q -r{"2007-06-21"}:{"2007-06-21"} $SVNROOT/branches
------------------------------------------------------------------------
r80919 | author | 2007-06-20 23:42:16 -0700 (Wed, 20 Jun 2007)
------------------------------------------------------------------------
[~] >


So, now it seems clear that the last revision before the given date/time
applies only if that revision affected files within the given path. If not,
it will not go as far as to look at the last revision that affected this
path.

Anyway, good to know these details.

Thanks!
-Hari Kodungallur

Re: svn log and revision date ranges

Posted by Jing Xue <ji...@digizenstudio.com>.
Quoting Ryan Schmidt <su...@ryandesign.com>:

> 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.

Hi Ryan,

(Sorry for bringing back this week-old one)

The paragraph underneath the "A Day Early" box seems to be describing  
it slightly differently - and (I think) is actually somewhat  
consistent with what one would think svn should do with date ranges:

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

$ svn log --revision {2002-11-20}:{2002-11-29}"

Or maybe I miss-read that or some part of the thread?

-- 
Jing Xue



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn log and revision date ranges

Posted by Ryan Schmidt <su...@ryandesign.com>.
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

Re: svn log and revision date ranges

Posted by Hari Kodungallur <hk...@gmail.com>.
On 6/23/07, Ryan Schmidt <su...@ryandesign.com> 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.

Thanks!
-Hari Kodungallur

Re: svn log and revision date ranges

Posted by Ryan Schmidt <su...@ryandesign.com>.
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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org