diff --git a/doc/hg.1.txt b/doc/hg.1.txt --- a/doc/hg.1.txt +++ b/doc/hg.1.txt @@ -33,7 +33,8 @@ COMMAND ELEMENTS ---------------- files ...:: - indicates one or more filename or relative path filenames + indicates one or more filename or relative path filenames; see + "FILE NAME PATTERNS" for information on pattern matching path:: indicates a path on the local machine @@ -51,11 +52,14 @@ repository path:: COMMANDS -------- -add [files ...]:: +add [options] [files ...]:: Schedule files to be version controlled and added to the repository. The files will be added to the repository at the next commit. + If no names are given, add all files in the current directory and + its subdirectory. + addremove:: Add all new files and remove all missing files from the repository. @@ -183,14 +187,10 @@ import [-p -b -q] :: init:: Initialize a new repository in the current directory. -locate [options] [patterns]:: - Print all files under Mercurial control whose basenames match the +locate [options] [files]:: + Print all files under Mercurial control whose names match the given patterns. - Patterns are shell-style globs. To restrict searches to specific - directories, use the "-i " option. To eliminate particular - directories from searching, use the "-x " option. - This command searches the current directory and its subdirectories. To search an entire repository, move to the root of the repository. @@ -207,9 +207,9 @@ locate [options] [patterns]:: -0, --print0 end filenames with NUL, for use with xargs -f, --fullpath print complete paths from the filesystem root - -i, --include include directories matching the given globs + -I, --include include directories matching the given patterns -r, --rev search the repository as it stood at rev - -x, --exclude exclude directories matching the given globs + -X, --exclude exclude directories matching the given patterns log [-r revision ...] [-p] [file]:: Print the revision history of the specified file or the entire project. @@ -398,6 +398,52 @@ verify:: the changelog, manifest, and tracked files, as well as the integrity of their crosslinks and indices. +FILE NAME PATTERNS +------------------ + + Mercurial accepts several notations for identifying one or more + file at a time. + + By default, Mercurial treats file names as shell-style extended + glob patterns. + + Alternate pattern notations must be specified explicitly. + + To use a plain path name without any pattern matching, start a + name with "path:". These path names must match completely, from + the root of the current repository. + + To use an extended glob, start a name with "glob:". Globs are + rooted at the current directory; a glob such as "*.c" will match + files ending in ".c" in the current directory only. + + The supported glob syntax extensions are "**" to match any string + across path separators, and "{a,b}" to mean "a or b". + + To use a Perl/Python regular expression, start a name with "re:". + Regexp pattern matching is anchored at the root of the repository. + + Plain examples: + + path:foo/bar a name bar in a directory named foo in the root of + the repository + path:path:name a file or directory named "path:name" + + Glob examples: + + glob:*.c any name ending in ".c" in the current directory + *.c any name ending in ".c" in the current directory + **.c any name ending in ".c" in the current directory, or + any subdirectory + foo/*.c any name ending in ".c" in the directory foo + foo/**.c any name ending in ".c" in the directory foo, or any + subdirectory + + Regexp examples: + + re:.*\.c$ any name ending in ".c", anywhere in the repsitory + + SPECIFYING SINGLE REVISIONS ---------------------------