Confusion over locations

Barry Warsaw barry at canonical.com
Wed May 14 23:12:47 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I was recently confused about the behavior of 'bzr merge' so I asked  
Aaron a few questions on irc and he was quite helpful in explaining  
how things work.  However, it lead me to the following comments, but  
first a quick background.

I was confused by something like the following set of commands:

% cd my-shared-repo
% bzr branch upstream foo
% cd foo
% bzr merge

That last merge did not try to merge from ../upstream, but instead  
from the non-local sftp branch that is upstream's parent.  This  
despite the fact that I had a parent_location defined in ~/.bazaar/ 
locations.conf, and despite the fact that 'bzr info' showed me the  
parent url I expected.

Aaron explained that merge prefers submit_branch over parent_location  
if defined, which jived with the fact that my locations.conf defines a  
submit_branch pointing to the non-local branch.

However, this just caused more confusion because there appears to be  
no way to really know which configuration variables are used by which  
commands, and in which order.  Aaron went on to explain that afahk,  
submit_branch was used by merge, send, pqm-submit, '-r submit:' and an  
internal review-submit plugin.

So now the comments and questions.

One problem is that 'bzr help configuration' describes submit_branch  
and parent_location, but nowhere does it say which commands use  
submit_branch and in what preference order these variables are  
consulted.  In particular, submit_branch is not described as being  
used by merge by either 'help configuration' or 'help merge'. 'help  
merge' does say: "If neither is specified, the default is the upstream  
branch or the branch most recently merged using --remember".  Well, I  
would have thought the "upstream branch" would be the parent branch by  
default, or my-shared-repo in the example above.  Clearly that's wrong.

Further, it's confusing to me that 'bzr merge' uses submit_branch but  
'bzr pull' uses parent_branch.  In my own mental model of Bazaar,  
these two commands would calculate their default locations in exactly  
the same way.  Why is my model wrong?  ISTM that the most logical  
default location for 'bzr merge' is in fact parent_location, and  
that's almost always what I want.  Having to always override it is an  
annoying speed bump.

You might say, well, just change submit_branch, but that's not quite  
right either.  What if changing that breaks 'bzr send', 'bzr pqm- 
submit' or some other vital command I don't yet realize also uses that  
variable?  The overloaded use of submit_branch is problematic because  
there's no way to really know what uses it, and even if I did, I  
suspect that the different commands will conflict in what they want it  
to be set to. Then I'm in a bind and have to decide which command I  
really want to work right and which are okay to be broken.  I  
shouldn't have to be in that dilemma!

Finally, it would at least be nice if some ultra-verbose option would  
cause bzr to print out the algorithm it goes through to calculate the  
default location for any particular command.  That would have given me  
a more concrete indication of what was going wrong rather than having  
to deduce it from my settings and experimentation.

Anyway, rant over. :)  Hopefully I'm alone in my confusion and y'all  
will show me the light.

Cheers,
- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkgrY+EACgkQ2YZpQepbvXGS0ACcDK/c9Q/v9A/4gMSdusOF1KBA
E94An2+2CL+7unTUBFl62CBf8gQGUmU6
=8Yqr
-----END PGP SIGNATURE-----



More information about the bazaar mailing list