Rev 4707: (mbp) better messages about missing extensions in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Sat Sep 19 02:33:15 BST 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4707 [merge]
revision-id: pqm at pqm.ubuntu.com-20090919013310-4lds9snxescbsxed
parent: pqm at pqm.ubuntu.com-20090919003214-2dli9jc4y5xhjj3n
parent: mbp at sourcefrog.net-20090917064943-7p1pu84qb4zw8165
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sat 2009-09-19 02:33:10 +0100
message:
(mbp) better messages about missing extensions
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/osutils.py osutils.py-20050309040759-eeaff12fbf77ac86
bzrlib/tests/test_osutils.py test_osutils.py-20051201224856-e48ee24c12182989
=== modified file 'NEWS'
--- a/NEWS 2009-09-18 15:08:09 +0000
+++ b/NEWS 2009-09-19 01:33:10 +0000
@@ -90,7 +90,7 @@
* Make sure that we unlock the tree if we fail to create a TreeTransform
object when doing a merge, and there is limbo, or pending-deletions
directory. (Gary van der Merwe, #427773)
-
+
* Prevent some kinds of incomplete data from being committed to a 2a
repository, such as revisions without inventories or inventories without
chk_bytes root records.
@@ -112,7 +112,8 @@
running using pure-Python versions, but this may be substantially
slower. The warning can be disabled by setting
``ignore_missing_extensions = True`` in ``bazaar.conf``.
- (Martin Pool, #406113)
+ See also <https://answers.launchpad.net/bzr/+faq/703>.
+ (Martin Pool, #406113, #430529)
Documentation
*************
=== modified file 'bzrlib/osutils.py'
--- a/bzrlib/osutils.py 2009-09-16 11:59:14 +0000
+++ b/bzrlib/osutils.py 2009-09-19 01:33:10 +0000
@@ -920,12 +920,13 @@
if GlobalConfig().get_user_option_as_bool('ignore_missing_extensions'):
return
# the warnings framework should by default show this only once
- warnings.warn(
- "bzr: warning: Failed to load compiled extensions:\n"
- " %s\n"
- " Bazaar can run, but performance may be reduced.\n"
- " Check Bazaar is correctly installed or set ignore_missing_extensions"
- % '\n '.join(_extension_load_failures,))
+ from bzrlib.trace import warning
+ warning(
+ "bzr: warning: some compiled extensions could not be loaded; "
+ "see <https://answers.launchpad.net/bzr/+faq/703>")
+ # we no longer show the specific missing extensions here, because it makes
+ # the message too long and scary - see
+ # https://bugs.launchpad.net/bzr/+bug/430529
try:
=== modified file 'bzrlib/tests/test_osutils.py'
--- a/bzrlib/tests/test_osutils.py 2009-09-11 06:36:50 +0000
+++ b/bzrlib/tests/test_osutils.py 2009-09-17 06:49:43 +0000
@@ -29,6 +29,7 @@
errors,
osutils,
tests,
+ trace,
win32utils,
)
from bzrlib.tests import (
@@ -1824,7 +1825,19 @@
self.assertEquals(osutils._extension_load_failures[0],
"No module named _fictional_extension_py")
- def test_report_extension_load_failures(self):
+ def test_report_extension_load_failures_no_warning(self):
self.assertTrue(self._try_loading())
warnings, result = self.callCatchWarnings(osutils.report_extension_load_failures)
- self.assertLength(1, warnings)
+ # it used to give a Python warning; it no longer does
+ self.assertLength(0, warnings)
+
+ def test_report_extension_load_failures_message(self):
+ log = StringIO()
+ trace.push_log_file(log)
+ self.assertTrue(self._try_loading())
+ osutils.report_extension_load_failures()
+ self.assertContainsRe(
+ log.getvalue(),
+ r"bzr: warning: some compiled extensions could not be loaded; "
+ "see <https://answers\.launchpad\.net/bzr/\+faq/703>\n"
+ )
More information about the bazaar-commits
mailing list