[MERGE] `bzr switch` now finds the sibling of the bound branch of a heavy checkout when passed a location that does not immediately resolve to a branch.
John Arbash Meinel
john at arbash-meinel.com
Mon Aug 4 15:51:33 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Adrian Wilkins wrote:
|
| A small change ; bzr switch did not follow my expectations of behaviour
| after reading the help, with heavy checkouts.
|
| Instead of looking for a sibling of the bound branch, it looks for a
| sibling of the checkout itself. This is a divergence from it's behaviour
| for lightweight checkouts, where it looks for a sibling of the bound
branch.
|
| First revision tests it, second revision fixes it.
|
| While this does stop switch from finding siblings of heavyweight
| checkouts intentionally, I'd not interpret that as being the intention
| of the feature (and it's very easy to type ../ , not so easy to get the
| bound branch location from bzr info, copy the URI, and
| infer the sibling location).
|
BB:tweak
I think the *intent* is good (to switch to a sibling of the master
branch). I would just recommend doing it slightly differently:
this_branch = control_dir.open_branch()
master_branch = this_branch.get_master_branch()
if master_branch is not None:
~ this_branch = master_branch
Alternatively, I'm not *positive* that you need to open the master
branch at all, since we are just trying a URL at this point. What about:
this_branch = control_dir.open_branch()
this_url = this_branch.get_bound_location()
if this_url is None:
~ this_url = this_branch.base
I probably prefer the latter, because there shouldn't be a need to open
the master branch again. (It will be done as part of switch checking it
has valid source/target/etc.)
It is also a shame that all of this logic is in the cmd_switch object,
as it should be in a helper. But that certainly isn't because of you.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkiXF3UACgkQJdeBCYSNAAPx2ACfWHV/GOFa38KpqSFEDpy2JymS
sK4An27FIWYKjQQ1J18lhYF46SNulT0K
=NXyB
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list