comparison mercurial/commands.py @ 4190:e8ee8fdeddb1

change locate to use relglobs by default This makes its default behaviour useful again (issue108), and changes it search the entire repository by default (instead of just the cwd), just like all other commands. It also hides issue204 by default, but you'll still see the same behaviour if you give it a relpath: pattern.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 10 Mar 2007 23:00:57 -0300
parents a2335e832e16
children 1c69c73d85d9
comparison
equal deleted inserted replaced
4189:8e947b0e53cc 4190:e8ee8fdeddb1
1600 """locate files matching specific patterns 1600 """locate files matching specific patterns
1601 1601
1602 Print all files under Mercurial control whose names match the 1602 Print all files under Mercurial control whose names match the
1603 given patterns. 1603 given patterns.
1604 1604
1605 This command searches the current directory and its 1605 This command searches the entire repository by default. To search
1606 subdirectories. To search an entire repository, move to the root 1606 just the current directory and its subdirectories, use "--include .".
1607 of the repository.
1608 1607
1609 If no patterns are given to match, this command prints all file 1608 If no patterns are given to match, this command prints all file
1610 names. 1609 names.
1611 1610
1612 If you want to feed the output of this command into the "xargs" 1611 If you want to feed the output of this command into the "xargs"
1620 node = repo.lookup(rev) 1619 node = repo.lookup(rev)
1621 else: 1620 else:
1622 node = None 1621 node = None
1623 1622
1624 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts, node=node, 1623 for src, abs, rel, exact in cmdutil.walk(repo, pats, opts, node=node,
1625 head='(?:.*/|)'): 1624 default='relglob'):
1626 if not node and repo.dirstate.state(abs) == '?': 1625 if not node and repo.dirstate.state(abs) == '?':
1627 continue 1626 continue
1628 if opts['fullpath']: 1627 if opts['fullpath']:
1629 ui.write(os.path.join(repo.root, abs), end) 1628 ui.write(os.path.join(repo.root, abs), end)
1630 else: 1629 else: