Patchwork [5,of,5] walkchangerevs: simplify by using match.always() method

login
register
mail settings
Submitter Martin von Zweigbergk
Date March 18, 2015, 8:27 p.m.
Message ID <c6ebc49ee55d61c1951f.1426710464@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/8151/
State Accepted
Commit 5cb459dc32d209653a3e5d77749cf989ab9a51e4
Headers show

Comments

Martin von Zweigbergk - March 18, 2015, 8:27 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1414560738 25200
#      Tue Oct 28 22:32:18 2014 -0700
# Node ID c6ebc49ee55d61c1951ffa385c799f0ca2d1ad8f
# Parent  a4576dc64143c7500e17a933e709a568b50ebb90
walkchangerevs: simplify by using match.always() method

Since "slowpath = match.anypats() or (match.files() and
opts.get('removed'))", we can simplify the condition "not slowpath and
not match.files()" to "not match.anypats() and not match.files()",
which is equivalent to "match.always()".
Matt Mackall - March 18, 2015, 10:22 p.m.
On Wed, 2015-03-18 at 13:27 -0700, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1414560738 25200
> #      Tue Oct 28 22:32:18 2014 -0700
> # Node ID c6ebc49ee55d61c1951ffa385c799f0ca2d1ad8f
> # Parent  a4576dc64143c7500e17a933e709a568b50ebb90
> walkchangerevs: simplify by using match.always() method

These are queued for default, thanks.

Patch

diff -r a4576dc64143 -r c6ebc49ee55d mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Tue Oct 28 22:43:59 2014 -0700
+++ b/mercurial/cmdutil.py	Tue Oct 28 22:32:18 2014 -0700
@@ -1692,7 +1692,7 @@ 
     # wanted: a cache of filenames that were changed (ctx.files()) and that
     # match the file filtering conditions.
 
-    if not slowpath and not match.files():
+    if match.always():
         # No files, no patterns.  Display all revs.
         wanted = revs