[PATCH] -r 1-100 not -r1:100 please...

John Arbash Meinel john at arbash-meinel.com
Fri May 27 14:40:47 BST 2005


John Arbash Meinel wrote:

>Michael Ellerman wrote:
>
>
...

>>>It isn't the end-all be-all, but I do think negative revisions numbers
>>>are a nice thing.
>>>
>>>
>>>
>>>
>>Yeah I think negative revision numbers are kind of "neat", but I don't think
>>you want to design your UI around them.
>>
>>By using - for ranges you free up : for seperating the name space prefix so as
>>I see it, it's either:
>>
>>bzr diff -r 10:20
>>and
>>bzr diff -r {date:yesterday}
>>
>>OR
>>
>>bzr diff -r 10-20
>>and
>>bzr diff -r date:yesterday
>>
>>
>>
>>
>>
>The problem is when we support UUIDs, they have dashes in them, so you get:
>bzr diff -r
>uuid:aoue-aoeu-aoeu-aoeu-aouaoeuaoeu-uuid:aoeu-aeou-aoeu-aoeu-aouaouau
>
>John
>=:->
>
>
Well, if you are willing to give up starting with a range (which isn't
terrible, as you can always start with 1), then my latest parser could
easily be modified to use '-' as a separator.
I also forgot that we do have 'revid:' which has '-' inside of it, thus:

bzr log -r revid:mdp at sourcefrog.net-20050511098098-0980129830-500

Is a little ambiguous. (Technically that is supposed to mean go from the
supplied revid until the 500th log).
Thus the {} need to stay for now
bzr log -r {revid:mdp at sourcefrog.net-20050511098098-0980129830}-500

It makes supplying a range with negative numbers a little ugly:
bzr log -r -5--2

But the parser would handle it just fine.

Getting rid of the braces is possible, but it complicates things a bit.
For something like revid: and date: probably they will generally follow
an obvious layout that the parser could know the format, and just keep
track of how many '-' it has seen. I don't know that this is very
stable, as a change to anything would break it. Also, if we do end up
supporting tag:, then we have given the user a free-form tag to fill
out. I certainly don't think we want to disallow the '-' character in tags.

I agree that '-' is a decent separator character, but I think it is also
frequently used as a joining character. We have thought about it and
discussed it, and it doesn't really seem like the best character. If we
are missing something, and you have a better workaround, let us know. I
know somebody complained about {} because in [t]csh it sometimes gets
stripped. But I think () and [] are probably worse, ' and " are
definitely stripped by the shell, you could do ::, so you might have
either :revid:blahblahblah:, or maybe leave off the initial colon. That
requires that you have no colons in the identifier, which doesn't work
for date, {date:YYYY-MM-DD HH:MM:SS}.  (The time is optional, and above
that seconds is optional) Obviously that string would need to be quoted
since it includes a space.

So in summary, if you leave the {} in, it is pretty easy to switch from
: to -. I think Subversion uses :, so there was a precedent for it. To
take out {} is a whole lot more difficult, and would need some
discussion. My favorite right now is the :revid:blah: format, but we
would need a solution for date (and it would mean tag names couldn't
include colons).

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050527/853b676f/attachment.pgp 


More information about the bazaar mailing list