thread names in urls (Re: Creating a branch other than master using bzr-git)

Robert Collins robertc at robertcollins.net
Mon Dec 1 06:51:43 GMT 2008


On Mon, 2008-12-01 at 17:35 +1100, Martin Pool wrote:

> I don't want to always be typing
> 
>   bzr switch \;doc

Neither do I; I don't think that that is implied.

Going back to basics, we have two broad cases for talking about branches
in user input.

'resolve something to a branch[or tree]'
'resolve something to a branch[or tree] and a relative path'

For the former, we could just treat everything in a url after the .bzr
directory is found as a branch qualifier. In fact, we could do that in
the second case as well.

http://example.com/somebzr/branchname/somepath

would resolve in code as:
probe .../somepath/.bzr
probe .../branchname/.bzr
probe .../somebzr/.bzr
try for a embedded branch of branchname/somepath, which would return
(EmbeddedBranch(branchname), somepath)

This clearly is a problem when somepath is both an embedded branch name
*and* a path.

Now, for the branch-only case, there is no ambiguity, because we are not
looking for paths in the input. Using '/;branch=foo/' avoids the
ambiguity always by being explicit.

Some options we could do:
 - infer, but allow url parameters to be used when there is a name
   collision
   'bzr cat doc'
   => 'cannot cat '' in branch $(pwd)/doc' or alternative it cats doc.
   'bzr cat ;branch='.'/doc'
   
   'bzr switch doc'
   => 'switched to branch doc'

 - infer with preference to the desired object time in the case
   of collisions - 
   'bzr switch doc' - works
   'bzr cat doc' - works (current branch)
   'bzr cat doc/doc' - works (grabs from doc branch)

I'd like something easy to use, but I'd also like there to be a standard
way to be completely explicit. So that in the event of bugs or confusion
we can control it from the command line, and also so that things that
output branches can do so reliably.
-Rob



-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20081201/ec94ef49/attachment.pgp 


More information about the bazaar mailing list