[MERGE] Exception when pulling from a location
John Arbash Meinel
john at arbash-meinel.com
Sat Feb 7 17:34:50 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Aaron Bentley wrote:
> John Arbash Meinel wrote:
>> We have a small bug in how 'bzr pull XXX' works. Basically, the first
>> thing we do is check to see if it is a 'mergeable' (aka bundle)
> nitpick: (aka bundle or merge directive)
> And it's hardly ever a bundle these days.
True, though I almost always call merge directives bundles because MD is
very unwieldy to actually use in conversation.
>> Ultimately, I think our logic is probably backwards. We should try to do
>> "Branch.open()" first, and then try "read_mergeable_from_url"
> If you do Branch.open, followed by read_mergeable_from_url, the result
> should be the same as if you do read_mergeable_from_url, then Branch.open.
> Why is one backwards and the other not?
Because the former will try to read from a directory, and is the
uncommon case. It also causes problems with HTTP servers that don't
support index listings, or cause redirections (like trying to GET
http://bazaar.launchpad.net/~foo/bar/baz/ will try to redirect you to
.../~foo/bar/baz/changes because that is what a web-browser should see.)
>> I think the reason we did it this way was because of
>> "Branch.open_containing()". If you supplied the path to a bundle, we
>> wouldn't want to open the containing branch.
> That's right, and it's more acute for the merge command, because you can
> specify a file to merge, so Branch.open_containing must be used.
> In the case where the specified file is versioned, and is a merge
> directive, should merge treat it as a versioned file, or as a merge
Versioning your merge directives is certainly an edge case that we could
support either way, or allow an explicit flag for what we want to do
I think doing a partial merge of a versioned merge directive is an even
further edge case, so I would officially say it should act as though the
MD wasn't versioned at all. In fact, the case I would originally try to
bzr send -o foo.patch
bzr merge ../orig/foo.patch
In this case "foo.patch" isn't versioned, but happens to be inside a
Still, for 'bzr pull' I think it makes the most sense to try as a
Branch.open() first, because it is unambiguous. I can respect that we
have a harder time with "bzr merge", though it would be nice to not get
Perhaps we could change the "read_mergeable_from_url" code to never
follow redirects? Or is that something people are going to want? (IMO
merge-directives are meant to be ephemeral, and not something that you
are going to go through the effort of setting up a redirect for.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the bazaar