[PATCH 0 of 4] Add locate command

Bryan O'Sullivan bos at serpentine.com
Mon Jul 4 23:40:32 CDT 2005


Other SCM systems have a shorthand way of finding files under SCM
control using a pattern.  Now Mercurial does, too.

The locate command lets you search for files under Mercurial control
based on glob patterns.  It will not print files that aren't in the
manifest.

It operates from the current directory.  Here are a few examples:

$ hg locate '*.c' tags.tmpl
mercurial/bdiff.c
mercurial/mpatch.c
templates/tags.tmpl

$ hg locate '*git*'
contrib/git-viz/git-cat-file
contrib/git-viz/git-diff-tree
contrib/git-viz/git-rev-list
contrib/git-viz/git-rev-tree
contrib/hgit

$ hg locate --exclude '*/git-viz' '*git*'
contrib/hgit

	<b



More information about the Mercurial mailing list