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

John Arbash Meinel john at arbash-meinel.com
Mon Aug 14 15:58:42 BST 2006


Matthieu Moy wrote:
> Hi,
> 
> In the past, I've brought this topic several times in this mailing
> list. The basic problem is that the revision specifiers do not allow
> one to deal with a remote revision. The typical problem is: take two
> arbitrary remote revisions. bzrlib knows how to diff them, but up to
> recently, it was not exported in the UI at all.
> 
> There are roughly 3 ways to deal with it:
> 
> 1) Extend the revisionspec to deal with remote locations. That's what
>    I implemented allowing one to do "diff -r revno:42:http://branch.com/"
> 
> 2) Extend URL to deal with revisions. There used to be a syntax for
>    this which has been pulled out (http://location.com/path/@3 IIRC)
> 
> 3) Keep URL and revision spec distinct, and ask both to be provided on
>    the command line.
> 
> 

...

>   URL;<revspec>
>   This has been proposed by someone else a long time ago. I don't
>   remember if it was only URL;revno=N, URL;revid=id or any revision
>   spec like URL;date:yesterday though.
>   Drawback: Shell metacharacter
>             Ambiguous in some cases, URL can contain a ';'.

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, 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', I know it
handles 'bzr foo -r branch:../../foobar' but that might only be because
of the slashes.

...

>   $ bzr diff -r 3 -R 4 http://remote/branch
> 
> 
> I'm willing to spend some time on an implementation if the team agrees
> on a specification.
> 
> Any comments/flames/better proposals are welcome.

Especially with switching over to optparse, you will need to be careful
if you want to create an argument that takes 2 parameters. 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 :)

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.

But doing 'bzr diff http://remote/branch\;revid:foo' is easier to type
than using parenthesis, etc.

If there is a real ';' in the path, we already support having it be
specified as '%3b', which would have to happen in a real http url.

John
=:->

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


More information about the bazaar mailing list