diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -28,6 +28,19 @@ def add(ui, repo, *pats, **opts): undo an add before that, see hg forget. If no names are given, add all files to the repository. + + .. container:: verbose + + An example showing how new (unknown) files are added + automatically by ``hg add``:: + + $ ls + foo.c + $ hg status + ? foo.c + $ hg add + adding foo.c + $ hg status """ bad = [] diff --git a/tests/test-help b/tests/test-help --- a/tests/test-help +++ b/tests/test-help @@ -10,6 +10,9 @@ hg -v help shortlist | sed 's/[(]version hg add -h +echo %% verbose help for add +hg add -hv + echo %% test help option with version option hg add -h --version | sed 's/[(]version [^)]*[)]/(version xxx)/' diff --git a/tests/test-help.out b/tests/test-help.out --- a/tests/test-help.out +++ b/tests/test-help.out @@ -243,6 +243,8 @@ add the specified files on the next comm If no names are given, add all files to the repository. +use "hg -v help add" to show verbose help + options: -I --include include names matching the given patterns @@ -250,6 +252,51 @@ options: -n --dry-run do not perform actions, just print output use "hg -v help add" to show global options +%% verbose help for add +hg add [OPTION]... [FILE]... + +add the specified files on the next commit + + Schedule files to be version controlled and added to the repository. + + The files will be added to the repository at the next commit. To undo an + add before that, see hg forget. + + If no names are given, add all files to the repository. + + An example showing how new (unknown) files are added automatically by "hg + add": + + $ ls + foo.c + $ hg status + ? foo.c + $ hg add + adding foo.c + $ hg status + +options: + + -I --include include names matching the given patterns + -X --exclude exclude names matching the given patterns + -n --dry-run do not perform actions, just print output + +global options: + -R --repository repository root directory or name of overlay bundle file + --cwd change working directory + -y --noninteractive do not prompt, assume 'yes' for any required answers + -q --quiet suppress output + -v --verbose enable additional output + --config set/override config option + --debug enable debugging output + --debugger start debugger + --encoding set the charset encoding (default: ascii) + --encodingmode set the charset encoding mode (default: strict) + --traceback always print a traceback on exception + --time time how long the command takes + --profile print command execution profile + --version output version information and exit + -h --help display help and exit %% test help option with version option Mercurial Distributed SCM (version xxx) @@ -268,6 +315,8 @@ add the specified files on the next comm If no names are given, add all files to the repository. +use "hg -v help add" to show verbose help + options: -I --include include names matching the given patterns @@ -287,6 +336,8 @@ add the specified files on the next comm If no names are given, add all files to the repository. +use "hg -v help add" to show verbose help + options: -I --include include names matching the given patterns