comparison 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
comparison
equal deleted inserted replaced
1621:ee16f06174bd 1622:5e9168401a68
1529 command, use the "-0" option to both this command and "xargs". 1529 command, use the "-0" option to both this command and "xargs".
1530 This will avoid the problem of "xargs" treating single filenames 1530 This will avoid the problem of "xargs" treating single filenames
1531 that contain white space as multiple filenames. 1531 that contain white space as multiple filenames.
1532 """ 1532 """
1533 end = opts['print0'] and '\0' or '\n' 1533 end = opts['print0'] and '\0' or '\n'
1534 1534 rev = opts['rev']
1535 for src, abs, rel, exact in walk(repo, pats, opts, '(?:.*/|)'): 1535 if rev:
1536 if repo.dirstate.state(abs) == '?': 1536 node = repo.lookup(rev)
1537 else:
1538 node = None
1539
1540 for src, abs, rel, exact in walk(repo, pats, opts, node=node,
1541 head='(?:.*/|)'):
1542 if not node and repo.dirstate.state(abs) == '?':
1537 continue 1543 continue
1538 if opts['fullpath']: 1544 if opts['fullpath']:
1539 ui.write(os.path.join(repo.root, abs), end) 1545 ui.write(os.path.join(repo.root, abs), end)
1540 else: 1546 else:
1541 ui.write(rel, end) 1547 ui.write(rel, end)