diff mercurial/commands.py @ 4191:1c69c73d85d9

locate: exit(1) if we didn't print any file
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 10 Mar 2007 23:00:58 -0300
parents e8ee8fdeddb1
children b5d1eaade333 e14b6980a014
line wrap: on
line diff
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1620,6 +1620,7 @@ def locate(ui, repo, *pats, **opts):
     else:
         node = None
 
+    ret = 1
     for src, abs, rel, exact in cmdutil.walk(repo, pats, opts, node=node,
                                              default='relglob'):
         if not node and repo.dirstate.state(abs) == '?':
@@ -1628,6 +1629,9 @@ def locate(ui, repo, *pats, **opts):
             ui.write(os.path.join(repo.root, abs), end)
         else:
             ui.write(((pats and rel) or abs), end)
+        ret = 0
+
+    return ret
 
 def log(ui, repo, *pats, **opts):
     """show revision history of entire repository or files