locate: don't print "file not found" messages.
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Wed, 04 Apr 2007 04:22:06 -0300
changeset 4308 a5cde03cd019
parent 4307 702f48570eb3
child 4309 d4f0405fadac
locate: don't print "file not found" messages. This should fix issue204.
mercurial/commands.py
tests/test-locate
tests/test-locate.out
--- a/mercurial/commands.py	Wed Apr 04 04:22:06 2007 -0300
+++ b/mercurial/commands.py	Wed Apr 04 04:22:06 2007 -0300
@@ -1624,7 +1624,10 @@
 
     ret = 1
     for src, abs, rel, exact in cmdutil.walk(repo, pats, opts, node=node,
+                                             badmatch=util.always,
                                              default='relglob'):
+        if src == 'b':
+            continue
         if not node and repo.dirstate.state(abs) == '?':
             continue
         if opts['fullpath']:
--- a/tests/test-locate	Wed Apr 04 04:22:06 2007 -0300
+++ b/tests/test-locate	Wed Apr 04 04:22:06 2007 -0300
@@ -30,9 +30,11 @@
 hg ci -m m -d "1000000 0"
 hglocate a
 hglocate NONEXISTENT
+hglocate relpath:NONEXISTENT
 hglocate
 hglocate -r 0 a
 hglocate -r 0 NONEXISTENT
+hglocate -r 0 relpath:NONEXISTENT
 hglocate -r 0
 echo % -I/-X with relative path should work
 cd t
--- a/tests/test-locate.out	Wed Apr 04 04:22:06 2007 -0300
+++ b/tests/test-locate.out	Wed Apr 04 04:22:06 2007 -0300
@@ -25,6 +25,8 @@
 
 hg locate NONEXISTENT
 
+hg locate relpath:NONEXISTENT
+
 hg locate 
 b
 dir.h/foo
@@ -38,6 +40,8 @@
 
 hg locate -r 0 NONEXISTENT
 
+hg locate -r 0 relpath:NONEXISTENT
+
 hg locate -r 0
 a
 b