[pqm-submit:MERGE] Remove default --message

John Arbash Meinel john at arbash-meinel.com
Tue Mar 18 01:46:06 GMT 2008


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

James Henstridge wrote:
> On 18/03/2008, John Arbash Meinel <john at arbash-meinel.com> wrote:
>>  > That does seem like a bug.  So you're changing it to do open() rather
>>  > than open_containing() if a path is provided?
>>  >
>>
>>
>> Well, it already had a check for "if relpath and not tree", I just
>>  changed it to "if relpath and not tree and location != '.'".
>>
>>  I believe what people want is the ability to be in a subdir and do "bzr
>>  pqm-submit". I'm fine with that. What we are turning off is any case of
>>  "bzr pqm-submit 'foo'" that doesn't directly refer to a branch.
> 
> Right.  With no argument, I'd expect the command to act on a the
> current branch (so do open_containing('.')).  If I pass a branch
> location though, I'd expect it to do open(location) instead.
> 
> This seems to be the heuristic that "bzr check" uses, but it does not
> seem consistent between commands :(
> 
> 
>>  So... effectively plain .open() but I just worked it into the way we are
>>  doing it now.
>>
>>  It is a bit complex because we want to open a working tree if it is
>>  available so that we can check it is clean. The way I would usually do
>>  that is:
> 
> Did you mean to write something extra here?

I was going to start writing something, but then I didn't bother. I
might be the only one who writes it this way, as Aaron seems to prefer
open_containing all the time.

Generally something like:

if location is None:
  try:
    tree = WT.open_containing('.')
  except ...:
    tree = None
    b = Branch.open('.')
  else:
    b = tree.branch
else:
  try:
    tree = WT.open(location)
  except ...:
    tree = None
    b = Branch.open(location)
  else:
    b = tree.b

It is a bit clumsy, and gets worse if you need an optional repository as
well. But except for commands like "bzr cat" I feel like you don't
really want Branch.open_containing()

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH3x7eJdeBCYSNAAMRApyjAKCbcGcUfLU9smoPO/DsVe9iIQuh/ACeM5Pd
l2gZUHJP+hAviK5pkiIffLg=
=YTyV
-----END PGP SIGNATURE-----



More information about the bazaar mailing list