[MERGE] bundle commandline cleanup
John Arbash Meinel
john at arbash-meinel.com
Thu Jun 29 15:54:45 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Aaron Bentley wrote:
> John A Meinel wrote:
>>> + elif not base_specified:
>>> + note('Using saved location: %s' % base)
>>> + base_branch = Branch.open(base)
>>>
>>>
>>> ^- this should be:
>>>
>>> self.outf.write('Using saved location: %s\n'
>>> % urlutils.urlfordisplay(base, self.outf.encoding))
>
> Doesn't that mean it will go to stdout, not stderr?
You're right. You could instead do:
encoding = osutils.get_terminal_encoding()
encoded_url = urlutils.urlfordisplay(base, encoding).encode(encoding)
sys.stderr.write('Using saved location: %s\n' % (encoded_url,))
Its a little bit long, but it means you'll see a much nicer branch
location. (A local path if local, unicode path entries instead of %AA, etc).
But you are right, we should send it to stderr, not stdout. We probably
should fix up the other occurrences, and turn this into a fully fledged
helper function.
>
>>> ^- So why are you always pulling from 'last_revision()' rather than the
>>> base revision that was specified? Potentially they are not even the same
>>> ancestry.
>>> It is possible the user did:
>>>
>>> bzr bundle -r revid:...
>>> And that isn't related to the last_revision()
>
> I guess I'm set in my ways. I'll look at fixing that.
>
>>> v- I don't see anything in these tests that check the output of
>>> 'run_bzr' to make sure it isn't printing 'used saved location' twice.
>
> This is the bit that makes sure it only prints it once:
>>> + self.assertEqual(stderr.count('Using saved location'), 1)
>
> Aaron
Okay, I guess I didn't catch that part. I thought this had been merged,
and was disappointed when I tried to use it, and it failed again. :)
+1 after the fixes.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEo+m0JdeBCYSNAAMRAlupAJ4oDx+pX9C/pyNfH++z6LDSU3L+kgCfRnAL
iuhmQtwqYKV7gKayjFBp2iY=
=fi1K
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list