[MERGE] 1.5? Suppress DeprecationWarning in official releases
John Arbash Meinel
john at arbash-meinel.com
Thu May 15 17:07:10 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This patch changes bzr so that it will suppress deprecation warnings if it is a
"final" release. The idea is that people running old plugins, etc, shouldn't get
warnings in their face if they just upgraded to the latest official 1.X release.
However, if they are running a development version, or running a release
candidate then they get the warnings.
I felt it was a good trade off. Because people who are running an RC or DEV are
inherently "testing" stuff.
The patch doesn't come with tests, because I didn't know how to test it. The
problem is that it has to do with how Python itself handles the warnings. In our
test suite, we actually usually replace the call to 'warnings.warn' with our own
function when testing for warnings.
The best I could come up with, would be to artificially create a command which
issues a deprecation warning, and then check the output of
"run_bzr_subprocesses". However, you also need to hack the bzrlib.version_info
for that subprocess, because it needs to think it is/isn't an official release.
If someone has a good way for me to test it, I'll do it. But the patch is small,
and provides a good benefit. I would even consider merging it for 1.5.
I *did* test it manually, that if I set the version info to 'final' the
deprecation warnings from a plugin are not issued.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkgsX64ACgkQJdeBCYSNAAPjgwCfbouGPjYPLiXwVCNDe1qij1TX
HZcAni04M2i/gm2IQWz8PA082GvsZYiI
=zyPx
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dep_warnings.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20080515/112d11df/attachment-0001.diff
More information about the bazaar
mailing list