changeset 26262:3e79ec0ba589

dispatch: pre-indent the extensions blaming logic We are about to put some real conditional here, but pre-indenting in it's own changesets makes next patch much cleaner.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 17 Sep 2015 11:50:55 -0700
parents 8fb92ff63ccf
children bf2bfc6f45fb
files mercurial/dispatch.py
diffstat 1 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Thu Sep 17 07:49:18 2015 -0400
+++ b/mercurial/dispatch.py	Thu Sep 17 11:50:55 2015 -0700
@@ -335,26 +335,27 @@
         compare = myver.split('+')[0]
         ct = tuplever(compare)
         worst = None, ct, ''
-        for name, mod in extensions.extensions():
-            testedwith = getattr(mod, 'testedwith', '')
-            report = getattr(mod, 'buglink', _('the extension author.'))
-            if not testedwith.strip():
-                # We found an untested extension. It's likely the culprit.
-                worst = name, 'unknown', report
-                break
+        if True:
+            for name, mod in extensions.extensions():
+                testedwith = getattr(mod, 'testedwith', '')
+                report = getattr(mod, 'buglink', _('the extension author.'))
+                if not testedwith.strip():
+                    # We found an untested extension. It's likely the culprit.
+                    worst = name, 'unknown', report
+                    break
 
-            # Never blame on extensions bundled with Mercurial.
-            if testedwith == 'internal':
-                continue
+                # Never blame on extensions bundled with Mercurial.
+                if testedwith == 'internal':
+                    continue
 
-            tested = [tuplever(t) for t in testedwith.split()]
-            if ct in tested:
-                continue
+                tested = [tuplever(t) for t in testedwith.split()]
+                if ct in tested:
+                    continue
 
-            lower = [t for t in tested if t < ct]
-            nearest = max(lower or tested)
-            if worst[0] is None or nearest < worst[1]:
-                worst = name, nearest, report
+                lower = [t for t in tested if t < ct]
+                nearest = max(lower or tested)
+                if worst[0] is None or nearest < worst[1]:
+                    worst = name, nearest, report
         if worst[0] is not None:
             name, testedwith, report = worst
             if not isinstance(testedwith, str):