[PATCH 7 of 7] manifest: use match.prefix() instead of 'not match.anypats()'

Martin von Zweigbergk martinvonz at google.com
Thu May 21 16:32:34 CDT 2015


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1432059380 25200
#      Tue May 19 11:16:20 2015 -0700
# Node ID a29d1e1d2fd02cf09f25ccb26c1ca1cc919e01eb
# Parent  57b2ad183735e615d30fce568c3612c83fae4f42
manifest: 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/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -219,7 +219,7 @@
         files instead of over manifest files.'''
         files = match.files()
         return (len(files) < 100 and (match.isexact() or
-            (not match.anypats() and all(fn in self for fn in files))))
+            (match.prefix() and all(fn in self for fn in files))))
 
     def walk(self, match):
         '''Generates matching file names.


More information about the Mercurial-devel mailing list