[PATCH 4 of 5] revpair: drop useless conditional
pierre-yves.david at ens-lyon.org
pierre-yves.david at ens-lyon.org
Fri Mar 21 18:28:07 UTC 2014
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1395362042 25200
# Thu Mar 20 17:34:02 2014 -0700
# Node ID 61b1fac1c97bcae7b851b2f3407d8a1f080dfc0b
# Parent a2ee878b4dc367f62f9461761f3cd2ec33bd912c
revpair: drop useless conditional
The `if not revs:` case is tested at the beginning of the function.
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -469,13 +469,11 @@ def revpair(repo, revs):
return repo.dirstate.p1(), None
l = revrange(repo, revs)
if len(l) == 0:
- if revs:
- raise util.Abort(_('empty revision range'))
- return repo.dirstate.p1(), None
+ raise util.Abort(_('empty revision range'))
if len(l) == 1 and len(revs) == 1 and _revrangesep not in revs[0]:
return repo.lookup(l[0]), None
return repo.lookup(l[0]), repo.lookup(l[-1])
More information about the Mercurial-devel
mailing list