[Patch] bzr status doesn't handle revision
Robey Pointer
robey at lag.net
Sun Sep 18 07:23:01 BST 2005
On 12 Sep 2005, at 22:47, Robey Pointer wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12 Sep 2005, at 21:04, John A Meinel wrote:
>
>
>> Robey Pointer wrote:
>>
>>
>>>
>>>
>>>
>>>> John A Meinel <john at arbash-meinel.com> writes:
>>>>
>>>> | bzr log -r date:+yesterday..date:-tomorrow
>>>> |
>>>> | (The syntax for the date code is a little bit odd, but the
>>>> above would
>>>> | print out all the changes from yesterday through today, up
>>>> until just
>>>> | before tomorrow).
>>>>
>>>>
>>>
>>> Yes, that date syntax is difficult. :)
>>>
>>> How about using [start,end) convention there and removing the "+"
>>> and
>>> "-"? For non-math-geeks, [start,end) is the same as python
>>> slices: the
>>> start point is included but the end point is not.
>>>
>>> Then "date:yesterday..date:tomorrow" would mean "everything from the
>>> beginning of yesterday, right up to -- but not including -- the
>>> beginning of tomorrow" or "11-Sep-2005 0:00:00 .. 12-Sep-2005
>>> 23:59:59.999999".
>>>
>>
>> The problem as it stands is how the revision parser works, which
>> generally treats each entry separately, so it doesn't know if you are
>> looking for the beginning of a date range, or the end of one. The +/-
>> change the meaning slightly, though I believe doing:
>> bzr log -r date:yesterday..date:tomorrow
>>
>> Would almost work. (tomorrow would fail because there are no
>> revisions
>> which match that date. Hence you have to specify the -tomorrow so
>> that
>> it looks for the first revision before the specified time).
>>
>
> What if you treated all dates as "+" and used the [start,end)
> convention? Dates before the archive started would round up to
> revno 1, and dates past the end (tomorrow, for example) could be
> rounded to branch.get_revno() + 1.
>
> Example:
>
> revno date
> - ----- ----
> 167 2005-09-12 22:18
> 168 2005-09-13 01:14
> 169 2005-09-13 01:40
> 170 2005-09-14 15:05
>
> date:2005-09-13..date:2005-09-14
> => [168..170) because +2005-09-13 = 168 and +2005-09-14 = 170
> => 168 thru 169
I messed around with this a bit tonite and decided that the special
[start,end) behavior wouldn't really be helpful enough for the kind
of code disruption it would cause.
Really all you want is to make the old "+" behavior the default, and
have a "before:" prefix for special-casing one end of the range.
So instead, here's a trivial patch that removes the +/-/= stuff from
"date:" revisions. I believe they won't be missed, since they're
really confusing to look at. Instead, now you can do:
$ bzr log -r date:yesterday..before:date:today
PS. I think the overloading of "new" in RevisionInfo is really clever
but also a bit arcane. Was a factory function deemed too obvious? ;)
robey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rev-date.patch
Type: application/octet-stream
Size: 5063 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050917/6dedd0d3/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050917/6dedd0d3/attachment.pgp
More information about the bazaar
mailing list