diff mercurial/localrepo.py @ 16144:4546a8513dcd stable

localrepository: use 'changectx.dirs()' in 'status()' for directory patterns when pattern which does not match against any files in working context is specified, current implementation of 'localrepository.status()' decides whether warning message about it should be shown or not by 'f not in context' this works correctly for 'file pattern', but not for 'directory pattern', because 'f not in context' always returns True for directories, even if they are related to the context. this patch uses 'changectx.dirs()' to examine whether specified pattern is related to the context as a directory or not.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Thu, 23 Feb 2012 00:07:54 +0900
parents ce0ad184f489
children a01d2fb5ba65 fa8488565afd
line wrap: on
line diff
--- a/mercurial/localrepo.py	Thu Feb 23 00:07:54 2012 +0900
+++ b/mercurial/localrepo.py	Thu Feb 23 00:07:54 2012 +0900
@@ -1351,7 +1351,9 @@
 
         if not parentworking:
             def bad(f, msg):
-                if f not in ctx1:
+                # 'f' may be a directory pattern from 'match.files()',
+                # so 'f not in ctx1' is not enough
+                if f not in ctx1 and f not in ctx1.dirs():
                     self.ui.warn('%s: %s\n' % (self.dirstate.pathto(f), msg))
             match.bad = bad