[MERGE] Make pull more forgiving of its location

Robert Collins robertc at robertcollins.net
Mon Oct 29 18:56:16 GMT 2007


On Tue, 2007-09-11 at 04:34 -0500, Matthew D. Fuller wrote:
> I ran across a case earlier tonite where I wanted to reset the head of
> a branch, and the natural choice is "pull -rwhatever .".  That croaks
> unpleasantly if you're not in the root of the branch, though, since it
> just tries to open() the given location.  Attached fixes that.
> 
> It would be nice to use Branch.open_containing_from_transport() to
> solve it simply, but that's slightly hampered by the fact that the
> method doesn't exist.  Making it exist would be more work than I can
> bite off, and would need add'l tests and all, so I just did it
> manually.  Sorry.

I have some UI concerns here.
05:51 < lifeless> so there is a serious failure mode
05:51 < lifeless> projectA-branch/foo/project-B-branch
05:52 < lifeless> cd local-projectA; bzr
pull /projectA-branch/foo/project-B-branch --overwrite
05:52 < fullermd> Which is roughly why the test suite croaks on it.
05:52 < lifeless> now, if I am used to having to give the exact url, I
won't in scripts etc do that
05:53 < lifeless> if I don't know that the subdir is a nested tree
rather than a subdir this converts projectA-branch *into*
project-B-branch
05:53 < lifeless> which is really bad

I think I would want --overwrite to barf on unrelated branches and
require another flag to make it work (e.g. --overwrite --force) eep.
scary.

OTOH I can see the point that it is a little demanding to require that
you know the right url each time.

For your specific use case 'bzr pull --overwrite $(bzr root)' will work
trivially; uncommit && revert will work too, and I wonder if making
those possibilities more visible would be a reasonable answer here?

Anyone else care to weigh in ?

-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/20071030/274ef5d8/attachment.pgp 


More information about the bazaar mailing list