[PATCH 04 of 10] revset: remove redundant condition and change to else from elif

Pulkit Goyal 7895pulkit at gmail.com
Mon May 22 16:52:14 EDT 2017


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1495397280 -19800
#      Mon May 22 01:38:00 2017 +0530
# Node ID 7cb5bf075d4aa046f7b39149c720d63253d510d6
# Parent  a3b2977ae12717d214ca4f95a8816ca3339e5332
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.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -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:


More information about the Mercurial-devel mailing list