[PATCH 6 of 7] dirstate: use match.prefix() instead of 'not match.anypats()'
Martin von Zweigbergk
martinvonz at google.com
Thu May 21 16:32:33 CDT 2015
# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1432057240 25200
# Tue May 19 10:40:40 2015 -0700
# Node ID 57b2ad183735e615d30fce568c3612c83fae4f42
# Parent 769c0f5320b6eed726b54cad7623ff078ae80677
dirstate: use match.prefix() instead of 'not match.anypats()'
It seems clearer to check for what it is than what it isn't.
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -985,7 +985,7 @@
# fast path -- filter the other way around, since typically files is
# much smaller than dmap
return [f for f in files if f in dmap]
- if not match.anypats() and all(fn in dmap for fn in files):
+ if match.prefix() and all(fn in dmap for fn in files):
# fast path -- all the values are known to be files, so just return
# that
return list(files)
More information about the Mercurial-devel
mailing list