changeset 4308:a5cde03cd019

locate: don't print "file not found" messages. This should fix issue204.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Wed, 04 Apr 2007 04:22:06 -0300
parents 702f48570eb3
children d4f0405fadac
files mercurial/commands.py tests/test-locate tests/test-locate.out
diffstat 3 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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