diff mercurial/commands.py @ 1622:5e9168401a68

fix locate broken since 63799b01985c - fix the keyword arguments for walk in commands.locate - implement 'hg locate -r <rev>' - add a test for 'hg locate'
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Mon, 16 Jan 2006 15:51:09 +0100
parents 1ba0d7041ac4
children e1bcf7fa983f
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Jan 12 21:55:19 2006 +0100
+++ b/mercurial/commands.py	Mon Jan 16 15:51:09 2006 +0100
@@ -1531,9 +1531,15 @@
     that contain white space as multiple filenames.
     """
     end = opts['print0'] and '\0' or '\n'
+    rev = opts['rev']
+    if rev:
+        node = repo.lookup(rev)
+    else:
+        node = None
 
-    for src, abs, rel, exact in walk(repo, pats, opts, '(?:.*/|)'):
-        if repo.dirstate.state(abs) == '?':
+    for src, abs, rel, exact in walk(repo, pats, opts, node=node,
+                                     head='(?:.*/|)'):
+        if not node and repo.dirstate.state(abs) == '?':
             continue
         if opts['fullpath']:
             ui.write(os.path.join(repo.root, abs), end)