[RFC] Trying to get something better that revno:N:branch to deal with remote revs

Matthieu Moy Matthieu.Moy at imag.fr
Mon Aug 14 16:24:40 BST 2006


John Arbash Meinel <john at arbash-meinel.com> writes:

> Actually, a URL cannot contain ';' as it is part of the URL spec that
> ';' indicates parameters are following. Which is how we are using it.
> And it is easy enough to do '\;' to escape on the command line.

Well, I don't know what the standard says, but

  http://www-verimag.imag.fr/~moy/tmp/foo;bar.txt

works. Also, the location can be a plain path like ./path/to/file. And
some people like to put ; in their filenames unfortunately. I agree
that it's not common, but I don't like ambiguities anyway.

>> Well, the conclusion is that it's hard to get something easy to type
>> (no shell metacharacters) and unambiguous. Indeed, with branch:, there
>> are already ambiguities: I can have a branch whose name is
>> "foo..revid:bar", it's a valid directory name!
>
> Yes, that was our conclusion as well. However, I think the current
> parser actually handles 'bzr foo -r branch:foo..revid:bar',

It handles it as branch:foo and revid:bar, but if you like to name
your branch foo..revid:bar, and if you wanted only one revision, you
have no way to say it. Not that this is a realistic situation, but for
me, a parser should be unambiguous and not based on heuristics.

> I know it handles 'bzr foo -r branch:../../foobar' but that might
> only be because of the slashes.

Yes, it also does it correctly. I don't know if it's by luck or by
design ;-).

> Especially with switching over to optparse, you will need to be careful
> if you want to create an argument that takes 2 parameters.

Yes, that was clearly my concern.

But let's see it in another way: first, do people want it in the
user-interface, and then, let's see if it's reasonably feasible in the
code.

> If you really wanted, you could just use ' ' as the separator. So
> you would have:
>
> bzr diff -??? "3 http://remote/branch"
>
> space can occur in paths, though :)

Yes, we're just comming back to the previous question : what's a good
delimiter ... Well, today, I think revsion spec can not contain
spaces, so we could use " " as a delimiter and search from the left.
Indeed, this is exactly my "revno:N:path", with a space instead of the
second ":".

> My personal favorite is still '<url>;<spec>'. It was discussed to use
> ',' but I use commas in my paths, and don't want to escape them to %2c
> all the time. I don't use ';' because it is a shell metacharacter.

You're saying that because you never use the {aaa,bbb} syntax of your
shell I suppose ;-).

-- 
Matthieu




More information about the bazaar mailing list