comparison mercurial/commands.py @ 4200:b5d1eaade333

Merge a bunch of matcher and locate fixes.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 10 Mar 2007 23:21:33 -0300
parents ba51a8225a60 1c69c73d85d9
children b2873c587b1a
comparison
equal deleted inserted replaced
4182:ba51a8225a60 4200:b5d1eaade333
1597 """locate files matching specific patterns 1597 """locate files matching specific patterns
1598 1598
1599 Print all files under Mercurial control whose names match the 1599 Print all files under Mercurial control whose names match the
1600 given patterns. 1600 given patterns.
1601 1601
1602 This command searches the current directory and its 1602 This command searches the entire repository by default. To search
1603 subdirectories. To search an entire repository, move to the root 1603 just the current directory and its subdirectories, use "--include .".
1604 of the repository.
1605 1604
1606 If no patterns are given to match, this command prints all file 1605 If no patterns are given to match, this command prints all file
1607 names. 1606 names.
1608 1607
1609 If you want to feed the output of this command into the "xargs" 1608 If you want to feed the output of this command into the "xargs"
1616 if rev: 1615 if rev:
1617 node = repo.lookup(rev) 1616 node = repo.lookup(rev)
1618 else: 1617 else:
1619 node = None 1618 node = None
1620 1619
1620 ret = 1
1621 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts, node=node, 1621 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts, node=node,
1622 head='(?:.*/|)'): 1622 default='relglob'):
1623 if not node and repo.dirstate.state(abs) == '?': 1623 if not node and repo.dirstate.state(abs) == '?':
1624 continue 1624 continue
1625 if opts['fullpath']: 1625 if opts['fullpath']:
1626 ui.write(os.path.join(repo.root, abs), end) 1626 ui.write(os.path.join(repo.root, abs), end)
1627 else: 1627 else:
1628 ui.write(((pats and rel) or abs), end) 1628 ui.write(((pats and rel) or abs), end)
1629 ret = 0
1630
1631 return ret
1629 1632
1630 def log(ui, repo, *pats, **opts): 1633 def log(ui, repo, *pats, **opts):
1631 """show revision history of entire repository or files 1634 """show revision history of entire repository or files
1632 1635
1633 Print the revision history of the specified files or the entire 1636 Print the revision history of the specified files or the entire