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

Alexander Belchenko bialix at ukr.net
Mon Feb 16 15:25:28 GMT 2009


John Arbash Meinel пишет:
> 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.

Current clients already can't properly handle relative paths.
The bug #330086 claims this fact.

My patch don't break old clients. They're already broken.

> Which means we should really only do it with a branch format bump.

This too much trouble for such simple change. In the end I can monkey-patch
old client from my plugin. So if others devs think the same, it's better
to bb:reject this patch.

> 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.)

No, I don't think so. Master branch for lightweight checkout could use
different transport (sftp:// vs file://).

> I do like the idea, but compatibility states that these new branches
> will break for old clients.

Sorry, I don't want to break anything. It does not work in the way I need,
so may be this is by design, I dunno.

> Perhaps someone else thinks we could be more
> lenient?
> 
> John
> =:->




More information about the bazaar mailing list