diff mercurial/dispatch.py @ 18224:0f9013112eba stable

dispatch: handle empty `testedwith` value in extension When extensions had an empty `testedwith` attribute the code tried to parse it and failed. As a result the actual error were shallowed by a This crash. We now treat empty strip as 'unknown'
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 04 Jan 2013 19:06:42 +0100
parents 434e5bd615fc
children 720308f741cb
line wrap: on
line diff
--- a/mercurial/dispatch.py	Wed Jan 02 13:59:07 2013 +0100
+++ b/mercurial/dispatch.py	Fri Jan 04 19:06:42 2013 +0100
@@ -217,11 +217,11 @@
         ct = tuplever(compare)
         worst = None, ct, ''
         for name, mod in extensions.extensions():
-            testedwith = getattr(mod, 'testedwith', 'unknown')
+            testedwith = getattr(mod, 'testedwith', '')
             report = getattr(mod, 'buglink', _('the extension author.'))
-            if testedwith == 'unknown':
+            if not testedwith.strip():
                 # We found an untested extension. It's likely the culprit.
-                worst = name, testedwith, report
+                worst = name, 'unknown', report
                 break
             if compare not in testedwith.split() and testedwith != 'internal':
                 tested = [tuplever(v) for v in testedwith.split()]