[MERGE][#120050] Give and example of --fixes in the help for the option.
John Arbash Meinel
john at arbash-meinel.com
Wed Jul 30 18:14:45 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
James Westby wrote:
| On Wed, 2008-07-30 at 10:31 -0500, John Arbash Meinel wrote:
|> If you look at the code, it is doing:
|>
|> ~ try:
|> ~ bug_url = bugtracker.get_bug_url(tag, branch, bug_id)
|> ~ except errors.UnknownBugTrackerAbbreviation:
|> ~ raise errors.BzrCommandError(
|> ~ 'Unrecognized bug %s. Commit refused.' % fixed_bug)
|> ~ except errors.MalformedBugIdentifier:
|> ~ raise errors.BzrCommandError(
|> ~ "Invalid bug identifier for %s. Commit refused."
|> ~ % fixed_bug)
|>
|> So it is catching your exception and re-wrapping them with a less
|> helpful one.
|
| Nice catch, I was fooled by the tests. I hadn't actually tried it,
| oops.
|
| It seems like it may be better to not do this and use the underlying
| exceptions.
|
| I guess the "Commit refused" part is wanted though to make it clear
| to users that they haven't committed and need to try again.
|
| Would something like
|
| try:
| ...
| except errors.MalformedBugIdentifier:
| self.outf.write("Commit Refused:\n")
| raise
|
| be frowned upon.
|
| I could just modify this in two places, but that seems
| wrong.
|
| Thanks,
|
| James
|
|
Well, you could do:
except errors.MalformedBugIdentifier, e:
~ raise BzrCommandError('%s\nCommit Refused' % (str(e),))
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkiQoYUACgkQJdeBCYSNAAPzrQCffsK3dlxLQdaxMvDvzE3WdPue
cU4AoLMixFc/bi/wy9jrzOPj/BMUmM9p
=lAWM
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list