[MERGE] Exception when pulling from a location
John Arbash Meinel
john at arbash-meinel.com
Thu Feb 5 20:56:34 GMT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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), and
then if we find it is not, we then switch and try it as a branch.
Ultimately, I think our logic is probably backwards. We should try to do
"Branch.open()" first, and then try "read_mergeable_from_url"
afterwards. 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.
Anyway, the specific bugs I'm fixing here is:
1) We were checking if, filename.endswith('/'), but because of how
Transport.relpath is implemented, that will never be true. The original
check was meant to be that you could use "bzr pull ../foo/" and we would
know it wasn't a file, but a directory, so I switched that around.
2) When the connection failed, we would raise a ConnectionError, but
this was being trapped and raised as a NotABundle. Which wasn't a big
problem, except a side effect of "read_mergeable_from_url" is to
populate the "possible_transports" list with a new entry for the
transport it used to read the bundle.
Which meant that if we got an abort on the connection, we would still
attempt to re-use the connection to do a later Branch.open()
So this patch is just about not translating the connection failure into
a NotABundle, and just letting it propagate normally.
I would be interested if someone wants to invert the mergeable logic in
'cmd_pull.run()' but I'm not going to work on that right now.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmLUoIACgkQJdeBCYSNAAMeZACbBe4O5LjGWmmULYeNio2dY0MC
k2gAnRIgAdrpch+qaVGhXyTN679Rib1Q
=mVeJ
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pull_mergeable.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20090205/52d20bdc/attachment.diff
More information about the bazaar
mailing list