diff mercurial/obsolete.py @ 40029:e2697acd9381

cleanup: some Yoda conditions, this patch removes It seems the factor 20 is less than the frequency of " < \d" compared to " \d > ". Differential Revision: https://phab.mercurial-scm.org/D4862
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 03 Oct 2018 10:27:44 -0700
parents 6335c0de80fa
children 208303a8172c
line wrap: on
line diff
--- a/mercurial/obsolete.py	Tue Oct 02 12:43:54 2018 -0700
+++ b/mercurial/obsolete.py	Wed Oct 03 10:27:44 2018 -0700
@@ -997,13 +997,13 @@
             if not isinstance(predecessors, tuple):
                 # preserve compat with old API until all caller are migrated
                 predecessors = (predecessors,)
-            if 1 < len(predecessors) and len(rel[1]) != 1:
+            if len(predecessors) > 1 and len(rel[1]) != 1:
                 msg = 'Fold markers can only have 1 successors, not %d'
                 raise error.ProgrammingError(msg % len(rel[1]))
             for prec in predecessors:
                 sucs = rel[1]
                 localmetadata = metadata.copy()
-                if 2 < len(rel):
+                if len(rel) > 2:
                     localmetadata.update(rel[2])
 
                 if not prec.mutable():