sapling/eden/scm/tests/test-help.t

1796 lines
59 KiB
Perl
Raw Normal View History

#chg-compatible
#require no-fsmonitor
Short help:
2010-08-27 18:25:47 +04:00
$ hg
Mercurial Distributed SCM
hg COMMAND [OPTIONS]
These are some common Mercurial commands. Use 'hg help commands' to list all
commands, and 'hg help COMMAND' to get help on a specific command.
Get the latest commits from the server:
2010-08-27 18:25:47 +04:00
pull pull changes from the specified source
View commits:
show show commit in detail
diff show differences between commits
Check out a commit:
checkout check out a specific commit
Work with your checkout:
status list files with pending changes
add start tracking the specified files
remove delete the specified tracked files
forget stop tracking the specified files
revert change the specified files to match a commit
purge delete untracked files
Commit changes and modify commits:
commit save all pending changes or specified files in a new commit
Rearrange commits:
graft copy commits from a different location
Undo changes:
uncommit uncommit part or all of the current commit
Other commands:
config show config settings
grep search for a pattern in tracked files in the working directory
Additional help topics:
filesets specifying files by their characteristics
glossary common terms
patterns specifying files by file name pattern
revisions specifying commits
templating customizing output with templates
2010-08-27 18:25:47 +04:00
$ hg -q
Mercurial Distributed SCM
hg COMMAND [OPTIONS]
These are some common Mercurial commands. Use 'hg help commands' to list all
commands, and 'hg help COMMAND' to get help on a specific command.
Get the latest commits from the server:
pull pull changes from the specified source
View commits:
show show commit in detail
diff show differences between commits
Check out a commit:
checkout check out a specific commit
Work with your checkout:
status list files with pending changes
add start tracking the specified files
remove delete the specified tracked files
forget stop tracking the specified files
revert change the specified files to match a commit
purge delete untracked files
Commit changes and modify commits:
commit save all pending changes or specified files in a new commit
Rearrange commits:
graft copy commits from a different location
Undo changes:
uncommit uncommit part or all of the current commit
Other commands:
config show config settings
grep search for a pattern in tracked files in the working directory
Additional help topics:
filesets specifying files by their characteristics
glossary common terms
patterns specifying files by file name pattern
revisions specifying commits
templating customizing output with templates
2010-08-27 18:25:47 +04:00
$ hg help
Mercurial Distributed SCM
hg COMMAND [OPTIONS]
These are some common Mercurial commands. Use 'hg help commands' to list all
commands, and 'hg help COMMAND' to get help on a specific command.
Get the latest commits from the server:
2010-08-27 18:25:47 +04:00
pull pull changes from the specified source
View commits:
show show commit in detail
diff show differences between commits
Check out a commit:
checkout check out a specific commit
Work with your checkout:
status list files with pending changes
add start tracking the specified files
remove delete the specified tracked files
forget stop tracking the specified files
revert change the specified files to match a commit
purge delete untracked files
Commit changes and modify commits:
commit save all pending changes or specified files in a new commit
Rearrange commits:
graft copy commits from a different location
Undo changes:
uncommit uncommit part or all of the current commit
Other commands:
config show config settings
grep search for a pattern in tracked files in the working directory
Additional help topics:
filesets specifying files by their characteristics
glossary common terms
patterns specifying files by file name pattern
revisions specifying commits
templating customizing output with templates
2010-08-27 18:25:47 +04:00
$ hg -q help
Mercurial Distributed SCM
hg COMMAND [OPTIONS]
These are some common Mercurial commands. Use 'hg help commands' to list all
commands, and 'hg help COMMAND' to get help on a specific command.
Get the latest commits from the server:
pull pull changes from the specified source
View commits:
show show commit in detail
diff show differences between commits
Check out a commit:
checkout check out a specific commit
Work with your checkout:
status list files with pending changes
add start tracking the specified files
remove delete the specified tracked files
forget stop tracking the specified files
revert change the specified files to match a commit
purge delete untracked files
Commit changes and modify commits:
commit save all pending changes or specified files in a new commit
Rearrange commits:
graft copy commits from a different location
Undo changes:
uncommit uncommit part or all of the current commit
Other commands:
config show config settings
grep search for a pattern in tracked files in the working directory
Additional help topics:
filesets specifying files by their characteristics
glossary common terms
patterns specifying files by file name pattern
revisions specifying commits
templating customizing output with templates
2010-08-27 18:25:47 +04:00
Test extension help:
$ hg help extensions --config extensions.rebase= --config extensions.children=
Using Additional Features
"""""""""""""""""""""""""
Mercurial has the ability to add new features through the use of
extensions. Extensions may add new commands, add options to existing
commands, change the default behavior of commands, or implement hooks.
To enable the "foo" extension, either shipped with Mercurial or in the
Python search path, create an entry for it in your configuration file,
like this:
[extensions]
foo =
You may also specify the full path to an extension:
[extensions]
myfeature = ~/.hgext/myfeature.py
See 'hg help config' for more information on configuration files.
Extensions are not loaded by default for a variety of reasons: they can
increase startup overhead; they may be meant for advanced usage only; they
may provide potentially dangerous abilities (such as letting you destroy
or modify history); they might not be ready for prime time; or they may
alter some usual behaviors of stock Mercurial. It is thus up to the user
to activate extensions as needed.
To explicitly disable an extension enabled in a configuration file of
broader scope, prepend its path with !:
[extensions]
# disabling extension bar residing in /path/to/extension/bar.py
bar = !/path/to/extension/bar.py
# ditto, but no path was supplied for extension baz
baz = !
Enabled extensions:
conflictinfo
debugshell a python shell with repo, changelog & manifest objects
errorredirect
redirect error message
2018-01-13 03:58:28 +03:00
githelp try mapping git commands to Mercurial commands
lz4revlog store revlog deltas using lz4 compression
mergedriver custom merge drivers for autoresolved files
patchrmdir patch rmdir
progressfile allows users to have JSON progress bar information written
to a path
rebase command to move sets of revisions to a different ancestor
eden accelerated hg functionality in Eden checkouts (eden !)
remotefilelog
minimize and speed up large repositories
sampling (no help text available)
treemanifest
Disabled extensions:
absorb apply working directory changes to changesets
amend extends the existing commit amend functionality
arcdiff (no help text available)
blackbox log repository events to a blackbox for debugging
catnotate (no help text available)
checkmessagehook
(no help text available)
checkserverbookmark
(no help text available)
chistedit
clienttelemetry
provide information about the client in server telemetry
clindex (no help text available)
clonebundles advertise pre-generated bundles to seed clones
commitcloud: incorporate infinitepush backups into commitcloud Summary: Merge the functionality of the infinitepushbackup extension (backing up commits to commit cloud) into the commitcloud extension. These two extensions are highly coupled, and the commitcloud extension monkey-patches the infinitepushbackup extension for a lot of its functionality. There is also a lot of code duplication between the two extensions which we can remove if they are part of the same extension. The infinitepushbackup commands (`hg pushbackup`, ...) are moved to subcommands of the `hg cloud` command, e.g. `hg cloud backup`. Each feature of the infinitepushbackup extension is moved to a new module in the commit cloud extension: The `background` module controls background execution of `hg cloud backup` and `hg cloud sync`. The `backupbookmarks` module tracks and updates scratch bookmarks for backups. This will be deprecated in the future. The `backupstate` module tracks whether or not a commit has been backed up. This is now tracked separately from backup bookmarks in a new file: `.hg/commitcloud/backedupheads.<remote-identifier>`. This also covers hidden commits, preventing a re-backup of previously backed up commits when they are unhidden. Previously the commitcloud extension customized the smartlog annotations: `Backing up` became `Syncing`, etc. This is now removed for consistency. Previously the infinitepushbackup extension disabled background backup by injecting an `infinitepushbackup.disableduntil` config entry into the user's config. This is now replaced with a state file at `.hg/commitcloud/autobackup`. Either option can be set to disable auto backup. Commit cloud will wait until both have expired before starting to run background backups again. Reviewed By: DurhamG Differential Revision: D15276939 fbshipit-source-id: 1d28989a157286e47d3dd97ca9c70b27f692dda1
2019-05-20 16:11:59 +03:00
commitcloud back up and sync changesets via the cloud
convert import revisions from foreign VCS repositories into
Mercurial
copytrace extension that does copytracing fast
crdump (no help text available)
debugcommitmessage
(no help text available)
debugnetwork test network connections to the server
dialect replace terms with more widely used equivalents
dirsync
disablesymlinks
disables symlink support when enabled
drop drop specified changeset from the stack
edrecord (no help text available)
eol automatically manage newlines in repository files
extdiff command to allow external programs to compare revisions
extorder
extutil (no help text available)
fastannotate yet another annotate implementation that might be faster
fastlog
fbhistedit extends the existing histedit functionality
fbscmquery (no help text available)
generic_bisect
(no help text available)
gitlookup extension that will look up hashes from an hg-git map file
over the wire.
gitrevset map a git hash to a Mercurial hash:
globalrevs extension for providing strictly increasing revision
numbers
gpg commands to sign and verify changesets
grepdiff (no help text available)
grpcheck check if the user is in specified groups
Split out a new hgevents extension from fsmonitor. Summary: This splits out the logic in the `fsmonitor` extension that is responsible for publishing `hg.filemerge` and `hg.update` state changes to Watchman into its own extension, `hgevents`. This is because we want the behavior of `hgevents` when Hg is running in Eden, but we do not want the remaining behavior of `fsmonitor` when Hg is running in Eden, so splitting the logic into separate extensions is the most straightforward way to achieve that. To achieve the split, we move some more logic that is common to both `fsmonitor` and `hgevents` out of `hgext/fsmonitor/__init__.py` and into `hgext/extlib/watchmanclient/__init__.py`. Then we move these lines out of `extsetup()` in `fsmonitor` to create `extsetup()` in `hgevents`: ``` extensions.wrapfunction(merge, 'update', wrapupdate) extensions.wrapfunction(filemerge, '_xmerge', _xmerge) ``` We also have to pull all of the transitive dependencies for this logic into `hgevents`. Finally, we also have to define a `reposetup()` function in `hgevents` that does a subset of what `reposetup()` does in `fsmonitor`. Specifically, it ensures that a Watchman client is created for a `repo`, as appropriate, so that it can be used to dispatch state changes to Watchman in `state_filemerge` and `state_update`. Note that the utility functions `createclientforrepo()` and `getclientforrepo()` have been added to ensure that only one Watchman client is created (and shared) when both `fsmonitor` and `hgevents` are enabled. Today, when an Hg repo is created in Eden, we set `extensions.fsmonitor=!` in the `.hg/hgrc`: diffusion/FBS/browse/master/fbcode/eden/hooks/hg/post-clone.py$69 Therefore, to get existing repos (both Eden and non-Eden) to pick up the `hgevents` extension automatically, we add it to the list of `[extensions]` in `common.rc`: diffusion/FBS/browse/master/fbcode/scm/hg/fb/staticfiles/etc/mercurial/repo-specific/common.rc$53-60 as this is where `fsmonitor` is configured. We do not enable it in `scm/hg/fb/staticfiles/etc/mercurial/facebook.rc` because there is no reason to enable `hgevents` on Hg servers. Therefore, we also decline to add `hgevents` to the set of `DEFAULT_EXTENSIONS` in `scm/hg/mercurial/extensions.py`. Reviewed By: quark-zju Differential Revision: D8003628 fbshipit-source-id: 4f23881f8c25f4638f5475c292537b0352ae8d15
2018-05-21 19:27:36 +03:00
hgevents publishes state-enter and state-leave events to Watchman
hggit push and pull from a Git server
hgsql sync hg repos with MySQL
highlight syntax highlighting for hgweb (requires Pygments)
histedit interactive history editing
infinitepush store draft commits in the cloud
infinitepushbackup
back up draft commits in the cloud
interactiveui
(no help text available)
logginghelper
this extension logs different pieces of information that
will be used
memcommit make commits without a working copy
morestatus make status give a bit more context
myparent
ownercheck prevent operations on repos not owned by the current user
perfsuite (no help text available)
phabdiff (no help text available)
phabstatus (no help text available)
phrevset provides support for Phabricator revsets
pullcreatemarkers
pushrebase rebases commits during push
rage upload useful diagnostics and give instructions for asking
for help
remotenames mercurial extension for improving client/server workflows
repogenerator
(no help text available)
reset reset the active bookmark and working copy to a desired
revision
schemes extend schemes with shortcuts to repository swarms
share share a common history between several working directories
shelve save and restore changes to the working directory
sigtrace sigtrace - dump stack and memory traces on signal
simplecache
smartlog command to display a relevant subgraph
snapshot extension to snapshot the working copy
sparse allow sparse checkouts of the working directory
sshaskpass ssh-askpass implementation that works with chg
stablerev provide a way to expose the "stable" commit via a revset
stat (no help text available)
traceprof (no help text available)
tweakdefaults
user friendly defaults
undo (no help text available)
whereami (no help text available)
win32mbcs allow the use of MBCS paths with problematic encodings
Verify that extension keywords appear in help templates
$ hg help --config extensions.phabdiff= templating|grep phabdiff > /dev/null
Normal help for add
2010-08-27 18:25:47 +04:00
$ hg add -h
hg add [OPTION]... [FILE]...
start tracking the specified files
2010-08-27 18:25:47 +04:00
Specify files to be tracked by Mercurial. The files will be added to the
repository at the next commit.
2010-08-27 18:25:47 +04:00
To undo an add before files have been committed, use 'hg forget'. To undo
an add after files have been committed, use 'hg rm'.
2010-08-27 18:25:47 +04:00
2015-12-17 17:53:40 +03:00
If no names are given, add all files to the repository (except files
matching ".hgignore").
2010-08-27 18:25:47 +04:00
Returns 0 if all files are successfully added.
Options ([+] can be repeated):
2010-08-27 18:25:47 +04:00
2011-09-21 22:00:48 +04:00
-I --include PATTERN [+] include names matching the given patterns
-X --exclude PATTERN [+] exclude names matching the given patterns
help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
2016-10-09 04:11:18 +03:00
-n --dry-run do not perform actions, just print output
2010-08-27 18:25:47 +04:00
(some details hidden, use --verbose to show complete help)
2010-08-27 18:25:47 +04:00
Verbose help for add
$ hg add -hv
hg add [OPTION]... [FILE]...
start tracking the specified files
2010-08-27 18:25:47 +04:00
Specify files to be tracked by Mercurial. The files will be added to the
repository at the next commit.
2010-08-27 18:25:47 +04:00
To undo an add before files have been committed, use 'hg forget'. To undo
an add after files have been committed, use 'hg rm'.
2010-08-27 18:25:47 +04:00
2015-12-17 17:53:40 +03:00
If no names are given, add all files to the repository (except files
matching ".hgignore").
2010-08-27 18:25:47 +04:00
2015-11-25 20:10:31 +03:00
Examples:
- New (unknown) files are added automatically by 'hg add':
2015-11-25 20:10:31 +03:00
$ ls
foo.c
$ hg status
? foo.c
$ hg add
adding foo.c
$ hg status
A foo.c
- Specific files to be added can be specified:
$ ls
bar.c foo.c
$ hg status
? bar.c
? foo.c
$ hg add bar.c
$ hg status
A bar.c
? foo.c
2010-08-27 18:25:47 +04:00
Returns 0 if all files are successfully added.
Options ([+] can be repeated):
2010-08-27 18:25:47 +04:00
2011-09-21 22:00:48 +04:00
-I --include PATTERN [+] include names matching the given patterns
-X --exclude PATTERN [+] exclude names matching the given patterns
help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
2016-10-09 04:11:18 +03:00
-n --dry-run do not perform actions, just print output
2011-09-21 22:00:48 +04:00
Global options ([+] can be repeated):
2011-09-21 22:00:48 +04:00
encoding: use correct output encoding on windows Summary: On Windows, there are *two* 8-bit encodings for each process. * The ANSI code page is used for all `...A` system calls, and this is what Mercurial uses internally. It can be overridden using the `--encoding` command line option. * The OEM code page is used when outputing to the console. Mercurial has no concept of this, and instead renders to the console using the ANSI code page, which results in mojibake like "Θ" instead of "é". Add the concept of an `outputencoding`. If this differs from `encoding`, we convert from the local encoding to the output encoding before writing to the console. On non-Windows platforms, this defaults to the same encoding as the local encoding, so this is a no-op unless `--outputencoding` is manually specified. On Windows, this defaults to the codepage given by `GetOEMCP`, causing output to be converted to the OEM codepage before being printed. For ordinary strings, the local encoded version is wrapped by `localstr` if the encoding does not round-trip cleanly. This means the output encoding works even if the character is not represented in the local encoding. Unfortunately, the templater is not localstr-clean, which means strings can get flattened down to the local encoding and the original code points are lost. In this case we can only output characters which are in the intersection of the encoding and the output encoding. Most US English Windows systems use cp1252 for the ANSI code page and cp437 for the OEM code page. These both contain many accented characters, so users with accented characters in their names will now see them correctly rendered. All of this only applies to Python 2.7. In Python 3, everything is Unicode, the `--encoding` and `--outputencoding` options do nothing, and it just works. Reviewed By: quark-zju, ikostia Differential Revision: D19951381 fbshipit-source-id: d5cb8b5bfe2bc131b2e6c3b892137a48b2139ca9
2020-02-20 15:27:06 +03:00
-R --repository REPO repository root directory or name of overlay
bundle file
--cwd DIR change working directory
-y --noninteractive do not prompt, automatically pick the first choice
for all prompts
-q --quiet suppress output
-v --verbose enable additional output
--color TYPE when to colorize (boolean, always, auto, never, or
debug)
--config CONFIG [+] set/override config option (use
'section.name=value')
--configfile FILE [+] enables the given config file
--debug enable debugging output
--debugger start debugger
--encoding ENCODE set the charset encoding (default: utf-8)
--encodingmode MODE set the charset encoding mode (default: strict)
--insecure do not verify server certificate
encoding: use correct output encoding on windows Summary: On Windows, there are *two* 8-bit encodings for each process. * The ANSI code page is used for all `...A` system calls, and this is what Mercurial uses internally. It can be overridden using the `--encoding` command line option. * The OEM code page is used when outputing to the console. Mercurial has no concept of this, and instead renders to the console using the ANSI code page, which results in mojibake like "Θ" instead of "é". Add the concept of an `outputencoding`. If this differs from `encoding`, we convert from the local encoding to the output encoding before writing to the console. On non-Windows platforms, this defaults to the same encoding as the local encoding, so this is a no-op unless `--outputencoding` is manually specified. On Windows, this defaults to the codepage given by `GetOEMCP`, causing output to be converted to the OEM codepage before being printed. For ordinary strings, the local encoded version is wrapped by `localstr` if the encoding does not round-trip cleanly. This means the output encoding works even if the character is not represented in the local encoding. Unfortunately, the templater is not localstr-clean, which means strings can get flattened down to the local encoding and the original code points are lost. In this case we can only output characters which are in the intersection of the encoding and the output encoding. Most US English Windows systems use cp1252 for the ANSI code page and cp437 for the OEM code page. These both contain many accented characters, so users with accented characters in their names will now see them correctly rendered. All of this only applies to Python 2.7. In Python 3, everything is Unicode, the `--encoding` and `--outputencoding` options do nothing, and it just works. Reviewed By: quark-zju, ikostia Differential Revision: D19951381 fbshipit-source-id: d5cb8b5bfe2bc131b2e6c3b892137a48b2139ca9
2020-02-20 15:27:06 +03:00
--outputencoding ENCODE set the output encoding (default: utf-8)
--traceback always print a traceback on exception
--trace enable more detailed tracing
encoding: use correct output encoding on windows Summary: On Windows, there are *two* 8-bit encodings for each process. * The ANSI code page is used for all `...A` system calls, and this is what Mercurial uses internally. It can be overridden using the `--encoding` command line option. * The OEM code page is used when outputing to the console. Mercurial has no concept of this, and instead renders to the console using the ANSI code page, which results in mojibake like "Θ" instead of "é". Add the concept of an `outputencoding`. If this differs from `encoding`, we convert from the local encoding to the output encoding before writing to the console. On non-Windows platforms, this defaults to the same encoding as the local encoding, so this is a no-op unless `--outputencoding` is manually specified. On Windows, this defaults to the codepage given by `GetOEMCP`, causing output to be converted to the OEM codepage before being printed. For ordinary strings, the local encoded version is wrapped by `localstr` if the encoding does not round-trip cleanly. This means the output encoding works even if the character is not represented in the local encoding. Unfortunately, the templater is not localstr-clean, which means strings can get flattened down to the local encoding and the original code points are lost. In this case we can only output characters which are in the intersection of the encoding and the output encoding. Most US English Windows systems use cp1252 for the ANSI code page and cp437 for the OEM code page. These both contain many accented characters, so users with accented characters in their names will now see them correctly rendered. All of this only applies to Python 2.7. In Python 3, everything is Unicode, the `--encoding` and `--outputencoding` options do nothing, and it just works. Reviewed By: quark-zju, ikostia Differential Revision: D19951381 fbshipit-source-id: d5cb8b5bfe2bc131b2e6c3b892137a48b2139ca9
2020-02-20 15:27:06 +03:00
--time time how long the command takes
--profile print command execution profile
--version output version information and exit
-h --help display help and exit
--hidden consider hidden changesets
--pager TYPE when to paginate (boolean, always, auto, or never)
(default: auto)
2010-08-27 18:25:47 +04:00
Test the textwidth config option
$ hg root -h --config ui.textwidth=50
hg root
print the root (top) of the current working
directory
Print the root directory of the current
repository.
Returns 0 on success.
Options:
--shared show root of the shared repo
(some details hidden, use --verbose to show
complete help)
Test help on a self-referencing alias that is a rust command
$ hg --config "alias.root=root --shared" help root
alias for: root --shared
hg root
print the root (top) of the current working directory
Print the root directory of the current repository.
Returns 0 on success.
Options:
--shared show root of the shared repo
(some details hidden, use --verbose to show complete help)
$ hg --config "alias.root=root --shared" root -h
alias for: root --shared
hg root
print the root (top) of the current working directory
Print the root directory of the current repository.
Returns 0 on success.
Options:
--shared show root of the shared repo
(some details hidden, use --verbose to show complete help)
2010-08-27 18:25:47 +04:00
Test help option with version option
$ hg add -h --version
EdenSCM * (glob)
2010-08-27 18:25:47 +04:00
$ hg add --skjdfks
hg add: option --skjdfks not recognized
(use 'hg add -h' to get help)
2010-09-17 02:51:32 +04:00
[255]
2010-08-27 18:25:47 +04:00
Test ambiguous command help
$ hg help ad
abort: no such help topic: ad
(try 'hg help --keyword ad')
[255]
2010-08-27 18:25:47 +04:00
Test command without options
$ hg help verify
hg verify
verify the integrity of the repository
Verify the integrity of the current repository.
This will perform an extensive check of the repository's integrity,
validating the hashes and checksums of each entry in the changelog,
manifest, and tracked files, as well as the integrity of their crosslinks
and indices.
2015-09-30 23:43:49 +03:00
Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
information about recovery from corruption of the repository.
2010-08-27 18:25:47 +04:00
Returns 0 on success, 1 if errors are encountered.
Manifest verification can be extremely slow on large repos, so it can be
disabled if "verify.skipmanifests" is True:
[verify]
skipmanifests = true
Options ([+] can be repeated):
-r --rev REV [+] verify the specified revision or revset
(some details hidden, use --verbose to show complete help)
2010-08-27 18:25:47 +04:00
$ hg help diff
hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
aliases: d
show differences between commits
2010-08-27 18:25:47 +04:00
Show the differences between two commits. If only one commit is specified,
shows the differences between the specified commit and your pending
changes. If no commits are specified, shows your pending changes.
2010-08-27 18:25:47 +04:00
Specify -c to see the changes in the specified commit relative to its
parent.
2010-08-27 18:25:47 +04:00
By default, this command skips binary files. To override this behavior,
specify -a to include binary files in the diff, probably with undesirable
results.
2010-08-27 18:25:47 +04:00
By default, diffs are shown using the unified diff format. Specify -g to
generate diffs in the git extended diff format. For more information, read
'hg help diffs'.
2010-08-27 18:25:47 +04:00
Note:
'hg diff' might generate unexpected results during merges because it
defaults to comparing against your checkout's first parent commit if no
commits are specified.
2010-08-27 18:25:47 +04:00
Returns 0 on success.
Options ([+] can be repeated):
2010-08-27 18:25:47 +04:00
help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
2016-10-09 04:11:18 +03:00
-r --rev REV [+] revision
-c --change REV change made by revision
-a --text treat all files as text
-g --git use git extended diff format
--binary generate binary diffs in git mode (default)
help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
2016-10-09 04:11:18 +03:00
--nodates omit dates from diff headers
--noprefix omit a/ and b/ prefixes from filenames
-p --show-function show which function each change is in
--reverse produce a diff that undoes the changes
-w --ignore-all-space ignore white space when comparing lines
-b --ignore-space-change ignore changes in the amount of white space
-B --ignore-blank-lines ignore changes whose lines are all blank
-Z --ignore-space-at-eol ignore changes in whitespace at EOL
help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
2016-10-09 04:11:18 +03:00
-U --unified NUM number of lines of context to show
--stat output diffstat-style summary of changes
--root DIR produce diffs relative to subdirectory
--only-files-in-revs only show changes for files modified in the
requested revisions
help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
2016-10-09 04:11:18 +03:00
-I --include PATTERN [+] include names matching the given patterns
-X --exclude PATTERN [+] exclude names matching the given patterns
2010-08-27 18:25:47 +04:00
(some details hidden, use --verbose to show complete help)
2010-08-27 18:25:47 +04:00
$ hg help status
hg status [OPTION]... [FILE]...
aliases: st
list files with pending changes
2010-08-27 18:25:47 +04:00
Show status of files in the repository using the following status
indicators:
2010-08-27 18:25:47 +04:00
M = modified
A = added
R = removed
C = clean
! = missing (deleted by a non-hg command, but still tracked)
2010-08-27 18:25:47 +04:00
? = not tracked
I = ignored
= origin of the previous file (with --copies)
2010-08-27 18:25:47 +04:00
By default, shows files that have been modified, added, removed, deleted,
or that are unknown (corresponding to the options -mardu). Files that are
unmodified, ignored, or the source of a copy/move operation are not
listed.
To control the exact statuses that are shown, specify the relevant flags
(like -rd to show only files that are removed or deleted). Additionally,
specify -q/--quiet to hide both unknown and ignored files.
To show the status of specific files, provide an explicit list of files to
match. To include or exclude files using regular expressions, use -I or
-X.
If --rev is specified, and only one revision is given, it is used as the
base revision. If two revisions are given, the differences between them
are shown. The --change option can also be used as a shortcut to list the
changed files of a revision from its first parent.
Note:
'hg status' might appear to disagree with 'hg diff' if permissions have
changed or a merge has occurred, because the standard diff format does
not report permission changes and 'hg diff' only reports changes
relative to one merge parent.
2010-08-27 18:25:47 +04:00
Returns 0 on success.
Options ([+] can be repeated):
2010-08-27 18:25:47 +04:00
help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
2016-10-09 04:11:18 +03:00
-A --all show status of all files
-m --modified show only modified files
-a --added show only added files
-r --removed show only removed files
-d --deleted show only deleted (but tracked) files
-c --clean show only files without changes
-u --unknown show only unknown (not tracked) files
-i --ignored show only ignored files
-n --no-status hide status prefix
-C --copies show source of copied files
-0 --print0 end filenames with NUL, for use with xargs
2011-09-21 22:00:48 +04:00
--rev REV [+] show difference from revision
--change REV list the changed files of a revision
-I --include PATTERN [+] include names matching the given patterns
-X --exclude PATTERN [+] exclude names matching the given patterns
2010-08-27 18:25:47 +04:00
(some details hidden, use --verbose to show complete help)
2010-08-27 18:25:47 +04:00
$ hg -q help status
hg status [OPTION]... [FILE]...
list files with pending changes
2010-08-27 18:25:47 +04:00
$ hg help foo
abort: no such help topic: foo
2016-09-21 02:47:46 +03:00
(try 'hg help --keyword foo')
2010-09-17 02:51:32 +04:00
[255]
2010-08-27 18:25:47 +04:00
$ hg skjdfks
unknown command 'skjdfks'
(use 'hg help' to get help)
2010-09-17 02:51:32 +04:00
[255]
2010-08-27 18:25:47 +04:00
Typoed command gives suggestion
$ hg puls
unknown command 'puls'
(use 'hg help' to get help)
[255]
Not enabled extension gets suggested
$ hg rebase
unknown command 'rebase'
(use 'hg help' to get help)
[255]
Disabled extension gets suggested
$ hg --config extensions.rebase=! rebase
unknown command 'rebase'
(use 'hg help' to get help)
[255]
Make sure that we don't run afoul of the help system thinking that
this is a section and erroring out weirdly.
$ hg .log
unknown command '.log'
(use 'hg help' to get help)
[255]
$ hg log.
unknown command 'log.'
(use 'hg help' to get help)
[255]
$ hg pu.lh
unknown command 'pu.lh'
(use 'hg help' to get help)
[255]
2010-08-27 18:25:47 +04:00
$ cat > helpext.py <<EOF
> import os
> from edenscm.mercurial import commands, registrar
2010-08-27 18:25:47 +04:00
>
> cmdtable = {}
> command = registrar.command(cmdtable)
>
> @command('nohelp',
> [('', 'longdesc', 3, 'x'*90),
> ('n', '', None, 'normal desc'),
> ('', 'newline', '', 'line1\nline2')],
> 'hg nohelp',
> norepo=True)
> @command('debugoptADV', [('', 'aopt', None, 'option is (ADVANCED)')])
> @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')])
> @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')])
2010-08-27 18:25:47 +04:00
> def nohelp(ui, *args, **kwargs):
> pass
>
2016-04-08 21:35:49 +03:00
> def uisetup(ui):
>
> ui.setconfig('alias', 'shellalias', '!echo hi', 'helpext')
> ui.setconfig('alias', 'hgalias', 'summary', 'helpext')
2010-08-27 18:25:47 +04:00
> EOF
$ echo '[extensions]' >> $HGRCPATH
$ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
2016-04-08 21:35:49 +03:00
Test for aliases
$ hg help hgalias
alias for: summary
hg summary [--remote]
2016-04-08 21:35:49 +03:00
commands: define prefixes as aliases Summary: At a recent team meeting we've decided to remove the command prefix matching behavior, as it can be really annoying for the Rust parser (since it needs to know all the names, but it wants to avoid spinning up Python). It's even more annoying for subcommand support. FWIW git does not have prefix matching. This diff adds various aliases to "roughly" keep the command prefix matching behavior. The list of aliases are obtained by this script in `hg dbsh`: def unique(prefix, names): m = __import__('edenscm.mercurial').mercurial try: return m.cmdutil.findcmd(prefix, m.commands.table, False)[0][0] in names except: return False nameslist=sorted([i.replace('^','') for i in m.commands.table]) aliases = {} for names in nameslist: names = names.split('|') for name in names: if name.startswith('debug'): continue for prefix in [name[:i] for i in xrange(1, len(name))]: if unique(prefix, names): aliases.setdefault(name, []).append(prefix) Debug commands, and commands that are rarely used are not changed, including: 'backfillmanifestrevlog': ['backfillm', 'backfillma', 'backfillman', 'backfillmani', 'backfillmanif', 'backfillmanife', 'backfillmanifes', 'backfillmanifest', 'backfillmanifestr', 'backfillmanifestre', 'backfillmanifestrev', 'backfillmanifestrevl', 'backfillmanifestrevlo'], 'backfilltree': ['backfillt', 'backfilltr', 'backfilltre']} 'blackbox': ['blac', 'black', 'blackb', 'blackbo'], 'cachemanifest': ['cac', 'cach', 'cache', 'cachem', 'cachema', 'cacheman', 'cachemani', 'cachemanif', 'cachemanife', 'cachemanifes'], 'chistedit': ['chi', 'chis', 'chist', 'chiste', 'chisted', 'chistedi'], 'clone': ['clon'], 'cloud': ['clou'], 'convert': ['conv', 'conve', 'conver'], 'copy': ['cop'], 'fastannotate': ['fa', 'fas', 'fast', 'fasta', 'fastan', 'fastann', 'fastanno', 'fastannot', 'fastannota', 'fastannotat'], 'fold': ['fol'], 'githelp': ['gi', 'git', 'gith', 'githe', 'githel'], 'histgrep': ['histg', 'histgr', 'histgre'], 'incoming': ['in', 'inc', 'inco', 'incom', 'incomi', 'incomin'], 'isbackedup': ['is', 'isb', 'isba', 'isbac', 'isback', 'isbacke', 'isbacked', 'isbackedu'], 'manifest': ['ma', 'man', 'mani', 'manif', 'manife', 'manifes'], 'outgoing': ['o', 'ou', 'out', 'outg', 'outgo', 'outgoi', 'outgoin'], 'prefetch': ['pref', 'prefe', 'prefet', 'prefetc'], 'prune': ['pru', 'prun'], 'pushbackup': ['pushb', 'pushba', 'pushbac', 'pushback', 'pushbacku'], 'rage': ['ra', 'rag'], 'record': ['recor'], 'recover': ['recov', 'recove'], 'redo': ['red'], 'repack': ['rep', 'repa', 'repac'], 'reset': ['rese'], 'rollback': ['rol', 'roll', 'rollb', 'rollba', 'rollbac'], 'root': ['roo'], 'serve': ['se', 'ser', 'serv'], 'share': ['sha', 'shar'], 'sparse': ['spa', 'spar', 'spars'], 'svn': ['sv'], 'undo': ['und'], 'unshare': ['unsha', 'unshar'], 'verifyremotefilelog': ['verifyr', 'verifyre', 'verifyrem', 'verifyremo', 'verifyremot', 'verifyremote', 'verifyremotef', 'verifyremotefi', 'verifyremotefil', 'verifyremotefile', 'verifyremotefilel', 'verifyremotefilelo'], Reviewed By: sfilipco Differential Revision: D17644676 fbshipit-source-id: f60f5e6810279b52f9a4a1e048eeb529a96bd735
2019-10-08 19:44:04 +03:00
aliases: su
2016-04-08 21:35:49 +03:00
summarize working directory state
This generates a brief summary of the working directory state, including
parents, branch, commit status, phase and available updates.
With the --remote option, this will check the default paths for incoming
and outgoing changes. This can be time-consuming.
Returns 0 on success.
Options:
2016-04-08 21:35:49 +03:00
help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
2016-10-09 04:11:18 +03:00
--remote check for push and pull
2016-04-08 21:35:49 +03:00
(some details hidden, use --verbose to show complete help)
$ hg help shellalias
alias for: debugrunshell --cmd=echo hi
hg debugrunshell
run a shell command
Options:
--cmd VALUE command to run
(some details hidden, use --verbose to show complete help)
2016-04-08 21:35:49 +03:00
2010-08-27 18:25:47 +04:00
Test command with no help text
$ hg help nohelp
hg nohelp
(no help text available)
Options:
--longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
2016-10-09 04:11:18 +03:00
-n -- normal desc
--newline VALUE line1 line2
(some details hidden, use --verbose to show complete help)
2010-08-27 18:25:47 +04:00
$ hg help -k nohelp
Commands:
nohelp hg nohelp
Extension Commands:
nohelp (no help text available)
Commands in disabled extensions gets suggested even if there is no help text
for the module itself.
$ hg help --config 'extensions.helpext=!'`pwd`/helpext.py nohelp
'nohelp' is provided by the following extension:
helpext (no help text available)
(use 'hg help extensions' for information on enabling extensions)
2010-08-27 18:25:47 +04:00
Test that default list of commands omits extension commands
$ hg help
Mercurial Distributed SCM
hg COMMAND [OPTIONS]
These are some common Mercurial commands. Use 'hg help commands' to list all
commands, and 'hg help COMMAND' to get help on a specific command.
Get the latest commits from the server:
2010-08-27 18:25:47 +04:00
pull pull changes from the specified source
View commits:
show show commit in detail
diff show differences between commits
Check out a commit:
checkout check out a specific commit
Work with your checkout:
status list files with pending changes
add start tracking the specified files
remove delete the specified tracked files
forget stop tracking the specified files
revert change the specified files to match a commit
purge delete untracked files
Commit changes and modify commits:
commit save all pending changes or specified files in a new commit
Rearrange commits:
graft copy commits from a different location
Undo changes:
uncommit uncommit part or all of the current commit
Other commands:
config show config settings
grep search for a pattern in tracked files in the working directory
Additional help topics:
filesets specifying files by their characteristics
glossary common terms
patterns specifying files by file name pattern
revisions specifying commits
templating customizing output with templates
2010-08-27 18:25:47 +04:00
Test list of internal help commands
$ hg help debug
Debug commands (internal and unsupported):
debug-args print arguments received
debugancestor
find the ancestor revision of two revisions in a given index
debugapplystreamclonebundle
apply a stream clone bundle file
debugbenchmark: add a command to benchmark revsets Summary: Provide a way to benchmark revsets, optionally on different backends. Some example benchmarks: On the linux.git repo: $ git clone https://github.com/torvalds/linux --filter=tree:0 -n # might need edit .git/config, set repositoryformat to 0 $ hg debuginitgit --git-dir=linux/.git linux-hg $ hg debugbenchmarkrevsets --cwd linux-hg -x v2.6.26 -Y v5.8 -m # x: bce7f793daec3e65ec5c5705d2457b81fe7b5725 (v2.6.26) # y: bcf876870b95592b52519ed4aafcf9d95999bc9c (v5.8) | revset \ backend | segments | revlog | revlog-cpy | |------------------|----------|--------|------------| | ancestor(x, x) | 0.1ms | 0.1ms | 0.1ms | | ancestor(x, y) | 0.1ms | 10ms | 11ms | | ancestors(x) | 0.2ms | 10ms | 264ms | | ancestors(y) | 0.2ms | 175ms | 3.0 s | | children(x) | 0.2ms | 12ms | 955ms | | children(y) | 0.2ms | 0.3ms | 54ms | | descendants(x) | 75ms | 164ms | 69ms | | descendants(y) | 1.6ms | 0.6ms | 0.7ms | | y % x | 0.2ms | 18ms | 863ms | | x::y | 75ms | 160ms | 68ms | | heads(_all()) | 0.1ms | 9.8ms | 843ms | | roots(_all()) | 0.5ms | 15ms | 1.6 s | On the git.git repo with lots of merges but relatively short history: # x: a3eb250f996bf5e12376ec88622c4ccaabf20ea8 (v0.99) # y: 4d4165b80d6b91a255e2847583bd4df98b5d54e1 (v2.9.5) | revset \ backend | segments | revlog | revlog-cpy | |------------------|----------|--------|------------| | ancestor(x, x) | 0.1ms | 0.1ms | 0.1ms | | ancestor(x, y) | 0.7ms | 0.6ms | 0.6ms | | ancestors(x) | 0.2ms | 0.4ms | 1.7ms | | ancestors(y) | 0.8ms | 4.4ms | 140ms | | children(x) | 0.2ms | 1.1ms | 75ms | | children(y) | 0.2ms | 0.4ms | 20ms | | descendants(x) | 16ms | 8.2ms | 2.9ms | | descendants(y) | 4.2ms | 1.8ms | 0.9ms | | y % x | 0.8ms | 1.2ms | 42ms | | x::y | 13ms | 5.8ms | 1.7ms | | heads(_all()) | 0.2ms | 0.6ms | 46ms | | roots(_all()) | 0.4ms | 1.0ms | 102ms | On large repo 1 with lots of drafts (and heads): # x: 94fccdcc90d52995bf47f1d9259372c290257420 (94fccdcc90 & public()) # y: afa87d815d528afadbe5622278e285346d5376f4 (afa87d81 & draft()) | revset \ backend | segments | revlog | revlog-cpy | |------------------|----------|--------|------------| | ancestor(x, x) | 0.1ms | 0.2ms | 0.1ms | | ancestor(x, y) | 0.1ms | 40ms | 62ms | | ancestors(x) | 0.2ms | 1.2 s | 6.8 s | | ancestors(y) | 0.2ms | 2.7 s | 16 s | | children(x) | 0.2ms | 52ms | 5.2 s | | children(y) | 0.2ms | 5.4ms | 357ms | | descendants(x) | 6.0ms | 616ms | 149ms | | descendants(y) | 1.0ms | 0.9ms | 1.5ms | | y % x | 0.2ms | 73ms | 4.2 s | | x::y | 2.3ms | 557ms | 159ms | | heads(_all()) | 184ms | 87ms | 10 s | | roots(_all()) | 22ms | 110ms | 16 s | On large repo 2 with mostly linear history: # x: a5b69b059257f732c3b06e5af4ace9fd58ba87e4 (10000) # y: e1e93ca550a89f7803e5a8fe5d388342c44bdd13 (e1e93ca5) | revset \ backend | segments | revlog | revlog-cpy | |------------------|----------|--------|------------| | ancestor(x, x) | 0.1ms | 0.1ms | 0.1ms | | ancestor(x, y) | 0.1ms | 354ms | 541ms | | ancestors(x) | 0.1ms | 1.1ms | 13ms | | ancestors(y) | 0.1ms | 16 s | 59 s | | children(x) | 0.1ms | 371ms | 32 s | | children(y) | 0.1ms | 0.1ms | 1.3 s | | descendants(x) | 0.3ms | 5.7 s | 1.3 s | | descendants(y) | 0.2ms | 0.2ms | 5.5ms | | y % x | 0.1ms | 583ms | 30 s | | x::y | 0.3ms | 5.7 s | 1.4 s | | heads(_all()) | 0.1ms | 317ms | 28 s | | roots(_all()) | 0.1ms | 493ms | 47 s | Notes about the segments backend: - Optimized for (common) ancestors calculation. - x::y, or descendants are sensitive to the number of merges. - descendants or heads are sensitive to the number of heads. - Not optimized for too many heads. But with narrow-heads, `descendants(x)` is re-written to `x::visible_heads()` and it could be less of an issue if heads are "narrowed". - More efficient IdDag implementation would improve performance by a constant time factor. Namely, having the Index pre-checksum the byte range would make it about 2x faster. Reviewed By: DurhamG Differential Revision: D23106173 fbshipit-source-id: b88770e2fc9f0f626bb65e214a83da1a0b927344
2020-08-27 01:26:49 +03:00
debugbenchmarkrevsets
benchmark revsets
debugbindag serialize dag to a compat binary format
debugbuilddag
builds a repo with a given DAG from scratch in the current
empty repo
debugbundle lists the contents of a bundle
debugcapabilities
lists the capabilities of a remote peer
debug: introduce binding layer for propagating error metadata to Python Summary: Implements based Rust-Python binding layer for error metadata propagation. We introduce a new type, `TaggedExceptionData`, which carries CommonMetadata and the original (without metadata) error message for a Rust Anyhow error. This class is passed to RustError and can be accessed in Python (somewhat awkwardly) via indexing: ``` except error.RustError as e: fault = e.args[0].fault() typename = e.args[0].typename() message = e.args[0].message() ``` As far as I can tell, due to limitations in cpython-rs, this can't be made more ergonomic without introducing a Python shim around the Rust binding layer, which could adapt the cpython-rs classes to use whatever API we'd like. Currently, anyhow errors that are not otherwise special-cased will be converted into RustError, with both the original error message and any attached metadata printed as shown below ``` abort: intentional error for debugging with message 'intentional_error' error has type name taggederror::IntentionalError and fault None ``` We can of course re-raise the error if desired to maintain the previous behavior for handling a RustError. If we'd like other, specialized Rust Python Exception types to carry metadata (such as `IndexedLogError`), we'll need to modify them to accept a `TaggedExceptionData` like `RustError`. Renamed the "cause an error in pure rust command" function to `debugcauserusterror`, and instead used the name `debugthrowrustexception` for a command which causes an error in rust which is converted to a Python exception across the binding layer. Introduced a simple integration test which exercises `debugthrowrustexception`. Added a basic handler for RustError to scmutil.py Reviewed By: DurhamG Differential Revision: D22517796 fbshipit-source-id: 0409489243fe739a26958aad48f608890eb93aa0
2020-07-17 05:28:04 +03:00
debugcauserusterror
cause an error to be generated in rust for testing error
handling
debugchangelog
show or migrate changelog backend
debugcheckcasecollisions
check for case collisions against a commit
debugcheckoutidentifier
display the current checkout unique identifier
debugcheckstate
validate the correctness of the current dirstate
debugcleanremotenames
remove non-essential remote bookmarks
debugcolor show available color, effects or style
debugcommands
list all available commands and options
debugcompactmetalog
compact the metalog by dropping history
debugcomplete
returns the completion list associated with the given command
debugcreatestreamclonebundle
create a stream clone bundle file
debugdag format the changelog or an index DAG as a concise textual
description
debugdata dump the contents of a data file revision
debugdatapack
(no help text available)
debugdate parse and display a date
debugdeltachain
dump information about delta chains in a revlog
debugdetectissues
various repository integrity and health checks. for automatic
remediation, use doctor.
debugdifftree
diff two trees
debugdirs list directories
debugdirstate
show the contents of the current dirstate
debugdiscovery
runs the changeset discovery protocol in isolation
debugdrawdag read an ASCII graph from stdin and create changesets
debugdryup Execute native checkout (update) without actually writing to
working copy
debugdumpindexedlog
dump indexedlog data
debugdumptrace
export tracing information
debugdynamicconfig
generate the dynamic configuration
debugedenimporthelper
Obtain data for edenfs
debugedenrunpostupdatehook
Run post-update hooks for edenfs
debugexistingcasecollisions
check for existing case collisions in a commit
debugextensions
show information about active extensions
debugfilerevision
dump internal metadata for given file revisions
debugfileset parse and apply a fileset specification
debugfsinfo show information detected about current filesystem
debugfsync call fsync on newly modified key storage files
debuggentrees
(no help text available)
debuggetbundle
retrieves a bundle from a repo
debuggetroottree
(no help text available)
debughistorypack
(no help text available)
debughttp check whether the EdenAPI server is reachable
debugignore display the combined ignore pattern and information about
ignored files
debugindex dump the contents of an index file
debugindexdot
dump an index DAG as a graphviz dot file
debugindexedlogdatastore
(no help text available)
debugindexedloghistorystore
(no help text available)
debuginitgit init a repo from a git backend
debuginstall test Mercurial installation
debugknown test whether node ids are known to a repo
debuglocks show or modify state of locks
debugmakepublic
make revisions public
debugmanifestdirs
print treemanifest id, and paths
debugmergestate
print merge state
debugmetalog show changes in commit graph over time
debugmetalogroots
list roots stored in metalog
debugmutation
display the mutation history (or future) of a commit
debugmutationfromobsmarkers
convert obsolescence markers to mutation records
debugnamecomplete
complete "names" - tags, open branch names, bookmark names
debugobsolete
create arbitrary obsolete marker
debugoptADV (no help text available)
debugoptDEP (no help text available)
debugoptEXP (no help text available)
debugpathcomplete
complete part or all of a tracked path
debugpickmergetool
examine which merge tool is chosen for specified file
debugpreviewbindag
print dag generated by debugbindag
debugprocesstree
show process tree related to hg
debugprogress
(no help text available)
debugpull test repo.pull interface
debugpushkey access the pushkey key/value protocol
debugpvec (no help text available)
debugpython run python interpreter
debugracyoutput
exercise racy stdout / stderr / progress outputs
debugreadauthforuri
(no help text available)
debugrebuildchangelog
rebuild changelog by recloning and copying draft commits
debugrebuilddirstate
rebuild the dirstate as it would look like for the given
revision
debugrebuildfncache
rebuild the fncache file
debugremotefilelog
(no help text available)
debugrename dump rename information
debugresetheads
reset heads of repo so it looks like after a fresh clone
debugrevlog show data and statistics about a revlog
debugrevspec parse and apply a revision specification
debugrunshell
run a shell command
debugscmstore
test file and tree fetching using scmstore
debugsegmentclone
clone a repository using segmented changelog
debugsendunbundle
Send unbundle wireproto command to a given server
debugsetparents
manually set the parents of the current working directory
debugshell (no help text available)
debugsmallcommitmetadata
store string metadata for a commit
debugssl test a secure connection to a server
debugstatus common performance issues for status
debugstore print information about blobstore
debugstrip strip commits and all their descendants from the repository
debugsuccessorssets
show set of successors for revision
debugtemplate
parse and apply a template
debugthrowexception
cause an intentional exception to be raised in the command
debugthrowrustbail
cause an error to be returned from rust and propagated to
python using bail
debugthrowrustexception
debug: introduce binding layer for propagating error metadata to Python Summary: Implements based Rust-Python binding layer for error metadata propagation. We introduce a new type, `TaggedExceptionData`, which carries CommonMetadata and the original (without metadata) error message for a Rust Anyhow error. This class is passed to RustError and can be accessed in Python (somewhat awkwardly) via indexing: ``` except error.RustError as e: fault = e.args[0].fault() typename = e.args[0].typename() message = e.args[0].message() ``` As far as I can tell, due to limitations in cpython-rs, this can't be made more ergonomic without introducing a Python shim around the Rust binding layer, which could adapt the cpython-rs classes to use whatever API we'd like. Currently, anyhow errors that are not otherwise special-cased will be converted into RustError, with both the original error message and any attached metadata printed as shown below ``` abort: intentional error for debugging with message 'intentional_error' error has type name taggederror::IntentionalError and fault None ``` We can of course re-raise the error if desired to maintain the previous behavior for handling a RustError. If we'd like other, specialized Rust Python Exception types to carry metadata (such as `IndexedLogError`), we'll need to modify them to accept a `TaggedExceptionData` like `RustError`. Renamed the "cause an error in pure rust command" function to `debugcauserusterror`, and instead used the name `debugthrowrustexception` for a command which causes an error in rust which is converted to a Python exception across the binding layer. Introduced a simple integration test which exercises `debugthrowrustexception`. Added a basic handler for RustError to scmutil.py Reviewed By: DurhamG Differential Revision: D22517796 fbshipit-source-id: 0409489243fe739a26958aad48f608890eb93aa0
2020-07-17 05:28:04 +03:00
cause an error to be returned from rust and propagated to
python
debugtreestate
manage treestate
debugupdatecaches
warm all known caches in the repository
debugvisibility
control visibility tracking
debugvisibleheads
print visible heads
debugwaitonprefetch
(no help text available)
debugwaitonrepack
(no help text available)
debugwalk show how files match on given patterns
debugwireargs
(no help text available)
2010-08-27 18:25:47 +04:00
Test list of commands with command with no help text
$ hg help helpext
helpext extension - no help text available
Commands:
2010-08-27 18:25:47 +04:00
help: format command and option list help using RST This patch changes the function which generates help text about commands and options to use RST formatting. Tables describing options have been formatted using RST table markup for some time already, so their appearance does not change. Command lists, however, change appearance. To format non-verbose command lists, RST field list markup was chosen, because it resembles the old format: <http://docutils.sourceforge.net/docs/user/rst/quickref.html#field-lists> In the old (hand-coded) format of non-verbose command lists, the left column is 12 characters wide. Our minirst implementation formats field lists with a left column 14 characters wide, so this patch changes the appearance of help output correspondingly: <http://markmail.org/message/krl4cxopsnii7s6z?q=mercurial+reinert+from:%22Olav+Reinert%22&page=2> The minirst markup most closely resembling the old verbose command lists is definition lists. But using it would cause a blank line to be inserted between each command definition, making the output excessively long, and no more useful than before. To avoid this, I chose to use field lists also for verbose command help, resulting in output like this example: add add the specified files on the next commit annotate, blame show changeset information by line for each file clone make a copy of an existing repository commit, ci commit the specified files or all outstanding changes diff diff repository (or selected files) export dump the header and diffs for one or more changesets forget forget the specified files on the next commit init create a new repository in the given directory log, history show revision history of entire repository or files merge merge working directory with another revision phase set or show the current phase name pull pull changes from the specified source push push changes to the specified destination qdiff diff of the current patch and subsequent modifications qinit init a new queue repository (DEPRECATED) qnew create a new patch qpop pop the current patch off the stack qpush push the next patch onto the stack qrefresh update the current patch remove, rm remove the specified files on the next commit serve start stand-alone webserver status, st show changed files in the working directory summary, sum summarize working directory state update, up, checkout, co update working directory (or switch revisions) This change is a move towards generating all help text as a list of strings marked up with RST.
2012-06-02 13:25:40 +04:00
nohelp (no help text available)
2010-08-27 18:25:47 +04:00
test advanced, deprecated and experimental options are hidden in command help
$ hg help debugoptADV
hg debugoptADV
(no help text available)
(some details hidden, use --verbose to show complete help)
$ hg help debugoptDEP
hg debugoptDEP
(no help text available)
(some details hidden, use --verbose to show complete help)
$ hg help debugoptEXP
hg debugoptEXP
(no help text available)
(some details hidden, use --verbose to show complete help)
test advanced, deprecated and experimental options are shown with -v
$ hg help -v debugoptADV | grep aopt
--aopt option is (ADVANCED)
$ hg help -v debugoptDEP | grep dopt
help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
2016-10-09 04:11:18 +03:00
--dopt option is (DEPRECATED)
$ hg help -v debugoptEXP | grep eopt
help: backout 6f89f03ad369 (mark boolean flags with [no-] in help) for now The ability to negate any boolean flags itself is great, but I think we are not ready to expose the help side of it yet. First, while there exist a handful of such flags whose default value can be changed (eg: git diff, patchwork confirmation), there is only a few of them. The users who benefit the most from this change are alias users and large installation that can deploy extension to change behavior (eg: facebook tweakdefault). So the majority of user who will be affected by a large change to command help that is not yet relevant to them. (I expect this to become relevant when ui.progressive start to exists). Below is an example of the impact of the new help on 'hg help diff': -r --rev REV [+] revision -c --change REV change made by revision -a --[no-]text treat all files as text -g --[no-]git use git extended diff format --[no-]nodates omit dates from diff headers --[no-]noprefix omit a/ and b/ prefixes from filenames -p --[no-]show-function show which function each change is in --[no-]reverse produce a diff that undoes the changes -w --[no-]ignore-all-space ignore white space when comparing lines -b --[no-]ignore-space-change ignore changes in the amount of white space -B --[no-]ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --[no-]stat output diffstat-style summary of changes --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --[no-]subrepos recurse into subrepositories Another issue with the current state of help, the default value for the flag is not conveyed to the user. For example in the 'backout' help, there is no real distinction between "--[no-]backup" (default to True) and "--[no-]keep" (default) to False: --[no-]backup no backups --[no-]keep do not modify working directory during strip In addition, I've discussed with Augie Fackler and the last batch of the work on this have burned him out quite some. Therefore he is not intending to perform any more work on this topic. Quoting him, he would rather see the help part backed out than spending more time on it. I do not think we are ready to expose this to users in 4.0 (freeze in a week), especially because we cannot expect quick improvement on these aspect as this topic no longer have an owner. We should be able to reintroduce that change in the future when someone get back on it and the main issues are solves: * Introduction of ui.progressive makes it relevant for a majority of user, * Current default value are efficiently conveyed to the user. (In addition, the excerpt from diff help show that we still have some issue with some negative option like '--nodates' so further improvement are probably welcome there.)
2016-10-09 04:11:18 +03:00
--eopt option is (EXPERIMENTAL)
#if gettext normal-layout
test deprecated option is hidden with translation with untranslated description
(use many globy for not failing on changed transaction)
$ LANGUAGE=sv hg help debugoptDEP
hg debugoptDEP
(*) (glob)
(some details hidden, use --verbose to show complete help)
#endif
Test commands that collide with topics (issue4240)
$ hg config -hq
hg config [-u] [NAME]...
show config settings
$ hg showconfig -hq
hg config [-u] [NAME]...
show config settings
2010-08-27 18:25:47 +04:00
Test a help topic
$ hg help dates
Date Formats
""""""""""""
Some commands allow the user to specify a date, e.g.:
- backout, commit, import, tag: Specify the commit date.
- log, revert, update: Select revision(s) by date.
2010-08-27 18:25:47 +04:00
Many date formats are valid. Here are some examples:
2010-08-27 18:25:47 +04:00
- "Wed Dec 6 13:18:29 2006" (local timezone assumed)
- "Dec 6 13:18 -0600" (year assumed, time offset provided)
- "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
- "Dec 6" (midnight)
- "13:18" (today assumed)
- "3:39" (3:39AM assumed)
- "3:39pm" (15:39)
- "2006-12-06 13:18:29" (ISO 8601 format)
- "2006-12-6 13:18"
- "2006-12-6"
- "12-6"
- "12/6"
- "12/6/6" (Dec 6 2006)
- "today" (midnight)
- "yesterday" (midnight)
- "now" - right now
2010-08-27 18:25:47 +04:00
Lastly, there is Mercurial's internal format:
2010-08-27 18:25:47 +04:00
- "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
2010-08-27 18:25:47 +04:00
This is the internal representation format for dates. The first number is
the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
is the offset of the local timezone, in seconds west of UTC (negative if
the timezone is east of UTC).
2010-08-27 18:25:47 +04:00
The log command also accepts date ranges:
2010-08-27 18:25:47 +04:00
- "<DATE" - at or before a given date/time
- ">DATE" - on or after a given date/time
- "DATE to DATE" - a date range, inclusive
- "-DAYS" - within a given number of days of today
Test repeated config section name
$ hg help config.host
"http_proxy.host"
Host name and (optional) port of the proxy server, for example
"myproxy:8000".
"smtp.host"
Host name of mail server, e.g. "mail.example.com".
Unrelated trailing paragraphs shouldn't be included
$ hg help config.extramsg | grep '^$'
Test capitalized section name
$ hg help scripting.HGPLAIN > /dev/null
Help subsection:
$ hg help config.charsets |grep "Email example:" > /dev/null
[1]
Show nested definitions
("profiling.type"[break]"ls"[break]"stat"[break])
$ hg help config.type | egrep '^$'|wc -l
\s*3 (re)
Separate sections from subsections
$ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
"format"
--------
"usegeneraldelta"
"dirstate"
2018-01-03 21:13:17 +03:00
"uselz4"
"cgdeltabase"
"profiling"
-----------
"format"
"progress"
----------
"format"
Last item in help config.*:
$ hg help config.`hg help config|grep '^ "'| \
> tail -1|sed 's![ "]*!!g'`| \
> grep 'hg help -c config' > /dev/null
[1]
note to use help -c for general hg help config:
$ hg help config |grep 'hg help -c config' > /dev/null
Test templating help
$ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
desc String. The text of the changeset description.
diffstat String. Statistics of changes with the following format:
firstline Any text. Returns the first line of text.
nonempty Any text. Returns '(none)' if the string is empty.
Test deprecated items
$ hg help -v templating | grep currentbookmark
currentbookmark
$ hg help templating | (grep currentbookmark || true)
Test help hooks
$ cat > helphook1.py <<EOF
> from edenscm.mercurial import help
>
> def rewrite(ui, topic, doc):
> return doc + '\nhelphook1\n'
>
> def extsetup(ui):
> help.addtopichook('revisions', rewrite)
> EOF
$ cat > helphook2.py <<EOF
> from edenscm.mercurial import help
>
> def rewrite(ui, topic, doc):
> return doc + '\nhelphook2\n'
>
> def extsetup(ui):
> help.addtopichook('revisions', rewrite)
> EOF
$ echo '[extensions]' >> $HGRCPATH
$ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
$ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
$ hg help revsets | grep helphook
helphook1
helphook2
help -c should only show debug --debug
$ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
[1]
help -c should only show deprecated for -v
$ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
[1]
Test -s / --system
$ hg help config.files -s windows |grep 'etc/mercurial' | \
> wc -l | sed -e 's/ //g'
0
$ hg help config.files --system unix | grep 'USER' | \
> wc -l | sed -e 's/ //g'
0
Test -e / -c / -k combinations
$ hg help -c|egrep '^[A-Z].*:|^ debug'
Commands:
$ hg help -e|egrep '^[A-Z].*:|^ debug'
Extensions:
debugcommitmessage (no help text available)
debugnetwork test network connections to the server
debugshell a python shell with repo, changelog & manifest objects
2015-12-14 08:29:55 +03:00
$ hg help -k|egrep '^[A-Z].*:|^ debug'
Topics:
Commands:
Extensions:
debugcommitmessage (no help text available)
debugnetwork test network connections to the server
debugshell a python shell with repo, changelog & manifest objects
Extension Commands:
$ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
Commands:
$ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
Extensions:
$ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
Commands:
$ hg help -c commit > /dev/null
$ hg help -e -c commit > /dev/null
$ hg help -e commit > /dev/null
abort: no such help topic: commit
2016-09-21 02:47:46 +03:00
(try 'hg help --keyword commit')
[255]
Test keyword search help
$ cat > prefixedname.py <<EOF
> '''matched against word "clone"
> '''
> EOF
$ echo '[extensions]' >> $HGRCPATH
$ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
$ hg help -k clone
Topics:
config Configuration Files
extensions Using Additional Features
glossary Common Terms
phases Working with Phases
urls URL Paths
Commands:
bookmarks create a new bookmark or list existing bookmarks
clone make a copy of an existing repository
paths show aliases for remote repositories
Extensions:
exchange: make clone bundles non-experimental and enabled by default The clone bundles feature was introduced in Mercurial 3.6 behind an experimental and disabled by default flag. The feature has been enabled on hg.mozilla.org for a few months and has served many terabytes of clones. Users have been encouraged to use the feature and reception has been very positive (mainly due to faster clones as a result of connecting to a CDN). I have heard no feedback about changing the feature other than inquiries about when it will be enabled by default. So, I think the feature is ready to be enabled by default. This patch renames experimental.clonebundles to ui.clonebundles, documents the option, and enables it by default. References to the experimental state of clone bundles have been removed. The remaining config option docs in clonebundles.py have been removed because they are redudant with `hg help config`. There are some oddities with behavior of clone bundles. Because clones with clone bundles are effectively 2 `hg pull` operations, there may be 2 transactions. This could result in hooks running twice. If the subsequent pull is aborted, it could result in partial rollback and an incomplete clone. This behavior is a bit wonky and should probably be documented. If this patch is accepted, I'll send a follow-up to document it. I don't think this behavior should prevent the feature being enabled by default. Reworking the clone mechanism to support interrupted or multi-part clones feels like a major new feature and something that when implemented can change the hook and rollback semantics of clone bundles. Besides, partial clone is better than full rollback and hooks running on initial clone are likely rare, so I think the impact is minimal.
2016-01-08 21:58:04 +03:00
clonebundles advertise pre-generated bundles to seed clones
prefixedname matched against word "clone"
Test unfound topic
$ hg help nonexistingtopicthatwillneverexisteverever
abort: no such help topic: nonexistingtopicthatwillneverexisteverever
2016-09-21 02:47:46 +03:00
(try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
[255]
Test unfound keyword
$ hg help --keyword nonexistingwordthatwillneverexisteverever
abort: no matches
2016-09-21 02:47:46 +03:00
(try 'hg help' for a list of topics)
[255]
Test omit indicating for help
$ cat > addverboseitems.py <<EOF
> '''extension to test omit indicating.
>
> This paragraph is never omitted (for extension)
>
> .. container:: verbose
>
> This paragraph is omitted,
2014-12-18 23:53:55 +03:00
> if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
>
> This paragraph is never omitted, too (for extension)
> '''
> from __future__ import absolute_import
> from edenscm.mercurial import commands, help
> testtopic = """This paragraph is never omitted (for topic).
>
> .. container:: verbose
>
> This paragraph is omitted,
2014-12-18 23:53:55 +03:00
> if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
>
> This paragraph is never omitted, too (for topic)
> """
> def extsetup(ui):
> help.helptable.append((["topic-containing-verbose"],
> "This is the topic to test omit indicating.",
> lambda ui: testtopic))
> EOF
$ echo '[extensions]' >> $HGRCPATH
$ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
$ hg help addverboseitems
addverboseitems extension - extension to test omit indicating.
This paragraph is never omitted (for extension)
This paragraph is never omitted, too (for extension)
(some details hidden, use --verbose to show complete help)
no commands defined
$ hg help -v addverboseitems
addverboseitems extension - extension to test omit indicating.
This paragraph is never omitted (for extension)
This paragraph is omitted, if 'hg help' is invoked without "-v" (for
2014-12-18 23:53:55 +03:00
extension)
This paragraph is never omitted, too (for extension)
no commands defined
$ hg help topic-containing-verbose
This is the topic to test omit indicating.
""""""""""""""""""""""""""""""""""""""""""
This paragraph is never omitted (for topic).
This paragraph is never omitted, too (for topic)
(some details hidden, use --verbose to show complete help)
$ hg help -v topic-containing-verbose
This is the topic to test omit indicating.
""""""""""""""""""""""""""""""""""""""""""
This paragraph is never omitted (for topic).
This paragraph is omitted, if 'hg help' is invoked without "-v" (for
2014-12-18 23:53:55 +03:00
topic)
This paragraph is never omitted, too (for topic)
Test section lookup
$ hg help revset.merge
"merge()"
Changeset is a merge changeset.
$ hg help glossary.dag
DAG
The repository of changesets of a distributed version control system
(DVCS) can be described as a directed acyclic graph (DAG), consisting
of nodes and edges, where nodes correspond to changesets and edges
imply a parent -> child relation. This graph can be visualized by
graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
limited by the requirement for children to have at most two parents.
$ hg help hgrc.paths
"paths"
-------
ui: support declaring path push urls as sub-options Power users often want to apply per-path configuration options. For example, they may want to declare an alternate URL for push operations or declare a revset of revisions to push when `hg push` is used (as opposed to attempting to push all revisions by default). This patch establishes the use of sub-options (config options with ":" in the name) to declare additional behavior for paths. New sub-options are declared by using the new ``@ui.pathsuboption`` decorator. This decorator serves multiple purposes: * Declaring which sub-options are registered * Declaring how a sub-option maps to an attribute on ``path`` instances (this is needed to `hg paths` can render sub-options and values properly) * Validation and normalization of config options to attribute values * Allows extensions to declare new sub-options without monkeypatching * Allows extensions to overwrite built-in behavior for sub-option handling As convenient as the new option registration decorator is, extensions (and even core functionality) may still need an additional hook point to perform finalization of path instances. For example, they may wish to validate that multiple options/attributes aren't conflicting with each other. This hook point could be added later, if needed. To prove this new functionality works, we implement the "pushurl" path sub-option. This option declares the URL that `hg push` should use by default. We require that "pushurl" is an actual URL. This requirement might be controversial and could be dropped if there is opposition. However, objectors should read the complicated code in ui.path.__init__ and commands.push for resolving non-URL values before making a judgement. We also don't allow #fragment in the URLs. I intend to introduce a ":pushrev" (or similar) option to define a revset to control which revisions are pushed when "-r <rev>" isn't passed into `hg push`. This is much more powerful than #fragment and I don't think #fragment is useful enough to continue supporting. The [paths] section of the "config" help page has been updated significantly. `hg paths` has been taught to display path sub-options. The docs mention that "default-push" is now deprecated. However, there are several references to it that need to be cleaned up. A large part of this is converting more consumers to the new paths API. This will happen naturally as more path sub-options are added and more and more components need to access them.
2015-12-06 08:11:04 +03:00
Assigns symbolic names and behavior to repositories.
ui: support declaring path push urls as sub-options Power users often want to apply per-path configuration options. For example, they may want to declare an alternate URL for push operations or declare a revset of revisions to push when `hg push` is used (as opposed to attempting to push all revisions by default). This patch establishes the use of sub-options (config options with ":" in the name) to declare additional behavior for paths. New sub-options are declared by using the new ``@ui.pathsuboption`` decorator. This decorator serves multiple purposes: * Declaring which sub-options are registered * Declaring how a sub-option maps to an attribute on ``path`` instances (this is needed to `hg paths` can render sub-options and values properly) * Validation and normalization of config options to attribute values * Allows extensions to declare new sub-options without monkeypatching * Allows extensions to overwrite built-in behavior for sub-option handling As convenient as the new option registration decorator is, extensions (and even core functionality) may still need an additional hook point to perform finalization of path instances. For example, they may wish to validate that multiple options/attributes aren't conflicting with each other. This hook point could be added later, if needed. To prove this new functionality works, we implement the "pushurl" path sub-option. This option declares the URL that `hg push` should use by default. We require that "pushurl" is an actual URL. This requirement might be controversial and could be dropped if there is opposition. However, objectors should read the complicated code in ui.path.__init__ and commands.push for resolving non-URL values before making a judgement. We also don't allow #fragment in the URLs. I intend to introduce a ":pushrev" (or similar) option to define a revset to control which revisions are pushed when "-r <rev>" isn't passed into `hg push`. This is much more powerful than #fragment and I don't think #fragment is useful enough to continue supporting. The [paths] section of the "config" help page has been updated significantly. `hg paths` has been taught to display path sub-options. The docs mention that "default-push" is now deprecated. However, there are several references to it that need to be cleaned up. A large part of this is converting more consumers to the new paths API. This will happen naturally as more path sub-options are added and more and more components need to access them.
2015-12-06 08:11:04 +03:00
Options are symbolic names defining the URL or directory that is the
location of the repository. Example:
ui: support declaring path push urls as sub-options Power users often want to apply per-path configuration options. For example, they may want to declare an alternate URL for push operations or declare a revset of revisions to push when `hg push` is used (as opposed to attempting to push all revisions by default). This patch establishes the use of sub-options (config options with ":" in the name) to declare additional behavior for paths. New sub-options are declared by using the new ``@ui.pathsuboption`` decorator. This decorator serves multiple purposes: * Declaring which sub-options are registered * Declaring how a sub-option maps to an attribute on ``path`` instances (this is needed to `hg paths` can render sub-options and values properly) * Validation and normalization of config options to attribute values * Allows extensions to declare new sub-options without monkeypatching * Allows extensions to overwrite built-in behavior for sub-option handling As convenient as the new option registration decorator is, extensions (and even core functionality) may still need an additional hook point to perform finalization of path instances. For example, they may wish to validate that multiple options/attributes aren't conflicting with each other. This hook point could be added later, if needed. To prove this new functionality works, we implement the "pushurl" path sub-option. This option declares the URL that `hg push` should use by default. We require that "pushurl" is an actual URL. This requirement might be controversial and could be dropped if there is opposition. However, objectors should read the complicated code in ui.path.__init__ and commands.push for resolving non-URL values before making a judgement. We also don't allow #fragment in the URLs. I intend to introduce a ":pushrev" (or similar) option to define a revset to control which revisions are pushed when "-r <rev>" isn't passed into `hg push`. This is much more powerful than #fragment and I don't think #fragment is useful enough to continue supporting. The [paths] section of the "config" help page has been updated significantly. `hg paths` has been taught to display path sub-options. The docs mention that "default-push" is now deprecated. However, there are several references to it that need to be cleaned up. A large part of this is converting more consumers to the new paths API. This will happen naturally as more path sub-options are added and more and more components need to access them.
2015-12-06 08:11:04 +03:00
[paths]
my_server = https://example.com/my_repo
local_path = /home/me/repo
ui: support declaring path push urls as sub-options Power users often want to apply per-path configuration options. For example, they may want to declare an alternate URL for push operations or declare a revset of revisions to push when `hg push` is used (as opposed to attempting to push all revisions by default). This patch establishes the use of sub-options (config options with ":" in the name) to declare additional behavior for paths. New sub-options are declared by using the new ``@ui.pathsuboption`` decorator. This decorator serves multiple purposes: * Declaring which sub-options are registered * Declaring how a sub-option maps to an attribute on ``path`` instances (this is needed to `hg paths` can render sub-options and values properly) * Validation and normalization of config options to attribute values * Allows extensions to declare new sub-options without monkeypatching * Allows extensions to overwrite built-in behavior for sub-option handling As convenient as the new option registration decorator is, extensions (and even core functionality) may still need an additional hook point to perform finalization of path instances. For example, they may wish to validate that multiple options/attributes aren't conflicting with each other. This hook point could be added later, if needed. To prove this new functionality works, we implement the "pushurl" path sub-option. This option declares the URL that `hg push` should use by default. We require that "pushurl" is an actual URL. This requirement might be controversial and could be dropped if there is opposition. However, objectors should read the complicated code in ui.path.__init__ and commands.push for resolving non-URL values before making a judgement. We also don't allow #fragment in the URLs. I intend to introduce a ":pushrev" (or similar) option to define a revset to control which revisions are pushed when "-r <rev>" isn't passed into `hg push`. This is much more powerful than #fragment and I don't think #fragment is useful enough to continue supporting. The [paths] section of the "config" help page has been updated significantly. `hg paths` has been taught to display path sub-options. The docs mention that "default-push" is now deprecated. However, there are several references to it that need to be cleaned up. A large part of this is converting more consumers to the new paths API. This will happen naturally as more path sub-options are added and more and more components need to access them.
2015-12-06 08:11:04 +03:00
These symbolic names can be used from the command line. To pull from
"my_server": 'hg pull my_server'. To push to "local_path": 'hg push
local_path'.
ui: support declaring path push urls as sub-options Power users often want to apply per-path configuration options. For example, they may want to declare an alternate URL for push operations or declare a revset of revisions to push when `hg push` is used (as opposed to attempting to push all revisions by default). This patch establishes the use of sub-options (config options with ":" in the name) to declare additional behavior for paths. New sub-options are declared by using the new ``@ui.pathsuboption`` decorator. This decorator serves multiple purposes: * Declaring which sub-options are registered * Declaring how a sub-option maps to an attribute on ``path`` instances (this is needed to `hg paths` can render sub-options and values properly) * Validation and normalization of config options to attribute values * Allows extensions to declare new sub-options without monkeypatching * Allows extensions to overwrite built-in behavior for sub-option handling As convenient as the new option registration decorator is, extensions (and even core functionality) may still need an additional hook point to perform finalization of path instances. For example, they may wish to validate that multiple options/attributes aren't conflicting with each other. This hook point could be added later, if needed. To prove this new functionality works, we implement the "pushurl" path sub-option. This option declares the URL that `hg push` should use by default. We require that "pushurl" is an actual URL. This requirement might be controversial and could be dropped if there is opposition. However, objectors should read the complicated code in ui.path.__init__ and commands.push for resolving non-URL values before making a judgement. We also don't allow #fragment in the URLs. I intend to introduce a ":pushrev" (or similar) option to define a revset to control which revisions are pushed when "-r <rev>" isn't passed into `hg push`. This is much more powerful than #fragment and I don't think #fragment is useful enough to continue supporting. The [paths] section of the "config" help page has been updated significantly. `hg paths` has been taught to display path sub-options. The docs mention that "default-push" is now deprecated. However, there are several references to it that need to be cleaned up. A large part of this is converting more consumers to the new paths API. This will happen naturally as more path sub-options are added and more and more components need to access them.
2015-12-06 08:11:04 +03:00
Options containing colons (":") denote sub-options that can influence
behavior for that specific path. Example:
[paths]
ui: support declaring path push urls as sub-options Power users often want to apply per-path configuration options. For example, they may want to declare an alternate URL for push operations or declare a revset of revisions to push when `hg push` is used (as opposed to attempting to push all revisions by default). This patch establishes the use of sub-options (config options with ":" in the name) to declare additional behavior for paths. New sub-options are declared by using the new ``@ui.pathsuboption`` decorator. This decorator serves multiple purposes: * Declaring which sub-options are registered * Declaring how a sub-option maps to an attribute on ``path`` instances (this is needed to `hg paths` can render sub-options and values properly) * Validation and normalization of config options to attribute values * Allows extensions to declare new sub-options without monkeypatching * Allows extensions to overwrite built-in behavior for sub-option handling As convenient as the new option registration decorator is, extensions (and even core functionality) may still need an additional hook point to perform finalization of path instances. For example, they may wish to validate that multiple options/attributes aren't conflicting with each other. This hook point could be added later, if needed. To prove this new functionality works, we implement the "pushurl" path sub-option. This option declares the URL that `hg push` should use by default. We require that "pushurl" is an actual URL. This requirement might be controversial and could be dropped if there is opposition. However, objectors should read the complicated code in ui.path.__init__ and commands.push for resolving non-URL values before making a judgement. We also don't allow #fragment in the URLs. I intend to introduce a ":pushrev" (or similar) option to define a revset to control which revisions are pushed when "-r <rev>" isn't passed into `hg push`. This is much more powerful than #fragment and I don't think #fragment is useful enough to continue supporting. The [paths] section of the "config" help page has been updated significantly. `hg paths` has been taught to display path sub-options. The docs mention that "default-push" is now deprecated. However, there are several references to it that need to be cleaned up. A large part of this is converting more consumers to the new paths API. This will happen naturally as more path sub-options are added and more and more components need to access them.
2015-12-06 08:11:04 +03:00
my_server = https://example.com/my_path
my_server:pushurl = ssh://example.com/my_path
The following sub-options can be defined:
ui: support declaring path push urls as sub-options Power users often want to apply per-path configuration options. For example, they may want to declare an alternate URL for push operations or declare a revset of revisions to push when `hg push` is used (as opposed to attempting to push all revisions by default). This patch establishes the use of sub-options (config options with ":" in the name) to declare additional behavior for paths. New sub-options are declared by using the new ``@ui.pathsuboption`` decorator. This decorator serves multiple purposes: * Declaring which sub-options are registered * Declaring how a sub-option maps to an attribute on ``path`` instances (this is needed to `hg paths` can render sub-options and values properly) * Validation and normalization of config options to attribute values * Allows extensions to declare new sub-options without monkeypatching * Allows extensions to overwrite built-in behavior for sub-option handling As convenient as the new option registration decorator is, extensions (and even core functionality) may still need an additional hook point to perform finalization of path instances. For example, they may wish to validate that multiple options/attributes aren't conflicting with each other. This hook point could be added later, if needed. To prove this new functionality works, we implement the "pushurl" path sub-option. This option declares the URL that `hg push` should use by default. We require that "pushurl" is an actual URL. This requirement might be controversial and could be dropped if there is opposition. However, objectors should read the complicated code in ui.path.__init__ and commands.push for resolving non-URL values before making a judgement. We also don't allow #fragment in the URLs. I intend to introduce a ":pushrev" (or similar) option to define a revset to control which revisions are pushed when "-r <rev>" isn't passed into `hg push`. This is much more powerful than #fragment and I don't think #fragment is useful enough to continue supporting. The [paths] section of the "config" help page has been updated significantly. `hg paths` has been taught to display path sub-options. The docs mention that "default-push" is now deprecated. However, there are several references to it that need to be cleaned up. A large part of this is converting more consumers to the new paths API. This will happen naturally as more path sub-options are added and more and more components need to access them.
2015-12-06 08:11:04 +03:00
"pushurl"
The URL to use for push operations. If not defined, the location
defined by the path's main entry is used.
"pushrev"
A revset defining which revisions to push by default.
When 'hg push' is executed without a "-r" argument, the revset defined
by this sub-option is evaluated to determine what to push.
For example, a value of "." will push the working directory's revision
by default.
Revsets specifying bookmarks will not result in the bookmark being
pushed.
ui: support declaring path push urls as sub-options Power users often want to apply per-path configuration options. For example, they may want to declare an alternate URL for push operations or declare a revset of revisions to push when `hg push` is used (as opposed to attempting to push all revisions by default). This patch establishes the use of sub-options (config options with ":" in the name) to declare additional behavior for paths. New sub-options are declared by using the new ``@ui.pathsuboption`` decorator. This decorator serves multiple purposes: * Declaring which sub-options are registered * Declaring how a sub-option maps to an attribute on ``path`` instances (this is needed to `hg paths` can render sub-options and values properly) * Validation and normalization of config options to attribute values * Allows extensions to declare new sub-options without monkeypatching * Allows extensions to overwrite built-in behavior for sub-option handling As convenient as the new option registration decorator is, extensions (and even core functionality) may still need an additional hook point to perform finalization of path instances. For example, they may wish to validate that multiple options/attributes aren't conflicting with each other. This hook point could be added later, if needed. To prove this new functionality works, we implement the "pushurl" path sub-option. This option declares the URL that `hg push` should use by default. We require that "pushurl" is an actual URL. This requirement might be controversial and could be dropped if there is opposition. However, objectors should read the complicated code in ui.path.__init__ and commands.push for resolving non-URL values before making a judgement. We also don't allow #fragment in the URLs. I intend to introduce a ":pushrev" (or similar) option to define a revset to control which revisions are pushed when "-r <rev>" isn't passed into `hg push`. This is much more powerful than #fragment and I don't think #fragment is useful enough to continue supporting. The [paths] section of the "config" help page has been updated significantly. `hg paths` has been taught to display path sub-options. The docs mention that "default-push" is now deprecated. However, there are several references to it that need to be cleaned up. A large part of this is converting more consumers to the new paths API. This will happen naturally as more path sub-options are added and more and more components need to access them.
2015-12-06 08:11:04 +03:00
The following special named paths exist:
"default"
The URL or directory to use when no source or remote is specified.
'hg clone' will automatically define this path to the location the
ui: support declaring path push urls as sub-options Power users often want to apply per-path configuration options. For example, they may want to declare an alternate URL for push operations or declare a revset of revisions to push when `hg push` is used (as opposed to attempting to push all revisions by default). This patch establishes the use of sub-options (config options with ":" in the name) to declare additional behavior for paths. New sub-options are declared by using the new ``@ui.pathsuboption`` decorator. This decorator serves multiple purposes: * Declaring which sub-options are registered * Declaring how a sub-option maps to an attribute on ``path`` instances (this is needed to `hg paths` can render sub-options and values properly) * Validation and normalization of config options to attribute values * Allows extensions to declare new sub-options without monkeypatching * Allows extensions to overwrite built-in behavior for sub-option handling As convenient as the new option registration decorator is, extensions (and even core functionality) may still need an additional hook point to perform finalization of path instances. For example, they may wish to validate that multiple options/attributes aren't conflicting with each other. This hook point could be added later, if needed. To prove this new functionality works, we implement the "pushurl" path sub-option. This option declares the URL that `hg push` should use by default. We require that "pushurl" is an actual URL. This requirement might be controversial and could be dropped if there is opposition. However, objectors should read the complicated code in ui.path.__init__ and commands.push for resolving non-URL values before making a judgement. We also don't allow #fragment in the URLs. I intend to introduce a ":pushrev" (or similar) option to define a revset to control which revisions are pushed when "-r <rev>" isn't passed into `hg push`. This is much more powerful than #fragment and I don't think #fragment is useful enough to continue supporting. The [paths] section of the "config" help page has been updated significantly. `hg paths` has been taught to display path sub-options. The docs mention that "default-push" is now deprecated. However, there are several references to it that need to be cleaned up. A large part of this is converting more consumers to the new paths API. This will happen naturally as more path sub-options are added and more and more components need to access them.
2015-12-06 08:11:04 +03:00
repository was cloned from.
"default-push"
(deprecated) The URL or directory for the default 'hg push' location.
ui: support declaring path push urls as sub-options Power users often want to apply per-path configuration options. For example, they may want to declare an alternate URL for push operations or declare a revset of revisions to push when `hg push` is used (as opposed to attempting to push all revisions by default). This patch establishes the use of sub-options (config options with ":" in the name) to declare additional behavior for paths. New sub-options are declared by using the new ``@ui.pathsuboption`` decorator. This decorator serves multiple purposes: * Declaring which sub-options are registered * Declaring how a sub-option maps to an attribute on ``path`` instances (this is needed to `hg paths` can render sub-options and values properly) * Validation and normalization of config options to attribute values * Allows extensions to declare new sub-options without monkeypatching * Allows extensions to overwrite built-in behavior for sub-option handling As convenient as the new option registration decorator is, extensions (and even core functionality) may still need an additional hook point to perform finalization of path instances. For example, they may wish to validate that multiple options/attributes aren't conflicting with each other. This hook point could be added later, if needed. To prove this new functionality works, we implement the "pushurl" path sub-option. This option declares the URL that `hg push` should use by default. We require that "pushurl" is an actual URL. This requirement might be controversial and could be dropped if there is opposition. However, objectors should read the complicated code in ui.path.__init__ and commands.push for resolving non-URL values before making a judgement. We also don't allow #fragment in the URLs. I intend to introduce a ":pushrev" (or similar) option to define a revset to control which revisions are pushed when "-r <rev>" isn't passed into `hg push`. This is much more powerful than #fragment and I don't think #fragment is useful enough to continue supporting. The [paths] section of the "config" help page has been updated significantly. `hg paths` has been taught to display path sub-options. The docs mention that "default-push" is now deprecated. However, there are several references to it that need to be cleaned up. A large part of this is converting more consumers to the new paths API. This will happen naturally as more path sub-options are added and more and more components need to access them.
2015-12-06 08:11:04 +03:00
"default:pushurl" should be used instead.
$ hg help glossary.mcguffin
abort: help section not found: glossary.mcguffin
[255]
$ hg help glossary.mc.guffin
abort: help section not found: glossary.mc.guffin
[255]
$ hg help template.files
files List of strings. All files modified, added, or removed by
this changeset.
files(pattern)
All files of the current changeset matching the pattern. See
'hg help patterns'.
Test section lookup by translated message
str.lower() instead of encoding.lower(str) on translated message might
make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
as the second or later byte of multi-byte character.
For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
replacement makes message meaningless.
This tests that section lookup by translated string isn't broken by
such str.lower().
$ $PYTHON <<EOF
> def escape(s):
> return ''.join('\\\u%x' % ord(uc) for uc in s.decode('cp932'))
> # translation of "record" in ja_JP.cp932
> upper = b"\x8bL\x98^"
> # str.lower()-ed section name should be treated as different one
> lower = b"\x8bl\x98^"
> with open('ambiguous.py', 'w') as fp:
> fp.write("""# ambiguous section names in ja_JP.cp932
> u'''summary of extension
>
> %s
> ----
>
> Upper name should show only this message
>
> %s
> ----
>
> Lower name should show only this message
>
> subsequent section
> ------------------
>
> This should be hidden at 'hg help ambiguous' with section name.
> '''
> """ % (escape(upper), escape(lower)))
> EOF
Show help content of disabled extensions
$ cat >> $HGRCPATH <<EOF
> [extensions]
> ambiguous = !./ambiguous.py
> EOF
$ hg help -e ambiguous
ambiguous extension - (no help text available)
2016-09-21 02:47:46 +03:00
(use 'hg help extensions' for information on enabling extensions)
Test dynamic list of merge tools only shows up once
$ hg help merge-tools
Merge Tools
"""""""""""
To merge files Mercurial uses merge tools.
A merge tool combines two different versions of a file into a merged file.
Merge tools are given the two files and the greatest common ancestor of
the two file versions, so they can determine the changes made on both
branches.
Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
backout' and in several extensions.
Usually, the merge tool tries to automatically reconcile the files by
combining all non-overlapping changes that occurred separately in the two
different evolutions of the same initial base file. Furthermore, some
interactive merge programs make it easier to manually resolve conflicting
merges, either in a graphical way, or by inserting some conflict markers.
Mercurial does not include any interactive merge programs but relies on
external tools for that.
Available merge tools
=====================
External merge tools and their properties are configured in the merge-
tools configuration section - see hgrc(5) - but they can often just be
named by their executable.
A merge tool is generally usable if its executable can be found on the
system and if it can handle the merge. The executable is found if it is an
absolute or relative executable path or the name of an application in the
executable search path. The tool is assumed to be able to handle the merge
if it can handle symlinks if the file is a symlink, if it can handle
binary files if the file is binary, and if a GUI is available if the tool
requires a GUI.
There are some internal merge tools which can be used. The internal merge
tools are:
":dump"
Creates three versions of the files to merge, containing the contents of
local, other and base. These files can then be used to perform a merge
manually. If the file to be merged is named "a.txt", these files will
accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
they will be placed in the same directory as "a.txt".
This implies premerge. Therefore, files aren't dumped, if premerge runs
successfully. Use :forcedump to forcibly write files out.
":fail"
Rather than attempting to merge files that were modified on both
branches, it marks them as unresolved. The resolve command must be used
to resolve these conflicts.
":forcedump"
Creates three versions of the files as same as :dump, but omits
premerge.
":local"
Uses the local 'p1()' version of files as the merged version.
":merge"
Uses the internal non-interactive simple merge algorithm for merging
files. It will fail if there are any conflicts and leave markers in the
partially merged file. Markers will have two sections, one for each side
of merge.
":merge-local"
Like :merge, but resolve all conflicts non-interactively in favor of the
local 'p1()' changes.
":merge-other"
Like :merge, but resolve all conflicts non-interactively in favor of the
other 'p2()' changes.
":merge3"
Uses the internal non-interactive simple merge algorithm for merging
files. It will fail if there are any conflicts and leave markers in the
partially merged file. Marker will have three sections, one from each
side of the merge and one for the base content.
mergetools: add new conflict marker format with diffs in Summary: Written by Martin von Zweigbergk at https://phab.mercurial-scm.org/D9551, or https://www.mercurial-scm.org/repo/hg/rev/bdc2bf68f19e. He suggested it and it's a useful feature. I did minor compatibility changes (encoding, avoid rev numbers, foo_bar -> foobar). Original commit message: I use 3-way conflict markers. Often when I resolve them, I manually compare one the base with one side and apply the differences to the other side. That can be hard when the conflict marker is large. This patch introduces a new type of conflict marker, which I'm hoping will make it easier to resolve conflicts. The new format uses `<<<<<<<` and `>>>>>>>` to open and close the markers, just like our existing 2-way and 3-way conflict markers. Instead of having 2 or 3 snapshots (left+right or left+base+right), it has a sequence of diffs. A diff looks like this: ``` ------- base +++++++ left a -b +c d ``` A diff that adds one side ("diff from nothing") has a `=======` header instead and does not have have `+` prefixed on its lines. A regular 3-way merge can be viewed as adding one side plus a diff between the base and the other side. It thus has two ways of being represented, depending on which side is being diffed: ``` <<<<<<< ======= left contents on left ------- base +++++++ right contents on -left +right >>>>>>> ``` or ``` <<<<<<< ------- base +++++++ left contents on -right +left ======= right contents on right >>>>>>> ``` I've made it so the new merge tool tries to pick a version that has the most common lines (no difference in the example above). I've called the new tool "mergediff" to stick to the convention of starting with "merge" if the tool tries a regular 3-way merge. The idea came from my pet VCS (placeholder name `jj`), which has support for octopus merges and other ways of ending up with merges of more than 3 versions. I wanted to be able to represent such conflicts in the working copy and therefore thought of this format (although I have not yet implemented it in my VCS). I then attended a meeting with Larry McVoy, who said BitKeeper has an option (`bk smerge -g`) for showing a similar format, which reminded me to actually attempt this in Mercurial. Reviewed By: DurhamG Differential Revision: D26947920 fbshipit-source-id: 8b4446862897ff9a6dfdf5a2e35617d4db09e883
2021-03-11 04:23:28 +03:00
":mergediff"
Uses the internal non-interactive simple merge algorithm for merging
files. It will fail if there are any conflicts and leave markers in the
partially merged file. The marker will have two sections, one with the
content from one side of the merge, and one with a diff from the base
content to the content on the other side. (experimental)
":other"
Uses the other 'p2()' version of files as the merged version.
":prompt"
Asks the user which of the local 'p1()' or the other 'p2()' version to
keep as the merged version.
":union"
Uses the internal non-interactive simple merge algorithm for merging
files. It will use both left and right sides for conflict regions. No
markers are inserted.
Internal tools are always available and do not require a GUI but will by
default not handle symlinks or binary files.
Choosing a merge tool
=====================
Mercurial uses these rules when deciding which merge tool to use:
1. If a tool has been specified with the --tool option to merge or
resolve, it is used. If it is the name of a tool in the merge-tools
configuration, its configuration is used. Otherwise the specified tool
must be executable by the shell.
2. If the "HGMERGE" environment variable is present, its value is used and
must be executable by the shell.
3. If the filename of the file to be merged matches any of the patterns in
the merge-patterns configuration section, the first usable merge tool
corresponding to a matching pattern is used. Here, binary capabilities
of the merge tool are not considered.
4. If ui.merge is set it will be considered next. If the value is not the
name of a configured tool, the specified value is used and must be
executable by the shell. Otherwise the named tool is used if it is
usable.
5. If any usable merge tools are present in the merge-tools configuration
section, the one with the highest priority is used.
6. If a program named "hgmerge" can be found on the system, it is used -
but it will by default not be used for symlinks and binary files.
7. If the file to be merged is not binary and is not a symlink, then
internal ":merge" is used.
8. Otherwise, ":prompt" is used.
Note:
After selecting a merge program, Mercurial will by default attempt to
merge the files using a simple merge algorithm first. Only if it
2017-11-01 06:09:29 +03:00
doesn't succeed because of conflicting changes will Mercurial actually
execute the merge program. Whether to use the simple merge algorithm
first can be controlled by the premerge setting of the merge tool.
Premerge is enabled by default unless the file is binary or a symlink.
See the merge-tools and ui sections of hgrc(5) for details on the
configuration of merge tools.
help: document bundle specifications I softly formalized the concept of a "bundle specification" a while ago when I was working on clone bundles and stream clone bundles and wanted a more robust way to define what exactly is in a bundle file. The concept has existed for a while. Since it is part of the clone bundles feature and exposed to the user via the "-t" argument to `hg bundle`, it is something we need to support for the long haul. After the 4.1 release, I heard a few people comment that they didn't realize you could generate zstd bundles with `hg bundle`. I'm partially to blame for not documenting it in bundle's docstring. Additionally, I added a hacky, experimental feature for controlling the compression level of bundles in 054e64c4d837. As the commit message says, I went with a quick and dirty solution out of time constraints. Furthermore, I wanted to eventually store this configuration in the "bundlespec" so it could be made more flexible. Given: a) bundlespecs are here to stay b) we don't have great documentation over what they are, despite being a user-facing feature c) the list of available compression engines and their behavior isn't exposed d) we need an extensible place to modify behavior of compression engines I want to move forward with formalizing bundlespecs as a user-facing feature. This commit does that by introducing a "bundlespec" help page. Leaning on the just-added compression engine documentation and API, the topic also conveniently lists available compression engines and details about them. This makes features like zstd bundle compression more discoverable. e.g. you can now `hg help -k zstd` and it lists the "bundlespec" topic.
2017-04-01 23:42:06 +03:00
Compression engines listed in `hg help bundlespec`
$ hg help bundlespec | grep gzip
"v1" bundles can only use the "gzip", "bzip2", and "none" compression
An algorithm that produces smaller bundles than "gzip".
This engine will likely produce smaller bundles than "gzip" but will be
"gzip"
better compression than "gzip". It also frequently yields better (?)
help: document bundle specifications I softly formalized the concept of a "bundle specification" a while ago when I was working on clone bundles and stream clone bundles and wanted a more robust way to define what exactly is in a bundle file. The concept has existed for a while. Since it is part of the clone bundles feature and exposed to the user via the "-t" argument to `hg bundle`, it is something we need to support for the long haul. After the 4.1 release, I heard a few people comment that they didn't realize you could generate zstd bundles with `hg bundle`. I'm partially to blame for not documenting it in bundle's docstring. Additionally, I added a hacky, experimental feature for controlling the compression level of bundles in 054e64c4d837. As the commit message says, I went with a quick and dirty solution out of time constraints. Furthermore, I wanted to eventually store this configuration in the "bundlespec" so it could be made more flexible. Given: a) bundlespecs are here to stay b) we don't have great documentation over what they are, despite being a user-facing feature c) the list of available compression engines and their behavior isn't exposed d) we need an extensible place to modify behavior of compression engines I want to move forward with formalizing bundlespecs as a user-facing feature. This commit does that by introducing a "bundlespec" help page. Leaning on the just-added compression engine documentation and API, the topic also conveniently lists available compression engines and details about them. This makes features like zstd bundle compression more discoverable. e.g. you can now `hg help -k zstd` and it lists the "bundlespec" topic.
2017-04-01 23:42:06 +03:00
#if normal-layout
Test usage of section marks in help documents
$ cd "$TESTDIR"/../doc
$ hg debugpython -- check-seclevel.py
2013-03-01 22:42:42 +04:00
#endif