revset: remove redundant condition and change to else from elif
authorPulkit Goyal <7895pulkit@gmail.com>
Mon, 22 May 2017 01:38:00 +0530
changeset 32438 14482f8e6ce6
parent 32437 f03dcb3f95a5
child 32439 e72c5263ccaf
revset: remove redundant condition and change to else from elif Before going to this piece of code, we already check whether n is in [0, 1, 2], so dropping the redundant condition.
mercurial/revset.py
--- a/mercurial/revset.py	Mon May 22 01:35:53 2017 +0530
+++ b/mercurial/revset.py	Mon May 22 01:38:00 2017 +0530
@@ -1506,7 +1506,7 @@
                 ps.add(cl.parentrevs(r)[0])
             except error.WdirUnsupported:
                 ps.add(repo[r].parents()[0].rev())
-        elif n == 2:
+        else:
             try:
                 parents = cl.parentrevs(r)
                 if parents[1] != node.nullrev: