Patchwork [1,of,7] walkchangerevs: simplify with an 'elif'

login
register
mail settings
Submitter Martin von Zweigbergk
Date May 21, 2015, 9:32 p.m.
Message ID <2d9c6fe9c552ede353ad.1432243948@waste.org>
Download mbox | patch
Permalink /patch/9221/
State Accepted
Delegated to: Augie Fackler
Headers show

Comments

Martin von Zweigbergk - May 21, 2015, 9:32 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1432243224 25200
#      Thu May 21 14:20:24 2015 -0700
# Node ID 2d9c6fe9c552ede353adb4df22da54fddac7b320
# Parent  aa36204766e4bc510d2e24d7279f6bc989b613bb
walkchangerevs: simplify with an 'elif'

Since 'match.files()' is interchangeable with 'not match.files()', we
can simplify with an 'elif' follwoing the 'if match.always()'.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1761,8 +1761,7 @@ 
     if match.always():
         # No files, no patterns.  Display all revs.
         wanted = revs
-
-    if not slowpath and match.files():
+    elif not slowpath:
         # We only have to read through the filelog to find wanted revisions
 
         try: