[PATCH] Using relative paths in branch references (bug #330086)

John Arbash Meinel john at arbash-meinel.com
Mon Feb 16 15:10:54 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> For my plugin (scmproj) I need to use relative paths to master branch
> in lightweight checkouts. This patch provides new parameter to
> set_reference()
> use_relpath to write reference as relative path, and also properly support
> for relative references in get_reference().
> 
> I found only one direct test in bt.test_branch, so I've added there
> new direct test for relative paths scenario.
> 

Unfortunately, this change:

     def get_reference(self, a_bzrdir):
         """See BranchFormat.get_reference()."""
         transport = a_bzrdir.get_branch_transport(None)
- -        return transport.get('location').read()
+        return urlutils.join(a_bzrdir.root_transport.base,
+            transport.get('location').read())


means that older clients will fail to properly handle the new paths.
Which means we should really only do it with a branch format bump. And
if we do that, IMO we should probably always use a relative path. (We do
this for the 'parent' field and for the stacked-on branch.)

I do like the idea, but compatibility states that these new branches
will break for old clients. Perhaps someone else thinks we could be more
lenient?

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmZgf4ACgkQJdeBCYSNAAPO6ACglHC5B5tdlz51hphT5VLvvEXh
plYAoJ3y/YxqnuPdynzh4k6go5OFTIRy
=PFvU
-----END PGP SIGNATURE-----



More information about the bazaar mailing list