help: create packages for the help text
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 13 Nov 2019 21:52:25 -0500
changeset 43632 2e017696181f
parent 43631 d3c4368099ed
child 43633 0b7733719d21
help: create packages for the help text These files need to be loaded as resources with PyOxidizer, instead of using filesystem representations. AFAICT, the resource loading mechanisms only work for the named package given to it, and can't reach into a subdirectory. While here, the `help` directory is renamed to `helptext`. Without this, trying to load external help text crashed in mercurial/help.py when importing `.i18n`, saying there's no `mercurial.help.i18n` module. Differential Revision: https://phab.mercurial-scm.org/D7376
mercurial/help.py
mercurial/help/bundlespec.txt
mercurial/help/color.txt
mercurial/help/common.txt
mercurial/help/config.txt
mercurial/help/dates.txt
mercurial/help/deprecated.txt
mercurial/help/diffs.txt
mercurial/help/environment.txt
mercurial/help/extensions.txt
mercurial/help/filesets.txt
mercurial/help/flags.txt
mercurial/help/glossary.txt
mercurial/help/hg-ssh.8.txt
mercurial/help/hg.1.txt
mercurial/help/hgignore.5.txt
mercurial/help/hgignore.txt
mercurial/help/hgrc.5.txt
mercurial/help/hgweb.txt
mercurial/help/internals/bundle2.txt
mercurial/help/internals/bundles.txt
mercurial/help/internals/cbor.txt
mercurial/help/internals/censor.txt
mercurial/help/internals/changegroups.txt
mercurial/help/internals/config.txt
mercurial/help/internals/extensions.txt
mercurial/help/internals/linelog.txt
mercurial/help/internals/mergestate.txt
mercurial/help/internals/requirements.txt
mercurial/help/internals/revlogs.txt
mercurial/help/internals/wireprotocol.txt
mercurial/help/internals/wireprotocolrpc.txt
mercurial/help/internals/wireprotocolv2.txt
mercurial/help/merge-tools.txt
mercurial/help/pager.txt
mercurial/help/patterns.txt
mercurial/help/phases.txt
mercurial/help/revisions.txt
mercurial/help/scripting.txt
mercurial/help/subrepos.txt
mercurial/help/templates.txt
mercurial/help/urls.txt
mercurial/helptext/__init__.py
mercurial/helptext/bundlespec.txt
mercurial/helptext/color.txt
mercurial/helptext/common.txt
mercurial/helptext/config.txt
mercurial/helptext/dates.txt
mercurial/helptext/deprecated.txt
mercurial/helptext/diffs.txt
mercurial/helptext/environment.txt
mercurial/helptext/extensions.txt
mercurial/helptext/filesets.txt
mercurial/helptext/flags.txt
mercurial/helptext/glossary.txt
mercurial/helptext/hg-ssh.8.txt
mercurial/helptext/hg.1.txt
mercurial/helptext/hgignore.5.txt
mercurial/helptext/hgignore.txt
mercurial/helptext/hgrc.5.txt
mercurial/helptext/hgweb.txt
mercurial/helptext/internals/__init__.py
mercurial/helptext/internals/bundle2.txt
mercurial/helptext/internals/bundles.txt
mercurial/helptext/internals/cbor.txt
mercurial/helptext/internals/censor.txt
mercurial/helptext/internals/changegroups.txt
mercurial/helptext/internals/config.txt
mercurial/helptext/internals/extensions.txt
mercurial/helptext/internals/linelog.txt
mercurial/helptext/internals/mergestate.txt
mercurial/helptext/internals/requirements.txt
mercurial/helptext/internals/revlogs.txt
mercurial/helptext/internals/wireprotocol.txt
mercurial/helptext/internals/wireprotocolrpc.txt
mercurial/helptext/internals/wireprotocolv2.txt
mercurial/helptext/merge-tools.txt
mercurial/helptext/pager.txt
mercurial/helptext/patterns.txt
mercurial/helptext/phases.txt
mercurial/helptext/revisions.txt
mercurial/helptext/scripting.txt
mercurial/helptext/subrepos.txt
mercurial/helptext/templates.txt
mercurial/helptext/urls.txt
setup.py
tests/test-check-config.t
--- a/mercurial/help.py	Thu Nov 14 11:33:05 2019 +0100
+++ b/mercurial/help.py	Wed Nov 13 21:52:25 2019 -0500
@@ -311,7 +311,7 @@
     """Return a delayed loader for help/topic.txt."""
 
     def loader(ui):
-        docdir = os.path.join(util.datapath, b'help')
+        docdir = os.path.join(util.datapath, b'helptext')
         if subdir:
             docdir = os.path.join(docdir, subdir)
         path = os.path.join(docdir, topic + b".txt")
--- a/mercurial/help/bundlespec.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-Mercurial supports generating standalone "bundle" files that hold repository
-data. These "bundles" are typically saved locally and used later or exchanged
-between different repositories, possibly on different machines. Example
-commands using bundles are :hg:`bundle` and :hg:`unbundle`.
-
-Generation of bundle files is controlled by a "bundle specification"
-("bundlespec") string. This string tells the bundle generation process how
-to create the bundle.
-
-A "bundlespec" string is composed of the following elements:
-
-type
-    A string denoting the bundle format to use.
-
-compression
-    Denotes the compression engine to use compressing the raw bundle data.
-
-parameters
-    Arbitrary key-value parameters to further control bundle generation.
-
-A "bundlespec" string has the following formats:
-
-<type>
-    The literal bundle format string is used.
-
-<compression>-<type>
-    The compression engine and format are delimited by a hyphen (``-``).
-
-Optional parameters follow the ``<type>``. Parameters are URI escaped
-``key=value`` pairs. Each pair is delimited by a semicolon (``;``). The
-first parameter begins after a ``;`` immediately following the ``<type>``
-value.
-
-Available Types
-===============
-
-The following bundle <type> strings are available:
-
-v1
-    Produces a legacy "changegroup" version 1 bundle.
-
-    This format is compatible with nearly all Mercurial clients because it is
-    the oldest. However, it has some limitations, which is why it is no longer
-    the default for new repositories.
-
-    ``v1`` bundles can be used with modern repositories using the "generaldelta"
-    storage format. However, it may take longer to produce the bundle and the
-    resulting bundle may be significantly larger than a ``v2`` bundle.
-
-    ``v1`` bundles can only use the ``gzip``, ``bzip2``, and ``none`` compression
-    formats.
-
-v2
-    Produces a version 2 bundle.
-
-    Version 2 bundles are an extensible format that can store additional
-    repository data (such as bookmarks and phases information) and they can
-    store data more efficiently, resulting in smaller bundles.
-
-    Version 2 bundles can also use modern compression engines, such as
-    ``zstd``, making them faster to compress and often smaller.
-
-Available Compression Engines
-=============================
-
-The following bundle <compression> engines can be used:
-
-.. bundlecompressionmarker
-
-Examples
-========
-
-``v2``
-    Produce a ``v2`` bundle using default options, including compression.
-
-``none-v1``
-    Produce a ``v1`` bundle with no compression.
-
-``zstd-v2``
-    Produce a ``v2`` bundle with zstandard compression using default
-    settings.
-
-``zstd-v1``
-    This errors because ``zstd`` is not supported for ``v1`` types.
--- a/mercurial/help/color.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-Mercurial colorizes output from several commands.
-
-For example, the diff command shows additions in green and deletions
-in red, while the status command shows modified files in magenta. Many
-other commands have analogous colors. It is possible to customize
-these colors.
-
-To enable color (default) whenever possible use::
-
-  [ui]
-  color = yes
-
-To disable color use::
-
-  [ui]
-  color = no
-
-See :hg:`help config.ui.color` for details.
-
-.. container:: windows
-
-  The default pager on Windows does not support color, so enabling the pager
-  will effectively disable color.  See :hg:`help config.ui.paginate` to disable
-  the pager.  Alternately, MSYS and Cygwin shells provide `less` as a pager,
-  which can be configured to support ANSI color mode.  Windows 10 natively
-  supports ANSI color mode.
-
-Mode
-====
-
-Mercurial can use various systems to display color. The supported modes are
-``ansi``, ``win32``, and ``terminfo``.  See :hg:`help config.color` for details
-about how to control the mode.
-
-Effects
-=======
-
-Other effects in addition to color, like bold and underlined text, are
-also available. By default, the terminfo database is used to find the
-terminal codes used to change color and effect.  If terminfo is not
-available, then effects are rendered with the ECMA-48 SGR control
-function (aka ANSI escape codes).
-
-The available effects in terminfo mode are 'blink', 'bold', 'dim',
-'inverse', 'invisible', 'italic', 'standout', and 'underline'; in
-ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and
-'underline'.  How each is rendered depends on the terminal emulator.
-Some may not be available for a given terminal type, and will be
-silently ignored.
-
-If the terminfo entry for your terminal is missing codes for an effect
-or has the wrong codes, you can add or override those codes in your
-configuration::
-
-  [color]
-  terminfo.dim = \E[2m
-
-where '\E' is substituted with an escape character.
-
-Labels
-======
-
-Text receives color effects depending on the labels that it has. Many
-default Mercurial commands emit labelled text. You can also define
-your own labels in templates using the label function, see :hg:`help
-templates`. A single portion of text may have more than one label. In
-that case, effects given to the last label will override any other
-effects. This includes the special "none" effect, which nullifies
-other effects.
-
-Labels are normally invisible. In order to see these labels and their
-position in the text, use the global --color=debug option. The same
-anchor text may be associated to multiple labels, e.g.
-
-  [log.changeset changeset.secret|changeset:   22611:6f0a53c8f587]
-
-The following are the default effects for some default labels. Default
-effects may be overridden from your configuration file::
-
-  [color]
-  status.modified = blue bold underline red_background
-  status.added = green bold
-  status.removed = red bold blue_background
-  status.deleted = cyan bold underline
-  status.unknown = magenta bold underline
-  status.ignored = black bold
-
-  # 'none' turns off all effects
-  status.clean = none
-  status.copied = none
-
-  qseries.applied = blue bold underline
-  qseries.unapplied = black bold
-  qseries.missing = red bold
-
-  diff.diffline = bold
-  diff.extended = cyan bold
-  diff.file_a = red bold
-  diff.file_b = green bold
-  diff.hunk = magenta
-  diff.deleted = red
-  diff.inserted = green
-  diff.changed = white
-  diff.tab =
-  diff.trailingwhitespace = bold red_background
-
-  # Blank so it inherits the style of the surrounding label
-  changeset.public =
-  changeset.draft =
-  changeset.secret =
-
-  resolve.unresolved = red bold
-  resolve.resolved = green bold
-
-  bookmarks.active = green
-
-  branches.active = none
-  branches.closed = black bold
-  branches.current = green
-  branches.inactive = none
-
-  tags.normal = green
-  tags.local = black bold
-
-  rebase.rebased = blue
-  rebase.remaining = red bold
-
-  shelve.age = cyan
-  shelve.newest = green bold
-  shelve.name = blue bold
-
-  histedit.remaining = red bold
-
-Custom colors
-=============
-
-Because there are only eight standard colors, Mercurial allows you
-to define color names for other color slots which might be available
-for your terminal type, assuming terminfo mode.  For instance::
-
-  color.brightblue = 12
-  color.pink = 207
-  color.orange = 202
-
-to set 'brightblue' to color slot 12 (useful for 16 color terminals
-that have brighter colors defined in the upper eight) and, 'pink' and
-'orange' to colors in 256-color xterm's default color cube.  These
-defined colors may then be used as any of the pre-defined eight,
-including appending '_background' to set the background to that color.
--- a/mercurial/help/common.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-.. Common link and substitution definitions.
-
-.. |hg(1)| replace:: **hg**\ (1)
-.. _hg(1): hg.1.html
-.. |hgrc(5)| replace:: **hgrc**\ (5)
-.. _hgrc(5): hgrc.5.html
-.. |hgignore(5)| replace:: **hgignore**\ (5)
-.. _hgignore(5): hgignore.5.html
--- a/mercurial/help/config.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2870 +0,0 @@
-The Mercurial system uses a set of configuration files to control
-aspects of its behavior.
-
-Troubleshooting
-===============
-
-If you're having problems with your configuration,
-:hg:`config --debug` can help you understand what is introducing
-a setting into your environment.
-
-See :hg:`help config.syntax` and :hg:`help config.files`
-for information about how and where to override things.
-
-Structure
-=========
-
-The configuration files use a simple ini-file format. A configuration
-file consists of sections, led by a ``[section]`` header and followed
-by ``name = value`` entries::
-
-  [ui]
-  username = Firstname Lastname <firstname.lastname@example.net>
-  verbose = True
-
-The above entries will be referred to as ``ui.username`` and
-``ui.verbose``, respectively. See :hg:`help config.syntax`.
-
-Files
-=====
-
-Mercurial reads configuration data from several files, if they exist.
-These files do not exist by default and you will have to create the
-appropriate configuration files yourself:
-
-Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
-
-Global configuration like the username setting is typically put into:
-
-.. container:: windows
-
-  - ``%USERPROFILE%\mercurial.ini`` (on Windows)
-
-.. container:: unix.plan9
-
-  - ``$HOME/.hgrc`` (on Unix, Plan9)
-
-The names of these files depend on the system on which Mercurial is
-installed. ``*.rc`` files from a single directory are read in
-alphabetical order, later ones overriding earlier ones. Where multiple
-paths are given below, settings from earlier paths override later
-ones.
-
-.. container:: verbose.unix
-
-  On Unix, the following files are consulted:
-
-  - ``<repo>/.hg/hgrc`` (per-repository)
-  - ``$HOME/.hgrc`` (per-user)
-  - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
-  - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
-  - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
-  - ``/etc/mercurial/hgrc`` (per-system)
-  - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
-  - ``<internal>/default.d/*.rc`` (defaults)
-
-.. container:: verbose.windows
-
-  On Windows, the following files are consulted:
-
-  - ``<repo>/.hg/hgrc`` (per-repository)
-  - ``%USERPROFILE%\.hgrc`` (per-user)
-  - ``%USERPROFILE%\Mercurial.ini`` (per-user)
-  - ``%HOME%\.hgrc`` (per-user)
-  - ``%HOME%\Mercurial.ini`` (per-user)
-  - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation)
-  - ``<install-dir>\hgrc.d\*.rc`` (per-installation)
-  - ``<install-dir>\Mercurial.ini`` (per-installation)
-  - ``<internal>/default.d/*.rc`` (defaults)
-
-  .. note::
-
-   The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
-   is used when running 32-bit Python on 64-bit Windows.
-
-.. container:: windows
-
-  On Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``.
-
-.. container:: verbose.plan9
-
-  On Plan9, the following files are consulted:
-
-  - ``<repo>/.hg/hgrc`` (per-repository)
-  - ``$home/lib/hgrc`` (per-user)
-  - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
-  - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
-  - ``/lib/mercurial/hgrc`` (per-system)
-  - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
-  - ``<internal>/default.d/*.rc`` (defaults)
-
-Per-repository configuration options only apply in a
-particular repository. This file is not version-controlled, and
-will not get transferred during a "clone" operation. Options in
-this file override options in all other configuration files.
-
-.. container:: unix.plan9
-
-  On Plan 9 and Unix, most of this file will be ignored if it doesn't
-  belong to a trusted user or to a trusted group. See
-  :hg:`help config.trusted` for more details.
-
-Per-user configuration file(s) are for the user running Mercurial.  Options
-in these files apply to all Mercurial commands executed by this user in any
-directory. Options in these files override per-system and per-installation
-options.
-
-Per-installation configuration files are searched for in the
-directory where Mercurial is installed. ``<install-root>`` is the
-parent directory of the **hg** executable (or symlink) being run.
-
-.. container:: unix.plan9
-
-  For example, if installed in ``/shared/tools/bin/hg``, Mercurial
-  will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
-  files apply to all Mercurial commands executed by any user in any
-  directory.
-
-Per-installation configuration files are for the system on
-which Mercurial is running. Options in these files apply to all
-Mercurial commands executed by any user in any directory. Registry
-keys contain PATH-like strings, every part of which must reference
-a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
-be read.  Mercurial checks each of these locations in the specified
-order until one or more configuration files are detected.
-
-Per-system configuration files are for the system on which Mercurial
-is running. Options in these files apply to all Mercurial commands
-executed by any user in any directory. Options in these files
-override per-installation options.
-
-Mercurial comes with some default configuration. The default configuration
-files are installed with Mercurial and will be overwritten on upgrades. Default
-configuration files should never be edited by users or administrators but can
-be overridden in other configuration files. So far the directory only contains
-merge tool configuration but packagers can also put other default configuration
-there.
-
-Syntax
-======
-
-A configuration file consists of sections, led by a ``[section]`` header
-and followed by ``name = value`` entries (sometimes called
-``configuration keys``)::
-
-    [spam]
-    eggs=ham
-    green=
-       eggs
-
-Each line contains one entry. If the lines that follow are indented,
-they are treated as continuations of that entry. Leading whitespace is
-removed from values. Empty lines are skipped. Lines beginning with
-``#`` or ``;`` are ignored and may be used to provide comments.
-
-Configuration keys can be set multiple times, in which case Mercurial
-will use the value that was configured last. As an example::
-
-    [spam]
-    eggs=large
-    ham=serrano
-    eggs=small
-
-This would set the configuration key named ``eggs`` to ``small``.
-
-It is also possible to define a section multiple times. A section can
-be redefined on the same and/or on different configuration files. For
-example::
-
-    [foo]
-    eggs=large
-    ham=serrano
-    eggs=small
-
-    [bar]
-    eggs=ham
-    green=
-       eggs
-
-    [foo]
-    ham=prosciutto
-    eggs=medium
-    bread=toasted
-
-This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
-of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
-respectively. As you can see there only thing that matters is the last
-value that was set for each of the configuration keys.
-
-If a configuration key is set multiple times in different
-configuration files the final value will depend on the order in which
-the different configuration files are read, with settings from earlier
-paths overriding later ones as described on the ``Files`` section
-above.
-
-A line of the form ``%include file`` will include ``file`` into the
-current configuration file. The inclusion is recursive, which means
-that included files can include other files. Filenames are relative to
-the configuration file in which the ``%include`` directive is found.
-Environment variables and ``~user`` constructs are expanded in
-``file``. This lets you do something like::
-
-  %include ~/.hgrc.d/$HOST.rc
-
-to include a different configuration file on each computer you use.
-
-A line with ``%unset name`` will remove ``name`` from the current
-section, if it has been set previously.
-
-The values are either free-form text strings, lists of text strings,
-or Boolean values. Boolean values can be set to true using any of "1",
-"yes", "true", or "on" and to false using "0", "no", "false", or "off"
-(all case insensitive).
-
-List values are separated by whitespace or comma, except when values are
-placed in double quotation marks::
-
-  allow_read = "John Doe, PhD", brian, betty
-
-Quotation marks can be escaped by prefixing them with a backslash. Only
-quotation marks at the beginning of a word is counted as a quotation
-(e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
-
-Sections
-========
-
-This section describes the different sections that may appear in a
-Mercurial configuration file, the purpose of each section, its possible
-keys, and their possible values.
-
-``alias``
----------
-
-Defines command aliases.
-
-Aliases allow you to define your own commands in terms of other
-commands (or aliases), optionally including arguments. Positional
-arguments in the form of ``$1``, ``$2``, etc. in the alias definition
-are expanded by Mercurial before execution. Positional arguments not
-already used by ``$N`` in the definition are put at the end of the
-command to be executed.
-
-Alias definitions consist of lines of the form::
-
-    <alias> = <command> [<argument>]...
-
-For example, this definition::
-
-    latest = log --limit 5
-
-creates a new command ``latest`` that shows only the five most recent
-changesets. You can define subsequent aliases using earlier ones::
-
-    stable5 = latest -b stable
-
-.. note::
-
-   It is possible to create aliases with the same names as
-   existing commands, which will then override the original
-   definitions. This is almost always a bad idea!
-
-An alias can start with an exclamation point (``!``) to make it a
-shell alias. A shell alias is executed with the shell and will let you
-run arbitrary commands. As an example, ::
-
-   echo = !echo $@
-
-will let you do ``hg echo foo`` to have ``foo`` printed in your
-terminal. A better example might be::
-
-   purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
-
-which will make ``hg purge`` delete all unknown files in the
-repository in the same manner as the purge extension.
-
-Positional arguments like ``$1``, ``$2``, etc. in the alias definition
-expand to the command arguments. Unmatched arguments are
-removed. ``$0`` expands to the alias name and ``$@`` expands to all
-arguments separated by a space. ``"$@"`` (with quotes) expands to all
-arguments quoted individually and separated by a space. These expansions
-happen before the command is passed to the shell.
-
-Shell aliases are executed in an environment where ``$HG`` expands to
-the path of the Mercurial that was used to execute the alias. This is
-useful when you want to call further Mercurial commands in a shell
-alias, as was done above for the purge alias. In addition,
-``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
-echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
-
-.. note::
-
-   Some global configuration options such as ``-R`` are
-   processed before shell aliases and will thus not be passed to
-   aliases.
-
-
-``annotate``
-------------
-
-Settings used when displaying file annotations. All values are
-Booleans and default to False. See :hg:`help config.diff` for
-related options for the diff command.
-
-``ignorews``
-    Ignore white space when comparing lines.
-
-``ignorewseol``
-    Ignore white space at the end of a line when comparing lines.
-
-``ignorewsamount``
-    Ignore changes in the amount of white space.
-
-``ignoreblanklines``
-    Ignore changes whose lines are all blank.
-
-
-``auth``
---------
-
-Authentication credentials and other authentication-like configuration
-for HTTP connections. This section allows you to store usernames and
-passwords for use when logging *into* HTTP servers. See
-:hg:`help config.web` if you want to configure *who* can login to
-your HTTP server.
-
-The following options apply to all hosts.
-
-``cookiefile``
-    Path to a file containing HTTP cookie lines. Cookies matching a
-    host will be sent automatically.
-
-    The file format uses the Mozilla cookies.txt format, which defines cookies
-    on their own lines. Each line contains 7 fields delimited by the tab
-    character (domain, is_domain_cookie, path, is_secure, expires, name,
-    value). For more info, do an Internet search for "Netscape cookies.txt
-    format."
-
-    Note: the cookies parser does not handle port numbers on domains. You
-    will need to remove ports from the domain for the cookie to be recognized.
-    This could result in a cookie being disclosed to an unwanted server.
-
-    The cookies file is read-only.
-
-Other options in this section are grouped by name and have the following
-format::
-
-    <name>.<argument> = <value>
-
-where ``<name>`` is used to group arguments into authentication
-entries. Example::
-
-    foo.prefix = hg.intevation.de/mercurial
-    foo.username = foo
-    foo.password = bar
-    foo.schemes = http https
-
-    bar.prefix = secure.example.org
-    bar.key = path/to/file.key
-    bar.cert = path/to/file.cert
-    bar.schemes = https
-
-Supported arguments:
-
-``prefix``
-    Either ``*`` or a URI prefix with or without the scheme part.
-    The authentication entry with the longest matching prefix is used
-    (where ``*`` matches everything and counts as a match of length
-    1). If the prefix doesn't include a scheme, the match is performed
-    against the URI with its scheme stripped as well, and the schemes
-    argument, q.v., is then subsequently consulted.
-
-``username``
-    Optional. Username to authenticate with. If not given, and the
-    remote site requires basic or digest authentication, the user will
-    be prompted for it. Environment variables are expanded in the
-    username letting you do ``foo.username = $USER``. If the URI
-    includes a username, only ``[auth]`` entries with a matching
-    username or without a username will be considered.
-
-``password``
-    Optional. Password to authenticate with. If not given, and the
-    remote site requires basic or digest authentication, the user
-    will be prompted for it.
-
-``key``
-    Optional. PEM encoded client certificate key file. Environment
-    variables are expanded in the filename.
-
-``cert``
-    Optional. PEM encoded client certificate chain file. Environment
-    variables are expanded in the filename.
-
-``schemes``
-    Optional. Space separated list of URI schemes to use this
-    authentication entry with. Only used if the prefix doesn't include
-    a scheme. Supported schemes are http and https. They will match
-    static-http and static-https respectively, as well.
-    (default: https)
-
-If no suitable authentication entry is found, the user is prompted
-for credentials as usual if required by the remote.
-
-``color``
----------
-
-Configure the Mercurial color mode. For details about how to define your custom
-effect and style see :hg:`help color`.
-
-``mode``
-    String: control the method used to output color. One of ``auto``, ``ansi``,
-    ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
-    use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
-    terminal. Any invalid value will disable color.
-
-``pagermode``
-    String: optional override of ``color.mode`` used with pager.
-
-    On some systems, terminfo mode may cause problems when using
-    color with ``less -R`` as a pager program. less with the -R option
-    will only display ECMA-48 color codes, and terminfo mode may sometimes
-    emit codes that less doesn't understand. You can work around this by
-    either using ansi mode (or auto mode), or by using less -r (which will
-    pass through all terminal control codes, not just color control
-    codes).
-
-    On some systems (such as MSYS in Windows), the terminal may support
-    a different color mode than the pager program.
-
-``commands``
-------------
-
-``commit.post-status``
-    Show status of files in the working directory after successful commit.
-    (default: False)
-
-``push.require-revs``
-    Require revisions to push be specified using one or more mechanisms such as
-    specifying them positionally on the command line, using ``-r``, ``-b``,
-    and/or ``-B`` on the command line, or using ``paths.<path>:pushrev`` in the
-    configuration. If this is enabled and revisions are not specified, the
-    command aborts.
-    (default: False)
-
-``resolve.confirm``
-    Confirm before performing action if no filename is passed.
-    (default: False)
-
-``resolve.explicit-re-merge``
-    Require uses of ``hg resolve`` to specify which action it should perform,
-    instead of re-merging files by default.
-    (default: False)
-
-``resolve.mark-check``
-    Determines what level of checking :hg:`resolve --mark` will perform before
-    marking files as resolved. Valid values are ``none`, ``warn``, and
-    ``abort``. ``warn`` will output a warning listing the file(s) that still
-    have conflict markers in them, but will still mark everything resolved.
-    ``abort`` will output the same warning but will not mark things as resolved.
-    If --all is passed and this is set to ``abort``, only a warning will be
-    shown (an error will not be raised).
-    (default: ``none``)
-
-``status.relative``
-    Make paths in :hg:`status` output relative to the current directory.
-    (default: False)
-
-``status.terse``
-    Default value for the --terse flag, which condenses status output.
-    (default: empty)
-
-``update.check``
-    Determines what level of checking :hg:`update` will perform before moving
-    to a destination revision. Valid values are ``abort``, ``none``,
-    ``linear``, and ``noconflict``. ``abort`` always fails if the working
-    directory has uncommitted changes. ``none`` performs no checking, and may
-    result in a merge with uncommitted changes. ``linear`` allows any update
-    as long as it follows a straight line in the revision history, and may
-    trigger a merge with uncommitted changes. ``noconflict`` will allow any
-    update which would not trigger a merge with uncommitted changes, if any
-    are present.
-    (default: ``linear``)
-
-``update.requiredest``
-    Require that the user pass a destination when running :hg:`update`.
-    For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
-    will be disallowed.
-    (default: False)
-
-``committemplate``
-------------------
-
-``changeset``
-    String: configuration in this section is used as the template to
-    customize the text shown in the editor when committing.
-
-In addition to pre-defined template keywords, commit log specific one
-below can be used for customization:
-
-``extramsg``
-    String: Extra message (typically 'Leave message empty to abort
-    commit.'). This may be changed by some commands or extensions.
-
-For example, the template configuration below shows as same text as
-one shown by default::
-
-    [committemplate]
-    changeset = {desc}\n\n
-        HG: Enter commit message.  Lines beginning with 'HG:' are removed.
-        HG: {extramsg}
-        HG: --
-        HG: user: {author}\n{ifeq(p2rev, "-1", "",
-       "HG: branch merge\n")
-       }HG: branch '{branch}'\n{if(activebookmark,
-       "HG: bookmark '{activebookmark}'\n")   }{subrepos %
-       "HG: subrepo {subrepo}\n"              }{file_adds %
-       "HG: added {file}\n"                   }{file_mods %
-       "HG: changed {file}\n"                 }{file_dels %
-       "HG: removed {file}\n"                 }{if(files, "",
-       "HG: no files changed\n")}
-
-``diff()``
-    String: show the diff (see :hg:`help templates` for detail)
-
-Sometimes it is helpful to show the diff of the changeset in the editor without
-having to prefix 'HG: ' to each line so that highlighting works correctly. For
-this, Mercurial provides a special string which will ignore everything below
-it::
-
-     HG: ------------------------ >8 ------------------------
-
-For example, the template configuration below will show the diff below the
-extra message::
-
-    [committemplate]
-    changeset = {desc}\n\n
-        HG: Enter commit message.  Lines beginning with 'HG:' are removed.
-        HG: {extramsg}
-        HG: ------------------------ >8 ------------------------
-        HG: Do not touch the line above.
-        HG: Everything below will be removed.
-        {diff()}
-
-.. note::
-
-   For some problematic encodings (see :hg:`help win32mbcs` for
-   detail), this customization should be configured carefully, to
-   avoid showing broken characters.
-
-   For example, if a multibyte character ending with backslash (0x5c) is
-   followed by the ASCII character 'n' in the customized template,
-   the sequence of backslash and 'n' is treated as line-feed unexpectedly
-   (and the multibyte character is broken, too).
-
-Customized template is used for commands below (``--edit`` may be
-required):
-
-- :hg:`backout`
-- :hg:`commit`
-- :hg:`fetch` (for merge commit only)
-- :hg:`graft`
-- :hg:`histedit`
-- :hg:`import`
-- :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
-- :hg:`rebase`
-- :hg:`shelve`
-- :hg:`sign`
-- :hg:`tag`
-- :hg:`transplant`
-
-Configuring items below instead of ``changeset`` allows showing
-customized message only for specific actions, or showing different
-messages for each action.
-
-- ``changeset.backout`` for :hg:`backout`
-- ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
-- ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
-- ``changeset.commit.normal.merge`` for :hg:`commit` on merges
-- ``changeset.commit.normal.normal`` for :hg:`commit` on other
-- ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
-- ``changeset.gpg.sign`` for :hg:`sign`
-- ``changeset.graft`` for :hg:`graft`
-- ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
-- ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
-- ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
-- ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
-- ``changeset.import.bypass`` for :hg:`import --bypass`
-- ``changeset.import.normal.merge`` for :hg:`import` on merges
-- ``changeset.import.normal.normal`` for :hg:`import` on other
-- ``changeset.mq.qnew`` for :hg:`qnew`
-- ``changeset.mq.qfold`` for :hg:`qfold`
-- ``changeset.mq.qrefresh`` for :hg:`qrefresh`
-- ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
-- ``changeset.rebase.merge`` for :hg:`rebase` on merges
-- ``changeset.rebase.normal`` for :hg:`rebase` on other
-- ``changeset.shelve.shelve`` for :hg:`shelve`
-- ``changeset.tag.add`` for :hg:`tag` without ``--remove``
-- ``changeset.tag.remove`` for :hg:`tag --remove`
-- ``changeset.transplant.merge`` for :hg:`transplant` on merges
-- ``changeset.transplant.normal`` for :hg:`transplant` on other
-
-These dot-separated lists of names are treated as hierarchical ones.
-For example, ``changeset.tag.remove`` customizes the commit message
-only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
-commit message for :hg:`tag` regardless of ``--remove`` option.
-
-When the external editor is invoked for a commit, the corresponding
-dot-separated list of names without the ``changeset.`` prefix
-(e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
-variable.
-
-In this section, items other than ``changeset`` can be referred from
-others. For example, the configuration to list committed files up
-below can be referred as ``{listupfiles}``::
-
-    [committemplate]
-    listupfiles = {file_adds %
-       "HG: added {file}\n"     }{file_mods %
-       "HG: changed {file}\n"   }{file_dels %
-       "HG: removed {file}\n"   }{if(files, "",
-       "HG: no files changed\n")}
-
-``decode/encode``
------------------
-
-Filters for transforming files on checkout/checkin. This would
-typically be used for newline processing or other
-localization/canonicalization of files.
-
-Filters consist of a filter pattern followed by a filter command.
-Filter patterns are globs by default, rooted at the repository root.
-For example, to match any file ending in ``.txt`` in the root
-directory only, use the pattern ``*.txt``. To match any file ending
-in ``.c`` anywhere in the repository, use the pattern ``**.c``.
-For each file only the first matching filter applies.
-
-The filter command can start with a specifier, either ``pipe:`` or
-``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
-
-A ``pipe:`` command must accept data on stdin and return the transformed
-data on stdout.
-
-Pipe example::
-
-  [encode]
-  # uncompress gzip files on checkin to improve delta compression
-  # note: not necessarily a good idea, just an example
-  *.gz = pipe: gunzip
-
-  [decode]
-  # recompress gzip files when writing them to the working dir (we
-  # can safely omit "pipe:", because it's the default)
-  *.gz = gzip
-
-A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
-with the name of a temporary file that contains the data to be
-filtered by the command. The string ``OUTFILE`` is replaced with the name
-of an empty temporary file, where the filtered data must be written by
-the command.
-
-.. container:: windows
-
-   .. note::
-
-     The tempfile mechanism is recommended for Windows systems,
-     where the standard shell I/O redirection operators often have
-     strange effects and may corrupt the contents of your files.
-
-This filter mechanism is used internally by the ``eol`` extension to
-translate line ending characters between Windows (CRLF) and Unix (LF)
-format. We suggest you use the ``eol`` extension for convenience.
-
-
-``defaults``
-------------
-
-(defaults are deprecated. Don't use them. Use aliases instead.)
-
-Use the ``[defaults]`` section to define command defaults, i.e. the
-default options/arguments to pass to the specified commands.
-
-The following example makes :hg:`log` run in verbose mode, and
-:hg:`status` show only the modified files, by default::
-
-  [defaults]
-  log = -v
-  status = -m
-
-The actual commands, instead of their aliases, must be used when
-defining command defaults. The command defaults will also be applied
-to the aliases of the commands defined.
-
-
-``diff``
---------
-
-Settings used when displaying diffs. Everything except for ``unified``
-is a Boolean and defaults to False. See :hg:`help config.annotate`
-for related options for the annotate command.
-
-``git``
-    Use git extended diff format.
-
-``nobinary``
-    Omit git binary patches.
-
-``nodates``
-    Don't include dates in diff headers.
-
-``noprefix``
-    Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
-
-``showfunc``
-    Show which function each change is in.
-
-``ignorews``
-    Ignore white space when comparing lines.
-
-``ignorewsamount``
-    Ignore changes in the amount of white space.
-
-``ignoreblanklines``
-    Ignore changes whose lines are all blank.
-
-``unified``
-    Number of lines of context to show.
-
-``word-diff``
-    Highlight changed words.
-
-``email``
----------
-
-Settings for extensions that send email messages.
-
-``from``
-    Optional. Email address to use in "From" header and SMTP envelope
-    of outgoing messages.
-
-``to``
-    Optional. Comma-separated list of recipients' email addresses.
-
-``cc``
-    Optional. Comma-separated list of carbon copy recipients'
-    email addresses.
-
-``bcc``
-    Optional. Comma-separated list of blind carbon copy recipients'
-    email addresses.
-
-``method``
-    Optional. Method to use to send email messages. If value is ``smtp``
-    (default), use SMTP (see the ``[smtp]`` section for configuration).
-    Otherwise, use as name of program to run that acts like sendmail
-    (takes ``-f`` option for sender, list of recipients on command line,
-    message on stdin). Normally, setting this to ``sendmail`` or
-    ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
-
-``charsets``
-    Optional. Comma-separated list of character sets considered
-    convenient for recipients. Addresses, headers, and parts not
-    containing patches of outgoing messages will be encoded in the
-    first character set to which conversion from local encoding
-    (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
-    conversion fails, the text in question is sent as is.
-    (default: '')
-
-    Order of outgoing email character sets:
-
-    1. ``us-ascii``: always first, regardless of settings
-    2. ``email.charsets``: in order given by user
-    3. ``ui.fallbackencoding``: if not in email.charsets
-    4. ``$HGENCODING``: if not in email.charsets
-    5. ``utf-8``: always last, regardless of settings
-
-Email example::
-
-  [email]
-  from = Joseph User <joe.user@example.com>
-  method = /usr/sbin/sendmail
-  # charsets for western Europeans
-  # us-ascii, utf-8 omitted, as they are tried first and last
-  charsets = iso-8859-1, iso-8859-15, windows-1252
-
-
-``extensions``
---------------
-
-Mercurial has an extension mechanism for adding new features. To
-enable an extension, create an entry for it in this section.
-
-If you know that the extension is already in Python's search path,
-you can give the name of the module, followed by ``=``, with nothing
-after the ``=``.
-
-Otherwise, give a name that you choose, followed by ``=``, followed by
-the path to the ``.py`` file (including the file name extension) that
-defines the extension.
-
-To explicitly disable an extension that is enabled in an hgrc of
-broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
-or ``foo = !`` when path is not supplied.
-
-Example for ``~/.hgrc``::
-
-  [extensions]
-  # (the churn extension will get loaded from Mercurial's path)
-  churn =
-  # (this extension will get loaded from the file specified)
-  myfeature = ~/.hgext/myfeature.py
-
-
-``format``
-----------
-
-Configuration that controls the repository format. Newer format options are more
-powerful but incompatible with some older versions of Mercurial. Format options
-are considered at repository initialization only. You need to make a new clone
-for config change to be taken into account.
-
-For more details about repository format and version compatibility, see
-https://www.mercurial-scm.org/wiki/MissingRequirement
-
-``usegeneraldelta``
-    Enable or disable the "generaldelta" repository format which improves
-    repository compression by allowing "revlog" to store delta against arbitrary
-    revision instead of the previous stored one. This provides significant
-    improvement for repositories with branches.
-
-    Repositories with this on-disk format require Mercurial version 1.9.
-
-    Enabled by default.
-
-``dotencode``
-    Enable or disable the "dotencode" repository format which enhances
-    the "fncache" repository format (which has to be enabled to use
-    dotencode) to avoid issues with filenames starting with ._ on
-    Mac OS X and spaces on Windows.
-
-    Repositories with this on-disk format require Mercurial version 1.7.
-
-    Enabled by default.
-
-``usefncache``
-    Enable or disable the "fncache" repository format which enhances
-    the "store" repository format (which has to be enabled to use
-    fncache) to allow longer filenames and avoids using Windows
-    reserved names, e.g. "nul".
-
-    Repositories with this on-disk format require Mercurial version 1.1.
-
-    Enabled by default.
-
-``usestore``
-    Enable or disable the "store" repository format which improves
-    compatibility with systems that fold case or otherwise mangle
-    filenames. Disabling this option will allow you to store longer filenames
-    in some situations at the expense of compatibility.
-
-    Repositories with this on-disk format require Mercurial version 0.9.4.
-
-    Enabled by default.
-
-``sparse-revlog``
-    Enable or disable the ``sparse-revlog`` delta strategy. This format improves
-    delta re-use inside revlog. For very branchy repositories, it results in a
-    smaller store. For repositories with many revisions, it also helps
-    performance (by using shortened delta chains.)
-
-    Repositories with this on-disk format require Mercurial version 4.7
-
-    Enabled by default.
-
-``revlog-compression``
-    Compression algorithm used by revlog. Supported value are `zlib` and `zstd`.
-    The `zlib` engine is the historical default of Mercurial. `zstd` is a newer
-    format that is usually a net win over `zlib` operating faster at better
-    compression rate. Use `zstd` to reduce CPU usage.
-
-    On some system, Mercurial installation may lack `zstd` supports. Default is `zlib`.
-
-``bookmarks-in-store``
-    Store bookmarks in .hg/store/. This means that bookmarks are shared when
-    using `hg share` regardless of the `-B` option.
-
-    Repositories with this on-disk format require Mercurial version 5.1.
-
-    Disabled by default.
-
-
-``graph``
----------
-
-Web graph view configuration. This section let you change graph
-elements display properties by branches, for instance to make the
-``default`` branch stand out.
-
-Each line has the following format::
-
-    <branch>.<argument> = <value>
-
-where ``<branch>`` is the name of the branch being
-customized. Example::
-
-    [graph]
-    # 2px width
-    default.width = 2
-    # red color
-    default.color = FF0000
-
-Supported arguments:
-
-``width``
-    Set branch edges width in pixels.
-
-``color``
-    Set branch edges color in hexadecimal RGB notation.
-
-``hooks``
----------
-
-Commands or Python functions that get automatically executed by
-various actions such as starting or finishing a commit. Multiple
-hooks can be run for the same action by appending a suffix to the
-action. Overriding a site-wide hook can be done by changing its
-value or setting it to an empty string.  Hooks can be prioritized
-by adding a prefix of ``priority.`` to the hook name on a new line
-and setting the priority. The default priority is 0.
-
-Example ``.hg/hgrc``::
-
-  [hooks]
-  # update working directory after adding changesets
-  changegroup.update = hg update
-  # do not use the site-wide hook
-  incoming =
-  incoming.email = /my/email/hook
-  incoming.autobuild = /my/build/hook
-  # force autobuild hook to run before other incoming hooks
-  priority.incoming.autobuild = 1
-
-Most hooks are run with environment variables set that give useful
-additional information. For each hook below, the environment variables
-it is passed are listed with names in the form ``$HG_foo``. The
-``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
-They contain the type of hook which triggered the run and the full name
-of the hook in the config, respectively. In the example above, this will
-be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
-
-.. container:: windows
-
-  Some basic Unix syntax can be enabled for portability, including ``$VAR``
-  and ``${VAR}`` style variables.  A ``~`` followed by ``\`` or ``/`` will
-  be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
-  on Unix.  To use a literal ``$`` or ``~``, it must be escaped with a back
-  slash or inside of a strong quote.  Strong quotes will be replaced by
-  double quotes after processing.
-
-  This feature is enabled by adding a prefix of ``tonative.`` to the hook
-  name on a new line, and setting it to ``True``.  For example::
-
-    [hooks]
-    incoming.autobuild = /my/build/hook
-    # enable translation to cmd.exe syntax for autobuild hook
-    tonative.incoming.autobuild = True
-
-``changegroup``
-  Run after a changegroup has been added via push, pull or unbundle.  The ID of
-  the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
-  The URL from which changes came is in ``$HG_URL``.
-
-``commit``
-  Run after a changeset has been created in the local repository. The ID
-  of the newly created changeset is in ``$HG_NODE``. Parent changeset
-  IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
-
-``incoming``
-  Run after a changeset has been pulled, pushed, or unbundled into
-  the local repository. The ID of the newly arrived changeset is in
-  ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
-
-``outgoing``
-  Run after sending changes from the local repository to another. The ID of
-  first changeset sent is in ``$HG_NODE``. The source of operation is in
-  ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
-
-``post-<command>``
-  Run after successful invocations of the associated command. The
-  contents of the command line are passed as ``$HG_ARGS`` and the result
-  code in ``$HG_RESULT``. Parsed command line arguments are passed as
-  ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
-  the python data internally passed to <command>. ``$HG_OPTS`` is a
-  dictionary of options (with unspecified options set to their defaults).
-  ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
-
-``fail-<command>``
-  Run after a failed invocation of an associated command. The contents
-  of the command line are passed as ``$HG_ARGS``. Parsed command line
-  arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
-  string representations of the python data internally passed to
-  <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
-  options set to their defaults). ``$HG_PATS`` is a list of arguments.
-  Hook failure is ignored.
-
-``pre-<command>``
-  Run before executing the associated command. The contents of the
-  command line are passed as ``$HG_ARGS``. Parsed command line arguments
-  are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
-  representations of the data internally passed to <command>. ``$HG_OPTS``
-  is a dictionary of options (with unspecified options set to their
-  defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
-  failure, the command doesn't execute and Mercurial returns the failure
-  code.
-
-``prechangegroup``
-  Run before a changegroup is added via push, pull or unbundle. Exit
-  status 0 allows the changegroup to proceed. A non-zero status will
-  cause the push, pull or unbundle to fail. The URL from which changes
-  will come is in ``$HG_URL``.
-
-``precommit``
-  Run before starting a local commit. Exit status 0 allows the
-  commit to proceed. A non-zero status will cause the commit to fail.
-  Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
-
-``prelistkeys``
-  Run before listing pushkeys (like bookmarks) in the
-  repository. A non-zero status will cause failure. The key namespace is
-  in ``$HG_NAMESPACE``.
-
-``preoutgoing``
-  Run before collecting changes to send from the local repository to
-  another. A non-zero status will cause failure. This lets you prevent
-  pull over HTTP or SSH. It can also prevent propagating commits (via
-  local pull, push (outbound) or bundle commands), but not completely,
-  since you can just copy files instead. The source of operation is in
-  ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
-  SSH or HTTP repository. If "push", "pull" or "bundle", the operation
-  is happening on behalf of a repository on same system.
-
-``prepushkey``
-  Run before a pushkey (like a bookmark) is added to the
-  repository. A non-zero status will cause the key to be rejected. The
-  key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
-  the old value (if any) is in ``$HG_OLD``, and the new value is in
-  ``$HG_NEW``.
-
-``pretag``
-  Run before creating a tag. Exit status 0 allows the tag to be
-  created. A non-zero status will cause the tag to fail. The ID of the
-  changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
-  tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
-
-``pretxnopen``
-  Run before any new repository transaction is open. The reason for the
-  transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
-  transaction will be in ``HG_TXNID``. A non-zero status will prevent the
-  transaction from being opened.
-
-``pretxnclose``
-  Run right before the transaction is actually finalized. Any repository change
-  will be visible to the hook program. This lets you validate the transaction
-  content or change it. Exit status 0 allows the commit to proceed. A non-zero
-  status will cause the transaction to be rolled back. The reason for the
-  transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
-  the transaction will be in ``HG_TXNID``. The rest of the available data will
-  vary according the transaction type. New changesets will add ``$HG_NODE``
-  (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
-  added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables.  Bookmark and
-  phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
-  respectively, etc.
-
-``pretxnclose-bookmark``
-  Run right before a bookmark change is actually finalized. Any repository
-  change will be visible to the hook program. This lets you validate the
-  transaction content or change it. Exit status 0 allows the commit to
-  proceed. A non-zero status will cause the transaction to be rolled back.
-  The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
-  bookmark location will be available in ``$HG_NODE`` while the previous
-  location will be available in ``$HG_OLDNODE``. In case of a bookmark
-  creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
-  will be empty.
-  In addition, the reason for the transaction opening will be in
-  ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
-  ``HG_TXNID``.
-
-``pretxnclose-phase``
-  Run right before a phase change is actually finalized. Any repository change
-  will be visible to the hook program. This lets you validate the transaction
-  content or change it. Exit status 0 allows the commit to proceed.  A non-zero
-  status will cause the transaction to be rolled back. The hook is called
-  multiple times, once for each revision affected by a phase change.
-  The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
-  while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
-  will be empty.  In addition, the reason for the transaction opening will be in
-  ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
-  ``HG_TXNID``. The hook is also run for newly added revisions. In this case
-  the ``$HG_OLDPHASE`` entry will be empty.
-
-``txnclose``
-  Run after any repository transaction has been committed. At this
-  point, the transaction can no longer be rolled back. The hook will run
-  after the lock is released. See :hg:`help config.hooks.pretxnclose` for
-  details about available variables.
-
-``txnclose-bookmark``
-  Run after any bookmark change has been committed. At this point, the
-  transaction can no longer be rolled back. The hook will run after the lock
-  is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
-  about available variables.
-
-``txnclose-phase``
-  Run after any phase change has been committed. At this point, the
-  transaction can no longer be rolled back. The hook will run after the lock
-  is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
-  available variables.
-
-``txnabort``
-  Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
-  for details about available variables.
-
-``pretxnchangegroup``
-  Run after a changegroup has been added via push, pull or unbundle, but before
-  the transaction has been committed. The changegroup is visible to the hook
-  program. This allows validation of incoming changes before accepting them.
-  The ID of the first new changeset is in ``$HG_NODE`` and last is in
-  ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
-  status will cause the transaction to be rolled back, and the push, pull or
-  unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
-
-``pretxncommit``
-  Run after a changeset has been created, but before the transaction is
-  committed. The changeset is visible to the hook program. This allows
-  validation of the commit message and changes. Exit status 0 allows the
-  commit to proceed. A non-zero status will cause the transaction to
-  be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
-  changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
-
-``preupdate``
-  Run before updating the working directory. Exit status 0 allows
-  the update to proceed. A non-zero status will prevent the update.
-  The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
-  merge, the ID of second new parent is in ``$HG_PARENT2``.
-
-``listkeys``
-  Run after listing pushkeys (like bookmarks) in the repository. The
-  key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
-  dictionary containing the keys and values.
-
-``pushkey``
-  Run after a pushkey (like a bookmark) is added to the
-  repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
-  ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
-  value is in ``$HG_NEW``.
-
-``tag``
-  Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
-  The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
-  the repository if ``$HG_LOCAL=0``.
-
-``update``
-  Run after updating the working directory. The changeset ID of first
-  new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
-  parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
-  update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
-
-.. note::
-
-   It is generally better to use standard hooks rather than the
-   generic pre- and post- command hooks, as they are guaranteed to be
-   called in the appropriate contexts for influencing transactions.
-   Also, hooks like "commit" will be called in all contexts that
-   generate a commit (e.g. tag) and not just the commit command.
-
-.. note::
-
-   Environment variables with empty values may not be passed to
-   hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
-   will have an empty value under Unix-like platforms for non-merge
-   changesets, while it will not be available at all under Windows.
-
-The syntax for Python hooks is as follows::
-
-  hookname = python:modulename.submodule.callable
-  hookname = python:/path/to/python/module.py:callable
-
-Python hooks are run within the Mercurial process. Each hook is
-called with at least three keyword arguments: a ui object (keyword
-``ui``), a repository object (keyword ``repo``), and a ``hooktype``
-keyword that tells what kind of hook is used. Arguments listed as
-environment variables above are passed as keyword arguments, with no
-``HG_`` prefix, and names in lower case.
-
-If a Python hook returns a "true" value or raises an exception, this
-is treated as a failure.
-
-
-``hostfingerprints``
---------------------
-
-(Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
-
-Fingerprints of the certificates of known HTTPS servers.
-
-A HTTPS connection to a server with a fingerprint configured here will
-only succeed if the servers certificate matches the fingerprint.
-This is very similar to how ssh known hosts works.
-
-The fingerprint is the SHA-1 hash value of the DER encoded certificate.
-Multiple values can be specified (separated by spaces or commas). This can
-be used to define both old and new fingerprints while a host transitions
-to a new certificate.
-
-The CA chain and web.cacerts is not used for servers with a fingerprint.
-
-For example::
-
-    [hostfingerprints]
-    hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
-    hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
-
-``hostsecurity``
-----------------
-
-Used to specify global and per-host security settings for connecting to
-other machines.
-
-The following options control default behavior for all hosts.
-
-``ciphers``
-    Defines the cryptographic ciphers to use for connections.
-
-    Value must be a valid OpenSSL Cipher List Format as documented at
-    https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
-
-    This setting is for advanced users only. Setting to incorrect values
-    can significantly lower connection security or decrease performance.
-    You have been warned.
-
-    This option requires Python 2.7.
-
-``minimumprotocol``
-    Defines the minimum channel encryption protocol to use.
-
-    By default, the highest version of TLS supported by both client and server
-    is used.
-
-    Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
-
-    When running on an old Python version, only ``tls1.0`` is allowed since
-    old versions of Python only support up to TLS 1.0.
-
-    When running a Python that supports modern TLS versions, the default is
-    ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
-    weakens security and should only be used as a feature of last resort if
-    a server does not support TLS 1.1+.
-
-Options in the ``[hostsecurity]`` section can have the form
-``hostname``:``setting``. This allows multiple settings to be defined on a
-per-host basis.
-
-The following per-host settings can be defined.
-
-``ciphers``
-    This behaves like ``ciphers`` as described above except it only applies
-    to the host on which it is defined.
-
-``fingerprints``
-    A list of hashes of the DER encoded peer/remote certificate. Values have
-    the form ``algorithm``:``fingerprint``. e.g.
-    ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
-    In addition, colons (``:``) can appear in the fingerprint part.
-
-    The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
-    ``sha512``.
-
-    Use of ``sha256`` or ``sha512`` is preferred.
-
-    If a fingerprint is specified, the CA chain is not validated for this
-    host and Mercurial will require the remote certificate to match one
-    of the fingerprints specified. This means if the server updates its
-    certificate, Mercurial will abort until a new fingerprint is defined.
-    This can provide stronger security than traditional CA-based validation
-    at the expense of convenience.
-
-    This option takes precedence over ``verifycertsfile``.
-
-``minimumprotocol``
-    This behaves like ``minimumprotocol`` as described above except it
-    only applies to the host on which it is defined.
-
-``verifycertsfile``
-    Path to file a containing a list of PEM encoded certificates used to
-    verify the server certificate. Environment variables and ``~user``
-    constructs are expanded in the filename.
-
-    The server certificate or the certificate's certificate authority (CA)
-    must match a certificate from this file or certificate verification
-    will fail and connections to the server will be refused.
-
-    If defined, only certificates provided by this file will be used:
-    ``web.cacerts`` and any system/default certificates will not be
-    used.
-
-    This option has no effect if the per-host ``fingerprints`` option
-    is set.
-
-    The format of the file is as follows::
-
-        -----BEGIN CERTIFICATE-----
-        ... (certificate in base64 PEM encoding) ...
-        -----END CERTIFICATE-----
-        -----BEGIN CERTIFICATE-----
-        ... (certificate in base64 PEM encoding) ...
-        -----END CERTIFICATE-----
-
-For example::
-
-    [hostsecurity]
-    hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
-    hg2.example.com:fingerprints = sha1:914f1aff87249c09b6859b88b1906d30756491ca, sha1:fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
-    hg3.example.com:fingerprints = sha256:9a:b0:dc:e2:75:ad:8a:b7:84:58:e5:1f:07:32:f1:87:e6:bd:24:22:af:b7:ce:8e:9c:b4:10:cf:b9:f4:0e:d2
-    foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
-
-To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
-when connecting to ``hg.example.com``::
-
-    [hostsecurity]
-    minimumprotocol = tls1.2
-    hg.example.com:minimumprotocol = tls1.1
-
-``http_proxy``
---------------
-
-Used to access web-based Mercurial repositories through a HTTP
-proxy.
-
-``host``
-    Host name and (optional) port of the proxy server, for example
-    "myproxy:8000".
-
-``no``
-    Optional. Comma-separated list of host names that should bypass
-    the proxy.
-
-``passwd``
-    Optional. Password to authenticate with at the proxy server.
-
-``user``
-    Optional. User name to authenticate with at the proxy server.
-
-``always``
-    Optional. Always use the proxy, even for localhost and any entries
-    in ``http_proxy.no``. (default: False)
-
-``http``
-----------
-
-Used to configure access to Mercurial repositories via HTTP.
-
-``timeout``
-    If set, blocking operations will timeout after that many seconds.
-    (default: None)
-
-``merge``
----------
-
-This section specifies behavior during merges and updates.
-
-``checkignored``
-   Controls behavior when an ignored file on disk has the same name as a tracked
-   file in the changeset being merged or updated to, and has different
-   contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
-   abort on such files. With ``warn``, warn on such files and back them up as
-   ``.orig``. With ``ignore``, don't print a warning and back them up as
-   ``.orig``. (default: ``abort``)
-
-``checkunknown``
-   Controls behavior when an unknown file that isn't ignored has the same name
-   as a tracked file in the changeset being merged or updated to, and has
-   different contents. Similar to ``merge.checkignored``, except for files that
-   are not ignored. (default: ``abort``)
-
-``on-failure``
-   When set to ``continue`` (the default), the merge process attempts to
-   merge all unresolved files using the merge chosen tool, regardless of
-   whether previous file merge attempts during the process succeeded or not.
-   Setting this to ``prompt`` will prompt after any merge failure continue
-   or halt the merge process. Setting this to ``halt`` will automatically
-   halt the merge process on any merge tool failure. The merge process
-   can be restarted by using the ``resolve`` command. When a merge is
-   halted, the repository is left in a normal ``unresolved`` merge state.
-   (default: ``continue``)
-
-``strict-capability-check``
-   Whether capabilities of internal merge tools are checked strictly
-   or not, while examining rules to decide merge tool to be used.
-   (default: False)
-
-``merge-patterns``
-------------------
-
-This section specifies merge tools to associate with particular file
-patterns. Tools matched here will take precedence over the default
-merge tool. Patterns are globs by default, rooted at the repository
-root.
-
-Example::
-
-  [merge-patterns]
-  **.c = kdiff3
-  **.jpg = myimgmerge
-
-``merge-tools``
----------------
-
-This section configures external merge tools to use for file-level
-merges. This section has likely been preconfigured at install time.
-Use :hg:`config merge-tools` to check the existing configuration.
-Also see :hg:`help merge-tools` for more details.
-
-Example ``~/.hgrc``::
-
-  [merge-tools]
-  # Override stock tool location
-  kdiff3.executable = ~/bin/kdiff3
-  # Specify command line
-  kdiff3.args = $base $local $other -o $output
-  # Give higher priority
-  kdiff3.priority = 1
-
-  # Changing the priority of preconfigured tool
-  meld.priority = 0
-
-  # Disable a preconfigured tool
-  vimdiff.disabled = yes
-
-  # Define new tool
-  myHtmlTool.args = -m $local $other $base $output
-  myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
-  myHtmlTool.priority = 1
-
-Supported arguments:
-
-``priority``
-  The priority in which to evaluate this tool.
-  (default: 0)
-
-``executable``
-  Either just the name of the executable or its pathname.
-
-  .. container:: windows
-
-    On Windows, the path can use environment variables with ${ProgramFiles}
-    syntax.
-
-  (default: the tool name)
-
-``args``
-  The arguments to pass to the tool executable. You can refer to the
-  files being merged as well as the output file through these
-  variables: ``$base``, ``$local``, ``$other``, ``$output``.
-
-  The meaning of ``$local`` and ``$other`` can vary depending on which action is
-  being performed. During an update or merge, ``$local`` represents the original
-  state of the file, while ``$other`` represents the commit you are updating to or
-  the commit you are merging with. During a rebase, ``$local`` represents the
-  destination of the rebase, and ``$other`` represents the commit being rebased.
-
-  Some operations define custom labels to assist with identifying the revisions,
-  accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
-  labels are not available, these will be ``local``, ``other``, and ``base``,
-  respectively.
-  (default: ``$local $base $other``)
-
-``premerge``
-  Attempt to run internal non-interactive 3-way merge tool before
-  launching external tool.  Options are ``true``, ``false``, ``keep`` or
-  ``keep-merge3``. The ``keep`` option will leave markers in the file if the
-  premerge fails. The ``keep-merge3`` will do the same but include information
-  about the base of the merge in the marker (see internal :merge3 in
-  :hg:`help merge-tools`).
-  (default: True)
-
-``binary``
-  This tool can merge binary files. (default: False, unless tool
-  was selected by file pattern match)
-
-``symlink``
-  This tool can merge symlinks. (default: False)
-
-``check``
-  A list of merge success-checking options:
-
-  ``changed``
-    Ask whether merge was successful when the merged file shows no changes.
-  ``conflicts``
-    Check whether there are conflicts even though the tool reported success.
-  ``prompt``
-    Always prompt for merge success, regardless of success reported by tool.
-
-``fixeol``
-  Attempt to fix up EOL changes caused by the merge tool.
-  (default: False)
-
-``gui``
-  This tool requires a graphical interface to run. (default: False)
-
-``mergemarkers``
-  Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
-  ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
-  ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
-  markers generated during premerge will be ``detailed`` if either this option or
-  the corresponding option in the ``[ui]`` section is ``detailed``.
-  (default: ``basic``)
-
-``mergemarkertemplate``
-  This setting can be used to override ``mergemarkertemplate`` from the ``[ui]``
-  section on a per-tool basis; this applies to the ``$label``-prefixed variables
-  and to the conflict markers that are generated if ``premerge`` is ``keep` or
-  ``keep-merge3``. See the corresponding variable in ``[ui]`` for more
-  information.
-
-.. container:: windows
-
-  ``regkey``
-    Windows registry key which describes install location of this
-    tool. Mercurial will search for this key first under
-    ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
-    (default: None)
-
-  ``regkeyalt``
-    An alternate Windows registry key to try if the first key is not
-    found.  The alternate key uses the same ``regname`` and ``regappend``
-    semantics of the primary key.  The most common use for this key
-    is to search for 32bit applications on 64bit operating systems.
-    (default: None)
-
-  ``regname``
-    Name of value to read from specified registry key.
-    (default: the unnamed (default) value)
-
-  ``regappend``
-    String to append to the value read from the registry, typically
-    the executable name of the tool.
-    (default: None)
-
-``pager``
----------
-
-Setting used to control when to paginate and with what external tool. See
-:hg:`help pager` for details.
-
-``pager``
-    Define the external tool used as pager.
-
-    If no pager is set, Mercurial uses the environment variable $PAGER.
-    If neither pager.pager, nor $PAGER is set, a default pager will be
-    used, typically `less` on Unix and `more` on Windows. Example::
-
-      [pager]
-      pager = less -FRX
-
-``ignore``
-    List of commands to disable the pager for. Example::
-
-      [pager]
-      ignore = version, help, update
-
-``patch``
----------
-
-Settings used when applying patches, for instance through the 'import'
-command or with Mercurial Queues extension.
-
-``eol``
-    When set to 'strict' patch content and patched files end of lines
-    are preserved. When set to ``lf`` or ``crlf``, both files end of
-    lines are ignored when patching and the result line endings are
-    normalized to either LF (Unix) or CRLF (Windows). When set to
-    ``auto``, end of lines are again ignored while patching but line
-    endings in patched files are normalized to their original setting
-    on a per-file basis. If target file does not exist or has no end
-    of line, patch line endings are preserved.
-    (default: strict)
-
-``fuzz``
-    The number of lines of 'fuzz' to allow when applying patches. This
-    controls how much context the patcher is allowed to ignore when
-    trying to apply a patch.
-    (default: 2)
-
-``paths``
----------
-
-Assigns symbolic names and behavior to repositories.
-
-Options are symbolic names defining the URL or directory that is the
-location of the repository. Example::
-
-    [paths]
-    my_server = https://example.com/my_repo
-    local_path = /home/me/repo
-
-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`.
-
-Options containing colons (``:``) denote sub-options that can influence
-behavior for that specific path. Example::
-
-    [paths]
-    my_server = https://example.com/my_path
-    my_server:pushurl = ssh://example.com/my_path
-
-The following sub-options can be defined:
-
-``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.
-
-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
-   repository was cloned from.
-
-``default-push``
-   (deprecated) The URL or directory for the default :hg:`push` location.
-   ``default:pushurl`` should be used instead.
-
-``phases``
-----------
-
-Specifies default handling of phases. See :hg:`help phases` for more
-information about working with phases.
-
-``publish``
-    Controls draft phase behavior when working as a server. When true,
-    pushed changesets are set to public in both client and server and
-    pulled or cloned changesets are set to public in the client.
-    (default: True)
-
-``new-commit``
-    Phase of newly-created commits.
-    (default: draft)
-
-``checksubrepos``
-    Check the phase of the current revision of each subrepository. Allowed
-    values are "ignore", "follow" and "abort". For settings other than
-    "ignore", the phase of the current revision of each subrepository is
-    checked before committing the parent repository. If any of those phases is
-    greater than the phase of the parent repository (e.g. if a subrepo is in a
-    "secret" phase while the parent repo is in "draft" phase), the commit is
-    either aborted (if checksubrepos is set to "abort") or the higher phase is
-    used for the parent repository commit (if set to "follow").
-    (default: follow)
-
-
-``profiling``
--------------
-
-Specifies profiling type, format, and file output. Two profilers are
-supported: an instrumenting profiler (named ``ls``), and a sampling
-profiler (named ``stat``).
-
-In this section description, 'profiling data' stands for the raw data
-collected during profiling, while 'profiling report' stands for a
-statistical text report generated from the profiling data.
-
-``enabled``
-    Enable the profiler.
-    (default: false)
-
-    This is equivalent to passing ``--profile`` on the command line.
-
-``type``
-    The type of profiler to use.
-    (default: stat)
-
-    ``ls``
-      Use Python's built-in instrumenting profiler. This profiler
-      works on all platforms, but each line number it reports is the
-      first line of a function. This restriction makes it difficult to
-      identify the expensive parts of a non-trivial function.
-    ``stat``
-      Use a statistical profiler, statprof. This profiler is most
-      useful for profiling commands that run for longer than about 0.1
-      seconds.
-
-``format``
-    Profiling format.  Specific to the ``ls`` instrumenting profiler.
-    (default: text)
-
-    ``text``
-      Generate a profiling report. When saving to a file, it should be
-      noted that only the report is saved, and the profiling data is
-      not kept.
-    ``kcachegrind``
-      Format profiling data for kcachegrind use: when saving to a
-      file, the generated file can directly be loaded into
-      kcachegrind.
-
-``statformat``
-    Profiling format for the ``stat`` profiler.
-    (default: hotpath)
-
-    ``hotpath``
-      Show a tree-based display containing the hot path of execution (where
-      most time was spent).
-    ``bymethod``
-      Show a table of methods ordered by how frequently they are active.
-    ``byline``
-      Show a table of lines in files ordered by how frequently they are active.
-    ``json``
-      Render profiling data as JSON.
-
-``frequency``
-    Sampling frequency.  Specific to the ``stat`` sampling profiler.
-    (default: 1000)
-
-``output``
-    File path where profiling data or report should be saved. If the
-    file exists, it is replaced. (default: None, data is printed on
-    stderr)
-
-``sort``
-    Sort field.  Specific to the ``ls`` instrumenting profiler.
-    One of ``callcount``, ``reccallcount``, ``totaltime`` and
-    ``inlinetime``.
-    (default: inlinetime)
-
-``time-track``
-    Control if the stat profiler track ``cpu`` or ``real`` time.
-    (default: ``cpu`` on Windows, otherwise ``real``)
-
-``limit``
-    Number of lines to show. Specific to the ``ls`` instrumenting profiler.
-    (default: 30)
-
-``nested``
-    Show at most this number of lines of drill-down info after each main entry.
-    This can help explain the difference between Total and Inline.
-    Specific to the ``ls`` instrumenting profiler.
-    (default: 0)
-
-``showmin``
-    Minimum fraction of samples an entry must have for it to be displayed.
-    Can be specified as a float between ``0.0`` and ``1.0`` or can have a
-    ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
-
-    Only used by the ``stat`` profiler.
-
-    For the ``hotpath`` format, default is ``0.05``.
-    For the ``chrome`` format, default is ``0.005``.
-
-    The option is unused on other formats.
-
-``showmax``
-    Maximum fraction of samples an entry can have before it is ignored in
-    display. Values format is the same as ``showmin``.
-
-    Only used by the ``stat`` profiler.
-
-    For the ``chrome`` format, default is ``0.999``.
-
-    The option is unused on other formats.
-
-``showtime``
-    Show time taken as absolute durations, in addition to percentages.
-    Only used by the ``hotpath`` format.
-    (default: true)
-
-``progress``
-------------
-
-Mercurial commands can draw progress bars that are as informative as
-possible. Some progress bars only offer indeterminate information, while others
-have a definite end point.
-
-``debug``
-    Whether to print debug info when updating the progress bar. (default: False)
-
-``delay``
-    Number of seconds (float) before showing the progress bar. (default: 3)
-
-``changedelay``
-    Minimum delay before showing a new topic. When set to less than 3 * refresh,
-    that value will be used instead. (default: 1)
-
-``estimateinterval``
-    Maximum sampling interval in seconds for speed and estimated time
-    calculation. (default: 60)
-
-``refresh``
-    Time in seconds between refreshes of the progress bar. (default: 0.1)
-
-``format``
-    Format of the progress bar.
-
-    Valid entries for the format field are ``topic``, ``bar``, ``number``,
-    ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
-    last 20 characters of the item, but this can be changed by adding either
-    ``-<num>`` which would take the last num characters, or ``+<num>`` for the
-    first num characters.
-
-    (default: topic bar number estimate)
-
-``width``
-    If set, the maximum width of the progress information (that is, min(width,
-    term width) will be used).
-
-``clear-complete``
-    Clear the progress bar after it's done. (default: True)
-
-``disable``
-    If true, don't show a progress bar.
-
-``assume-tty``
-    If true, ALWAYS show a progress bar, unless disable is given.
-
-``rebase``
-----------
-
-``evolution.allowdivergence``
-    Default to False, when True allow creating divergence when performing
-    rebase of obsolete changesets.
-
-``revsetalias``
----------------
-
-Alias definitions for revsets. See :hg:`help revsets` for details.
-
-``rewrite``
------------
-
-``backup-bundle``
-    Whether to save stripped changesets to a bundle file. (default: True)
-
-``update-timestamp``
-    If true, updates the date and time of the changeset to current. It is only
-    applicable for `hg amend`, `hg commit --amend` and `hg uncommit` in the
-    current version.
-
-``storage``
------------
-
-Control the strategy Mercurial uses internally to store history. Options in this
-category impact performance and repository size.
-
-``revlog.optimize-delta-parent-choice``
-    When storing a merge revision, both parents will be equally considered as
-    a possible delta base. This results in better delta selection and improved
-    revlog compression. This option is enabled by default.
-
-    Turning this option off can result in large increase of repository size for
-    repository with many merges.
-
-``revlog.reuse-external-delta-parent``
-    Control the order in which delta parents are considered when adding new
-    revisions from an external source.
-    (typically: apply bundle from `hg pull` or `hg push`).
-
-    New revisions are usually provided as a delta against other revisions. By
-    default, Mercurial will try to reuse this delta first, therefore using the
-    same "delta parent" as the source. Directly using delta's from the source
-    reduces CPU usage and usually speeds up operation. However, in some case,
-    the source might have sub-optimal delta bases and forcing their reevaluation
-    is useful. For example, pushes from an old client could have sub-optimal
-    delta's parent that the server want to optimize. (lack of general delta, bad
-    parents, choice, lack of sparse-revlog, etc).
-
-    This option is enabled by default. Turning it off will ensure bad delta
-    parent choices from older client do not propagate to this repository, at
-    the cost of a small increase in CPU consumption.
-
-    Note: this option only control the order in which delta parents are
-    considered.  Even when disabled, the existing delta from the source will be
-    reused if the same delta parent is selected.
-
-``revlog.reuse-external-delta``
-    Control the reuse of delta from external source.
-    (typically: apply bundle from `hg pull` or `hg push`).
-
-    New revisions are usually provided as a delta against another revision. By
-    default, Mercurial will not recompute the same delta again, trusting
-    externally provided deltas. There have been rare cases of small adjustment
-    to the diffing algorithm in the past. So in some rare case, recomputing
-    delta provided by ancient clients can provides better results. Disabling
-    this option means going through a full delta recomputation for all incoming
-    revisions. It means a large increase in CPU usage and will slow operations
-    down.
-
-    This option is enabled by default. When disabled, it also disables the
-    related ``storage.revlog.reuse-external-delta-parent`` option.
-
-``revlog.zlib.level``
-    Zlib compression level used when storing data into the repository. Accepted
-    Value range from 1 (lowest compression) to 9 (highest compression). Zlib
-    default value is 6.
-
-
-``revlog.zstd.level``
-    zstd compression level used when storing data into the repository. Accepted
-    Value range from 1 (lowest compression) to 22 (highest compression).
-    (default 3)
-
-``server``
-----------
-
-Controls generic server settings.
-
-``bookmarks-pushkey-compat``
-    Trigger pushkey hook when being pushed bookmark updates. This config exist
-    for compatibility purpose (default to True)
-
-    If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
-    movement we recommend you migrate them to ``txnclose-bookmark`` and
-    ``pretxnclose-bookmark``.
-
-``compressionengines``
-    List of compression engines and their relative priority to advertise
-    to clients.
-
-    The order of compression engines determines their priority, the first
-    having the highest priority. If a compression engine is not listed
-    here, it won't be advertised to clients.
-
-    If not set (the default), built-in defaults are used. Run
-    :hg:`debuginstall` to list available compression engines and their
-    default wire protocol priority.
-
-    Older Mercurial clients only support zlib compression and this setting
-    has no effect for legacy clients.
-
-``uncompressed``
-    Whether to allow clients to clone a repository using the
-    uncompressed streaming protocol. This transfers about 40% more
-    data than a regular clone, but uses less memory and CPU on both
-    server and client. Over a LAN (100 Mbps or better) or a very fast
-    WAN, an uncompressed streaming clone is a lot faster (~10x) than a
-    regular clone. Over most WAN connections (anything slower than
-    about 6 Mbps), uncompressed streaming is slower, because of the
-    extra data transfer overhead. This mode will also temporarily hold
-    the write lock while determining what data to transfer.
-    (default: True)
-
-``uncompressedallowsecret``
-    Whether to allow stream clones when the repository contains secret
-    changesets. (default: False)
-
-``preferuncompressed``
-    When set, clients will try to use the uncompressed streaming
-    protocol. (default: False)
-
-``disablefullbundle``
-    When set, servers will refuse attempts to do pull-based clones.
-    If this option is set, ``preferuncompressed`` and/or clone bundles
-    are highly recommended. Partial clones will still be allowed.
-    (default: False)
-
-``streamunbundle``
-    When set, servers will apply data sent from the client directly,
-    otherwise it will be written to a temporary file first. This option
-    effectively prevents concurrent pushes.
-
-``pullbundle``
-    When set, the server will check pullbundle.manifest for bundles
-    covering the requested heads and common nodes. The first matching
-    entry will be streamed to the client.
-
-    For HTTP transport, the stream will still use zlib compression
-    for older clients.
-
-``concurrent-push-mode``
-    Level of allowed race condition between two pushing clients.
-
-    - 'strict': push is abort if another client touched the repository
-      while the push was preparing. (default)
-    - 'check-related': push is only aborted if it affects head that got also
-      affected while the push was preparing.
-
-    This requires compatible client (version 4.3 and later). Old client will
-    use 'strict'.
-
-``validate``
-    Whether to validate the completeness of pushed changesets by
-    checking that all new file revisions specified in manifests are
-    present. (default: False)
-
-``maxhttpheaderlen``
-    Instruct HTTP clients not to send request headers longer than this
-    many bytes. (default: 1024)
-
-``bundle1``
-    Whether to allow clients to push and pull using the legacy bundle1
-    exchange format. (default: True)
-
-``bundle1gd``
-    Like ``bundle1`` but only used if the repository is using the
-    *generaldelta* storage format. (default: True)
-
-``bundle1.push``
-    Whether to allow clients to push using the legacy bundle1 exchange
-    format. (default: True)
-
-``bundle1gd.push``
-    Like ``bundle1.push`` but only used if the repository is using the
-    *generaldelta* storage format. (default: True)
-
-``bundle1.pull``
-    Whether to allow clients to pull using the legacy bundle1 exchange
-    format. (default: True)
-
-``bundle1gd.pull``
-    Like ``bundle1.pull`` but only used if the repository is using the
-    *generaldelta* storage format. (default: True)
-
-    Large repositories using the *generaldelta* storage format should
-    consider setting this option because converting *generaldelta*
-    repositories to the exchange format required by the bundle1 data
-    format can consume a lot of CPU.
-
-``bundle2.stream``
-    Whether to allow clients to pull using the bundle2 streaming protocol.
-    (default: True)
-
-``zliblevel``
-    Integer between ``-1`` and ``9`` that controls the zlib compression level
-    for wire protocol commands that send zlib compressed output (notably the
-    commands that send repository history data).
-
-    The default (``-1``) uses the default zlib compression level, which is
-    likely equivalent to ``6``. ``0`` means no compression. ``9`` means
-    maximum compression.
-
-    Setting this option allows server operators to make trade-offs between
-    bandwidth and CPU used. Lowering the compression lowers CPU utilization
-    but sends more bytes to clients.
-
-    This option only impacts the HTTP server.
-
-``zstdlevel``
-    Integer between ``1`` and ``22`` that controls the zstd compression level
-    for wire protocol commands. ``1`` is the minimal amount of compression and
-    ``22`` is the highest amount of compression.
-
-    The default (``3``) should be significantly faster than zlib while likely
-    delivering better compression ratios.
-
-    This option only impacts the HTTP server.
-
-    See also ``server.zliblevel``.
-
-``view``
-    Repository filter used when exchanging revisions with the peer.
-
-    The default view (``served``) excludes secret and hidden changesets.
-    Another useful value is ``immutable`` (no draft, secret or hidden
-    changesets). (EXPERIMENTAL)
-
-``smtp``
---------
-
-Configuration for extensions that need to send email messages.
-
-``host``
-    Host name of mail server, e.g. "mail.example.com".
-
-``port``
-    Optional. Port to connect to on mail server. (default: 465 if
-    ``tls`` is smtps; 25 otherwise)
-
-``tls``
-    Optional. Method to enable TLS when connecting to mail server: starttls,
-    smtps or none. (default: none)
-
-``username``
-    Optional. User name for authenticating with the SMTP server.
-    (default: None)
-
-``password``
-    Optional. Password for authenticating with the SMTP server. If not
-    specified, interactive sessions will prompt the user for a
-    password; non-interactive sessions will fail. (default: None)
-
-``local_hostname``
-    Optional. The hostname that the sender can use to identify
-    itself to the MTA.
-
-
-``subpaths``
-------------
-
-Subrepository source URLs can go stale if a remote server changes name
-or becomes temporarily unavailable. This section lets you define
-rewrite rules of the form::
-
-    <pattern> = <replacement>
-
-where ``pattern`` is a regular expression matching a subrepository
-source URL and ``replacement`` is the replacement string used to
-rewrite it. Groups can be matched in ``pattern`` and referenced in
-``replacements``. For instance::
-
-    http://server/(.*)-hg/ = http://hg.server/\1/
-
-rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
-
-Relative subrepository paths are first made absolute, and the
-rewrite rules are then applied on the full (absolute) path. If ``pattern``
-doesn't match the full path, an attempt is made to apply it on the
-relative path alone. The rules are applied in definition order.
-
-``subrepos``
-------------
-
-This section contains options that control the behavior of the
-subrepositories feature. See also :hg:`help subrepos`.
-
-Security note: auditing in Mercurial is known to be insufficient to
-prevent clone-time code execution with carefully constructed Git
-subrepos. It is unknown if a similar detect is present in Subversion
-subrepos. Both Git and Subversion subrepos are disabled by default
-out of security concerns. These subrepo types can be enabled using
-the respective options below.
-
-``allowed``
-    Whether subrepositories are allowed in the working directory.
-
-    When false, commands involving subrepositories (like :hg:`update`)
-    will fail for all subrepository types.
-    (default: true)
-
-``hg:allowed``
-    Whether Mercurial subrepositories are allowed in the working
-    directory. This option only has an effect if ``subrepos.allowed``
-    is true.
-    (default: true)
-
-``git:allowed``
-    Whether Git subrepositories are allowed in the working directory.
-    This option only has an effect if ``subrepos.allowed`` is true.
-
-    See the security note above before enabling Git subrepos.
-    (default: false)
-
-``svn:allowed``
-    Whether Subversion subrepositories are allowed in the working
-    directory. This option only has an effect if ``subrepos.allowed``
-    is true.
-
-    See the security note above before enabling Subversion subrepos.
-    (default: false)
-
-``templatealias``
------------------
-
-Alias definitions for templates. See :hg:`help templates` for details.
-
-``templates``
--------------
-
-Use the ``[templates]`` section to define template strings.
-See :hg:`help templates` for details.
-
-``trusted``
------------
-
-Mercurial will not use the settings in the
-``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
-user or to a trusted group, as various hgrc features allow arbitrary
-commands to be run. This issue is often encountered when configuring
-hooks or extensions for shared repositories or servers. However,
-the web interface will use some safe settings from the ``[web]``
-section.
-
-This section specifies what users and groups are trusted. The
-current user is always trusted. To trust everybody, list a user or a
-group with name ``*``. These settings must be placed in an
-*already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
-user or service running Mercurial.
-
-``users``
-  Comma-separated list of trusted users.
-
-``groups``
-  Comma-separated list of trusted groups.
-
-
-``ui``
-------
-
-User interface controls.
-
-``archivemeta``
-    Whether to include the .hg_archival.txt file containing meta data
-    (hashes for the repository base and for tip) in archives created
-    by the :hg:`archive` command or downloaded via hgweb.
-    (default: True)
-
-``askusername``
-    Whether to prompt for a username when committing. If True, and
-    neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
-    be prompted to enter a username. If no username is entered, the
-    default ``USER@HOST`` is used instead.
-    (default: False)
-
-``clonebundles``
-    Whether the "clone bundles" feature is enabled.
-
-    When enabled, :hg:`clone` may download and apply a server-advertised
-    bundle file from a URL instead of using the normal exchange mechanism.
-
-    This can likely result in faster and more reliable clones.
-
-    (default: True)
-
-``clonebundlefallback``
-    Whether failure to apply an advertised "clone bundle" from a server
-    should result in fallback to a regular clone.
-
-    This is disabled by default because servers advertising "clone
-    bundles" often do so to reduce server load. If advertised bundles
-    start mass failing and clients automatically fall back to a regular
-    clone, this would add significant and unexpected load to the server
-    since the server is expecting clone operations to be offloaded to
-    pre-generated bundles. Failing fast (the default behavior) ensures
-    clients don't overwhelm the server when "clone bundle" application
-    fails.
-
-    (default: False)
-
-``clonebundleprefers``
-    Defines preferences for which "clone bundles" to use.
-
-    Servers advertising "clone bundles" may advertise multiple available
-    bundles. Each bundle may have different attributes, such as the bundle
-    type and compression format. This option is used to prefer a particular
-    bundle over another.
-
-    The following keys are defined by Mercurial:
-
-    BUNDLESPEC
-       A bundle type specifier. These are strings passed to :hg:`bundle -t`.
-       e.g. ``gzip-v2`` or ``bzip2-v1``.
-
-    COMPRESSION
-       The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
-
-    Server operators may define custom keys.
-
-    Example values: ``COMPRESSION=bzip2``,
-    ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
-
-    By default, the first bundle advertised by the server is used.
-
-``color``
-    When to colorize output. Possible value are Boolean ("yes" or "no"), or
-    "debug", or "always". (default: "yes"). "yes" will use color whenever it
-    seems possible. See :hg:`help color` for details.
-
-``commitsubrepos``
-    Whether to commit modified subrepositories when committing the
-    parent repository. If False and one subrepository has uncommitted
-    changes, abort the commit.
-    (default: False)
-
-``debug``
-    Print debugging information. (default: False)
-
-``editor``
-    The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
-
-``fallbackencoding``
-    Encoding to try if it's not possible to decode the changelog using
-    UTF-8. (default: ISO-8859-1)
-
-``graphnodetemplate``
-    The template used to print changeset nodes in an ASCII revision graph.
-    (default: ``{graphnode}``)
-
-``ignore``
-    A file to read per-user ignore patterns from. This file should be
-    in the same format as a repository-wide .hgignore file. Filenames
-    are relative to the repository root. This option supports hook syntax,
-    so if you want to specify multiple ignore files, you can do so by
-    setting something like ``ignore.other = ~/.hgignore2``. For details
-    of the ignore file format, see the ``hgignore(5)`` man page.
-
-``interactive``
-    Allow to prompt the user. (default: True)
-
-``interface``
-    Select the default interface for interactive features (default: text).
-    Possible values are 'text' and 'curses'.
-
-``interface.chunkselector``
-    Select the interface for change recording (e.g. :hg:`commit -i`).
-    Possible values are 'text' and 'curses'.
-    This config overrides the interface specified by ui.interface.
-
-``large-file-limit``
-    Largest file size that gives no memory use warning.
-    Possible values are integers or 0 to disable the check.
-    (default: 10000000)
-
-``logtemplate``
-    Template string for commands that print changesets.
-
-``merge``
-    The conflict resolution program to use during a manual merge.
-    For more information on merge tools see :hg:`help merge-tools`.
-    For configuring merge tools see the ``[merge-tools]`` section.
-
-``mergemarkers``
-    Sets the merge conflict marker label styling. The ``detailed``
-    style uses the ``mergemarkertemplate`` setting to style the labels.
-    The ``basic`` style just uses 'local' and 'other' as the marker label.
-    One of ``basic`` or ``detailed``.
-    (default: ``basic``)
-
-``mergemarkertemplate``
-    The template used to print the commit description next to each conflict
-    marker during merge conflicts. See :hg:`help templates` for the template
-    format.
-
-    Defaults to showing the hash, tags, branches, bookmarks, author, and
-    the first line of the commit description.
-
-    If you use non-ASCII characters in names for tags, branches, bookmarks,
-    authors, and/or commit descriptions, you must pay attention to encodings of
-    managed files. At template expansion, non-ASCII characters use the encoding
-    specified by the ``--encoding`` global option, ``HGENCODING`` or other
-    environment variables that govern your locale. If the encoding of the merge
-    markers is different from the encoding of the merged files,
-    serious problems may occur.
-
-    Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
-
-``message-output``
-    Where to write status and error messages. (default: ``stdio``)
-
-    ``stderr``
-      Everything to stderr.
-    ``stdio``
-      Status to stdout, and error to stderr.
-
-``origbackuppath``
-    The path to a directory used to store generated .orig files. If the path is
-    not a directory, one will be created.  If set, files stored in this
-    directory have the same name as the original file and do not have a .orig
-    suffix.
-
-``paginate``
-  Control the pagination of command output (default: True). See :hg:`help pager`
-  for details.
-
-``patch``
-    An optional external tool that ``hg import`` and some extensions
-    will use for applying patches. By default Mercurial uses an
-    internal patch utility. The external tool must work as the common
-    Unix ``patch`` program. In particular, it must accept a ``-p``
-    argument to strip patch headers, a ``-d`` argument to specify the
-    current directory, a file name to patch, and a patch file to take
-    from stdin.
-
-    It is possible to specify a patch tool together with extra
-    arguments. For example, setting this option to ``patch --merge``
-    will use the ``patch`` program with its 2-way merge option.
-
-``portablefilenames``
-    Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
-    (default: ``warn``)
-
-    ``warn``
-      Print a warning message on POSIX platforms, if a file with a non-portable
-      filename is added (e.g. a file with a name that can't be created on
-      Windows because it contains reserved parts like ``AUX``, reserved
-      characters like ``:``, or would cause a case collision with an existing
-      file).
-
-    ``ignore``
-      Don't print a warning.
-
-    ``abort``
-      The command is aborted.
-
-    ``true``
-      Alias for ``warn``.
-
-    ``false``
-      Alias for ``ignore``.
-
-    .. container:: windows
-
-      On Windows, this configuration option is ignored and the command aborted.
-
-``pre-merge-tool-output-template``
-    A template that is printed before executing an external merge tool. This can
-    be used to print out additional context that might be useful to have during
-    the conflict resolution, such as the description of the various commits
-    involved or bookmarks/tags.
-
-    Additional information is available in the ``local`, ``base``, and ``other``
-    dicts. For example: ``{local.label}``, ``{base.name}``, or
-    ``{other.islink}``.
-
-``quiet``
-    Reduce the amount of output printed.
-    (default: False)
-
-``relative-paths``
-    Prefer relative paths in the UI.
-
-``remotecmd``
-    Remote command to use for clone/push/pull operations.
-    (default: ``hg``)
-
-``report_untrusted``
-    Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
-    trusted user or group.
-    (default: True)
-
-``slash``
-    (Deprecated. Use ``slashpath`` template filter instead.)
-
-    Display paths using a slash (``/``) as the path separator. This
-    only makes a difference on systems where the default path
-    separator is not the slash character (e.g. Windows uses the
-    backslash character (``\``)).
-    (default: False)
-
-``statuscopies``
-    Display copies in the status command.
-
-``ssh``
-    Command to use for SSH connections. (default: ``ssh``)
-
-``ssherrorhint``
-    A hint shown to the user in the case of SSH error (e.g.
-    ``Please see http://company/internalwiki/ssh.html``)
-
-``strict``
-    Require exact command names, instead of allowing unambiguous
-    abbreviations. (default: False)
-
-``style``
-    Name of style to use for command output.
-
-``supportcontact``
-    A URL where users should report a Mercurial traceback. Use this if you are a
-    large organisation with its own Mercurial deployment process and crash
-    reports should be addressed to your internal support.
-
-``textwidth``
-    Maximum width of help text. A longer line generated by ``hg help`` or
-    ``hg subcommand --help`` will be broken after white space to get this
-    width or the terminal width, whichever comes first.
-    A non-positive value will disable this and the terminal width will be
-    used. (default: 78)
-
-``timeout``
-    The timeout used when a lock is held (in seconds), a negative value
-    means no timeout. (default: 600)
-
-``timeout.warn``
-    Time (in seconds) before a warning is printed about held lock. A negative
-    value means no warning. (default: 0)
-
-``traceback``
-    Mercurial always prints a traceback when an unknown exception
-    occurs. Setting this to True will make Mercurial print a traceback
-    on all exceptions, even those recognized by Mercurial (such as
-    IOError or MemoryError). (default: False)
-
-``tweakdefaults``
-
-    By default Mercurial's behavior changes very little from release
-    to release, but over time the recommended config settings
-    shift. Enable this config to opt in to get automatic tweaks to
-    Mercurial's behavior over time. This config setting will have no
-    effect if ``HGPLAIN`` is set or ``HGPLAINEXCEPT`` is set and does
-    not include ``tweakdefaults``. (default: False)
-
-    It currently means::
-
-      .. tweakdefaultsmarker
-
-``username``
-    The committer of a changeset created when running "commit".
-    Typically a person's name and email address, e.g. ``Fred Widget
-    <fred@example.com>``. Environment variables in the
-    username are expanded.
-
-    (default: ``$EMAIL`` or ``username@hostname``. If the username in
-    hgrc is empty, e.g. if the system admin set ``username =`` in the
-    system hgrc, it has to be specified manually or in a different
-    hgrc file)
-
-``verbose``
-    Increase the amount of output printed. (default: False)
-
-
-``web``
--------
-
-Web interface configuration. The settings in this section apply to
-both the builtin webserver (started by :hg:`serve`) and the script you
-run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
-and WSGI).
-
-The Mercurial webserver does no authentication (it does not prompt for
-usernames and passwords to validate *who* users are), but it does do
-authorization (it grants or denies access for *authenticated users*
-based on settings in this section). You must either configure your
-webserver to do authentication for you, or disable the authorization
-checks.
-
-For a quick setup in a trusted environment, e.g., a private LAN, where
-you want it to accept pushes from anybody, you can use the following
-command line::
-
-    $ hg --config web.allow-push=* --config web.push_ssl=False serve
-
-Note that this will allow anybody to push anything to the server and
-that this should not be used for public servers.
-
-The full set of options is:
-
-``accesslog``
-    Where to output the access log. (default: stdout)
-
-``address``
-    Interface address to bind to. (default: all)
-
-``allow-archive``
-    List of archive format (bz2, gz, zip) allowed for downloading.
-    (default: empty)
-
-``allowbz2``
-    (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
-    revisions.
-    (default: False)
-
-``allowgz``
-    (DEPRECATED) Whether to allow .tar.gz downloading of repository
-    revisions.
-    (default: False)
-
-``allow-pull``
-    Whether to allow pulling from the repository. (default: True)
-
-``allow-push``
-    Whether to allow pushing to the repository. If empty or not set,
-    pushing is not allowed. If the special value ``*``, any remote
-    user can push, including unauthenticated users. Otherwise, the
-    remote user must have been authenticated, and the authenticated
-    user name must be present in this list. The contents of the
-    allow-push list are examined after the deny_push list.
-
-``allow_read``
-    If the user has not already been denied repository access due to
-    the contents of deny_read, this list determines whether to grant
-    repository access to the user. If this list is not empty, and the
-    user is unauthenticated or not present in the list, then access is
-    denied for the user. If the list is empty or not set, then access
-    is permitted to all users by default. Setting allow_read to the
-    special value ``*`` is equivalent to it not being set (i.e. access
-    is permitted to all users). The contents of the allow_read list are
-    examined after the deny_read list.
-
-``allowzip``
-    (DEPRECATED) Whether to allow .zip downloading of repository
-    revisions. This feature creates temporary files.
-    (default: False)
-
-``archivesubrepos``
-    Whether to recurse into subrepositories when archiving.
-    (default: False)
-
-``baseurl``
-    Base URL to use when publishing URLs in other locations, so
-    third-party tools like email notification hooks can construct
-    URLs. Example: ``http://hgserver/repos/``.
-
-``cacerts``
-    Path to file containing a list of PEM encoded certificate
-    authority certificates. Environment variables and ``~user``
-    constructs are expanded in the filename. If specified on the
-    client, then it will verify the identity of remote HTTPS servers
-    with these certificates.
-
-    To disable SSL verification temporarily, specify ``--insecure`` from
-    command line.
-
-    You can use OpenSSL's CA certificate file if your platform has
-    one. On most Linux systems this will be
-    ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
-    generate this file manually. The form must be as follows::
-
-        -----BEGIN CERTIFICATE-----
-        ... (certificate in base64 PEM encoding) ...
-        -----END CERTIFICATE-----
-        -----BEGIN CERTIFICATE-----
-        ... (certificate in base64 PEM encoding) ...
-        -----END CERTIFICATE-----
-
-``cache``
-    Whether to support caching in hgweb. (default: True)
-
-``certificate``
-    Certificate to use when running :hg:`serve`.
-
-``collapse``
-    With ``descend`` enabled, repositories in subdirectories are shown at
-    a single level alongside repositories in the current path. With
-    ``collapse`` also enabled, repositories residing at a deeper level than
-    the current path are grouped behind navigable directory entries that
-    lead to the locations of these repositories. In effect, this setting
-    collapses each collection of repositories found within a subdirectory
-    into a single entry for that subdirectory. (default: False)
-
-``comparisoncontext``
-    Number of lines of context to show in side-by-side file comparison. If
-    negative or the value ``full``, whole files are shown. (default: 5)
-
-    This setting can be overridden by a ``context`` request parameter to the
-    ``comparison`` command, taking the same values.
-
-``contact``
-    Name or email address of the person in charge of the repository.
-    (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
-
-``csp``
-    Send a ``Content-Security-Policy`` HTTP header with this value.
-
-    The value may contain a special string ``%nonce%``, which will be replaced
-    by a randomly-generated one-time use value. If the value contains
-    ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
-    one-time property of the nonce. This nonce will also be inserted into
-    ``<script>`` elements containing inline JavaScript.
-
-    Note: lots of HTML content sent by the server is derived from repository
-    data. Please consider the potential for malicious repository data to
-    "inject" itself into generated HTML content as part of your security
-    threat model.
-
-``deny_push``
-    Whether to deny pushing to the repository. If empty or not set,
-    push is not denied. If the special value ``*``, all remote users are
-    denied push. Otherwise, unauthenticated users are all denied, and
-    any authenticated user name present in this list is also denied. The
-    contents of the deny_push list are examined before the allow-push list.
-
-``deny_read``
-    Whether to deny reading/viewing of the repository. If this list is
-    not empty, unauthenticated users are all denied, and any
-    authenticated user name present in this list is also denied access to
-    the repository. If set to the special value ``*``, all remote users
-    are denied access (rarely needed ;). If deny_read is empty or not set,
-    the determination of repository access depends on the presence and
-    content of the allow_read list (see description). If both
-    deny_read and allow_read are empty or not set, then access is
-    permitted to all users by default. If the repository is being
-    served via hgwebdir, denied users will not be able to see it in
-    the list of repositories. The contents of the deny_read list have
-    priority over (are examined before) the contents of the allow_read
-    list.
-
-``descend``
-    hgwebdir indexes will not descend into subdirectories. Only repositories
-    directly in the current path will be shown (other repositories are still
-    available from the index corresponding to their containing path).
-
-``description``
-    Textual description of the repository's purpose or contents.
-    (default: "unknown")
-
-``encoding``
-    Character encoding name. (default: the current locale charset)
-    Example: "UTF-8".
-
-``errorlog``
-    Where to output the error log. (default: stderr)
-
-``guessmime``
-    Control MIME types for raw download of file content.
-    Set to True to let hgweb guess the content type from the file
-    extension. This will serve HTML files as ``text/html`` and might
-    allow cross-site scripting attacks when serving untrusted
-    repositories. (default: False)
-
-``hidden``
-    Whether to hide the repository in the hgwebdir index.
-    (default: False)
-
-``ipv6``
-    Whether to use IPv6. (default: False)
-
-``labels``
-    List of string *labels* associated with the repository.
-
-    Labels are exposed as a template keyword and can be used to customize
-    output. e.g. the ``index`` template can group or filter repositories
-    by labels and the ``summary`` template can display additional content
-    if a specific label is present.
-
-``logoimg``
-    File name of the logo image that some templates display on each page.
-    The file name is relative to ``staticurl``. That is, the full path to
-    the logo image is "staticurl/logoimg".
-    If unset, ``hglogo.png`` will be used.
-
-``logourl``
-    Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
-    will be used.
-
-``maxchanges``
-    Maximum number of changes to list on the changelog. (default: 10)
-
-``maxfiles``
-    Maximum number of files to list per changeset. (default: 10)
-
-``maxshortchanges``
-    Maximum number of changes to list on the shortlog, graph or filelog
-    pages. (default: 60)
-
-``name``
-    Repository name to use in the web interface.
-    (default: current working directory)
-
-``port``
-    Port to listen on. (default: 8000)
-
-``prefix``
-    Prefix path to serve from. (default: '' (server root))
-
-``push_ssl``
-    Whether to require that inbound pushes be transported over SSL to
-    prevent password sniffing. (default: True)
-
-``refreshinterval``
-    How frequently directory listings re-scan the filesystem for new
-    repositories, in seconds. This is relevant when wildcards are used
-    to define paths. Depending on how much filesystem traversal is
-    required, refreshing may negatively impact performance.
-
-    Values less than or equal to 0 always refresh.
-    (default: 20)
-
-``server-header``
-    Value for HTTP ``Server`` response header.
-
-``static``
-    Directory where static files are served from.
-
-``staticurl``
-    Base URL to use for static files. If unset, static files (e.g. the
-    hgicon.png favicon) will be served by the CGI script itself. Use
-    this setting to serve them directly with the HTTP server.
-    Example: ``http://hgserver/static/``.
-
-``stripes``
-    How many lines a "zebra stripe" should span in multi-line output.
-    Set to 0 to disable. (default: 1)
-
-``style``
-    Which template map style to use. The available options are the names of
-    subdirectories in the HTML templates path. (default: ``paper``)
-    Example: ``monoblue``.
-
-``templates``
-    Where to find the HTML templates. The default path to the HTML templates
-    can be obtained from ``hg debuginstall``.
-
-``websub``
-----------
-
-Web substitution filter definition. You can use this section to
-define a set of regular expression substitution patterns which
-let you automatically modify the hgweb server output.
-
-The default hgweb templates only apply these substitution patterns
-on the revision description fields. You can apply them anywhere
-you want when you create your own templates by adding calls to the
-"websub" filter (usually after calling the "escape" filter).
-
-This can be used, for example, to convert issue references to links
-to your issue tracker, or to convert "markdown-like" syntax into
-HTML (see the examples below).
-
-Each entry in this section names a substitution filter.
-The value of each entry defines the substitution expression itself.
-The websub expressions follow the old interhg extension syntax,
-which in turn imitates the Unix sed replacement syntax::
-
-    patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
-
-You can use any separator other than "/". The final "i" is optional
-and indicates that the search must be case insensitive.
-
-Examples::
-
-    [websub]
-    issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
-    italic = s/\b_(\S+)_\b/<i>\1<\/i>/
-    bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
-
-``worker``
-----------
-
-Parallel master/worker configuration. We currently perform working
-directory updates in parallel on Unix-like systems, which greatly
-helps performance.
-
-``enabled``
-    Whether to enable workers code to be used.
-    (default: true)
-
-``numcpus``
-    Number of CPUs to use for parallel operations. A zero or
-    negative value is treated as ``use the default``.
-    (default: 4 or the number of CPUs on the system, whichever is larger)
-
-``backgroundclose``
-    Whether to enable closing file handles on background threads during certain
-    operations. Some platforms aren't very efficient at closing file
-    handles that have been written or appended to. By performing file closing
-    on background threads, file write rate can increase substantially.
-    (default: true on Windows, false elsewhere)
-
-``backgroundcloseminfilecount``
-    Minimum number of files required to trigger background file closing.
-    Operations not writing this many files won't start background close
-    threads.
-    (default: 2048)
-
-``backgroundclosemaxqueue``
-    The maximum number of opened file handles waiting to be closed in the
-    background. This option only has an effect if ``backgroundclose`` is
-    enabled.
-    (default: 384)
-
-``backgroundclosethreadcount``
-    Number of threads to process background file closes. Only relevant if
-    ``backgroundclose`` is enabled.
-    (default: 4)
--- a/mercurial/help/dates.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-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.
-
-Many date formats are valid. Here are some examples:
-
-- ``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
-
-Lastly, there is Mercurial's internal format:
-
-- ``1165411109 0`` (Wed Dec 6 13:18:29 2006 UTC)
-
-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).
-
-The log command also accepts date ranges:
-
-- ``<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
--- a/mercurial/help/deprecated.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-Mercurial evolves over time, some features, options, commands may be replaced by
-better and more secure alternatives. This topic will help you migrating your
-existing usage and/or configuration to newer features.
-
-Commands
-========
-
-The following commands are still available but their use are not recommended:
-
-``locate``
-
-This command has been replaced by `hg files`.
-
-``parents``
-
-This command can be replaced by `hg summary` or `hg log` with appropriate
-revsets. See `hg help revsets` for more information.
-
-``tip``
-
-The recommended alternative is `hg heads`.
-
-Options
-=======
-
-``web.allowpull``
-    Renamed to `allow-pull`.
-
-``web.allow_push``
-    Renamed to `allow-push`.
--- a/mercurial/help/diffs.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-Mercurial's default format for showing changes between two versions of
-a file is compatible with the unified format of GNU diff, which can be
-used by GNU patch and many other standard tools.
-
-While this standard format is often enough, it does not encode the
-following information:
-
-- executable status and other permission bits
-- copy or rename information
-- changes in binary files
-- creation or deletion of empty files
-
-Mercurial also supports the extended diff format from the git VCS
-which addresses these limitations. The git diff format is not produced
-by default because a few widespread tools still do not understand this
-format.
-
-This means that when generating diffs from a Mercurial repository
-(e.g. with :hg:`export`), you should be careful about things like file
-copies and renames or other things mentioned above, because when
-applying a standard diff to a different repository, this extra
-information is lost. Mercurial's internal operations (like push and
-pull) are not affected by this, because they use an internal binary
-format for communicating changes.
-
-To make Mercurial produce the git extended diff format, use the --git
-option available for many commands, or set 'git = True' in the [diff]
-section of your configuration file. You do not need to set this option
-when importing diffs in this format or using them in the mq extension.
--- a/mercurial/help/environment.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-HG
-    Path to the 'hg' executable, automatically passed when running
-    hooks, extensions or external tools. If unset or empty, this is
-    the hg executable's name if it's frozen, or an executable named
-    'hg' (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions on
-    Windows) is searched.
-
-HGEDITOR
-    This is the name of the editor to run when committing. See EDITOR.
-
-    (deprecated, see :hg:`help config.ui.editor`)
-
-HGENCODING
-    This overrides the default locale setting detected by Mercurial.
-    This setting is used to convert data including usernames,
-    changeset descriptions, tag names, and branches. This setting can
-    be overridden with the --encoding command-line option.
-
-HGENCODINGMODE
-    This sets Mercurial's behavior for handling unknown characters
-    while transcoding user input. The default is "strict", which
-    causes Mercurial to abort if it can't map a character. Other
-    settings include "replace", which replaces unknown characters, and
-    "ignore", which drops them. This setting can be overridden with
-    the --encodingmode command-line option.
-
-HGENCODINGAMBIGUOUS
-    This sets Mercurial's behavior for handling characters with
-    "ambiguous" widths like accented Latin characters with East Asian
-    fonts. By default, Mercurial assumes ambiguous characters are
-    narrow, set this variable to "wide" if such characters cause
-    formatting problems.
-
-HGMERGE
-    An executable to use for resolving merge conflicts. The program
-    will be executed with three arguments: local file, remote file,
-    ancestor file.
-
-    (deprecated, see :hg:`help config.ui.merge`)
-
-HGRCPATH
-    A list of files or directories to search for configuration
-    files. Item separator is ":" on Unix, ";" on Windows. If HGRCPATH
-    is not set, platform default search path is used. If empty, only
-    the .hg/hgrc from the current repository is read.
-
-    For each element in HGRCPATH:
-
-    - if it's a directory, all files ending with .rc are added
-    - otherwise, the file itself will be added
-
-HGPLAIN
-    When set, this disables any configuration settings that might
-    change Mercurial's default output. This includes encoding,
-    defaults, verbose mode, debug mode, quiet mode, tracebacks, and
-    localization. This can be useful when scripting against Mercurial
-    in the face of existing user configuration.
-
-    In addition to the features disabled by ``HGPLAIN=``, the following
-    values can be specified to adjust behavior:
-
-    ``+strictflags``
-        Restrict parsing of command line flags.
-
-    Equivalent options set via command line flags or environment
-    variables are not overridden.
-
-    See :hg:`help scripting` for details.
-
-HGPLAINEXCEPT
-    This is a comma-separated list of features to preserve when
-    HGPLAIN is enabled. Currently the following values are supported:
-
-    ``alias``
-        Don't remove aliases.
-    ``color``
-        Don't disable colored output.
-    ``i18n``
-        Preserve internationalization.
-    ``revsetalias``
-        Don't remove revset aliases.
-    ``templatealias``
-        Don't remove template aliases.
-    ``progress``
-        Don't hide progress output.
-
-    Setting HGPLAINEXCEPT to anything (even an empty string) will
-    enable plain mode.
-
-HGUSER
-    This is the string used as the author of a commit. If not set,
-    available values will be considered in this order:
-
-    - HGUSER (deprecated)
-    - configuration files from the HGRCPATH
-    - EMAIL
-    - interactive prompt
-    - LOGNAME (with ``@hostname`` appended)
-
-    (deprecated, see :hg:`help config.ui.username`)
-
-EMAIL
-    May be used as the author of a commit; see HGUSER.
-
-LOGNAME
-    May be used as the author of a commit; see HGUSER.
-
-VISUAL
-    This is the name of the editor to use when committing. See EDITOR.
-
-EDITOR
-    Sometimes Mercurial needs to open a text file in an editor for a
-    user to modify, for example when writing commit messages. The
-    editor it uses is determined by looking at the environment
-    variables HGEDITOR, VISUAL and EDITOR, in that order. The first
-    non-empty one is chosen. If all of them are empty, the editor
-    defaults to 'vi'.
-
-PYTHONPATH
-    This is used by Python to find imported modules and may need to be
-    set appropriately if this Mercurial is not installed system-wide.
--- a/mercurial/help/extensions.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-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 = !
--- a/mercurial/help/filesets.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-Mercurial supports a functional language for selecting a set of
-files.
-
-Like other file patterns, this pattern type is indicated by a prefix,
-'set:'. The language supports a number of predicates which are joined
-by infix operators. Parenthesis can be used for grouping.
-
-Identifiers such as filenames or patterns must be quoted with single
-or double quotes if they contain characters outside of
-``[.*{}[]?/\_a-zA-Z0-9\x80-\xff]`` or if they match one of the
-predefined predicates. This generally applies to file patterns other
-than globs and arguments for predicates. Pattern prefixes such as
-``path:`` may be specified without quoting.
-
-Special characters can be used in quoted identifiers by escaping them,
-e.g., ``\n`` is interpreted as a newline. To prevent them from being
-interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
-
-See also :hg:`help patterns`.
-
-Operators
-=========
-
-There is a single prefix operator:
-
-``not x``
-  Files not in x. Short form is ``! x``.
-
-These are the supported infix operators:
-
-``x and y``
-  The intersection of files in x and y. Short form is ``x & y``.
-
-``x or y``
-  The union of files in x and y. There are two alternative short
-  forms: ``x | y`` and ``x + y``.
-
-``x - y``
-  Files in x but not in y.
-
-Predicates
-==========
-
-The following predicates are supported:
-
-.. predicatesmarker
-
-Examples
-========
-
-Some sample queries:
-
-- Show status of files that appear to be binary in the working directory::
-
-    hg status -A "set:binary()"
-
-- Forget files that are in .hgignore but are already tracked::
-
-    hg forget "set:hgignore() and not ignored()"
-
-- Find text files that contain a string::
-
-    hg files "set:grep(magic) and not binary()"
-
-- Find C files in a non-standard encoding::
-
-    hg files "set:**.c and not encoding('UTF-8')"
-
-- Revert copies of large binary files::
-
-    hg revert "set:copied() and binary() and size('>1M')"
-
-- Revert files that were added to the working directory::
-
-    hg revert "set:revs('wdir()', added())"
-
-- Remove files listed in foo.lst that contain the letter a or b::
-
-    hg remove "set: listfile:foo.lst and (**a* or **b*)"
--- a/mercurial/help/flags.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-Most Mercurial commands accept various flags.
-
-Flag names
-==========
-
-Flags for each command are listed in :hg:`help` for that command.
-Additionally, some flags, such as --repository, are global and can be used with
-any command - those are seen in :hg:`help -v`, and can be specified before or
-after the command.
-
-Every flag has at least a long name, such as --repository. Some flags may also
-have a short one-letter name, such as the equivalent -R. Using the short or long
-name is equivalent and has the same effect.
-
-Flags that have a short name can also be bundled together - for instance, to
-specify both --edit (short -e) and --interactive (short -i), one could use::
-
-    hg commit -ei
-
-If any of the bundled flags takes a value (i.e. is not a boolean), it must be
-last, followed by the value::
-
-    hg commit -im 'Message'
-
-Flag types
-==========
-
-Mercurial command-line flags can be strings, numbers, booleans, or lists of
-strings.
-
-Specifying flag values
-======================
-
-The following syntaxes are allowed, assuming a flag 'flagname' with short name
-'f'::
-
-    --flagname=foo
-    --flagname foo
-    -f foo
-    -ffoo
-
-This syntax applies to all non-boolean flags (strings, numbers or lists).
-
-Specifying boolean flags
-========================
-
-Boolean flags do not take a value parameter. To specify a boolean, use the flag
-name to set it to true, or the same name prefixed with 'no-' to set it to
-false::
-
-    hg commit --interactive
-    hg commit --no-interactive
-
-Specifying list flags
-=====================
-
-List flags take multiple values. To specify them, pass the flag multiple times::
-
-    hg files --include mercurial --include tests
-
-Setting flag defaults
-=====================
-
-In order to set a default value for a flag in an hgrc file, it is recommended to
-use aliases::
-
-    [alias]
-    commit = commit --interactive
-
-For more information on hgrc files, see :hg:`help config`.
-
-Overriding flags on the command line
-====================================
-
-If the same non-list flag is specified multiple times on the command line, the
-latest specification is used::
-
-    hg commit -m "Ignored value" -m "Used value"
-
-This includes the use of aliases - e.g., if one has::
-
-    [alias]
-    committemp = commit -m "Ignored value"
-
-then the following command will override that -m::
-
-    hg committemp -m "Used value"
-
-Overriding flag defaults
-========================
-
-Every flag has a default value, and you may also set your own defaults in hgrc
-as described above.
-Except for list flags, defaults can be overridden on the command line simply by
-specifying the flag in that location.
-
-Hidden flags
-============
-
-Some flags are not shown in a command's help by default - specifically, those
-that are deemed to be experimental, deprecated or advanced. To show all flags,
-add the --verbose flag for the help command::
-
-    hg help --verbose commit
--- a/mercurial/help/glossary.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,413 +0,0 @@
-Ancestor
-    Any changeset that can be reached by an unbroken chain of parent
-    changesets from a given changeset. More precisely, the ancestors
-    of a changeset can be defined by two properties: a parent of a
-    changeset is an ancestor, and a parent of an ancestor is an
-    ancestor. See also: 'Descendant'.
-
-Bookmark
-    Bookmarks are pointers to certain commits that move when
-    committing. They are similar to tags in that it is possible to use
-    bookmark names in all places where Mercurial expects a changeset
-    ID, e.g., with :hg:`update`. Unlike tags, bookmarks move along
-    when you make a commit.
-
-    Bookmarks can be renamed, copied and deleted. Bookmarks are local,
-    unless they are explicitly pushed or pulled between repositories.
-    Pushing and pulling bookmarks allow you to collaborate with others
-    on a branch without creating a named branch.
-
-Branch
-    (Noun) A child changeset that has been created from a parent that
-    is not a head. These are known as topological branches, see
-    'Branch, topological'. If a topological branch is named, it becomes
-    a named branch. If a topological branch is not named, it becomes
-    an anonymous branch. See 'Branch, anonymous' and 'Branch, named'.
-
-    Branches may be created when changes are pulled from or pushed to
-    a remote repository, since new heads may be created by these
-    operations. Note that the term branch can also be used informally
-    to describe a development process in which certain development is
-    done independently of other development. This is sometimes done
-    explicitly with a named branch, but it can also be done locally,
-    using bookmarks or clones and anonymous branches.
-
-    Example: "The experimental branch."
-
-    (Verb) The action of creating a child changeset which results in
-    its parent having more than one child.
-
-    Example: "I'm going to branch at X."
-
-Branch, anonymous
-    Every time a new child changeset is created from a parent that is not
-    a head and the name of the branch is not changed, a new anonymous
-    branch is created.
-
-Branch, closed
-    A named branch whose branch heads have all been closed.
-
-Branch, default
-    The branch assigned to a changeset when no name has previously been
-    assigned.
-
-Branch head
-    See 'Head, branch'.
-
-Branch, inactive
-    If a named branch has no topological heads, it is considered to be
-    inactive. As an example, a feature branch becomes inactive when it
-    is merged into the default branch. The :hg:`branches` command
-    shows inactive branches by default, though they can be hidden with
-    :hg:`branches --active`.
-
-    NOTE: this concept is deprecated because it is too implicit.
-    Branches should now be explicitly closed using :hg:`commit
-    --close-branch` when they are no longer needed.
-
-Branch, named
-    A collection of changesets which have the same branch name. By
-    default, children of a changeset in a named branch belong to the
-    same named branch. A child can be explicitly assigned to a
-    different branch. See :hg:`help branch`, :hg:`help branches` and
-    :hg:`commit --close-branch` for more information on managing
-    branches.
-
-    Named branches can be thought of as a kind of namespace, dividing
-    the collection of changesets that comprise the repository into a
-    collection of disjoint subsets. A named branch is not necessarily
-    a topological branch. If a new named branch is created from the
-    head of another named branch, or the default branch, but no
-    further changesets are added to that previous branch, then that
-    previous branch will be a branch in name only.
-
-Branch tip
-    See 'Tip, branch'.
-
-Branch, topological
-    Every time a new child changeset is created from a parent that is
-    not a head, a new topological branch is created. If a topological
-    branch is named, it becomes a named branch. If a topological
-    branch is not named, it becomes an anonymous branch of the
-    current, possibly default, branch.
-
-Changelog
-    A record of the changesets in the order in which they were added
-    to the repository. This includes details such as changeset id,
-    author, commit message, date, and list of changed files.
-
-Changeset
-    A snapshot of the state of the repository used to record a change.
-
-Changeset, child
-    The converse of parent changeset: if P is a parent of C, then C is
-    a child of P. There is no limit to the number of children that a
-    changeset may have.
-
-Changeset id
-    A SHA-1 hash that uniquely identifies a changeset. It may be
-    represented as either a "long" 40 hexadecimal digit string, or a
-    "short" 12 hexadecimal digit string.
-
-Changeset, merge
-    A changeset with two parents. This occurs when a merge is
-    committed.
-
-Changeset, parent
-    A revision upon which a child changeset is based. Specifically, a
-    parent changeset of a changeset C is a changeset whose node
-    immediately precedes C in the DAG. Changesets have at most two
-    parents.
-
-Checkout
-    (Noun) The working directory being updated to a specific
-    revision. This use should probably be avoided where possible, as
-    changeset is much more appropriate than checkout in this context.
-
-    Example: "I'm using checkout X."
-
-    (Verb) Updating the working directory to a specific changeset. See
-    :hg:`help update`.
-
-    Example: "I'm going to check out changeset X."
-
-Child changeset
-    See 'Changeset, child'.
-
-Close changeset
-    See 'Head, closed branch'.
-
-Closed branch
-    See 'Branch, closed'.
-
-Clone
-    (Noun) An entire or partial copy of a repository. The partial
-    clone must be in the form of a revision and its ancestors.
-
-    Example: "Is your clone up to date?"
-
-    (Verb) The process of creating a clone, using :hg:`clone`.
-
-    Example: "I'm going to clone the repository."
-
-Closed branch head
-    See 'Head, closed branch'.
-
-Commit
-    (Noun) A synonym for changeset.
-
-    Example: "Is the bug fixed in your recent commit?"
-
-    (Verb) The act of recording changes to a repository. When files
-    are committed in a working directory, Mercurial finds the
-    differences between the committed files and their parent
-    changeset, creating a new changeset in the repository.
-
-    Example: "You should commit those changes now."
-
-Cset
-    A common abbreviation of the term changeset.
-
-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.
-
-Deprecated
-    Feature removed from documentation, but not scheduled for removal.
-
-Default branch
-    See 'Branch, default'.
-
-Descendant
-    Any changeset that can be reached by a chain of child changesets
-    from a given changeset. More precisely, the descendants of a
-    changeset can be defined by two properties: the child of a
-    changeset is a descendant, and the child of a descendant is a
-    descendant. See also: 'Ancestor'.
-
-Diff
-    (Noun) The difference between the contents and attributes of files
-    in two changesets or a changeset and the current working
-    directory. The difference is usually represented in a standard
-    form called a "diff" or "patch". The "git diff" format is used
-    when the changes include copies, renames, or changes to file
-    attributes, none of which can be represented/handled by classic
-    "diff" and "patch".
-
-    Example: "Did you see my correction in the diff?"
-
-    (Verb) Diffing two changesets is the action of creating a diff or
-    patch.
-
-    Example: "If you diff with changeset X, you will see what I mean."
-
-Directory, working
-    The working directory represents the state of the files tracked by
-    Mercurial, that will be recorded in the next commit. The working
-    directory initially corresponds to the snapshot at an existing
-    changeset, known as the parent of the working directory. See
-    'Parent, working directory'. The state may be modified by changes
-    to the files introduced manually or by a merge. The repository
-    metadata exists in the .hg directory inside the working directory.
-
-Draft
-    Changesets in the draft phase have not been shared with publishing
-    repositories and may thus be safely changed by history-modifying
-    extensions. See :hg:`help phases`.
-
-Experimental
-    Feature that may change or be removed at a later date.
-
-Graph
-    See DAG and :hg:`log --graph`.
-
-Head
-    The term 'head' may be used to refer to both a branch head or a
-    repository head, depending on the context. See 'Head, branch' and
-    'Head, repository' for specific definitions.
-
-    Heads are where development generally takes place and are the
-    usual targets for update and merge operations.
-
-Head, branch
-    A changeset with no descendants on the same named branch.
-
-Head, closed branch
-    A changeset that marks a head as no longer interesting. The closed
-    head is no longer listed by :hg:`heads`. A branch is considered
-    closed when all its heads are closed and consequently is not
-    listed by :hg:`branches`.
-
-    Closed heads can be re-opened by committing new changeset as the
-    child of the changeset that marks a head as closed.
-
-Head, repository
-    A topological head which has not been closed.
-
-Head, topological
-    A changeset with no children in the repository.
-
-History, immutable
-    Once committed, changesets cannot be altered.  Extensions which
-    appear to change history actually create new changesets that
-    replace existing ones, and then destroy the old changesets. Doing
-    so in public repositories can result in old changesets being
-    reintroduced to the repository.
-
-History, rewriting
-    The changesets in a repository are immutable. However, extensions
-    to Mercurial can be used to alter the repository, usually in such
-    a way as to preserve changeset contents.
-
-Immutable history
-    See 'History, immutable'.
-
-Merge changeset
-    See 'Changeset, merge'.
-
-Manifest
-    Each changeset has a manifest, which is the list of files that are
-    tracked by the changeset.
-
-Merge
-    Used to bring together divergent branches of work. When you update
-    to a changeset and then merge another changeset, you bring the
-    history of the latter changeset into your working directory. Once
-    conflicts are resolved (and marked), this merge may be committed
-    as a merge changeset, bringing two branches together in the DAG.
-
-Named branch
-    See 'Branch, named'.
-
-Null changeset
-    The empty changeset. It is the parent state of newly-initialized
-    repositories and repositories with no checked out revision. It is
-    thus the parent of root changesets and the effective ancestor when
-    merging unrelated changesets. Can be specified by the alias 'null'
-    or by the changeset ID '000000000000'.
-
-Parent
-    See 'Changeset, parent'.
-
-Parent changeset
-    See 'Changeset, parent'.
-
-Parent, working directory
-    The working directory parent reflects a virtual revision which is
-    the child of the changeset (or two changesets with an uncommitted
-    merge) shown by :hg:`parents`. This is changed with
-    :hg:`update`. Other commands to see the working directory parent
-    are :hg:`summary` and :hg:`id`. Can be specified by the alias ".".
-
-Patch
-    (Noun) The product of a diff operation.
-
-    Example: "I've sent you my patch."
-
-    (Verb) The process of using a patch file to transform one
-    changeset into another.
-
-    Example: "You will need to patch that revision."
-
-Phase
-    A per-changeset state tracking how the changeset has been or
-    should be shared. See :hg:`help phases`.
-
-Public
-    Changesets in the public phase have been shared with publishing
-    repositories and are therefore considered immutable. See :hg:`help
-    phases`.
-
-Pull
-    An operation in which changesets in a remote repository which are
-    not in the local repository are brought into the local
-    repository. Note that this operation without special arguments
-    only updates the repository, it does not update the files in the
-    working directory. See :hg:`help pull`.
-
-Push
-    An operation in which changesets in a local repository which are
-    not in a remote repository are sent to the remote repository. Note
-    that this operation only adds changesets which have been committed
-    locally to the remote repository. Uncommitted changes are not
-    sent. See :hg:`help push`.
-
-Repository
-    The metadata describing all recorded states of a collection of
-    files. Each recorded state is represented by a changeset. A
-    repository is usually (but not always) found in the ``.hg``
-    subdirectory of a working directory. Any recorded state can be
-    recreated by "updating" a working directory to a specific
-    changeset.
-
-Repository head
-    See 'Head, repository'.
-
-Revision
-    A state of the repository at some point in time. Earlier revisions
-    can be updated to by using :hg:`update`.  See also 'Revision
-    number'; See also 'Changeset'.
-
-Revision number
-    This integer uniquely identifies a changeset in a specific
-    repository. It represents the order in which changesets were added
-    to a repository, starting with revision number 0. Note that the
-    revision number may be different in each clone of a repository. To
-    identify changesets uniquely between different clones, see
-    'Changeset id'.
-
-Revlog
-    History storage mechanism used by Mercurial. It is a form of delta
-    encoding, with occasional full revision of data followed by delta
-    of each successive revision. It includes data and an index
-    pointing to the data.
-
-Rewriting history
-    See 'History, rewriting'.
-
-Root
-    A changeset that has only the null changeset as its parent. Most
-    repositories have only a single root changeset.
-
-Secret
-    Changesets in the secret phase may not be shared via push, pull,
-    or clone. See :hg:`help phases`.
-
-Tag
-    An alternative name given to a changeset. Tags can be used in all
-    places where Mercurial expects a changeset ID, e.g., with
-    :hg:`update`. The creation of a tag is stored in the history and
-    will thus automatically be shared with other using push and pull.
-
-Tip
-    The changeset with the highest revision number. It is the changeset
-    most recently added in a repository.
-
-Tip, branch
-    The head of a given branch with the highest revision number. When
-    a branch name is used as a revision identifier, it refers to the
-    branch tip. See also 'Branch, head'. Note that because revision
-    numbers may be different in different repository clones, the
-    branch tip may be different in different cloned repositories.
-
-Update
-    (Noun) Another synonym of changeset.
-
-    Example: "I've pushed an update."
-
-    (Verb) This term is usually used to describe updating the state of
-    the working directory to that of a specific changeset. See
-    :hg:`help update`.
-
-    Example: "You should update."
-
-Working directory
-    See 'Directory, working'.
-
-Working directory parent
-    See 'Parent, working directory'.
--- a/mercurial/help/hg-ssh.8.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-========
- hg-ssh
-========
-
-----------------------------------------
-restricted ssh login shell for Mercurial
-----------------------------------------
-
-:Author:         Thomas Arendsen Hein <thomas@intevation.de>
-:Organization:   Mercurial
-:Manual section: 8
-:Manual group:   Mercurial Manual
-
-.. contents::
-   :backlinks: top
-   :class: htmlonly
-   :depth: 1
-
-Synopsis
-""""""""
-**hg-ssh** repositories...
-
-Description
-"""""""""""
-**hg-ssh** is a wrapper for ssh access to a limited set of mercurial repos.
-
-To be used in ~/.ssh/authorized_keys with the "command" option, see sshd(8):
-command="hg-ssh path/to/repo1 /path/to/repo2 ~/repo3 ~user/repo4" ssh-dss ...
-(probably together with these other useful options:
-no-port-forwarding,no-X11-forwarding,no-agent-forwarding)
-
-This allows pull/push over ssh from/to the repositories given as arguments.
-
-If all your repositories are subdirectories of a common directory, you can
-allow shorter paths with:
-command="cd path/to/my/repositories && hg-ssh repo1 subdir/repo2"
-
-You can use pattern matching of your normal shell, e.g.:
-command="cd repos && hg-ssh user/thomas/* projects/{mercurial,foo}"
-
-You can also add a --read-only flag to allow read-only access to a key, e.g.:
-command="hg-ssh --read-only repos/\*"
-
-Bugs
-""""
-Probably lots, please post them to the mailing list (see Resources_
-below) when you find them.
-
-See Also
-""""""""
-|hg(1)|_
-
-Author
-""""""
-Written by Matt Mackall <mpm@selenic.com>
-
-Resources
-"""""""""
-Main Web Site: https://mercurial-scm.org/
-
-Source code repository: https://www.mercurial-scm.org/repo/hg
-
-Mailing list: https://www.mercurial-scm.org/mailman/listinfo/mercurial/
-
-Copying
-"""""""
-Copyright (C) 2005-2016 Matt Mackall.
-Free use of this software is granted under the terms of the GNU General
-Public License version 2 or any later version.
-
-.. include:: common.txt
--- a/mercurial/help/hg.1.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-====
- hg
-====
-
----------------------------------------
-Mercurial source code management system
----------------------------------------
-
-:Author:         Matt Mackall <mpm@selenic.com>
-:Organization:   Mercurial
-:Manual section: 1
-:Manual group:   Mercurial Manual
-
-.. contents::
-   :backlinks: top
-   :class: htmlonly
-   :depth: 1
-
-
-Synopsis
-""""""""
-**hg** *command* [*option*]... [*argument*]...
-
-Description
-"""""""""""
-The **hg** command provides a command line interface to the Mercurial
-system.
-
-Command Elements
-""""""""""""""""
-
-files...
-    indicates one or more filename or relative path filenames; see
-    `File Name Patterns`_ for information on pattern matching
-
-path
-    indicates a path on the local machine
-
-revision
-    indicates a changeset which can be specified as a changeset
-    revision number, a tag, or a unique substring of the changeset
-    hash value
-
-repository path
-    either the pathname of a local repository or the URI of a remote
-    repository.
-
-.. include:: hg.1.gendoc.txt
-
-Files
-"""""
-
-``/etc/mercurial/hgrc``, ``$HOME/.hgrc``, ``.hg/hgrc``
-    This file contains defaults and configuration. Values in
-    ``.hg/hgrc`` override those in ``$HOME/.hgrc``, and these override
-    settings made in the global ``/etc/mercurial/hgrc`` configuration.
-    See |hgrc(5)|_ for details of the contents and format of these
-    files.
-
-``.hgignore``
-    This file contains regular expressions (one per line) that
-    describe file names that should be ignored by **hg**. For details,
-    see |hgignore(5)|_.
-
-``.hgsub``
-    This file defines the locations of all subrepositories, and
-    tells where the subrepository checkouts came from. For details, see
-    :hg:`help subrepos`.
-
-``.hgsubstate``
-    This file is where Mercurial stores all nested repository states. *NB: This
-    file should not be edited manually.*
-
-``.hgtags``
-    This file contains changeset hash values and text tag names (one
-    of each separated by spaces) that correspond to tagged versions of
-    the repository contents. The file content is encoded using UTF-8.
-
-``.hg/last-message.txt``
-    This file is used by :hg:`commit` to store a backup of the commit message
-    in case the commit fails.
-
-``.hg/localtags``
-    This file can be used to define local tags which are not shared among
-    repositories. The file format is the same as for ``.hgtags``, but it is
-    encoded using the local system encoding.
-
-Some commands (e.g. revert) produce backup files ending in ``.orig``,
-if the ``.orig`` file already exists and is not tracked by Mercurial,
-it will be overwritten.
-
-Bugs
-""""
-Probably lots, please post them to the mailing list (see Resources_
-below) when you find them.
-
-See Also
-""""""""
-|hgignore(5)|_, |hgrc(5)|_
-
-Author
-""""""
-Written by Matt Mackall <mpm@selenic.com>
-
-Resources
-"""""""""
-Main Web Site: https://mercurial-scm.org/
-
-Source code repository: https://www.mercurial-scm.org/repo/hg
-
-Mailing list: https://www.mercurial-scm.org/mailman/listinfo/mercurial/
-
-Copying
-"""""""
-Copyright (C) 2005-2019 Matt Mackall.
-Free use of this software is granted under the terms of the GNU General
-Public License version 2 or any later version.
-
-.. include:: common.txt
--- a/mercurial/help/hgignore.5.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-==========
- hgignore
-==========
-
----------------------------------
-syntax for Mercurial ignore files
----------------------------------
-
-:Author:         Vadim Gelfer <vadim.gelfer@gmail.com>
-:Organization:   Mercurial
-:Manual section: 5
-:Manual group:   Mercurial Manual
-
-.. include:: hgignore.5.gendoc.txt
-
-Author
-======
-Vadim Gelfer <vadim.gelfer@gmail.com>
-
-Mercurial was written by Matt Mackall <mpm@selenic.com>.
-
-See Also
-========
-|hg(1)|_, |hgrc(5)|_
-
-Copying
-=======
-This manual page is copyright 2006 Vadim Gelfer.
-Mercurial is copyright 2005-2019 Matt Mackall.
-Free use of this software is granted under the terms of the GNU General
-Public License version 2 or any later version.
-
-.. include:: common.txt
-
--- a/mercurial/help/hgignore.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-Synopsis
-========
-
-The Mercurial system uses a file called ``.hgignore`` in the root
-directory of a repository to control its behavior when it searches
-for files that it is not currently tracking.
-
-Description
-===========
-
-The working directory of a Mercurial repository will often contain
-files that should not be tracked by Mercurial. These include backup
-files created by editors and build products created by compilers.
-These files can be ignored by listing them in a ``.hgignore`` file in
-the root of the working directory. The ``.hgignore`` file must be
-created manually. It is typically put under version control, so that
-the settings will propagate to other repositories with push and pull.
-
-An untracked file is ignored if its path relative to the repository
-root directory, or any prefix path of that path, is matched against
-any pattern in ``.hgignore``.
-
-For example, say we have an untracked file, ``file.c``, at
-``a/b/file.c`` inside our repository. Mercurial will ignore ``file.c``
-if any pattern in ``.hgignore`` matches ``a/b/file.c``, ``a/b`` or ``a``.
-
-In addition, a Mercurial configuration file can reference a set of
-per-user or global ignore files. See the ``ignore`` configuration
-key on the ``[ui]`` section of :hg:`help config` for details of how to
-configure these files.
-
-To control Mercurial's handling of files that it manages, many
-commands support the ``-I`` and ``-X`` options; see
-:hg:`help <command>` and :hg:`help patterns` for details.
-
-Files that are already tracked are not affected by .hgignore, even
-if they appear in .hgignore. An untracked file X can be explicitly
-added with :hg:`add X`, even if X would be excluded by a pattern
-in .hgignore.
-
-Syntax
-======
-
-An ignore file is a plain text file consisting of a list of patterns,
-with one pattern per line. Empty lines are skipped. The ``#``
-character is treated as a comment character, and the ``\`` character
-is treated as an escape character.
-
-Mercurial supports several pattern syntaxes. The default syntax used
-is Python/Perl-style regular expressions.
-
-To change the syntax used, use a line of the following form::
-
-  syntax: NAME
-
-where ``NAME`` is one of the following:
-
-``regexp``
-  Regular expression, Python/Perl syntax.
-``glob``
-  Shell-style glob.
-``rootglob``
-  A variant of ``glob`` that is rooted (see below).
-
-The chosen syntax stays in effect when parsing all patterns that
-follow, until another syntax is selected.
-
-Neither ``glob`` nor regexp patterns are rooted. A glob-syntax
-pattern of the form ``*.c`` will match a file ending in ``.c`` in any
-directory, and a regexp pattern of the form ``\.c$`` will do the
-same. To root a regexp pattern, start it with ``^``. To get the same
-effect with glob-syntax, you have to use ``rootglob``.
-
-Subdirectories can have their own .hgignore settings by adding
-``subinclude:path/to/subdir/.hgignore`` to the root ``.hgignore``. See
-:hg:`help patterns` for details on ``subinclude:`` and ``include:``.
-
-.. note::
-
-  Patterns specified in other than ``.hgignore`` are always rooted.
-  Please see :hg:`help patterns` for details.
-
-Example
-=======
-
-Here is an example ignore file. ::
-
-  # use glob syntax.
-  syntax: glob
-
-  *.elc
-  *.pyc
-  *~
-
-  # switch to regexp syntax.
-  syntax: regexp
-  ^\.pc/
--- a/mercurial/help/hgrc.5.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-======
- hgrc
-======
-
----------------------------------
-configuration files for Mercurial
----------------------------------
-
-:Author:         Bryan O'Sullivan <bos@serpentine.com>
-:Organization:   Mercurial
-:Manual section: 5
-:Manual group:   Mercurial Manual
-
-.. contents::
-   :backlinks: top
-   :class: htmlonly
-
-
-Description
-===========
-
-.. include:: hgrc.5.gendoc.txt
-
-Author
-======
-Bryan O'Sullivan <bos@serpentine.com>.
-
-Mercurial was written by Matt Mackall <mpm@selenic.com>.
-
-See Also
-========
-|hg(1)|_, |hgignore(5)|_
-
-Copying
-=======
-This manual page is copyright 2005 Bryan O'Sullivan.
-Mercurial is copyright 2005-2019 Matt Mackall.
-Free use of this software is granted under the terms of the GNU General
-Public License version 2 or any later version.
-
-.. include:: common.txt
--- a/mercurial/help/hgweb.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-Mercurial's internal web server, hgweb, can serve either a single
-repository, or a tree of repositories. In the second case, repository
-paths and global options can be defined using a dedicated
-configuration file common to :hg:`serve`, ``hgweb.wsgi``,
-``hgweb.cgi`` and ``hgweb.fcgi``.
-
-This file uses the same syntax as other Mercurial configuration files
-but recognizes only the following sections:
-
-  - web
-  - paths
-  - collections
-
-The ``web`` options are thoroughly described in :hg:`help config`.
-
-The ``paths`` section maps URL paths to paths of repositories in the
-filesystem. hgweb will not expose the filesystem directly - only
-Mercurial repositories can be published and only according to the
-configuration.
-
-The left hand side is the path in the URL. Note that hgweb reserves
-subpaths like ``rev`` or ``file``, try using different names for
-nested repositories to avoid confusing effects.
-
-The right hand side is the path in the filesystem. If the specified
-path ends with ``*`` or ``**`` the filesystem will be searched
-recursively for repositories below that point.
-With ``*`` it will not recurse into the repositories it finds (except for
-``.hg/patches``).
-With ``**`` it will also search inside repository working directories
-and possibly find subrepositories.
-
-In this example::
-
-  [paths]
-  /projects/a = /srv/tmprepos/a
-  /projects/b = c:/repos/b
-  / = /srv/repos/*
-  /user/bob = /home/bob/repos/**
-
-- The first two entries make two repositories in different directories
-  appear under the same directory in the web interface
-- The third entry will publish every Mercurial repository found in
-  ``/srv/repos/``, for instance the repository ``/srv/repos/quux/``
-  will appear as ``http://server/quux/``
-- The fourth entry will publish both ``http://server/user/bob/quux/``
-  and ``http://server/user/bob/quux/testsubrepo/``
-
-The ``collections`` section is deprecated and has been superseded by
-``paths``.
-
-URLs and Common Arguments
-=========================
-
-URLs under each repository have the form ``/{command}[/{arguments}]``
-where ``{command}`` represents the name of a command or handler and
-``{arguments}`` represents any number of additional URL parameters
-to that command.
-
-The web server has a default style associated with it. Styles map to
-a collection of named templates. Each template is used to render a
-specific piece of data, such as a changeset or diff.
-
-The style for the current request can be overwritten two ways. First,
-if ``{command}`` contains a hyphen (``-``), the text before the hyphen
-defines the style. For example, ``/atom-log`` will render the ``log``
-command handler with the ``atom`` style. The second way to set the
-style is with the ``style`` query string argument. For example,
-``/log?style=atom``. The hyphenated URL parameter is preferred.
-
-Not all templates are available for all styles. Attempting to use
-a style that doesn't have all templates defined may result in an error
-rendering the page.
-
-Many commands take a ``{revision}`` URL parameter. This defines the
-changeset to operate on. This is commonly specified as the short,
-12 digit hexadecimal abbreviation for the full 40 character unique
-revision identifier. However, any value described by
-:hg:`help revisions` typically works.
-
-Commands and URLs
-=================
-
-The following web commands and their URLs are available:
-
-  .. webcommandsmarker
--- a/mercurial/help/internals/bundle2.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,677 +0,0 @@
-Bundle2 refers to a data format that is used for both on-disk storage
-and over-the-wire transfer of repository data and state.
-
-The data format allows the capture of multiple components of
-repository data. Contrast with the initial bundle format, which
-only captured *changegroup* data (and couldn't store bookmarks,
-phases, etc).
-
-Bundle2 is used for:
-
-* Transferring data from a repository (e.g. as part of an ``hg clone``
-  or ``hg pull`` operation).
-* Transferring data to a repository (e.g. as part of an ``hg push``
-  operation).
-* Storing data on disk (e.g. the result of an ``hg bundle``
-  operation).
-* Transferring the results of a repository operation (e.g. the
-  reply to an ``hg push`` operation).
-
-At its highest level, a bundle2 payload is a stream that begins
-with some metadata and consists of a series of *parts*, with each
-part describing repository data or state or the result of an
-operation. New bundle2 parts are introduced over time when there is
-a need to capture a new form of data. A *capabilities* mechanism
-exists to allow peers to understand which bundle2 parts the other
-understands.
-
-Stream Format
-=============
-
-A bundle2 payload consists of a magic string (``HG20``) followed by
-stream level parameters, followed by any number of payload *parts*.
-
-It may help to think of the stream level parameters as *headers* and the
-payload parts as the *body*.
-
-Stream Level Parameters
------------------------
-
-Following the magic string is data that defines parameters applicable to the
-entire payload.
-
-Stream level parameters begin with a 32-bit unsigned big-endian integer.
-The value of this integer defines the number of bytes of stream level
-parameters that follow.
-
-The *N* bytes of raw data contains a space separated list of parameters.
-Each parameter consists of a required name and an optional value.
-
-Parameters have the form ``<name>`` or ``<name>=<value>``.
-
-Both the parameter name and value are URL quoted.
-
-Names MUST start with a letter. If the first letter is lower case, the
-parameter is advisory and can safely be ignored. If the first letter
-is upper case, the parameter is mandatory and the handler MUST stop if
-it is unable to process it.
-
-Stream level parameters apply to the entire bundle2 payload. Lower-level
-options should go into a bundle2 part instead.
-
-The following stream level parameters are defined:
-
-Compression
-   Compression format of payload data. ``GZ`` denotes zlib. ``BZ``
-   denotes bzip2. ``ZS`` denotes zstandard.
-
-   When defined, all bytes after the stream level parameters are
-   compressed using the compression format defined by this parameter.
-
-   If this parameter isn't present, data is raw/uncompressed.
-
-   This parameter MUST be mandatory because attempting to consume
-   streams without knowing how to decode the underlying bytes will
-   result in errors.
-
-Payload Part
-------------
-
-Following the stream level parameters are 0 or more payload parts. Each
-payload part consists of a header and a body.
-
-The payload part header consists of a 32-bit unsigned big-endian integer
-defining the number of bytes in the header that follow. The special
-value ``0`` indicates the end of the bundle2 stream.
-
-The binary format of the part header is as follows:
-
-* 8-bit unsigned size of the part name
-* N-bytes alphanumeric part name
-* 32-bit unsigned big-endian part ID
-* N bytes part parameter data
-
-The *part name* identifies the type of the part. A part name with an
-UPPERCASE letter is mandatory. Otherwise, the part is advisory. A
-consumer should abort if it encounters a mandatory part it doesn't know
-how to process. See the sections below for each defined part type.
-
-The *part ID* is a unique identifier within the bundle used to refer to a
-specific part. It should be unique within the bundle2 payload.
-
-Part parameter data consists of:
-
-* 1 byte number of mandatory parameters
-* 1 byte number of advisory parameters
-* 2 * N bytes of sizes of parameter key and values
-* N * M blobs of values for parameter key and values
-
-Following the 2 bytes of mandatory and advisory parameter counts are
-2-tuples of bytes of the sizes of each parameter. e.g.
-(<key size>, <value size>).
-
-Following that are the raw values, without padding. Mandatory parameters
-come first, followed by advisory parameters.
-
-Each parameter's key MUST be unique within the part.
-
-Following the part parameter data is the part payload. The part payload
-consists of a series of framed chunks. The frame header is a 32-bit
-big-endian integer defining the size of the chunk. The N bytes of raw
-payload data follows.
-
-The part payload consists of 0 or more chunks.
-
-A chunk with size ``0`` denotes the end of the part payload. Therefore,
-there will always be at least 1 32-bit integer following the payload
-part header.
-
-A chunk size of ``-1`` is used to signal an *interrupt*. If such a chunk
-size is seen, the stream processor should process the next bytes as a new
-payload part. After this payload part, processing of the original,
-interrupted part should resume.
-
-Capabilities
-============
-
-Bundle2 is a dynamic format that can evolve over time. For example,
-when a new repository data concept is invented, a new bundle2 part
-is typically invented to hold that data. In addition, parts performing
-similar functionality may come into existence if there is a better
-mechanism for performing certain functionality.
-
-Because the bundle2 format evolves over time, peers need to understand
-what bundle2 features the other can understand. The *capabilities*
-mechanism is how those features are expressed.
-
-Bundle2 capabilities are logically expressed as a dictionary of
-string key-value pairs where the keys are strings and the values
-are lists of strings.
-
-Capabilities are encoded for exchange between peers. The encoded
-capabilities blob consists of a newline (``\n``) delimited list of
-entries. Each entry has the form ``<key>`` or ``<key>=<value>``,
-depending if the capability has a value.
-
-The capability name is URL quoted (``%XX`` encoding of URL unsafe
-characters).
-
-The value, if present, is formed by URL quoting each value in
-the capability list and concatenating the result with a comma (``,``).
-
-For example, the capabilities ``novaluekey`` and ``listvaluekey``
-with values ``value 1`` and ``value 2``. This would be encoded as:
-
-   listvaluekey=value%201,value%202\nnovaluekey
-
-The sections below detail the defined bundle2 capabilities.
-
-HG20
-----
-
-Denotes that the peer supports the bundle2 data format.
-
-bookmarks
----------
-
-Denotes that the peer supports the ``bookmarks`` part.
-
-Peers should not issue mandatory ``bookmarks`` parts unless this
-capability is present.
-
-changegroup
------------
-
-Denotes which versions of the *changegroup* format the peer can
-receive. Values include ``01``, ``02``, and ``03``.
-
-The peer should not generate changegroup data for a version not
-specified by this capability.
-
-checkheads
-----------
-
-Denotes which forms of heads checking the peer supports.
-
-If ``related`` is in the value, then the peer supports the ``check:heads``
-part and the peer is capable of detecting race conditions when applying
-changelog data.
-
-digests
--------
-
-Denotes which hashing formats the peer supports.
-
-Values are names of hashing function. Values include ``md5``, ``sha1``,
-and ``sha512``.
-
-error
------
-
-Denotes which ``error:`` parts the peer supports.
-
-Value is a list of strings of ``error:`` part names. Valid values
-include ``abort``, ``unsupportecontent``, ``pushraced``, and ``pushkey``.
-
-Peers should not issue an ``error:`` part unless the type of that
-part is listed as supported by this capability.
-
-listkeys
---------
-
-Denotes that the peer supports the ``listkeys`` part.
-
-hgtagsfnodes
-------------
-
-Denotes that the peer supports the ``hgtagsfnodes`` part.
-
-obsmarkers
-----------
-
-Denotes that the peer supports the ``obsmarker`` part and which versions
-of the obsolescence data format it can receive. Values are strings like
-``V<N>``. e.g. ``V1``.
-
-phases
-------
-
-Denotes that the peer supports the ``phases`` part.
-
-pushback
---------
-
-Denotes that the peer supports sending/receiving bundle2 data in response
-to a bundle2 request.
-
-This capability is typically used by servers that employ server-side
-rewriting of pushed repository data. For example, a server may wish to
-automatically rebase pushed changesets. When this capability is present,
-the server can send a bundle2 response containing the rewritten changeset
-data and the client will apply it.
-
-pushkey
--------
-
-Denotes that the peer supports the ``puskey`` part.
-
-remote-changegroup
-------------------
-
-Denotes that the peer supports the ``remote-changegroup`` part and
-which protocols it can use to fetch remote changegroup data.
-
-Values are protocol names. e.g. ``http`` and ``https``.
-
-stream
-------
-
-Denotes that the peer supports ``stream*`` parts in order to support
-*stream clone*.
-
-Values are which ``stream*`` parts the peer supports. ``v2`` denotes
-support for the ``stream2`` part.
-
-Bundle2 Part Types
-==================
-
-The sections below detail the various bundle2 part types.
-
-bookmarks
----------
-
-The ``bookmarks`` part holds bookmarks information.
-
-This part has no parameters.
-
-The payload consists of entries defining bookmarks. Each entry consists of:
-
-* 20 bytes binary changeset node.
-* 2 bytes big endian short defining bookmark name length.
-* N bytes defining bookmark name.
-
-Receivers typically update bookmarks to match the state specified in
-this part.
-
-changegroup
------------
-
-The ``changegroup`` part contains *changegroup* data (changelog, manifestlog,
-and filelog revision data).
-
-The following part parameters are defined for this part.
-
-version
-   Changegroup version string. e.g. ``01``, ``02``, and ``03``. This parameter
-   determines how to interpret the changegroup data within the part.
-
-nbchanges
-   The number of changesets in this changegroup. This parameter can be used
-   to aid in the display of progress bars, etc during part application.
-
-treemanifest
-   Whether the changegroup contains tree manifests.
-
-targetphase
-   The target phase of changesets in this part. Value is an integer of
-   the target phase.
-
-The payload of this part is raw changegroup data. See
-:hg:`help internals.changegroups` for the format of changegroup data.
-
-check:bookmarks
----------------
-
-The ``check:bookmarks`` part is inserted into a bundle as a means for the
-receiver to validate that the sender's known state of bookmarks matches
-the receiver's.
-
-This part has no parameters.
-
-The payload is a binary stream of bookmark data. Each entry in the stream
-consists of:
-
-* 20 bytes binary node that bookmark is associated with
-* 2 bytes unsigned short defining length of bookmark name
-* N bytes containing the bookmark name
-
-If all bits in the node value are ``1``, then this signifies a missing
-bookmark.
-
-When the receiver encounters this part, for each bookmark in the part
-payload, it should validate that the current bookmark state matches
-the specified state. If it doesn't, then the receiver should take
-appropriate action. (In the case of pushes, this mismatch signifies
-a race condition and the receiver should consider rejecting the push.)
-
-check:heads
------------
-
-The ``check:heads`` part is a means to validate that the sender's state
-of DAG heads matches the receiver's.
-
-This part has no parameters.
-
-The body of this part is an array of 20 byte binary nodes representing
-changeset heads.
-
-Receivers should compare the set of heads defined in this part to the
-current set of repo heads and take action if there is a mismatch in that
-set.
-
-Note that this part applies to *all* heads in the repo.
-
-check:phases
-------------
-
-The ``check:phases`` part validates that the sender's state of phase
-boundaries matches the receiver's.
-
-This part has no parameters.
-
-The payload consists of an array of 24 byte entries. Each entry is
-a big endian 32-bit integer defining the phase integer and 20 byte
-binary node value.
-
-For each changeset defined in this part, the receiver should validate
-that its current phase matches the phase defined in this part. The
-receiver should take appropriate action if a mismatch occurs.
-
-check:updated-heads
--------------------
-
-The ``check:updated-heads`` part validates that the sender's state of
-DAG heads updated by this bundle matches the receiver's.
-
-This type is nearly identical to ``check:heads`` except the heads
-in the payload are only a subset of heads in the repository. The
-receiver should validate that all nodes specified by the sender are
-branch heads and take appropriate action if not.
-
-error:abort
------------
-
-The ``error:abort`` part conveys a fatal error.
-
-The following part parameters are defined:
-
-message
-   The string content of the error message.
-
-hint
-   Supplemental string giving a hint on how to fix the problem.
-
-error:pushkey
--------------
-
-The ``error:pushkey`` part conveys an error in the *pushkey* protocol.
-
-The following part parameters are defined:
-
-namespace
-   The pushkey domain that exhibited the error.
-
-key
-   The key whose update failed.
-
-new
-   The value we tried to set the key to.
-
-old
-   The old value of the key (as supplied by the client).
-
-ret
-   The integer result code for the pushkey request.
-
-in-reply-to
-   Part ID that triggered this error.
-
-This part is generated if there was an error applying *pushkey* data.
-Pushkey data includes bookmarks, phases, and obsolescence markers.
-
-error:pushraced
----------------
-
-The ``error:pushraced`` part conveys that an error occurred and
-the likely cause is losing a race with another pusher.
-
-The following part parameters are defined:
-
-message
-   String error message.
-
-This part is typically emitted when a receiver examining ``check:*``
-parts encountered inconsistency between incoming state and local state.
-The likely cause of that inconsistency is another repository change
-operation (often another client performing an ``hg push``).
-
-error:unsupportedcontent
-------------------------
-
-The ``error:unsupportedcontent`` part conveys that a bundle2 receiver
-encountered a part or content it was not able to handle.
-
-The following part parameters are defined:
-
-parttype
-   The name of the part that triggered this error.
-
-params
-   ``\0`` delimited list of parameters.
-
-hgtagsfnodes
-------------
-
-The ``hgtagsfnodes`` type defines file nodes for the ``.hgtags`` file
-for various changesets.
-
-This part has no parameters.
-
-The payload is an array of pairs of 20 byte binary nodes. The first node
-is a changeset node. The second node is the ``.hgtags`` file node.
-
-Resolving tags requires resolving the ``.hgtags`` file node for changesets.
-On large repositories, this can be expensive. Repositories cache the
-mapping of changeset to ``.hgtags`` file node on disk as a performance
-optimization. This part allows that cached data to be transferred alongside
-changeset data.
-
-Receivers should update their ``.hgtags`` cache file node mappings with
-the incoming data.
-
-listkeys
---------
-
-The ``listkeys`` part holds content for a *pushkey* namespace.
-
-The following part parameters are defined:
-
-namespace
-   The pushkey domain this data belongs to.
-
-The part payload contains a newline (``\n``) delimited list of
-tab (``\t``) delimited key-value pairs defining entries in this pushkey
-namespace.
-
-obsmarkers
-----------
-
-The ``obsmarkers`` part defines obsolescence markers.
-
-This part has no parameters.
-
-The payload consists of obsolescence markers using the on-disk markers
-format. The first byte defines the version format.
-
-The receiver should apply the obsolescence markers defined in this
-part. A ``reply:obsmarkers`` part should be sent to the sender, if possible.
-
-output
-------
-
-The ``output`` part is used to display output on the receiver.
-
-This part has no parameters.
-
-The payload consists of raw data to be printed on the receiver.
-
-phase-heads
------------
-
-The ``phase-heads`` part defines phase boundaries.
-
-This part has no parameters.
-
-The payload consists of an array of 24 byte entries. Each entry is
-a big endian 32-bit integer defining the phase integer and 20 byte
-binary node value.
-
-pushkey
--------
-
-The ``pushkey`` part communicates an intent to perform a ``pushkey``
-request.
-
-The following part parameters are defined:
-
-namespace
-   The pushkey domain to operate on.
-
-key
-   The key within the pushkey namespace that is being changed.
-
-old
-   The old value for the key being changed.
-
-new
-   The new value for the key being changed.
-
-This part has no payload.
-
-The receiver should perform a pushkey operation as described by this
-part's parameters.
-
-If the pushey operation fails, a ``reply:pushkey`` part should be sent
-back to the sender, if possible. The ``in-reply-to`` part parameter
-should reference the source part.
-
-pushvars
---------
-
-The ``pushvars`` part defines environment variables that should be
-set when processing this bundle2 payload.
-
-The part's advisory parameters define environment variables.
-
-There is no part payload.
-
-When received, part parameters are prefixed with ``USERVAR_`` and the
-resulting variables are defined in the hooks context for the current
-bundle2 application. This part provides a mechanism for senders to
-inject extra state into the hook execution environment on the receiver.
-
-remote-changegroup
-------------------
-
-The ``remote-changegroup`` part defines an external location of a bundle
-to apply. This part can be used by servers to serve pre-generated bundles
-hosted at arbitrary URLs.
-
-The following part parameters are defined:
-
-url
-   The URL of the remote bundle.
-
-size
-   The size in bytes of the remote bundle.
-
-digests
-   A space separated list of the digest types provided in additional
-   part parameters.
-
-digest:<type>
-   The hexadecimal representation of the digest (hash) of the remote bundle.
-
-There is no payload for this part type.
-
-When encountered, clients should attempt to fetch the URL being advertised
-and read and apply it as a bundle.
-
-The ``size`` and ``digest:<type>`` parameters should be used to validate
-that the downloaded bundle matches what was advertised. If a mismatch occurs,
-the client should abort.
-
-reply:changegroup
------------------
-
-The ``reply:changegroup`` part conveys the results of application of a
-``changegroup`` part.
-
-The following part parameters are defined:
-
-return
-   Integer return code from changegroup application.
-
-in-reply-to
-   Part ID of part this reply is in response to.
-
-reply:obsmarkers
-----------------
-
-The ``reply:obsmarkers`` part conveys the results of applying an
-``obsmarkers`` part.
-
-The following part parameters are defined:
-
-new
-   The integer number of new markers that were applied.
-
-in-reply-to
-   The part ID that this part is in reply to.
-
-reply:pushkey
--------------
-
-The ``reply:pushkey`` part conveys the result of a *pushkey* operation.
-
-The following part parameters are defined:
-
-return
-   Integer result code from pushkey operation.
-
-in-reply-to
-   Part ID that triggered this pushkey operation.
-
-This part has no payload.
-
-replycaps
----------
-
-The ``replycaps`` part notifies the receiver that a reply bundle should
-be created.
-
-This part has no parameters.
-
-The payload consists of a bundle2 capabilities blob.
-
-stream2
--------
-
-The ``stream2`` part contains *streaming clone* version 2 data.
-
-The following part parameters are defined:
-
-requirements
-   URL quoted repository requirements string. Requirements are delimited by a
-   command (``,``).
-
-filecount
-   The total number of files being transferred in the payload.
-
-bytecount
-   The total size of file content being transferred in the payload.
-
-The payload consists of raw stream clone version 2 data.
-
-The ``filecount`` and ``bytecount`` parameters can be used for progress and
-reporting purposes. The values may not be exact.
--- a/mercurial/help/internals/bundles.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-A bundle is a container for repository data.
-
-Bundles are used as standalone files as well as the interchange format
-over the wire protocol used when two Mercurial peers communicate with
-each other.
-
-Headers
-=======
-
-Bundles produced since Mercurial 0.7 (September 2005) have a 4 byte
-header identifying the major bundle type. The header always begins with
-``HG`` and the follow 2 bytes indicate the bundle type/version. Some
-bundle types have additional data after this 4 byte header.
-
-The following sections describe each bundle header/type.
-
-HG10
-----
-
-``HG10`` headers indicate a *changegroup bundle*. This is the original
-bundle format, so it is sometimes referred to as *bundle1*. It has been
-present since version 0.7 (released September 2005).
-
-This header is followed by 2 bytes indicating the compression algorithm
-used for data that follows. All subsequent data following this
-compression identifier is compressed according to the algorithm/method
-specified.
-
-Supported algorithms include the following.
-
-``BZ``
-   *bzip2* compression.
-
-   Bzip2 compressors emit a leading ``BZ`` header. Mercurial uses this
-   leading ``BZ`` as part of the bundle header. Therefore consumers
-   of bzip2 bundles need to *seed* the bzip2 decompressor with ``BZ`` or
-   seek the input stream back to the beginning of the algorithm component
-   of the bundle header so that decompressor input is valid. This behavior
-   is unique among supported compression algorithms.
-
-   Supported since version 0.7 (released December 2006).
-
-``GZ``
-  *zlib* compression.
-
-   Supported since version 0.9.2 (released December 2006).
-
-``UN``
-  *Uncompressed* or no compression. Unmodified changegroup data follows.
-
-  Supported since version 0.9.2 (released December 2006).
-
-3rd party extensions may implement their own compression. However, no
-authority reserves values for their compression algorithm identifiers.
-
-HG2X
-----
-
-``HG2X`` headers (where ``X`` is any value) denote a *bundle2* bundle.
-Bundle2 bundles are a container format for various kinds of repository
-data and capabilities, beyond changegroup data (which was the only data
-supported by ``HG10`` bundles.
-
-``HG20`` is currently the only defined bundle2 version.
-
-The ``HG20`` format is documented at :hg:`help internals.bundle2`.
-
-Initial ``HG20`` support was added in Mercurial 3.0 (released May
-2014). However, bundle2 bundles were hidden behind an experimental flag
-until version 3.5 (released August 2015), when they were enabled in the
-wire protocol. Various commands (including ``hg bundle``) did not
-support generating bundle2 files until Mercurial 3.6 (released November
-2015).
-
-HGS1
-----
-
-*Experimental*
-
-A ``HGS1`` header indicates a *streaming clone bundle*. This is a bundle
-that contains raw revlog data from a repository store. (Typically revlog
-data is exchanged in the form of changegroups.)
-
-The purpose of *streaming clone bundles* are to *clone* repository data
-very efficiently.
-
-The ``HGS1`` header is always followed by 2 bytes indicating a
-compression algorithm of the data that follows. Only ``UN``
-(uncompressed data) is currently allowed.
-
-``HGS1UN`` support was added as an experimental feature in version 3.6
-(released November 2015) as part of the initial offering of the *clone
-bundles* feature.
--- a/mercurial/help/internals/cbor.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-Mercurial uses Concise Binary Object Representation (CBOR)
-(RFC 7049) for various data formats.
-
-This document describes the subset of CBOR that Mercurial uses and
-gives recommendations for appropriate use of CBOR within Mercurial.
-
-Type Limitations
-================
-
-Major types 0 and 1 (unsigned integers and negative integers) MUST be
-fully supported.
-
-Major type 2 (byte strings) MUST be fully supported. However, there
-are limitations around the use of indefinite-length byte strings.
-(See below.)
-
-Major type 3 (text strings) are NOT supported.
-
-Major type 4 (arrays) MUST be supported. However, values are limited
-to the set of types described in the "Container Types" section below.
-And indefinite-length arrays are NOT supported.
-
-Major type 5 (maps) MUST be supported. However, key values are limited
-to the set of types described in the "Container Types" section below.
-And indefinite-length maps are NOT supported.
-
-Major type 6 (semantic tagging of major types) can be used with the
-following semantic tag values:
-
-258
-   Mathematical finite set. Suitable for representing Python's
-   ``set`` type.
-
-All other semantic tag values are not allowed.
-
-Major type 7 (simple data types) can be used with the following
-type values:
-
-20
-   False
-21
-   True
-22
-   Null
-31
-   Break stop code (for indefinite-length items).
-
-All other simple data type values (including every value requiring the
-1 byte extension) are disallowed.
-
-Indefinite-Length Byte Strings
-==============================
-
-Indefinite-length byte strings (major type 2) are allowed. However,
-they MUST NOT occur inside a container type (such as an array or map).
-i.e. they can only occur as the "top-most" element in a stream of
-values.
-
-Encoders and decoders SHOULD *stream* indefinite-length byte strings.
-i.e. an encoder or decoder SHOULD NOT buffer the entirety of a long
-byte string value when indefinite-length byte strings are being used
-if it can be avoided. Mercurial MAY use extremely long indefinite-length
-byte strings and buffering the source or destination value COULD lead to
-memory exhaustion.
-
-Chunks in an indefinite-length byte string SHOULD NOT exceed 2^20
-bytes.
-
-Container Types
-===============
-
-Mercurial may use the array (major type 4), map (major type 5), and
-set (semantic tag 258 plus major type 4 array) container types.
-
-An array may contain any supported type as values.
-
-A map MUST only use the following types as keys:
-
-* unsigned integers (major type 0)
-* negative integers (major type 1)
-* byte strings (major type 2) (but not indefinite-length byte strings)
-* false (simple type 20)
-* true (simple type 21)
-* null (simple type 22)
-
-A map MUST only use the following types as values:
-
-* all types supported as map keys
-* arrays
-* maps
-* sets
-
-A set may only use the following types as values:
-
-* all types supported as map keys
-
-It is recommended that keys in maps and values in sets and arrays all
-be of a uniform type.
-
-Avoiding Large Byte Strings
-===========================
-
-The use of large byte strings is discouraged, especially in scenarios where
-the total size of the byte string may by unbound for some inputs (e.g. when
-representing the content of a tracked file). It is highly recommended to use
-indefinite-length byte strings for these purposes.
-
-Since indefinite-length byte strings cannot be nested within an outer
-container (such as an array or map), to associate a large byte string
-with another data structure, it is recommended to use an array or
-map followed immediately by an indefinite-length byte string. For example,
-instead of the following map::
-
-   {
-      "key1": "value1",
-      "key2": "value2",
-      "long_value": "some very large value...",
-   }
-
-Use a map followed by a byte string:
-
-   {
-      "key1": "value1",
-      "key2": "value2",
-      "value_follows": True,
-   }
-   <BEGIN INDEFINITE-LENGTH BYTE STRING>
-   "some very large value"
-   "..."
-   <END INDEFINITE-LENGTH BYTE STRING>
--- a/mercurial/help/internals/censor.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-The censor system allows retroactively removing content from
-files. Actually censoring a node requires using the censor extension,
-but the functionality for handling censored nodes is partially in core.
-
-Censored nodes in a filelog have the flag ``REVIDX_ISCENSORED`` set,
-and the contents of the censored node are replaced with a censor
-tombstone. For historical reasons, the tombstone is packed in the
-filelog metadata field ``censored``. This allows censored nodes to be
-(mostly) safely transmitted through old formats like changegroup
-versions 1 and 2. When using changegroup formats older than 3, the
-receiver is required to re-add the ``REVIDX_ISCENSORED`` flag when
-storing the revision. This depends on the ``censored`` metadata key
-never being used for anything other than censoring revisions, which is
-true as of January 2017. Note that the revlog flag is the
-authoritative marker of a censored node: the tombstone should only be
-consulted when looking for a reason a node was censored or when revlog
-flags are unavailable as mentioned above.
-
-The tombstone data is a free-form string. It's expected that users of
-censor will want to record the reason for censoring a node in the
-tombstone. Censored nodes must be able to fit in the size of the
-content being censored.
--- a/mercurial/help/internals/changegroups.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,207 +0,0 @@
-Changegroups are representations of repository revlog data, specifically
-the changelog data, root/flat manifest data, treemanifest data, and
-filelogs.
-
-There are 3 versions of changegroups: ``1``, ``2``, and ``3``. From a
-high-level, versions ``1`` and ``2`` are almost exactly the same, with the
-only difference being an additional item in the *delta header*. Version
-``3`` adds support for storage flags in the *delta header* and optionally
-exchanging treemanifests (enabled by setting an option on the
-``changegroup`` part in the bundle2).
-
-Changegroups when not exchanging treemanifests consist of 3 logical
-segments::
-
-   +---------------------------------+
-   |           |          |          |
-   | changeset | manifest | filelogs |
-   |           |          |          |
-   |           |          |          |
-   +---------------------------------+
-
-When exchanging treemanifests, there are 4 logical segments::
-
-   +-------------------------------------------------+
-   |           |          |               |          |
-   | changeset |   root   | treemanifests | filelogs |
-   |           | manifest |               |          |
-   |           |          |               |          |
-   +-------------------------------------------------+
-
-The principle building block of each segment is a *chunk*. A *chunk*
-is a framed piece of data::
-
-   +---------------------------------------+
-   |           |                           |
-   |  length   |           data            |
-   | (4 bytes) |   (<length - 4> bytes)    |
-   |           |                           |
-   +---------------------------------------+
-
-All integers are big-endian signed integers. Each chunk starts with a 32-bit
-integer indicating the length of the entire chunk (including the length field
-itself).
-
-There is a special case chunk that has a value of 0 for the length
-(``0x00000000``). We call this an *empty chunk*.
-
-Delta Groups
-============
-
-A *delta group* expresses the content of a revlog as a series of deltas,
-or patches against previous revisions.
-
-Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
-to signal the end of the delta group::
-
-  +------------------------------------------------------------------------+
-  |                |             |               |             |           |
-  | chunk0 length  | chunk0 data | chunk1 length | chunk1 data |    0x0    |
-  |   (4 bytes)    |  (various)  |   (4 bytes)   |  (various)  | (4 bytes) |
-  |                |             |               |             |           |
-  +------------------------------------------------------------------------+
-
-Each *chunk*'s data consists of the following::
-
-  +---------------------------------------+
-  |                        |              |
-  |     delta header       |  delta data  |
-  |  (various by version)  |  (various)   |
-  |                        |              |
-  +---------------------------------------+
-
-The *delta data* is a series of *delta*s that describe a diff from an existing
-entry (either that the recipient already has, or previously specified in the
-bundle/changegroup).
-
-The *delta header* is different between versions ``1``, ``2``, and
-``3`` of the changegroup format.
-
-Version 1 (headerlen=80)::
-
-   +------------------------------------------------------+
-   |            |             |             |             |
-   |    node    |   p1 node   |   p2 node   |  link node  |
-   | (20 bytes) |  (20 bytes) |  (20 bytes) |  (20 bytes) |
-   |            |             |             |             |
-   +------------------------------------------------------+
-
-Version 2 (headerlen=100)::
-
-   +------------------------------------------------------------------+
-   |            |             |             |            |            |
-   |    node    |   p1 node   |   p2 node   | base node  | link node  |
-   | (20 bytes) |  (20 bytes) |  (20 bytes) | (20 bytes) | (20 bytes) |
-   |            |             |             |            |            |
-   +------------------------------------------------------------------+
-
-Version 3 (headerlen=102)::
-
-   +------------------------------------------------------------------------------+
-   |            |             |             |            |            |           |
-   |    node    |   p1 node   |   p2 node   | base node  | link node  |   flags   |
-   | (20 bytes) |  (20 bytes) |  (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
-   |            |             |             |            |            |           |
-   +------------------------------------------------------------------------------+
-
-The *delta data* consists of ``chunklen - 4 - headerlen`` bytes, which contain a
-series of *delta*s, densely packed (no separators). These deltas describe a diff
-from an existing entry (either that the recipient already has, or previously
-specified in the bundle/changegroup). The format is described more fully in
-``hg help internals.bdiff``, but briefly::
-
-   +---------------------------------------------------------------+
-   |              |            |            |                      |
-   | start offset | end offset | new length |        content       |
-   |  (4 bytes)   |  (4 bytes) |  (4 bytes) | (<new length> bytes) |
-   |              |            |            |                      |
-   +---------------------------------------------------------------+
-
-Please note that the length field in the delta data does *not* include itself.
-
-In version 1, the delta is always applied against the previous node from
-the changegroup or the first parent if this is the first entry in the
-changegroup.
-
-In version 2 and up, the delta base node is encoded in the entry in the
-changegroup. This allows the delta to be expressed against any parent,
-which can result in smaller deltas and more efficient encoding of data.
-
-The *flags* field holds bitwise flags affecting the processing of revision
-data. The following flags are defined:
-
-32768
-   Censored revision. The revision's fulltext has been replaced by censor
-   metadata. May only occur on file revisions.
-16384
-   Ellipsis revision. Revision hash does not match data (likely due to rewritten
-   parents).
-8192
-   Externally stored. The revision fulltext contains ``key:value`` ``\n``
-   delimited metadata defining an object stored elsewhere. Used by the LFS
-   extension.
-
-For historical reasons, the integer values are identical to revlog version 1
-per-revision storage flags and correspond to bits being set in this 2-byte
-field. Bits were allocated starting from the most-significant bit, hence the
-reverse ordering and allocation of these flags.
-
-Changeset Segment
-=================
-
-The *changeset segment* consists of a single *delta group* holding
-changelog data. The *empty chunk* at the end of the *delta group* denotes
-the boundary to the *manifest segment*.
-
-Manifest Segment
-================
-
-The *manifest segment* consists of a single *delta group* holding manifest
-data. If treemanifests are in use, it contains only the manifest for the
-root directory of the repository. Otherwise, it contains the entire
-manifest data. The *empty chunk* at the end of the *delta group* denotes
-the boundary to the next segment (either the *treemanifests segment* or the
-*filelogs segment*, depending on version and the request options).
-
-Treemanifests Segment
----------------------
-
-The *treemanifests segment* only exists in changegroup version ``3``, and
-only if the 'treemanifest' param is part of the bundle2 changegroup part
-(it is not possible to use changegroup version 3 outside of bundle2).
-Aside from the filenames in the *treemanifests segment* containing a
-trailing ``/`` character, it behaves identically to the *filelogs segment*
-(see below). The final sub-segment is followed by an *empty chunk* (logically,
-a sub-segment with filename size 0). This denotes the boundary to the
-*filelogs segment*.
-
-Filelogs Segment
-================
-
-The *filelogs segment* consists of multiple sub-segments, each
-corresponding to an individual file whose data is being described::
-
-   +--------------------------------------------------+
-   |          |          |          |     |           |
-   | filelog0 | filelog1 | filelog2 | ... |    0x0    |
-   |          |          |          |     | (4 bytes) |
-   |          |          |          |     |           |
-   +--------------------------------------------------+
-
-The final filelog sub-segment is followed by an *empty chunk* (logically,
-a sub-segment with filename size 0). This denotes the end of the segment
-and of the overall changegroup.
-
-Each filelog sub-segment consists of the following::
-
-   +------------------------------------------------------+
-   |                 |                      |             |
-   | filename length |       filename       | delta group |
-   |    (4 bytes)    | (<length - 4> bytes) |  (various)  |
-   |                 |                      |             |
-   +------------------------------------------------------+
-
-That is, a *chunk* consisting of the filename (not terminated or padded)
-followed by N chunks constituting the *delta group* for this file. The
-*empty chunk* at the end of each *delta group* denotes the boundary to the
-next filelog sub-segment.
--- a/mercurial/help/internals/config.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-All config options used within Mercurial should be registered.
-
-Config Option in Core
-=====================
-
-Config options used by Mercurial core are registered in the
-``mercurial.configitems`` module.
-
-Simple entry
-------------
-
-A registration entry typically looks like::
-
-    coreconfigitem('section', 'option',
-        default=MyDefaultValue,
-    )
-
-Once registered, Mercurial will know that ``section.option`` is a legitimate
-config option and that ``MyDefaultValue`` should be used if no other values are
-defined in configuration files.
-
-Complex default value
----------------------
-
-If the default provided is a callable, it is called to retrieve the default
-value when accessing the config option. This is useful for default values that
-are mutable like the empty list::
-
-    coreconfigitem('pager', 'ignore',
-        default=list,
-    )
-
-In addition, there are cases where the default is not fixed, but computed from
-other properties. In this case, use the ``dynamicdefault`` object as the value
-for the ``default`` parameter. A default value is then explicitly required when
-reading the option::
-
-    # registration
-    coreconfigitem('web', 'name',
-        default=dynamicdefault,
-    )
-
-    # usage
-    ui.config('web', 'name', dirname)
-
-Free form options
------------------
-
-Some config sections use free form options (e.g. ``paths``). You can register
-them using the ``generic`` parameters::
-
-    coreconfigitem('paths', '.*',
-        default=None,
-        generic=True,
-    )
-
-When ``generic=True`` is set, the option name is matched as a regular expression
-(rooted to string start). It can be used to select specific sub parameters::
-
-    coreconfigitem('merge-tools', br'.*\.args$',
-        default="$local $base $other",
-        generic=True,
-        priority=-1,
-    )
-
-The ``priority`` parameter controls the order used to match the generic pattern
-(lower first).
-
-Config Option in Extensions
-===========================
-
-General case
-------------
-
-Extensions should register config items through the ``registrar`` API (also used
-for commands and others)::
-
-    configtable = {}
-    configitem = registrar.configitem(configtable)
-
-    configitem('blackbox', 'dirty',
-        default=False,
-    )
-
-The ``dynamicdefault`` object is then available as
-``configitem.dynamicdefault``.
-
-Supporting older versions
--------------------------
-
-The registrar was introduced in Mercurial 4.3, and the ``generic`` parameter was
-introduced in 4.4. Starting with Mercurial 4.4, all core options were registered
-and developer warnings are emitted when accessing unregistered option.
-
-Extensions supporting versions older than Mercurial 4.3 cannot rely on the
-default value being registered. The simplest way to register an option while
-still supporting an older version is to use ``dynamicdefault`` for options
-requiring a default value. The existing code passing an explicit default can
-then stay in use until compatibility with Mercurial 4.2 is dropped.
-
-As reminder, here are the default values for each config type:
-
-    - config:      None
-    - configbool:  False
-    - configbytes: 0
-    - configdate:  None
-    - configint:   None
-    - configlist:  []
-    - configpath:  None
--- a/mercurial/help/internals/extensions.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,367 +0,0 @@
-Extensions allow the creation of new features and using them directly from
-the main hg command line as if they were built-in commands. The extensions
-have full access to the *internal* API.
-
-Use of Mercurial's internal API very likely makes your code subject to
-Mercurial's license. Before going any further, read the License page.
-
-There are NO guarantees that third-party code calling into Mercurial's
-internals won't break from release to release. If you do use Mercurial's API
-for published third-party code, we expect you to test your code before each
-major Mercurial release. This will prevent various bug reports from your users
-when they upgrade their copy of Mercurial.
-
-File Layout
-===========
-
-Extensions are usually written as simple python modules. Larger ones are
-better split into multiple modules of a single package (see the convert
-extension). The package root module gives its name to the extension and
-implements the ``cmdtable`` and optional callbacks described below.
-
-Command table
-=============
-
-To write your own extension, your python module can provide an optional dict
-named ``cmdtable`` with entries describing each command. A command should be
-registered to the ``cmdtable`` by ``@command`` decorator.
-
-Example using ``@command`` decorator (requires Mercurial 1.9)::
-
-    from mercurial.i18n import _
-
-    cmdtable = {}
-    try:
-        from mercurial import registrar
-        command = registrar.command(cmdtable)
-    except (AttributeError, ImportError):
-        # Fallback to hg < 4.3 support
-        from mercurial import cmdutil
-        command = cmdutil.command(cmdtable)
-
-    @command('print-parents',
-        [('s', 'short', None, _('print short form')),
-         ('l', 'long', None, _('print long form'))],
-        _('[options] node'))
-    def printparents(ui, repo, node, **opts):
-        ...
-
-The cmdtable dictionary
------------------------
-
-The ``cmdtable`` dictionary uses as key the new command names, and, as value,
-a tuple containing:
-
-1. the function to be called when the command is used.
-2. a list of options the command can take.
-3. a command line synopsis for the command (the function docstring is used for
-   the full help).
-
-List of options
----------------
-
-All the command flag options are documented in the mercurial/fancyopts.py
-sources.
-
-The options list is a list of tuples containing:
-
-1. the short option letter, or ``''`` if no short option is available
-   (for example, ``o`` for a ``-o`` option).
-2. the long option name (for example, ``option`` for a ``--option`` option).
-3. a default value for the option.
-4. a help string for the option (it's possible to omit the "hg newcommand"
-   part and only the options and parameter substring is needed).
-
-Command function signatures
----------------------------
-
-Functions that implement new commands always receive a ``ui`` and usually
-a ``repo`` parameter. The rest of parameters are taken from the command line
-items that don't start with a dash and are passed in the same order they were
-written. If no default value is given in the parameter list they are required.
-
-If there is no repo to be associated with the command and consequently no
-``repo`` passed, then ``norepo=True`` should be passed to the ``@command``
-decorator::
-
-    @command('mycommand', [], norepo=True)
-    def mycommand(ui, **opts):
-        ...
-
-For examples of ``norepo``, see the convert extension.
-
-Command function docstrings
-===========================
-
-The docstring of your function is used as the main help text, shown by
-``hg help mycommand``. The docstring should be formatted using a simple
-subset of reStructuredText markup. The supported constructs include:
-
-Paragraphs::
-
-    This is a paragraph.
-
-    Paragraphs are separated
-    by blank lines.
-
-A verbatim block is introduced with a double colon followed by an indented
-block. The double colon is turned into a single colon on display::
-
-    Some text::
-
-      verbatim
-        text
-         !!
-
-We have field lists::
-
-    :key1: value1
-    :key2: value2
-
-Bullet lists::
-
-    - foo
-    - bar
-
-Enumerated lists::
-
-    1. foo
-    2. bar
-
-Inline markup::
-
-    ``*bold*``, ``monospace``, :hg:`command`
-
-Mark Mercurial commands with ``:hg:`` to make a nice link to the corresponding
-documentation. We'll expand the support if new constructs can be parsed
-without too much trouble.
-
-Communicating with the user
-===========================
-
-Besides the ``ui`` methods, like ``ui.write(*msg)`` or
-``ui.prompt(msg, default="y")``, an extension can add help text for each
-of its commands and the extension itself.
-
-The module docstring will be used as help string when ``hg help extensionname``
-is used and, similarly, the help string for a command and the docstring
-belonging to the function that's wrapped by the command will be shown when
-``hg help command`` is invoked.
-
-Setup Callbacks
-===============
-
-Extensions are loaded in phases. All extensions are processed in a given phase
-before the next phase begins. In the first phase, all extension modules are
-loaded and registered with Mercurial. This means that you can find all enabled
-extensions with ``extensions.find`` in the following phases.
-
-Extension setup
----------------
-
-There are two callbacks to be called when extensions are loaded, named
-``uisetup`` and ``extsetup``. ``uisetup`` is called first for each extension,
-then ``extsetup`` is called. This means ``extsetup`` can be useful in case
-one extension optionally depends on another extension.
-
-Both ``uisetup`` and ``extsetup`` receive a ui object with the local
-repository configuration::
-
-    def uisetup(ui):
-        # ...
-
-    def extsetup(ui):
-        # ...
-
-Be aware that ``uisetup`` in NOT the function to configure a ``ui`` instance.
-It's called only once per process, not per ``ui`` instance. Also, any changes
-to the ``ui`` may be discarded because the ``ui`` here temporarily loaded
-local configuration. So, it's generally wrong to do `ui.setconfig()` in
-these callbacks. Notable exception is setting ``pre/post-<command>`` hooks
-and extending ``ui.__class__``.
-
-In Mercurial 1.3.1 or earlier, ``extsetup`` takes no argument.
-
-Command table setup
--------------------
-
-After ``extsetup``, the ``cmdtable`` is copied into the global command table
-in Mercurial.
-
-Ui instance setup
------------------
-
-The optional ``uipopulate`` is called for each ``ui`` instance after
-configuration is loaded, where extensions can set up additional ui members,
-update configuration by ``ui.setconfig()``, and extend the class dynamically.
-
-Typically there are three ``ui`` instances involved in command execution:
-
-``req.ui`` (or ``repo.baseui``)
-    Only system and user configurations are loaded into it.
-``lui``
-    Local repository configuration is loaded as well. This will be used at
-    early dispatching stage where a repository isn't available.
-``repo.ui``
-    The fully-loaded ``ui`` used after a repository is instantiated. This
-    will be created from the ``req.ui`` per repository.
-
-In command server and hgweb, this may be called more than once for the same
-``ui`` instance.
-
-(New in Mercurial 4.9)
-
-Repository setup
-----------------
-
-Extensions can implement an optional callback named ``reposetup``. It is
-called after the main Mercurial repository initialization, and can be used
-to setup any local state the extension might need.
-
-As other command functions it receives an ``ui`` object and a ``repo`` object
-(no additional parameters for this, though)::
-
-    def reposetup(ui, repo):
-        #do initialization here.
-
-It is important to take into account that the ``ui`` object that is received
-by the ``reposetup`` function is not the same as the one received by the
-``uisetup`` and ``extsetup`` functions. This is particularly important when
-setting up hooks as described in the following section, since not all hooks
-use the same ``ui`` object and hence different hooks must be configured in
-different setup functions.
-
-Wrapping methods on the ui and repo classes
--------------------------------------------
-
-Because extensions can be loaded *per repository*, you should avoid using
-``extensions.wrapfunction()`` on methods of the ``ui`` and ``repo`` objects.
-Instead, create a subclass of the specific class of the instance passed into
-the ``*setup()`` hook; e.g. use ``ui.__class__`` as the base class, then
-reassign your new class to ``ui.__class__`` again. Mercurial will then use
-your updated ``ui`` or ``repo`` instance only for repositories where your
-extension is enabled (or copies thereof, reusing your new class).
-
-For example::
-
-    def uisetup(ui):
-        class echologui(ui.__class__):
-            def log(self, service, *msg, **opts):
-                if msg:
-                    self.write('%s: %s\n' % (service, msg[0] % msg[1:]))
-                super(echologui, self).log(service, *msg, **opts)
-
-        ui.__class__ = echologui
-
-Configuring Hooks
-=================
-
-Some extensions must use hooks to do their work. These required hooks can
-be configured manually by the user by modifying the ``[hook]`` section of
-their hgrc, but they can also be configured automatically by calling the
-``ui.setconfig('hooks', ...)`` function in one of the setup functions
-described above.
-
-The main difference between manually modifying the hooks section in the hgrc
-and using ``ui.setconfig()`` is that when using ``ui.setconfig()`` you have
-access to the actual hook function object, which you can pass directly to
-``ui.setconfig()``, while when you use the hooks section of the hgrc file
-you must refer to the hook function by using the
-``python:modulename.functioname`` idiom (e.g. ``python:hgext.notify.hook``).
-
-For example::
-
-    # Define hooks -- note that the actual function name it irrelevant.
-    def preupdatehook(ui, repo, **kwargs):
-        ui.write("Pre-update hook triggered\n")
-
-    def updatehook(ui, repo, **kwargs):
-        ui.write("Update hook triggered\n")
-
-    def uisetup(ui):
-        # When pre-<cmd> and post-<cmd> hooks are configured by means of
-        # the ui.setconfig() function, you must use the ui object passed
-        # to uisetup or extsetup.
-        ui.setconfig("hooks", "pre-update.myextension", preupdatehook)
-
-    def reposetup(ui, repo):
-        # Repository-specific hooks can be configured here. These include
-        # the update hook.
-        ui.setconfig("hooks", "update.myextension", updatehook)
-
-Note how different hooks may need to be configured in different setup
-functions. In the example you can see that the ``update`` hook must be
-configured in the ``reposetup`` function, while the ``pre-update`` hook
-must be configured on the ``uisetup`` or the ``extsetup`` functions.
-
-Marking compatible versions
-===========================
-
-Every extension should use the ``testedwith`` variable to specify Mercurial
-releases it's known to be compatible with. This helps us and users diagnose
-where problems are coming from::
-
-    testedwith = '2.0 2.0.1 2.1 2.1.1 2.1.2'
-
-Do not use the ``internal`` marker in third-party extensions; we will
-immediately drop all bug reports mentioning your extension if we catch you
-doing this.
-
-Similarly, an extension can use the ``buglink`` variable to specify how users
-should report issues with the extension.  This link will be included in the
-error message if the extension produces errors::
-
-    buglink = 'https://bitbucket.org/USER/REPO/issues'
-
-If an extension requires a minimum version of Mercurial, it can be declared
-with the ``minimumhgversion`` variable::
-
-    minimumhgversion = '4.6'
-
-Older clients will print a warning that the extension requires a new version,
-instead of attempting to load it.
-
-Wrap up: what belongs where?
-============================
-
-You will find here a list of most common tasks, based on setups from the
-extensions included in Mercurial core.
-
-uisetup
--------
-
-* Changes to ``ui.__class__`` . The ``ui`` object that will be used to run
-  the command has not yet been created. Changes made here will affect ``ui``
-  objects created after this, and in particular the ``ui`` that will be passed
-  to ``runcommand``
-* Command wraps (``extensions.wrapcommand``)
-* Changes that need to be visible by other extensions: because initialization
-  occurs in phases (all extensions run ``uisetup``, then all run ``extsetup``),
-  a change made here will be visible by other extensions during ``extsetup``.
-* Monkeypatches or function wraps (``extensions.wrapfunction``) of ``dispatch``
-  module members
-* Set up ``pre-*`` and ``post-*`` hooks. (DEPRECATED. ``uipopulate`` is
-  preferred on Mercurial 4.9 and later.)
-* ``pushkey`` setup
-
-extsetup
---------
-
-* Changes depending on the status of other extensions. (``if extensions.find('mq')``)
-* Add a global option to all commands
-* Extend revsets
-
-uipopulate
-----------
-
-* Modify ``ui`` instance attributes and configuration variables.
-* Changes to ``ui.__class__`` per instance.
-* Set up all hooks per scoped configuration.
-
-reposetup
----------
-
-* Set up all hooks but ``pre-*`` and ``post-*``. (DEPRECATED. ``uipopulate`` is
-  preferred on Mercurial 4.9 and later.)
-* Modify configuration variables
-* Changes to ``repo.__class__``, ``repo.dirstate.__class__``
--- a/mercurial/help/internals/linelog.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,302 +0,0 @@
-linelog is a storage format inspired by the "Interleaved deltas" idea. See
-https://en.wikipedia.org/wiki/Interleaved_deltas for its introduction.
-
-0. SCCS Weave
-
-  To understand what linelog is, first we have a quick look at a simplified
-  (with header removed) SCCS weave format, which is an implementation of the
-  "Interleaved deltas" idea.
-
-0.1 Basic SCCS Weave File Format
-
-  A SCCS weave file consists of plain text lines. Each line is either a
-  special instruction starting with "^A" or part of the content of the real
-  file the weave tracks. There are 3 important operations, where REV denotes
-  the revision number:
-
-    ^AI REV, marking the beginning of an insertion block introduced by REV
-    ^AD REV, marking the beginning of a deletion block introduced by REV
-    ^AE REV, marking the end of the block started by "^AI REV" or "^AD REV"
-
-  Note on revision numbers: For any two different revision numbers, one must
-  be an ancestor of the other to make them comparable. This enforces linear
-  history. Besides, the comparison functions (">=", "<") should be efficient.
-  This means, if revisions are strings like git or hg, an external map is
-  required to convert them into integers.
-
-  For example, to represent the following changes:
-
-    REV 1 | REV 2 | REV 3
-    ------+-------+-------
-    a     | a     | a
-    b     | b     | 2
-    c     | 1     | c
-          | 2     |
-          | c     |
-
-  A possible weave file looks like:
-
-    ^AI 1
-    a
-    ^AD 3
-    b
-    ^AI 2
-    1
-    ^AE 3
-    2
-    ^AE 2
-    c
-    ^AE 1
-
-  An "^AE" does not always match its nearest operation ("^AI" or "^AD"). In
-  the above example, "^AE 3" does not match the nearest "^AI 2" but "^AD 3".
-  Therefore we need some extra information for "^AE". The SCCS weave uses a
-  revision number. It could also be a boolean value about whether it is an
-  insertion or a deletion (see section 0.4).
-
-0.2 Checkout
-
-  The "checkout" operation is to retrieve file content at a given revision,
-  say X. It's doable by going through the file line by line and:
-
-    - If meet ^AI rev, and rev > X, find the corresponding ^AE and jump there
-    - If meet ^AD rev, and rev <= X, find the corresponding ^AE and jump there
-    - Ignore ^AE
-    - For normal lines, just output them
-
-0.3 Annotate
-
-  The "annotate" operation is to show extra metadata like the revision number
-  and the original line number a line comes from.
-
-  It's basically just a "Checkout". For the extra metadata, they can be stored
-  side by side with the line contents. Alternatively, we can infer the
-  revision number from "^AI"s.
-
-  Some SCM tools have to calculate diffs on the fly and thus are much slower
-  on this operation.
-
-0.4 Tree Structure
-
-  The word "interleaved" is used because "^AI" .. "^AE" and "^AD" .. "^AE"
-  blocks can be interleaved.
-
-  If we consider insertions and deletions separately, they can form tree
-  structures, respectively.
-
-    +--- ^AI 1        +--- ^AD 3
-    | +- ^AI 2        | +- ^AD 2
-    | |               | |
-    | +- ^AE 2        | +- ^AE 2
-    |                 |
-    +--- ^AE 1        +--- ^AE 3
-
-  More specifically, it's possible to build a tree for all insertions, where
-  the tree node has the structure "(rev, startline, endline)". "startline" is
-  the line number of "^AI" and "endline" is the line number of the matched
-  "^AE".  The tree will have these properties:
-
-    1. child.rev > parent.rev
-    2. child.startline > parent.startline
-    3. child.endline < parent.endline
-
-  A similar tree for all deletions can also be built with the first property
-  changed to:
-
-    1. child.rev < parent.rev
-
-0.5 Malformed Cases
-
-  The following cases are considered malformed in our implementation:
-
-    1. Interleaved insertions, or interleaved deletions.
-       It can be rewritten to a non-interleaved tree structure.
-
-       Take insertions as example, deletions are similar:
-
-       ^AI x         ^AI x
-       a             a
-       ^AI x + 1  -> ^AI x + 1
-       b             b
-       ^AE x         ^AE x + 1
-       c             ^AE x
-       ^AE x + 1     ^AI x + 1
-                     c
-                     ^AE x + 1
-
-    2. Nested insertions, where the inner one has a smaller revision number.
-       Or nested deletions, where the inner one has a larger revision number.
-       It can be rewritten to a non-nested form.
-
-       Take insertions as example, deletions are similar:
-
-       ^AI x + 1     ^AI x + 1
-       a             a
-       ^AI x      -> ^AE x + 1
-       b             ^AI x
-       ^AE x         b
-       c             ^AE x
-       ^AE x + 1     ^AI x + 1
-                     c
-                     ^AE x + 1
-
-    3. Insertion inside deletion with a smaller revision number.
-
-       Rewrite by duplicating the content inserted:
-
-       ^AD x          ^AD x
-       a              a
-       ^AI x + 1  ->  b
-       b              c
-       ^AE x + 1      ^AE x
-       c              ^AI x + 1
-       ^AE x          b
-                      ^AE x + 1
-
-       Note: If "annotate" purely depends on "^AI" information, then the
-       duplication content will lose track of where "b" is originally from.
-
-  Some of them may be valid in other implementations for special purposes. For
-  example, to "revive" a previously deleted block in a newer revision.
-
-0.6 Cases Can Be Optimized
-
-  It's always better to get things nested. For example, the left is more
-  efficient than the right while they represent the same content:
-
-    +--- ^AD 2          +- ^AD 1
-    | +- ^AD 1          |   LINE A
-    | |   LINE A        +- ^AE 1
-    | +- ^AE 1          +- ^AD 2
-    |     LINE B        |   LINE B
-    +--- ^AE 2          +- ^AE 2
-
-  Our implementation sometimes generates the less efficient data. To always
-  get the optimal form, it requires extra code complexity that seems unworthy.
-
-0.7 Inefficiency
-
-  The file format can be slow because:
-
-  - Inserting a new line at position P requires rewriting all data after P.
-  - Finding "^AE" requires walking through the content (O(N), where N is the
-    number of lines between "^AI/D" and "^AE").
-
-1. Linelog
-
-  The linelog is a binary format that dedicates to speed up mercurial (or
-  git)'s "annotate" operation. It's designed to avoid issues mentioned in
-  section 0.7.
-
-1.1 Content Stored
-
-  Linelog is not another storage for file contents. It only stores line
-  numbers and corresponding revision numbers, instead of actual line content.
-  This is okay for the "annotate" operation because usually the external
-  source is fast to checkout the content of a file at a specific revision.
-
-  A typical SCCS weave is also fast on the "grep" operation, which needs
-  random accesses to line contents from different revisions of a file. This
-  can be slow with linelog's no-line-content design. However we could use
-  an extra map ((rev, line num) -> line content) to speed it up.
-
-  Note the revision numbers in linelog should be independent from mercurial
-  integer revision numbers. There should be some mapping between linelog rev
-  and hg hash stored side by side, to make the files reusable after being
-  copied to another machine.
-
-1.2 Basic Format
-
-  A linelog file consists of "instruction"s. An "instruction" can be either:
-
-    - JGE  REV ADDR     # jump to ADDR if rev >= REV
-    - JL   REV ADDR     # jump to ADDR if rev < REV
-    - LINE REV LINENUM  # append the (LINENUM+1)-th line in revision REV
-
-  For example, here is the example linelog representing the same file with
-  3 revisions mentioned in section 0.1:
-
-    SCCS  |    Linelog
-    Weave | Addr : Instruction
-    ------+------+-------------
-    ^AI 1 |    0 : JL   1 8
-    a     |    1 : LINE 1 0
-    ^AD 3 |    2 : JGE  3 6
-    b     |    3 : LINE 1 1
-    ^AI 2 |    4 : JL   2 7
-    1     |    5 : LINE 2 2
-    ^AE 3 |
-    2     |    6 : LINE 2 3
-    ^AE 2 |
-    c     |    7 : LINE 1 2
-    ^AE 1 |
-          |    8 : END
-
-  This way, "find ^AE" is O(1) because we just jump there. And we can insert
-  new lines without rewriting most part of the file by appending new lines and
-  changing a single instruction to jump to them.
-
-  The current implementation uses 64 bits for an instruction: The opcode (JGE,
-  JL or LINE) takes 2 bits, REV takes 30 bits and ADDR or LINENUM takes 32
-  bits. It also stores the max revision number and buffer size at the first
-  64 bits for quick access to these values.
-
-1.3 Comparing with Mercurial's revlog format
-
-  Apparently, linelog is very different from revlog: linelog stores rev and
-  line numbers, while revlog has line contents and other metadata (like
-  parents, flags). However, the revlog format could also be used to store rev
-  and line numbers. For example, to speed up the annotate operation, we could
-  also pre-calculate annotate results and just store them using the revlog
-  format.
-
-  Therefore, linelog is actually somehow similar to revlog, with the important
-  trade-off that it only supports linear history (mentioned in section 0.1).
-  Essentially, the differences are:
-
-    a) Linelog is full of deltas, while revlog could contain full file
-       contents sometimes. So linelog is smaller. Revlog could trade
-       reconstruction speed for file size - best case, revlog is as small as
-       linelog.
-    b) The interleaved delta structure allows skipping large portion of
-       uninteresting deltas so linelog's content reconstruction is faster than
-       the delta-only version of revlog (however it's possible to construct
-       a case where interleaved deltas degrade to plain deltas, so linelog
-       worst case would be delta-only revlog). Revlog could trade file size
-       for reconstruction speed.
-    c) Linelog implicitly maintains the order of all lines it stores. So it
-       could dump all the lines from all revisions, with a reasonable order.
-       While revlog could also dump all line additions, it requires extra
-       computation to figure out the order putting those lines - that's some
-       kind of "merge".
-
-  "c" makes "hg absorb" easier to implement and makes it possible to do
-  "annotate --deleted".
-
-1.4 Malformed Cases Handling
-
-  The following "case 1", "case 2", and "case 3" refer to cases mentioned
-  in section 0.5.
-
-  Using the exposed API (replacelines), case 1 is impossible to generate,
-  although it's possible to generate it by constructing rawdata and load that
-  via linelog.fromdata.
-
-  Doing annotate(maxrev) before replacelines (aka. a1, a2 passed to
-  replacelines are related to the latest revision) eliminates the possibility
-  of case 3. That makes sense since usually you'd like to make edits on top of
-  the latest revision. Practically, both absorb and fastannotate do this.
-
-  Doing annotate(maxrev), plus replacelines(rev, ...) where rev >= maxrev
-  eliminates the possibility of case 2. That makes sense since usually the
-  edits belong to "new revisions", not "old revisions". Practically,
-  fastannotate does this. Absorb calls replacelines with rev < maxrev to edit
-  past revisions. So it needs some extra care to not generate case 2.
-
-  If case 1 occurs, that probably means linelog file corruption (assuming
-  linelog is edited via public APIs) the checkout or annotate result could
-  be less meaningful or even error out, but linelog wouldn't enter an infinite
-  loop.
-
-  If either case 2 or 3 occurs, linelog works as if the inner "^AI/D" and "^AE"
-  operations on the left side are silently ignored.
--- a/mercurial/help/internals/mergestate.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-The active mergestate is stored in ``.hg/merge`` when a merge is triggered
-by commands like ``hg merge``, ``hg rebase``, etc. until the merge is
-completed or aborted to track the 3-way merge state of individual files.
-
-The contents of the directory are:
-
-Conflicting files
------------------
-
-The local version of the conflicting files are stored with their
-filenames as the hash of their paths.
-
-state
------
-
-This mergestate file record is used by hg version prior to 2.9.1
-and contains less data than ``state2``. If there is no contradiction
-with ``state2``, we can assume that both are written at the same time.
-In this case, data from ``state2`` is used. Otherwise, we use ``state``.
-We read/write both ``state`` and ``state2`` records to ensure backward
-compatibility.
-
-state2
-------
-
-This record stores a superset of data in ``state``, including new kinds
-of records in the future.
-
-Each record can contain arbitrary content and has an associated type. This
-`type` should be a letter. If `type` is uppercase, the record is mandatory:
-versions of Mercurial that don't support it should abort. If `type` is
-lowercase, the record can be safely ignored.
-
-Currently known records:
-
-| * L: the node of the "local" part of the merge (hexified version)
-| * O: the node of the "other" part of the merge (hexified version)
-| * F: a file to be merged entry
-| * C: a change/delete or delete/change conflict
-| * D: a file that the external merge driver will merge internally
-|      (experimental)
-| * P: a path conflict (file vs directory)
-| * m: the external merge driver defined for this merge plus its run state
-|      (experimental)
-| * f: a (filename, dictionary) tuple of optional values for a given file
-| * X: unsupported mandatory record type (used in tests)
-| * x: unsupported advisory record type (used in tests)
-| * l: the labels for the parts of the merge.
-
-Merge driver run states (experimental):
-
-| * u: driver-resolved files unmarked -- needs to be run next time we're
-|      about to resolve or commit
-| * m: driver-resolved files marked -- only needs to be run before commit
-| * s: success/skipped -- does not need to be run any more
-
-Merge record states (indexed by filename):
-
-| * u: unresolved conflict
-| * r: resolved conflict
-| * pu: unresolved path conflict (file conflicts with directory)
-| * pr: resolved path conflict
-| * d: driver-resolved conflict
-
-The resolve command transitions between 'u' and 'r' for conflicts and
-'pu' and 'pr' for path conflicts.
-
-This format is a list of arbitrary records of the form:
-
-[type][length][content]
-
-`type` is a single character, `length` is a 4 byte integer, and
-`content` is an arbitrary byte sequence of length `length`.
-
-Mercurial versions prior to 3.7 have a bug where if there are
-unsupported mandatory merge records, attempting to clear out the merge
-state with hg update --clean or similar aborts. The 't' record type
-works around that by writing out what those versions treat as an
-advisory record, but later versions interpret as special: the first
-character is the 'real' record type and everything onwards is the data.
--- a/mercurial/help/internals/requirements.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-Repositories contain a file (``.hg/requires``) containing a list of
-features/capabilities that are *required* for clients to interface
-with the repository. This file has been present in Mercurial since
-version 0.9.2 (released December 2006).
-
-One of the first things clients do when opening a repository is read
-``.hg/requires`` and verify that all listed requirements are supported,
-aborting if not. Requirements are therefore a strong mechanism to
-prevent incompatible clients from reading from unknown repository
-formats or even corrupting them by writing to them.
-
-Extensions may add requirements. When they do this, clients not running
-an extension will be unable to read from repositories.
-
-The following sections describe the requirements defined by the
-Mercurial core distribution.
-
-revlogv1
-========
-
-When present, revlogs are version 1 (RevlogNG). RevlogNG was introduced
-in 2006. The ``revlogv1`` requirement has been enabled by default
-since the ``requires`` file was introduced in Mercurial 0.9.2.
-
-If this requirement is not present, version 0 revlogs are assumed.
-
-store
-=====
-
-The *store* repository layout should be used.
-
-This requirement has been enabled by default since the ``requires`` file
-was introduced in Mercurial 0.9.2.
-
-fncache
-=======
-
-The *fncache* repository layout should be used.
-
-The *fncache* layout hash encodes filenames with long paths and
-encodes reserved filenames.
-
-This requirement is enabled by default when the *store* requirement is
-enabled (which is the default behavior). It was introduced in Mercurial
-1.1 (released December 2008).
-
-shared
-======
-
-Denotes that the store for a repository is shared from another location
-(defined by the ``.hg/sharedpath`` file).
-
-This requirement is set when a repository is created via :hg:`share`.
-
-The requirement was added in Mercurial 1.3 (released July 2009).
-
-relshared
-=========
-
-Derivative of ``shared``; the location of the store is relative to the
-store of this repository.
-
-This requirement is set when a repository is created via :hg:`share`
-using the ``--relative`` option.
-
-The requirement was added in Mercurial 4.2 (released May 2017).
-
-dotencode
-=========
-
-The *dotencode* repository layout should be used.
-
-The *dotencode* layout encodes the first period or space in filenames
-to prevent issues on OS X and Windows.
-
-This requirement is enabled by default when the *store* requirement
-is enabled (which is the default behavior). It was introduced in
-Mercurial 1.7 (released November 2010).
-
-parentdelta
-===========
-
-Denotes a revlog delta encoding format that was experimental and
-replaced by *generaldelta*. It should not be seen in the wild because
-it was never enabled by default.
-
-This requirement was added in Mercurial 1.7 and removed in Mercurial
-1.9.
-
-generaldelta
-============
-
-Revlogs should be created with the *generaldelta* flag enabled. The
-generaldelta flag will cause deltas to be encoded against a parent
-revision instead of the previous revision in the revlog.
-
-Support for this requirement was added in Mercurial 1.9 (released
-July 2011). The requirement was disabled on new repositories by
-default until Mercurial 3.7 (released February 2016).
-
-manifestv2
-==========
-
-Denotes that version 2 of manifests are being used.
-
-Support for this requirement was added in Mercurial 3.4 (released
-May 2015). The new format failed to meet expectations and support
-for the format and requirement were removed in Mercurial 4.6
-(released May 2018) since the feature never graduated frome experiment
-status.
-
-treemanifest
-============
-
-Denotes that tree manifests are being used. Tree manifests are
-one manifest per directory (as opposed to a single flat manifest).
-
-Support for this requirement was added in Mercurial 3.4 (released
-August 2015). The requirement is currently experimental and is
-disabled by default.
-
-exp-sparse
-==========
-
-The working directory is sparse (only contains a subset of files).
-
-Support for this requirement was added in Mercurial 4.3 (released
-August 2017). This requirement and feature are experimental and may
-disappear in a future Mercurial release. The requirement will only
-be present on repositories that have opted in to a sparse working
-directory.
-
-bookmarksinstore
-==================
-
-Bookmarks are stored in ``.hg/store/`` instead of directly in ``.hg/``
-where they used to be stored. The active bookmark is still stored
-directly in ``.hg/``. This makes them always shared by ``hg share``,
-whether or not ``-B`` was passed.
-
-Support for this requirement was added in Mercurial 5.1 (released
-August 2019). The requirement will only be present on repositories
-that have opted in to this format (by having
-``format.bookmarks-in-store=true`` set when they were created).
--- a/mercurial/help/internals/revlogs.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-Revision logs - or *revlogs* - are an append only data structure for
-storing discrete entries, or *revisions*. They are the primary storage
-mechanism of repository data.
-
-Revlogs effectively model a directed acyclic graph (DAG). Each node
-has edges to 1 or 2 *parent* nodes. Each node contains metadata and
-the raw value for that node.
-
-Revlogs consist of entries which have metadata and revision data.
-Metadata includes the hash of the revision's content, sizes, and
-links to its *parent* entries. The collective metadata is referred
-to as the *index* and the revision data is the *data*.
-
-Revision data is stored as a series of compressed deltas against
-ancestor revisions.
-
-Revlogs are written in an append-only fashion. We never need to rewrite
-a file to insert nor do we need to remove data. Rolling back in-progress
-writes can be performed by truncating files. Read locks can be avoided
-using simple techniques. This means that references to other data in
-the same revlog *always* refer to a previous entry.
-
-Revlogs can be modeled as 0-indexed arrays. The first revision is
-revision #0 and the second is revision #1. The revision -1 is typically
-used to mean *does not exist* or *not defined*.
-
-File Format
-===========
-
-A revlog begins with a 32-bit big endian integer holding version info
-and feature flags. This integer overlaps with the first four bytes of
-the first revision entry.
-
-This integer is logically divided into 2 16-bit shorts. The least
-significant half of the integer is the format/version short. The other
-short holds feature flags that dictate behavior of the revlog.
-
-The following values for the format/version short are defined:
-
-0
-   The original revlog version.
-1
-   RevlogNG (*next generation*). It replaced version 0 when it was
-   implemented in 2006.
-2
-   In-development version incorporating accumulated knowledge and
-   missing features from 10+ years of revlog version 1.
-57005 (0xdead)
-   Reserved for internal testing of new versions. No defined format
-   beyond 32-bit header.
-
-The feature flags short consists of bit flags. Where 0 is the least
-significant bit. The bit flags vary by revlog version.
-
-Version 0 revlogs have no defined flags and the presence of a flag
-is considered an error.
-
-Version 1 revlogs have the following flags at the specified bit offsets:
-
-0
-   Store revision data inline.
-1
-   Generaldelta encoding.
-
-Version 2 revlogs have the following flags at the specified bit offsets:
-
-0
-   Store revision data inline.
-
-The following header values are common:
-
-00 00 00 01
-   v1
-00 01 00 01
-   v1 + inline
-00 02 00 01
-   v1 + generaldelta
-00 03 00 01
-   v1 + inline + generaldelta
-
-Following the 32-bit header is the remaining 60 bytes of the first index
-entry. Following that are additional *index* entries. Inlined revision
-data is possibly located between index entries. More on this inlined
-layout is described below.
-
-Version 1 Format
-================
-
-Version 1 (RevlogNG) begins with an index describing the revisions in
-the revlog. If the ``inline`` flag is set, revision data is stored inline,
-or between index entries (as opposed to in a separate container).
-
-Each index entry is 64 bytes. The byte layout of each entry is as
-follows, with byte 0 being the first byte (all data stored as big endian):
-
-0-3 (4 bytes) (rev 0 only)
-   Revlog header
-
-0-5 (6 bytes)
-   Absolute offset of revision data from beginning of revlog.
-
-6-7 (2 bytes)
-   Bit flags impacting revision behavior. The following bit offsets define:
-
-   0: REVIDX_ISCENSORED revision has censor metadata, must be verified.
-
-   1: REVIDX_ELLIPSIS revision hash does not match its data. Used by
-   narrowhg
-
-   2: REVIDX_EXTSTORED revision data is stored externally.
-
-8-11 (4 bytes)
-   Compressed length of revision data / chunk as stored in revlog.
-
-12-15 (4 bytes)
-   Uncompressed length of revision data. This is the size of the full
-   revision data, not the size of the chunk post decompression.
-
-16-19 (4 bytes)
-   Base or previous revision this revision's delta was produced against.
-   This revision holds full text (as opposed to a delta) if it points to
-   itself. For generaldelta repos, this is the previous revision in the
-   delta chain. For non-generaldelta repos, this is the base or first
-   revision in the delta chain.
-
-20-23 (4 bytes)
-   A revision this revision is *linked* to. This allows a revision in
-   one revlog to be forever associated with a revision in another
-   revlog. For example, a file's revlog may point to the changelog
-   revision that introduced it.
-
-24-27 (4 bytes)
-   Revision of 1st parent. -1 indicates no parent.
-
-28-31 (4 bytes)
-   Revision of 2nd parent. -1 indicates no 2nd parent.
-
-32-63 (32 bytes)
-   Hash of revision's full text. Currently, SHA-1 is used and only
-   the first 20 bytes of this field are used. The rest of the bytes
-   are ignored and should be stored as \0.
-
-If inline revision data is being stored, the compressed revision data
-(of length from bytes offset 8-11 from the index entry) immediately
-follows the index entry. There is no header on the revision data. There
-is no padding between it and the index entries before and after.
-
-If revision data is not inline, then raw revision data is stored in a
-separate byte container. The offsets from bytes 0-5 and the compressed
-length from bytes 8-11 define how to access this data.
-
-The 6 byte absolute offset field from the first revlog entry overlaps
-with the revlog header. That is, the first 6 bytes of the first revlog
-entry can be split into four bytes containing the header for the revlog
-file and an additional two bytes containing the offset for the first
-entry. Since this is the offset from the beginning of the file for the
-first revision entry, the two bytes will always be set to zero.
-
-Version 2 Format
-================
-
-(In development. Format not finalized or stable.)
-
-Version 2 is identical to version 2 with the following differences.
-
-There is no dedicated *generaldelta* revlog format flag. Instead,
-the feature is implied enabled by default.
-
-Delta Chains
-============
-
-Revision data is encoded as a chain of *chunks*. Each chain begins with
-the compressed original full text for that revision. Each subsequent
-*chunk* is a *delta* against the previous revision. We therefore call
-these chains of chunks/deltas *delta chains*.
-
-The full text for a revision is reconstructed by loading the original
-full text for the base revision of a *delta chain* and then applying
-*deltas* until the target revision is reconstructed.
-
-*Delta chains* are limited in length so lookup time is bound. They are
-limited to ~2x the length of the revision's data. The linear distance
-between the base chunk and the final chunk is also limited so the
-amount of read I/O to load all chunks in the delta chain is bound.
-
-Deltas and delta chains are either computed against the previous
-revision in the revlog or another revision (almost certainly one of
-the parents of the revision). Historically, deltas were computed against
-the previous revision. The *generaldelta* revlog feature flag (enabled
-by default in Mercurial 3.7) activates the mode where deltas are
-computed against an arbitrary revision (almost certainly a parent revision).
-
-File Storage
-============
-
-Revlogs logically consist of an index (metadata of entries) and
-revision data. This data may be stored together in a single file or in
-separate files. The mechanism used is indicated by the ``inline`` feature
-flag on the revlog.
-
-Mercurial's behavior is to use inline storage until a revlog reaches a
-certain size, at which point it will be converted to non-inline. The
-reason there is a size limit on inline storage is to establish an upper
-bound on how much data must be read to load the index. It would be a waste
-to read tens or hundreds of extra megabytes of data just to access the
-index data.
-
-The actual layout of revlog files on disk is governed by the repository's
-*store format*. Typically, a ``.i`` file represents the index revlog
-(possibly containing inline data) and a ``.d`` file holds the revision data.
-
-Revision Entries
-================
-
-Revision entries consist of an optional 1 byte header followed by an
-encoding of the revision data. The headers are as follows:
-
-\0 (0x00)
-   Revision data is the entirety of the entry, including this header.
-u (0x75)
-   Raw revision data follows.
-x (0x78)
-   zlib (RFC 1950) data.
-
-   The 0x78 value is actually the first byte of the zlib header (CMF byte).
-
-Hash Computation
-================
-
-The hash of the revision is stored in the index and is used both as a primary
-key and for data integrity verification.
-
-Currently, SHA-1 is the only supported hashing algorithm. To obtain the SHA-1
-hash of a revision:
-
-1. Hash the parent nodes
-2. Hash the fulltext of the revision
-
-The 20 byte node ids of the parents are fed into the hasher in ascending order.
--- a/mercurial/help/internals/wireprotocol.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1277 +0,0 @@
-The Mercurial wire protocol is a request-response based protocol
-with multiple wire representations.
-
-Each request is modeled as a command name, a dictionary of arguments, and
-optional raw input. Command arguments and their types are intrinsic
-properties of commands. So is the response type of the command. This means
-clients can't always send arbitrary arguments to servers and servers can't
-return multiple response types.
-
-The protocol is synchronous and does not support multiplexing (concurrent
-commands).
-
-Handshake
-=========
-
-It is required or common for clients to perform a *handshake* when connecting
-to a server. The handshake serves the following purposes:
-
-* Negotiating protocol/transport level options
-* Allows the client to learn about server capabilities to influence
-  future requests
-* Ensures the underlying transport channel is in a *clean* state
-
-An important goal of the handshake is to allow clients to use more modern
-wire protocol features. By default, clients must assume they are talking
-to an old version of Mercurial server (possibly even the very first
-implementation). So, clients should not attempt to call or utilize modern
-wire protocol features until they have confirmation that the server
-supports them. The handshake implementation is designed to allow both
-ends to utilize the latest set of features and capabilities with as
-few round trips as possible.
-
-The handshake mechanism varies by transport and protocol and is documented
-in the sections below.
-
-HTTP Protocol
-=============
-
-Handshake
----------
-
-The client sends a ``capabilities`` command request (``?cmd=capabilities``)
-as soon as HTTP requests may be issued.
-
-By default, the server responds with a version 1 capabilities string, which
-the client parses to learn about the server's abilities. The ``Content-Type``
-for this response is ``application/mercurial-0.1`` or
-``application/mercurial-0.2`` depending on whether the client advertised
-support for version ``0.2`` in its request. (Clients aren't supposed to
-advertise support for ``0.2`` until the capabilities response indicates
-the server's support for that media type. However, a client could
-conceivably cache this metadata and issue the capabilities request in such
-a way to elicit an ``application/mercurial-0.2`` response.)
-
-Clients wishing to switch to a newer API service may send an
-``X-HgUpgrade-<X>`` header containing a space-delimited list of API service
-names the client is capable of speaking. The request MUST also include an
-``X-HgProto-<X>`` header advertising a known serialization format for the
-response. ``cbor`` is currently the only defined serialization format.
-
-If the request contains these headers, the response ``Content-Type`` MAY
-be for a different media type. e.g. ``application/mercurial-cbor`` if the
-client advertises support for CBOR.
-
-The response MUST be deserializable to a map with the following keys:
-
-apibase
-   URL path to API services, relative to the repository root. e.g. ``api/``.
-
-apis
-   A map of API service names to API descriptors. An API descriptor contains
-   more details about that API. In the case of the HTTP Version 2 Transport,
-   it will be the normal response to a ``capabilities`` command.
-
-   Only the services advertised by the client that are also available on
-   the server are advertised.
-
-v1capabilities
-   The capabilities string that would be returned by a version 1 response.
-
-The client can then inspect the server-advertised APIs and decide which
-API to use, including continuing to use the HTTP Version 1 Transport.
-
-HTTP Version 1 Transport
-------------------------
-
-Commands are issued as HTTP/1.0 or HTTP/1.1 requests. Commands are
-sent to the base URL of the repository with the command name sent in
-the ``cmd`` query string parameter. e.g.
-``https://example.com/repo?cmd=capabilities``. The HTTP method is ``GET``
-or ``POST`` depending on the command and whether there is a request
-body.
-
-Command arguments can be sent multiple ways.
-
-The simplest is part of the URL query string using ``x-www-form-urlencoded``
-encoding (see Python's ``urllib.urlencode()``. However, many servers impose
-length limitations on the URL. So this mechanism is typically only used if
-the server doesn't support other mechanisms.
-
-If the server supports the ``httpheader`` capability, command arguments can
-be sent in HTTP request headers named ``X-HgArg-<N>`` where ``<N>`` is an
-integer starting at 1. A ``x-www-form-urlencoded`` representation of the
-arguments is obtained. This full string is then split into chunks and sent
-in numbered ``X-HgArg-<N>`` headers. The maximum length of each HTTP header
-is defined by the server in the ``httpheader`` capability value, which defaults
-to ``1024``. The server reassembles the encoded arguments string by
-concatenating the ``X-HgArg-<N>`` headers then URL decodes them into a
-dictionary.
-
-The list of ``X-HgArg-<N>`` headers should be added to the ``Vary`` request
-header to instruct caches to take these headers into consideration when caching
-requests.
-
-If the server supports the ``httppostargs`` capability, the client
-may send command arguments in the HTTP request body as part of an
-HTTP POST request. The command arguments will be URL encoded just like
-they would for sending them via HTTP headers. However, no splitting is
-performed: the raw arguments are included in the HTTP request body.
-
-The client sends a ``X-HgArgs-Post`` header with the string length of the
-encoded arguments data. Additional data may be included in the HTTP
-request body immediately following the argument data. The offset of the
-non-argument data is defined by the ``X-HgArgs-Post`` header. The
-``X-HgArgs-Post`` header is not required if there is no argument data.
-
-Additional command data can be sent as part of the HTTP request body. The
-default ``Content-Type`` when sending data is ``application/mercurial-0.1``.
-A ``Content-Length`` header is currently always sent.
-
-Example HTTP requests::
-
-    GET /repo?cmd=capabilities
-    X-HgArg-1: foo=bar&baz=hello%20world
-
-The request media type should be chosen based on server support. If the
-``httpmediatype`` server capability is present, the client should send
-the newest mutually supported media type. If this capability is absent,
-the client must assume the server only supports the
-``application/mercurial-0.1`` media type.
-
-The ``Content-Type`` HTTP response header identifies the response as coming
-from Mercurial and can also be used to signal an error has occurred.
-
-The ``application/mercurial-*`` media types indicate a generic Mercurial
-data type.
-
-The ``application/mercurial-0.1`` media type is raw Mercurial data. It is the
-predecessor of the format below.
-
-The ``application/mercurial-0.2`` media type is compression framed Mercurial
-data. The first byte of the payload indicates the length of the compression
-format identifier that follows. Next are N bytes indicating the compression
-format. e.g. ``zlib``. The remaining bytes are compressed according to that
-compression format. The decompressed data behaves the same as with
-``application/mercurial-0.1``.
-
-The ``application/hg-error`` media type indicates a generic error occurred.
-The content of the HTTP response body typically holds text describing the
-error.
-
-The ``application/mercurial-cbor`` media type indicates a CBOR payload
-and should be interpreted as identical to ``application/cbor``.
-
-Behavior of media types is further described in the ``Content Negotiation``
-section below.
-
-Clients should issue a ``User-Agent`` request header that identifies the client.
-The server should not use the ``User-Agent`` for feature detection.
-
-A command returning a ``string`` response issues a
-``application/mercurial-0.*`` media type and the HTTP response body contains
-the raw string value (after compression decoding, if used). A
-``Content-Length`` header is typically issued, but not required.
-
-A command returning a ``stream`` response issues a
-``application/mercurial-0.*`` media type and the HTTP response is typically
-using *chunked transfer* (``Transfer-Encoding: chunked``).
-
-HTTP Version 2 Transport
-------------------------
-
-**Experimental - feature under active development**
-
-Version 2 of the HTTP protocol is exposed under the ``/api/*`` URL space.
-It's final API name is not yet formalized.
-
-Commands are triggered by sending HTTP POST requests against URLs of the
-form ``<permission>/<command>``, where ``<permission>`` is ``ro`` or
-``rw``, meaning read-only and read-write, respectively and ``<command>``
-is a named wire protocol command.
-
-Non-POST request methods MUST be rejected by the server with an HTTP
-405 response.
-
-Commands that modify repository state in meaningful ways MUST NOT be
-exposed under the ``ro`` URL prefix. All available commands MUST be
-available under the ``rw`` URL prefix.
-
-Server adminstrators MAY implement blanket HTTP authentication keyed
-off the URL prefix. For example, a server may require authentication
-for all ``rw/*`` URLs and let unauthenticated requests to ``ro/*``
-URL proceed. A server MAY issue an HTTP 401, 403, or 407 response
-in accordance with RFC 7235. Clients SHOULD recognize the HTTP Basic
-(RFC 7617) and Digest (RFC 7616) authentication schemes. Clients SHOULD
-make an attempt to recognize unknown schemes using the
-``WWW-Authenticate`` response header on a 401 response, as defined by
-RFC 7235.
-
-Read-only commands are accessible under ``rw/*`` URLs so clients can
-signal the intent of the operation very early in the connection
-lifecycle. For example, a ``push`` operation - which consists of
-various read-only commands mixed with at least one read-write command -
-can perform all commands against ``rw/*`` URLs so that any server-side
-authentication requirements are discovered upon attempting the first
-command - not potentially several commands into the exchange. This
-allows clients to fail faster or prompt for credentials as soon as the
-exchange takes place. This provides a better end-user experience.
-
-Requests to unknown commands or URLS result in an HTTP 404.
-TODO formally define response type, how error is communicated, etc.
-
-HTTP request and response bodies use the ``hgrpc`` protocol for media
-exchange.` (See :hg:`help internals.wireprotocolrpc` for details of
-the protocol.) The entirety of the HTTP message body is 0 or more frames
-as defined by this protocol.
-
-Clients and servers MUST advertise the ``TBD`` media type via the
-``Content-Type`` request and response headers. In addition, clients MUST
-advertise this media type value in their ``Accept`` request header in all
-requests.
-TODO finalize the media type. For now, it is defined in wireprotoserver.py.
-
-Servers receiving requests without an ``Accept`` header SHOULD respond with
-an HTTP 406.
-
-Servers receiving requests with an invalid ``Content-Type`` header SHOULD
-respond with an HTTP 415.
-
-The command to run is specified in the POST payload as defined by ``hgrpc``.
-This is redundant with data already encoded in the URL. This is by design,
-so server operators can have better understanding about server activity from
-looking merely at HTTP access logs.
-
-In most circumstances, the command specified in the URL MUST match
-the command specified in the frame-based payload or the server will
-respond with an error. The exception to this is the special
-``multirequest`` URL. (See below.) In addition, HTTP requests
-are limited to one command invocation. The exception is the special
-``multirequest`` URL.
-
-The ``multirequest`` command endpoints (``ro/multirequest`` and
-``rw/multirequest``) are special in that they allow the execution of
-*any* command and allow the execution of multiple commands. If the
-HTTP request issues multiple commands across multiple frames, all
-issued commands will be processed by the server. Per the defined
-behavior of ``hgrpc```, commands may be issued interleaved and responses
-may come back in a different order than they were issued. Clients MUST
-be able to deal with this.
-
-SSH Protocol
-============
-
-Handshake
----------
-
-For all clients, the handshake consists of the client sending 1 or more
-commands to the server using version 1 of the transport. Servers respond
-to commands they know how to respond to and send an empty response (``0\n``)
-for unknown commands (per standard behavior of version 1 of the transport).
-Clients then typically look for a response to the newest sent command to
-determine which transport version to use and what the available features for
-the connection and server are.
-
-Preceding any response from client-issued commands, the server may print
-non-protocol output. It is common for SSH servers to print banners, message
-of the day announcements, etc when clients connect. It is assumed that any
-such *banner* output will precede any Mercurial server output. So clients
-must be prepared to handle server output on initial connect that isn't
-in response to any client-issued command and doesn't conform to Mercurial's
-wire protocol. This *banner* output should only be on stdout. However,
-some servers may send output on stderr.
-
-Pre 0.9.1 clients issue a ``between`` command with the ``pairs`` argument
-having the value
-``0000000000000000000000000000000000000000-0000000000000000000000000000000000000000``.
-
-The ``between`` command has been supported since the original Mercurial
-SSH server. Requesting the empty range will return a ``\n`` string response,
-which will be encoded as ``1\n\n`` (value length of ``1`` followed by a newline
-followed by the value, which happens to be a newline).
-
-For pre 0.9.1 clients and all servers, the exchange looks like::
-
-   c: between\n
-   c: pairs 81\n
-   c: 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
-   s: 1\n
-   s: \n
-
-0.9.1+ clients send a ``hello`` command (with no arguments) before the
-``between`` command. The response to this command allows clients to
-discover server capabilities and settings.
-
-An example exchange between 0.9.1+ clients and a ``hello`` aware server looks
-like::
-
-   c: hello\n
-   c: between\n
-   c: pairs 81\n
-   c: 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
-   s: 324\n
-   s: capabilities: lookup changegroupsubset branchmap pushkey known getbundle ...\n
-   s: 1\n
-   s: \n
-
-And a similar scenario but with servers sending a banner on connect::
-
-   c: hello\n
-   c: between\n
-   c: pairs 81\n
-   c: 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
-   s: welcome to the server\n
-   s: if you find any issues, email someone@somewhere.com\n
-   s: 324\n
-   s: capabilities: lookup changegroupsubset branchmap pushkey known getbundle ...\n
-   s: 1\n
-   s: \n
-
-Note that output from the ``hello`` command is terminated by a ``\n``. This is
-part of the response payload and not part of the wire protocol adding a newline
-after responses. In other words, the length of the response contains the
-trailing ``\n``.
-
-Clients supporting version 2 of the SSH transport send a line beginning
-with ``upgrade`` before the ``hello`` and ``between`` commands. The line
-(which isn't a well-formed command line because it doesn't consist of a
-single command name) serves to both communicate the client's intent to
-switch to transport version 2 (transports are version 1 by default) as
-well as to advertise the client's transport-level capabilities so the
-server may satisfy that request immediately.
-
-The upgrade line has the form:
-
-    upgrade <token> <transport capabilities>
-
-That is the literal string ``upgrade`` followed by a space, followed by
-a randomly generated string, followed by a space, followed by a string
-denoting the client's transport capabilities.
-
-The token can be anything. However, a random UUID is recommended. (Use
-of version 4 UUIDs is recommended because version 1 UUIDs can leak the
-client's MAC address.)
-
-The transport capabilities string is a URL/percent encoded string
-containing key-value pairs defining the client's transport-level
-capabilities. The following capabilities are defined:
-
-proto
-   A comma-delimited list of transport protocol versions the client
-   supports. e.g. ``ssh-v2``.
-
-If the server does not recognize the ``upgrade`` line, it should issue
-an empty response and continue processing the ``hello`` and ``between``
-commands. Here is an example handshake between a version 2 aware client
-and a non version 2 aware server:
-
-   c: upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=ssh-v2
-   c: hello\n
-   c: between\n
-   c: pairs 81\n
-   c: 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
-   s: 0\n
-   s: 324\n
-   s: capabilities: lookup changegroupsubset branchmap pushkey known getbundle ...\n
-   s: 1\n
-   s: \n
-
-(The initial ``0\n`` line from the server indicates an empty response to
-the unknown ``upgrade ..`` command/line.)
-
-If the server recognizes the ``upgrade`` line and is willing to satisfy that
-upgrade request, it replies to with a payload of the following form:
-
-   upgraded <token> <transport name>\n
-
-This line is the literal string ``upgraded``, a space, the token that was
-specified by the client in its ``upgrade ...`` request line, a space, and the
-name of the transport protocol that was chosen by the server. The transport
-name MUST match one of the names the client specified in the ``proto`` field
-of its ``upgrade ...`` request line.
-
-If a server issues an ``upgraded`` response, it MUST also read and ignore
-the lines associated with the ``hello`` and ``between`` command requests
-that were issued by the server. It is assumed that the negotiated transport
-will respond with equivalent requested information following the transport
-handshake.
-
-All data following the ``\n`` terminating the ``upgraded`` line is the
-domain of the negotiated transport. It is common for the data immediately
-following to contain additional metadata about the state of the transport and
-the server. However, this isn't strictly speaking part of the transport
-handshake and isn't covered by this section.
-
-Here is an example handshake between a version 2 aware client and a version
-2 aware server:
-
-   c:  upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=ssh-v2
-   c:  hello\n
-   c:  between\n
-   c:  pairs 81\n
-   c:  0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
-   s: upgraded 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a ssh-v2\n
-   s: <additional transport specific data>
-
-The client-issued token that is echoed in the response provides a more
-resilient mechanism for differentiating *banner* output from Mercurial
-output. In version 1, properly formatted banner output could get confused
-for Mercurial server output. By submitting a randomly generated token
-that is then present in the response, the client can look for that token
-in response lines and have reasonable certainty that the line did not
-originate from a *banner* message.
-
-SSH Version 1 Transport
------------------------
-
-The SSH transport (version 1) is a custom text-based protocol suitable for
-use over any bi-directional stream transport. It is most commonly used with
-SSH.
-
-A SSH transport server can be started with ``hg serve --stdio``. The stdin,
-stderr, and stdout file descriptors of the started process are used to exchange
-data. When Mercurial connects to a remote server over SSH, it actually starts
-a ``hg serve --stdio`` process on the remote server.
-
-Commands are issued by sending the command name followed by a trailing newline
-``\n`` to the server. e.g. ``capabilities\n``.
-
-Command arguments are sent in the following format::
-
-    <argument> <length>\n<value>
-
-That is, the argument string name followed by a space followed by the
-integer length of the value (expressed as a string) followed by a newline
-(``\n``) followed by the raw argument value.
-
-Dictionary arguments are encoded differently::
-
-    <argument> <# elements>\n
-    <key1> <length1>\n<value1>
-    <key2> <length2>\n<value2>
-    ...
-
-Non-argument data is sent immediately after the final argument value. It is
-encoded in chunks::
-
-    <length>\n<data>
-
-Each command declares a list of supported arguments and their types. If a
-client sends an unknown argument to the server, the server should abort
-immediately. The special argument ``*`` in a command's definition indicates
-that all argument names are allowed.
-
-The definition of supported arguments and types is initially made when a
-new command is implemented. The client and server must initially independently
-agree on the arguments and their types. This initial set of arguments can be
-supplemented through the presence of *capabilities* advertised by the server.
-
-Each command has a defined expected response type.
-
-A ``string`` response type is a length framed value. The response consists of
-the string encoded integer length of a value followed by a newline (``\n``)
-followed by the value. Empty values are allowed (and are represented as
-``0\n``).
-
-A ``stream`` response type consists of raw bytes of data. There is no framing.
-
-A generic error response type is also supported. It consists of a an error
-message written to ``stderr`` followed by ``\n-\n``. In addition, ``\n`` is
-written to ``stdout``.
-
-If the server receives an unknown command, it will send an empty ``string``
-response.
-
-The server terminates if it receives an empty command (a ``\n`` character).
-
-If the server announces support for the ``protocaps`` capability, the client
-should issue a ``protocaps`` command after the initial handshake to annonunce
-its own capabilities. The client capabilities are persistent.
-
-SSH Version 2 Transport
------------------------
-
-**Experimental and under development**
-
-Version 2 of the SSH transport behaves identically to version 1 of the SSH
-transport with the exception of handshake semantics. See above for how
-version 2 of the SSH transport is negotiated.
-
-Immediately following the ``upgraded`` line signaling a switch to version
-2 of the SSH protocol, the server automatically sends additional details
-about the capabilities of the remote server. This has the form:
-
-   <integer length of value>\n
-   capabilities: ...\n
-
-e.g.
-
-   s: upgraded 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a ssh-v2\n
-   s: 240\n
-   s: capabilities: known getbundle batch ...\n
-
-Following capabilities advertisement, the peers communicate using version
-1 of the SSH transport.
-
-Capabilities
-============
-
-Servers advertise supported wire protocol features. This allows clients to
-probe for server features before blindly calling a command or passing a
-specific argument.
-
-The server's features are exposed via a *capabilities* string. This is a
-space-delimited string of tokens/features. Some features are single words
-like ``lookup`` or ``batch``. Others are complicated key-value pairs
-advertising sub-features. e.g. ``httpheader=2048``. When complex, non-word
-values are used, each feature name can define its own encoding of sub-values.
-Comma-delimited and ``x-www-form-urlencoded`` values are common.
-
-The following document capabilities defined by the canonical Mercurial server
-implementation.
-
-batch
------
-
-Whether the server supports the ``batch`` command.
-
-This capability/command was introduced in Mercurial 1.9 (released July 2011).
-
-branchmap
----------
-
-Whether the server supports the ``branchmap`` command.
-
-This capability/command was introduced in Mercurial 1.3 (released July 2009).
-
-bundle2-exp
------------
-
-Precursor to ``bundle2`` capability that was used before bundle2 was a
-stable feature.
-
-This capability was introduced in Mercurial 3.0 behind an experimental
-flag. This capability should not be observed in the wild.
-
-bundle2
--------
-
-Indicates whether the server supports the ``bundle2`` data exchange format.
-
-The value of the capability is a URL quoted, newline (``\n``) delimited
-list of keys or key-value pairs.
-
-A key is simply a URL encoded string.
-
-A key-value pair is a URL encoded key separated from a URL encoded value by
-an ``=``. If the value is a list, elements are delimited by a ``,`` after
-URL encoding.
-
-For example, say we have the values::
-
-  {'HG20': [], 'changegroup': ['01', '02'], 'digests': ['sha1', 'sha512']}
-
-We would first construct a string::
-
-  HG20\nchangegroup=01,02\ndigests=sha1,sha512
-
-We would then URL quote this string::
-
-  HG20%0Achangegroup%3D01%2C02%0Adigests%3Dsha1%2Csha512
-
-This capability was introduced in Mercurial 3.4 (released May 2015).
-
-changegroupsubset
------------------
-
-Whether the server supports the ``changegroupsubset`` command.
-
-This capability was introduced in Mercurial 0.9.2 (released December
-2006).
-
-This capability was introduced at the same time as the ``lookup``
-capability/command.
-
-compression
------------
-
-Declares support for negotiating compression formats.
-
-Presence of this capability indicates the server supports dynamic selection
-of compression formats based on the client request.
-
-Servers advertising this capability are required to support the
-``application/mercurial-0.2`` media type in response to commands returning
-streams. Servers may support this media type on any command.
-
-The value of the capability is a comma-delimited list of strings declaring
-supported compression formats. The order of the compression formats is in
-server-preferred order, most preferred first.
-
-The identifiers used by the official Mercurial distribution are:
-
-bzip2
-   bzip2
-none
-   uncompressed / raw data
-zlib
-   zlib (no gzip header)
-zstd
-   zstd
-
-This capability was introduced in Mercurial 4.1 (released February 2017).
-
-getbundle
----------
-
-Whether the server supports the ``getbundle`` command.
-
-This capability was introduced in Mercurial 1.9 (released July 2011).
-
-httpheader
-----------
-
-Whether the server supports receiving command arguments via HTTP request
-headers.
-
-The value of the capability is an integer describing the max header
-length that clients should send. Clients should ignore any content after a
-comma in the value, as this is reserved for future use.
-
-This capability was introduced in Mercurial 1.9 (released July 2011).
-
-httpmediatype
--------------
-
-Indicates which HTTP media types (``Content-Type`` header) the server is
-capable of receiving and sending.
-
-The value of the capability is a comma-delimited list of strings identifying
-support for media type and transmission direction. The following strings may
-be present:
-
-0.1rx
-   Indicates server support for receiving ``application/mercurial-0.1`` media
-   types.
-
-0.1tx
-   Indicates server support for sending ``application/mercurial-0.1`` media
-   types.
-
-0.2rx
-   Indicates server support for receiving ``application/mercurial-0.2`` media
-   types.
-
-0.2tx
-   Indicates server support for sending ``application/mercurial-0.2`` media
-   types.
-
-minrx=X
-   Minimum media type version the server is capable of receiving. Value is a
-   string like ``0.2``.
-
-   This capability can be used by servers to limit connections from legacy
-   clients not using the latest supported media type. However, only clients
-   with knowledge of this capability will know to consult this value. This
-   capability is present so the client may issue a more user-friendly error
-   when the server has locked out a legacy client.
-
-mintx=X
-   Minimum media type version the server is capable of sending. Value is a
-   string like ``0.1``.
-
-Servers advertising support for the ``application/mercurial-0.2`` media type
-should also advertise the ``compression`` capability.
-
-This capability was introduced in Mercurial 4.1 (released February 2017).
-
-httppostargs
-------------
-
-**Experimental**
-
-Indicates that the server supports and prefers clients send command arguments
-via a HTTP POST request as part of the request body.
-
-This capability was introduced in Mercurial 3.8 (released May 2016).
-
-known
------
-
-Whether the server supports the ``known`` command.
-
-This capability/command was introduced in Mercurial 1.9 (released July 2011).
-
-lfs
----
-
-Indicates that the LFS extension is enabled on the server.  It makes no claims
-about the repository actually having LFS blobs committed to it.
-
-This capability was introduced by the LFS extension in Mercurial 4.5 (released
-Feb 2018).
-
-lfs-serve
----------
-
-Indicates that the LFS extension is enabled on the server, and LFS blobs are
-committed to the remote repository.  (Specifically, it indicates that the 'lfs'
-requirement is present in the remote repository.)
-
-This capability was introduced by the LFS extension in Mercurial 4.8 (released
-Nov 2018).
-
-lookup
-------
-
-Whether the server supports the ``lookup`` command.
-
-This capability was introduced in Mercurial 0.9.2 (released December
-2006).
-
-This capability was introduced at the same time as the ``changegroupsubset``
-capability/command.
-
-partial-pull
-------------
-
-Indicates that the client can deal with partial answers to pull requests
-by repeating the request.
-
-If this parameter is not advertised, the server will not send pull bundles.
-
-This client capability was introduced in Mercurial 4.6.
-
-protocaps
----------
-
-Whether the server supports the ``protocaps`` command for SSH V1 transport.
-
-This capability was introduced in Mercurial 4.6.
-
-pushkey
--------
-
-Whether the server supports the ``pushkey`` and ``listkeys`` commands.
-
-This capability was introduced in Mercurial 1.6 (released July 2010).
-
-standardbundle
---------------
-
-**Unsupported**
-
-This capability was introduced during the Mercurial 0.9.2 development cycle in
-2006. It was never present in a release, as it was replaced by the ``unbundle``
-capability. This capability should not be encountered in the wild.
-
-stream-preferred
-----------------
-
-If present the server prefers that clients clone using the streaming clone
-protocol (``hg clone --stream``) rather than the standard
-changegroup/bundle based protocol.
-
-This capability was introduced in Mercurial 2.2 (released May 2012).
-
-streamreqs
-----------
-
-Indicates whether the server supports *streaming clones* and the *requirements*
-that clients must support to receive it.
-
-If present, the server supports the ``stream_out`` command, which transmits
-raw revlogs from the repository instead of changegroups. This provides a faster
-cloning mechanism at the expense of more bandwidth used.
-
-The value of this capability is a comma-delimited list of repo format
-*requirements*. These are requirements that impact the reading of data in
-the ``.hg/store`` directory. An example value is
-``streamreqs=generaldelta,revlogv1`` indicating the server repo requires
-the ``revlogv1`` and ``generaldelta`` requirements.
-
-If the only format requirement is ``revlogv1``, the server may expose the
-``stream`` capability instead of the ``streamreqs`` capability.
-
-This capability was introduced in Mercurial 1.7 (released November 2010).
-
-stream
-------
-
-Whether the server supports *streaming clones* from ``revlogv1`` repos.
-
-If present, the server supports the ``stream_out`` command, which transmits
-raw revlogs from the repository instead of changegroups. This provides a faster
-cloning mechanism at the expense of more bandwidth used.
-
-This capability was introduced in Mercurial 0.9.1 (released July 2006).
-
-When initially introduced, the value of the capability was the numeric
-revlog revision. e.g. ``stream=1``. This indicates the changegroup is using
-``revlogv1``. This simple integer value wasn't powerful enough, so the
-``streamreqs`` capability was invented to handle cases where the repo
-requirements have more than just ``revlogv1``. Newer servers omit the
-``=1`` since it was the only value supported and the value of ``1`` can
-be implied by clients.
-
-unbundlehash
-------------
-
-Whether the ``unbundle`` commands supports receiving a hash of all the
-heads instead of a list.
-
-For more, see the documentation for the ``unbundle`` command.
-
-This capability was introduced in Mercurial 1.9 (released July 2011).
-
-unbundle
---------
-
-Whether the server supports pushing via the ``unbundle`` command.
-
-This capability/command has been present since Mercurial 0.9.1 (released
-July 2006).
-
-Mercurial 0.9.2 (released December 2006) added values to the capability
-indicating which bundle types the server supports receiving. This value is a
-comma-delimited list. e.g. ``HG10GZ,HG10BZ,HG10UN``. The order of values
-reflects the priority/preference of that type, where the first value is the
-most preferred type.
-
-Content Negotiation
-===================
-
-The wire protocol has some mechanisms to help peers determine what content
-types and encoding the other side will accept. Historically, these mechanisms
-have been built into commands themselves because most commands only send a
-well-defined response type and only certain commands needed to support
-functionality like compression.
-
-Currently, only the HTTP version 1 transport supports content negotiation
-at the protocol layer.
-
-HTTP requests advertise supported response formats via the ``X-HgProto-<N>``
-request header, where ``<N>`` is an integer starting at 1 allowing the logical
-value to span multiple headers. This value consists of a list of
-space-delimited parameters. Each parameter denotes a feature or capability.
-
-The following parameters are defined:
-
-0.1
-   Indicates the client supports receiving ``application/mercurial-0.1``
-   responses.
-
-0.2
-   Indicates the client supports receiving ``application/mercurial-0.2``
-   responses.
-
-cbor
-   Indicates the client supports receiving ``application/mercurial-cbor``
-   responses.
-
-   (Only intended to be used with version 2 transports.)
-
-comp
-   Indicates compression formats the client can decode. Value is a list of
-   comma delimited strings identifying compression formats ordered from
-   most preferential to least preferential. e.g. ``comp=zstd,zlib,none``.
-
-   This parameter does not have an effect if only the ``0.1`` parameter
-   is defined, as support for ``application/mercurial-0.2`` or greater is
-   required to use arbitrary compression formats.
-
-   If this parameter is not advertised, the server interprets this as
-   equivalent to ``zlib,none``.
-
-Clients may choose to only send this header if the ``httpmediatype``
-server capability is present, as currently all server-side features
-consulting this header require the client to opt in to new protocol features
-advertised via the ``httpmediatype`` capability.
-
-A server that doesn't receive an ``X-HgProto-<N>`` header should infer a
-value of ``0.1``. This is compatible with legacy clients.
-
-A server receiving a request indicating support for multiple media type
-versions may respond with any of the supported media types. Not all servers
-may support all media types on all commands.
-
-Commands
-========
-
-This section contains a list of all wire protocol commands implemented by
-the canonical Mercurial server.
-
-See :hg:`help internals.wireprotocolv2` for information on commands exposed
-to the frame-based protocol.
-
-batch
------
-
-Issue multiple commands while sending a single command request. The purpose
-of this command is to allow a client to issue multiple commands while avoiding
-multiple round trips to the server therefore enabling commands to complete
-quicker.
-
-The command accepts a ``cmds`` argument that contains a list of commands to
-execute.
-
-The value of ``cmds`` is a ``;`` delimited list of strings. Each string has the
-form ``<command> <arguments>``. That is, the command name followed by a space
-followed by an argument string.
-
-The argument string is a ``,`` delimited list of ``<key>=<value>`` values
-corresponding to command arguments. Both the argument name and value are
-escaped using a special substitution map::
-
-   : -> :c
-   , -> :o
-   ; -> :s
-   = -> :e
-
-The response type for this command is ``string``. The value contains a
-``;`` delimited list of responses for each requested command. Each value
-in this list is escaped using the same substitution map used for arguments.
-
-If an error occurs, the generic error response may be sent.
-
-between
--------
-
-(Legacy command used for discovery in old clients)
-
-Obtain nodes between pairs of nodes.
-
-The ``pairs`` arguments contains a space-delimited list of ``-`` delimited
-hex node pairs. e.g.::
-
-   a072279d3f7fd3a4aa7ffa1a5af8efc573e1c896-6dc58916e7c070f678682bfe404d2e2d68291a18
-
-Return type is a ``string``. Value consists of lines corresponding to each
-requested range. Each line contains a space-delimited list of hex nodes.
-A newline ``\n`` terminates each line, including the last one.
-
-branchmap
----------
-
-Obtain heads in named branches.
-
-Accepts no arguments. Return type is a ``string``.
-
-Return value contains lines with URL encoded branch names followed by a space
-followed by a space-delimited list of hex nodes of heads on that branch.
-e.g.::
-
-    default a072279d3f7fd3a4aa7ffa1a5af8efc573e1c896 6dc58916e7c070f678682bfe404d2e2d68291a18
-    stable baae3bf31522f41dd5e6d7377d0edd8d1cf3fccc
-
-There is no trailing newline.
-
-branches
---------
-
-(Legacy command used for discovery in old clients. Clients with ``getbundle``
-use the ``known`` and ``heads`` commands instead.)
-
-Obtain ancestor changesets of specific nodes back to a branch point.
-
-Despite the name, this command has nothing to do with Mercurial named branches.
-Instead, it is related to DAG branches.
-
-The command accepts a ``nodes`` argument, which is a string of space-delimited
-hex nodes.
-
-For each node requested, the server will find the first ancestor node that is
-a DAG root or is a merge.
-
-Return type is a ``string``. Return value contains lines with result data for
-each requested node. Each line contains space-delimited nodes followed by a
-newline (``\n``). The 4 nodes reported on each line correspond to the requested
-node, the ancestor node found, and its 2 parent nodes (which may be the null
-node).
-
-capabilities
-------------
-
-Obtain the capabilities string for the repo.
-
-Unlike the ``hello`` command, the capabilities string is not prefixed.
-There is no trailing newline.
-
-This command does not accept any arguments. Return type is a ``string``.
-
-This command was introduced in Mercurial 0.9.1 (released July 2006).
-
-changegroup
------------
-
-(Legacy command: use ``getbundle`` instead)
-
-Obtain a changegroup version 1 with data for changesets that are
-descendants of client-specified changesets.
-
-The ``roots`` arguments contains a list of space-delimited hex nodes.
-
-The server responds with a changegroup version 1 containing all
-changesets between the requested root/base nodes and the repo's head nodes
-at the time of the request.
-
-The return type is a ``stream``.
-
-changegroupsubset
------------------
-
-(Legacy command: use ``getbundle`` instead)
-
-Obtain a changegroup version 1 with data for changesetsets between
-client specified base and head nodes.
-
-The ``bases`` argument contains a list of space-delimited hex nodes.
-The ``heads`` argument contains a list of space-delimited hex nodes.
-
-The server responds with a changegroup version 1 containing all
-changesets between the requested base and head nodes at the time of the
-request.
-
-The return type is a ``stream``.
-
-clonebundles
-------------
-
-Obtains a manifest of bundle URLs available to seed clones.
-
-Each returned line contains a URL followed by metadata. See the
-documentation in the ``clonebundles`` extension for more.
-
-The return type is a ``string``.
-
-getbundle
----------
-
-Obtain a bundle containing repository data.
-
-This command accepts the following arguments:
-
-heads
-   List of space-delimited hex nodes of heads to retrieve.
-common
-   List of space-delimited hex nodes that the client has in common with the
-   server.
-obsmarkers
-   Boolean indicating whether to include obsolescence markers as part
-   of the response. Only works with bundle2.
-bundlecaps
-   Comma-delimited set of strings defining client bundle capabilities.
-listkeys
-   Comma-delimited list of strings of ``pushkey`` namespaces. For each
-   namespace listed, a bundle2 part will be included with the content of
-   that namespace.
-cg
-   Boolean indicating whether changegroup data is requested.
-cbattempted
-   Boolean indicating whether the client attempted to use the *clone bundles*
-   feature before performing this request.
-bookmarks
-   Boolean indicating whether bookmark data is requested.
-phases
-   Boolean indicating whether phases data is requested.
-
-The return type on success is a ``stream`` where the value is bundle.
-On the HTTP version 1 transport, the response is zlib compressed.
-
-If an error occurs, a generic error response can be sent.
-
-Unless the client sends a false value for the ``cg`` argument, the returned
-bundle contains a changegroup with the nodes between the specified ``common``
-and ``heads`` nodes. Depending on the command arguments, the type and content
-of the returned bundle can vary significantly.
-
-The default behavior is for the server to send a raw changegroup version
-``01`` response.
-
-If the ``bundlecaps`` provided by the client contain a value beginning
-with ``HG2``, a bundle2 will be returned. The bundle2 data may contain
-additional repository data, such as ``pushkey`` namespace values.
-
-heads
------
-
-Returns a list of space-delimited hex nodes of repository heads followed
-by a newline. e.g.
-``a9eeb3adc7ddb5006c088e9eda61791c777cbf7c 31f91a3da534dc849f0d6bfc00a395a97cf218a1\n``
-
-This command does not accept any arguments. The return type is a ``string``.
-
-hello
------
-
-Returns lines describing interesting things about the server in an RFC-822
-like format.
-
-Currently, the only line defines the server capabilities. It has the form::
-
-    capabilities: <value>
-
-See above for more about the capabilities string.
-
-SSH clients typically issue this command as soon as a connection is
-established.
-
-This command does not accept any arguments. The return type is a ``string``.
-
-This command was introduced in Mercurial 0.9.1 (released July 2006).
-
-listkeys
---------
-
-List values in a specified ``pushkey`` namespace.
-
-The ``namespace`` argument defines the pushkey namespace to operate on.
-
-The return type is a ``string``. The value is an encoded dictionary of keys.
-
-Key-value pairs are delimited by newlines (``\n``). Within each line, keys and
-values are separated by a tab (``\t``). Keys and values are both strings.
-
-lookup
-------
-
-Try to resolve a value to a known repository revision.
-
-The ``key`` argument is converted from bytes to an
-``encoding.localstr`` instance then passed into
-``localrepository.__getitem__`` in an attempt to resolve it.
-
-The return type is a ``string``.
-
-Upon successful resolution, returns ``1 <hex node>\n``. On failure,
-returns ``0 <error string>\n``. e.g.::
-
-   1 273ce12ad8f155317b2c078ec75a4eba507f1fba\n
-
-   0 unknown revision 'foo'\n
-
-known
------
-
-Determine whether multiple nodes are known.
-
-The ``nodes`` argument is a list of space-delimited hex nodes to check
-for existence.
-
-The return type is ``string``.
-
-Returns a string consisting of ``0``s and ``1``s indicating whether nodes
-are known. If the Nth node specified in the ``nodes`` argument is known,
-a ``1`` will be returned at byte offset N. If the node isn't known, ``0``
-will be present at byte offset N.
-
-There is no trailing newline.
-
-protocaps
----------
-
-Notify the server about the client capabilities in the SSH V1 transport
-protocol.
-
-The ``caps`` argument is a space-delimited list of capabilities.
-
-The server will reply with the string ``OK``.
-
-pushkey
--------
-
-Set a value using the ``pushkey`` protocol.
-
-Accepts arguments ``namespace``, ``key``, ``old``, and ``new``, which
-correspond to the pushkey namespace to operate on, the key within that
-namespace to change, the old value (which may be empty), and the new value.
-All arguments are string types.
-
-The return type is a ``string``. The value depends on the transport protocol.
-
-The SSH version 1 transport sends a string encoded integer followed by a
-newline (``\n``) which indicates operation result. The server may send
-additional output on the ``stderr`` stream that should be displayed to the
-user.
-
-The HTTP version 1 transport sends a string encoded integer followed by a
-newline followed by additional server output that should be displayed to
-the user. This may include output from hooks, etc.
-
-The integer result varies by namespace. ``0`` means an error has occurred
-and there should be additional output to display to the user.
-
-stream_out
-----------
-
-Obtain *streaming clone* data.
-
-The return type is either a ``string`` or a ``stream``, depending on
-whether the request was fulfilled properly.
-
-A return value of ``1\n`` indicates the server is not configured to serve
-this data. If this is seen by the client, they may not have verified the
-``stream`` capability is set before making the request.
-
-A return value of ``2\n`` indicates the server was unable to lock the
-repository to generate data.
-
-All other responses are a ``stream`` of bytes. The first line of this data
-contains 2 space-delimited integers corresponding to the path count and
-payload size, respectively::
-
-    <path count> <payload size>\n
-
-The ``<payload size>`` is the total size of path data: it does not include
-the size of the per-path header lines.
-
-Following that header are ``<path count>`` entries. Each entry consists of a
-line with metadata followed by raw revlog data. The line consists of::
-
-    <store path>\0<size>\n
-
-The ``<store path>`` is the encoded store path of the data that follows.
-``<size>`` is the amount of data for this store path/revlog that follows the
-newline.
-
-There is no trailer to indicate end of data. Instead, the client should stop
-reading after ``<path count>`` entries are consumed.
-
-unbundle
---------
-
-Send a bundle containing data (usually changegroup data) to the server.
-
-Accepts the argument ``heads``, which is a space-delimited list of hex nodes
-corresponding to server repository heads observed by the client. This is used
-to detect race conditions and abort push operations before a server performs
-too much work or a client transfers too much data.
-
-The request payload consists of a bundle to be applied to the repository,
-similarly to as if :hg:`unbundle` were called.
-
-In most scenarios, a special ``push response`` type is returned. This type
-contains an integer describing the change in heads as a result of the
-operation. A value of ``0`` indicates nothing changed. ``1`` means the number
-of heads remained the same. Values ``2`` and larger indicate the number of
-added heads minus 1. e.g. ``3`` means 2 heads were added. Negative values
-indicate the number of fewer heads, also off by 1. e.g. ``-2`` means there
-is 1 fewer head.
-
-The encoding of the ``push response`` type varies by transport.
-
-For the SSH version 1 transport, this type is composed of 2 ``string``
-responses: an empty response (``0\n``) followed by the integer result value.
-e.g. ``1\n2``. So the full response might be ``0\n1\n2``.
-
-For the HTTP version 1 transport, the response is a ``string`` type composed
-of an integer result value followed by a newline (``\n``) followed by string
-content holding server output that should be displayed on the client (output
-hooks, etc).
-
-In some cases, the server may respond with a ``bundle2`` bundle. In this
-case, the response type is ``stream``. For the HTTP version 1 transport, the
-response is zlib compressed.
-
-The server may also respond with a generic error type, which contains a string
-indicating the failure.
--- a/mercurial/help/internals/wireprotocolrpc.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,740 +0,0 @@
-**Experimental and under development**
-
-This document describe's Mercurial's transport-agnostic remote procedure
-call (RPC) protocol which is used to perform interactions with remote
-servers. This protocol is also referred to as ``hgrpc``.
-
-The protocol has the following high-level features:
-
-* Concurrent request and response support (multiple commands can be issued
-  simultaneously and responses can be streamed simultaneously).
-* Supports half-duplex and full-duplex connections.
-* All data is transmitted within *frames*, which have a well-defined
-  header and encode their length.
-* Side-channels for sending progress updates and printing output. Text
-  output from the remote can be localized locally.
-* Support for simultaneous and long-lived compression streams, even across
-  requests.
-* Uses CBOR for data exchange.
-
-The protocol is not specific to Mercurial and could be used by other
-applications.
-
-High-level Overview
-===================
-
-To operate the protocol, a bi-directional, half-duplex pipe supporting
-ordered sends and receives is required. That is, each peer has one pipe
-for sending data and another for receiving. Full-duplex pipes are also
-supported.
-
-All data is read and written in atomic units called *frames*. These
-are conceptually similar to TCP packets. Higher-level functionality
-is built on the exchange and processing of frames.
-
-All frames are associated with a *stream*. A *stream* provides a
-unidirectional grouping of frames. Streams facilitate two goals:
-content encoding and parallelism. There is a dedicated section on
-streams below.
-
-The protocol is request-response based: the client issues requests to
-the server, which issues replies to those requests. Server-initiated
-messaging is not currently supported, but this specification carves
-out room to implement it.
-
-All frames are associated with a numbered request. Frames can thus
-be logically grouped by their request ID.
-
-Frames
-======
-
-Frames begin with an 8 octet header followed by a variable length
-payload::
-
-    +------------------------------------------------+
-    |                 Length (24)                    |
-    +--------------------------------+---------------+
-    |         Request ID (16)        | Stream ID (8) |
-    +------------------+-------------+---------------+
-    | Stream Flags (8) |
-    +-----------+------+
-    | Type (4)  |
-    +-----------+
-    | Flags (4) |
-    +===========+===================================================|
-    |                     Frame Payload (0...)                    ...
-    +---------------------------------------------------------------+
-
-The length of the frame payload is expressed as an unsigned 24 bit
-little endian integer. Values larger than 65535 MUST NOT be used unless
-given permission by the server as part of the negotiated capabilities
-during the handshake. The frame header is not part of the advertised
-frame length. The payload length is the over-the-wire length. If there
-is content encoding applied to the payload as part of the frame's stream,
-the length is the output of that content encoding, not the input.
-
-The 16-bit ``Request ID`` field denotes the integer request identifier,
-stored as an unsigned little endian integer. Odd numbered requests are
-client-initiated. Even numbered requests are server-initiated. This
-refers to where the *request* was initiated - not where the *frame* was
-initiated, so servers will send frames with odd ``Request ID`` in
-response to client-initiated requests. Implementations are advised to
-start ordering request identifiers at ``1`` and ``0``, increment by
-``2``, and wrap around if all available numbers have been exhausted.
-
-The 8-bit ``Stream ID`` field denotes the stream that the frame is
-associated with. Frames belonging to a stream may have content
-encoding applied and the receiver may need to decode the raw frame
-payload to obtain the original data. Odd numbered IDs are
-client-initiated. Even numbered IDs are server-initiated.
-
-The 8-bit ``Stream Flags`` field defines stream processing semantics.
-See the section on streams below.
-
-The 4-bit ``Type`` field denotes the type of frame being sent.
-
-The 4-bit ``Flags`` field defines special, per-type attributes for
-the frame.
-
-The sections below define the frame types and their behavior.
-
-Command Request (``0x01``)
---------------------------
-
-This frame contains a request to run a command.
-
-The payload consists of a CBOR map defining the command request. The
-bytestring keys of that map are:
-
-name
-   Name of the command that should be executed (bytestring).
-args
-   Map of bytestring keys to various value types containing the named
-   arguments to this command.
-
-   Each command defines its own set of argument names and their expected
-   types.
-
-redirect (optional)
-   (map) Advertises client support for following response *redirects*.
-
-   This map has the following bytestring keys:
-
-   targets
-      (array of bytestring) List of named redirect targets supported by
-      this client. The names come from the targets advertised by the
-      server's *capabilities* message.
-
-   hashes
-      (array of bytestring) List of preferred hashing algorithms that can
-      be used for content integrity verification.
-
-   See the *Content Redirects* section below for more on content redirects.
-
-This frame type MUST ONLY be sent from clients to servers: it is illegal
-for a server to send this frame to a client.
-
-The following flag values are defined for this type:
-
-0x01
-   New command request. When set, this frame represents the beginning
-   of a new request to run a command. The ``Request ID`` attached to this
-   frame MUST NOT be active.
-0x02
-   Command request continuation. When set, this frame is a continuation
-   from a previous command request frame for its ``Request ID``. This
-   flag is set when the CBOR data for a command request does not fit
-   in a single frame.
-0x04
-   Additional frames expected. When set, the command request didn't fit
-   into a single frame and additional CBOR data follows in a subsequent
-   frame.
-0x08
-   Command data frames expected. When set, command data frames are
-   expected to follow the final command request frame for this request.
-
-``0x01`` MUST be set on the initial command request frame for a
-``Request ID``.
-
-``0x01`` or ``0x02`` MUST be set to indicate this frame's role in
-a series of command request frames.
-
-If command data frames are to be sent, ``0x08`` MUST be set on ALL
-command request frames.
-
-Command Data (``0x02``)
------------------------
-
-This frame contains raw data for a command.
-
-Most commands can be executed by specifying arguments. However,
-arguments have an upper bound to their length. For commands that
-accept data that is beyond this length or whose length isn't known
-when the command is initially sent, they will need to stream
-arbitrary data to the server. This frame type facilitates the sending
-of this data.
-
-The payload of this frame type consists of a stream of raw data to be
-consumed by the command handler on the server. The format of the data
-is command specific.
-
-The following flag values are defined for this type:
-
-0x01
-   Command data continuation. When set, the data for this command
-   continues into a subsequent frame.
-
-0x02
-   End of data. When set, command data has been fully sent to the
-   server. The command has been fully issued and no new data for this
-   command will be sent. The next frame will belong to a new command.
-
-Command Response Data (``0x03``)
---------------------------------
-
-This frame contains response data to an issued command.
-
-Response data ALWAYS consists of a series of 1 or more CBOR encoded
-values. A CBOR value may be using indefinite length encoding. And the
-bytes constituting the value may span several frames.
-
-The following flag values are defined for this type:
-
-0x01
-   Data continuation. When set, an additional frame containing response data
-   will follow.
-0x02
-   End of data. When set, the response data has been fully sent and
-   no additional frames for this response will be sent.
-
-The ``0x01`` flag is mutually exclusive with the ``0x02`` flag.
-
-Error Occurred (``0x05``)
--------------------------
-
-Some kind of error occurred.
-
-There are 3 general kinds of failures that can occur:
-
-* Command error encountered before any response issued
-* Command error encountered after a response was issued
-* Protocol or stream level error
-
-This frame type is used to capture the latter cases. (The general
-command error case is handled by the leading CBOR map in
-``Command Response`` frames.)
-
-The payload of this frame contains a CBOR map detailing the error. That
-map has the following bytestring keys:
-
-type
-   (bytestring) The overall type of error encountered. Can be one of the
-   following values:
-
-   protocol
-      A protocol-level error occurred. This typically means someone
-      is violating the framing protocol semantics and the server is
-      refusing to proceed.
-
-   server
-      A server-level error occurred. This typically indicates some kind of
-      logic error on the server, likely the fault of the server.
-
-   command
-      A command-level error, likely the fault of the client.
-
-message
-   (array of maps) A richly formatted message that is intended for
-   human consumption. See the ``Human Output Side-Channel`` frame
-   section for a description of the format of this data structure.
-
-Human Output Side-Channel (``0x06``)
-------------------------------------
-
-This frame contains a message that is intended to be displayed to
-people. Whereas most frames communicate machine readable data, this
-frame communicates textual data that is intended to be shown to
-humans.
-
-The frame consists of a series of *formatting requests*. Each formatting
-request consists of a formatting string, arguments for that formatting
-string, and labels to apply to that formatting string.
-
-A formatting string is a printf()-like string that allows variable
-substitution within the string. Labels allow the rendered text to be
-*decorated*. Assuming use of the canonical Mercurial code base, a
-formatting string can be the input to the ``i18n._`` function. This
-allows messages emitted from the server to be localized. So even if
-the server has different i18n settings, people could see messages in
-their *native* settings. Similarly, the use of labels allows
-decorations like coloring and underlining to be applied using the
-client's configured rendering settings.
-
-Formatting strings are similar to ``printf()`` strings or how
-Python's ``%`` operator works. The only supported formatting sequences
-are ``%s`` and ``%%``. ``%s`` will be replaced by whatever the string
-at that position resolves to. ``%%`` will be replaced by ``%``. All
-other 2-byte sequences beginning with ``%`` represent a literal
-``%`` followed by that character. However, future versions of the
-wire protocol reserve the right to allow clients to opt in to receiving
-formatting strings with additional formatters, hence why ``%%`` is
-required to represent the literal ``%``.
-
-The frame payload consists of a CBOR array of CBOR maps. Each map
-defines an *atom* of text data to print. Each *atom* has the following
-bytestring keys:
-
-msg
-   (bytestring) The formatting string. Content MUST be ASCII.
-args (optional)
-   Array of bytestrings defining arguments to the formatting string.
-labels (optional)
-   Array of bytestrings defining labels to apply to this atom.
-
-All data to be printed MUST be encoded into a single frame: this frame
-does not support spanning data across multiple frames.
-
-All textual data encoded in these frames is assumed to be line delimited.
-The last atom in the frame SHOULD end with a newline (``\n``). If it
-doesn't, clients MAY add a newline to facilitate immediate printing.
-
-Progress Update (``0x07``)
---------------------------
-
-This frame holds the progress of an operation on the peer. Consumption
-of these frames allows clients to display progress bars, estimated
-completion times, etc.
-
-Each frame defines the progress of a single operation on the peer. The
-payload consists of a CBOR map with the following bytestring keys:
-
-topic
-   Topic name (string)
-pos
-   Current numeric position within the topic (integer)
-total
-   Total/end numeric position of this topic (unsigned integer)
-label (optional)
-   Unit label (string)
-item (optional)
-   Item name (string)
-
-Progress state is created when a frame is received referencing a
-*topic* that isn't currently tracked. Progress tracking for that
-*topic* is finished when a frame is received reporting the current
-position of that topic as ``-1``.
-
-Multiple *topics* may be active at any given time.
-
-Rendering of progress information is not mandated or governed by this
-specification: implementations MAY render progress information however
-they see fit, including not at all.
-
-The string data describing the topic SHOULD be static strings to
-facilitate receivers localizing that string data. The emitter
-MUST normalize all string data to valid UTF-8 and receivers SHOULD
-validate that received data conforms to UTF-8. The topic name
-SHOULD be ASCII.
-
-Sender Protocol Settings (``0x08``)
------------------------------------
-
-This frame type advertises the sender's support for various protocol and
-stream level features. The data advertised in this frame is used to influence
-subsequent behavior of the current frame exchange channel.
-
-The frame payload consists of a CBOR map. It may contain the following
-bytestring keys:
-
-contentencodings
-   (array of bytestring) A list of content encodings supported by the
-   sender, in order of most to least preferred.
-
-   Peers are allowed to encode stream data using any of the listed
-   encodings.
-
-   See the ``Content Encoding Profiles`` section for an enumeration
-   of supported content encodings.
-
-   If not defined, the value is assumed to be a list with the single value
-   ``identity``, meaning only the no-op encoding is supported.
-
-   Senders MAY filter the set of advertised encodings against what it
-   knows the receiver supports (e.g. if the receiver advertised encodings
-   via the capabilities descriptor). However, doing so will prevent
-   servers from gaining an understanding of the aggregate capabilities
-   of clients. So clients are discouraged from doing so.
-
-When this frame is not sent/received, the receiver assumes default values
-for all keys.
-
-If encountered, this frame type MUST be sent before any other frame type
-in a channel.
-
-The following flag values are defined for this frame type:
-
-0x01
-   Data continuation. When set, an additional frame containing more protocol
-   settings immediately follows.
-0x02
-   End of data. When set, the protocol settings data has been completely
-   sent.
-
-The ``0x01`` flag is mutually exclusive with the ``0x02`` flag.
-
-Stream Encoding Settings (``0x09``)
------------------------------------
-
-This frame type holds information defining the content encoding
-settings for a *stream*.
-
-This frame type is likely consumed by the protocol layer and is not
-passed on to applications.
-
-This frame type MUST ONLY occur on frames having the *Beginning of Stream*
-``Stream Flag`` set.
-
-The payload of this frame defines what content encoding has (possibly)
-been applied to the payloads of subsequent frames in this stream.
-
-The payload consists of a series of CBOR values. The first value is a
-bytestring denoting the content encoding profile of the data in this
-stream. Subsequent CBOR values supplement this simple value in a
-profile-specific manner. See the ``Content Encoding Profiles`` section
-for more.
-
-In the absence of this frame on a stream, it is assumed the stream is
-using the ``identity`` content encoding.
-
-The following flag values are defined for this frame type:
-
-0x01
-   Data continuation. When set, an additional frame containing more encoding
-   settings immediately follows.
-0x02
-   End of data. When set, the encoding settings data has been completely
-   sent.
-
-The ``0x01`` flag is mutually exclusive with the ``0x02`` flag.
-
-Stream States and Flags
-=======================
-
-Streams can be in two states: *open* and *closed*. An *open* stream
-is active and frames attached to that stream could arrive at any time.
-A *closed* stream is not active. If a frame attached to a *closed*
-stream arrives, that frame MUST have an appropriate stream flag
-set indicating beginning of stream. All streams are in the *closed*
-state by default.
-
-The ``Stream Flags`` field denotes a set of bit flags for defining
-the relationship of this frame within a stream. The following flags
-are defined:
-
-0x01
-   Beginning of stream. The first frame in the stream MUST set this
-   flag. When received, the ``Stream ID`` this frame is attached to
-   becomes ``open``.
-
-0x02
-   End of stream. The last frame in a stream MUST set this flag. When
-   received, the ``Stream ID`` this frame is attached to becomes
-   ``closed``. Any content encoding context associated with this stream
-   can be destroyed after processing the payload of this frame.
-
-0x04
-   Apply content encoding. When set, any content encoding settings
-   defined by the stream should be applied when attempting to read
-   the frame. When not set, the frame payload isn't encoded.
-
-TODO consider making stream opening and closing communicated via
-explicit frame types (e.g. a "stream state change" frame) rather than
-flags on all frames. This would make stream state changes more explicit,
-as they could only occur on specific frame types.
-
-Streams
-=======
-
-Streams - along with ``Request IDs`` - facilitate grouping of frames.
-But the purpose of each is quite different and the groupings they
-constitute are independent.
-
-A ``Request ID`` is essentially a tag. It tells you which logical
-request a frame is associated with.
-
-A *stream* is a sequence of frames grouped for the express purpose
-of applying a stateful encoding or for denoting sub-groups of frames.
-
-Unlike ``Request ID``s which span the request and response, a stream
-is unidirectional and stream IDs are independent from client to
-server.
-
-There is no strict hierarchical relationship between ``Request IDs``
-and *streams*. A stream can contain frames having multiple
-``Request IDs``. Frames belonging to the same ``Request ID`` can
-span multiple streams.
-
-One goal of streams is to facilitate content encoding. A stream can
-define an encoding to be applied to frame payloads. For example, the
-payload transmitted over the wire may contain output from a
-zstandard compression operation and the receiving end may decompress
-that payload to obtain the original data.
-
-The other goal of streams is to facilitate concurrent execution. For
-example, a server could spawn 4 threads to service a request that can
-be easily parallelized. Each of those 4 threads could write into its
-own stream. Those streams could then in turn be delivered to 4 threads
-on the receiving end, with each thread consuming its stream in near
-isolation. The *main* thread on both ends merely does I/O and
-encodes/decodes frame headers: the bulk of the work is done by worker
-threads.
-
-In addition, since content encoding is defined per stream, each
-*worker thread* could perform potentially CPU bound work concurrently
-with other threads. This approach of applying encoding at the
-sub-protocol / stream level eliminates a potential resource constraint
-on the protocol stream as a whole (it is common for the throughput of
-a compression engine to be smaller than the throughput of a network).
-
-Having multiple streams - each with their own encoding settings - also
-facilitates the use of advanced data compression techniques. For
-example, a transmitter could see that it is generating data faster
-and slower than the receiving end is consuming it and adjust its
-compression settings to trade CPU for compression ratio accordingly.
-
-While streams can define a content encoding, not all frames within
-that stream must use that content encoding. This can be useful when
-data is being served from caches and being derived dynamically. A
-cache could pre-compressed data so the server doesn't have to
-recompress it. The ability to pick and choose which frames are
-compressed allows servers to easily send data to the wire without
-involving potentially expensive encoding overhead.
-
-Content Encoding Profiles
-=========================
-
-Streams can have named content encoding *profiles* associated with
-them. A profile defines a shared understanding of content encoding
-settings and behavior.
-
-Profiles are described in the following sections.
-
-identity
---------
-
-The ``identity`` profile is a no-op encoding: the encoded bytes are
-exactly the input bytes.
-
-This profile MUST be supported by all peers.
-
-In the absence of an identified profile, the ``identity`` profile is
-assumed.
-
-zstd-8mb
---------
-
-Zstandard encoding (RFC 8478). Zstandard is a fast and effective lossless
-compression format.
-
-This profile allows decompressor window sizes of up to 8 MB.
-
-zlib
-----
-
-zlib compressed data (RFC 1950). zlib is a widely-used and supported
-lossless compression format.
-
-It isn't as fast as zstandard and it is recommended to use zstandard instead,
-if possible.
-
-Command Protocol
-================
-
-A client can request that a remote run a command by sending it
-frames defining that command. This logical stream is composed of
-1 or more ``Command Request`` frames and and 0 or more ``Command Data``
-frames.
-
-All frames composing a single command request MUST be associated with
-the same ``Request ID``.
-
-Clients MAY send additional command requests without waiting on the
-response to a previous command request. If they do so, they MUST ensure
-that the ``Request ID`` field of outbound frames does not conflict
-with that of an active ``Request ID`` whose response has not yet been
-fully received.
-
-Servers MAY respond to commands in a different order than they were
-sent over the wire. Clients MUST be prepared to deal with this. Servers
-also MAY start executing commands in a different order than they were
-received, or MAY execute multiple commands concurrently.
-
-If there is a dependency between commands or a race condition between
-commands executing (e.g. a read-only command that depends on the results
-of a command that mutates the repository), then clients MUST NOT send
-frames issuing a command until a response to all dependent commands has
-been received.
-TODO think about whether we should express dependencies between commands
-to avoid roundtrip latency.
-
-A command is defined by a command name, 0 or more command arguments,
-and optional command data.
-
-Arguments are the recommended mechanism for transferring fixed sets of
-parameters to a command. Data is appropriate for transferring variable
-data. Thinking in terms of HTTP, arguments would be headers and data
-would be the message body.
-
-It is recommended for servers to delay the dispatch of a command
-until all argument have been received. Servers MAY impose limits on the
-maximum argument size.
-TODO define failure mechanism.
-
-Servers MAY dispatch to commands immediately once argument data
-is available or delay until command data is received in full.
-
-Once a ``Command Request`` frame is sent, a client must be prepared to
-receive any of the following frames associated with that request:
-``Command Response``, ``Error Response``, ``Human Output Side-Channel``,
-``Progress Update``.
-
-The *main* response for a command will be in ``Command Response`` frames.
-The payloads of these frames consist of 1 or more CBOR encoded values.
-The first CBOR value on the first ``Command Response`` frame is special
-and denotes the overall status of the command. This CBOR map contains
-the following bytestring keys:
-
-status
-   (bytestring) A well-defined message containing the overall status of
-   this command request. The following values are defined:
-
-   ok
-      The command was received successfully and its response follows.
-   error
-      There was an error processing the command. More details about the
-      error are encoded in the ``error`` key.
-   redirect
-      The response for this command is available elsewhere. Details on
-      where are in the ``location`` key.
-
-error (optional)
-   A map containing information about an encountered error. The map has the
-   following keys:
-
-   message
-      (array of maps) A message describing the error. The message uses the
-      same format as those in the ``Human Output Side-Channel`` frame.
-
-location (optional)
-   (map) Presence indicates that a *content redirect* has occurred. The map
-   provides the external location of the content.
-
-   This map contains the following bytestring keys:
-
-   url
-      (bytestring) URL from which this content may be requested.
-
-   mediatype
-      (bytestring) The media type for the fetched content. e.g.
-      ``application/mercurial-*``.
-
-      In some transports, this value is also advertised by the transport.
-      e.g. as the ``Content-Type`` HTTP header.
-
-   size (optional)
-      (unsigned integer) Total size of remote object in bytes. This is
-      the raw size of the entity that will be fetched, minus any
-      non-Mercurial protocol encoding (e.g. HTTP content or transfer
-      encoding.)
-
-   fullhashes (optional)
-      (array of arrays) Content hashes for the entire payload. Each entry
-      is an array of bytestrings containing the hash name and the hash value.
-
-   fullhashseed (optional)
-      (bytestring) Optional seed value to feed into hasher for full content
-      hash verification.
-
-   serverdercerts (optional)
-      (array of bytestring) DER encoded x509 certificates for the server. When
-      defined, clients MAY validate that the x509 certificate on the target
-      server exactly matches the certificate used here.
-
-   servercadercerts (optional)
-      (array of bytestring) DER encoded x509 certificates for the certificate
-      authority of the target server. When defined, clients MAY validate that
-      the x509 on the target server was signed by CA certificate in this set.
-
-   # TODO support for giving client an x509 certificate pair to be used as a
-   # client certificate.
-
-   # TODO support common authentication mechanisms (e.g. HTTP basic/digest
-   # auth).
-
-   # TODO support custom authentication mechanisms. This likely requires
-   # server to advertise required auth mechanism so client can filter.
-
-   # TODO support chained hashes. e.g. hash for each 1MB segment so client
-   # can iteratively validate data without having to consume all of it first.
-
-TODO formalize when error frames can be seen and how errors can be
-recognized midway through a command response.
-
-Content Redirects
-=================
-
-Servers have the ability to respond to ANY command request with a
-*redirect* to another location. Such a response is referred to as a *redirect
-response*. (This feature is conceptually similar to HTTP redirects, but is
-more powerful.)
-
-A *redirect response* MUST ONLY be issued if the client advertises support
-for a redirect *target*.
-
-A *redirect response* MUST NOT be issued unless the client advertises support
-for one.
-
-Clients advertise support for *redirect responses* after looking at the server's
-*capabilities* data, which is fetched during initial server connection
-handshake. The server's capabilities data advertises named *targets* for
-potential redirects.
-
-Each target is described by a protocol name, connection and protocol features,
-etc. The server also advertises target-agnostic redirect settings, such as
-which hash algorithms are supported for content integrity checking. (See
-the documentation for the *capabilities* command for more.)
-
-Clients examine the set of advertised redirect targets for compatibility.
-When sending a command request, the client advertises the set of redirect
-target names it is willing to follow, along with some other settings influencing
-behavior.
-
-For example, say the server is advertising a ``cdn`` redirect target that
-requires SNI and TLS 1.2. If the client supports those features, it will
-send command requests stating that the ``cdn`` target is acceptable to use.
-But if the client doesn't support SNI or TLS 1.2 (or maybe it encountered an
-error using this target from a previous request), then it omits this target
-name.
-
-If the client advertises support for a redirect target, the server MAY
-substitute the normal, inline response data for a *redirect response* -
-one where the initial CBOR map has a ``status`` key with value ``redirect``.
-
-The *redirect response* at a minimum advertises the URL where the response
-can be retrieved.
-
-The *redirect response* MAY also advertise additional details about that
-content and how to retrieve it. Notably, the response may contain the
-x509 public certificates for the server being redirected to or the
-certificate authority that signed that server's certificate. Unless the
-client has existing settings that offer stronger trust validation than what
-the server advertises, the client SHOULD use the server-provided certificates
-when validating the connection to the remote server in place of any default
-connection verification checks. This is because certificates coming from
-the server SHOULD establish a stronger chain of trust than what the default
-certification validation mechanism in most environments provides. (By default,
-certificate validation ensures the signer of the cert chains up to a set of
-trusted root certificates. And if an explicit certificate or CA certificate
-is presented, that greadly reduces the set of certificates that will be
-recognized as valid, thus reducing the potential for a "bad" certificate
-to be used and trusted.)
--- a/mercurial/help/internals/wireprotocolv2.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,724 +0,0 @@
-**Experimental and under active development**
-
-This section documents the wire protocol commands exposed to transports
-using the frame-based protocol. The set of commands exposed through
-these transports is distinct from the set of commands exposed to legacy
-transports.
-
-The frame-based protocol uses CBOR to encode command execution requests.
-All command arguments must be mapped to a specific or set of CBOR data
-types.
-
-The response to many commands is also CBOR. There is no common response
-format: each command defines its own response format.
-
-TODOs
-=====
-
-* Add "node namespace" support to each command. In order to support
-  SHA-1 hash transition, we want servers to be able to expose different
-  "node namespaces" for the same data. Every command operating on nodes
-  should specify which "node namespace" it is operating on and responses
-  should encode the "node namespace" accordingly.
-
-Commands
-========
-
-The sections below detail all commands available to wire protocol version
-2.
-
-branchmap
----------
-
-Obtain heads in named branches.
-
-Receives no arguments.
-
-The response is a map with bytestring keys defining the branch name.
-Values are arrays of bytestring defining raw changeset nodes.
-
-capabilities
-------------
-
-Obtain the server's capabilities.
-
-Receives no arguments.
-
-This command is typically called only as part of the handshake during
-initial connection establishment.
-
-The response is a map with bytestring keys defining server information.
-
-The defined keys are:
-
-commands
-   A map defining available wire protocol commands on this server.
-
-   Keys in the map are the names of commands that can be invoked. Values
-   are maps defining information about that command. The bytestring keys
-   are:
-
-      args
-         (map) Describes arguments accepted by the command.
-
-         Keys are bytestrings denoting the argument name.
-
-         Values are maps describing the argument. The map has the following
-         bytestring keys:
-
-         default
-            (varied) The default value for this argument if not specified. Only
-            present if ``required`` is not true.
-
-         required
-            (boolean) Whether the argument must be specified. Failure to send
-            required arguments will result in an error executing the command.
-
-         type
-            (bytestring) The type of the argument. e.g. ``bytes`` or ``bool``.
-
-         validvalues
-            (set) Values that are recognized for this argument. Some arguments
-            only allow a fixed set of values to be specified. These arguments
-            may advertise that set in this key. If this set is advertised and
-            a value not in this set is specified, the command should result
-            in error.
-
-      permissions
-         An array of permissions required to execute this command.
-
-      *
-         (various) Individual commands may define extra keys that supplement
-         generic command metadata. See the command definition for more.
-
-framingmediatypes
-   An array of bytestrings defining the supported framing protocol
-   media types. Servers will not accept media types not in this list.
-
-pathfilterprefixes
-   (set of bytestring) Matcher prefixes that are recognized when performing
-   path filtering. Specifying a path filter whose type/prefix does not
-   match one in this set will likely be rejected by the server.
-
-rawrepoformats
-   An array of storage formats the repository is using. This set of
-   requirements can be used to determine whether a client can read a
-   *raw* copy of file data available.
-
-redirect
-   A map declaring potential *content redirects* that may be used by this
-   server. Contains the following bytestring keys:
-
-   targets
-      (array of maps) Potential redirect targets. Values are maps describing
-      this target in more detail. Each map has the following bytestring keys:
-
-      name
-         (bytestring) Identifier for this target. The identifier will be used
-         by clients to uniquely identify this target.
-
-      protocol
-         (bytestring) High-level network protocol. Values can be
-         ``http``, ```https``, ``ssh``, etc.
-
-      uris
-          (array of bytestrings) Representative URIs for this target.
-
-      snirequired (optional)
-          (boolean) Indicates whether Server Name Indication is required
-          to use this target. Defaults to False.
-
-      tlsversions (optional)
-          (array of bytestring) Indicates which TLS versions are supported by
-          this target. Values are ``1.1``, ``1.2``, ``1.3``, etc.
-
-   hashes
-      (array of bytestring) Indicates support for hashing algorithms that are
-      used to ensure content integrity. Values include ``sha1``, ``sha256``,
-      etc.
-
-changesetdata
--------------
-
-Obtain various data related to changesets.
-
-The command accepts the following arguments:
-
-revisions
-   (array of maps) Specifies revisions whose data is being requested. Each
-   value in the array is a map describing revisions. See the
-   *Revisions Specifiers* section below for the format of this map.
-
-   Data will be sent for the union of all revisions resolved by all
-   revision specifiers.
-
-   Only revision specifiers operating on changeset revisions are allowed.
-
-fields
-   (set of bytestring) Which data associated with changelog revisions to
-   fetch. The following values are recognized:
-
-   bookmarks
-      Bookmarks associated with a revision.
-
-   parents
-      Parent revisions.
-
-   phase
-      The phase state of a revision.
-
-   revision
-      The raw, revision data for the changelog entry. The hash of this data
-      will match the revision's node value.
-
-The response bytestream starts with a CBOR map describing the data that follows.
-This map has the following bytestring keys:
-
-totalitems
-   (unsigned integer) Total number of changelog revisions whose data is being
-   transferred. This maps to the set of revisions in the requested node
-   range, not the total number of records that follow (see below for why).
-
-Following the map header is a series of 0 or more CBOR values. If values
-are present, the first value will always be a map describing a single changeset
-revision.
-
-If the ``fieldsfollowing`` key is present, the map will immediately be followed
-by N CBOR bytestring values, where N is the number of elements in
-``fieldsfollowing``. Each bytestring value corresponds to a field denoted
-by ``fieldsfollowing``.
-
-Following the optional bytestring field values is the next revision descriptor
-map, or end of stream.
-
-Each revision descriptor map has the following bytestring keys:
-
-node
-   (bytestring) The node value for this revision. This is the SHA-1 hash of
-   the raw revision data.
-
-bookmarks (optional)
-   (array of bytestrings) Bookmarks attached to this revision. Only present
-   if ``bookmarks`` data is being requested and the revision has bookmarks
-   attached.
-
-fieldsfollowing (optional)
-   (array of 2-array) Denotes what fields immediately follow this map. Each
-   value is an array with 2 elements: the bytestring field name and an unsigned
-   integer describing the length of the data, in bytes.
-
-   If this key isn't present, no special fields will follow this map.
-
-   The following fields may be present:
-
-   revision
-      Raw, revision data for the changelog entry. Contains a serialized form
-      of the changeset data, including the author, date, commit message, set
-      of changed files, manifest node, and other metadata.
-
-      Only present if the ``revision`` field was requested.
-
-parents (optional)
-   (array of bytestrings) The nodes representing the parent revisions of this
-   revision. Only present if ``parents`` data is being requested.
-
-phase (optional)
-   (bytestring) The phase that a revision is in. Recognized values are
-   ``secret``, ``draft``, and ``public``. Only present if ``phase`` data
-   is being requested.
-
-The set of changeset revisions emitted may not match the exact set of
-changesets requested. Furthermore, the set of keys present on each
-map may vary. This is to facilitate emitting changeset updates as well
-as new revisions.
-
-For example, if the request wants ``phase`` and ``revision`` data,
-the response may contain entries for each changeset in the common nodes
-set with the ``phase`` key and without the ``revision`` key in order
-to reflect a phase-only update.
-
-TODO support different revision selection mechanisms (e.g. non-public, specific
-revisions)
-TODO support different hash "namespaces" for revisions (e.g. sha-1 versus other)
-TODO support emitting obsolescence data
-TODO support filtering based on relevant paths (narrow clone)
-TODO support hgtagsfnodes cache / tags data
-TODO support branch heads cache
-TODO consider unify query mechanism. e.g. as an array of "query descriptors"
-rather than a set of top-level arguments that have semantics when combined.
-
-filedata
---------
-
-Obtain various data related to an individual tracked file.
-
-The command accepts the following arguments:
-
-fields
-   (set of bytestring) Which data associated with a file to fetch.
-   The following values are recognized:
-
-   linknode
-      The changeset node introducing this revision.
-
-   parents
-      Parent nodes for the revision.
-
-   revision
-      The raw revision data for a file.
-
-haveparents
-   (bool) Whether the client has the parent revisions of all requested
-   nodes. If set, the server may emit revision data as deltas against
-   any parent revision. If not set, the server MUST only emit deltas for
-   revisions previously emitted by this command.
-
-   False is assumed in the absence of any value.
-
-nodes
-   (array of bytestrings) File nodes whose data to retrieve.
-
-path
-   (bytestring) Path of the tracked file whose data to retrieve.
-
-TODO allow specifying revisions via alternate means (such as from
-changeset revisions or ranges)
-
-The response bytestream starts with a CBOR map describing the data that
-follows. It has the following bytestream keys:
-
-totalitems
-   (unsigned integer) Total number of file revisions whose data is
-   being returned.
-
-Following the map header is a series of 0 or more CBOR values. If values
-are present, the first value will always be a map describing a single changeset
-revision.
-
-If the ``fieldsfollowing`` key is present, the map will immediately be followed
-by N CBOR bytestring values, where N is the number of elements in
-``fieldsfollowing``. Each bytestring value corresponds to a field denoted
-by ``fieldsfollowing``.
-
-Following the optional bytestring field values is the next revision descriptor
-map, or end of stream.
-
-Each revision descriptor map has the following bytestring keys:
-
-Each map has the following bytestring keys:
-
-node
-   (bytestring) The node of the file revision whose data is represented.
-
-deltabasenode
-   (bytestring) Node of the file revision the following delta is against.
-
-   Only present if the ``revision`` field is requested and delta data
-   follows this map.
-
-fieldsfollowing
-   (array of 2-array) Denotes extra bytestring fields that following this map.
-   See the documentation for ``changesetdata`` for semantics.
-
-   The following named fields may be present:
-
-   ``delta``
-      The delta data to use to construct the fulltext revision.
-
-      Only present if the ``revision`` field is requested and a delta is
-      being emitted. The ``deltabasenode`` top-level key will also be
-      present if this field is being emitted.
-
-   ``revision``
-      The fulltext revision data for this manifest. Only present if the
-      ``revision`` field is requested and a fulltext revision is being emitted.
-
-parents
-   (array of bytestring) The nodes of the parents of this file revision.
-
-   Only present if the ``parents`` field is requested.
-
-When ``revision`` data is requested, the server chooses to emit either fulltext
-revision data or a delta. What the server decides can be inferred by looking
-for the presence of the ``delta`` or ``revision`` keys in the
-``fieldsfollowing`` array.
-
-filesdata
----------
-
-Obtain various data related to multiple tracked files for specific changesets.
-
-This command is similar to ``filedata`` with the main difference being that
-individual requests operate on multiple file paths. This allows clients to
-request data for multiple paths by issuing a single command.
-
-The command accepts the following arguments:
-
-fields
-   (set of bytestring) Which data associated with a file to fetch.
-   The following values are recognized:
-
-   linknode
-      The changeset node introducing this revision.
-
-   parents
-      Parent nodes for the revision.
-
-   revision
-      The raw revision data for a file.
-
-haveparents
-   (bool) Whether the client has the parent revisions of all requested
-   nodes.
-
-pathfilter
-   (map) Defines a filter that determines what file paths are relevant.
-
-   See the *Path Filters* section for more.
-
-   If the argument is omitted, it is assumed that all paths are relevant.
-
-revisions
-   (array of maps) Specifies revisions whose data is being requested. Each value
-   in the array is a map describing revisions. See the *Revisions Specifiers*
-   section below for the format of this map.
-
-   Data will be sent for the union of all revisions resolved by all revision
-   specifiers.
-
-   Only revision specifiers operating on changeset revisions are allowed.
-
-The response bytestream starts with a CBOR map describing the data that
-follows. This map has the following bytestring keys:
-
-totalpaths
-   (unsigned integer) Total number of paths whose data is being transferred.
-
-totalitems
-   (unsigned integer) Total number of file revisions whose data is being
-   transferred.
-
-Following the map header are 0 or more sequences of CBOR values. Each sequence
-represents data for a specific tracked path. Each sequence begins with a CBOR
-map describing the file data that follows. Following that map is N CBOR values
-describing file revision data. The format of this data is identical to that
-returned by the ``filedata`` command.
-
-Each sequence's map header has the following bytestring keys:
-
-path
-   (bytestring) The tracked file path whose data follows.
-
-totalitems
-   (unsigned integer) Total number of file revisions whose data is being
-   transferred.
-
-The ``haveparents`` argument has significant implications on the data
-transferred.
-
-When ``haveparents`` is true, the command MAY only emit data for file
-revisions introduced by the set of changeset revisions whose data is being
-requested. In other words, the command may assume that all file revisions
-for all relevant paths for ancestors of the requested changeset revisions
-are present on the receiver.
-
-When ``haveparents`` is false, the command MUST assume that the receiver
-has no file revisions data. This means that all referenced file revisions
-in the queried set of changeset revisions will be sent.
-
-TODO we want a more complicated mechanism for the client to specify which
-ancestor revisions are known. This is needed so intelligent deltas can be
-emitted and so updated linknodes can be sent if the client needs to adjust
-its linknodes for existing file nodes to older changeset revisions.
-TODO we may want to make linknodes an array so multiple changesets can be
-marked as introducing a file revision, since this can occur with e.g. hidden
-changesets.
-
-heads
------
-
-Obtain DAG heads in the repository.
-
-The command accepts the following arguments:
-
-publiconly (optional)
-   (boolean) If set, operate on the DAG for public phase changesets only.
-   Non-public (i.e. draft) phase DAG heads will not be returned.
-
-The response is a CBOR array of bytestrings defining changeset nodes
-of DAG heads. The array can be empty if the repository is empty or no
-changesets satisfied the request.
-
-TODO consider exposing phase of heads in response
-
-known
------
-
-Determine whether a series of changeset nodes is known to the server.
-
-The command accepts the following arguments:
-
-nodes
-   (array of bytestrings) List of changeset nodes whose presence to
-   query.
-
-The response is a bytestring where each byte contains a 0 or 1 for the
-corresponding requested node at the same index.
-
-TODO use a bit array for even more compact response
-
-listkeys
---------
-
-List values in a specified ``pushkey`` namespace.
-
-The command receives the following arguments:
-
-namespace
-   (bytestring) Pushkey namespace to query.
-
-The response is a map with bytestring keys and values.
-
-TODO consider using binary to represent nodes in certain pushkey namespaces.
-
-lookup
-------
-
-Try to resolve a value to a changeset revision.
-
-Unlike ``known`` which operates on changeset nodes, lookup operates on
-node fragments and other names that a user may use.
-
-The command receives the following arguments:
-
-key
-   (bytestring) Value to try to resolve.
-
-On success, returns a bytestring containing the resolved node.
-
-manifestdata
-------------
-
-Obtain various data related to manifests (which are lists of files in
-a revision).
-
-The command accepts the following arguments:
-
-fields
-   (set of bytestring) Which data associated with manifests to fetch.
-   The following values are recognized:
-
-   parents
-      Parent nodes for the manifest.
-
-   revision
-      The raw revision data for the manifest.
-
-haveparents
-   (bool) Whether the client has the parent revisions of all requested
-   nodes. If set, the server may emit revision data as deltas against
-   any parent revision. If not set, the server MUST only emit deltas for
-   revisions previously emitted by this command.
-
-   False is assumed in the absence of any value.
-
-nodes
-   (array of bytestring) Manifest nodes whose data to retrieve.
-
-tree
-   (bytestring) Path to manifest to retrieve. The empty bytestring represents
-   the root manifest. All other values represent directories/trees within
-   the repository.
-
-TODO allow specifying revisions via alternate means (such as from changeset
-revisions or ranges)
-TODO consider recursive expansion of manifests (with path filtering for
-narrow use cases)
-
-The response bytestream starts with a CBOR map describing the data that
-follows. It has the following bytestring keys:
-
-totalitems
-   (unsigned integer) Total number of manifest revisions whose data is
-   being returned.
-
-Following the map header is a series of 0 or more CBOR values. If values
-are present, the first value will always be a map describing a single manifest
-revision.
-
-If the ``fieldsfollowing`` key is present, the map will immediately be followed
-by N CBOR bytestring values, where N is the number of elements in
-``fieldsfollowing``. Each bytestring value corresponds to a field denoted
-by ``fieldsfollowing``.
-
-Following the optional bytestring field values is the next revision descriptor
-map, or end of stream.
-
-Each revision descriptor map has the following bytestring keys:
-
-node
-   (bytestring) The node of the manifest revision whose data is represented.
-
-deltabasenode
-   (bytestring) The node that the delta representation of this revision is
-   computed against. Only present if the ``revision`` field is requested and
-   a delta is being emitted.
-
-fieldsfollowing
-   (array of 2-array) Denotes extra bytestring fields that following this map.
-   See the documentation for ``changesetdata`` for semantics.
-
-   The following named fields may be present:
-
-   ``delta``
-      The delta data to use to construct the fulltext revision.
-
-      Only present if the ``revision`` field is requested and a delta is
-      being emitted. The ``deltabasenode`` top-level key will also be
-      present if this field is being emitted.
-
-   ``revision``
-      The fulltext revision data for this manifest. Only present if the
-      ``revision`` field is requested and a fulltext revision is being emitted.
-
-parents
-   (array of bytestring) The nodes of the parents of this manifest revision.
-   Only present if the ``parents`` field is requested.
-
-When ``revision`` data is requested, the server chooses to emit either fulltext
-revision data or a delta. What the server decides can be inferred by looking
-for the presence of ``delta`` or ``revision`` in the ``fieldsfollowing`` array.
-
-Servers MAY advertise the following extra fields in the capabilities
-descriptor for this command:
-
-recommendedbatchsize
-   (unsigned integer) Number of revisions the server recommends as a batch
-   query size. If defined, clients needing to issue multiple ``manifestdata``
-   commands to obtain needed data SHOULD construct their commands to have
-   this many revisions per request.
-
-pushkey
--------
-
-Set a value using the ``pushkey`` protocol.
-
-The command receives the following arguments:
-
-namespace
-   (bytestring) Pushkey namespace to operate on.
-key
-   (bytestring) The pushkey key to set.
-old
-   (bytestring) Old value for this key.
-new
-   (bytestring) New value for this key.
-
-TODO consider using binary to represent nodes is certain pushkey namespaces.
-TODO better define response type and meaning.
-
-rawstorefiledata
-----------------
-
-Allows retrieving raw files used to store repository data.
-
-The command accepts the following arguments:
-
-files
-   (array of bytestring) Describes the files that should be retrieved.
-
-   The meaning of values in this array is dependent on the storage backend used
-   by the server.
-
-The response bytestream starts with a CBOR map describing the data that follows.
-This map has the following bytestring keys:
-
-filecount
-   (unsigned integer) Total number of files whose data is being transferred.
-
-totalsize
-   (unsigned integer) Total size in bytes of files data that will be
-   transferred. This is file on-disk size and not wire size.
-
-Following the map header are N file segments. Each file segment consists of a
-CBOR map followed by an indefinite length bytestring. Each map has the following
-bytestring keys:
-
-location
-   (bytestring) Denotes the location in the repository where the file should be
-   written. Values map to vfs instances to use for the writing.
-
-path
-   (bytestring) Path of file being transferred. Path is the raw store
-   path and can be any sequence of bytes that can be tracked in a Mercurial
-   manifest.
-
-size
-   (unsigned integer) Size of file data. This will be the final written
-   file size. The total size of the data that follows the CBOR map
-   will be greater due to encoding overhead of CBOR.
-
-TODO this command is woefully incomplete. If we are to move forward with a
-stream clone analog, it needs a lot more metadata around how to describe what
-files are available to retrieve, other semantics.
-
-Revision Specifiers
-===================
-
-A *revision specifier* is a map that evaluates to a set of revisions.
-
-A *revision specifier* has a ``type`` key that defines the revision
-selection type to perform. Other keys in the map are used in a
-type-specific manner.
-
-The following types are defined:
-
-changesetexplicit
-   An explicit set of enumerated changeset revisions.
-
-   The ``nodes`` key MUST contain an array of full binary nodes, expressed
-   as bytestrings.
-
-changesetexplicitdepth
-   Like ``changesetexplicit``, but contains a ``depth`` key defining the
-   unsigned integer number of ancestor revisions to also resolve. For each
-   value in ``nodes``, DAG ancestors will be walked until up to N total
-   revisions from that ancestry walk are present in the final resolved set.
-
-changesetdagrange
-   Defines revisions via a DAG range of changesets on the changelog.
-
-   The ``roots`` key MUST contain an array of full, binary node values
-   representing the *root* revisions.
-
-   The ``heads`` key MUST contain an array of full, binary nodes values
-   representing the *head* revisions.
-
-   The DAG range between ``roots`` and ``heads`` will be resolved and all
-   revisions between will be used. Nodes in ``roots`` are not part of the
-   resolved set. Nodes in ``heads`` are. The ``roots`` array may be empty.
-   The ``heads`` array MUST be defined.
-
-Path Filters
-============
-
-Various commands accept a *path filter* argument that defines the set of file
-paths relevant to the request.
-
-A *path filter* is defined as a map with the bytestring keys ``include`` and
-``exclude``. Each is an array of bytestring values. Each value defines a pattern
-rule (see :hg:`help patterns`) that is used to match file paths.
-
-A path matches the path filter if it is matched by a rule in the ``include``
-set but doesn't match a rule in the ``exclude`` set. In other words, a path
-matcher takes the union of all ``include`` patterns and then substracts the
-union of all ``exclude`` patterns.
-
-Patterns MUST be prefixed with their pattern type. Only the following pattern
-types are allowed: ``path:``, ``rootfilesin:``.
-
-If the ``include`` key is omitted, it is assumed that all paths are
-relevant. The patterns from ``exclude`` will still be used, if defined.
-
-An example value is ``path:tests/foo``, which would match a file named
-``tests/foo`` or a directory ``tests/foo`` and all files under it.
--- a/mercurial/help/merge-tools.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-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:
-
-.. internaltoolsmarker
-
-Internal tools are always available and do not require a GUI but will
-by default not handle symlinks or binary files. See next section for
-detail about "actual capabilities" described above.
-
-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.
-
-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.
-
-For historical reason, Mercurial treats merge tools as below while
-examining rules above.
-
-==== =============== ====== =======
-step specified via   binary symlink
-==== =============== ====== =======
-1.   --tool          o/o    o/o
-2.   HGMERGE         o/o    o/o
-3.   merge-patterns  o/o(*) x/?(*)
-4.   ui.merge        x/?(*) x/?(*)
-==== =============== ====== =======
-
-Each capability column indicates Mercurial behavior for
-internal/external merge tools at examining each rule.
-
-- "o": "assume that a tool has capability"
-- "x": "assume that a tool does not have capability"
-- "?": "check actual capability of a tool"
-
-If ``merge.strict-capability-check`` configuration is true, Mercurial
-checks capabilities of merge tools strictly in (*) cases above (= each
-capability column becomes "?/?"). It is false by default for backward
-compatibility.
-
-.. note::
-
-   After selecting a merge program, Mercurial will by default attempt
-   to merge the files using a simple merge algorithm first. Only if it 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.
--- a/mercurial/help/pager.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-Some Mercurial commands can produce a lot of output, and Mercurial will
-attempt to use a pager to make those commands more pleasant.
-
-To set the pager that should be used, set the application variable::
-
-  [pager]
-  pager = less -FRX
-
-If no pager is set in the user or repository configuration, Mercurial uses the
-environment variable $PAGER. If $PAGER is not set, pager.pager from the default
-or system configuration is used. If none of these are set, a default pager will
-be used, typically `less` on Unix and `more` on Windows.
-
-.. container:: windows
-
-  On Windows, `more` is not color aware, so using it effectively disables color.
-  MSYS and Cygwin shells provide `less` as a pager, which can be configured to
-  support ANSI color codes.  See :hg:`help config.color.pagermode` to configure
-  the color mode when invoking a pager.
-
-You can disable the pager for certain commands by adding them to the
-pager.ignore list::
-
-  [pager]
-  ignore = version, help, update
-
-To ignore global commands like :hg:`version` or :hg:`help`, you have
-to specify them in your user configuration file.
-
-To control whether the pager is used at all for an individual command,
-you can use --pager=<value>:
-
-  - use as needed: `auto`.
-  - require the pager: `yes` or `on`.
-  - suppress the pager: `no` or `off` (any unrecognized value
-    will also work).
-
-To globally turn off all attempts to use a pager, set::
-
-  [ui]
-  paginate = never
-
-which will prevent the pager from running.
--- a/mercurial/help/patterns.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-Mercurial accepts several notations for identifying one or more files
-at a time.
-
-By default, Mercurial treats filenames as shell-style extended glob
-patterns.
-
-Alternate pattern notations must be specified explicitly.
-
-.. note::
-
-  Patterns specified in ``.hgignore`` are not rooted.
-  Please see :hg:`help hgignore` for details.
-
-To use a plain path name without any pattern matching, start it with
-``path:``. These path names must completely match starting at the
-current repository root, and when the path points to a directory, it is matched
-recursively. To match all files in a directory non-recursively (not including
-any files in subdirectories), ``rootfilesin:`` can be used, specifying an
-absolute path (relative to the repository root).
-
-To use an extended glob, start a name with ``glob:``. Globs are rooted
-at the current directory; a glob such as ``*.c`` will only match files
-in the current directory ending with ``.c``. ``rootglob:`` can be used
-instead of ``glob:`` for a glob that is rooted at the root of the
-repository.
-
-The supported glob syntax extensions are ``**`` to match any string
-across path separators and ``{a,b}`` to mean "a or b".
-
-To use a Perl/Python regular expression, start a name with ``re:``.
-Regexp pattern matching is anchored at the root of the repository.
-
-To read name patterns from a file, use ``listfile:`` or ``listfile0:``.
-The latter expects null delimited patterns while the former expects line
-feeds. Each string read from the file is itself treated as a file
-pattern.
-
-To read a set of patterns from a file, use ``include:`` or ``subinclude:``.
-``include:`` will use all the patterns from the given file and treat them as if
-they had been passed in manually.  ``subinclude:`` will only apply the patterns
-against files that are under the subinclude file's directory. See :hg:`help
-hgignore` for details on the format of these files.
-
-All patterns, except for ``glob:`` specified in command line (not for
-``-I`` or ``-X`` options), can match also against directories: files
-under matched directories are treated as matched.
-For ``-I`` and ``-X`` options, ``glob:`` will match directories recursively.
-
-Plain examples::
-
-  path:foo/bar        a name bar in a directory named foo in the root
-                      of the repository
-  path:path:name      a file or directory named "path:name"
-  rootfilesin:foo/bar the files in a directory called foo/bar, but not any files
-                      in its subdirectories and not a file bar in directory foo
-
-Glob examples::
-
-  glob:*.c       any name ending in ".c" in the current directory
-  *.c            any name ending in ".c" in the current directory
-  **.c           any name ending in ".c" in any subdirectory of the
-                 current directory including itself.
-  foo/*          any file in directory foo
-  foo/**         any file in directory foo plus all its subdirectories,
-                 recursively
-  foo/*.c        any name ending in ".c" in the directory foo
-  foo/**.c       any name ending in ".c" in any subdirectory of foo
-                 including itself.
-  rootglob:*.c   any name ending in ".c" in the root of the repository
-
-Regexp examples::
-
-  re:.*\.c$      any name ending in ".c", anywhere in the repository
-
-File examples::
-
-  listfile:list.txt  read list from list.txt with one file pattern per line
-  listfile0:list.txt read list from list.txt with null byte delimiters
-
-See also :hg:`help filesets`.
-
-Include examples::
-
-  include:path/to/mypatternfile    reads patterns to be applied to all paths
-  subinclude:path/to/subignorefile reads patterns specifically for paths in the
-                                   subdirectory
--- a/mercurial/help/phases.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-What are phases?
-================
-
-Phases are a system for tracking which changesets have been or should
-be shared. This helps prevent common mistakes when modifying history
-(for instance, with the mq or rebase extensions).
-
-Each changeset in a repository is in one of the following phases:
-
- - public : changeset is visible on a public server
- - draft : changeset is not yet published
- - secret : changeset should not be pushed, pulled, or cloned
-
-These phases are ordered (public < draft < secret) and no changeset
-can be in a lower phase than its ancestors. For instance, if a
-changeset is public, all its ancestors are also public. Lastly,
-changeset phases should only be changed towards the public phase.
-
-How are phases managed?
-=======================
-
-For the most part, phases should work transparently. By default, a
-changeset is created in the draft phase and is moved into the public
-phase when it is pushed to another repository.
-
-Once changesets become public, extensions like mq and rebase will
-refuse to operate on them to prevent creating duplicate changesets.
-Phases can also be manually manipulated with the :hg:`phase` command
-if needed. See :hg:`help -v phase` for examples.
-
-To make your commits secret by default, put this in your
-configuration file::
-
-  [phases]
-  new-commit = secret
-
-Phases and servers
-==================
-
-Normally, all servers are ``publishing`` by default. This means::
-
- - all draft changesets that are pulled or cloned appear in phase
- public on the client
-
- - all draft changesets that are pushed appear as public on both
- client and server
-
- - secret changesets are neither pushed, pulled, or cloned
-
-.. note::
-
-  Pulling a draft changeset from a publishing server does not mark it
-  as public on the server side due to the read-only nature of pull.
-
-Sometimes it may be desirable to push and pull changesets in the draft
-phase to share unfinished work. This can be done by setting a
-repository to disable publishing in its configuration file::
-
-  [phases]
-  publish = False
-
-See :hg:`help config` for more information on configuration files.
-
-.. note::
-
-  Servers running older versions of Mercurial are treated as
-  publishing.
-
-.. note::
-
-   Changesets in secret phase are not exchanged with the server. This
-   applies to their content: file names, file contents, and changeset
-   metadata. For technical reasons, the identifier (e.g. d825e4025e39)
-   of the secret changeset may be communicated to the server.
-
-
-Examples
-========
-
- - list changesets in draft or secret phase::
-
-     hg log -r "not public()"
-
- - change all secret changesets to draft::
-
-     hg phase --draft "secret()"
-
- - forcibly move the current changeset and descendants from public to draft::
-
-     hg phase --force --draft .
-
- - show a list of changeset revisions and each corresponding phase::
-
-     hg log --template "{rev} {phase}\n"
-
- - resynchronize draft changesets relative to a remote repository::
-
-     hg phase -fd "outgoing(URL)"
-
-See :hg:`help phase` for more information on manually manipulating phases.
--- a/mercurial/help/revisions.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,223 +0,0 @@
-Mercurial supports several ways to specify revisions.
-
-Specifying single revisions
-===========================
-
-A plain integer is treated as a revision number. Negative integers are
-treated as sequential offsets from the tip, with -1 denoting the tip,
--2 denoting the revision prior to the tip, and so forth.
-
-A 40-digit hexadecimal string is treated as a unique revision identifier.
-A hexadecimal string less than 40 characters long is treated as a
-unique revision identifier and is referred to as a short-form
-identifier. A short-form identifier is only valid if it is the prefix
-of exactly one full-length identifier.
-
-Any other string is treated as a bookmark, tag, or branch name. A
-bookmark is a movable pointer to a revision. A tag is a permanent name
-associated with a revision. A branch name denotes the tipmost open branch head
-of that branch - or if they are all closed, the tipmost closed head of the
-branch. Bookmark, tag, and branch names must not contain the ":" character.
-
-The reserved name "tip" always identifies the most recent revision.
-
-The reserved name "null" indicates the null revision. This is the
-revision of an empty repository, and the parent of revision 0.
-
-The reserved name "." indicates the working directory parent. If no
-working directory is checked out, it is equivalent to null. If an
-uncommitted merge is in progress, "." is the revision of the first
-parent.
-
-Finally, commands that expect a single revision (like ``hg update``) also
-accept revsets (see below for details). When given a revset, they use the
-last revision of the revset. A few commands accept two single revisions
-(like ``hg diff``). When given a revset, they use the first and the last
-revisions of the revset.
-
-Specifying multiple revisions
-=============================
-
-Mercurial supports a functional language for selecting a set of
-revisions. Expressions in this language are called revsets.
-
-The language supports a number of predicates which are joined by infix
-operators. Parenthesis can be used for grouping.
-
-Identifiers such as branch names may need quoting with single or
-double quotes if they contain characters like ``-`` or if they match
-one of the predefined predicates.
-
-Special characters can be used in quoted identifiers by escaping them,
-e.g., ``\n`` is interpreted as a newline. To prevent them from being
-interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
-
-Operators
-=========
-
-There is a single prefix operator:
-
-``not x``
-  Changesets not in x. Short form is ``! x``.
-
-These are the supported infix operators:
-
-``x::y``
-  A DAG range, meaning all changesets that are descendants of x and
-  ancestors of y, including x and y themselves. If the first endpoint
-  is left out, this is equivalent to ``ancestors(y)``, if the second
-  is left out it is equivalent to ``descendants(x)``.
-
-  An alternative syntax is ``x..y``.
-
-``x:y``
-  All changesets with revision numbers between x and y, both
-  inclusive. Either endpoint can be left out, they default to 0 and
-  tip.
-
-``x and y``
-  The intersection of changesets in x and y. Short form is ``x & y``.
-
-``x or y``
-  The union of changesets in x and y. There are two alternative short
-  forms: ``x | y`` and ``x + y``.
-
-``x - y``
-  Changesets in x but not in y.
-
-``x % y``
-  Changesets that are ancestors of x but not ancestors of y (i.e. ::x - ::y).
-  This is shorthand notation for ``only(x, y)`` (see below). The second
-  argument is optional and, if left out, is equivalent to ``only(x)``.
-
-``x^n``
-  The nth parent of x, n == 0, 1, or 2.
-  For n == 0, x; for n == 1, the first parent of each changeset in x;
-  for n == 2, the second parent of changeset in x.
-
-``x~n``
-  The nth first ancestor of x; ``x~0`` is x; ``x~3`` is ``x^^^``.
-  For n < 0, the nth unambiguous descendent of x.
-
-``x ## y``
-  Concatenate strings and identifiers into one string.
-
-  All other prefix, infix and postfix operators have lower priority than
-  ``##``. For example, ``a1 ## a2~2`` is equivalent to ``(a1 ## a2)~2``.
-
-  For example::
-
-    [revsetalias]
-    issue(a1) = grep(r'\bissue[ :]?' ## a1 ## r'\b|\bbug\(' ## a1 ## r'\)')
-
-  ``issue(1234)`` is equivalent to
-  ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')``
-  in this case. This matches against all of "issue 1234", "issue:1234",
-  "issue1234" and "bug(1234)".
-
-There is a single postfix operator:
-
-``x^``
-  Equivalent to ``x^1``, the first parent of each changeset in x.
-
-Patterns
-========
-
-Where noted, predicates that perform string matching can accept a pattern
-string. The pattern may be either a literal, or a regular expression. If the
-pattern starts with ``re:``, the remainder of the pattern is treated as a
-regular expression. Otherwise, it is treated as a literal. To match a pattern
-that actually starts with ``re:``, use the prefix ``literal:``.
-
-Matching is case-sensitive, unless otherwise noted.  To perform a case-
-insensitive match on a case-sensitive predicate, use a regular expression,
-prefixed with ``(?i)``.
-
-For example, ``tag(r're:(?i)release')`` matches "release" or "RELEASE"
-or "Release", etc.
-
-Predicates
-==========
-
-The following predicates are supported:
-
-.. predicatesmarker
-
-Aliases
-=======
-
-New predicates (known as "aliases") can be defined, using any combination of
-existing predicates or other aliases. An alias definition looks like::
-
-  <alias> = <definition>
-
-in the ``revsetalias`` section of a Mercurial configuration file. Arguments
-of the form `a1`, `a2`, etc. are substituted from the alias into the
-definition.
-
-For example,
-
-::
-
-  [revsetalias]
-  h = heads()
-  d(s) = sort(s, date)
-  rs(s, k) = reverse(sort(s, k))
-
-defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is
-exactly equivalent to ``reverse(sort(0:tip, author))``.
-
-Equivalents
-===========
-
-Command line equivalents for :hg:`log`::
-
-  -f    ->  ::.
-  -d x  ->  date(x)
-  -k x  ->  keyword(x)
-  -m    ->  merge()
-  -u x  ->  user(x)
-  -b x  ->  branch(x)
-  -P x  ->  !::x
-  -l x  ->  limit(expr, x)
-
-Examples
-========
-
-Some sample queries:
-
-- Changesets on the default branch::
-
-    hg log -r "branch(default)"
-
-- Changesets on the default branch since tag 1.5 (excluding merges)::
-
-    hg log -r "branch(default) and 1.5:: and not merge()"
-
-- Open branch heads::
-
-    hg log -r "head() and not closed()"
-
-- Changesets between tags 1.3 and 1.5 mentioning "bug" that affect
-  ``hgext/*``::
-
-    hg log -r "1.3::1.5 and keyword(bug) and file('hgext/*')"
-
-- Changesets committed in May 2008, sorted by user::
-
-    hg log -r "sort(date('May 2008'), user)"
-
-- Changesets mentioning "bug" or "issue" that are not in a tagged
-  release::
-
-    hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tag())"
-
-- Update to the commit that bookmark @ is pointing to, without activating the
-  bookmark (this works because the last revision of the revset is used)::
-
-    hg update :@
-
-- Show diff between tags 1.3 and 1.5 (this works because the first and the
-  last revisions of the revset are used)::
-
-    hg diff -r 1.3::1.5
--- a/mercurial/help/scripting.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +0,0 @@
-It is common for machines (as opposed to humans) to consume Mercurial.
-This help topic describes some of the considerations for interfacing
-machines with Mercurial.
-
-Choosing an Interface
-=====================
-
-Machines have a choice of several methods to interface with Mercurial.
-These include:
-
-- Executing the ``hg`` process
-- Querying a HTTP server
-- Calling out to a command server
-
-Executing ``hg`` processes is very similar to how humans interact with
-Mercurial in the shell. It should already be familiar to you.
-
-:hg:`serve` can be used to start a server. By default, this will start
-a "hgweb" HTTP server. This HTTP server has support for machine-readable
-output, such as JSON. For more, see :hg:`help hgweb`.
-
-:hg:`serve` can also start a "command server." Clients can connect
-to this server and issue Mercurial commands over a special protocol.
-For more details on the command server, including links to client
-libraries, see https://www.mercurial-scm.org/wiki/CommandServer.
-
-:hg:`serve` based interfaces (the hgweb and command servers) have the
-advantage over simple ``hg`` process invocations in that they are
-likely more efficient. This is because there is significant overhead
-to spawn new Python processes.
-
-.. tip::
-
-   If you need to invoke several ``hg`` processes in short order and/or
-   performance is important to you, use of a server-based interface
-   is highly recommended.
-
-Environment Variables
-=====================
-
-As documented in :hg:`help environment`, various environment variables
-influence the operation of Mercurial. The following are particularly
-relevant for machines consuming Mercurial:
-
-HGPLAIN
-    If not set, Mercurial's output could be influenced by configuration
-    settings that impact its encoding, verbose mode, localization, etc.
-
-    It is highly recommended for machines to set this variable when
-    invoking ``hg`` processes.
-
-HGENCODING
-    If not set, the locale used by Mercurial will be detected from the
-    environment. If the determined locale does not support display of
-    certain characters, Mercurial may render these character sequences
-    incorrectly (often by using "?" as a placeholder for invalid
-    characters in the current locale).
-
-    Explicitly setting this environment variable is a good practice to
-    guarantee consistent results. "utf-8" is a good choice on UNIX-like
-    environments.
-
-HGRCPATH
-    If not set, Mercurial will inherit config options from config files
-    using the process described in :hg:`help config`. This includes
-    inheriting user or system-wide config files.
-
-    When utmost control over the Mercurial configuration is desired, the
-    value of ``HGRCPATH`` can be set to an explicit file with known good
-    configs. In rare cases, the value can be set to an empty file or the
-    null device (often ``/dev/null``) to bypass loading of any user or
-    system config files. Note that these approaches can have unintended
-    consequences, as the user and system config files often define things
-    like the username and extensions that may be required to interface
-    with a repository.
-
-Command-line Flags
-==================
-
-Mercurial's default command-line parser is designed for humans, and is not
-robust against malicious input. For instance, you can start a debugger by
-passing ``--debugger`` as an option value::
-
-    $ REV=--debugger sh -c 'hg log -r "$REV"'
-
-This happens because several command-line flags need to be scanned without
-using a concrete command table, which may be modified while loading repository
-settings and extensions.
-
-Since Mercurial 4.4.2, the parsing of such flags may be restricted by setting
-``HGPLAIN=+strictflags``. When this feature is enabled, all early options
-(e.g. ``-R/--repository``, ``--cwd``, ``--config``) must be specified first
-amongst the other global options, and cannot be injected to an arbitrary
-location::
-
-    $ HGPLAIN=+strictflags hg -R "$REPO" log -r "$REV"
-
-In earlier Mercurial versions where ``+strictflags`` isn't available, you
-can mitigate the issue by concatenating an option value with its flag::
-
-    $ hg log -r"$REV" --keyword="$KEYWORD"
-
-Consuming Command Output
-========================
-
-It is common for machines to need to parse the output of Mercurial
-commands for relevant data. This section describes the various
-techniques for doing so.
-
-Parsing Raw Command Output
---------------------------
-
-Likely the simplest and most effective solution for consuming command
-output is to simply invoke ``hg`` commands as you would as a user and
-parse their output.
-
-The output of many commands can easily be parsed with tools like
-``grep``, ``sed``, and ``awk``.
-
-A potential downside with parsing command output is that the output
-of commands can change when Mercurial is upgraded. While Mercurial
-does generally strive for strong backwards compatibility, command
-output does occasionally change. Having tests for your automated
-interactions with ``hg`` commands is generally recommended, but is
-even more important when raw command output parsing is involved.
-
-Using Templates to Control Output
----------------------------------
-
-Many ``hg`` commands support templatized output via the
-``-T/--template`` argument. For more, see :hg:`help templates`.
-
-Templates are useful for explicitly controlling output so that
-you get exactly the data you want formatted how you want it. For
-example, ``log -T {node}\n`` can be used to print a newline
-delimited list of changeset nodes instead of a human-tailored
-output containing authors, dates, descriptions, etc.
-
-.. tip::
-
-   If parsing raw command output is too complicated, consider
-   using templates to make your life easier.
-
-The ``-T/--template`` argument allows specifying pre-defined styles.
-Mercurial ships with the machine-readable styles ``cbor``, ``json``,
-and ``xml``, which provide CBOR, JSON, and XML output, respectively.
-These are useful for producing output that is machine readable as-is.
-
-(Mercurial 5.0 is required for CBOR style.)
-
-.. important::
-
-   The ``json`` and ``xml`` styles are considered experimental. While
-   they may be attractive to use for easily obtaining machine-readable
-   output, their behavior may change in subsequent versions.
-
-   These styles may also exhibit unexpected results when dealing with
-   certain encodings. Mercurial treats things like filenames as a
-   series of bytes and normalizing certain byte sequences to JSON
-   or XML with certain encoding settings can lead to surprises.
-
-Command Server Output
----------------------
-
-If using the command server to interact with Mercurial, you are likely
-using an existing library/API that abstracts implementation details of
-the command server. If so, this interface layer may perform parsing for
-you, saving you the work of implementing it yourself.
-
-Output Verbosity
-----------------
-
-Commands often have varying output verbosity, even when machine
-readable styles are being used (e.g. ``-T json``). Adding
-``-v/--verbose`` and ``--debug`` to the command's arguments can
-increase the amount of data exposed by Mercurial.
-
-An alternate way to get the data you need is by explicitly specifying
-a template.
-
-Other Topics
-============
-
-revsets
-   Revisions sets is a functional query language for selecting a set
-   of revisions. Think of it as SQL for Mercurial repositories. Revsets
-   are useful for querying repositories for specific data.
-
-   See :hg:`help revsets` for more.
-
-share extension
-   The ``share`` extension provides functionality for sharing
-   repository data across several working copies. It can even
-   automatically "pool" storage for logically related repositories when
-   cloning.
-
-   Configuring the ``share`` extension can lead to significant resource
-   utilization reduction, particularly around disk space and the
-   network. This is especially true for continuous integration (CI)
-   environments.
-
-   See :hg:`help -e share` for more.
--- a/mercurial/help/subrepos.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-Subrepositories let you nest external repositories or projects into a
-parent Mercurial repository, and make commands operate on them as a
-group.
-
-Mercurial currently supports Mercurial, Git, and Subversion
-subrepositories.
-
-Subrepositories are made of three components:
-
-1. Nested repository checkouts. They can appear anywhere in the
-   parent working directory.
-
-2. Nested repository references. They are defined in ``.hgsub``, which
-   should be placed in the root of working directory, and
-   tell where the subrepository checkouts come from. Mercurial
-   subrepositories are referenced like::
-
-     path/to/nested = https://example.com/nested/repo/path
-
-   Git and Subversion subrepos are also supported::
-
-     path/to/nested = [git]git://example.com/nested/repo/path
-     path/to/nested = [svn]https://example.com/nested/trunk/path
-
-   where ``path/to/nested`` is the checkout location relatively to the
-   parent Mercurial root, and ``https://example.com/nested/repo/path``
-   is the source repository path. The source can also reference a
-   filesystem path.
-
-   Note that ``.hgsub`` does not exist by default in Mercurial
-   repositories, you have to create and add it to the parent
-   repository before using subrepositories.
-
-3. Nested repository states. They are defined in ``.hgsubstate``, which
-   is placed in the root of working directory, and
-   capture whatever information is required to restore the
-   subrepositories to the state they were committed in a parent
-   repository changeset. Mercurial automatically record the nested
-   repositories states when committing in the parent repository.
-
-   .. note::
-
-      The ``.hgsubstate`` file should not be edited manually.
-
-
-Adding a Subrepository
-======================
-
-If ``.hgsub`` does not exist, create it and add it to the parent
-repository. Clone or checkout the external projects where you want it
-to live in the parent repository. Edit ``.hgsub`` and add the
-subrepository entry as described above. At this point, the
-subrepository is tracked and the next commit will record its state in
-``.hgsubstate`` and bind it to the committed changeset.
-
-Synchronizing a Subrepository
-=============================
-
-Subrepos do not automatically track the latest changeset of their
-sources. Instead, they are updated to the changeset that corresponds
-with the changeset checked out in the top-level changeset. This is so
-developers always get a consistent set of compatible code and
-libraries when they update.
-
-Thus, updating subrepos is a manual process. Simply check out target
-subrepo at the desired revision, test in the top-level repo, then
-commit in the parent repository to record the new combination.
-
-Deleting a Subrepository
-========================
-
-To remove a subrepository from the parent repository, delete its
-reference from ``.hgsub``, then remove its files.
-
-Interaction with Mercurial Commands
-===================================
-
-:add: add does not recurse in subrepos unless -S/--subrepos is
-    specified.  However, if you specify the full path of a file in a
-    subrepo, it will be added even without -S/--subrepos specified.
-    Subversion subrepositories are currently silently
-    ignored.
-
-:addremove: addremove does not recurse into subrepos unless
-    -S/--subrepos is specified.  However, if you specify the full
-    path of a directory in a subrepo, addremove will be performed on
-    it even without -S/--subrepos being specified.  Git and
-    Subversion subrepositories will print a warning and continue.
-
-:archive: archive does not recurse in subrepositories unless
-    -S/--subrepos is specified.
-
-:cat: Git subrepositories only support exact file matches.
-    Subversion subrepositories are currently ignored.
-
-:commit: commit creates a consistent snapshot of the state of the
-    entire project and its subrepositories. If any subrepositories
-    have been modified, Mercurial will abort.  Mercurial can be made
-    to instead commit all modified subrepositories by specifying
-    -S/--subrepos, or setting "ui.commitsubrepos=True" in a
-    configuration file (see :hg:`help config`).  After there are no
-    longer any modified subrepositories, it records their state and
-    finally commits it in the parent repository.  The --addremove
-    option also honors the -S/--subrepos option.  However, Git and
-    Subversion subrepositories will print a warning and abort.
-
-:diff: diff does not recurse in subrepos unless -S/--subrepos is
-    specified.  However, if you specify the full path of a file or
-    directory in a subrepo, it will be diffed even without
-    -S/--subrepos being specified.  Subversion subrepositories are
-    currently silently ignored.
-
-:files: files does not recurse into subrepos unless -S/--subrepos is
-    specified.  However, if you specify the full path of a file or
-    directory in a subrepo, it will be displayed even without
-    -S/--subrepos being specified.  Git and Subversion subrepositories
-    are currently silently ignored.
-
-:forget: forget currently only handles exact file matches in subrepos.
-    Git and Subversion subrepositories are currently silently ignored.
-
-:incoming: incoming does not recurse in subrepos unless -S/--subrepos
-    is specified. Git and Subversion subrepositories are currently
-    silently ignored.
-
-:outgoing: outgoing does not recurse in subrepos unless -S/--subrepos
-    is specified. Git and Subversion subrepositories are currently
-    silently ignored.
-
-:pull: pull is not recursive since it is not clear what to pull prior
-    to running :hg:`update`. Listing and retrieving all
-    subrepositories changes referenced by the parent repository pulled
-    changesets is expensive at best, impossible in the Subversion
-    case.
-
-:push: Mercurial will automatically push all subrepositories first
-    when the parent repository is being pushed. This ensures new
-    subrepository changes are available when referenced by top-level
-    repositories.  Push is a no-op for Subversion subrepositories.
-
-:serve: serve does not recurse into subrepositories unless
-    -S/--subrepos is specified.  Git and Subversion subrepositories
-    are currently silently ignored.
-
-:status: status does not recurse into subrepositories unless
-    -S/--subrepos is specified. Subrepository changes are displayed as
-    regular Mercurial changes on the subrepository
-    elements. Subversion subrepositories are currently silently
-    ignored.
-
-:remove: remove does not recurse into subrepositories unless
-    -S/--subrepos is specified.  However, if you specify a file or
-    directory path in a subrepo, it will be removed even without
-    -S/--subrepos.  Git and Subversion subrepositories are currently
-    silently ignored.
-
-:update: update restores the subrepos in the state they were
-    originally committed in target changeset. If the recorded
-    changeset is not available in the current subrepository, Mercurial
-    will pull it in first before updating.  This means that updating
-    can require network access when using subrepositories.
-
-Remapping Subrepositories Sources
-=================================
-
-A subrepository source location may change during a project life,
-invalidating references stored in the parent repository history. To
-fix this, rewriting rules can be defined in parent repository ``hgrc``
-file or in Mercurial configuration. See the ``[subpaths]`` section in
-hgrc(5) for more details.
-
--- a/mercurial/help/templates.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +0,0 @@
-Mercurial allows you to customize output of commands through
-templates. You can either pass in a template or select an existing
-template-style from the command line, via the --template option.
-
-You can customize output for any "log-like" command: log,
-outgoing, incoming, tip, parents, and heads.
-
-Some built-in styles are packaged with Mercurial. These can be listed
-with :hg:`log --template list`. Example usage::
-
-    $ hg log -r1.0::1.1 --template changelog
-
-A template is a piece of text, with markup to invoke variable
-expansion::
-
-    $ hg log -r1 --template "{node}\n"
-    b56ce7b07c52de7d5fd79fb89701ea538af65746
-
-Keywords
-========
-
-Strings in curly braces are called keywords. The availability of
-keywords depends on the exact context of the templater. These
-keywords are usually available for templating a log-like command:
-
-.. keywordsmarker
-
-The "date" keyword does not produce human-readable output. If you
-want to use a date in your output, you can use a filter to process
-it. Filters are functions which return a string based on the input
-variable. Be sure to use the stringify filter first when you're
-applying a string-input filter to a list-like input variable.
-You can also use a chain of filters to get the desired output::
-
-   $ hg tip --template "{date|isodate}\n"
-   2008-08-21 18:22 +0000
-
-Filters
-=======
-
-List of filters:
-
-.. filtersmarker
-
-Note that a filter is nothing more than a function call, i.e.
-``expr|filter`` is equivalent to ``filter(expr)``.
-
-Functions
-=========
-
-In addition to filters, there are some basic built-in functions:
-
-.. functionsmarker
-
-Operators
-=========
-
-We provide a limited set of infix arithmetic operations on integers::
-
-  + for addition
-  - for subtraction
-  * for multiplication
-  / for floor division (division rounded to integer nearest -infinity)
-
-Division fulfills the law x = x / y + mod(x, y).
-
-Also, for any expression that returns a list, there is a list operator::
-
-    expr % "{template}"
-
-As seen in the above example, ``{template}`` is interpreted as a template.
-To prevent it from being interpreted, you can use an escape character ``\{``
-or a raw string prefix, ``r'...'``.
-
-The dot operator can be used as a shorthand for accessing a sub item:
-
-- ``expr.member`` is roughly equivalent to ``expr % '{member}'`` if ``expr``
-  returns a non-list/dict. The returned value is not stringified.
-- ``dict.key`` is identical to ``get(dict, 'key')``.
-
-Aliases
-=======
-
-New keywords and functions can be defined in the ``templatealias`` section of
-a Mercurial configuration file::
-
-  <alias> = <definition>
-
-Arguments of the form `a1`, `a2`, etc. are substituted from the alias into
-the definition.
-
-For example,
-
-::
-
-  [templatealias]
-  r = rev
-  rn = "{r}:{node|short}"
-  leftpad(s, w) = pad(s, w, ' ', True)
-
-defines two symbol aliases, ``r`` and ``rn``, and a function alias
-``leftpad()``.
-
-It's also possible to specify complete template strings, using the
-``templates`` section. The syntax used is the general template string syntax.
-
-For example,
-
-::
-
-  [templates]
-  nodedate = "{node|short}: {date(date, "%Y-%m-%d")}\n"
-
-defines a template, ``nodedate``, which can be called like::
-
-  $ hg log -r . -Tnodedate
-
-A template defined in ``templates`` section can also be referenced from
-another template::
-
-  $ hg log -r . -T "{rev} {nodedate}"
-
-but be aware that the keywords cannot be overridden by templates. For example,
-a template defined as ``templates.rev`` cannot be referenced as ``{rev}``.
-
-A template defined in ``templates`` section may have sub templates which
-are inserted before/after/between items::
-
-  [templates]
-  myjson = ' {dict(rev, node|short)|json}'
-  myjson:docheader = '\{\n'
-  myjson:docfooter = '\n}\n'
-  myjson:separator = ',\n'
-
-Examples
-========
-
-Some sample command line templates:
-
-- Format lists, e.g. files::
-
-   $ hg log -r 0 --template "files:\n{files % '  {file}\n'}"
-
-- Join the list of files with a ", "::
-
-   $ hg log -r 0 --template "files: {join(files, ', ')}\n"
-
-- Join the list of files ending with ".py" with a ", "::
-
-   $ hg log -r 0 --template "pythonfiles: {join(files('**.py'), ', ')}\n"
-
-- Separate non-empty arguments by a " "::
-
-   $ hg log -r 0 --template "{separate(' ', node, bookmarks, tags}\n"
-
-- Modify each line of a commit description::
-
-   $ hg log --template "{splitlines(desc) % '**** {line}\n'}"
-
-- Format date::
-
-   $ hg log -r 0 --template "{date(date, '%Y')}\n"
-
-- Display date in UTC::
-
-   $ hg log -r 0 --template "{localdate(date, 'UTC')|date}\n"
-
-- Output the description set to a fill-width of 30::
-
-   $ hg log -r 0 --template "{fill(desc, 30)}"
-
-- Use a conditional to test for the default branch::
-
-   $ hg log -r 0 --template "{ifeq(branch, 'default', 'on the main branch',
-   'on branch {branch}')}\n"
-
-- Append a newline if not empty::
-
-   $ hg tip --template "{if(author, '{author}\n')}"
-
-- Label the output for use with the color extension::
-
-   $ hg log -r 0 --template "{label('changeset.{phase}', node|short)}\n"
-
-- Invert the firstline filter, i.e. everything but the first line::
-
-   $ hg log -r 0 --template "{sub(r'^.*\n?\n?', '', desc)}\n"
-
-- Display the contents of the 'extra' field, one per line::
-
-   $ hg log -r 0 --template "{join(extras, '\n')}\n"
-
-- Mark the active bookmark with '*'::
-
-   $ hg log --template "{bookmarks % '{bookmark}{ifeq(bookmark, active, '*')} '}\n"
-
-- Find the previous release candidate tag, the distance and changes since the tag::
-
-   $ hg log -r . --template "{latesttag('re:^.*-rc$') % '{tag}, {changes}, {distance}'}\n"
-
-- Mark the working copy parent with '@'::
-
-   $ hg log --template "{ifcontains(rev, revset('.'), '@')}\n"
-
-- Show details of parent revisions::
-
-   $ hg log --template "{revset('parents(%d)', rev) % '{desc|firstline}\n'}"
-
-- Show only commit descriptions that start with "template"::
-
-   $ hg log --template "{startswith('template', firstline(desc))}\n"
-
-- Print the first word of each line of a commit message::
-
-   $ hg log --template "{word(0, desc)}\n"
--- a/mercurial/help/urls.txt	Thu Nov 14 11:33:05 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-Valid URLs are of the form::
-
-  local/filesystem/path[#revision]
-  file://local/filesystem/path[#revision]
-  http://[user[:pass]@]host[:port]/[path][#revision]
-  https://[user[:pass]@]host[:port]/[path][#revision]
-  ssh://[user@]host[:port]/[path][#revision]
-
-Paths in the local filesystem can either point to Mercurial
-repositories or to bundle files (as created by :hg:`bundle` or
-:hg:`incoming --bundle`). See also :hg:`help paths`.
-
-An optional identifier after # indicates a particular branch, tag, or
-changeset to use from the remote repository. See also :hg:`help
-revisions`.
-
-Some features, such as pushing to http:// and https:// URLs are only
-possible if the feature is explicitly enabled on the remote Mercurial
-server.
-
-Note that the security of HTTPS URLs depends on proper configuration of
-web.cacerts.
-
-Some notes about using SSH with Mercurial:
-
-- SSH requires an accessible shell account on the destination machine
-  and a copy of hg in the remote path or specified with remotecmd.
-- path is relative to the remote user's home directory by default. Use
-  an extra slash at the start of a path to specify an absolute path::
-
-    ssh://example.com//tmp/repository
-
-- Mercurial doesn't use its own compression via SSH; the right thing
-  to do is to configure it in your ~/.ssh/config, e.g.::
-
-    Host *.mylocalnetwork.example.com
-      Compression no
-    Host *
-      Compression yes
-
-  Alternatively specify "ssh -C" as your ssh command in your
-  configuration file or with the --ssh command line option.
-
-These URLs can all be stored in your configuration file with path
-aliases under the [paths] section like so::
-
-  [paths]
-  alias1 = URL1
-  alias2 = URL2
-  ...
-
-You can then use the alias for any command that uses a URL (for
-example :hg:`pull alias1` will be treated as :hg:`pull URL1`).
-
-Two path aliases are special because they are used as defaults when
-you do not provide the URL to a command:
-
-default:
-  When you create a repository with hg clone, the clone command saves
-  the location of the source repository as the new repository's
-  'default' path. This is then used when you omit path from push- and
-  pull-like commands (including incoming and outgoing).
-
-default-push:
-  The push command will look for a path named 'default-push', and
-  prefer it over 'default' if both are defined.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/bundlespec.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,84 @@
+Mercurial supports generating standalone "bundle" files that hold repository
+data. These "bundles" are typically saved locally and used later or exchanged
+between different repositories, possibly on different machines. Example
+commands using bundles are :hg:`bundle` and :hg:`unbundle`.
+
+Generation of bundle files is controlled by a "bundle specification"
+("bundlespec") string. This string tells the bundle generation process how
+to create the bundle.
+
+A "bundlespec" string is composed of the following elements:
+
+type
+    A string denoting the bundle format to use.
+
+compression
+    Denotes the compression engine to use compressing the raw bundle data.
+
+parameters
+    Arbitrary key-value parameters to further control bundle generation.
+
+A "bundlespec" string has the following formats:
+
+<type>
+    The literal bundle format string is used.
+
+<compression>-<type>
+    The compression engine and format are delimited by a hyphen (``-``).
+
+Optional parameters follow the ``<type>``. Parameters are URI escaped
+``key=value`` pairs. Each pair is delimited by a semicolon (``;``). The
+first parameter begins after a ``;`` immediately following the ``<type>``
+value.
+
+Available Types
+===============
+
+The following bundle <type> strings are available:
+
+v1
+    Produces a legacy "changegroup" version 1 bundle.
+
+    This format is compatible with nearly all Mercurial clients because it is
+    the oldest. However, it has some limitations, which is why it is no longer
+    the default for new repositories.
+
+    ``v1`` bundles can be used with modern repositories using the "generaldelta"
+    storage format. However, it may take longer to produce the bundle and the
+    resulting bundle may be significantly larger than a ``v2`` bundle.
+
+    ``v1`` bundles can only use the ``gzip``, ``bzip2``, and ``none`` compression
+    formats.
+
+v2
+    Produces a version 2 bundle.
+
+    Version 2 bundles are an extensible format that can store additional
+    repository data (such as bookmarks and phases information) and they can
+    store data more efficiently, resulting in smaller bundles.
+
+    Version 2 bundles can also use modern compression engines, such as
+    ``zstd``, making them faster to compress and often smaller.
+
+Available Compression Engines
+=============================
+
+The following bundle <compression> engines can be used:
+
+.. bundlecompressionmarker
+
+Examples
+========
+
+``v2``
+    Produce a ``v2`` bundle using default options, including compression.
+
+``none-v1``
+    Produce a ``v1`` bundle with no compression.
+
+``zstd-v2``
+    Produce a ``v2`` bundle with zstandard compression using default
+    settings.
+
+``zstd-v1``
+    This errors because ``zstd`` is not supported for ``v1`` types.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/color.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,149 @@
+Mercurial colorizes output from several commands.
+
+For example, the diff command shows additions in green and deletions
+in red, while the status command shows modified files in magenta. Many
+other commands have analogous colors. It is possible to customize
+these colors.
+
+To enable color (default) whenever possible use::
+
+  [ui]
+  color = yes
+
+To disable color use::
+
+  [ui]
+  color = no
+
+See :hg:`help config.ui.color` for details.
+
+.. container:: windows
+
+  The default pager on Windows does not support color, so enabling the pager
+  will effectively disable color.  See :hg:`help config.ui.paginate` to disable
+  the pager.  Alternately, MSYS and Cygwin shells provide `less` as a pager,
+  which can be configured to support ANSI color mode.  Windows 10 natively
+  supports ANSI color mode.
+
+Mode
+====
+
+Mercurial can use various systems to display color. The supported modes are
+``ansi``, ``win32``, and ``terminfo``.  See :hg:`help config.color` for details
+about how to control the mode.
+
+Effects
+=======
+
+Other effects in addition to color, like bold and underlined text, are
+also available. By default, the terminfo database is used to find the
+terminal codes used to change color and effect.  If terminfo is not
+available, then effects are rendered with the ECMA-48 SGR control
+function (aka ANSI escape codes).
+
+The available effects in terminfo mode are 'blink', 'bold', 'dim',
+'inverse', 'invisible', 'italic', 'standout', and 'underline'; in
+ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and
+'underline'.  How each is rendered depends on the terminal emulator.
+Some may not be available for a given terminal type, and will be
+silently ignored.
+
+If the terminfo entry for your terminal is missing codes for an effect
+or has the wrong codes, you can add or override those codes in your
+configuration::
+
+  [color]
+  terminfo.dim = \E[2m
+
+where '\E' is substituted with an escape character.
+
+Labels
+======
+
+Text receives color effects depending on the labels that it has. Many
+default Mercurial commands emit labelled text. You can also define
+your own labels in templates using the label function, see :hg:`help
+templates`. A single portion of text may have more than one label. In
+that case, effects given to the last label will override any other
+effects. This includes the special "none" effect, which nullifies
+other effects.
+
+Labels are normally invisible. In order to see these labels and their
+position in the text, use the global --color=debug option. The same
+anchor text may be associated to multiple labels, e.g.
+
+  [log.changeset changeset.secret|changeset:   22611:6f0a53c8f587]
+
+The following are the default effects for some default labels. Default
+effects may be overridden from your configuration file::
+
+  [color]
+  status.modified = blue bold underline red_background
+  status.added = green bold
+  status.removed = red bold blue_background
+  status.deleted = cyan bold underline
+  status.unknown = magenta bold underline
+  status.ignored = black bold
+
+  # 'none' turns off all effects
+  status.clean = none
+  status.copied = none
+
+  qseries.applied = blue bold underline
+  qseries.unapplied = black bold
+  qseries.missing = red bold
+
+  diff.diffline = bold
+  diff.extended = cyan bold
+  diff.file_a = red bold
+  diff.file_b = green bold
+  diff.hunk = magenta
+  diff.deleted = red
+  diff.inserted = green
+  diff.changed = white
+  diff.tab =
+  diff.trailingwhitespace = bold red_background
+
+  # Blank so it inherits the style of the surrounding label
+  changeset.public =
+  changeset.draft =
+  changeset.secret =
+
+  resolve.unresolved = red bold
+  resolve.resolved = green bold
+
+  bookmarks.active = green
+
+  branches.active = none
+  branches.closed = black bold
+  branches.current = green
+  branches.inactive = none
+
+  tags.normal = green
+  tags.local = black bold
+
+  rebase.rebased = blue
+  rebase.remaining = red bold
+
+  shelve.age = cyan
+  shelve.newest = green bold
+  shelve.name = blue bold
+
+  histedit.remaining = red bold
+
+Custom colors
+=============
+
+Because there are only eight standard colors, Mercurial allows you
+to define color names for other color slots which might be available
+for your terminal type, assuming terminfo mode.  For instance::
+
+  color.brightblue = 12
+  color.pink = 207
+  color.orange = 202
+
+to set 'brightblue' to color slot 12 (useful for 16 color terminals
+that have brighter colors defined in the upper eight) and, 'pink' and
+'orange' to colors in 256-color xterm's default color cube.  These
+defined colors may then be used as any of the pre-defined eight,
+including appending '_background' to set the background to that color.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/common.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,8 @@
+.. Common link and substitution definitions.
+
+.. |hg(1)| replace:: **hg**\ (1)
+.. _hg(1): hg.1.html
+.. |hgrc(5)| replace:: **hgrc**\ (5)
+.. _hgrc(5): hgrc.5.html
+.. |hgignore(5)| replace:: **hgignore**\ (5)
+.. _hgignore(5): hgignore.5.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/config.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,2870 @@
+The Mercurial system uses a set of configuration files to control
+aspects of its behavior.
+
+Troubleshooting
+===============
+
+If you're having problems with your configuration,
+:hg:`config --debug` can help you understand what is introducing
+a setting into your environment.
+
+See :hg:`help config.syntax` and :hg:`help config.files`
+for information about how and where to override things.
+
+Structure
+=========
+
+The configuration files use a simple ini-file format. A configuration
+file consists of sections, led by a ``[section]`` header and followed
+by ``name = value`` entries::
+
+  [ui]
+  username = Firstname Lastname <firstname.lastname@example.net>
+  verbose = True
+
+The above entries will be referred to as ``ui.username`` and
+``ui.verbose``, respectively. See :hg:`help config.syntax`.
+
+Files
+=====
+
+Mercurial reads configuration data from several files, if they exist.
+These files do not exist by default and you will have to create the
+appropriate configuration files yourself:
+
+Local configuration is put into the per-repository ``<repo>/.hg/hgrc`` file.
+
+Global configuration like the username setting is typically put into:
+
+.. container:: windows
+
+  - ``%USERPROFILE%\mercurial.ini`` (on Windows)
+
+.. container:: unix.plan9
+
+  - ``$HOME/.hgrc`` (on Unix, Plan9)
+
+The names of these files depend on the system on which Mercurial is
+installed. ``*.rc`` files from a single directory are read in
+alphabetical order, later ones overriding earlier ones. Where multiple
+paths are given below, settings from earlier paths override later
+ones.
+
+.. container:: verbose.unix
+
+  On Unix, the following files are consulted:
+
+  - ``<repo>/.hg/hgrc`` (per-repository)
+  - ``$HOME/.hgrc`` (per-user)
+  - ``${XDG_CONFIG_HOME:-$HOME/.config}/hg/hgrc`` (per-user)
+  - ``<install-root>/etc/mercurial/hgrc`` (per-installation)
+  - ``<install-root>/etc/mercurial/hgrc.d/*.rc`` (per-installation)
+  - ``/etc/mercurial/hgrc`` (per-system)
+  - ``/etc/mercurial/hgrc.d/*.rc`` (per-system)
+  - ``<internal>/default.d/*.rc`` (defaults)
+
+.. container:: verbose.windows
+
+  On Windows, the following files are consulted:
+
+  - ``<repo>/.hg/hgrc`` (per-repository)
+  - ``%USERPROFILE%\.hgrc`` (per-user)
+  - ``%USERPROFILE%\Mercurial.ini`` (per-user)
+  - ``%HOME%\.hgrc`` (per-user)
+  - ``%HOME%\Mercurial.ini`` (per-user)
+  - ``HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial`` (per-installation)
+  - ``<install-dir>\hgrc.d\*.rc`` (per-installation)
+  - ``<install-dir>\Mercurial.ini`` (per-installation)
+  - ``<internal>/default.d/*.rc`` (defaults)
+
+  .. note::
+
+   The registry key ``HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercurial``
+   is used when running 32-bit Python on 64-bit Windows.
+
+.. container:: windows
+
+  On Windows 9x, ``%HOME%`` is replaced by ``%APPDATA%``.
+
+.. container:: verbose.plan9
+
+  On Plan9, the following files are consulted:
+
+  - ``<repo>/.hg/hgrc`` (per-repository)
+  - ``$home/lib/hgrc`` (per-user)
+  - ``<install-root>/lib/mercurial/hgrc`` (per-installation)
+  - ``<install-root>/lib/mercurial/hgrc.d/*.rc`` (per-installation)
+  - ``/lib/mercurial/hgrc`` (per-system)
+  - ``/lib/mercurial/hgrc.d/*.rc`` (per-system)
+  - ``<internal>/default.d/*.rc`` (defaults)
+
+Per-repository configuration options only apply in a
+particular repository. This file is not version-controlled, and
+will not get transferred during a "clone" operation. Options in
+this file override options in all other configuration files.
+
+.. container:: unix.plan9
+
+  On Plan 9 and Unix, most of this file will be ignored if it doesn't
+  belong to a trusted user or to a trusted group. See
+  :hg:`help config.trusted` for more details.
+
+Per-user configuration file(s) are for the user running Mercurial.  Options
+in these files apply to all Mercurial commands executed by this user in any
+directory. Options in these files override per-system and per-installation
+options.
+
+Per-installation configuration files are searched for in the
+directory where Mercurial is installed. ``<install-root>`` is the
+parent directory of the **hg** executable (or symlink) being run.
+
+.. container:: unix.plan9
+
+  For example, if installed in ``/shared/tools/bin/hg``, Mercurial
+  will look in ``/shared/tools/etc/mercurial/hgrc``. Options in these
+  files apply to all Mercurial commands executed by any user in any
+  directory.
+
+Per-installation configuration files are for the system on
+which Mercurial is running. Options in these files apply to all
+Mercurial commands executed by any user in any directory. Registry
+keys contain PATH-like strings, every part of which must reference
+a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will
+be read.  Mercurial checks each of these locations in the specified
+order until one or more configuration files are detected.
+
+Per-system configuration files are for the system on which Mercurial
+is running. Options in these files apply to all Mercurial commands
+executed by any user in any directory. Options in these files
+override per-installation options.
+
+Mercurial comes with some default configuration. The default configuration
+files are installed with Mercurial and will be overwritten on upgrades. Default
+configuration files should never be edited by users or administrators but can
+be overridden in other configuration files. So far the directory only contains
+merge tool configuration but packagers can also put other default configuration
+there.
+
+Syntax
+======
+
+A configuration file consists of sections, led by a ``[section]`` header
+and followed by ``name = value`` entries (sometimes called
+``configuration keys``)::
+
+    [spam]
+    eggs=ham
+    green=
+       eggs
+
+Each line contains one entry. If the lines that follow are indented,
+they are treated as continuations of that entry. Leading whitespace is
+removed from values. Empty lines are skipped. Lines beginning with
+``#`` or ``;`` are ignored and may be used to provide comments.
+
+Configuration keys can be set multiple times, in which case Mercurial
+will use the value that was configured last. As an example::
+
+    [spam]
+    eggs=large
+    ham=serrano
+    eggs=small
+
+This would set the configuration key named ``eggs`` to ``small``.
+
+It is also possible to define a section multiple times. A section can
+be redefined on the same and/or on different configuration files. For
+example::
+
+    [foo]
+    eggs=large
+    ham=serrano
+    eggs=small
+
+    [bar]
+    eggs=ham
+    green=
+       eggs
+
+    [foo]
+    ham=prosciutto
+    eggs=medium
+    bread=toasted
+
+This would set the ``eggs``, ``ham``, and ``bread`` configuration keys
+of the ``foo`` section to ``medium``, ``prosciutto``, and ``toasted``,
+respectively. As you can see there only thing that matters is the last
+value that was set for each of the configuration keys.
+
+If a configuration key is set multiple times in different
+configuration files the final value will depend on the order in which
+the different configuration files are read, with settings from earlier
+paths overriding later ones as described on the ``Files`` section
+above.
+
+A line of the form ``%include file`` will include ``file`` into the
+current configuration file. The inclusion is recursive, which means
+that included files can include other files. Filenames are relative to
+the configuration file in which the ``%include`` directive is found.
+Environment variables and ``~user`` constructs are expanded in
+``file``. This lets you do something like::
+
+  %include ~/.hgrc.d/$HOST.rc
+
+to include a different configuration file on each computer you use.
+
+A line with ``%unset name`` will remove ``name`` from the current
+section, if it has been set previously.
+
+The values are either free-form text strings, lists of text strings,
+or Boolean values. Boolean values can be set to true using any of "1",
+"yes", "true", or "on" and to false using "0", "no", "false", or "off"
+(all case insensitive).
+
+List values are separated by whitespace or comma, except when values are
+placed in double quotation marks::
+
+  allow_read = "John Doe, PhD", brian, betty
+
+Quotation marks can be escaped by prefixing them with a backslash. Only
+quotation marks at the beginning of a word is counted as a quotation
+(e.g., ``foo"bar baz`` is the list of ``foo"bar`` and ``baz``).
+
+Sections
+========
+
+This section describes the different sections that may appear in a
+Mercurial configuration file, the purpose of each section, its possible
+keys, and their possible values.
+
+``alias``
+---------
+
+Defines command aliases.
+
+Aliases allow you to define your own commands in terms of other
+commands (or aliases), optionally including arguments. Positional
+arguments in the form of ``$1``, ``$2``, etc. in the alias definition
+are expanded by Mercurial before execution. Positional arguments not
+already used by ``$N`` in the definition are put at the end of the
+command to be executed.
+
+Alias definitions consist of lines of the form::
+
+    <alias> = <command> [<argument>]...
+
+For example, this definition::
+
+    latest = log --limit 5
+
+creates a new command ``latest`` that shows only the five most recent
+changesets. You can define subsequent aliases using earlier ones::
+
+    stable5 = latest -b stable
+
+.. note::
+
+   It is possible to create aliases with the same names as
+   existing commands, which will then override the original
+   definitions. This is almost always a bad idea!
+
+An alias can start with an exclamation point (``!``) to make it a
+shell alias. A shell alias is executed with the shell and will let you
+run arbitrary commands. As an example, ::
+
+   echo = !echo $@
+
+will let you do ``hg echo foo`` to have ``foo`` printed in your
+terminal. A better example might be::
+
+   purge = !$HG status --no-status --unknown -0 re: | xargs -0 rm -f
+
+which will make ``hg purge`` delete all unknown files in the
+repository in the same manner as the purge extension.
+
+Positional arguments like ``$1``, ``$2``, etc. in the alias definition
+expand to the command arguments. Unmatched arguments are
+removed. ``$0`` expands to the alias name and ``$@`` expands to all
+arguments separated by a space. ``"$@"`` (with quotes) expands to all
+arguments quoted individually and separated by a space. These expansions
+happen before the command is passed to the shell.
+
+Shell aliases are executed in an environment where ``$HG`` expands to
+the path of the Mercurial that was used to execute the alias. This is
+useful when you want to call further Mercurial commands in a shell
+alias, as was done above for the purge alias. In addition,
+``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
+echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
+
+.. note::
+
+   Some global configuration options such as ``-R`` are
+   processed before shell aliases and will thus not be passed to
+   aliases.
+
+
+``annotate``
+------------
+
+Settings used when displaying file annotations. All values are
+Booleans and default to False. See :hg:`help config.diff` for
+related options for the diff command.
+
+``ignorews``
+    Ignore white space when comparing lines.
+
+``ignorewseol``
+    Ignore white space at the end of a line when comparing lines.
+
+``ignorewsamount``
+    Ignore changes in the amount of white space.
+
+``ignoreblanklines``
+    Ignore changes whose lines are all blank.
+
+
+``auth``
+--------
+
+Authentication credentials and other authentication-like configuration
+for HTTP connections. This section allows you to store usernames and
+passwords for use when logging *into* HTTP servers. See
+:hg:`help config.web` if you want to configure *who* can login to
+your HTTP server.
+
+The following options apply to all hosts.
+
+``cookiefile``
+    Path to a file containing HTTP cookie lines. Cookies matching a
+    host will be sent automatically.
+
+    The file format uses the Mozilla cookies.txt format, which defines cookies
+    on their own lines. Each line contains 7 fields delimited by the tab
+    character (domain, is_domain_cookie, path, is_secure, expires, name,
+    value). For more info, do an Internet search for "Netscape cookies.txt
+    format."
+
+    Note: the cookies parser does not handle port numbers on domains. You
+    will need to remove ports from the domain for the cookie to be recognized.
+    This could result in a cookie being disclosed to an unwanted server.
+
+    The cookies file is read-only.
+
+Other options in this section are grouped by name and have the following
+format::
+
+    <name>.<argument> = <value>
+
+where ``<name>`` is used to group arguments into authentication
+entries. Example::
+
+    foo.prefix = hg.intevation.de/mercurial
+    foo.username = foo
+    foo.password = bar
+    foo.schemes = http https
+
+    bar.prefix = secure.example.org
+    bar.key = path/to/file.key
+    bar.cert = path/to/file.cert
+    bar.schemes = https
+
+Supported arguments:
+
+``prefix``
+    Either ``*`` or a URI prefix with or without the scheme part.
+    The authentication entry with the longest matching prefix is used
+    (where ``*`` matches everything and counts as a match of length
+    1). If the prefix doesn't include a scheme, the match is performed
+    against the URI with its scheme stripped as well, and the schemes
+    argument, q.v., is then subsequently consulted.
+
+``username``
+    Optional. Username to authenticate with. If not given, and the
+    remote site requires basic or digest authentication, the user will
+    be prompted for it. Environment variables are expanded in the
+    username letting you do ``foo.username = $USER``. If the URI
+    includes a username, only ``[auth]`` entries with a matching
+    username or without a username will be considered.
+
+``password``
+    Optional. Password to authenticate with. If not given, and the
+    remote site requires basic or digest authentication, the user
+    will be prompted for it.
+
+``key``
+    Optional. PEM encoded client certificate key file. Environment
+    variables are expanded in the filename.
+
+``cert``
+    Optional. PEM encoded client certificate chain file. Environment
+    variables are expanded in the filename.
+
+``schemes``
+    Optional. Space separated list of URI schemes to use this
+    authentication entry with. Only used if the prefix doesn't include
+    a scheme. Supported schemes are http and https. They will match
+    static-http and static-https respectively, as well.
+    (default: https)
+
+If no suitable authentication entry is found, the user is prompted
+for credentials as usual if required by the remote.
+
+``color``
+---------
+
+Configure the Mercurial color mode. For details about how to define your custom
+effect and style see :hg:`help color`.
+
+``mode``
+    String: control the method used to output color. One of ``auto``, ``ansi``,
+    ``win32``, ``terminfo`` or ``debug``. In auto mode, Mercurial will
+    use ANSI mode by default (or win32 mode prior to Windows 10) if it detects a
+    terminal. Any invalid value will disable color.
+
+``pagermode``
+    String: optional override of ``color.mode`` used with pager.
+
+    On some systems, terminfo mode may cause problems when using
+    color with ``less -R`` as a pager program. less with the -R option
+    will only display ECMA-48 color codes, and terminfo mode may sometimes
+    emit codes that less doesn't understand. You can work around this by
+    either using ansi mode (or auto mode), or by using less -r (which will
+    pass through all terminal control codes, not just color control
+    codes).
+
+    On some systems (such as MSYS in Windows), the terminal may support
+    a different color mode than the pager program.
+
+``commands``
+------------
+
+``commit.post-status``
+    Show status of files in the working directory after successful commit.
+    (default: False)
+
+``push.require-revs``
+    Require revisions to push be specified using one or more mechanisms such as
+    specifying them positionally on the command line, using ``-r``, ``-b``,
+    and/or ``-B`` on the command line, or using ``paths.<path>:pushrev`` in the
+    configuration. If this is enabled and revisions are not specified, the
+    command aborts.
+    (default: False)
+
+``resolve.confirm``
+    Confirm before performing action if no filename is passed.
+    (default: False)
+
+``resolve.explicit-re-merge``
+    Require uses of ``hg resolve`` to specify which action it should perform,
+    instead of re-merging files by default.
+    (default: False)
+
+``resolve.mark-check``
+    Determines what level of checking :hg:`resolve --mark` will perform before
+    marking files as resolved. Valid values are ``none`, ``warn``, and
+    ``abort``. ``warn`` will output a warning listing the file(s) that still
+    have conflict markers in them, but will still mark everything resolved.
+    ``abort`` will output the same warning but will not mark things as resolved.
+    If --all is passed and this is set to ``abort``, only a warning will be
+    shown (an error will not be raised).
+    (default: ``none``)
+
+``status.relative``
+    Make paths in :hg:`status` output relative to the current directory.
+    (default: False)
+
+``status.terse``
+    Default value for the --terse flag, which condenses status output.
+    (default: empty)
+
+``update.check``
+    Determines what level of checking :hg:`update` will perform before moving
+    to a destination revision. Valid values are ``abort``, ``none``,
+    ``linear``, and ``noconflict``. ``abort`` always fails if the working
+    directory has uncommitted changes. ``none`` performs no checking, and may
+    result in a merge with uncommitted changes. ``linear`` allows any update
+    as long as it follows a straight line in the revision history, and may
+    trigger a merge with uncommitted changes. ``noconflict`` will allow any
+    update which would not trigger a merge with uncommitted changes, if any
+    are present.
+    (default: ``linear``)
+
+``update.requiredest``
+    Require that the user pass a destination when running :hg:`update`.
+    For example, :hg:`update .::` will be allowed, but a plain :hg:`update`
+    will be disallowed.
+    (default: False)
+
+``committemplate``
+------------------
+
+``changeset``
+    String: configuration in this section is used as the template to
+    customize the text shown in the editor when committing.
+
+In addition to pre-defined template keywords, commit log specific one
+below can be used for customization:
+
+``extramsg``
+    String: Extra message (typically 'Leave message empty to abort
+    commit.'). This may be changed by some commands or extensions.
+
+For example, the template configuration below shows as same text as
+one shown by default::
+
+    [committemplate]
+    changeset = {desc}\n\n
+        HG: Enter commit message.  Lines beginning with 'HG:' are removed.
+        HG: {extramsg}
+        HG: --
+        HG: user: {author}\n{ifeq(p2rev, "-1", "",
+       "HG: branch merge\n")
+       }HG: branch '{branch}'\n{if(activebookmark,
+       "HG: bookmark '{activebookmark}'\n")   }{subrepos %
+       "HG: subrepo {subrepo}\n"              }{file_adds %
+       "HG: added {file}\n"                   }{file_mods %
+       "HG: changed {file}\n"                 }{file_dels %
+       "HG: removed {file}\n"                 }{if(files, "",
+       "HG: no files changed\n")}
+
+``diff()``
+    String: show the diff (see :hg:`help templates` for detail)
+
+Sometimes it is helpful to show the diff of the changeset in the editor without
+having to prefix 'HG: ' to each line so that highlighting works correctly. For
+this, Mercurial provides a special string which will ignore everything below
+it::
+
+     HG: ------------------------ >8 ------------------------
+
+For example, the template configuration below will show the diff below the
+extra message::
+
+    [committemplate]
+    changeset = {desc}\n\n
+        HG: Enter commit message.  Lines beginning with 'HG:' are removed.
+        HG: {extramsg}
+        HG: ------------------------ >8 ------------------------
+        HG: Do not touch the line above.
+        HG: Everything below will be removed.
+        {diff()}
+
+.. note::
+
+   For some problematic encodings (see :hg:`help win32mbcs` for
+   detail), this customization should be configured carefully, to
+   avoid showing broken characters.
+
+   For example, if a multibyte character ending with backslash (0x5c) is
+   followed by the ASCII character 'n' in the customized template,
+   the sequence of backslash and 'n' is treated as line-feed unexpectedly
+   (and the multibyte character is broken, too).
+
+Customized template is used for commands below (``--edit`` may be
+required):
+
+- :hg:`backout`
+- :hg:`commit`
+- :hg:`fetch` (for merge commit only)
+- :hg:`graft`
+- :hg:`histedit`
+- :hg:`import`
+- :hg:`qfold`, :hg:`qnew` and :hg:`qrefresh`
+- :hg:`rebase`
+- :hg:`shelve`
+- :hg:`sign`
+- :hg:`tag`
+- :hg:`transplant`
+
+Configuring items below instead of ``changeset`` allows showing
+customized message only for specific actions, or showing different
+messages for each action.
+
+- ``changeset.backout`` for :hg:`backout`
+- ``changeset.commit.amend.merge`` for :hg:`commit --amend` on merges
+- ``changeset.commit.amend.normal`` for :hg:`commit --amend` on other
+- ``changeset.commit.normal.merge`` for :hg:`commit` on merges
+- ``changeset.commit.normal.normal`` for :hg:`commit` on other
+- ``changeset.fetch`` for :hg:`fetch` (impling merge commit)
+- ``changeset.gpg.sign`` for :hg:`sign`
+- ``changeset.graft`` for :hg:`graft`
+- ``changeset.histedit.edit`` for ``edit`` of :hg:`histedit`
+- ``changeset.histedit.fold`` for ``fold`` of :hg:`histedit`
+- ``changeset.histedit.mess`` for ``mess`` of :hg:`histedit`
+- ``changeset.histedit.pick`` for ``pick`` of :hg:`histedit`
+- ``changeset.import.bypass`` for :hg:`import --bypass`
+- ``changeset.import.normal.merge`` for :hg:`import` on merges
+- ``changeset.import.normal.normal`` for :hg:`import` on other
+- ``changeset.mq.qnew`` for :hg:`qnew`
+- ``changeset.mq.qfold`` for :hg:`qfold`
+- ``changeset.mq.qrefresh`` for :hg:`qrefresh`
+- ``changeset.rebase.collapse`` for :hg:`rebase --collapse`
+- ``changeset.rebase.merge`` for :hg:`rebase` on merges
+- ``changeset.rebase.normal`` for :hg:`rebase` on other
+- ``changeset.shelve.shelve`` for :hg:`shelve`
+- ``changeset.tag.add`` for :hg:`tag` without ``--remove``
+- ``changeset.tag.remove`` for :hg:`tag --remove`
+- ``changeset.transplant.merge`` for :hg:`transplant` on merges
+- ``changeset.transplant.normal`` for :hg:`transplant` on other
+
+These dot-separated lists of names are treated as hierarchical ones.
+For example, ``changeset.tag.remove`` customizes the commit message
+only for :hg:`tag --remove`, but ``changeset.tag`` customizes the
+commit message for :hg:`tag` regardless of ``--remove`` option.
+
+When the external editor is invoked for a commit, the corresponding
+dot-separated list of names without the ``changeset.`` prefix
+(e.g. ``commit.normal.normal``) is in the ``HGEDITFORM`` environment
+variable.
+
+In this section, items other than ``changeset`` can be referred from
+others. For example, the configuration to list committed files up
+below can be referred as ``{listupfiles}``::
+
+    [committemplate]
+    listupfiles = {file_adds %
+       "HG: added {file}\n"     }{file_mods %
+       "HG: changed {file}\n"   }{file_dels %
+       "HG: removed {file}\n"   }{if(files, "",
+       "HG: no files changed\n")}
+
+``decode/encode``
+-----------------
+
+Filters for transforming files on checkout/checkin. This would
+typically be used for newline processing or other
+localization/canonicalization of files.
+
+Filters consist of a filter pattern followed by a filter command.
+Filter patterns are globs by default, rooted at the repository root.
+For example, to match any file ending in ``.txt`` in the root
+directory only, use the pattern ``*.txt``. To match any file ending
+in ``.c`` anywhere in the repository, use the pattern ``**.c``.
+For each file only the first matching filter applies.
+
+The filter command can start with a specifier, either ``pipe:`` or
+``tempfile:``. If no specifier is given, ``pipe:`` is used by default.
+
+A ``pipe:`` command must accept data on stdin and return the transformed
+data on stdout.
+
+Pipe example::
+
+  [encode]
+  # uncompress gzip files on checkin to improve delta compression
+  # note: not necessarily a good idea, just an example
+  *.gz = pipe: gunzip
+
+  [decode]
+  # recompress gzip files when writing them to the working dir (we
+  # can safely omit "pipe:", because it's the default)
+  *.gz = gzip
+
+A ``tempfile:`` command is a template. The string ``INFILE`` is replaced
+with the name of a temporary file that contains the data to be
+filtered by the command. The string ``OUTFILE`` is replaced with the name
+of an empty temporary file, where the filtered data must be written by
+the command.
+
+.. container:: windows
+
+   .. note::
+
+     The tempfile mechanism is recommended for Windows systems,
+     where the standard shell I/O redirection operators often have
+     strange effects and may corrupt the contents of your files.
+
+This filter mechanism is used internally by the ``eol`` extension to
+translate line ending characters between Windows (CRLF) and Unix (LF)
+format. We suggest you use the ``eol`` extension for convenience.
+
+
+``defaults``
+------------
+
+(defaults are deprecated. Don't use them. Use aliases instead.)
+
+Use the ``[defaults]`` section to define command defaults, i.e. the
+default options/arguments to pass to the specified commands.
+
+The following example makes :hg:`log` run in verbose mode, and
+:hg:`status` show only the modified files, by default::
+
+  [defaults]
+  log = -v
+  status = -m
+
+The actual commands, instead of their aliases, must be used when
+defining command defaults. The command defaults will also be applied
+to the aliases of the commands defined.
+
+
+``diff``
+--------
+
+Settings used when displaying diffs. Everything except for ``unified``
+is a Boolean and defaults to False. See :hg:`help config.annotate`
+for related options for the annotate command.
+
+``git``
+    Use git extended diff format.
+
+``nobinary``
+    Omit git binary patches.
+
+``nodates``
+    Don't include dates in diff headers.
+
+``noprefix``
+    Omit 'a/' and 'b/' prefixes from filenames. Ignored in plain mode.
+
+``showfunc``
+    Show which function each change is in.
+
+``ignorews``
+    Ignore white space when comparing lines.
+
+``ignorewsamount``
+    Ignore changes in the amount of white space.
+
+``ignoreblanklines``
+    Ignore changes whose lines are all blank.
+
+``unified``
+    Number of lines of context to show.
+
+``word-diff``
+    Highlight changed words.
+
+``email``
+---------
+
+Settings for extensions that send email messages.
+
+``from``
+    Optional. Email address to use in "From" header and SMTP envelope
+    of outgoing messages.
+
+``to``
+    Optional. Comma-separated list of recipients' email addresses.
+
+``cc``
+    Optional. Comma-separated list of carbon copy recipients'
+    email addresses.
+
+``bcc``
+    Optional. Comma-separated list of blind carbon copy recipients'
+    email addresses.
+
+``method``
+    Optional. Method to use to send email messages. If value is ``smtp``
+    (default), use SMTP (see the ``[smtp]`` section for configuration).
+    Otherwise, use as name of program to run that acts like sendmail
+    (takes ``-f`` option for sender, list of recipients on command line,
+    message on stdin). Normally, setting this to ``sendmail`` or
+    ``/usr/sbin/sendmail`` is enough to use sendmail to send messages.
+
+``charsets``
+    Optional. Comma-separated list of character sets considered
+    convenient for recipients. Addresses, headers, and parts not
+    containing patches of outgoing messages will be encoded in the
+    first character set to which conversion from local encoding
+    (``$HGENCODING``, ``ui.fallbackencoding``) succeeds. If correct
+    conversion fails, the text in question is sent as is.
+    (default: '')
+
+    Order of outgoing email character sets:
+
+    1. ``us-ascii``: always first, regardless of settings
+    2. ``email.charsets``: in order given by user
+    3. ``ui.fallbackencoding``: if not in email.charsets
+    4. ``$HGENCODING``: if not in email.charsets
+    5. ``utf-8``: always last, regardless of settings
+
+Email example::
+
+  [email]
+  from = Joseph User <joe.user@example.com>
+  method = /usr/sbin/sendmail
+  # charsets for western Europeans
+  # us-ascii, utf-8 omitted, as they are tried first and last
+  charsets = iso-8859-1, iso-8859-15, windows-1252
+
+
+``extensions``
+--------------
+
+Mercurial has an extension mechanism for adding new features. To
+enable an extension, create an entry for it in this section.
+
+If you know that the extension is already in Python's search path,
+you can give the name of the module, followed by ``=``, with nothing
+after the ``=``.
+
+Otherwise, give a name that you choose, followed by ``=``, followed by
+the path to the ``.py`` file (including the file name extension) that
+defines the extension.
+
+To explicitly disable an extension that is enabled in an hgrc of
+broader scope, prepend its path with ``!``, as in ``foo = !/ext/path``
+or ``foo = !`` when path is not supplied.
+
+Example for ``~/.hgrc``::
+
+  [extensions]
+  # (the churn extension will get loaded from Mercurial's path)
+  churn =
+  # (this extension will get loaded from the file specified)
+  myfeature = ~/.hgext/myfeature.py
+
+
+``format``
+----------
+
+Configuration that controls the repository format. Newer format options are more
+powerful but incompatible with some older versions of Mercurial. Format options
+are considered at repository initialization only. You need to make a new clone
+for config change to be taken into account.
+
+For more details about repository format and version compatibility, see
+https://www.mercurial-scm.org/wiki/MissingRequirement
+
+``usegeneraldelta``
+    Enable or disable the "generaldelta" repository format which improves
+    repository compression by allowing "revlog" to store delta against arbitrary
+    revision instead of the previous stored one. This provides significant
+    improvement for repositories with branches.
+
+    Repositories with this on-disk format require Mercurial version 1.9.
+
+    Enabled by default.
+
+``dotencode``
+    Enable or disable the "dotencode" repository format which enhances
+    the "fncache" repository format (which has to be enabled to use
+    dotencode) to avoid issues with filenames starting with ._ on
+    Mac OS X and spaces on Windows.
+
+    Repositories with this on-disk format require Mercurial version 1.7.
+
+    Enabled by default.
+
+``usefncache``
+    Enable or disable the "fncache" repository format which enhances
+    the "store" repository format (which has to be enabled to use
+    fncache) to allow longer filenames and avoids using Windows
+    reserved names, e.g. "nul".
+
+    Repositories with this on-disk format require Mercurial version 1.1.
+
+    Enabled by default.
+
+``usestore``
+    Enable or disable the "store" repository format which improves
+    compatibility with systems that fold case or otherwise mangle
+    filenames. Disabling this option will allow you to store longer filenames
+    in some situations at the expense of compatibility.
+
+    Repositories with this on-disk format require Mercurial version 0.9.4.
+
+    Enabled by default.
+
+``sparse-revlog``
+    Enable or disable the ``sparse-revlog`` delta strategy. This format improves
+    delta re-use inside revlog. For very branchy repositories, it results in a
+    smaller store. For repositories with many revisions, it also helps
+    performance (by using shortened delta chains.)
+
+    Repositories with this on-disk format require Mercurial version 4.7
+
+    Enabled by default.
+
+``revlog-compression``
+    Compression algorithm used by revlog. Supported value are `zlib` and `zstd`.
+    The `zlib` engine is the historical default of Mercurial. `zstd` is a newer
+    format that is usually a net win over `zlib` operating faster at better
+    compression rate. Use `zstd` to reduce CPU usage.
+
+    On some system, Mercurial installation may lack `zstd` supports. Default is `zlib`.
+
+``bookmarks-in-store``
+    Store bookmarks in .hg/store/. This means that bookmarks are shared when
+    using `hg share` regardless of the `-B` option.
+
+    Repositories with this on-disk format require Mercurial version 5.1.
+
+    Disabled by default.
+
+
+``graph``
+---------
+
+Web graph view configuration. This section let you change graph
+elements display properties by branches, for instance to make the
+``default`` branch stand out.
+
+Each line has the following format::
+
+    <branch>.<argument> = <value>
+
+where ``<branch>`` is the name of the branch being
+customized. Example::
+
+    [graph]
+    # 2px width
+    default.width = 2
+    # red color
+    default.color = FF0000
+
+Supported arguments:
+
+``width``
+    Set branch edges width in pixels.
+
+``color``
+    Set branch edges color in hexadecimal RGB notation.
+
+``hooks``
+---------
+
+Commands or Python functions that get automatically executed by
+various actions such as starting or finishing a commit. Multiple
+hooks can be run for the same action by appending a suffix to the
+action. Overriding a site-wide hook can be done by changing its
+value or setting it to an empty string.  Hooks can be prioritized
+by adding a prefix of ``priority.`` to the hook name on a new line
+and setting the priority. The default priority is 0.
+
+Example ``.hg/hgrc``::
+
+  [hooks]
+  # update working directory after adding changesets
+  changegroup.update = hg update
+  # do not use the site-wide hook
+  incoming =
+  incoming.email = /my/email/hook
+  incoming.autobuild = /my/build/hook
+  # force autobuild hook to run before other incoming hooks
+  priority.incoming.autobuild = 1
+
+Most hooks are run with environment variables set that give useful
+additional information. For each hook below, the environment variables
+it is passed are listed with names in the form ``$HG_foo``. The
+``$HG_HOOKTYPE`` and ``$HG_HOOKNAME`` variables are set for all hooks.
+They contain the type of hook which triggered the run and the full name
+of the hook in the config, respectively. In the example above, this will
+be ``$HG_HOOKTYPE=incoming`` and ``$HG_HOOKNAME=incoming.email``.
+
+.. container:: windows
+
+  Some basic Unix syntax can be enabled for portability, including ``$VAR``
+  and ``${VAR}`` style variables.  A ``~`` followed by ``\`` or ``/`` will
+  be expanded to ``%USERPROFILE%`` to simulate a subset of tilde expansion
+  on Unix.  To use a literal ``$`` or ``~``, it must be escaped with a back
+  slash or inside of a strong quote.  Strong quotes will be replaced by
+  double quotes after processing.
+
+  This feature is enabled by adding a prefix of ``tonative.`` to the hook
+  name on a new line, and setting it to ``True``.  For example::
+
+    [hooks]
+    incoming.autobuild = /my/build/hook
+    # enable translation to cmd.exe syntax for autobuild hook
+    tonative.incoming.autobuild = True
+
+``changegroup``
+  Run after a changegroup has been added via push, pull or unbundle.  The ID of
+  the first new changeset is in ``$HG_NODE`` and last is in ``$HG_NODE_LAST``.
+  The URL from which changes came is in ``$HG_URL``.
+
+``commit``
+  Run after a changeset has been created in the local repository. The ID
+  of the newly created changeset is in ``$HG_NODE``. Parent changeset
+  IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
+
+``incoming``
+  Run after a changeset has been pulled, pushed, or unbundled into
+  the local repository. The ID of the newly arrived changeset is in
+  ``$HG_NODE``. The URL that was source of the changes is in ``$HG_URL``.
+
+``outgoing``
+  Run after sending changes from the local repository to another. The ID of
+  first changeset sent is in ``$HG_NODE``. The source of operation is in
+  ``$HG_SOURCE``. Also see :hg:`help config.hooks.preoutgoing`.
+
+``post-<command>``
+  Run after successful invocations of the associated command. The
+  contents of the command line are passed as ``$HG_ARGS`` and the result
+  code in ``$HG_RESULT``. Parsed command line arguments are passed as
+  ``$HG_PATS`` and ``$HG_OPTS``. These contain string representations of
+  the python data internally passed to <command>. ``$HG_OPTS`` is a
+  dictionary of options (with unspecified options set to their defaults).
+  ``$HG_PATS`` is a list of arguments. Hook failure is ignored.
+
+``fail-<command>``
+  Run after a failed invocation of an associated command. The contents
+  of the command line are passed as ``$HG_ARGS``. Parsed command line
+  arguments are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain
+  string representations of the python data internally passed to
+  <command>. ``$HG_OPTS`` is a dictionary of options (with unspecified
+  options set to their defaults). ``$HG_PATS`` is a list of arguments.
+  Hook failure is ignored.
+
+``pre-<command>``
+  Run before executing the associated command. The contents of the
+  command line are passed as ``$HG_ARGS``. Parsed command line arguments
+  are passed as ``$HG_PATS`` and ``$HG_OPTS``. These contain string
+  representations of the data internally passed to <command>. ``$HG_OPTS``
+  is a dictionary of options (with unspecified options set to their
+  defaults). ``$HG_PATS`` is a list of arguments. If the hook returns
+  failure, the command doesn't execute and Mercurial returns the failure
+  code.
+
+``prechangegroup``
+  Run before a changegroup is added via push, pull or unbundle. Exit
+  status 0 allows the changegroup to proceed. A non-zero status will
+  cause the push, pull or unbundle to fail. The URL from which changes
+  will come is in ``$HG_URL``.
+
+``precommit``
+  Run before starting a local commit. Exit status 0 allows the
+  commit to proceed. A non-zero status will cause the commit to fail.
+  Parent changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
+
+``prelistkeys``
+  Run before listing pushkeys (like bookmarks) in the
+  repository. A non-zero status will cause failure. The key namespace is
+  in ``$HG_NAMESPACE``.
+
+``preoutgoing``
+  Run before collecting changes to send from the local repository to
+  another. A non-zero status will cause failure. This lets you prevent
+  pull over HTTP or SSH. It can also prevent propagating commits (via
+  local pull, push (outbound) or bundle commands), but not completely,
+  since you can just copy files instead. The source of operation is in
+  ``$HG_SOURCE``. If "serve", the operation is happening on behalf of a remote
+  SSH or HTTP repository. If "push", "pull" or "bundle", the operation
+  is happening on behalf of a repository on same system.
+
+``prepushkey``
+  Run before a pushkey (like a bookmark) is added to the
+  repository. A non-zero status will cause the key to be rejected. The
+  key namespace is in ``$HG_NAMESPACE``, the key is in ``$HG_KEY``,
+  the old value (if any) is in ``$HG_OLD``, and the new value is in
+  ``$HG_NEW``.
+
+``pretag``
+  Run before creating a tag. Exit status 0 allows the tag to be
+  created. A non-zero status will cause the tag to fail. The ID of the
+  changeset to tag is in ``$HG_NODE``. The name of tag is in ``$HG_TAG``. The
+  tag is local if ``$HG_LOCAL=1``, or in the repository if ``$HG_LOCAL=0``.
+
+``pretxnopen``
+  Run before any new repository transaction is open. The reason for the
+  transaction will be in ``$HG_TXNNAME``, and a unique identifier for the
+  transaction will be in ``HG_TXNID``. A non-zero status will prevent the
+  transaction from being opened.
+
+``pretxnclose``
+  Run right before the transaction is actually finalized. Any repository change
+  will be visible to the hook program. This lets you validate the transaction
+  content or change it. Exit status 0 allows the commit to proceed. A non-zero
+  status will cause the transaction to be rolled back. The reason for the
+  transaction opening will be in ``$HG_TXNNAME``, and a unique identifier for
+  the transaction will be in ``HG_TXNID``. The rest of the available data will
+  vary according the transaction type. New changesets will add ``$HG_NODE``
+  (the ID of the first added changeset), ``$HG_NODE_LAST`` (the ID of the last
+  added changeset), ``$HG_URL`` and ``$HG_SOURCE`` variables.  Bookmark and
+  phase changes will set ``HG_BOOKMARK_MOVED`` and ``HG_PHASES_MOVED`` to ``1``
+  respectively, etc.
+
+``pretxnclose-bookmark``
+  Run right before a bookmark change is actually finalized. Any repository
+  change will be visible to the hook program. This lets you validate the
+  transaction content or change it. Exit status 0 allows the commit to
+  proceed. A non-zero status will cause the transaction to be rolled back.
+  The name of the bookmark will be available in ``$HG_BOOKMARK``, the new
+  bookmark location will be available in ``$HG_NODE`` while the previous
+  location will be available in ``$HG_OLDNODE``. In case of a bookmark
+  creation ``$HG_OLDNODE`` will be empty. In case of deletion ``$HG_NODE``
+  will be empty.
+  In addition, the reason for the transaction opening will be in
+  ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
+  ``HG_TXNID``.
+
+``pretxnclose-phase``
+  Run right before a phase change is actually finalized. Any repository change
+  will be visible to the hook program. This lets you validate the transaction
+  content or change it. Exit status 0 allows the commit to proceed.  A non-zero
+  status will cause the transaction to be rolled back. The hook is called
+  multiple times, once for each revision affected by a phase change.
+  The affected node is available in ``$HG_NODE``, the phase in ``$HG_PHASE``
+  while the previous ``$HG_OLDPHASE``. In case of new node, ``$HG_OLDPHASE``
+  will be empty.  In addition, the reason for the transaction opening will be in
+  ``$HG_TXNNAME``, and a unique identifier for the transaction will be in
+  ``HG_TXNID``. The hook is also run for newly added revisions. In this case
+  the ``$HG_OLDPHASE`` entry will be empty.
+
+``txnclose``
+  Run after any repository transaction has been committed. At this
+  point, the transaction can no longer be rolled back. The hook will run
+  after the lock is released. See :hg:`help config.hooks.pretxnclose` for
+  details about available variables.
+
+``txnclose-bookmark``
+  Run after any bookmark change has been committed. At this point, the
+  transaction can no longer be rolled back. The hook will run after the lock
+  is released. See :hg:`help config.hooks.pretxnclose-bookmark` for details
+  about available variables.
+
+``txnclose-phase``
+  Run after any phase change has been committed. At this point, the
+  transaction can no longer be rolled back. The hook will run after the lock
+  is released. See :hg:`help config.hooks.pretxnclose-phase` for details about
+  available variables.
+
+``txnabort``
+  Run when a transaction is aborted. See :hg:`help config.hooks.pretxnclose`
+  for details about available variables.
+
+``pretxnchangegroup``
+  Run after a changegroup has been added via push, pull or unbundle, but before
+  the transaction has been committed. The changegroup is visible to the hook
+  program. This allows validation of incoming changes before accepting them.
+  The ID of the first new changeset is in ``$HG_NODE`` and last is in
+  ``$HG_NODE_LAST``. Exit status 0 allows the transaction to commit. A non-zero
+  status will cause the transaction to be rolled back, and the push, pull or
+  unbundle will fail. The URL that was the source of changes is in ``$HG_URL``.
+
+``pretxncommit``
+  Run after a changeset has been created, but before the transaction is
+  committed. The changeset is visible to the hook program. This allows
+  validation of the commit message and changes. Exit status 0 allows the
+  commit to proceed. A non-zero status will cause the transaction to
+  be rolled back. The ID of the new changeset is in ``$HG_NODE``. The parent
+  changeset IDs are in ``$HG_PARENT1`` and ``$HG_PARENT2``.
+
+``preupdate``
+  Run before updating the working directory. Exit status 0 allows
+  the update to proceed. A non-zero status will prevent the update.
+  The changeset ID of first new parent is in ``$HG_PARENT1``. If updating to a
+  merge, the ID of second new parent is in ``$HG_PARENT2``.
+
+``listkeys``
+  Run after listing pushkeys (like bookmarks) in the repository. The
+  key namespace is in ``$HG_NAMESPACE``. ``$HG_VALUES`` is a
+  dictionary containing the keys and values.
+
+``pushkey``
+  Run after a pushkey (like a bookmark) is added to the
+  repository. The key namespace is in ``$HG_NAMESPACE``, the key is in
+  ``$HG_KEY``, the old value (if any) is in ``$HG_OLD``, and the new
+  value is in ``$HG_NEW``.
+
+``tag``
+  Run after a tag is created. The ID of the tagged changeset is in ``$HG_NODE``.
+  The name of tag is in ``$HG_TAG``. The tag is local if ``$HG_LOCAL=1``, or in
+  the repository if ``$HG_LOCAL=0``.
+
+``update``
+  Run after updating the working directory. The changeset ID of first
+  new parent is in ``$HG_PARENT1``. If updating to a merge, the ID of second new
+  parent is in ``$HG_PARENT2``. If the update succeeded, ``$HG_ERROR=0``. If the
+  update failed (e.g. because conflicts were not resolved), ``$HG_ERROR=1``.
+
+.. note::
+
+   It is generally better to use standard hooks rather than the
+   generic pre- and post- command hooks, as they are guaranteed to be
+   called in the appropriate contexts for influencing transactions.
+   Also, hooks like "commit" will be called in all contexts that
+   generate a commit (e.g. tag) and not just the commit command.
+
+.. note::
+
+   Environment variables with empty values may not be passed to
+   hooks on platforms such as Windows. As an example, ``$HG_PARENT2``
+   will have an empty value under Unix-like platforms for non-merge
+   changesets, while it will not be available at all under Windows.
+
+The syntax for Python hooks is as follows::
+
+  hookname = python:modulename.submodule.callable
+  hookname = python:/path/to/python/module.py:callable
+
+Python hooks are run within the Mercurial process. Each hook is
+called with at least three keyword arguments: a ui object (keyword
+``ui``), a repository object (keyword ``repo``), and a ``hooktype``
+keyword that tells what kind of hook is used. Arguments listed as
+environment variables above are passed as keyword arguments, with no
+``HG_`` prefix, and names in lower case.
+
+If a Python hook returns a "true" value or raises an exception, this
+is treated as a failure.
+
+
+``hostfingerprints``
+--------------------
+
+(Deprecated. Use ``[hostsecurity]``'s ``fingerprints`` options instead.)
+
+Fingerprints of the certificates of known HTTPS servers.
+
+A HTTPS connection to a server with a fingerprint configured here will
+only succeed if the servers certificate matches the fingerprint.
+This is very similar to how ssh known hosts works.
+
+The fingerprint is the SHA-1 hash value of the DER encoded certificate.
+Multiple values can be specified (separated by spaces or commas). This can
+be used to define both old and new fingerprints while a host transitions
+to a new certificate.
+
+The CA chain and web.cacerts is not used for servers with a fingerprint.
+
+For example::
+
+    [hostfingerprints]
+    hg.intevation.de = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
+    hg.intevation.org = fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
+
+``hostsecurity``
+----------------
+
+Used to specify global and per-host security settings for connecting to
+other machines.
+
+The following options control default behavior for all hosts.
+
+``ciphers``
+    Defines the cryptographic ciphers to use for connections.
+
+    Value must be a valid OpenSSL Cipher List Format as documented at
+    https://www.openssl.org/docs/manmaster/apps/ciphers.html#CIPHER-LIST-FORMAT.
+
+    This setting is for advanced users only. Setting to incorrect values
+    can significantly lower connection security or decrease performance.
+    You have been warned.
+
+    This option requires Python 2.7.
+
+``minimumprotocol``
+    Defines the minimum channel encryption protocol to use.
+
+    By default, the highest version of TLS supported by both client and server
+    is used.
+
+    Allowed values are: ``tls1.0``, ``tls1.1``, ``tls1.2``.
+
+    When running on an old Python version, only ``tls1.0`` is allowed since
+    old versions of Python only support up to TLS 1.0.
+
+    When running a Python that supports modern TLS versions, the default is
+    ``tls1.1``. ``tls1.0`` can still be used to allow TLS 1.0. However, this
+    weakens security and should only be used as a feature of last resort if
+    a server does not support TLS 1.1+.
+
+Options in the ``[hostsecurity]`` section can have the form
+``hostname``:``setting``. This allows multiple settings to be defined on a
+per-host basis.
+
+The following per-host settings can be defined.
+
+``ciphers``
+    This behaves like ``ciphers`` as described above except it only applies
+    to the host on which it is defined.
+
+``fingerprints``
+    A list of hashes of the DER encoded peer/remote certificate. Values have
+    the form ``algorithm``:``fingerprint``. e.g.
+    ``sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2``.
+    In addition, colons (``:``) can appear in the fingerprint part.
+
+    The following algorithms/prefixes are supported: ``sha1``, ``sha256``,
+    ``sha512``.
+
+    Use of ``sha256`` or ``sha512`` is preferred.
+
+    If a fingerprint is specified, the CA chain is not validated for this
+    host and Mercurial will require the remote certificate to match one
+    of the fingerprints specified. This means if the server updates its
+    certificate, Mercurial will abort until a new fingerprint is defined.
+    This can provide stronger security than traditional CA-based validation
+    at the expense of convenience.
+
+    This option takes precedence over ``verifycertsfile``.
+
+``minimumprotocol``
+    This behaves like ``minimumprotocol`` as described above except it
+    only applies to the host on which it is defined.
+
+``verifycertsfile``
+    Path to file a containing a list of PEM encoded certificates used to
+    verify the server certificate. Environment variables and ``~user``
+    constructs are expanded in the filename.
+
+    The server certificate or the certificate's certificate authority (CA)
+    must match a certificate from this file or certificate verification
+    will fail and connections to the server will be refused.
+
+    If defined, only certificates provided by this file will be used:
+    ``web.cacerts`` and any system/default certificates will not be
+    used.
+
+    This option has no effect if the per-host ``fingerprints`` option
+    is set.
+
+    The format of the file is as follows::
+
+        -----BEGIN CERTIFICATE-----
+        ... (certificate in base64 PEM encoding) ...
+        -----END CERTIFICATE-----
+        -----BEGIN CERTIFICATE-----
+        ... (certificate in base64 PEM encoding) ...
+        -----END CERTIFICATE-----
+
+For example::
+
+    [hostsecurity]
+    hg.example.com:fingerprints = sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2
+    hg2.example.com:fingerprints = sha1:914f1aff87249c09b6859b88b1906d30756491ca, sha1:fc:e2:8d:d9:51:cd:cb:c1:4d:18:6b:b7:44:8d:49:72:57:e6:cd:33
+    hg3.example.com:fingerprints = sha256:9a:b0:dc:e2:75:ad:8a:b7:84:58:e5:1f:07:32:f1:87:e6:bd:24:22:af:b7:ce:8e:9c:b4:10:cf:b9:f4:0e:d2
+    foo.example.com:verifycertsfile = /etc/ssl/trusted-ca-certs.pem
+
+To change the default minimum protocol version to TLS 1.2 but to allow TLS 1.1
+when connecting to ``hg.example.com``::
+
+    [hostsecurity]
+    minimumprotocol = tls1.2
+    hg.example.com:minimumprotocol = tls1.1
+
+``http_proxy``
+--------------
+
+Used to access web-based Mercurial repositories through a HTTP
+proxy.
+
+``host``
+    Host name and (optional) port of the proxy server, for example
+    "myproxy:8000".
+
+``no``
+    Optional. Comma-separated list of host names that should bypass
+    the proxy.
+
+``passwd``
+    Optional. Password to authenticate with at the proxy server.
+
+``user``
+    Optional. User name to authenticate with at the proxy server.
+
+``always``
+    Optional. Always use the proxy, even for localhost and any entries
+    in ``http_proxy.no``. (default: False)
+
+``http``
+----------
+
+Used to configure access to Mercurial repositories via HTTP.
+
+``timeout``
+    If set, blocking operations will timeout after that many seconds.
+    (default: None)
+
+``merge``
+---------
+
+This section specifies behavior during merges and updates.
+
+``checkignored``
+   Controls behavior when an ignored file on disk has the same name as a tracked
+   file in the changeset being merged or updated to, and has different
+   contents. Options are ``abort``, ``warn`` and ``ignore``. With ``abort``,
+   abort on such files. With ``warn``, warn on such files and back them up as
+   ``.orig``. With ``ignore``, don't print a warning and back them up as
+   ``.orig``. (default: ``abort``)
+
+``checkunknown``
+   Controls behavior when an unknown file that isn't ignored has the same name
+   as a tracked file in the changeset being merged or updated to, and has
+   different contents. Similar to ``merge.checkignored``, except for files that
+   are not ignored. (default: ``abort``)
+
+``on-failure``
+   When set to ``continue`` (the default), the merge process attempts to
+   merge all unresolved files using the merge chosen tool, regardless of
+   whether previous file merge attempts during the process succeeded or not.
+   Setting this to ``prompt`` will prompt after any merge failure continue
+   or halt the merge process. Setting this to ``halt`` will automatically
+   halt the merge process on any merge tool failure. The merge process
+   can be restarted by using the ``resolve`` command. When a merge is
+   halted, the repository is left in a normal ``unresolved`` merge state.
+   (default: ``continue``)
+
+``strict-capability-check``
+   Whether capabilities of internal merge tools are checked strictly
+   or not, while examining rules to decide merge tool to be used.
+   (default: False)
+
+``merge-patterns``
+------------------
+
+This section specifies merge tools to associate with particular file
+patterns. Tools matched here will take precedence over the default
+merge tool. Patterns are globs by default, rooted at the repository
+root.
+
+Example::
+
+  [merge-patterns]
+  **.c = kdiff3
+  **.jpg = myimgmerge
+
+``merge-tools``
+---------------
+
+This section configures external merge tools to use for file-level
+merges. This section has likely been preconfigured at install time.
+Use :hg:`config merge-tools` to check the existing configuration.
+Also see :hg:`help merge-tools` for more details.
+
+Example ``~/.hgrc``::
+
+  [merge-tools]
+  # Override stock tool location
+  kdiff3.executable = ~/bin/kdiff3
+  # Specify command line
+  kdiff3.args = $base $local $other -o $output
+  # Give higher priority
+  kdiff3.priority = 1
+
+  # Changing the priority of preconfigured tool
+  meld.priority = 0
+
+  # Disable a preconfigured tool
+  vimdiff.disabled = yes
+
+  # Define new tool
+  myHtmlTool.args = -m $local $other $base $output
+  myHtmlTool.regkey = Software\FooSoftware\HtmlMerge
+  myHtmlTool.priority = 1
+
+Supported arguments:
+
+``priority``
+  The priority in which to evaluate this tool.
+  (default: 0)
+
+``executable``
+  Either just the name of the executable or its pathname.
+
+  .. container:: windows
+
+    On Windows, the path can use environment variables with ${ProgramFiles}
+    syntax.
+
+  (default: the tool name)
+
+``args``
+  The arguments to pass to the tool executable. You can refer to the
+  files being merged as well as the output file through these
+  variables: ``$base``, ``$local``, ``$other``, ``$output``.
+
+  The meaning of ``$local`` and ``$other`` can vary depending on which action is
+  being performed. During an update or merge, ``$local`` represents the original
+  state of the file, while ``$other`` represents the commit you are updating to or
+  the commit you are merging with. During a rebase, ``$local`` represents the
+  destination of the rebase, and ``$other`` represents the commit being rebased.
+
+  Some operations define custom labels to assist with identifying the revisions,
+  accessible via ``$labellocal``, ``$labelother``, and ``$labelbase``. If custom
+  labels are not available, these will be ``local``, ``other``, and ``base``,
+  respectively.
+  (default: ``$local $base $other``)
+
+``premerge``
+  Attempt to run internal non-interactive 3-way merge tool before
+  launching external tool.  Options are ``true``, ``false``, ``keep`` or
+  ``keep-merge3``. The ``keep`` option will leave markers in the file if the
+  premerge fails. The ``keep-merge3`` will do the same but include information
+  about the base of the merge in the marker (see internal :merge3 in
+  :hg:`help merge-tools`).
+  (default: True)
+
+``binary``
+  This tool can merge binary files. (default: False, unless tool
+  was selected by file pattern match)
+
+``symlink``
+  This tool can merge symlinks. (default: False)
+
+``check``
+  A list of merge success-checking options:
+
+  ``changed``
+    Ask whether merge was successful when the merged file shows no changes.
+  ``conflicts``
+    Check whether there are conflicts even though the tool reported success.
+  ``prompt``
+    Always prompt for merge success, regardless of success reported by tool.
+
+``fixeol``
+  Attempt to fix up EOL changes caused by the merge tool.
+  (default: False)
+
+``gui``
+  This tool requires a graphical interface to run. (default: False)
+
+``mergemarkers``
+  Controls whether the labels passed via ``$labellocal``, ``$labelother``, and
+  ``$labelbase`` are ``detailed`` (respecting ``mergemarkertemplate``) or
+  ``basic``. If ``premerge`` is ``keep`` or ``keep-merge3``, the conflict
+  markers generated during premerge will be ``detailed`` if either this option or
+  the corresponding option in the ``[ui]`` section is ``detailed``.
+  (default: ``basic``)
+
+``mergemarkertemplate``
+  This setting can be used to override ``mergemarkertemplate`` from the ``[ui]``
+  section on a per-tool basis; this applies to the ``$label``-prefixed variables
+  and to the conflict markers that are generated if ``premerge`` is ``keep` or
+  ``keep-merge3``. See the corresponding variable in ``[ui]`` for more
+  information.
+
+.. container:: windows
+
+  ``regkey``
+    Windows registry key which describes install location of this
+    tool. Mercurial will search for this key first under
+    ``HKEY_CURRENT_USER`` and then under ``HKEY_LOCAL_MACHINE``.
+    (default: None)
+
+  ``regkeyalt``
+    An alternate Windows registry key to try if the first key is not
+    found.  The alternate key uses the same ``regname`` and ``regappend``
+    semantics of the primary key.  The most common use for this key
+    is to search for 32bit applications on 64bit operating systems.
+    (default: None)
+
+  ``regname``
+    Name of value to read from specified registry key.
+    (default: the unnamed (default) value)
+
+  ``regappend``
+    String to append to the value read from the registry, typically
+    the executable name of the tool.
+    (default: None)
+
+``pager``
+---------
+
+Setting used to control when to paginate and with what external tool. See
+:hg:`help pager` for details.
+
+``pager``
+    Define the external tool used as pager.
+
+    If no pager is set, Mercurial uses the environment variable $PAGER.
+    If neither pager.pager, nor $PAGER is set, a default pager will be
+    used, typically `less` on Unix and `more` on Windows. Example::
+
+      [pager]
+      pager = less -FRX
+
+``ignore``
+    List of commands to disable the pager for. Example::
+
+      [pager]
+      ignore = version, help, update
+
+``patch``
+---------
+
+Settings used when applying patches, for instance through the 'import'
+command or with Mercurial Queues extension.
+
+``eol``
+    When set to 'strict' patch content and patched files end of lines
+    are preserved. When set to ``lf`` or ``crlf``, both files end of
+    lines are ignored when patching and the result line endings are
+    normalized to either LF (Unix) or CRLF (Windows). When set to
+    ``auto``, end of lines are again ignored while patching but line
+    endings in patched files are normalized to their original setting
+    on a per-file basis. If target file does not exist or has no end
+    of line, patch line endings are preserved.
+    (default: strict)
+
+``fuzz``
+    The number of lines of 'fuzz' to allow when applying patches. This
+    controls how much context the patcher is allowed to ignore when
+    trying to apply a patch.
+    (default: 2)
+
+``paths``
+---------
+
+Assigns symbolic names and behavior to repositories.
+
+Options are symbolic names defining the URL or directory that is the
+location of the repository. Example::
+
+    [paths]
+    my_server = https://example.com/my_repo
+    local_path = /home/me/repo
+
+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`.
+
+Options containing colons (``:``) denote sub-options that can influence
+behavior for that specific path. Example::
+
+    [paths]
+    my_server = https://example.com/my_path
+    my_server:pushurl = ssh://example.com/my_path
+
+The following sub-options can be defined:
+
+``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.
+
+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
+   repository was cloned from.
+
+``default-push``
+   (deprecated) The URL or directory for the default :hg:`push` location.
+   ``default:pushurl`` should be used instead.
+
+``phases``
+----------
+
+Specifies default handling of phases. See :hg:`help phases` for more
+information about working with phases.
+
+``publish``
+    Controls draft phase behavior when working as a server. When true,
+    pushed changesets are set to public in both client and server and
+    pulled or cloned changesets are set to public in the client.
+    (default: True)
+
+``new-commit``
+    Phase of newly-created commits.
+    (default: draft)
+
+``checksubrepos``
+    Check the phase of the current revision of each subrepository. Allowed
+    values are "ignore", "follow" and "abort". For settings other than
+    "ignore", the phase of the current revision of each subrepository is
+    checked before committing the parent repository. If any of those phases is
+    greater than the phase of the parent repository (e.g. if a subrepo is in a
+    "secret" phase while the parent repo is in "draft" phase), the commit is
+    either aborted (if checksubrepos is set to "abort") or the higher phase is
+    used for the parent repository commit (if set to "follow").
+    (default: follow)
+
+
+``profiling``
+-------------
+
+Specifies profiling type, format, and file output. Two profilers are
+supported: an instrumenting profiler (named ``ls``), and a sampling
+profiler (named ``stat``).
+
+In this section description, 'profiling data' stands for the raw data
+collected during profiling, while 'profiling report' stands for a
+statistical text report generated from the profiling data.
+
+``enabled``
+    Enable the profiler.
+    (default: false)
+
+    This is equivalent to passing ``--profile`` on the command line.
+
+``type``
+    The type of profiler to use.
+    (default: stat)
+
+    ``ls``
+      Use Python's built-in instrumenting profiler. This profiler
+      works on all platforms, but each line number it reports is the
+      first line of a function. This restriction makes it difficult to
+      identify the expensive parts of a non-trivial function.
+    ``stat``
+      Use a statistical profiler, statprof. This profiler is most
+      useful for profiling commands that run for longer than about 0.1
+      seconds.
+
+``format``
+    Profiling format.  Specific to the ``ls`` instrumenting profiler.
+    (default: text)
+
+    ``text``
+      Generate a profiling report. When saving to a file, it should be
+      noted that only the report is saved, and the profiling data is
+      not kept.
+    ``kcachegrind``
+      Format profiling data for kcachegrind use: when saving to a
+      file, the generated file can directly be loaded into
+      kcachegrind.
+
+``statformat``
+    Profiling format for the ``stat`` profiler.
+    (default: hotpath)
+
+    ``hotpath``
+      Show a tree-based display containing the hot path of execution (where
+      most time was spent).
+    ``bymethod``
+      Show a table of methods ordered by how frequently they are active.
+    ``byline``
+      Show a table of lines in files ordered by how frequently they are active.
+    ``json``
+      Render profiling data as JSON.
+
+``frequency``
+    Sampling frequency.  Specific to the ``stat`` sampling profiler.
+    (default: 1000)
+
+``output``
+    File path where profiling data or report should be saved. If the
+    file exists, it is replaced. (default: None, data is printed on
+    stderr)
+
+``sort``
+    Sort field.  Specific to the ``ls`` instrumenting profiler.
+    One of ``callcount``, ``reccallcount``, ``totaltime`` and
+    ``inlinetime``.
+    (default: inlinetime)
+
+``time-track``
+    Control if the stat profiler track ``cpu`` or ``real`` time.
+    (default: ``cpu`` on Windows, otherwise ``real``)
+
+``limit``
+    Number of lines to show. Specific to the ``ls`` instrumenting profiler.
+    (default: 30)
+
+``nested``
+    Show at most this number of lines of drill-down info after each main entry.
+    This can help explain the difference between Total and Inline.
+    Specific to the ``ls`` instrumenting profiler.
+    (default: 0)
+
+``showmin``
+    Minimum fraction of samples an entry must have for it to be displayed.
+    Can be specified as a float between ``0.0`` and ``1.0`` or can have a
+    ``%`` afterwards to allow values up to ``100``. e.g. ``5%``.
+
+    Only used by the ``stat`` profiler.
+
+    For the ``hotpath`` format, default is ``0.05``.
+    For the ``chrome`` format, default is ``0.005``.
+
+    The option is unused on other formats.
+
+``showmax``
+    Maximum fraction of samples an entry can have before it is ignored in
+    display. Values format is the same as ``showmin``.
+
+    Only used by the ``stat`` profiler.
+
+    For the ``chrome`` format, default is ``0.999``.
+
+    The option is unused on other formats.
+
+``showtime``
+    Show time taken as absolute durations, in addition to percentages.
+    Only used by the ``hotpath`` format.
+    (default: true)
+
+``progress``
+------------
+
+Mercurial commands can draw progress bars that are as informative as
+possible. Some progress bars only offer indeterminate information, while others
+have a definite end point.
+
+``debug``
+    Whether to print debug info when updating the progress bar. (default: False)
+
+``delay``
+    Number of seconds (float) before showing the progress bar. (default: 3)
+
+``changedelay``
+    Minimum delay before showing a new topic. When set to less than 3 * refresh,
+    that value will be used instead. (default: 1)
+
+``estimateinterval``
+    Maximum sampling interval in seconds for speed and estimated time
+    calculation. (default: 60)
+
+``refresh``
+    Time in seconds between refreshes of the progress bar. (default: 0.1)
+
+``format``
+    Format of the progress bar.
+
+    Valid entries for the format field are ``topic``, ``bar``, ``number``,
+    ``unit``, ``estimate``, ``speed``, and ``item``. ``item`` defaults to the
+    last 20 characters of the item, but this can be changed by adding either
+    ``-<num>`` which would take the last num characters, or ``+<num>`` for the
+    first num characters.
+
+    (default: topic bar number estimate)
+
+``width``
+    If set, the maximum width of the progress information (that is, min(width,
+    term width) will be used).
+
+``clear-complete``
+    Clear the progress bar after it's done. (default: True)
+
+``disable``
+    If true, don't show a progress bar.
+
+``assume-tty``
+    If true, ALWAYS show a progress bar, unless disable is given.
+
+``rebase``
+----------
+
+``evolution.allowdivergence``
+    Default to False, when True allow creating divergence when performing
+    rebase of obsolete changesets.
+
+``revsetalias``
+---------------
+
+Alias definitions for revsets. See :hg:`help revsets` for details.
+
+``rewrite``
+-----------
+
+``backup-bundle``
+    Whether to save stripped changesets to a bundle file. (default: True)
+
+``update-timestamp``
+    If true, updates the date and time of the changeset to current. It is only
+    applicable for `hg amend`, `hg commit --amend` and `hg uncommit` in the
+    current version.
+
+``storage``
+-----------
+
+Control the strategy Mercurial uses internally to store history. Options in this
+category impact performance and repository size.
+
+``revlog.optimize-delta-parent-choice``
+    When storing a merge revision, both parents will be equally considered as
+    a possible delta base. This results in better delta selection and improved
+    revlog compression. This option is enabled by default.
+
+    Turning this option off can result in large increase of repository size for
+    repository with many merges.
+
+``revlog.reuse-external-delta-parent``
+    Control the order in which delta parents are considered when adding new
+    revisions from an external source.
+    (typically: apply bundle from `hg pull` or `hg push`).
+
+    New revisions are usually provided as a delta against other revisions. By
+    default, Mercurial will try to reuse this delta first, therefore using the
+    same "delta parent" as the source. Directly using delta's from the source
+    reduces CPU usage and usually speeds up operation. However, in some case,
+    the source might have sub-optimal delta bases and forcing their reevaluation
+    is useful. For example, pushes from an old client could have sub-optimal
+    delta's parent that the server want to optimize. (lack of general delta, bad
+    parents, choice, lack of sparse-revlog, etc).
+
+    This option is enabled by default. Turning it off will ensure bad delta
+    parent choices from older client do not propagate to this repository, at
+    the cost of a small increase in CPU consumption.
+
+    Note: this option only control the order in which delta parents are
+    considered.  Even when disabled, the existing delta from the source will be
+    reused if the same delta parent is selected.
+
+``revlog.reuse-external-delta``
+    Control the reuse of delta from external source.
+    (typically: apply bundle from `hg pull` or `hg push`).
+
+    New revisions are usually provided as a delta against another revision. By
+    default, Mercurial will not recompute the same delta again, trusting
+    externally provided deltas. There have been rare cases of small adjustment
+    to the diffing algorithm in the past. So in some rare case, recomputing
+    delta provided by ancient clients can provides better results. Disabling
+    this option means going through a full delta recomputation for all incoming
+    revisions. It means a large increase in CPU usage and will slow operations
+    down.
+
+    This option is enabled by default. When disabled, it also disables the
+    related ``storage.revlog.reuse-external-delta-parent`` option.
+
+``revlog.zlib.level``
+    Zlib compression level used when storing data into the repository. Accepted
+    Value range from 1 (lowest compression) to 9 (highest compression). Zlib
+    default value is 6.
+
+
+``revlog.zstd.level``
+    zstd compression level used when storing data into the repository. Accepted
+    Value range from 1 (lowest compression) to 22 (highest compression).
+    (default 3)
+
+``server``
+----------
+
+Controls generic server settings.
+
+``bookmarks-pushkey-compat``
+    Trigger pushkey hook when being pushed bookmark updates. This config exist
+    for compatibility purpose (default to True)
+
+    If you use ``pushkey`` and ``pre-pushkey`` hooks to control bookmark
+    movement we recommend you migrate them to ``txnclose-bookmark`` and
+    ``pretxnclose-bookmark``.
+
+``compressionengines``
+    List of compression engines and their relative priority to advertise
+    to clients.
+
+    The order of compression engines determines their priority, the first
+    having the highest priority. If a compression engine is not listed
+    here, it won't be advertised to clients.
+
+    If not set (the default), built-in defaults are used. Run
+    :hg:`debuginstall` to list available compression engines and their
+    default wire protocol priority.
+
+    Older Mercurial clients only support zlib compression and this setting
+    has no effect for legacy clients.
+
+``uncompressed``
+    Whether to allow clients to clone a repository using the
+    uncompressed streaming protocol. This transfers about 40% more
+    data than a regular clone, but uses less memory and CPU on both
+    server and client. Over a LAN (100 Mbps or better) or a very fast
+    WAN, an uncompressed streaming clone is a lot faster (~10x) than a
+    regular clone. Over most WAN connections (anything slower than
+    about 6 Mbps), uncompressed streaming is slower, because of the
+    extra data transfer overhead. This mode will also temporarily hold
+    the write lock while determining what data to transfer.
+    (default: True)
+
+``uncompressedallowsecret``
+    Whether to allow stream clones when the repository contains secret
+    changesets. (default: False)
+
+``preferuncompressed``
+    When set, clients will try to use the uncompressed streaming
+    protocol. (default: False)
+
+``disablefullbundle``
+    When set, servers will refuse attempts to do pull-based clones.
+    If this option is set, ``preferuncompressed`` and/or clone bundles
+    are highly recommended. Partial clones will still be allowed.
+    (default: False)
+
+``streamunbundle``
+    When set, servers will apply data sent from the client directly,
+    otherwise it will be written to a temporary file first. This option
+    effectively prevents concurrent pushes.
+
+``pullbundle``
+    When set, the server will check pullbundle.manifest for bundles
+    covering the requested heads and common nodes. The first matching
+    entry will be streamed to the client.
+
+    For HTTP transport, the stream will still use zlib compression
+    for older clients.
+
+``concurrent-push-mode``
+    Level of allowed race condition between two pushing clients.
+
+    - 'strict': push is abort if another client touched the repository
+      while the push was preparing. (default)
+    - 'check-related': push is only aborted if it affects head that got also
+      affected while the push was preparing.
+
+    This requires compatible client (version 4.3 and later). Old client will
+    use 'strict'.
+
+``validate``
+    Whether to validate the completeness of pushed changesets by
+    checking that all new file revisions specified in manifests are
+    present. (default: False)
+
+``maxhttpheaderlen``
+    Instruct HTTP clients not to send request headers longer than this
+    many bytes. (default: 1024)
+
+``bundle1``
+    Whether to allow clients to push and pull using the legacy bundle1
+    exchange format. (default: True)
+
+``bundle1gd``
+    Like ``bundle1`` but only used if the repository is using the
+    *generaldelta* storage format. (default: True)
+
+``bundle1.push``
+    Whether to allow clients to push using the legacy bundle1 exchange
+    format. (default: True)
+
+``bundle1gd.push``
+    Like ``bundle1.push`` but only used if the repository is using the
+    *generaldelta* storage format. (default: True)
+
+``bundle1.pull``
+    Whether to allow clients to pull using the legacy bundle1 exchange
+    format. (default: True)
+
+``bundle1gd.pull``
+    Like ``bundle1.pull`` but only used if the repository is using the
+    *generaldelta* storage format. (default: True)
+
+    Large repositories using the *generaldelta* storage format should
+    consider setting this option because converting *generaldelta*
+    repositories to the exchange format required by the bundle1 data
+    format can consume a lot of CPU.
+
+``bundle2.stream``
+    Whether to allow clients to pull using the bundle2 streaming protocol.
+    (default: True)
+
+``zliblevel``
+    Integer between ``-1`` and ``9`` that controls the zlib compression level
+    for wire protocol commands that send zlib compressed output (notably the
+    commands that send repository history data).
+
+    The default (``-1``) uses the default zlib compression level, which is
+    likely equivalent to ``6``. ``0`` means no compression. ``9`` means
+    maximum compression.
+
+    Setting this option allows server operators to make trade-offs between
+    bandwidth and CPU used. Lowering the compression lowers CPU utilization
+    but sends more bytes to clients.
+
+    This option only impacts the HTTP server.
+
+``zstdlevel``
+    Integer between ``1`` and ``22`` that controls the zstd compression level
+    for wire protocol commands. ``1`` is the minimal amount of compression and
+    ``22`` is the highest amount of compression.
+
+    The default (``3``) should be significantly faster than zlib while likely
+    delivering better compression ratios.
+
+    This option only impacts the HTTP server.
+
+    See also ``server.zliblevel``.
+
+``view``
+    Repository filter used when exchanging revisions with the peer.
+
+    The default view (``served``) excludes secret and hidden changesets.
+    Another useful value is ``immutable`` (no draft, secret or hidden
+    changesets). (EXPERIMENTAL)
+
+``smtp``
+--------
+
+Configuration for extensions that need to send email messages.
+
+``host``
+    Host name of mail server, e.g. "mail.example.com".
+
+``port``
+    Optional. Port to connect to on mail server. (default: 465 if
+    ``tls`` is smtps; 25 otherwise)
+
+``tls``
+    Optional. Method to enable TLS when connecting to mail server: starttls,
+    smtps or none. (default: none)
+
+``username``
+    Optional. User name for authenticating with the SMTP server.
+    (default: None)
+
+``password``
+    Optional. Password for authenticating with the SMTP server. If not
+    specified, interactive sessions will prompt the user for a
+    password; non-interactive sessions will fail. (default: None)
+
+``local_hostname``
+    Optional. The hostname that the sender can use to identify
+    itself to the MTA.
+
+
+``subpaths``
+------------
+
+Subrepository source URLs can go stale if a remote server changes name
+or becomes temporarily unavailable. This section lets you define
+rewrite rules of the form::
+
+    <pattern> = <replacement>
+
+where ``pattern`` is a regular expression matching a subrepository
+source URL and ``replacement`` is the replacement string used to
+rewrite it. Groups can be matched in ``pattern`` and referenced in
+``replacements``. For instance::
+
+    http://server/(.*)-hg/ = http://hg.server/\1/
+
+rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``.
+
+Relative subrepository paths are first made absolute, and the
+rewrite rules are then applied on the full (absolute) path. If ``pattern``
+doesn't match the full path, an attempt is made to apply it on the
+relative path alone. The rules are applied in definition order.
+
+``subrepos``
+------------
+
+This section contains options that control the behavior of the
+subrepositories feature. See also :hg:`help subrepos`.
+
+Security note: auditing in Mercurial is known to be insufficient to
+prevent clone-time code execution with carefully constructed Git
+subrepos. It is unknown if a similar detect is present in Subversion
+subrepos. Both Git and Subversion subrepos are disabled by default
+out of security concerns. These subrepo types can be enabled using
+the respective options below.
+
+``allowed``
+    Whether subrepositories are allowed in the working directory.
+
+    When false, commands involving subrepositories (like :hg:`update`)
+    will fail for all subrepository types.
+    (default: true)
+
+``hg:allowed``
+    Whether Mercurial subrepositories are allowed in the working
+    directory. This option only has an effect if ``subrepos.allowed``
+    is true.
+    (default: true)
+
+``git:allowed``
+    Whether Git subrepositories are allowed in the working directory.
+    This option only has an effect if ``subrepos.allowed`` is true.
+
+    See the security note above before enabling Git subrepos.
+    (default: false)
+
+``svn:allowed``
+    Whether Subversion subrepositories are allowed in the working
+    directory. This option only has an effect if ``subrepos.allowed``
+    is true.
+
+    See the security note above before enabling Subversion subrepos.
+    (default: false)
+
+``templatealias``
+-----------------
+
+Alias definitions for templates. See :hg:`help templates` for details.
+
+``templates``
+-------------
+
+Use the ``[templates]`` section to define template strings.
+See :hg:`help templates` for details.
+
+``trusted``
+-----------
+
+Mercurial will not use the settings in the
+``.hg/hgrc`` file from a repository if it doesn't belong to a trusted
+user or to a trusted group, as various hgrc features allow arbitrary
+commands to be run. This issue is often encountered when configuring
+hooks or extensions for shared repositories or servers. However,
+the web interface will use some safe settings from the ``[web]``
+section.
+
+This section specifies what users and groups are trusted. The
+current user is always trusted. To trust everybody, list a user or a
+group with name ``*``. These settings must be placed in an
+*already-trusted file* to take effect, such as ``$HOME/.hgrc`` of the
+user or service running Mercurial.
+
+``users``
+  Comma-separated list of trusted users.
+
+``groups``
+  Comma-separated list of trusted groups.
+
+
+``ui``
+------
+
+User interface controls.
+
+``archivemeta``
+    Whether to include the .hg_archival.txt file containing meta data
+    (hashes for the repository base and for tip) in archives created
+    by the :hg:`archive` command or downloaded via hgweb.
+    (default: True)
+
+``askusername``
+    Whether to prompt for a username when committing. If True, and
+    neither ``$HGUSER`` nor ``$EMAIL`` has been specified, then the user will
+    be prompted to enter a username. If no username is entered, the
+    default ``USER@HOST`` is used instead.
+    (default: False)
+
+``clonebundles``
+    Whether the "clone bundles" feature is enabled.
+
+    When enabled, :hg:`clone` may download and apply a server-advertised
+    bundle file from a URL instead of using the normal exchange mechanism.
+
+    This can likely result in faster and more reliable clones.
+
+    (default: True)
+
+``clonebundlefallback``
+    Whether failure to apply an advertised "clone bundle" from a server
+    should result in fallback to a regular clone.
+
+    This is disabled by default because servers advertising "clone
+    bundles" often do so to reduce server load. If advertised bundles
+    start mass failing and clients automatically fall back to a regular
+    clone, this would add significant and unexpected load to the server
+    since the server is expecting clone operations to be offloaded to
+    pre-generated bundles. Failing fast (the default behavior) ensures
+    clients don't overwhelm the server when "clone bundle" application
+    fails.
+
+    (default: False)
+
+``clonebundleprefers``
+    Defines preferences for which "clone bundles" to use.
+
+    Servers advertising "clone bundles" may advertise multiple available
+    bundles. Each bundle may have different attributes, such as the bundle
+    type and compression format. This option is used to prefer a particular
+    bundle over another.
+
+    The following keys are defined by Mercurial:
+
+    BUNDLESPEC
+       A bundle type specifier. These are strings passed to :hg:`bundle -t`.
+       e.g. ``gzip-v2`` or ``bzip2-v1``.
+
+    COMPRESSION
+       The compression format of the bundle. e.g. ``gzip`` and ``bzip2``.
+
+    Server operators may define custom keys.
+
+    Example values: ``COMPRESSION=bzip2``,
+    ``BUNDLESPEC=gzip-v2, COMPRESSION=gzip``.
+
+    By default, the first bundle advertised by the server is used.
+
+``color``
+    When to colorize output. Possible value are Boolean ("yes" or "no"), or
+    "debug", or "always". (default: "yes"). "yes" will use color whenever it
+    seems possible. See :hg:`help color` for details.
+
+``commitsubrepos``
+    Whether to commit modified subrepositories when committing the
+    parent repository. If False and one subrepository has uncommitted
+    changes, abort the commit.
+    (default: False)
+
+``debug``
+    Print debugging information. (default: False)
+
+``editor``
+    The editor to use during a commit. (default: ``$EDITOR`` or ``vi``)
+
+``fallbackencoding``
+    Encoding to try if it's not possible to decode the changelog using
+    UTF-8. (default: ISO-8859-1)
+
+``graphnodetemplate``
+    The template used to print changeset nodes in an ASCII revision graph.
+    (default: ``{graphnode}``)
+
+``ignore``
+    A file to read per-user ignore patterns from. This file should be
+    in the same format as a repository-wide .hgignore file. Filenames
+    are relative to the repository root. This option supports hook syntax,
+    so if you want to specify multiple ignore files, you can do so by
+    setting something like ``ignore.other = ~/.hgignore2``. For details
+    of the ignore file format, see the ``hgignore(5)`` man page.
+
+``interactive``
+    Allow to prompt the user. (default: True)
+
+``interface``
+    Select the default interface for interactive features (default: text).
+    Possible values are 'text' and 'curses'.
+
+``interface.chunkselector``
+    Select the interface for change recording (e.g. :hg:`commit -i`).
+    Possible values are 'text' and 'curses'.
+    This config overrides the interface specified by ui.interface.
+
+``large-file-limit``
+    Largest file size that gives no memory use warning.
+    Possible values are integers or 0 to disable the check.
+    (default: 10000000)
+
+``logtemplate``
+    Template string for commands that print changesets.
+
+``merge``
+    The conflict resolution program to use during a manual merge.
+    For more information on merge tools see :hg:`help merge-tools`.
+    For configuring merge tools see the ``[merge-tools]`` section.
+
+``mergemarkers``
+    Sets the merge conflict marker label styling. The ``detailed``
+    style uses the ``mergemarkertemplate`` setting to style the labels.
+    The ``basic`` style just uses 'local' and 'other' as the marker label.
+    One of ``basic`` or ``detailed``.
+    (default: ``basic``)
+
+``mergemarkertemplate``
+    The template used to print the commit description next to each conflict
+    marker during merge conflicts. See :hg:`help templates` for the template
+    format.
+
+    Defaults to showing the hash, tags, branches, bookmarks, author, and
+    the first line of the commit description.
+
+    If you use non-ASCII characters in names for tags, branches, bookmarks,
+    authors, and/or commit descriptions, you must pay attention to encodings of
+    managed files. At template expansion, non-ASCII characters use the encoding
+    specified by the ``--encoding`` global option, ``HGENCODING`` or other
+    environment variables that govern your locale. If the encoding of the merge
+    markers is different from the encoding of the merged files,
+    serious problems may occur.
+
+    Can be overridden per-merge-tool, see the ``[merge-tools]`` section.
+
+``message-output``
+    Where to write status and error messages. (default: ``stdio``)
+
+    ``stderr``
+      Everything to stderr.
+    ``stdio``
+      Status to stdout, and error to stderr.
+
+``origbackuppath``
+    The path to a directory used to store generated .orig files. If the path is
+    not a directory, one will be created.  If set, files stored in this
+    directory have the same name as the original file and do not have a .orig
+    suffix.
+
+``paginate``
+  Control the pagination of command output (default: True). See :hg:`help pager`
+  for details.
+
+``patch``
+    An optional external tool that ``hg import`` and some extensions
+    will use for applying patches. By default Mercurial uses an
+    internal patch utility. The external tool must work as the common
+    Unix ``patch`` program. In particular, it must accept a ``-p``
+    argument to strip patch headers, a ``-d`` argument to specify the
+    current directory, a file name to patch, and a patch file to take
+    from stdin.
+
+    It is possible to specify a patch tool together with extra
+    arguments. For example, setting this option to ``patch --merge``
+    will use the ``patch`` program with its 2-way merge option.
+
+``portablefilenames``
+    Check for portable filenames. Can be ``warn``, ``ignore`` or ``abort``.
+    (default: ``warn``)
+
+    ``warn``
+      Print a warning message on POSIX platforms, if a file with a non-portable
+      filename is added (e.g. a file with a name that can't be created on
+      Windows because it contains reserved parts like ``AUX``, reserved
+      characters like ``:``, or would cause a case collision with an existing
+      file).
+
+    ``ignore``
+      Don't print a warning.
+
+    ``abort``
+      The command is aborted.
+
+    ``true``
+      Alias for ``warn``.
+
+    ``false``
+      Alias for ``ignore``.
+
+    .. container:: windows
+
+      On Windows, this configuration option is ignored and the command aborted.
+
+``pre-merge-tool-output-template``
+    A template that is printed before executing an external merge tool. This can
+    be used to print out additional context that might be useful to have during
+    the conflict resolution, such as the description of the various commits
+    involved or bookmarks/tags.
+
+    Additional information is available in the ``local`, ``base``, and ``other``
+    dicts. For example: ``{local.label}``, ``{base.name}``, or
+    ``{other.islink}``.
+
+``quiet``
+    Reduce the amount of output printed.
+    (default: False)
+
+``relative-paths``
+    Prefer relative paths in the UI.
+
+``remotecmd``
+    Remote command to use for clone/push/pull operations.
+    (default: ``hg``)
+
+``report_untrusted``
+    Warn if a ``.hg/hgrc`` file is ignored due to not being owned by a
+    trusted user or group.
+    (default: True)
+
+``slash``
+    (Deprecated. Use ``slashpath`` template filter instead.)
+
+    Display paths using a slash (``/``) as the path separator. This
+    only makes a difference on systems where the default path
+    separator is not the slash character (e.g. Windows uses the
+    backslash character (``\``)).
+    (default: False)
+
+``statuscopies``
+    Display copies in the status command.
+
+``ssh``
+    Command to use for SSH connections. (default: ``ssh``)
+
+``ssherrorhint``
+    A hint shown to the user in the case of SSH error (e.g.
+    ``Please see http://company/internalwiki/ssh.html``)
+
+``strict``
+    Require exact command names, instead of allowing unambiguous
+    abbreviations. (default: False)
+
+``style``
+    Name of style to use for command output.
+
+``supportcontact``
+    A URL where users should report a Mercurial traceback. Use this if you are a
+    large organisation with its own Mercurial deployment process and crash
+    reports should be addressed to your internal support.
+
+``textwidth``
+    Maximum width of help text. A longer line generated by ``hg help`` or
+    ``hg subcommand --help`` will be broken after white space to get this
+    width or the terminal width, whichever comes first.
+    A non-positive value will disable this and the terminal width will be
+    used. (default: 78)
+
+``timeout``
+    The timeout used when a lock is held (in seconds), a negative value
+    means no timeout. (default: 600)
+
+``timeout.warn``
+    Time (in seconds) before a warning is printed about held lock. A negative
+    value means no warning. (default: 0)
+
+``traceback``
+    Mercurial always prints a traceback when an unknown exception
+    occurs. Setting this to True will make Mercurial print a traceback
+    on all exceptions, even those recognized by Mercurial (such as
+    IOError or MemoryError). (default: False)
+
+``tweakdefaults``
+
+    By default Mercurial's behavior changes very little from release
+    to release, but over time the recommended config settings
+    shift. Enable this config to opt in to get automatic tweaks to
+    Mercurial's behavior over time. This config setting will have no
+    effect if ``HGPLAIN`` is set or ``HGPLAINEXCEPT`` is set and does
+    not include ``tweakdefaults``. (default: False)
+
+    It currently means::
+
+      .. tweakdefaultsmarker
+
+``username``
+    The committer of a changeset created when running "commit".
+    Typically a person's name and email address, e.g. ``Fred Widget
+    <fred@example.com>``. Environment variables in the
+    username are expanded.
+
+    (default: ``$EMAIL`` or ``username@hostname``. If the username in
+    hgrc is empty, e.g. if the system admin set ``username =`` in the
+    system hgrc, it has to be specified manually or in a different
+    hgrc file)
+
+``verbose``
+    Increase the amount of output printed. (default: False)
+
+
+``web``
+-------
+
+Web interface configuration. The settings in this section apply to
+both the builtin webserver (started by :hg:`serve`) and the script you
+run through a webserver (``hgweb.cgi`` and the derivatives for FastCGI
+and WSGI).
+
+The Mercurial webserver does no authentication (it does not prompt for
+usernames and passwords to validate *who* users are), but it does do
+authorization (it grants or denies access for *authenticated users*
+based on settings in this section). You must either configure your
+webserver to do authentication for you, or disable the authorization
+checks.
+
+For a quick setup in a trusted environment, e.g., a private LAN, where
+you want it to accept pushes from anybody, you can use the following
+command line::
+
+    $ hg --config web.allow-push=* --config web.push_ssl=False serve
+
+Note that this will allow anybody to push anything to the server and
+that this should not be used for public servers.
+
+The full set of options is:
+
+``accesslog``
+    Where to output the access log. (default: stdout)
+
+``address``
+    Interface address to bind to. (default: all)
+
+``allow-archive``
+    List of archive format (bz2, gz, zip) allowed for downloading.
+    (default: empty)
+
+``allowbz2``
+    (DEPRECATED) Whether to allow .tar.bz2 downloading of repository
+    revisions.
+    (default: False)
+
+``allowgz``
+    (DEPRECATED) Whether to allow .tar.gz downloading of repository
+    revisions.
+    (default: False)
+
+``allow-pull``
+    Whether to allow pulling from the repository. (default: True)
+
+``allow-push``
+    Whether to allow pushing to the repository. If empty or not set,
+    pushing is not allowed. If the special value ``*``, any remote
+    user can push, including unauthenticated users. Otherwise, the
+    remote user must have been authenticated, and the authenticated
+    user name must be present in this list. The contents of the
+    allow-push list are examined after the deny_push list.
+
+``allow_read``
+    If the user has not already been denied repository access due to
+    the contents of deny_read, this list determines whether to grant
+    repository access to the user. If this list is not empty, and the
+    user is unauthenticated or not present in the list, then access is
+    denied for the user. If the list is empty or not set, then access
+    is permitted to all users by default. Setting allow_read to the
+    special value ``*`` is equivalent to it not being set (i.e. access
+    is permitted to all users). The contents of the allow_read list are
+    examined after the deny_read list.
+
+``allowzip``
+    (DEPRECATED) Whether to allow .zip downloading of repository
+    revisions. This feature creates temporary files.
+    (default: False)
+
+``archivesubrepos``
+    Whether to recurse into subrepositories when archiving.
+    (default: False)
+
+``baseurl``
+    Base URL to use when publishing URLs in other locations, so
+    third-party tools like email notification hooks can construct
+    URLs. Example: ``http://hgserver/repos/``.
+
+``cacerts``
+    Path to file containing a list of PEM encoded certificate
+    authority certificates. Environment variables and ``~user``
+    constructs are expanded in the filename. If specified on the
+    client, then it will verify the identity of remote HTTPS servers
+    with these certificates.
+
+    To disable SSL verification temporarily, specify ``--insecure`` from
+    command line.
+
+    You can use OpenSSL's CA certificate file if your platform has
+    one. On most Linux systems this will be
+    ``/etc/ssl/certs/ca-certificates.crt``. Otherwise you will have to
+    generate this file manually. The form must be as follows::
+
+        -----BEGIN CERTIFICATE-----
+        ... (certificate in base64 PEM encoding) ...
+        -----END CERTIFICATE-----
+        -----BEGIN CERTIFICATE-----
+        ... (certificate in base64 PEM encoding) ...
+        -----END CERTIFICATE-----
+
+``cache``
+    Whether to support caching in hgweb. (default: True)
+
+``certificate``
+    Certificate to use when running :hg:`serve`.
+
+``collapse``
+    With ``descend`` enabled, repositories in subdirectories are shown at
+    a single level alongside repositories in the current path. With
+    ``collapse`` also enabled, repositories residing at a deeper level than
+    the current path are grouped behind navigable directory entries that
+    lead to the locations of these repositories. In effect, this setting
+    collapses each collection of repositories found within a subdirectory
+    into a single entry for that subdirectory. (default: False)
+
+``comparisoncontext``
+    Number of lines of context to show in side-by-side file comparison. If
+    negative or the value ``full``, whole files are shown. (default: 5)
+
+    This setting can be overridden by a ``context`` request parameter to the
+    ``comparison`` command, taking the same values.
+
+``contact``
+    Name or email address of the person in charge of the repository.
+    (default: ui.username or ``$EMAIL`` or "unknown" if unset or empty)
+
+``csp``
+    Send a ``Content-Security-Policy`` HTTP header with this value.
+
+    The value may contain a special string ``%nonce%``, which will be replaced
+    by a randomly-generated one-time use value. If the value contains
+    ``%nonce%``, ``web.cache`` will be disabled, as caching undermines the
+    one-time property of the nonce. This nonce will also be inserted into
+    ``<script>`` elements containing inline JavaScript.
+
+    Note: lots of HTML content sent by the server is derived from repository
+    data. Please consider the potential for malicious repository data to
+    "inject" itself into generated HTML content as part of your security
+    threat model.
+
+``deny_push``
+    Whether to deny pushing to the repository. If empty or not set,
+    push is not denied. If the special value ``*``, all remote users are
+    denied push. Otherwise, unauthenticated users are all denied, and
+    any authenticated user name present in this list is also denied. The
+    contents of the deny_push list are examined before the allow-push list.
+
+``deny_read``
+    Whether to deny reading/viewing of the repository. If this list is
+    not empty, unauthenticated users are all denied, and any
+    authenticated user name present in this list is also denied access to
+    the repository. If set to the special value ``*``, all remote users
+    are denied access (rarely needed ;). If deny_read is empty or not set,
+    the determination of repository access depends on the presence and
+    content of the allow_read list (see description). If both
+    deny_read and allow_read are empty or not set, then access is
+    permitted to all users by default. If the repository is being
+    served via hgwebdir, denied users will not be able to see it in
+    the list of repositories. The contents of the deny_read list have
+    priority over (are examined before) the contents of the allow_read
+    list.
+
+``descend``
+    hgwebdir indexes will not descend into subdirectories. Only repositories
+    directly in the current path will be shown (other repositories are still
+    available from the index corresponding to their containing path).
+
+``description``
+    Textual description of the repository's purpose or contents.
+    (default: "unknown")
+
+``encoding``
+    Character encoding name. (default: the current locale charset)
+    Example: "UTF-8".
+
+``errorlog``
+    Where to output the error log. (default: stderr)
+
+``guessmime``
+    Control MIME types for raw download of file content.
+    Set to True to let hgweb guess the content type from the file
+    extension. This will serve HTML files as ``text/html`` and might
+    allow cross-site scripting attacks when serving untrusted
+    repositories. (default: False)
+
+``hidden``
+    Whether to hide the repository in the hgwebdir index.
+    (default: False)
+
+``ipv6``
+    Whether to use IPv6. (default: False)
+
+``labels``
+    List of string *labels* associated with the repository.
+
+    Labels are exposed as a template keyword and can be used to customize
+    output. e.g. the ``index`` template can group or filter repositories
+    by labels and the ``summary`` template can display additional content
+    if a specific label is present.
+
+``logoimg``
+    File name of the logo image that some templates display on each page.
+    The file name is relative to ``staticurl``. That is, the full path to
+    the logo image is "staticurl/logoimg".
+    If unset, ``hglogo.png`` will be used.
+
+``logourl``
+    Base URL to use for logos. If unset, ``https://mercurial-scm.org/``
+    will be used.
+
+``maxchanges``
+    Maximum number of changes to list on the changelog. (default: 10)
+
+``maxfiles``
+    Maximum number of files to list per changeset. (default: 10)
+
+``maxshortchanges``
+    Maximum number of changes to list on the shortlog, graph or filelog
+    pages. (default: 60)
+
+``name``
+    Repository name to use in the web interface.
+    (default: current working directory)
+
+``port``
+    Port to listen on. (default: 8000)
+
+``prefix``
+    Prefix path to serve from. (default: '' (server root))
+
+``push_ssl``
+    Whether to require that inbound pushes be transported over SSL to
+    prevent password sniffing. (default: True)
+
+``refreshinterval``
+    How frequently directory listings re-scan the filesystem for new
+    repositories, in seconds. This is relevant when wildcards are used
+    to define paths. Depending on how much filesystem traversal is
+    required, refreshing may negatively impact performance.
+
+    Values less than or equal to 0 always refresh.
+    (default: 20)
+
+``server-header``
+    Value for HTTP ``Server`` response header.
+
+``static``
+    Directory where static files are served from.
+
+``staticurl``
+    Base URL to use for static files. If unset, static files (e.g. the
+    hgicon.png favicon) will be served by the CGI script itself. Use
+    this setting to serve them directly with the HTTP server.
+    Example: ``http://hgserver/static/``.
+
+``stripes``
+    How many lines a "zebra stripe" should span in multi-line output.
+    Set to 0 to disable. (default: 1)
+
+``style``
+    Which template map style to use. The available options are the names of
+    subdirectories in the HTML templates path. (default: ``paper``)
+    Example: ``monoblue``.
+
+``templates``
+    Where to find the HTML templates. The default path to the HTML templates
+    can be obtained from ``hg debuginstall``.
+
+``websub``
+----------
+
+Web substitution filter definition. You can use this section to
+define a set of regular expression substitution patterns which
+let you automatically modify the hgweb server output.
+
+The default hgweb templates only apply these substitution patterns
+on the revision description fields. You can apply them anywhere
+you want when you create your own templates by adding calls to the
+"websub" filter (usually after calling the "escape" filter).
+
+This can be used, for example, to convert issue references to links
+to your issue tracker, or to convert "markdown-like" syntax into
+HTML (see the examples below).
+
+Each entry in this section names a substitution filter.
+The value of each entry defines the substitution expression itself.
+The websub expressions follow the old interhg extension syntax,
+which in turn imitates the Unix sed replacement syntax::
+
+    patternname = s/SEARCH_REGEX/REPLACE_EXPRESSION/[i]
+
+You can use any separator other than "/". The final "i" is optional
+and indicates that the search must be case insensitive.
+
+Examples::
+
+    [websub]
+    issues = s|issue(\d+)|<a href="http://bts.example.org/issue\1">issue\1</a>|i
+    italic = s/\b_(\S+)_\b/<i>\1<\/i>/
+    bold = s/\*\b(\S+)\b\*/<b>\1<\/b>/
+
+``worker``
+----------
+
+Parallel master/worker configuration. We currently perform working
+directory updates in parallel on Unix-like systems, which greatly
+helps performance.
+
+``enabled``
+    Whether to enable workers code to be used.
+    (default: true)
+
+``numcpus``
+    Number of CPUs to use for parallel operations. A zero or
+    negative value is treated as ``use the default``.
+    (default: 4 or the number of CPUs on the system, whichever is larger)
+
+``backgroundclose``
+    Whether to enable closing file handles on background threads during certain
+    operations. Some platforms aren't very efficient at closing file
+    handles that have been written or appended to. By performing file closing
+    on background threads, file write rate can increase substantially.
+    (default: true on Windows, false elsewhere)
+
+``backgroundcloseminfilecount``
+    Minimum number of files required to trigger background file closing.
+    Operations not writing this many files won't start background close
+    threads.
+    (default: 2048)
+
+``backgroundclosemaxqueue``
+    The maximum number of opened file handles waiting to be closed in the
+    background. This option only has an effect if ``backgroundclose`` is
+    enabled.
+    (default: 384)
+
+``backgroundclosethreadcount``
+    Number of threads to process background file closes. Only relevant if
+    ``backgroundclose`` is enabled.
+    (default: 4)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/dates.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,39 @@
+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.
+
+Many date formats are valid. Here are some examples:
+
+- ``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
+
+Lastly, there is Mercurial's internal format:
+
+- ``1165411109 0`` (Wed Dec 6 13:18:29 2006 UTC)
+
+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).
+
+The log command also accepts date ranges:
+
+- ``<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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/deprecated.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,30 @@
+Mercurial evolves over time, some features, options, commands may be replaced by
+better and more secure alternatives. This topic will help you migrating your
+existing usage and/or configuration to newer features.
+
+Commands
+========
+
+The following commands are still available but their use are not recommended:
+
+``locate``
+
+This command has been replaced by `hg files`.
+
+``parents``
+
+This command can be replaced by `hg summary` or `hg log` with appropriate
+revsets. See `hg help revsets` for more information.
+
+``tip``
+
+The recommended alternative is `hg heads`.
+
+Options
+=======
+
+``web.allowpull``
+    Renamed to `allow-pull`.
+
+``web.allow_push``
+    Renamed to `allow-push`.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/diffs.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,29 @@
+Mercurial's default format for showing changes between two versions of
+a file is compatible with the unified format of GNU diff, which can be
+used by GNU patch and many other standard tools.
+
+While this standard format is often enough, it does not encode the
+following information:
+
+- executable status and other permission bits
+- copy or rename information
+- changes in binary files
+- creation or deletion of empty files
+
+Mercurial also supports the extended diff format from the git VCS
+which addresses these limitations. The git diff format is not produced
+by default because a few widespread tools still do not understand this
+format.
+
+This means that when generating diffs from a Mercurial repository
+(e.g. with :hg:`export`), you should be careful about things like file
+copies and renames or other things mentioned above, because when
+applying a standard diff to a different repository, this extra
+information is lost. Mercurial's internal operations (like push and
+pull) are not affected by this, because they use an internal binary
+format for communicating changes.
+
+To make Mercurial produce the git extended diff format, use the --git
+option available for many commands, or set 'git = True' in the [diff]
+section of your configuration file. You do not need to set this option
+when importing diffs in this format or using them in the mq extension.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/environment.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,121 @@
+HG
+    Path to the 'hg' executable, automatically passed when running
+    hooks, extensions or external tools. If unset or empty, this is
+    the hg executable's name if it's frozen, or an executable named
+    'hg' (with %PATHEXT% [defaulting to COM/EXE/BAT/CMD] extensions on
+    Windows) is searched.
+
+HGEDITOR
+    This is the name of the editor to run when committing. See EDITOR.
+
+    (deprecated, see :hg:`help config.ui.editor`)
+
+HGENCODING
+    This overrides the default locale setting detected by Mercurial.
+    This setting is used to convert data including usernames,
+    changeset descriptions, tag names, and branches. This setting can
+    be overridden with the --encoding command-line option.
+
+HGENCODINGMODE
+    This sets Mercurial's behavior for handling unknown characters
+    while transcoding user input. The default is "strict", which
+    causes Mercurial to abort if it can't map a character. Other
+    settings include "replace", which replaces unknown characters, and
+    "ignore", which drops them. This setting can be overridden with
+    the --encodingmode command-line option.
+
+HGENCODINGAMBIGUOUS
+    This sets Mercurial's behavior for handling characters with
+    "ambiguous" widths like accented Latin characters with East Asian
+    fonts. By default, Mercurial assumes ambiguous characters are
+    narrow, set this variable to "wide" if such characters cause
+    formatting problems.
+
+HGMERGE
+    An executable to use for resolving merge conflicts. The program
+    will be executed with three arguments: local file, remote file,
+    ancestor file.
+
+    (deprecated, see :hg:`help config.ui.merge`)
+
+HGRCPATH
+    A list of files or directories to search for configuration
+    files. Item separator is ":" on Unix, ";" on Windows. If HGRCPATH
+    is not set, platform default search path is used. If empty, only
+    the .hg/hgrc from the current repository is read.
+
+    For each element in HGRCPATH:
+
+    - if it's a directory, all files ending with .rc are added
+    - otherwise, the file itself will be added
+
+HGPLAIN
+    When set, this disables any configuration settings that might
+    change Mercurial's default output. This includes encoding,
+    defaults, verbose mode, debug mode, quiet mode, tracebacks, and
+    localization. This can be useful when scripting against Mercurial
+    in the face of existing user configuration.
+
+    In addition to the features disabled by ``HGPLAIN=``, the following
+    values can be specified to adjust behavior:
+
+    ``+strictflags``
+        Restrict parsing of command line flags.
+
+    Equivalent options set via command line flags or environment
+    variables are not overridden.
+
+    See :hg:`help scripting` for details.
+
+HGPLAINEXCEPT
+    This is a comma-separated list of features to preserve when
+    HGPLAIN is enabled. Currently the following values are supported:
+
+    ``alias``
+        Don't remove aliases.
+    ``color``
+        Don't disable colored output.
+    ``i18n``
+        Preserve internationalization.
+    ``revsetalias``
+        Don't remove revset aliases.
+    ``templatealias``
+        Don't remove template aliases.
+    ``progress``
+        Don't hide progress output.
+
+    Setting HGPLAINEXCEPT to anything (even an empty string) will
+    enable plain mode.
+
+HGUSER
+    This is the string used as the author of a commit. If not set,
+    available values will be considered in this order:
+
+    - HGUSER (deprecated)
+    - configuration files from the HGRCPATH
+    - EMAIL
+    - interactive prompt
+    - LOGNAME (with ``@hostname`` appended)
+
+    (deprecated, see :hg:`help config.ui.username`)
+
+EMAIL
+    May be used as the author of a commit; see HGUSER.
+
+LOGNAME
+    May be used as the author of a commit; see HGUSER.
+
+VISUAL
+    This is the name of the editor to use when committing. See EDITOR.
+
+EDITOR
+    Sometimes Mercurial needs to open a text file in an editor for a
+    user to modify, for example when writing commit messages. The
+    editor it uses is determined by looking at the environment
+    variables HGEDITOR, VISUAL and EDITOR, in that order. The first
+    non-empty one is chosen. If all of them are empty, the editor
+    defaults to 'vi'.
+
+PYTHONPATH
+    This is used by Python to find imported modules and may need to be
+    set appropriately if this Mercurial is not installed system-wide.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/extensions.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,35 @@
+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 = !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/filesets.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,79 @@
+Mercurial supports a functional language for selecting a set of
+files.
+
+Like other file patterns, this pattern type is indicated by a prefix,
+'set:'. The language supports a number of predicates which are joined
+by infix operators. Parenthesis can be used for grouping.
+
+Identifiers such as filenames or patterns must be quoted with single
+or double quotes if they contain characters outside of
+``[.*{}[]?/\_a-zA-Z0-9\x80-\xff]`` or if they match one of the
+predefined predicates. This generally applies to file patterns other
+than globs and arguments for predicates. Pattern prefixes such as
+``path:`` may be specified without quoting.
+
+Special characters can be used in quoted identifiers by escaping them,
+e.g., ``\n`` is interpreted as a newline. To prevent them from being
+interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
+
+See also :hg:`help patterns`.
+
+Operators
+=========
+
+There is a single prefix operator:
+
+``not x``
+  Files not in x. Short form is ``! x``.
+
+These are the supported infix operators:
+
+``x and y``
+  The intersection of files in x and y. Short form is ``x & y``.
+
+``x or y``
+  The union of files in x and y. There are two alternative short
+  forms: ``x | y`` and ``x + y``.
+
+``x - y``
+  Files in x but not in y.
+
+Predicates
+==========
+
+The following predicates are supported:
+
+.. predicatesmarker
+
+Examples
+========
+
+Some sample queries:
+
+- Show status of files that appear to be binary in the working directory::
+
+    hg status -A "set:binary()"
+
+- Forget files that are in .hgignore but are already tracked::
+
+    hg forget "set:hgignore() and not ignored()"
+
+- Find text files that contain a string::
+
+    hg files "set:grep(magic) and not binary()"
+
+- Find C files in a non-standard encoding::
+
+    hg files "set:**.c and not encoding('UTF-8')"
+
+- Revert copies of large binary files::
+
+    hg revert "set:copied() and binary() and size('>1M')"
+
+- Revert files that were added to the working directory::
+
+    hg revert "set:revs('wdir()', added())"
+
+- Remove files listed in foo.lst that contain the letter a or b::
+
+    hg remove "set: listfile:foo.lst and (**a* or **b*)"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/flags.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,104 @@
+Most Mercurial commands accept various flags.
+
+Flag names
+==========
+
+Flags for each command are listed in :hg:`help` for that command.
+Additionally, some flags, such as --repository, are global and can be used with
+any command - those are seen in :hg:`help -v`, and can be specified before or
+after the command.
+
+Every flag has at least a long name, such as --repository. Some flags may also
+have a short one-letter name, such as the equivalent -R. Using the short or long
+name is equivalent and has the same effect.
+
+Flags that have a short name can also be bundled together - for instance, to
+specify both --edit (short -e) and --interactive (short -i), one could use::
+
+    hg commit -ei
+
+If any of the bundled flags takes a value (i.e. is not a boolean), it must be
+last, followed by the value::
+
+    hg commit -im 'Message'
+
+Flag types
+==========
+
+Mercurial command-line flags can be strings, numbers, booleans, or lists of
+strings.
+
+Specifying flag values
+======================
+
+The following syntaxes are allowed, assuming a flag 'flagname' with short name
+'f'::
+
+    --flagname=foo
+    --flagname foo
+    -f foo
+    -ffoo
+
+This syntax applies to all non-boolean flags (strings, numbers or lists).
+
+Specifying boolean flags
+========================
+
+Boolean flags do not take a value parameter. To specify a boolean, use the flag
+name to set it to true, or the same name prefixed with 'no-' to set it to
+false::
+
+    hg commit --interactive
+    hg commit --no-interactive
+
+Specifying list flags
+=====================
+
+List flags take multiple values. To specify them, pass the flag multiple times::
+
+    hg files --include mercurial --include tests
+
+Setting flag defaults
+=====================
+
+In order to set a default value for a flag in an hgrc file, it is recommended to
+use aliases::
+
+    [alias]
+    commit = commit --interactive
+
+For more information on hgrc files, see :hg:`help config`.
+
+Overriding flags on the command line
+====================================
+
+If the same non-list flag is specified multiple times on the command line, the
+latest specification is used::
+
+    hg commit -m "Ignored value" -m "Used value"
+
+This includes the use of aliases - e.g., if one has::
+
+    [alias]
+    committemp = commit -m "Ignored value"
+
+then the following command will override that -m::
+
+    hg committemp -m "Used value"
+
+Overriding flag defaults
+========================
+
+Every flag has a default value, and you may also set your own defaults in hgrc
+as described above.
+Except for list flags, defaults can be overridden on the command line simply by
+specifying the flag in that location.
+
+Hidden flags
+============
+
+Some flags are not shown in a command's help by default - specifically, those
+that are deemed to be experimental, deprecated or advanced. To show all flags,
+add the --verbose flag for the help command::
+
+    hg help --verbose commit
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/glossary.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,413 @@
+Ancestor
+    Any changeset that can be reached by an unbroken chain of parent
+    changesets from a given changeset. More precisely, the ancestors
+    of a changeset can be defined by two properties: a parent of a
+    changeset is an ancestor, and a parent of an ancestor is an
+    ancestor. See also: 'Descendant'.
+
+Bookmark
+    Bookmarks are pointers to certain commits that move when
+    committing. They are similar to tags in that it is possible to use
+    bookmark names in all places where Mercurial expects a changeset
+    ID, e.g., with :hg:`update`. Unlike tags, bookmarks move along
+    when you make a commit.
+
+    Bookmarks can be renamed, copied and deleted. Bookmarks are local,
+    unless they are explicitly pushed or pulled between repositories.
+    Pushing and pulling bookmarks allow you to collaborate with others
+    on a branch without creating a named branch.
+
+Branch
+    (Noun) A child changeset that has been created from a parent that
+    is not a head. These are known as topological branches, see
+    'Branch, topological'. If a topological branch is named, it becomes
+    a named branch. If a topological branch is not named, it becomes
+    an anonymous branch. See 'Branch, anonymous' and 'Branch, named'.
+
+    Branches may be created when changes are pulled from or pushed to
+    a remote repository, since new heads may be created by these
+    operations. Note that the term branch can also be used informally
+    to describe a development process in which certain development is
+    done independently of other development. This is sometimes done
+    explicitly with a named branch, but it can also be done locally,
+    using bookmarks or clones and anonymous branches.
+
+    Example: "The experimental branch."
+
+    (Verb) The action of creating a child changeset which results in
+    its parent having more than one child.
+
+    Example: "I'm going to branch at X."
+
+Branch, anonymous
+    Every time a new child changeset is created from a parent that is not
+    a head and the name of the branch is not changed, a new anonymous
+    branch is created.
+
+Branch, closed
+    A named branch whose branch heads have all been closed.
+
+Branch, default
+    The branch assigned to a changeset when no name has previously been
+    assigned.
+
+Branch head
+    See 'Head, branch'.
+
+Branch, inactive
+    If a named branch has no topological heads, it is considered to be
+    inactive. As an example, a feature branch becomes inactive when it
+    is merged into the default branch. The :hg:`branches` command
+    shows inactive branches by default, though they can be hidden with
+    :hg:`branches --active`.
+
+    NOTE: this concept is deprecated because it is too implicit.
+    Branches should now be explicitly closed using :hg:`commit
+    --close-branch` when they are no longer needed.
+
+Branch, named
+    A collection of changesets which have the same branch name. By
+    default, children of a changeset in a named branch belong to the
+    same named branch. A child can be explicitly assigned to a
+    different branch. See :hg:`help branch`, :hg:`help branches` and
+    :hg:`commit --close-branch` for more information on managing
+    branches.
+
+    Named branches can be thought of as a kind of namespace, dividing
+    the collection of changesets that comprise the repository into a
+    collection of disjoint subsets. A named branch is not necessarily
+    a topological branch. If a new named branch is created from the
+    head of another named branch, or the default branch, but no
+    further changesets are added to that previous branch, then that
+    previous branch will be a branch in name only.
+
+Branch tip
+    See 'Tip, branch'.
+
+Branch, topological
+    Every time a new child changeset is created from a parent that is
+    not a head, a new topological branch is created. If a topological
+    branch is named, it becomes a named branch. If a topological
+    branch is not named, it becomes an anonymous branch of the
+    current, possibly default, branch.
+
+Changelog
+    A record of the changesets in the order in which they were added
+    to the repository. This includes details such as changeset id,
+    author, commit message, date, and list of changed files.
+
+Changeset
+    A snapshot of the state of the repository used to record a change.
+
+Changeset, child
+    The converse of parent changeset: if P is a parent of C, then C is
+    a child of P. There is no limit to the number of children that a
+    changeset may have.
+
+Changeset id
+    A SHA-1 hash that uniquely identifies a changeset. It may be
+    represented as either a "long" 40 hexadecimal digit string, or a
+    "short" 12 hexadecimal digit string.
+
+Changeset, merge
+    A changeset with two parents. This occurs when a merge is
+    committed.
+
+Changeset, parent
+    A revision upon which a child changeset is based. Specifically, a
+    parent changeset of a changeset C is a changeset whose node
+    immediately precedes C in the DAG. Changesets have at most two
+    parents.
+
+Checkout
+    (Noun) The working directory being updated to a specific
+    revision. This use should probably be avoided where possible, as
+    changeset is much more appropriate than checkout in this context.
+
+    Example: "I'm using checkout X."
+
+    (Verb) Updating the working directory to a specific changeset. See
+    :hg:`help update`.
+
+    Example: "I'm going to check out changeset X."
+
+Child changeset
+    See 'Changeset, child'.
+
+Close changeset
+    See 'Head, closed branch'.
+
+Closed branch
+    See 'Branch, closed'.
+
+Clone
+    (Noun) An entire or partial copy of a repository. The partial
+    clone must be in the form of a revision and its ancestors.
+
+    Example: "Is your clone up to date?"
+
+    (Verb) The process of creating a clone, using :hg:`clone`.
+
+    Example: "I'm going to clone the repository."
+
+Closed branch head
+    See 'Head, closed branch'.
+
+Commit
+    (Noun) A synonym for changeset.
+
+    Example: "Is the bug fixed in your recent commit?"
+
+    (Verb) The act of recording changes to a repository. When files
+    are committed in a working directory, Mercurial finds the
+    differences between the committed files and their parent
+    changeset, creating a new changeset in the repository.
+
+    Example: "You should commit those changes now."
+
+Cset
+    A common abbreviation of the term changeset.
+
+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.
+
+Deprecated
+    Feature removed from documentation, but not scheduled for removal.
+
+Default branch
+    See 'Branch, default'.
+
+Descendant
+    Any changeset that can be reached by a chain of child changesets
+    from a given changeset. More precisely, the descendants of a
+    changeset can be defined by two properties: the child of a
+    changeset is a descendant, and the child of a descendant is a
+    descendant. See also: 'Ancestor'.
+
+Diff
+    (Noun) The difference between the contents and attributes of files
+    in two changesets or a changeset and the current working
+    directory. The difference is usually represented in a standard
+    form called a "diff" or "patch". The "git diff" format is used
+    when the changes include copies, renames, or changes to file
+    attributes, none of which can be represented/handled by classic
+    "diff" and "patch".
+
+    Example: "Did you see my correction in the diff?"
+
+    (Verb) Diffing two changesets is the action of creating a diff or
+    patch.
+
+    Example: "If you diff with changeset X, you will see what I mean."
+
+Directory, working
+    The working directory represents the state of the files tracked by
+    Mercurial, that will be recorded in the next commit. The working
+    directory initially corresponds to the snapshot at an existing
+    changeset, known as the parent of the working directory. See
+    'Parent, working directory'. The state may be modified by changes
+    to the files introduced manually or by a merge. The repository
+    metadata exists in the .hg directory inside the working directory.
+
+Draft
+    Changesets in the draft phase have not been shared with publishing
+    repositories and may thus be safely changed by history-modifying
+    extensions. See :hg:`help phases`.
+
+Experimental
+    Feature that may change or be removed at a later date.
+
+Graph
+    See DAG and :hg:`log --graph`.
+
+Head
+    The term 'head' may be used to refer to both a branch head or a
+    repository head, depending on the context. See 'Head, branch' and
+    'Head, repository' for specific definitions.
+
+    Heads are where development generally takes place and are the
+    usual targets for update and merge operations.
+
+Head, branch
+    A changeset with no descendants on the same named branch.
+
+Head, closed branch
+    A changeset that marks a head as no longer interesting. The closed
+    head is no longer listed by :hg:`heads`. A branch is considered
+    closed when all its heads are closed and consequently is not
+    listed by :hg:`branches`.
+
+    Closed heads can be re-opened by committing new changeset as the
+    child of the changeset that marks a head as closed.
+
+Head, repository
+    A topological head which has not been closed.
+
+Head, topological
+    A changeset with no children in the repository.
+
+History, immutable
+    Once committed, changesets cannot be altered.  Extensions which
+    appear to change history actually create new changesets that
+    replace existing ones, and then destroy the old changesets. Doing
+    so in public repositories can result in old changesets being
+    reintroduced to the repository.
+
+History, rewriting
+    The changesets in a repository are immutable. However, extensions
+    to Mercurial can be used to alter the repository, usually in such
+    a way as to preserve changeset contents.
+
+Immutable history
+    See 'History, immutable'.
+
+Merge changeset
+    See 'Changeset, merge'.
+
+Manifest
+    Each changeset has a manifest, which is the list of files that are
+    tracked by the changeset.
+
+Merge
+    Used to bring together divergent branches of work. When you update
+    to a changeset and then merge another changeset, you bring the
+    history of the latter changeset into your working directory. Once
+    conflicts are resolved (and marked), this merge may be committed
+    as a merge changeset, bringing two branches together in the DAG.
+
+Named branch
+    See 'Branch, named'.
+
+Null changeset
+    The empty changeset. It is the parent state of newly-initialized
+    repositories and repositories with no checked out revision. It is
+    thus the parent of root changesets and the effective ancestor when
+    merging unrelated changesets. Can be specified by the alias 'null'
+    or by the changeset ID '000000000000'.
+
+Parent
+    See 'Changeset, parent'.
+
+Parent changeset
+    See 'Changeset, parent'.
+
+Parent, working directory
+    The working directory parent reflects a virtual revision which is
+    the child of the changeset (or two changesets with an uncommitted
+    merge) shown by :hg:`parents`. This is changed with
+    :hg:`update`. Other commands to see the working directory parent
+    are :hg:`summary` and :hg:`id`. Can be specified by the alias ".".
+
+Patch
+    (Noun) The product of a diff operation.
+
+    Example: "I've sent you my patch."
+
+    (Verb) The process of using a patch file to transform one
+    changeset into another.
+
+    Example: "You will need to patch that revision."
+
+Phase
+    A per-changeset state tracking how the changeset has been or
+    should be shared. See :hg:`help phases`.
+
+Public
+    Changesets in the public phase have been shared with publishing
+    repositories and are therefore considered immutable. See :hg:`help
+    phases`.
+
+Pull
+    An operation in which changesets in a remote repository which are
+    not in the local repository are brought into the local
+    repository. Note that this operation without special arguments
+    only updates the repository, it does not update the files in the
+    working directory. See :hg:`help pull`.
+
+Push
+    An operation in which changesets in a local repository which are
+    not in a remote repository are sent to the remote repository. Note
+    that this operation only adds changesets which have been committed
+    locally to the remote repository. Uncommitted changes are not
+    sent. See :hg:`help push`.
+
+Repository
+    The metadata describing all recorded states of a collection of
+    files. Each recorded state is represented by a changeset. A
+    repository is usually (but not always) found in the ``.hg``
+    subdirectory of a working directory. Any recorded state can be
+    recreated by "updating" a working directory to a specific
+    changeset.
+
+Repository head
+    See 'Head, repository'.
+
+Revision
+    A state of the repository at some point in time. Earlier revisions
+    can be updated to by using :hg:`update`.  See also 'Revision
+    number'; See also 'Changeset'.
+
+Revision number
+    This integer uniquely identifies a changeset in a specific
+    repository. It represents the order in which changesets were added
+    to a repository, starting with revision number 0. Note that the
+    revision number may be different in each clone of a repository. To
+    identify changesets uniquely between different clones, see
+    'Changeset id'.
+
+Revlog
+    History storage mechanism used by Mercurial. It is a form of delta
+    encoding, with occasional full revision of data followed by delta
+    of each successive revision. It includes data and an index
+    pointing to the data.
+
+Rewriting history
+    See 'History, rewriting'.
+
+Root
+    A changeset that has only the null changeset as its parent. Most
+    repositories have only a single root changeset.
+
+Secret
+    Changesets in the secret phase may not be shared via push, pull,
+    or clone. See :hg:`help phases`.
+
+Tag
+    An alternative name given to a changeset. Tags can be used in all
+    places where Mercurial expects a changeset ID, e.g., with
+    :hg:`update`. The creation of a tag is stored in the history and
+    will thus automatically be shared with other using push and pull.
+
+Tip
+    The changeset with the highest revision number. It is the changeset
+    most recently added in a repository.
+
+Tip, branch
+    The head of a given branch with the highest revision number. When
+    a branch name is used as a revision identifier, it refers to the
+    branch tip. See also 'Branch, head'. Note that because revision
+    numbers may be different in different repository clones, the
+    branch tip may be different in different cloned repositories.
+
+Update
+    (Noun) Another synonym of changeset.
+
+    Example: "I've pushed an update."
+
+    (Verb) This term is usually used to describe updating the state of
+    the working directory to that of a specific changeset. See
+    :hg:`help update`.
+
+    Example: "You should update."
+
+Working directory
+    See 'Directory, working'.
+
+Working directory parent
+    See 'Parent, working directory'.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/hg-ssh.8.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,71 @@
+========
+ hg-ssh
+========
+
+----------------------------------------
+restricted ssh login shell for Mercurial
+----------------------------------------
+
+:Author:         Thomas Arendsen Hein <thomas@intevation.de>
+:Organization:   Mercurial
+:Manual section: 8
+:Manual group:   Mercurial Manual
+
+.. contents::
+   :backlinks: top
+   :class: htmlonly
+   :depth: 1
+
+Synopsis
+""""""""
+**hg-ssh** repositories...
+
+Description
+"""""""""""
+**hg-ssh** is a wrapper for ssh access to a limited set of mercurial repos.
+
+To be used in ~/.ssh/authorized_keys with the "command" option, see sshd(8):
+command="hg-ssh path/to/repo1 /path/to/repo2 ~/repo3 ~user/repo4" ssh-dss ...
+(probably together with these other useful options:
+no-port-forwarding,no-X11-forwarding,no-agent-forwarding)
+
+This allows pull/push over ssh from/to the repositories given as arguments.
+
+If all your repositories are subdirectories of a common directory, you can
+allow shorter paths with:
+command="cd path/to/my/repositories && hg-ssh repo1 subdir/repo2"
+
+You can use pattern matching of your normal shell, e.g.:
+command="cd repos && hg-ssh user/thomas/* projects/{mercurial,foo}"
+
+You can also add a --read-only flag to allow read-only access to a key, e.g.:
+command="hg-ssh --read-only repos/\*"
+
+Bugs
+""""
+Probably lots, please post them to the mailing list (see Resources_
+below) when you find them.
+
+See Also
+""""""""
+|hg(1)|_
+
+Author
+""""""
+Written by Matt Mackall <mpm@selenic.com>
+
+Resources
+"""""""""
+Main Web Site: https://mercurial-scm.org/
+
+Source code repository: https://www.mercurial-scm.org/repo/hg
+
+Mailing list: https://www.mercurial-scm.org/mailman/listinfo/mercurial/
+
+Copying
+"""""""
+Copyright (C) 2005-2016 Matt Mackall.
+Free use of this software is granted under the terms of the GNU General
+Public License version 2 or any later version.
+
+.. include:: common.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/hg.1.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,119 @@
+====
+ hg
+====
+
+---------------------------------------
+Mercurial source code management system
+---------------------------------------
+
+:Author:         Matt Mackall <mpm@selenic.com>
+:Organization:   Mercurial
+:Manual section: 1
+:Manual group:   Mercurial Manual
+
+.. contents::
+   :backlinks: top
+   :class: htmlonly
+   :depth: 1
+
+
+Synopsis
+""""""""
+**hg** *command* [*option*]... [*argument*]...
+
+Description
+"""""""""""
+The **hg** command provides a command line interface to the Mercurial
+system.
+
+Command Elements
+""""""""""""""""
+
+files...
+    indicates one or more filename or relative path filenames; see
+    `File Name Patterns`_ for information on pattern matching
+
+path
+    indicates a path on the local machine
+
+revision
+    indicates a changeset which can be specified as a changeset
+    revision number, a tag, or a unique substring of the changeset
+    hash value
+
+repository path
+    either the pathname of a local repository or the URI of a remote
+    repository.
+
+.. include:: hg.1.gendoc.txt
+
+Files
+"""""
+
+``/etc/mercurial/hgrc``, ``$HOME/.hgrc``, ``.hg/hgrc``
+    This file contains defaults and configuration. Values in
+    ``.hg/hgrc`` override those in ``$HOME/.hgrc``, and these override
+    settings made in the global ``/etc/mercurial/hgrc`` configuration.
+    See |hgrc(5)|_ for details of the contents and format of these
+    files.
+
+``.hgignore``
+    This file contains regular expressions (one per line) that
+    describe file names that should be ignored by **hg**. For details,
+    see |hgignore(5)|_.
+
+``.hgsub``
+    This file defines the locations of all subrepositories, and
+    tells where the subrepository checkouts came from. For details, see
+    :hg:`help subrepos`.
+
+``.hgsubstate``
+    This file is where Mercurial stores all nested repository states. *NB: This
+    file should not be edited manually.*
+
+``.hgtags``
+    This file contains changeset hash values and text tag names (one
+    of each separated by spaces) that correspond to tagged versions of
+    the repository contents. The file content is encoded using UTF-8.
+
+``.hg/last-message.txt``
+    This file is used by :hg:`commit` to store a backup of the commit message
+    in case the commit fails.
+
+``.hg/localtags``
+    This file can be used to define local tags which are not shared among
+    repositories. The file format is the same as for ``.hgtags``, but it is
+    encoded using the local system encoding.
+
+Some commands (e.g. revert) produce backup files ending in ``.orig``,
+if the ``.orig`` file already exists and is not tracked by Mercurial,
+it will be overwritten.
+
+Bugs
+""""
+Probably lots, please post them to the mailing list (see Resources_
+below) when you find them.
+
+See Also
+""""""""
+|hgignore(5)|_, |hgrc(5)|_
+
+Author
+""""""
+Written by Matt Mackall <mpm@selenic.com>
+
+Resources
+"""""""""
+Main Web Site: https://mercurial-scm.org/
+
+Source code repository: https://www.mercurial-scm.org/repo/hg
+
+Mailing list: https://www.mercurial-scm.org/mailman/listinfo/mercurial/
+
+Copying
+"""""""
+Copyright (C) 2005-2019 Matt Mackall.
+Free use of this software is granted under the terms of the GNU General
+Public License version 2 or any later version.
+
+.. include:: common.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/hgignore.5.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,34 @@
+==========
+ hgignore
+==========
+
+---------------------------------
+syntax for Mercurial ignore files
+---------------------------------
+
+:Author:         Vadim Gelfer <vadim.gelfer@gmail.com>
+:Organization:   Mercurial
+:Manual section: 5
+:Manual group:   Mercurial Manual
+
+.. include:: hgignore.5.gendoc.txt
+
+Author
+======
+Vadim Gelfer <vadim.gelfer@gmail.com>
+
+Mercurial was written by Matt Mackall <mpm@selenic.com>.
+
+See Also
+========
+|hg(1)|_, |hgrc(5)|_
+
+Copying
+=======
+This manual page is copyright 2006 Vadim Gelfer.
+Mercurial is copyright 2005-2019 Matt Mackall.
+Free use of this software is granted under the terms of the GNU General
+Public License version 2 or any later version.
+
+.. include:: common.txt
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/hgignore.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,97 @@
+Synopsis
+========
+
+The Mercurial system uses a file called ``.hgignore`` in the root
+directory of a repository to control its behavior when it searches
+for files that it is not currently tracking.
+
+Description
+===========
+
+The working directory of a Mercurial repository will often contain
+files that should not be tracked by Mercurial. These include backup
+files created by editors and build products created by compilers.
+These files can be ignored by listing them in a ``.hgignore`` file in
+the root of the working directory. The ``.hgignore`` file must be
+created manually. It is typically put under version control, so that
+the settings will propagate to other repositories with push and pull.
+
+An untracked file is ignored if its path relative to the repository
+root directory, or any prefix path of that path, is matched against
+any pattern in ``.hgignore``.
+
+For example, say we have an untracked file, ``file.c``, at
+``a/b/file.c`` inside our repository. Mercurial will ignore ``file.c``
+if any pattern in ``.hgignore`` matches ``a/b/file.c``, ``a/b`` or ``a``.
+
+In addition, a Mercurial configuration file can reference a set of
+per-user or global ignore files. See the ``ignore`` configuration
+key on the ``[ui]`` section of :hg:`help config` for details of how to
+configure these files.
+
+To control Mercurial's handling of files that it manages, many
+commands support the ``-I`` and ``-X`` options; see
+:hg:`help <command>` and :hg:`help patterns` for details.
+
+Files that are already tracked are not affected by .hgignore, even
+if they appear in .hgignore. An untracked file X can be explicitly
+added with :hg:`add X`, even if X would be excluded by a pattern
+in .hgignore.
+
+Syntax
+======
+
+An ignore file is a plain text file consisting of a list of patterns,
+with one pattern per line. Empty lines are skipped. The ``#``
+character is treated as a comment character, and the ``\`` character
+is treated as an escape character.
+
+Mercurial supports several pattern syntaxes. The default syntax used
+is Python/Perl-style regular expressions.
+
+To change the syntax used, use a line of the following form::
+
+  syntax: NAME
+
+where ``NAME`` is one of the following:
+
+``regexp``
+  Regular expression, Python/Perl syntax.
+``glob``
+  Shell-style glob.
+``rootglob``
+  A variant of ``glob`` that is rooted (see below).
+
+The chosen syntax stays in effect when parsing all patterns that
+follow, until another syntax is selected.
+
+Neither ``glob`` nor regexp patterns are rooted. A glob-syntax
+pattern of the form ``*.c`` will match a file ending in ``.c`` in any
+directory, and a regexp pattern of the form ``\.c$`` will do the
+same. To root a regexp pattern, start it with ``^``. To get the same
+effect with glob-syntax, you have to use ``rootglob``.
+
+Subdirectories can have their own .hgignore settings by adding
+``subinclude:path/to/subdir/.hgignore`` to the root ``.hgignore``. See
+:hg:`help patterns` for details on ``subinclude:`` and ``include:``.
+
+.. note::
+
+  Patterns specified in other than ``.hgignore`` are always rooted.
+  Please see :hg:`help patterns` for details.
+
+Example
+=======
+
+Here is an example ignore file. ::
+
+  # use glob syntax.
+  syntax: glob
+
+  *.elc
+  *.pyc
+  *~
+
+  # switch to regexp syntax.
+  syntax: regexp
+  ^\.pc/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/hgrc.5.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,41 @@
+======
+ hgrc
+======
+
+---------------------------------
+configuration files for Mercurial
+---------------------------------
+
+:Author:         Bryan O'Sullivan <bos@serpentine.com>
+:Organization:   Mercurial
+:Manual section: 5
+:Manual group:   Mercurial Manual
+
+.. contents::
+   :backlinks: top
+   :class: htmlonly
+
+
+Description
+===========
+
+.. include:: hgrc.5.gendoc.txt
+
+Author
+======
+Bryan O'Sullivan <bos@serpentine.com>.
+
+Mercurial was written by Matt Mackall <mpm@selenic.com>.
+
+See Also
+========
+|hg(1)|_, |hgignore(5)|_
+
+Copying
+=======
+This manual page is copyright 2005 Bryan O'Sullivan.
+Mercurial is copyright 2005-2019 Matt Mackall.
+Free use of this software is granted under the terms of the GNU General
+Public License version 2 or any later version.
+
+.. include:: common.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/hgweb.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,86 @@
+Mercurial's internal web server, hgweb, can serve either a single
+repository, or a tree of repositories. In the second case, repository
+paths and global options can be defined using a dedicated
+configuration file common to :hg:`serve`, ``hgweb.wsgi``,
+``hgweb.cgi`` and ``hgweb.fcgi``.
+
+This file uses the same syntax as other Mercurial configuration files
+but recognizes only the following sections:
+
+  - web
+  - paths
+  - collections
+
+The ``web`` options are thoroughly described in :hg:`help config`.
+
+The ``paths`` section maps URL paths to paths of repositories in the
+filesystem. hgweb will not expose the filesystem directly - only
+Mercurial repositories can be published and only according to the
+configuration.
+
+The left hand side is the path in the URL. Note that hgweb reserves
+subpaths like ``rev`` or ``file``, try using different names for
+nested repositories to avoid confusing effects.
+
+The right hand side is the path in the filesystem. If the specified
+path ends with ``*`` or ``**`` the filesystem will be searched
+recursively for repositories below that point.
+With ``*`` it will not recurse into the repositories it finds (except for
+``.hg/patches``).
+With ``**`` it will also search inside repository working directories
+and possibly find subrepositories.
+
+In this example::
+
+  [paths]
+  /projects/a = /srv/tmprepos/a
+  /projects/b = c:/repos/b
+  / = /srv/repos/*
+  /user/bob = /home/bob/repos/**
+
+- The first two entries make two repositories in different directories
+  appear under the same directory in the web interface
+- The third entry will publish every Mercurial repository found in
+  ``/srv/repos/``, for instance the repository ``/srv/repos/quux/``
+  will appear as ``http://server/quux/``
+- The fourth entry will publish both ``http://server/user/bob/quux/``
+  and ``http://server/user/bob/quux/testsubrepo/``
+
+The ``collections`` section is deprecated and has been superseded by
+``paths``.
+
+URLs and Common Arguments
+=========================
+
+URLs under each repository have the form ``/{command}[/{arguments}]``
+where ``{command}`` represents the name of a command or handler and
+``{arguments}`` represents any number of additional URL parameters
+to that command.
+
+The web server has a default style associated with it. Styles map to
+a collection of named templates. Each template is used to render a
+specific piece of data, such as a changeset or diff.
+
+The style for the current request can be overwritten two ways. First,
+if ``{command}`` contains a hyphen (``-``), the text before the hyphen
+defines the style. For example, ``/atom-log`` will render the ``log``
+command handler with the ``atom`` style. The second way to set the
+style is with the ``style`` query string argument. For example,
+``/log?style=atom``. The hyphenated URL parameter is preferred.
+
+Not all templates are available for all styles. Attempting to use
+a style that doesn't have all templates defined may result in an error
+rendering the page.
+
+Many commands take a ``{revision}`` URL parameter. This defines the
+changeset to operate on. This is commonly specified as the short,
+12 digit hexadecimal abbreviation for the full 40 character unique
+revision identifier. However, any value described by
+:hg:`help revisions` typically works.
+
+Commands and URLs
+=================
+
+The following web commands and their URLs are available:
+
+  .. webcommandsmarker
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/bundle2.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,677 @@
+Bundle2 refers to a data format that is used for both on-disk storage
+and over-the-wire transfer of repository data and state.
+
+The data format allows the capture of multiple components of
+repository data. Contrast with the initial bundle format, which
+only captured *changegroup* data (and couldn't store bookmarks,
+phases, etc).
+
+Bundle2 is used for:
+
+* Transferring data from a repository (e.g. as part of an ``hg clone``
+  or ``hg pull`` operation).
+* Transferring data to a repository (e.g. as part of an ``hg push``
+  operation).
+* Storing data on disk (e.g. the result of an ``hg bundle``
+  operation).
+* Transferring the results of a repository operation (e.g. the
+  reply to an ``hg push`` operation).
+
+At its highest level, a bundle2 payload is a stream that begins
+with some metadata and consists of a series of *parts*, with each
+part describing repository data or state or the result of an
+operation. New bundle2 parts are introduced over time when there is
+a need to capture a new form of data. A *capabilities* mechanism
+exists to allow peers to understand which bundle2 parts the other
+understands.
+
+Stream Format
+=============
+
+A bundle2 payload consists of a magic string (``HG20``) followed by
+stream level parameters, followed by any number of payload *parts*.
+
+It may help to think of the stream level parameters as *headers* and the
+payload parts as the *body*.
+
+Stream Level Parameters
+-----------------------
+
+Following the magic string is data that defines parameters applicable to the
+entire payload.
+
+Stream level parameters begin with a 32-bit unsigned big-endian integer.
+The value of this integer defines the number of bytes of stream level
+parameters that follow.
+
+The *N* bytes of raw data contains a space separated list of parameters.
+Each parameter consists of a required name and an optional value.
+
+Parameters have the form ``<name>`` or ``<name>=<value>``.
+
+Both the parameter name and value are URL quoted.
+
+Names MUST start with a letter. If the first letter is lower case, the
+parameter is advisory and can safely be ignored. If the first letter
+is upper case, the parameter is mandatory and the handler MUST stop if
+it is unable to process it.
+
+Stream level parameters apply to the entire bundle2 payload. Lower-level
+options should go into a bundle2 part instead.
+
+The following stream level parameters are defined:
+
+Compression
+   Compression format of payload data. ``GZ`` denotes zlib. ``BZ``
+   denotes bzip2. ``ZS`` denotes zstandard.
+
+   When defined, all bytes after the stream level parameters are
+   compressed using the compression format defined by this parameter.
+
+   If this parameter isn't present, data is raw/uncompressed.
+
+   This parameter MUST be mandatory because attempting to consume
+   streams without knowing how to decode the underlying bytes will
+   result in errors.
+
+Payload Part
+------------
+
+Following the stream level parameters are 0 or more payload parts. Each
+payload part consists of a header and a body.
+
+The payload part header consists of a 32-bit unsigned big-endian integer
+defining the number of bytes in the header that follow. The special
+value ``0`` indicates the end of the bundle2 stream.
+
+The binary format of the part header is as follows:
+
+* 8-bit unsigned size of the part name
+* N-bytes alphanumeric part name
+* 32-bit unsigned big-endian part ID
+* N bytes part parameter data
+
+The *part name* identifies the type of the part. A part name with an
+UPPERCASE letter is mandatory. Otherwise, the part is advisory. A
+consumer should abort if it encounters a mandatory part it doesn't know
+how to process. See the sections below for each defined part type.
+
+The *part ID* is a unique identifier within the bundle used to refer to a
+specific part. It should be unique within the bundle2 payload.
+
+Part parameter data consists of:
+
+* 1 byte number of mandatory parameters
+* 1 byte number of advisory parameters
+* 2 * N bytes of sizes of parameter key and values
+* N * M blobs of values for parameter key and values
+
+Following the 2 bytes of mandatory and advisory parameter counts are
+2-tuples of bytes of the sizes of each parameter. e.g.
+(<key size>, <value size>).
+
+Following that are the raw values, without padding. Mandatory parameters
+come first, followed by advisory parameters.
+
+Each parameter's key MUST be unique within the part.
+
+Following the part parameter data is the part payload. The part payload
+consists of a series of framed chunks. The frame header is a 32-bit
+big-endian integer defining the size of the chunk. The N bytes of raw
+payload data follows.
+
+The part payload consists of 0 or more chunks.
+
+A chunk with size ``0`` denotes the end of the part payload. Therefore,
+there will always be at least 1 32-bit integer following the payload
+part header.
+
+A chunk size of ``-1`` is used to signal an *interrupt*. If such a chunk
+size is seen, the stream processor should process the next bytes as a new
+payload part. After this payload part, processing of the original,
+interrupted part should resume.
+
+Capabilities
+============
+
+Bundle2 is a dynamic format that can evolve over time. For example,
+when a new repository data concept is invented, a new bundle2 part
+is typically invented to hold that data. In addition, parts performing
+similar functionality may come into existence if there is a better
+mechanism for performing certain functionality.
+
+Because the bundle2 format evolves over time, peers need to understand
+what bundle2 features the other can understand. The *capabilities*
+mechanism is how those features are expressed.
+
+Bundle2 capabilities are logically expressed as a dictionary of
+string key-value pairs where the keys are strings and the values
+are lists of strings.
+
+Capabilities are encoded for exchange between peers. The encoded
+capabilities blob consists of a newline (``\n``) delimited list of
+entries. Each entry has the form ``<key>`` or ``<key>=<value>``,
+depending if the capability has a value.
+
+The capability name is URL quoted (``%XX`` encoding of URL unsafe
+characters).
+
+The value, if present, is formed by URL quoting each value in
+the capability list and concatenating the result with a comma (``,``).
+
+For example, the capabilities ``novaluekey`` and ``listvaluekey``
+with values ``value 1`` and ``value 2``. This would be encoded as:
+
+   listvaluekey=value%201,value%202\nnovaluekey
+
+The sections below detail the defined bundle2 capabilities.
+
+HG20
+----
+
+Denotes that the peer supports the bundle2 data format.
+
+bookmarks
+---------
+
+Denotes that the peer supports the ``bookmarks`` part.
+
+Peers should not issue mandatory ``bookmarks`` parts unless this
+capability is present.
+
+changegroup
+-----------
+
+Denotes which versions of the *changegroup* format the peer can
+receive. Values include ``01``, ``02``, and ``03``.
+
+The peer should not generate changegroup data for a version not
+specified by this capability.
+
+checkheads
+----------
+
+Denotes which forms of heads checking the peer supports.
+
+If ``related`` is in the value, then the peer supports the ``check:heads``
+part and the peer is capable of detecting race conditions when applying
+changelog data.
+
+digests
+-------
+
+Denotes which hashing formats the peer supports.
+
+Values are names of hashing function. Values include ``md5``, ``sha1``,
+and ``sha512``.
+
+error
+-----
+
+Denotes which ``error:`` parts the peer supports.
+
+Value is a list of strings of ``error:`` part names. Valid values
+include ``abort``, ``unsupportecontent``, ``pushraced``, and ``pushkey``.
+
+Peers should not issue an ``error:`` part unless the type of that
+part is listed as supported by this capability.
+
+listkeys
+--------
+
+Denotes that the peer supports the ``listkeys`` part.
+
+hgtagsfnodes
+------------
+
+Denotes that the peer supports the ``hgtagsfnodes`` part.
+
+obsmarkers
+----------
+
+Denotes that the peer supports the ``obsmarker`` part and which versions
+of the obsolescence data format it can receive. Values are strings like
+``V<N>``. e.g. ``V1``.
+
+phases
+------
+
+Denotes that the peer supports the ``phases`` part.
+
+pushback
+--------
+
+Denotes that the peer supports sending/receiving bundle2 data in response
+to a bundle2 request.
+
+This capability is typically used by servers that employ server-side
+rewriting of pushed repository data. For example, a server may wish to
+automatically rebase pushed changesets. When this capability is present,
+the server can send a bundle2 response containing the rewritten changeset
+data and the client will apply it.
+
+pushkey
+-------
+
+Denotes that the peer supports the ``puskey`` part.
+
+remote-changegroup
+------------------
+
+Denotes that the peer supports the ``remote-changegroup`` part and
+which protocols it can use to fetch remote changegroup data.
+
+Values are protocol names. e.g. ``http`` and ``https``.
+
+stream
+------
+
+Denotes that the peer supports ``stream*`` parts in order to support
+*stream clone*.
+
+Values are which ``stream*`` parts the peer supports. ``v2`` denotes
+support for the ``stream2`` part.
+
+Bundle2 Part Types
+==================
+
+The sections below detail the various bundle2 part types.
+
+bookmarks
+---------
+
+The ``bookmarks`` part holds bookmarks information.
+
+This part has no parameters.
+
+The payload consists of entries defining bookmarks. Each entry consists of:
+
+* 20 bytes binary changeset node.
+* 2 bytes big endian short defining bookmark name length.
+* N bytes defining bookmark name.
+
+Receivers typically update bookmarks to match the state specified in
+this part.
+
+changegroup
+-----------
+
+The ``changegroup`` part contains *changegroup* data (changelog, manifestlog,
+and filelog revision data).
+
+The following part parameters are defined for this part.
+
+version
+   Changegroup version string. e.g. ``01``, ``02``, and ``03``. This parameter
+   determines how to interpret the changegroup data within the part.
+
+nbchanges
+   The number of changesets in this changegroup. This parameter can be used
+   to aid in the display of progress bars, etc during part application.
+
+treemanifest
+   Whether the changegroup contains tree manifests.
+
+targetphase
+   The target phase of changesets in this part. Value is an integer of
+   the target phase.
+
+The payload of this part is raw changegroup data. See
+:hg:`help internals.changegroups` for the format of changegroup data.
+
+check:bookmarks
+---------------
+
+The ``check:bookmarks`` part is inserted into a bundle as a means for the
+receiver to validate that the sender's known state of bookmarks matches
+the receiver's.
+
+This part has no parameters.
+
+The payload is a binary stream of bookmark data. Each entry in the stream
+consists of:
+
+* 20 bytes binary node that bookmark is associated with
+* 2 bytes unsigned short defining length of bookmark name
+* N bytes containing the bookmark name
+
+If all bits in the node value are ``1``, then this signifies a missing
+bookmark.
+
+When the receiver encounters this part, for each bookmark in the part
+payload, it should validate that the current bookmark state matches
+the specified state. If it doesn't, then the receiver should take
+appropriate action. (In the case of pushes, this mismatch signifies
+a race condition and the receiver should consider rejecting the push.)
+
+check:heads
+-----------
+
+The ``check:heads`` part is a means to validate that the sender's state
+of DAG heads matches the receiver's.
+
+This part has no parameters.
+
+The body of this part is an array of 20 byte binary nodes representing
+changeset heads.
+
+Receivers should compare the set of heads defined in this part to the
+current set of repo heads and take action if there is a mismatch in that
+set.
+
+Note that this part applies to *all* heads in the repo.
+
+check:phases
+------------
+
+The ``check:phases`` part validates that the sender's state of phase
+boundaries matches the receiver's.
+
+This part has no parameters.
+
+The payload consists of an array of 24 byte entries. Each entry is
+a big endian 32-bit integer defining the phase integer and 20 byte
+binary node value.
+
+For each changeset defined in this part, the receiver should validate
+that its current phase matches the phase defined in this part. The
+receiver should take appropriate action if a mismatch occurs.
+
+check:updated-heads
+-------------------
+
+The ``check:updated-heads`` part validates that the sender's state of
+DAG heads updated by this bundle matches the receiver's.
+
+This type is nearly identical to ``check:heads`` except the heads
+in the payload are only a subset of heads in the repository. The
+receiver should validate that all nodes specified by the sender are
+branch heads and take appropriate action if not.
+
+error:abort
+-----------
+
+The ``error:abort`` part conveys a fatal error.
+
+The following part parameters are defined:
+
+message
+   The string content of the error message.
+
+hint
+   Supplemental string giving a hint on how to fix the problem.
+
+error:pushkey
+-------------
+
+The ``error:pushkey`` part conveys an error in the *pushkey* protocol.
+
+The following part parameters are defined:
+
+namespace
+   The pushkey domain that exhibited the error.
+
+key
+   The key whose update failed.
+
+new
+   The value we tried to set the key to.
+
+old
+   The old value of the key (as supplied by the client).
+
+ret
+   The integer result code for the pushkey request.
+
+in-reply-to
+   Part ID that triggered this error.
+
+This part is generated if there was an error applying *pushkey* data.
+Pushkey data includes bookmarks, phases, and obsolescence markers.
+
+error:pushraced
+---------------
+
+The ``error:pushraced`` part conveys that an error occurred and
+the likely cause is losing a race with another pusher.
+
+The following part parameters are defined:
+
+message
+   String error message.
+
+This part is typically emitted when a receiver examining ``check:*``
+parts encountered inconsistency between incoming state and local state.
+The likely cause of that inconsistency is another repository change
+operation (often another client performing an ``hg push``).
+
+error:unsupportedcontent
+------------------------
+
+The ``error:unsupportedcontent`` part conveys that a bundle2 receiver
+encountered a part or content it was not able to handle.
+
+The following part parameters are defined:
+
+parttype
+   The name of the part that triggered this error.
+
+params
+   ``\0`` delimited list of parameters.
+
+hgtagsfnodes
+------------
+
+The ``hgtagsfnodes`` type defines file nodes for the ``.hgtags`` file
+for various changesets.
+
+This part has no parameters.
+
+The payload is an array of pairs of 20 byte binary nodes. The first node
+is a changeset node. The second node is the ``.hgtags`` file node.
+
+Resolving tags requires resolving the ``.hgtags`` file node for changesets.
+On large repositories, this can be expensive. Repositories cache the
+mapping of changeset to ``.hgtags`` file node on disk as a performance
+optimization. This part allows that cached data to be transferred alongside
+changeset data.
+
+Receivers should update their ``.hgtags`` cache file node mappings with
+the incoming data.
+
+listkeys
+--------
+
+The ``listkeys`` part holds content for a *pushkey* namespace.
+
+The following part parameters are defined:
+
+namespace
+   The pushkey domain this data belongs to.
+
+The part payload contains a newline (``\n``) delimited list of
+tab (``\t``) delimited key-value pairs defining entries in this pushkey
+namespace.
+
+obsmarkers
+----------
+
+The ``obsmarkers`` part defines obsolescence markers.
+
+This part has no parameters.
+
+The payload consists of obsolescence markers using the on-disk markers
+format. The first byte defines the version format.
+
+The receiver should apply the obsolescence markers defined in this
+part. A ``reply:obsmarkers`` part should be sent to the sender, if possible.
+
+output
+------
+
+The ``output`` part is used to display output on the receiver.
+
+This part has no parameters.
+
+The payload consists of raw data to be printed on the receiver.
+
+phase-heads
+-----------
+
+The ``phase-heads`` part defines phase boundaries.
+
+This part has no parameters.
+
+The payload consists of an array of 24 byte entries. Each entry is
+a big endian 32-bit integer defining the phase integer and 20 byte
+binary node value.
+
+pushkey
+-------
+
+The ``pushkey`` part communicates an intent to perform a ``pushkey``
+request.
+
+The following part parameters are defined:
+
+namespace
+   The pushkey domain to operate on.
+
+key
+   The key within the pushkey namespace that is being changed.
+
+old
+   The old value for the key being changed.
+
+new
+   The new value for the key being changed.
+
+This part has no payload.
+
+The receiver should perform a pushkey operation as described by this
+part's parameters.
+
+If the pushey operation fails, a ``reply:pushkey`` part should be sent
+back to the sender, if possible. The ``in-reply-to`` part parameter
+should reference the source part.
+
+pushvars
+--------
+
+The ``pushvars`` part defines environment variables that should be
+set when processing this bundle2 payload.
+
+The part's advisory parameters define environment variables.
+
+There is no part payload.
+
+When received, part parameters are prefixed with ``USERVAR_`` and the
+resulting variables are defined in the hooks context for the current
+bundle2 application. This part provides a mechanism for senders to
+inject extra state into the hook execution environment on the receiver.
+
+remote-changegroup
+------------------
+
+The ``remote-changegroup`` part defines an external location of a bundle
+to apply. This part can be used by servers to serve pre-generated bundles
+hosted at arbitrary URLs.
+
+The following part parameters are defined:
+
+url
+   The URL of the remote bundle.
+
+size
+   The size in bytes of the remote bundle.
+
+digests
+   A space separated list of the digest types provided in additional
+   part parameters.
+
+digest:<type>
+   The hexadecimal representation of the digest (hash) of the remote bundle.
+
+There is no payload for this part type.
+
+When encountered, clients should attempt to fetch the URL being advertised
+and read and apply it as a bundle.
+
+The ``size`` and ``digest:<type>`` parameters should be used to validate
+that the downloaded bundle matches what was advertised. If a mismatch occurs,
+the client should abort.
+
+reply:changegroup
+-----------------
+
+The ``reply:changegroup`` part conveys the results of application of a
+``changegroup`` part.
+
+The following part parameters are defined:
+
+return
+   Integer return code from changegroup application.
+
+in-reply-to
+   Part ID of part this reply is in response to.
+
+reply:obsmarkers
+----------------
+
+The ``reply:obsmarkers`` part conveys the results of applying an
+``obsmarkers`` part.
+
+The following part parameters are defined:
+
+new
+   The integer number of new markers that were applied.
+
+in-reply-to
+   The part ID that this part is in reply to.
+
+reply:pushkey
+-------------
+
+The ``reply:pushkey`` part conveys the result of a *pushkey* operation.
+
+The following part parameters are defined:
+
+return
+   Integer result code from pushkey operation.
+
+in-reply-to
+   Part ID that triggered this pushkey operation.
+
+This part has no payload.
+
+replycaps
+---------
+
+The ``replycaps`` part notifies the receiver that a reply bundle should
+be created.
+
+This part has no parameters.
+
+The payload consists of a bundle2 capabilities blob.
+
+stream2
+-------
+
+The ``stream2`` part contains *streaming clone* version 2 data.
+
+The following part parameters are defined:
+
+requirements
+   URL quoted repository requirements string. Requirements are delimited by a
+   command (``,``).
+
+filecount
+   The total number of files being transferred in the payload.
+
+bytecount
+   The total size of file content being transferred in the payload.
+
+The payload consists of raw stream clone version 2 data.
+
+The ``filecount`` and ``bytecount`` parameters can be used for progress and
+reporting purposes. The values may not be exact.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/bundles.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,93 @@
+A bundle is a container for repository data.
+
+Bundles are used as standalone files as well as the interchange format
+over the wire protocol used when two Mercurial peers communicate with
+each other.
+
+Headers
+=======
+
+Bundles produced since Mercurial 0.7 (September 2005) have a 4 byte
+header identifying the major bundle type. The header always begins with
+``HG`` and the follow 2 bytes indicate the bundle type/version. Some
+bundle types have additional data after this 4 byte header.
+
+The following sections describe each bundle header/type.
+
+HG10
+----
+
+``HG10`` headers indicate a *changegroup bundle*. This is the original
+bundle format, so it is sometimes referred to as *bundle1*. It has been
+present since version 0.7 (released September 2005).
+
+This header is followed by 2 bytes indicating the compression algorithm
+used for data that follows. All subsequent data following this
+compression identifier is compressed according to the algorithm/method
+specified.
+
+Supported algorithms include the following.
+
+``BZ``
+   *bzip2* compression.
+
+   Bzip2 compressors emit a leading ``BZ`` header. Mercurial uses this
+   leading ``BZ`` as part of the bundle header. Therefore consumers
+   of bzip2 bundles need to *seed* the bzip2 decompressor with ``BZ`` or
+   seek the input stream back to the beginning of the algorithm component
+   of the bundle header so that decompressor input is valid. This behavior
+   is unique among supported compression algorithms.
+
+   Supported since version 0.7 (released December 2006).
+
+``GZ``
+  *zlib* compression.
+
+   Supported since version 0.9.2 (released December 2006).
+
+``UN``
+  *Uncompressed* or no compression. Unmodified changegroup data follows.
+
+  Supported since version 0.9.2 (released December 2006).
+
+3rd party extensions may implement their own compression. However, no
+authority reserves values for their compression algorithm identifiers.
+
+HG2X
+----
+
+``HG2X`` headers (where ``X`` is any value) denote a *bundle2* bundle.
+Bundle2 bundles are a container format for various kinds of repository
+data and capabilities, beyond changegroup data (which was the only data
+supported by ``HG10`` bundles.
+
+``HG20`` is currently the only defined bundle2 version.
+
+The ``HG20`` format is documented at :hg:`help internals.bundle2`.
+
+Initial ``HG20`` support was added in Mercurial 3.0 (released May
+2014). However, bundle2 bundles were hidden behind an experimental flag
+until version 3.5 (released August 2015), when they were enabled in the
+wire protocol. Various commands (including ``hg bundle``) did not
+support generating bundle2 files until Mercurial 3.6 (released November
+2015).
+
+HGS1
+----
+
+*Experimental*
+
+A ``HGS1`` header indicates a *streaming clone bundle*. This is a bundle
+that contains raw revlog data from a repository store. (Typically revlog
+data is exchanged in the form of changegroups.)
+
+The purpose of *streaming clone bundles* are to *clone* repository data
+very efficiently.
+
+The ``HGS1`` header is always followed by 2 bytes indicating a
+compression algorithm of the data that follows. Only ``UN``
+(uncompressed data) is currently allowed.
+
+``HGS1UN`` support was added as an experimental feature in version 3.6
+(released November 2015) as part of the initial offering of the *clone
+bundles* feature.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/cbor.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,130 @@
+Mercurial uses Concise Binary Object Representation (CBOR)
+(RFC 7049) for various data formats.
+
+This document describes the subset of CBOR that Mercurial uses and
+gives recommendations for appropriate use of CBOR within Mercurial.
+
+Type Limitations
+================
+
+Major types 0 and 1 (unsigned integers and negative integers) MUST be
+fully supported.
+
+Major type 2 (byte strings) MUST be fully supported. However, there
+are limitations around the use of indefinite-length byte strings.
+(See below.)
+
+Major type 3 (text strings) are NOT supported.
+
+Major type 4 (arrays) MUST be supported. However, values are limited
+to the set of types described in the "Container Types" section below.
+And indefinite-length arrays are NOT supported.
+
+Major type 5 (maps) MUST be supported. However, key values are limited
+to the set of types described in the "Container Types" section below.
+And indefinite-length maps are NOT supported.
+
+Major type 6 (semantic tagging of major types) can be used with the
+following semantic tag values:
+
+258
+   Mathematical finite set. Suitable for representing Python's
+   ``set`` type.
+
+All other semantic tag values are not allowed.
+
+Major type 7 (simple data types) can be used with the following
+type values:
+
+20
+   False
+21
+   True
+22
+   Null
+31
+   Break stop code (for indefinite-length items).
+
+All other simple data type values (including every value requiring the
+1 byte extension) are disallowed.
+
+Indefinite-Length Byte Strings
+==============================
+
+Indefinite-length byte strings (major type 2) are allowed. However,
+they MUST NOT occur inside a container type (such as an array or map).
+i.e. they can only occur as the "top-most" element in a stream of
+values.
+
+Encoders and decoders SHOULD *stream* indefinite-length byte strings.
+i.e. an encoder or decoder SHOULD NOT buffer the entirety of a long
+byte string value when indefinite-length byte strings are being used
+if it can be avoided. Mercurial MAY use extremely long indefinite-length
+byte strings and buffering the source or destination value COULD lead to
+memory exhaustion.
+
+Chunks in an indefinite-length byte string SHOULD NOT exceed 2^20
+bytes.
+
+Container Types
+===============
+
+Mercurial may use the array (major type 4), map (major type 5), and
+set (semantic tag 258 plus major type 4 array) container types.
+
+An array may contain any supported type as values.
+
+A map MUST only use the following types as keys:
+
+* unsigned integers (major type 0)
+* negative integers (major type 1)
+* byte strings (major type 2) (but not indefinite-length byte strings)
+* false (simple type 20)
+* true (simple type 21)
+* null (simple type 22)
+
+A map MUST only use the following types as values:
+
+* all types supported as map keys
+* arrays
+* maps
+* sets
+
+A set may only use the following types as values:
+
+* all types supported as map keys
+
+It is recommended that keys in maps and values in sets and arrays all
+be of a uniform type.
+
+Avoiding Large Byte Strings
+===========================
+
+The use of large byte strings is discouraged, especially in scenarios where
+the total size of the byte string may by unbound for some inputs (e.g. when
+representing the content of a tracked file). It is highly recommended to use
+indefinite-length byte strings for these purposes.
+
+Since indefinite-length byte strings cannot be nested within an outer
+container (such as an array or map), to associate a large byte string
+with another data structure, it is recommended to use an array or
+map followed immediately by an indefinite-length byte string. For example,
+instead of the following map::
+
+   {
+      "key1": "value1",
+      "key2": "value2",
+      "long_value": "some very large value...",
+   }
+
+Use a map followed by a byte string:
+
+   {
+      "key1": "value1",
+      "key2": "value2",
+      "value_follows": True,
+   }
+   <BEGIN INDEFINITE-LENGTH BYTE STRING>
+   "some very large value"
+   "..."
+   <END INDEFINITE-LENGTH BYTE STRING>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/censor.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,22 @@
+The censor system allows retroactively removing content from
+files. Actually censoring a node requires using the censor extension,
+but the functionality for handling censored nodes is partially in core.
+
+Censored nodes in a filelog have the flag ``REVIDX_ISCENSORED`` set,
+and the contents of the censored node are replaced with a censor
+tombstone. For historical reasons, the tombstone is packed in the
+filelog metadata field ``censored``. This allows censored nodes to be
+(mostly) safely transmitted through old formats like changegroup
+versions 1 and 2. When using changegroup formats older than 3, the
+receiver is required to re-add the ``REVIDX_ISCENSORED`` flag when
+storing the revision. This depends on the ``censored`` metadata key
+never being used for anything other than censoring revisions, which is
+true as of January 2017. Note that the revlog flag is the
+authoritative marker of a censored node: the tombstone should only be
+consulted when looking for a reason a node was censored or when revlog
+flags are unavailable as mentioned above.
+
+The tombstone data is a free-form string. It's expected that users of
+censor will want to record the reason for censoring a node in the
+tombstone. Censored nodes must be able to fit in the size of the
+content being censored.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/changegroups.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,207 @@
+Changegroups are representations of repository revlog data, specifically
+the changelog data, root/flat manifest data, treemanifest data, and
+filelogs.
+
+There are 3 versions of changegroups: ``1``, ``2``, and ``3``. From a
+high-level, versions ``1`` and ``2`` are almost exactly the same, with the
+only difference being an additional item in the *delta header*. Version
+``3`` adds support for storage flags in the *delta header* and optionally
+exchanging treemanifests (enabled by setting an option on the
+``changegroup`` part in the bundle2).
+
+Changegroups when not exchanging treemanifests consist of 3 logical
+segments::
+
+   +---------------------------------+
+   |           |          |          |
+   | changeset | manifest | filelogs |
+   |           |          |          |
+   |           |          |          |
+   +---------------------------------+
+
+When exchanging treemanifests, there are 4 logical segments::
+
+   +-------------------------------------------------+
+   |           |          |               |          |
+   | changeset |   root   | treemanifests | filelogs |
+   |           | manifest |               |          |
+   |           |          |               |          |
+   +-------------------------------------------------+
+
+The principle building block of each segment is a *chunk*. A *chunk*
+is a framed piece of data::
+
+   +---------------------------------------+
+   |           |                           |
+   |  length   |           data            |
+   | (4 bytes) |   (<length - 4> bytes)    |
+   |           |                           |
+   +---------------------------------------+
+
+All integers are big-endian signed integers. Each chunk starts with a 32-bit
+integer indicating the length of the entire chunk (including the length field
+itself).
+
+There is a special case chunk that has a value of 0 for the length
+(``0x00000000``). We call this an *empty chunk*.
+
+Delta Groups
+============
+
+A *delta group* expresses the content of a revlog as a series of deltas,
+or patches against previous revisions.
+
+Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
+to signal the end of the delta group::
+
+  +------------------------------------------------------------------------+
+  |                |             |               |             |           |
+  | chunk0 length  | chunk0 data | chunk1 length | chunk1 data |    0x0    |
+  |   (4 bytes)    |  (various)  |   (4 bytes)   |  (various)  | (4 bytes) |
+  |                |             |               |             |           |
+  +------------------------------------------------------------------------+
+
+Each *chunk*'s data consists of the following::
+
+  +---------------------------------------+
+  |                        |              |
+  |     delta header       |  delta data  |
+  |  (various by version)  |  (various)   |
+  |                        |              |
+  +---------------------------------------+
+
+The *delta data* is a series of *delta*s that describe a diff from an existing
+entry (either that the recipient already has, or previously specified in the
+bundle/changegroup).
+
+The *delta header* is different between versions ``1``, ``2``, and
+``3`` of the changegroup format.
+
+Version 1 (headerlen=80)::
+
+   +------------------------------------------------------+
+   |            |             |             |             |
+   |    node    |   p1 node   |   p2 node   |  link node  |
+   | (20 bytes) |  (20 bytes) |  (20 bytes) |  (20 bytes) |
+   |            |             |             |             |
+   +------------------------------------------------------+
+
+Version 2 (headerlen=100)::
+
+   +------------------------------------------------------------------+
+   |            |             |             |            |            |
+   |    node    |   p1 node   |   p2 node   | base node  | link node  |
+   | (20 bytes) |  (20 bytes) |  (20 bytes) | (20 bytes) | (20 bytes) |
+   |            |             |             |            |            |
+   +------------------------------------------------------------------+
+
+Version 3 (headerlen=102)::
+
+   +------------------------------------------------------------------------------+
+   |            |             |             |            |            |           |
+   |    node    |   p1 node   |   p2 node   | base node  | link node  |   flags   |
+   | (20 bytes) |  (20 bytes) |  (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
+   |            |             |             |            |            |           |
+   +------------------------------------------------------------------------------+
+
+The *delta data* consists of ``chunklen - 4 - headerlen`` bytes, which contain a
+series of *delta*s, densely packed (no separators). These deltas describe a diff
+from an existing entry (either that the recipient already has, or previously
+specified in the bundle/changegroup). The format is described more fully in
+``hg help internals.bdiff``, but briefly::
+
+   +---------------------------------------------------------------+
+   |              |            |            |                      |
+   | start offset | end offset | new length |        content       |
+   |  (4 bytes)   |  (4 bytes) |  (4 bytes) | (<new length> bytes) |
+   |              |            |            |                      |
+   +---------------------------------------------------------------+
+
+Please note that the length field in the delta data does *not* include itself.
+
+In version 1, the delta is always applied against the previous node from
+the changegroup or the first parent if this is the first entry in the
+changegroup.
+
+In version 2 and up, the delta base node is encoded in the entry in the
+changegroup. This allows the delta to be expressed against any parent,
+which can result in smaller deltas and more efficient encoding of data.
+
+The *flags* field holds bitwise flags affecting the processing of revision
+data. The following flags are defined:
+
+32768
+   Censored revision. The revision's fulltext has been replaced by censor
+   metadata. May only occur on file revisions.
+16384
+   Ellipsis revision. Revision hash does not match data (likely due to rewritten
+   parents).
+8192
+   Externally stored. The revision fulltext contains ``key:value`` ``\n``
+   delimited metadata defining an object stored elsewhere. Used by the LFS
+   extension.
+
+For historical reasons, the integer values are identical to revlog version 1
+per-revision storage flags and correspond to bits being set in this 2-byte
+field. Bits were allocated starting from the most-significant bit, hence the
+reverse ordering and allocation of these flags.
+
+Changeset Segment
+=================
+
+The *changeset segment* consists of a single *delta group* holding
+changelog data. The *empty chunk* at the end of the *delta group* denotes
+the boundary to the *manifest segment*.
+
+Manifest Segment
+================
+
+The *manifest segment* consists of a single *delta group* holding manifest
+data. If treemanifests are in use, it contains only the manifest for the
+root directory of the repository. Otherwise, it contains the entire
+manifest data. The *empty chunk* at the end of the *delta group* denotes
+the boundary to the next segment (either the *treemanifests segment* or the
+*filelogs segment*, depending on version and the request options).
+
+Treemanifests Segment
+---------------------
+
+The *treemanifests segment* only exists in changegroup version ``3``, and
+only if the 'treemanifest' param is part of the bundle2 changegroup part
+(it is not possible to use changegroup version 3 outside of bundle2).
+Aside from the filenames in the *treemanifests segment* containing a
+trailing ``/`` character, it behaves identically to the *filelogs segment*
+(see below). The final sub-segment is followed by an *empty chunk* (logically,
+a sub-segment with filename size 0). This denotes the boundary to the
+*filelogs segment*.
+
+Filelogs Segment
+================
+
+The *filelogs segment* consists of multiple sub-segments, each
+corresponding to an individual file whose data is being described::
+
+   +--------------------------------------------------+
+   |          |          |          |     |           |
+   | filelog0 | filelog1 | filelog2 | ... |    0x0    |
+   |          |          |          |     | (4 bytes) |
+   |          |          |          |     |           |
+   +--------------------------------------------------+
+
+The final filelog sub-segment is followed by an *empty chunk* (logically,
+a sub-segment with filename size 0). This denotes the end of the segment
+and of the overall changegroup.
+
+Each filelog sub-segment consists of the following::
+
+   +------------------------------------------------------+
+   |                 |                      |             |
+   | filename length |       filename       | delta group |
+   |    (4 bytes)    | (<length - 4> bytes) |  (various)  |
+   |                 |                      |             |
+   +------------------------------------------------------+
+
+That is, a *chunk* consisting of the filename (not terminated or padded)
+followed by N chunks constituting the *delta group* for this file. The
+*empty chunk* at the end of each *delta group* denotes the boundary to the
+next filelog sub-segment.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/config.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,109 @@
+All config options used within Mercurial should be registered.
+
+Config Option in Core
+=====================
+
+Config options used by Mercurial core are registered in the
+``mercurial.configitems`` module.
+
+Simple entry
+------------
+
+A registration entry typically looks like::
+
+    coreconfigitem('section', 'option',
+        default=MyDefaultValue,
+    )
+
+Once registered, Mercurial will know that ``section.option`` is a legitimate
+config option and that ``MyDefaultValue`` should be used if no other values are
+defined in configuration files.
+
+Complex default value
+---------------------
+
+If the default provided is a callable, it is called to retrieve the default
+value when accessing the config option. This is useful for default values that
+are mutable like the empty list::
+
+    coreconfigitem('pager', 'ignore',
+        default=list,
+    )
+
+In addition, there are cases where the default is not fixed, but computed from
+other properties. In this case, use the ``dynamicdefault`` object as the value
+for the ``default`` parameter. A default value is then explicitly required when
+reading the option::
+
+    # registration
+    coreconfigitem('web', 'name',
+        default=dynamicdefault,
+    )
+
+    # usage
+    ui.config('web', 'name', dirname)
+
+Free form options
+-----------------
+
+Some config sections use free form options (e.g. ``paths``). You can register
+them using the ``generic`` parameters::
+
+    coreconfigitem('paths', '.*',
+        default=None,
+        generic=True,
+    )
+
+When ``generic=True`` is set, the option name is matched as a regular expression
+(rooted to string start). It can be used to select specific sub parameters::
+
+    coreconfigitem('merge-tools', br'.*\.args$',
+        default="$local $base $other",
+        generic=True,
+        priority=-1,
+    )
+
+The ``priority`` parameter controls the order used to match the generic pattern
+(lower first).
+
+Config Option in Extensions
+===========================
+
+General case
+------------
+
+Extensions should register config items through the ``registrar`` API (also used
+for commands and others)::
+
+    configtable = {}
+    configitem = registrar.configitem(configtable)
+
+    configitem('blackbox', 'dirty',
+        default=False,
+    )
+
+The ``dynamicdefault`` object is then available as
+``configitem.dynamicdefault``.
+
+Supporting older versions
+-------------------------
+
+The registrar was introduced in Mercurial 4.3, and the ``generic`` parameter was
+introduced in 4.4. Starting with Mercurial 4.4, all core options were registered
+and developer warnings are emitted when accessing unregistered option.
+
+Extensions supporting versions older than Mercurial 4.3 cannot rely on the
+default value being registered. The simplest way to register an option while
+still supporting an older version is to use ``dynamicdefault`` for options
+requiring a default value. The existing code passing an explicit default can
+then stay in use until compatibility with Mercurial 4.2 is dropped.
+
+As reminder, here are the default values for each config type:
+
+    - config:      None
+    - configbool:  False
+    - configbytes: 0
+    - configdate:  None
+    - configint:   None
+    - configlist:  []
+    - configpath:  None
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/extensions.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,367 @@
+Extensions allow the creation of new features and using them directly from
+the main hg command line as if they were built-in commands. The extensions
+have full access to the *internal* API.
+
+Use of Mercurial's internal API very likely makes your code subject to
+Mercurial's license. Before going any further, read the License page.
+
+There are NO guarantees that third-party code calling into Mercurial's
+internals won't break from release to release. If you do use Mercurial's API
+for published third-party code, we expect you to test your code before each
+major Mercurial release. This will prevent various bug reports from your users
+when they upgrade their copy of Mercurial.
+
+File Layout
+===========
+
+Extensions are usually written as simple python modules. Larger ones are
+better split into multiple modules of a single package (see the convert
+extension). The package root module gives its name to the extension and
+implements the ``cmdtable`` and optional callbacks described below.
+
+Command table
+=============
+
+To write your own extension, your python module can provide an optional dict
+named ``cmdtable`` with entries describing each command. A command should be
+registered to the ``cmdtable`` by ``@command`` decorator.
+
+Example using ``@command`` decorator (requires Mercurial 1.9)::
+
+    from mercurial.i18n import _
+
+    cmdtable = {}
+    try:
+        from mercurial import registrar
+        command = registrar.command(cmdtable)
+    except (AttributeError, ImportError):
+        # Fallback to hg < 4.3 support
+        from mercurial import cmdutil
+        command = cmdutil.command(cmdtable)
+
+    @command('print-parents',
+        [('s', 'short', None, _('print short form')),
+         ('l', 'long', None, _('print long form'))],
+        _('[options] node'))
+    def printparents(ui, repo, node, **opts):
+        ...
+
+The cmdtable dictionary
+-----------------------
+
+The ``cmdtable`` dictionary uses as key the new command names, and, as value,
+a tuple containing:
+
+1. the function to be called when the command is used.
+2. a list of options the command can take.
+3. a command line synopsis for the command (the function docstring is used for
+   the full help).
+
+List of options
+---------------
+
+All the command flag options are documented in the mercurial/fancyopts.py
+sources.
+
+The options list is a list of tuples containing:
+
+1. the short option letter, or ``''`` if no short option is available
+   (for example, ``o`` for a ``-o`` option).
+2. the long option name (for example, ``option`` for a ``--option`` option).
+3. a default value for the option.
+4. a help string for the option (it's possible to omit the "hg newcommand"
+   part and only the options and parameter substring is needed).
+
+Command function signatures
+---------------------------
+
+Functions that implement new commands always receive a ``ui`` and usually
+a ``repo`` parameter. The rest of parameters are taken from the command line
+items that don't start with a dash and are passed in the same order they were
+written. If no default value is given in the parameter list they are required.
+
+If there is no repo to be associated with the command and consequently no
+``repo`` passed, then ``norepo=True`` should be passed to the ``@command``
+decorator::
+
+    @command('mycommand', [], norepo=True)
+    def mycommand(ui, **opts):
+        ...
+
+For examples of ``norepo``, see the convert extension.
+
+Command function docstrings
+===========================
+
+The docstring of your function is used as the main help text, shown by
+``hg help mycommand``. The docstring should be formatted using a simple
+subset of reStructuredText markup. The supported constructs include:
+
+Paragraphs::
+
+    This is a paragraph.
+
+    Paragraphs are separated
+    by blank lines.
+
+A verbatim block is introduced with a double colon followed by an indented
+block. The double colon is turned into a single colon on display::
+
+    Some text::
+
+      verbatim
+        text
+         !!
+
+We have field lists::
+
+    :key1: value1
+    :key2: value2
+
+Bullet lists::
+
+    - foo
+    - bar
+
+Enumerated lists::
+
+    1. foo
+    2. bar
+
+Inline markup::
+
+    ``*bold*``, ``monospace``, :hg:`command`
+
+Mark Mercurial commands with ``:hg:`` to make a nice link to the corresponding
+documentation. We'll expand the support if new constructs can be parsed
+without too much trouble.
+
+Communicating with the user
+===========================
+
+Besides the ``ui`` methods, like ``ui.write(*msg)`` or
+``ui.prompt(msg, default="y")``, an extension can add help text for each
+of its commands and the extension itself.
+
+The module docstring will be used as help string when ``hg help extensionname``
+is used and, similarly, the help string for a command and the docstring
+belonging to the function that's wrapped by the command will be shown when
+``hg help command`` is invoked.
+
+Setup Callbacks
+===============
+
+Extensions are loaded in phases. All extensions are processed in a given phase
+before the next phase begins. In the first phase, all extension modules are
+loaded and registered with Mercurial. This means that you can find all enabled
+extensions with ``extensions.find`` in the following phases.
+
+Extension setup
+---------------
+
+There are two callbacks to be called when extensions are loaded, named
+``uisetup`` and ``extsetup``. ``uisetup`` is called first for each extension,
+then ``extsetup`` is called. This means ``extsetup`` can be useful in case
+one extension optionally depends on another extension.
+
+Both ``uisetup`` and ``extsetup`` receive a ui object with the local
+repository configuration::
+
+    def uisetup(ui):
+        # ...
+
+    def extsetup(ui):
+        # ...
+
+Be aware that ``uisetup`` in NOT the function to configure a ``ui`` instance.
+It's called only once per process, not per ``ui`` instance. Also, any changes
+to the ``ui`` may be discarded because the ``ui`` here temporarily loaded
+local configuration. So, it's generally wrong to do `ui.setconfig()` in
+these callbacks. Notable exception is setting ``pre/post-<command>`` hooks
+and extending ``ui.__class__``.
+
+In Mercurial 1.3.1 or earlier, ``extsetup`` takes no argument.
+
+Command table setup
+-------------------
+
+After ``extsetup``, the ``cmdtable`` is copied into the global command table
+in Mercurial.
+
+Ui instance setup
+-----------------
+
+The optional ``uipopulate`` is called for each ``ui`` instance after
+configuration is loaded, where extensions can set up additional ui members,
+update configuration by ``ui.setconfig()``, and extend the class dynamically.
+
+Typically there are three ``ui`` instances involved in command execution:
+
+``req.ui`` (or ``repo.baseui``)
+    Only system and user configurations are loaded into it.
+``lui``
+    Local repository configuration is loaded as well. This will be used at
+    early dispatching stage where a repository isn't available.
+``repo.ui``
+    The fully-loaded ``ui`` used after a repository is instantiated. This
+    will be created from the ``req.ui`` per repository.
+
+In command server and hgweb, this may be called more than once for the same
+``ui`` instance.
+
+(New in Mercurial 4.9)
+
+Repository setup
+----------------
+
+Extensions can implement an optional callback named ``reposetup``. It is
+called after the main Mercurial repository initialization, and can be used
+to setup any local state the extension might need.
+
+As other command functions it receives an ``ui`` object and a ``repo`` object
+(no additional parameters for this, though)::
+
+    def reposetup(ui, repo):
+        #do initialization here.
+
+It is important to take into account that the ``ui`` object that is received
+by the ``reposetup`` function is not the same as the one received by the
+``uisetup`` and ``extsetup`` functions. This is particularly important when
+setting up hooks as described in the following section, since not all hooks
+use the same ``ui`` object and hence different hooks must be configured in
+different setup functions.
+
+Wrapping methods on the ui and repo classes
+-------------------------------------------
+
+Because extensions can be loaded *per repository*, you should avoid using
+``extensions.wrapfunction()`` on methods of the ``ui`` and ``repo`` objects.
+Instead, create a subclass of the specific class of the instance passed into
+the ``*setup()`` hook; e.g. use ``ui.__class__`` as the base class, then
+reassign your new class to ``ui.__class__`` again. Mercurial will then use
+your updated ``ui`` or ``repo`` instance only for repositories where your
+extension is enabled (or copies thereof, reusing your new class).
+
+For example::
+
+    def uisetup(ui):
+        class echologui(ui.__class__):
+            def log(self, service, *msg, **opts):
+                if msg:
+                    self.write('%s: %s\n' % (service, msg[0] % msg[1:]))
+                super(echologui, self).log(service, *msg, **opts)
+
+        ui.__class__ = echologui
+
+Configuring Hooks
+=================
+
+Some extensions must use hooks to do their work. These required hooks can
+be configured manually by the user by modifying the ``[hook]`` section of
+their hgrc, but they can also be configured automatically by calling the
+``ui.setconfig('hooks', ...)`` function in one of the setup functions
+described above.
+
+The main difference between manually modifying the hooks section in the hgrc
+and using ``ui.setconfig()`` is that when using ``ui.setconfig()`` you have
+access to the actual hook function object, which you can pass directly to
+``ui.setconfig()``, while when you use the hooks section of the hgrc file
+you must refer to the hook function by using the
+``python:modulename.functioname`` idiom (e.g. ``python:hgext.notify.hook``).
+
+For example::
+
+    # Define hooks -- note that the actual function name it irrelevant.
+    def preupdatehook(ui, repo, **kwargs):
+        ui.write("Pre-update hook triggered\n")
+
+    def updatehook(ui, repo, **kwargs):
+        ui.write("Update hook triggered\n")
+
+    def uisetup(ui):
+        # When pre-<cmd> and post-<cmd> hooks are configured by means of
+        # the ui.setconfig() function, you must use the ui object passed
+        # to uisetup or extsetup.
+        ui.setconfig("hooks", "pre-update.myextension", preupdatehook)
+
+    def reposetup(ui, repo):
+        # Repository-specific hooks can be configured here. These include
+        # the update hook.
+        ui.setconfig("hooks", "update.myextension", updatehook)
+
+Note how different hooks may need to be configured in different setup
+functions. In the example you can see that the ``update`` hook must be
+configured in the ``reposetup`` function, while the ``pre-update`` hook
+must be configured on the ``uisetup`` or the ``extsetup`` functions.
+
+Marking compatible versions
+===========================
+
+Every extension should use the ``testedwith`` variable to specify Mercurial
+releases it's known to be compatible with. This helps us and users diagnose
+where problems are coming from::
+
+    testedwith = '2.0 2.0.1 2.1 2.1.1 2.1.2'
+
+Do not use the ``internal`` marker in third-party extensions; we will
+immediately drop all bug reports mentioning your extension if we catch you
+doing this.
+
+Similarly, an extension can use the ``buglink`` variable to specify how users
+should report issues with the extension.  This link will be included in the
+error message if the extension produces errors::
+
+    buglink = 'https://bitbucket.org/USER/REPO/issues'
+
+If an extension requires a minimum version of Mercurial, it can be declared
+with the ``minimumhgversion`` variable::
+
+    minimumhgversion = '4.6'
+
+Older clients will print a warning that the extension requires a new version,
+instead of attempting to load it.
+
+Wrap up: what belongs where?
+============================
+
+You will find here a list of most common tasks, based on setups from the
+extensions included in Mercurial core.
+
+uisetup
+-------
+
+* Changes to ``ui.__class__`` . The ``ui`` object that will be used to run
+  the command has not yet been created. Changes made here will affect ``ui``
+  objects created after this, and in particular the ``ui`` that will be passed
+  to ``runcommand``
+* Command wraps (``extensions.wrapcommand``)
+* Changes that need to be visible by other extensions: because initialization
+  occurs in phases (all extensions run ``uisetup``, then all run ``extsetup``),
+  a change made here will be visible by other extensions during ``extsetup``.
+* Monkeypatches or function wraps (``extensions.wrapfunction``) of ``dispatch``
+  module members
+* Set up ``pre-*`` and ``post-*`` hooks. (DEPRECATED. ``uipopulate`` is
+  preferred on Mercurial 4.9 and later.)
+* ``pushkey`` setup
+
+extsetup
+--------
+
+* Changes depending on the status of other extensions. (``if extensions.find('mq')``)
+* Add a global option to all commands
+* Extend revsets
+
+uipopulate
+----------
+
+* Modify ``ui`` instance attributes and configuration variables.
+* Changes to ``ui.__class__`` per instance.
+* Set up all hooks per scoped configuration.
+
+reposetup
+---------
+
+* Set up all hooks but ``pre-*`` and ``post-*``. (DEPRECATED. ``uipopulate`` is
+  preferred on Mercurial 4.9 and later.)
+* Modify configuration variables
+* Changes to ``repo.__class__``, ``repo.dirstate.__class__``
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/linelog.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,302 @@
+linelog is a storage format inspired by the "Interleaved deltas" idea. See
+https://en.wikipedia.org/wiki/Interleaved_deltas for its introduction.
+
+0. SCCS Weave
+
+  To understand what linelog is, first we have a quick look at a simplified
+  (with header removed) SCCS weave format, which is an implementation of the
+  "Interleaved deltas" idea.
+
+0.1 Basic SCCS Weave File Format
+
+  A SCCS weave file consists of plain text lines. Each line is either a
+  special instruction starting with "^A" or part of the content of the real
+  file the weave tracks. There are 3 important operations, where REV denotes
+  the revision number:
+
+    ^AI REV, marking the beginning of an insertion block introduced by REV
+    ^AD REV, marking the beginning of a deletion block introduced by REV
+    ^AE REV, marking the end of the block started by "^AI REV" or "^AD REV"
+
+  Note on revision numbers: For any two different revision numbers, one must
+  be an ancestor of the other to make them comparable. This enforces linear
+  history. Besides, the comparison functions (">=", "<") should be efficient.
+  This means, if revisions are strings like git or hg, an external map is
+  required to convert them into integers.
+
+  For example, to represent the following changes:
+
+    REV 1 | REV 2 | REV 3
+    ------+-------+-------
+    a     | a     | a
+    b     | b     | 2
+    c     | 1     | c
+          | 2     |
+          | c     |
+
+  A possible weave file looks like:
+
+    ^AI 1
+    a
+    ^AD 3
+    b
+    ^AI 2
+    1
+    ^AE 3
+    2
+    ^AE 2
+    c
+    ^AE 1
+
+  An "^AE" does not always match its nearest operation ("^AI" or "^AD"). In
+  the above example, "^AE 3" does not match the nearest "^AI 2" but "^AD 3".
+  Therefore we need some extra information for "^AE". The SCCS weave uses a
+  revision number. It could also be a boolean value about whether it is an
+  insertion or a deletion (see section 0.4).
+
+0.2 Checkout
+
+  The "checkout" operation is to retrieve file content at a given revision,
+  say X. It's doable by going through the file line by line and:
+
+    - If meet ^AI rev, and rev > X, find the corresponding ^AE and jump there
+    - If meet ^AD rev, and rev <= X, find the corresponding ^AE and jump there
+    - Ignore ^AE
+    - For normal lines, just output them
+
+0.3 Annotate
+
+  The "annotate" operation is to show extra metadata like the revision number
+  and the original line number a line comes from.
+
+  It's basically just a "Checkout". For the extra metadata, they can be stored
+  side by side with the line contents. Alternatively, we can infer the
+  revision number from "^AI"s.
+
+  Some SCM tools have to calculate diffs on the fly and thus are much slower
+  on this operation.
+
+0.4 Tree Structure
+
+  The word "interleaved" is used because "^AI" .. "^AE" and "^AD" .. "^AE"
+  blocks can be interleaved.
+
+  If we consider insertions and deletions separately, they can form tree
+  structures, respectively.
+
+    +--- ^AI 1        +--- ^AD 3
+    | +- ^AI 2        | +- ^AD 2
+    | |               | |
+    | +- ^AE 2        | +- ^AE 2
+    |                 |
+    +--- ^AE 1        +--- ^AE 3
+
+  More specifically, it's possible to build a tree for all insertions, where
+  the tree node has the structure "(rev, startline, endline)". "startline" is
+  the line number of "^AI" and "endline" is the line number of the matched
+  "^AE".  The tree will have these properties:
+
+    1. child.rev > parent.rev
+    2. child.startline > parent.startline
+    3. child.endline < parent.endline
+
+  A similar tree for all deletions can also be built with the first property
+  changed to:
+
+    1. child.rev < parent.rev
+
+0.5 Malformed Cases
+
+  The following cases are considered malformed in our implementation:
+
+    1. Interleaved insertions, or interleaved deletions.
+       It can be rewritten to a non-interleaved tree structure.
+
+       Take insertions as example, deletions are similar:
+
+       ^AI x         ^AI x
+       a             a
+       ^AI x + 1  -> ^AI x + 1
+       b             b
+       ^AE x         ^AE x + 1
+       c             ^AE x
+       ^AE x + 1     ^AI x + 1
+                     c
+                     ^AE x + 1
+
+    2. Nested insertions, where the inner one has a smaller revision number.
+       Or nested deletions, where the inner one has a larger revision number.
+       It can be rewritten to a non-nested form.
+
+       Take insertions as example, deletions are similar:
+
+       ^AI x + 1     ^AI x + 1
+       a             a
+       ^AI x      -> ^AE x + 1
+       b             ^AI x
+       ^AE x         b
+       c             ^AE x
+       ^AE x + 1     ^AI x + 1
+                     c
+                     ^AE x + 1
+
+    3. Insertion inside deletion with a smaller revision number.
+
+       Rewrite by duplicating the content inserted:
+
+       ^AD x          ^AD x
+       a              a
+       ^AI x + 1  ->  b
+       b              c
+       ^AE x + 1      ^AE x
+       c              ^AI x + 1
+       ^AE x          b
+                      ^AE x + 1
+
+       Note: If "annotate" purely depends on "^AI" information, then the
+       duplication content will lose track of where "b" is originally from.
+
+  Some of them may be valid in other implementations for special purposes. For
+  example, to "revive" a previously deleted block in a newer revision.
+
+0.6 Cases Can Be Optimized
+
+  It's always better to get things nested. For example, the left is more
+  efficient than the right while they represent the same content:
+
+    +--- ^AD 2          +- ^AD 1
+    | +- ^AD 1          |   LINE A
+    | |   LINE A        +- ^AE 1
+    | +- ^AE 1          +- ^AD 2
+    |     LINE B        |   LINE B
+    +--- ^AE 2          +- ^AE 2
+
+  Our implementation sometimes generates the less efficient data. To always
+  get the optimal form, it requires extra code complexity that seems unworthy.
+
+0.7 Inefficiency
+
+  The file format can be slow because:
+
+  - Inserting a new line at position P requires rewriting all data after P.
+  - Finding "^AE" requires walking through the content (O(N), where N is the
+    number of lines between "^AI/D" and "^AE").
+
+1. Linelog
+
+  The linelog is a binary format that dedicates to speed up mercurial (or
+  git)'s "annotate" operation. It's designed to avoid issues mentioned in
+  section 0.7.
+
+1.1 Content Stored
+
+  Linelog is not another storage for file contents. It only stores line
+  numbers and corresponding revision numbers, instead of actual line content.
+  This is okay for the "annotate" operation because usually the external
+  source is fast to checkout the content of a file at a specific revision.
+
+  A typical SCCS weave is also fast on the "grep" operation, which needs
+  random accesses to line contents from different revisions of a file. This
+  can be slow with linelog's no-line-content design. However we could use
+  an extra map ((rev, line num) -> line content) to speed it up.
+
+  Note the revision numbers in linelog should be independent from mercurial
+  integer revision numbers. There should be some mapping between linelog rev
+  and hg hash stored side by side, to make the files reusable after being
+  copied to another machine.
+
+1.2 Basic Format
+
+  A linelog file consists of "instruction"s. An "instruction" can be either:
+
+    - JGE  REV ADDR     # jump to ADDR if rev >= REV
+    - JL   REV ADDR     # jump to ADDR if rev < REV
+    - LINE REV LINENUM  # append the (LINENUM+1)-th line in revision REV
+
+  For example, here is the example linelog representing the same file with
+  3 revisions mentioned in section 0.1:
+
+    SCCS  |    Linelog
+    Weave | Addr : Instruction
+    ------+------+-------------
+    ^AI 1 |    0 : JL   1 8
+    a     |    1 : LINE 1 0
+    ^AD 3 |    2 : JGE  3 6
+    b     |    3 : LINE 1 1
+    ^AI 2 |    4 : JL   2 7
+    1     |    5 : LINE 2 2
+    ^AE 3 |
+    2     |    6 : LINE 2 3
+    ^AE 2 |
+    c     |    7 : LINE 1 2
+    ^AE 1 |
+          |    8 : END
+
+  This way, "find ^AE" is O(1) because we just jump there. And we can insert
+  new lines without rewriting most part of the file by appending new lines and
+  changing a single instruction to jump to them.
+
+  The current implementation uses 64 bits for an instruction: The opcode (JGE,
+  JL or LINE) takes 2 bits, REV takes 30 bits and ADDR or LINENUM takes 32
+  bits. It also stores the max revision number and buffer size at the first
+  64 bits for quick access to these values.
+
+1.3 Comparing with Mercurial's revlog format
+
+  Apparently, linelog is very different from revlog: linelog stores rev and
+  line numbers, while revlog has line contents and other metadata (like
+  parents, flags). However, the revlog format could also be used to store rev
+  and line numbers. For example, to speed up the annotate operation, we could
+  also pre-calculate annotate results and just store them using the revlog
+  format.
+
+  Therefore, linelog is actually somehow similar to revlog, with the important
+  trade-off that it only supports linear history (mentioned in section 0.1).
+  Essentially, the differences are:
+
+    a) Linelog is full of deltas, while revlog could contain full file
+       contents sometimes. So linelog is smaller. Revlog could trade
+       reconstruction speed for file size - best case, revlog is as small as
+       linelog.
+    b) The interleaved delta structure allows skipping large portion of
+       uninteresting deltas so linelog's content reconstruction is faster than
+       the delta-only version of revlog (however it's possible to construct
+       a case where interleaved deltas degrade to plain deltas, so linelog
+       worst case would be delta-only revlog). Revlog could trade file size
+       for reconstruction speed.
+    c) Linelog implicitly maintains the order of all lines it stores. So it
+       could dump all the lines from all revisions, with a reasonable order.
+       While revlog could also dump all line additions, it requires extra
+       computation to figure out the order putting those lines - that's some
+       kind of "merge".
+
+  "c" makes "hg absorb" easier to implement and makes it possible to do
+  "annotate --deleted".
+
+1.4 Malformed Cases Handling
+
+  The following "case 1", "case 2", and "case 3" refer to cases mentioned
+  in section 0.5.
+
+  Using the exposed API (replacelines), case 1 is impossible to generate,
+  although it's possible to generate it by constructing rawdata and load that
+  via linelog.fromdata.
+
+  Doing annotate(maxrev) before replacelines (aka. a1, a2 passed to
+  replacelines are related to the latest revision) eliminates the possibility
+  of case 3. That makes sense since usually you'd like to make edits on top of
+  the latest revision. Practically, both absorb and fastannotate do this.
+
+  Doing annotate(maxrev), plus replacelines(rev, ...) where rev >= maxrev
+  eliminates the possibility of case 2. That makes sense since usually the
+  edits belong to "new revisions", not "old revisions". Practically,
+  fastannotate does this. Absorb calls replacelines with rev < maxrev to edit
+  past revisions. So it needs some extra care to not generate case 2.
+
+  If case 1 occurs, that probably means linelog file corruption (assuming
+  linelog is edited via public APIs) the checkout or annotate result could
+  be less meaningful or even error out, but linelog wouldn't enter an infinite
+  loop.
+
+  If either case 2 or 3 occurs, linelog works as if the inner "^AI/D" and "^AE"
+  operations on the left side are silently ignored.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/mergestate.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,80 @@
+The active mergestate is stored in ``.hg/merge`` when a merge is triggered
+by commands like ``hg merge``, ``hg rebase``, etc. until the merge is
+completed or aborted to track the 3-way merge state of individual files.
+
+The contents of the directory are:
+
+Conflicting files
+-----------------
+
+The local version of the conflicting files are stored with their
+filenames as the hash of their paths.
+
+state
+-----
+
+This mergestate file record is used by hg version prior to 2.9.1
+and contains less data than ``state2``. If there is no contradiction
+with ``state2``, we can assume that both are written at the same time.
+In this case, data from ``state2`` is used. Otherwise, we use ``state``.
+We read/write both ``state`` and ``state2`` records to ensure backward
+compatibility.
+
+state2
+------
+
+This record stores a superset of data in ``state``, including new kinds
+of records in the future.
+
+Each record can contain arbitrary content and has an associated type. This
+`type` should be a letter. If `type` is uppercase, the record is mandatory:
+versions of Mercurial that don't support it should abort. If `type` is
+lowercase, the record can be safely ignored.
+
+Currently known records:
+
+| * L: the node of the "local" part of the merge (hexified version)
+| * O: the node of the "other" part of the merge (hexified version)
+| * F: a file to be merged entry
+| * C: a change/delete or delete/change conflict
+| * D: a file that the external merge driver will merge internally
+|      (experimental)
+| * P: a path conflict (file vs directory)
+| * m: the external merge driver defined for this merge plus its run state
+|      (experimental)
+| * f: a (filename, dictionary) tuple of optional values for a given file
+| * X: unsupported mandatory record type (used in tests)
+| * x: unsupported advisory record type (used in tests)
+| * l: the labels for the parts of the merge.
+
+Merge driver run states (experimental):
+
+| * u: driver-resolved files unmarked -- needs to be run next time we're
+|      about to resolve or commit
+| * m: driver-resolved files marked -- only needs to be run before commit
+| * s: success/skipped -- does not need to be run any more
+
+Merge record states (indexed by filename):
+
+| * u: unresolved conflict
+| * r: resolved conflict
+| * pu: unresolved path conflict (file conflicts with directory)
+| * pr: resolved path conflict
+| * d: driver-resolved conflict
+
+The resolve command transitions between 'u' and 'r' for conflicts and
+'pu' and 'pr' for path conflicts.
+
+This format is a list of arbitrary records of the form:
+
+[type][length][content]
+
+`type` is a single character, `length` is a 4 byte integer, and
+`content` is an arbitrary byte sequence of length `length`.
+
+Mercurial versions prior to 3.7 have a bug where if there are
+unsupported mandatory merge records, attempting to clear out the merge
+state with hg update --clean or similar aborts. The 't' record type
+works around that by writing out what those versions treat as an
+advisory record, but later versions interpret as special: the first
+character is the 'real' record type and everything onwards is the data.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/requirements.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,144 @@
+Repositories contain a file (``.hg/requires``) containing a list of
+features/capabilities that are *required* for clients to interface
+with the repository. This file has been present in Mercurial since
+version 0.9.2 (released December 2006).
+
+One of the first things clients do when opening a repository is read
+``.hg/requires`` and verify that all listed requirements are supported,
+aborting if not. Requirements are therefore a strong mechanism to
+prevent incompatible clients from reading from unknown repository
+formats or even corrupting them by writing to them.
+
+Extensions may add requirements. When they do this, clients not running
+an extension will be unable to read from repositories.
+
+The following sections describe the requirements defined by the
+Mercurial core distribution.
+
+revlogv1
+========
+
+When present, revlogs are version 1 (RevlogNG). RevlogNG was introduced
+in 2006. The ``revlogv1`` requirement has been enabled by default
+since the ``requires`` file was introduced in Mercurial 0.9.2.
+
+If this requirement is not present, version 0 revlogs are assumed.
+
+store
+=====
+
+The *store* repository layout should be used.
+
+This requirement has been enabled by default since the ``requires`` file
+was introduced in Mercurial 0.9.2.
+
+fncache
+=======
+
+The *fncache* repository layout should be used.
+
+The *fncache* layout hash encodes filenames with long paths and
+encodes reserved filenames.
+
+This requirement is enabled by default when the *store* requirement is
+enabled (which is the default behavior). It was introduced in Mercurial
+1.1 (released December 2008).
+
+shared
+======
+
+Denotes that the store for a repository is shared from another location
+(defined by the ``.hg/sharedpath`` file).
+
+This requirement is set when a repository is created via :hg:`share`.
+
+The requirement was added in Mercurial 1.3 (released July 2009).
+
+relshared
+=========
+
+Derivative of ``shared``; the location of the store is relative to the
+store of this repository.
+
+This requirement is set when a repository is created via :hg:`share`
+using the ``--relative`` option.
+
+The requirement was added in Mercurial 4.2 (released May 2017).
+
+dotencode
+=========
+
+The *dotencode* repository layout should be used.
+
+The *dotencode* layout encodes the first period or space in filenames
+to prevent issues on OS X and Windows.
+
+This requirement is enabled by default when the *store* requirement
+is enabled (which is the default behavior). It was introduced in
+Mercurial 1.7 (released November 2010).
+
+parentdelta
+===========
+
+Denotes a revlog delta encoding format that was experimental and
+replaced by *generaldelta*. It should not be seen in the wild because
+it was never enabled by default.
+
+This requirement was added in Mercurial 1.7 and removed in Mercurial
+1.9.
+
+generaldelta
+============
+
+Revlogs should be created with the *generaldelta* flag enabled. The
+generaldelta flag will cause deltas to be encoded against a parent
+revision instead of the previous revision in the revlog.
+
+Support for this requirement was added in Mercurial 1.9 (released
+July 2011). The requirement was disabled on new repositories by
+default until Mercurial 3.7 (released February 2016).
+
+manifestv2
+==========
+
+Denotes that version 2 of manifests are being used.
+
+Support for this requirement was added in Mercurial 3.4 (released
+May 2015). The new format failed to meet expectations and support
+for the format and requirement were removed in Mercurial 4.6
+(released May 2018) since the feature never graduated frome experiment
+status.
+
+treemanifest
+============
+
+Denotes that tree manifests are being used. Tree manifests are
+one manifest per directory (as opposed to a single flat manifest).
+
+Support for this requirement was added in Mercurial 3.4 (released
+August 2015). The requirement is currently experimental and is
+disabled by default.
+
+exp-sparse
+==========
+
+The working directory is sparse (only contains a subset of files).
+
+Support for this requirement was added in Mercurial 4.3 (released
+August 2017). This requirement and feature are experimental and may
+disappear in a future Mercurial release. The requirement will only
+be present on repositories that have opted in to a sparse working
+directory.
+
+bookmarksinstore
+==================
+
+Bookmarks are stored in ``.hg/store/`` instead of directly in ``.hg/``
+where they used to be stored. The active bookmark is still stored
+directly in ``.hg/``. This makes them always shared by ``hg share``,
+whether or not ``-B`` was passed.
+
+Support for this requirement was added in Mercurial 5.1 (released
+August 2019). The requirement will only be present on repositories
+that have opted in to this format (by having
+``format.bookmarks-in-store=true`` set when they were created).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/revlogs.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,239 @@
+Revision logs - or *revlogs* - are an append only data structure for
+storing discrete entries, or *revisions*. They are the primary storage
+mechanism of repository data.
+
+Revlogs effectively model a directed acyclic graph (DAG). Each node
+has edges to 1 or 2 *parent* nodes. Each node contains metadata and
+the raw value for that node.
+
+Revlogs consist of entries which have metadata and revision data.
+Metadata includes the hash of the revision's content, sizes, and
+links to its *parent* entries. The collective metadata is referred
+to as the *index* and the revision data is the *data*.
+
+Revision data is stored as a series of compressed deltas against
+ancestor revisions.
+
+Revlogs are written in an append-only fashion. We never need to rewrite
+a file to insert nor do we need to remove data. Rolling back in-progress
+writes can be performed by truncating files. Read locks can be avoided
+using simple techniques. This means that references to other data in
+the same revlog *always* refer to a previous entry.
+
+Revlogs can be modeled as 0-indexed arrays. The first revision is
+revision #0 and the second is revision #1. The revision -1 is typically
+used to mean *does not exist* or *not defined*.
+
+File Format
+===========
+
+A revlog begins with a 32-bit big endian integer holding version info
+and feature flags. This integer overlaps with the first four bytes of
+the first revision entry.
+
+This integer is logically divided into 2 16-bit shorts. The least
+significant half of the integer is the format/version short. The other
+short holds feature flags that dictate behavior of the revlog.
+
+The following values for the format/version short are defined:
+
+0
+   The original revlog version.
+1
+   RevlogNG (*next generation*). It replaced version 0 when it was
+   implemented in 2006.
+2
+   In-development version incorporating accumulated knowledge and
+   missing features from 10+ years of revlog version 1.
+57005 (0xdead)
+   Reserved for internal testing of new versions. No defined format
+   beyond 32-bit header.
+
+The feature flags short consists of bit flags. Where 0 is the least
+significant bit. The bit flags vary by revlog version.
+
+Version 0 revlogs have no defined flags and the presence of a flag
+is considered an error.
+
+Version 1 revlogs have the following flags at the specified bit offsets:
+
+0
+   Store revision data inline.
+1
+   Generaldelta encoding.
+
+Version 2 revlogs have the following flags at the specified bit offsets:
+
+0
+   Store revision data inline.
+
+The following header values are common:
+
+00 00 00 01
+   v1
+00 01 00 01
+   v1 + inline
+00 02 00 01
+   v1 + generaldelta
+00 03 00 01
+   v1 + inline + generaldelta
+
+Following the 32-bit header is the remaining 60 bytes of the first index
+entry. Following that are additional *index* entries. Inlined revision
+data is possibly located between index entries. More on this inlined
+layout is described below.
+
+Version 1 Format
+================
+
+Version 1 (RevlogNG) begins with an index describing the revisions in
+the revlog. If the ``inline`` flag is set, revision data is stored inline,
+or between index entries (as opposed to in a separate container).
+
+Each index entry is 64 bytes. The byte layout of each entry is as
+follows, with byte 0 being the first byte (all data stored as big endian):
+
+0-3 (4 bytes) (rev 0 only)
+   Revlog header
+
+0-5 (6 bytes)
+   Absolute offset of revision data from beginning of revlog.
+
+6-7 (2 bytes)
+   Bit flags impacting revision behavior. The following bit offsets define:
+
+   0: REVIDX_ISCENSORED revision has censor metadata, must be verified.
+
+   1: REVIDX_ELLIPSIS revision hash does not match its data. Used by
+   narrowhg
+
+   2: REVIDX_EXTSTORED revision data is stored externally.
+
+8-11 (4 bytes)
+   Compressed length of revision data / chunk as stored in revlog.
+
+12-15 (4 bytes)
+   Uncompressed length of revision data. This is the size of the full
+   revision data, not the size of the chunk post decompression.
+
+16-19 (4 bytes)
+   Base or previous revision this revision's delta was produced against.
+   This revision holds full text (as opposed to a delta) if it points to
+   itself. For generaldelta repos, this is the previous revision in the
+   delta chain. For non-generaldelta repos, this is the base or first
+   revision in the delta chain.
+
+20-23 (4 bytes)
+   A revision this revision is *linked* to. This allows a revision in
+   one revlog to be forever associated with a revision in another
+   revlog. For example, a file's revlog may point to the changelog
+   revision that introduced it.
+
+24-27 (4 bytes)
+   Revision of 1st parent. -1 indicates no parent.
+
+28-31 (4 bytes)
+   Revision of 2nd parent. -1 indicates no 2nd parent.
+
+32-63 (32 bytes)
+   Hash of revision's full text. Currently, SHA-1 is used and only
+   the first 20 bytes of this field are used. The rest of the bytes
+   are ignored and should be stored as \0.
+
+If inline revision data is being stored, the compressed revision data
+(of length from bytes offset 8-11 from the index entry) immediately
+follows the index entry. There is no header on the revision data. There
+is no padding between it and the index entries before and after.
+
+If revision data is not inline, then raw revision data is stored in a
+separate byte container. The offsets from bytes 0-5 and the compressed
+length from bytes 8-11 define how to access this data.
+
+The 6 byte absolute offset field from the first revlog entry overlaps
+with the revlog header. That is, the first 6 bytes of the first revlog
+entry can be split into four bytes containing the header for the revlog
+file and an additional two bytes containing the offset for the first
+entry. Since this is the offset from the beginning of the file for the
+first revision entry, the two bytes will always be set to zero.
+
+Version 2 Format
+================
+
+(In development. Format not finalized or stable.)
+
+Version 2 is identical to version 2 with the following differences.
+
+There is no dedicated *generaldelta* revlog format flag. Instead,
+the feature is implied enabled by default.
+
+Delta Chains
+============
+
+Revision data is encoded as a chain of *chunks*. Each chain begins with
+the compressed original full text for that revision. Each subsequent
+*chunk* is a *delta* against the previous revision. We therefore call
+these chains of chunks/deltas *delta chains*.
+
+The full text for a revision is reconstructed by loading the original
+full text for the base revision of a *delta chain* and then applying
+*deltas* until the target revision is reconstructed.
+
+*Delta chains* are limited in length so lookup time is bound. They are
+limited to ~2x the length of the revision's data. The linear distance
+between the base chunk and the final chunk is also limited so the
+amount of read I/O to load all chunks in the delta chain is bound.
+
+Deltas and delta chains are either computed against the previous
+revision in the revlog or another revision (almost certainly one of
+the parents of the revision). Historically, deltas were computed against
+the previous revision. The *generaldelta* revlog feature flag (enabled
+by default in Mercurial 3.7) activates the mode where deltas are
+computed against an arbitrary revision (almost certainly a parent revision).
+
+File Storage
+============
+
+Revlogs logically consist of an index (metadata of entries) and
+revision data. This data may be stored together in a single file or in
+separate files. The mechanism used is indicated by the ``inline`` feature
+flag on the revlog.
+
+Mercurial's behavior is to use inline storage until a revlog reaches a
+certain size, at which point it will be converted to non-inline. The
+reason there is a size limit on inline storage is to establish an upper
+bound on how much data must be read to load the index. It would be a waste
+to read tens or hundreds of extra megabytes of data just to access the
+index data.
+
+The actual layout of revlog files on disk is governed by the repository's
+*store format*. Typically, a ``.i`` file represents the index revlog
+(possibly containing inline data) and a ``.d`` file holds the revision data.
+
+Revision Entries
+================
+
+Revision entries consist of an optional 1 byte header followed by an
+encoding of the revision data. The headers are as follows:
+
+\0 (0x00)
+   Revision data is the entirety of the entry, including this header.
+u (0x75)
+   Raw revision data follows.
+x (0x78)
+   zlib (RFC 1950) data.
+
+   The 0x78 value is actually the first byte of the zlib header (CMF byte).
+
+Hash Computation
+================
+
+The hash of the revision is stored in the index and is used both as a primary
+key and for data integrity verification.
+
+Currently, SHA-1 is the only supported hashing algorithm. To obtain the SHA-1
+hash of a revision:
+
+1. Hash the parent nodes
+2. Hash the fulltext of the revision
+
+The 20 byte node ids of the parents are fed into the hasher in ascending order.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/wireprotocol.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,1277 @@
+The Mercurial wire protocol is a request-response based protocol
+with multiple wire representations.
+
+Each request is modeled as a command name, a dictionary of arguments, and
+optional raw input. Command arguments and their types are intrinsic
+properties of commands. So is the response type of the command. This means
+clients can't always send arbitrary arguments to servers and servers can't
+return multiple response types.
+
+The protocol is synchronous and does not support multiplexing (concurrent
+commands).
+
+Handshake
+=========
+
+It is required or common for clients to perform a *handshake* when connecting
+to a server. The handshake serves the following purposes:
+
+* Negotiating protocol/transport level options
+* Allows the client to learn about server capabilities to influence
+  future requests
+* Ensures the underlying transport channel is in a *clean* state
+
+An important goal of the handshake is to allow clients to use more modern
+wire protocol features. By default, clients must assume they are talking
+to an old version of Mercurial server (possibly even the very first
+implementation). So, clients should not attempt to call or utilize modern
+wire protocol features until they have confirmation that the server
+supports them. The handshake implementation is designed to allow both
+ends to utilize the latest set of features and capabilities with as
+few round trips as possible.
+
+The handshake mechanism varies by transport and protocol and is documented
+in the sections below.
+
+HTTP Protocol
+=============
+
+Handshake
+---------
+
+The client sends a ``capabilities`` command request (``?cmd=capabilities``)
+as soon as HTTP requests may be issued.
+
+By default, the server responds with a version 1 capabilities string, which
+the client parses to learn about the server's abilities. The ``Content-Type``
+for this response is ``application/mercurial-0.1`` or
+``application/mercurial-0.2`` depending on whether the client advertised
+support for version ``0.2`` in its request. (Clients aren't supposed to
+advertise support for ``0.2`` until the capabilities response indicates
+the server's support for that media type. However, a client could
+conceivably cache this metadata and issue the capabilities request in such
+a way to elicit an ``application/mercurial-0.2`` response.)
+
+Clients wishing to switch to a newer API service may send an
+``X-HgUpgrade-<X>`` header containing a space-delimited list of API service
+names the client is capable of speaking. The request MUST also include an
+``X-HgProto-<X>`` header advertising a known serialization format for the
+response. ``cbor`` is currently the only defined serialization format.
+
+If the request contains these headers, the response ``Content-Type`` MAY
+be for a different media type. e.g. ``application/mercurial-cbor`` if the
+client advertises support for CBOR.
+
+The response MUST be deserializable to a map with the following keys:
+
+apibase
+   URL path to API services, relative to the repository root. e.g. ``api/``.
+
+apis
+   A map of API service names to API descriptors. An API descriptor contains
+   more details about that API. In the case of the HTTP Version 2 Transport,
+   it will be the normal response to a ``capabilities`` command.
+
+   Only the services advertised by the client that are also available on
+   the server are advertised.
+
+v1capabilities
+   The capabilities string that would be returned by a version 1 response.
+
+The client can then inspect the server-advertised APIs and decide which
+API to use, including continuing to use the HTTP Version 1 Transport.
+
+HTTP Version 1 Transport
+------------------------
+
+Commands are issued as HTTP/1.0 or HTTP/1.1 requests. Commands are
+sent to the base URL of the repository with the command name sent in
+the ``cmd`` query string parameter. e.g.
+``https://example.com/repo?cmd=capabilities``. The HTTP method is ``GET``
+or ``POST`` depending on the command and whether there is a request
+body.
+
+Command arguments can be sent multiple ways.
+
+The simplest is part of the URL query string using ``x-www-form-urlencoded``
+encoding (see Python's ``urllib.urlencode()``. However, many servers impose
+length limitations on the URL. So this mechanism is typically only used if
+the server doesn't support other mechanisms.
+
+If the server supports the ``httpheader`` capability, command arguments can
+be sent in HTTP request headers named ``X-HgArg-<N>`` where ``<N>`` is an
+integer starting at 1. A ``x-www-form-urlencoded`` representation of the
+arguments is obtained. This full string is then split into chunks and sent
+in numbered ``X-HgArg-<N>`` headers. The maximum length of each HTTP header
+is defined by the server in the ``httpheader`` capability value, which defaults
+to ``1024``. The server reassembles the encoded arguments string by
+concatenating the ``X-HgArg-<N>`` headers then URL decodes them into a
+dictionary.
+
+The list of ``X-HgArg-<N>`` headers should be added to the ``Vary`` request
+header to instruct caches to take these headers into consideration when caching
+requests.
+
+If the server supports the ``httppostargs`` capability, the client
+may send command arguments in the HTTP request body as part of an
+HTTP POST request. The command arguments will be URL encoded just like
+they would for sending them via HTTP headers. However, no splitting is
+performed: the raw arguments are included in the HTTP request body.
+
+The client sends a ``X-HgArgs-Post`` header with the string length of the
+encoded arguments data. Additional data may be included in the HTTP
+request body immediately following the argument data. The offset of the
+non-argument data is defined by the ``X-HgArgs-Post`` header. The
+``X-HgArgs-Post`` header is not required if there is no argument data.
+
+Additional command data can be sent as part of the HTTP request body. The
+default ``Content-Type`` when sending data is ``application/mercurial-0.1``.
+A ``Content-Length`` header is currently always sent.
+
+Example HTTP requests::
+
+    GET /repo?cmd=capabilities
+    X-HgArg-1: foo=bar&baz=hello%20world
+
+The request media type should be chosen based on server support. If the
+``httpmediatype`` server capability is present, the client should send
+the newest mutually supported media type. If this capability is absent,
+the client must assume the server only supports the
+``application/mercurial-0.1`` media type.
+
+The ``Content-Type`` HTTP response header identifies the response as coming
+from Mercurial and can also be used to signal an error has occurred.
+
+The ``application/mercurial-*`` media types indicate a generic Mercurial
+data type.
+
+The ``application/mercurial-0.1`` media type is raw Mercurial data. It is the
+predecessor of the format below.
+
+The ``application/mercurial-0.2`` media type is compression framed Mercurial
+data. The first byte of the payload indicates the length of the compression
+format identifier that follows. Next are N bytes indicating the compression
+format. e.g. ``zlib``. The remaining bytes are compressed according to that
+compression format. The decompressed data behaves the same as with
+``application/mercurial-0.1``.
+
+The ``application/hg-error`` media type indicates a generic error occurred.
+The content of the HTTP response body typically holds text describing the
+error.
+
+The ``application/mercurial-cbor`` media type indicates a CBOR payload
+and should be interpreted as identical to ``application/cbor``.
+
+Behavior of media types is further described in the ``Content Negotiation``
+section below.
+
+Clients should issue a ``User-Agent`` request header that identifies the client.
+The server should not use the ``User-Agent`` for feature detection.
+
+A command returning a ``string`` response issues a
+``application/mercurial-0.*`` media type and the HTTP response body contains
+the raw string value (after compression decoding, if used). A
+``Content-Length`` header is typically issued, but not required.
+
+A command returning a ``stream`` response issues a
+``application/mercurial-0.*`` media type and the HTTP response is typically
+using *chunked transfer* (``Transfer-Encoding: chunked``).
+
+HTTP Version 2 Transport
+------------------------
+
+**Experimental - feature under active development**
+
+Version 2 of the HTTP protocol is exposed under the ``/api/*`` URL space.
+It's final API name is not yet formalized.
+
+Commands are triggered by sending HTTP POST requests against URLs of the
+form ``<permission>/<command>``, where ``<permission>`` is ``ro`` or
+``rw``, meaning read-only and read-write, respectively and ``<command>``
+is a named wire protocol command.
+
+Non-POST request methods MUST be rejected by the server with an HTTP
+405 response.
+
+Commands that modify repository state in meaningful ways MUST NOT be
+exposed under the ``ro`` URL prefix. All available commands MUST be
+available under the ``rw`` URL prefix.
+
+Server adminstrators MAY implement blanket HTTP authentication keyed
+off the URL prefix. For example, a server may require authentication
+for all ``rw/*`` URLs and let unauthenticated requests to ``ro/*``
+URL proceed. A server MAY issue an HTTP 401, 403, or 407 response
+in accordance with RFC 7235. Clients SHOULD recognize the HTTP Basic
+(RFC 7617) and Digest (RFC 7616) authentication schemes. Clients SHOULD
+make an attempt to recognize unknown schemes using the
+``WWW-Authenticate`` response header on a 401 response, as defined by
+RFC 7235.
+
+Read-only commands are accessible under ``rw/*`` URLs so clients can
+signal the intent of the operation very early in the connection
+lifecycle. For example, a ``push`` operation - which consists of
+various read-only commands mixed with at least one read-write command -
+can perform all commands against ``rw/*`` URLs so that any server-side
+authentication requirements are discovered upon attempting the first
+command - not potentially several commands into the exchange. This
+allows clients to fail faster or prompt for credentials as soon as the
+exchange takes place. This provides a better end-user experience.
+
+Requests to unknown commands or URLS result in an HTTP 404.
+TODO formally define response type, how error is communicated, etc.
+
+HTTP request and response bodies use the ``hgrpc`` protocol for media
+exchange.` (See :hg:`help internals.wireprotocolrpc` for details of
+the protocol.) The entirety of the HTTP message body is 0 or more frames
+as defined by this protocol.
+
+Clients and servers MUST advertise the ``TBD`` media type via the
+``Content-Type`` request and response headers. In addition, clients MUST
+advertise this media type value in their ``Accept`` request header in all
+requests.
+TODO finalize the media type. For now, it is defined in wireprotoserver.py.
+
+Servers receiving requests without an ``Accept`` header SHOULD respond with
+an HTTP 406.
+
+Servers receiving requests with an invalid ``Content-Type`` header SHOULD
+respond with an HTTP 415.
+
+The command to run is specified in the POST payload as defined by ``hgrpc``.
+This is redundant with data already encoded in the URL. This is by design,
+so server operators can have better understanding about server activity from
+looking merely at HTTP access logs.
+
+In most circumstances, the command specified in the URL MUST match
+the command specified in the frame-based payload or the server will
+respond with an error. The exception to this is the special
+``multirequest`` URL. (See below.) In addition, HTTP requests
+are limited to one command invocation. The exception is the special
+``multirequest`` URL.
+
+The ``multirequest`` command endpoints (``ro/multirequest`` and
+``rw/multirequest``) are special in that they allow the execution of
+*any* command and allow the execution of multiple commands. If the
+HTTP request issues multiple commands across multiple frames, all
+issued commands will be processed by the server. Per the defined
+behavior of ``hgrpc```, commands may be issued interleaved and responses
+may come back in a different order than they were issued. Clients MUST
+be able to deal with this.
+
+SSH Protocol
+============
+
+Handshake
+---------
+
+For all clients, the handshake consists of the client sending 1 or more
+commands to the server using version 1 of the transport. Servers respond
+to commands they know how to respond to and send an empty response (``0\n``)
+for unknown commands (per standard behavior of version 1 of the transport).
+Clients then typically look for a response to the newest sent command to
+determine which transport version to use and what the available features for
+the connection and server are.
+
+Preceding any response from client-issued commands, the server may print
+non-protocol output. It is common for SSH servers to print banners, message
+of the day announcements, etc when clients connect. It is assumed that any
+such *banner* output will precede any Mercurial server output. So clients
+must be prepared to handle server output on initial connect that isn't
+in response to any client-issued command and doesn't conform to Mercurial's
+wire protocol. This *banner* output should only be on stdout. However,
+some servers may send output on stderr.
+
+Pre 0.9.1 clients issue a ``between`` command with the ``pairs`` argument
+having the value
+``0000000000000000000000000000000000000000-0000000000000000000000000000000000000000``.
+
+The ``between`` command has been supported since the original Mercurial
+SSH server. Requesting the empty range will return a ``\n`` string response,
+which will be encoded as ``1\n\n`` (value length of ``1`` followed by a newline
+followed by the value, which happens to be a newline).
+
+For pre 0.9.1 clients and all servers, the exchange looks like::
+
+   c: between\n
+   c: pairs 81\n
+   c: 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
+   s: 1\n
+   s: \n
+
+0.9.1+ clients send a ``hello`` command (with no arguments) before the
+``between`` command. The response to this command allows clients to
+discover server capabilities and settings.
+
+An example exchange between 0.9.1+ clients and a ``hello`` aware server looks
+like::
+
+   c: hello\n
+   c: between\n
+   c: pairs 81\n
+   c: 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
+   s: 324\n
+   s: capabilities: lookup changegroupsubset branchmap pushkey known getbundle ...\n
+   s: 1\n
+   s: \n
+
+And a similar scenario but with servers sending a banner on connect::
+
+   c: hello\n
+   c: between\n
+   c: pairs 81\n
+   c: 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
+   s: welcome to the server\n
+   s: if you find any issues, email someone@somewhere.com\n
+   s: 324\n
+   s: capabilities: lookup changegroupsubset branchmap pushkey known getbundle ...\n
+   s: 1\n
+   s: \n
+
+Note that output from the ``hello`` command is terminated by a ``\n``. This is
+part of the response payload and not part of the wire protocol adding a newline
+after responses. In other words, the length of the response contains the
+trailing ``\n``.
+
+Clients supporting version 2 of the SSH transport send a line beginning
+with ``upgrade`` before the ``hello`` and ``between`` commands. The line
+(which isn't a well-formed command line because it doesn't consist of a
+single command name) serves to both communicate the client's intent to
+switch to transport version 2 (transports are version 1 by default) as
+well as to advertise the client's transport-level capabilities so the
+server may satisfy that request immediately.
+
+The upgrade line has the form:
+
+    upgrade <token> <transport capabilities>
+
+That is the literal string ``upgrade`` followed by a space, followed by
+a randomly generated string, followed by a space, followed by a string
+denoting the client's transport capabilities.
+
+The token can be anything. However, a random UUID is recommended. (Use
+of version 4 UUIDs is recommended because version 1 UUIDs can leak the
+client's MAC address.)
+
+The transport capabilities string is a URL/percent encoded string
+containing key-value pairs defining the client's transport-level
+capabilities. The following capabilities are defined:
+
+proto
+   A comma-delimited list of transport protocol versions the client
+   supports. e.g. ``ssh-v2``.
+
+If the server does not recognize the ``upgrade`` line, it should issue
+an empty response and continue processing the ``hello`` and ``between``
+commands. Here is an example handshake between a version 2 aware client
+and a non version 2 aware server:
+
+   c: upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=ssh-v2
+   c: hello\n
+   c: between\n
+   c: pairs 81\n
+   c: 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
+   s: 0\n
+   s: 324\n
+   s: capabilities: lookup changegroupsubset branchmap pushkey known getbundle ...\n
+   s: 1\n
+   s: \n
+
+(The initial ``0\n`` line from the server indicates an empty response to
+the unknown ``upgrade ..`` command/line.)
+
+If the server recognizes the ``upgrade`` line and is willing to satisfy that
+upgrade request, it replies to with a payload of the following form:
+
+   upgraded <token> <transport name>\n
+
+This line is the literal string ``upgraded``, a space, the token that was
+specified by the client in its ``upgrade ...`` request line, a space, and the
+name of the transport protocol that was chosen by the server. The transport
+name MUST match one of the names the client specified in the ``proto`` field
+of its ``upgrade ...`` request line.
+
+If a server issues an ``upgraded`` response, it MUST also read and ignore
+the lines associated with the ``hello`` and ``between`` command requests
+that were issued by the server. It is assumed that the negotiated transport
+will respond with equivalent requested information following the transport
+handshake.
+
+All data following the ``\n`` terminating the ``upgraded`` line is the
+domain of the negotiated transport. It is common for the data immediately
+following to contain additional metadata about the state of the transport and
+the server. However, this isn't strictly speaking part of the transport
+handshake and isn't covered by this section.
+
+Here is an example handshake between a version 2 aware client and a version
+2 aware server:
+
+   c:  upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=ssh-v2
+   c:  hello\n
+   c:  between\n
+   c:  pairs 81\n
+   c:  0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
+   s: upgraded 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a ssh-v2\n
+   s: <additional transport specific data>
+
+The client-issued token that is echoed in the response provides a more
+resilient mechanism for differentiating *banner* output from Mercurial
+output. In version 1, properly formatted banner output could get confused
+for Mercurial server output. By submitting a randomly generated token
+that is then present in the response, the client can look for that token
+in response lines and have reasonable certainty that the line did not
+originate from a *banner* message.
+
+SSH Version 1 Transport
+-----------------------
+
+The SSH transport (version 1) is a custom text-based protocol suitable for
+use over any bi-directional stream transport. It is most commonly used with
+SSH.
+
+A SSH transport server can be started with ``hg serve --stdio``. The stdin,
+stderr, and stdout file descriptors of the started process are used to exchange
+data. When Mercurial connects to a remote server over SSH, it actually starts
+a ``hg serve --stdio`` process on the remote server.
+
+Commands are issued by sending the command name followed by a trailing newline
+``\n`` to the server. e.g. ``capabilities\n``.
+
+Command arguments are sent in the following format::
+
+    <argument> <length>\n<value>
+
+That is, the argument string name followed by a space followed by the
+integer length of the value (expressed as a string) followed by a newline
+(``\n``) followed by the raw argument value.
+
+Dictionary arguments are encoded differently::
+
+    <argument> <# elements>\n
+    <key1> <length1>\n<value1>
+    <key2> <length2>\n<value2>
+    ...
+
+Non-argument data is sent immediately after the final argument value. It is
+encoded in chunks::
+
+    <length>\n<data>
+
+Each command declares a list of supported arguments and their types. If a
+client sends an unknown argument to the server, the server should abort
+immediately. The special argument ``*`` in a command's definition indicates
+that all argument names are allowed.
+
+The definition of supported arguments and types is initially made when a
+new command is implemented. The client and server must initially independently
+agree on the arguments and their types. This initial set of arguments can be
+supplemented through the presence of *capabilities* advertised by the server.
+
+Each command has a defined expected response type.
+
+A ``string`` response type is a length framed value. The response consists of
+the string encoded integer length of a value followed by a newline (``\n``)
+followed by the value. Empty values are allowed (and are represented as
+``0\n``).
+
+A ``stream`` response type consists of raw bytes of data. There is no framing.
+
+A generic error response type is also supported. It consists of a an error
+message written to ``stderr`` followed by ``\n-\n``. In addition, ``\n`` is
+written to ``stdout``.
+
+If the server receives an unknown command, it will send an empty ``string``
+response.
+
+The server terminates if it receives an empty command (a ``\n`` character).
+
+If the server announces support for the ``protocaps`` capability, the client
+should issue a ``protocaps`` command after the initial handshake to annonunce
+its own capabilities. The client capabilities are persistent.
+
+SSH Version 2 Transport
+-----------------------
+
+**Experimental and under development**
+
+Version 2 of the SSH transport behaves identically to version 1 of the SSH
+transport with the exception of handshake semantics. See above for how
+version 2 of the SSH transport is negotiated.
+
+Immediately following the ``upgraded`` line signaling a switch to version
+2 of the SSH protocol, the server automatically sends additional details
+about the capabilities of the remote server. This has the form:
+
+   <integer length of value>\n
+   capabilities: ...\n
+
+e.g.
+
+   s: upgraded 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a ssh-v2\n
+   s: 240\n
+   s: capabilities: known getbundle batch ...\n
+
+Following capabilities advertisement, the peers communicate using version
+1 of the SSH transport.
+
+Capabilities
+============
+
+Servers advertise supported wire protocol features. This allows clients to
+probe for server features before blindly calling a command or passing a
+specific argument.
+
+The server's features are exposed via a *capabilities* string. This is a
+space-delimited string of tokens/features. Some features are single words
+like ``lookup`` or ``batch``. Others are complicated key-value pairs
+advertising sub-features. e.g. ``httpheader=2048``. When complex, non-word
+values are used, each feature name can define its own encoding of sub-values.
+Comma-delimited and ``x-www-form-urlencoded`` values are common.
+
+The following document capabilities defined by the canonical Mercurial server
+implementation.
+
+batch
+-----
+
+Whether the server supports the ``batch`` command.
+
+This capability/command was introduced in Mercurial 1.9 (released July 2011).
+
+branchmap
+---------
+
+Whether the server supports the ``branchmap`` command.
+
+This capability/command was introduced in Mercurial 1.3 (released July 2009).
+
+bundle2-exp
+-----------
+
+Precursor to ``bundle2`` capability that was used before bundle2 was a
+stable feature.
+
+This capability was introduced in Mercurial 3.0 behind an experimental
+flag. This capability should not be observed in the wild.
+
+bundle2
+-------
+
+Indicates whether the server supports the ``bundle2`` data exchange format.
+
+The value of the capability is a URL quoted, newline (``\n``) delimited
+list of keys or key-value pairs.
+
+A key is simply a URL encoded string.
+
+A key-value pair is a URL encoded key separated from a URL encoded value by
+an ``=``. If the value is a list, elements are delimited by a ``,`` after
+URL encoding.
+
+For example, say we have the values::
+
+  {'HG20': [], 'changegroup': ['01', '02'], 'digests': ['sha1', 'sha512']}
+
+We would first construct a string::
+
+  HG20\nchangegroup=01,02\ndigests=sha1,sha512
+
+We would then URL quote this string::
+
+  HG20%0Achangegroup%3D01%2C02%0Adigests%3Dsha1%2Csha512
+
+This capability was introduced in Mercurial 3.4 (released May 2015).
+
+changegroupsubset
+-----------------
+
+Whether the server supports the ``changegroupsubset`` command.
+
+This capability was introduced in Mercurial 0.9.2 (released December
+2006).
+
+This capability was introduced at the same time as the ``lookup``
+capability/command.
+
+compression
+-----------
+
+Declares support for negotiating compression formats.
+
+Presence of this capability indicates the server supports dynamic selection
+of compression formats based on the client request.
+
+Servers advertising this capability are required to support the
+``application/mercurial-0.2`` media type in response to commands returning
+streams. Servers may support this media type on any command.
+
+The value of the capability is a comma-delimited list of strings declaring
+supported compression formats. The order of the compression formats is in
+server-preferred order, most preferred first.
+
+The identifiers used by the official Mercurial distribution are:
+
+bzip2
+   bzip2
+none
+   uncompressed / raw data
+zlib
+   zlib (no gzip header)
+zstd
+   zstd
+
+This capability was introduced in Mercurial 4.1 (released February 2017).
+
+getbundle
+---------
+
+Whether the server supports the ``getbundle`` command.
+
+This capability was introduced in Mercurial 1.9 (released July 2011).
+
+httpheader
+----------
+
+Whether the server supports receiving command arguments via HTTP request
+headers.
+
+The value of the capability is an integer describing the max header
+length that clients should send. Clients should ignore any content after a
+comma in the value, as this is reserved for future use.
+
+This capability was introduced in Mercurial 1.9 (released July 2011).
+
+httpmediatype
+-------------
+
+Indicates which HTTP media types (``Content-Type`` header) the server is
+capable of receiving and sending.
+
+The value of the capability is a comma-delimited list of strings identifying
+support for media type and transmission direction. The following strings may
+be present:
+
+0.1rx
+   Indicates server support for receiving ``application/mercurial-0.1`` media
+   types.
+
+0.1tx
+   Indicates server support for sending ``application/mercurial-0.1`` media
+   types.
+
+0.2rx
+   Indicates server support for receiving ``application/mercurial-0.2`` media
+   types.
+
+0.2tx
+   Indicates server support for sending ``application/mercurial-0.2`` media
+   types.
+
+minrx=X
+   Minimum media type version the server is capable of receiving. Value is a
+   string like ``0.2``.
+
+   This capability can be used by servers to limit connections from legacy
+   clients not using the latest supported media type. However, only clients
+   with knowledge of this capability will know to consult this value. This
+   capability is present so the client may issue a more user-friendly error
+   when the server has locked out a legacy client.
+
+mintx=X
+   Minimum media type version the server is capable of sending. Value is a
+   string like ``0.1``.
+
+Servers advertising support for the ``application/mercurial-0.2`` media type
+should also advertise the ``compression`` capability.
+
+This capability was introduced in Mercurial 4.1 (released February 2017).
+
+httppostargs
+------------
+
+**Experimental**
+
+Indicates that the server supports and prefers clients send command arguments
+via a HTTP POST request as part of the request body.
+
+This capability was introduced in Mercurial 3.8 (released May 2016).
+
+known
+-----
+
+Whether the server supports the ``known`` command.
+
+This capability/command was introduced in Mercurial 1.9 (released July 2011).
+
+lfs
+---
+
+Indicates that the LFS extension is enabled on the server.  It makes no claims
+about the repository actually having LFS blobs committed to it.
+
+This capability was introduced by the LFS extension in Mercurial 4.5 (released
+Feb 2018).
+
+lfs-serve
+---------
+
+Indicates that the LFS extension is enabled on the server, and LFS blobs are
+committed to the remote repository.  (Specifically, it indicates that the 'lfs'
+requirement is present in the remote repository.)
+
+This capability was introduced by the LFS extension in Mercurial 4.8 (released
+Nov 2018).
+
+lookup
+------
+
+Whether the server supports the ``lookup`` command.
+
+This capability was introduced in Mercurial 0.9.2 (released December
+2006).
+
+This capability was introduced at the same time as the ``changegroupsubset``
+capability/command.
+
+partial-pull
+------------
+
+Indicates that the client can deal with partial answers to pull requests
+by repeating the request.
+
+If this parameter is not advertised, the server will not send pull bundles.
+
+This client capability was introduced in Mercurial 4.6.
+
+protocaps
+---------
+
+Whether the server supports the ``protocaps`` command for SSH V1 transport.
+
+This capability was introduced in Mercurial 4.6.
+
+pushkey
+-------
+
+Whether the server supports the ``pushkey`` and ``listkeys`` commands.
+
+This capability was introduced in Mercurial 1.6 (released July 2010).
+
+standardbundle
+--------------
+
+**Unsupported**
+
+This capability was introduced during the Mercurial 0.9.2 development cycle in
+2006. It was never present in a release, as it was replaced by the ``unbundle``
+capability. This capability should not be encountered in the wild.
+
+stream-preferred
+----------------
+
+If present the server prefers that clients clone using the streaming clone
+protocol (``hg clone --stream``) rather than the standard
+changegroup/bundle based protocol.
+
+This capability was introduced in Mercurial 2.2 (released May 2012).
+
+streamreqs
+----------
+
+Indicates whether the server supports *streaming clones* and the *requirements*
+that clients must support to receive it.
+
+If present, the server supports the ``stream_out`` command, which transmits
+raw revlogs from the repository instead of changegroups. This provides a faster
+cloning mechanism at the expense of more bandwidth used.
+
+The value of this capability is a comma-delimited list of repo format
+*requirements*. These are requirements that impact the reading of data in
+the ``.hg/store`` directory. An example value is
+``streamreqs=generaldelta,revlogv1`` indicating the server repo requires
+the ``revlogv1`` and ``generaldelta`` requirements.
+
+If the only format requirement is ``revlogv1``, the server may expose the
+``stream`` capability instead of the ``streamreqs`` capability.
+
+This capability was introduced in Mercurial 1.7 (released November 2010).
+
+stream
+------
+
+Whether the server supports *streaming clones* from ``revlogv1`` repos.
+
+If present, the server supports the ``stream_out`` command, which transmits
+raw revlogs from the repository instead of changegroups. This provides a faster
+cloning mechanism at the expense of more bandwidth used.
+
+This capability was introduced in Mercurial 0.9.1 (released July 2006).
+
+When initially introduced, the value of the capability was the numeric
+revlog revision. e.g. ``stream=1``. This indicates the changegroup is using
+``revlogv1``. This simple integer value wasn't powerful enough, so the
+``streamreqs`` capability was invented to handle cases where the repo
+requirements have more than just ``revlogv1``. Newer servers omit the
+``=1`` since it was the only value supported and the value of ``1`` can
+be implied by clients.
+
+unbundlehash
+------------
+
+Whether the ``unbundle`` commands supports receiving a hash of all the
+heads instead of a list.
+
+For more, see the documentation for the ``unbundle`` command.
+
+This capability was introduced in Mercurial 1.9 (released July 2011).
+
+unbundle
+--------
+
+Whether the server supports pushing via the ``unbundle`` command.
+
+This capability/command has been present since Mercurial 0.9.1 (released
+July 2006).
+
+Mercurial 0.9.2 (released December 2006) added values to the capability
+indicating which bundle types the server supports receiving. This value is a
+comma-delimited list. e.g. ``HG10GZ,HG10BZ,HG10UN``. The order of values
+reflects the priority/preference of that type, where the first value is the
+most preferred type.
+
+Content Negotiation
+===================
+
+The wire protocol has some mechanisms to help peers determine what content
+types and encoding the other side will accept. Historically, these mechanisms
+have been built into commands themselves because most commands only send a
+well-defined response type and only certain commands needed to support
+functionality like compression.
+
+Currently, only the HTTP version 1 transport supports content negotiation
+at the protocol layer.
+
+HTTP requests advertise supported response formats via the ``X-HgProto-<N>``
+request header, where ``<N>`` is an integer starting at 1 allowing the logical
+value to span multiple headers. This value consists of a list of
+space-delimited parameters. Each parameter denotes a feature or capability.
+
+The following parameters are defined:
+
+0.1
+   Indicates the client supports receiving ``application/mercurial-0.1``
+   responses.
+
+0.2
+   Indicates the client supports receiving ``application/mercurial-0.2``
+   responses.
+
+cbor
+   Indicates the client supports receiving ``application/mercurial-cbor``
+   responses.
+
+   (Only intended to be used with version 2 transports.)
+
+comp
+   Indicates compression formats the client can decode. Value is a list of
+   comma delimited strings identifying compression formats ordered from
+   most preferential to least preferential. e.g. ``comp=zstd,zlib,none``.
+
+   This parameter does not have an effect if only the ``0.1`` parameter
+   is defined, as support for ``application/mercurial-0.2`` or greater is
+   required to use arbitrary compression formats.
+
+   If this parameter is not advertised, the server interprets this as
+   equivalent to ``zlib,none``.
+
+Clients may choose to only send this header if the ``httpmediatype``
+server capability is present, as currently all server-side features
+consulting this header require the client to opt in to new protocol features
+advertised via the ``httpmediatype`` capability.
+
+A server that doesn't receive an ``X-HgProto-<N>`` header should infer a
+value of ``0.1``. This is compatible with legacy clients.
+
+A server receiving a request indicating support for multiple media type
+versions may respond with any of the supported media types. Not all servers
+may support all media types on all commands.
+
+Commands
+========
+
+This section contains a list of all wire protocol commands implemented by
+the canonical Mercurial server.
+
+See :hg:`help internals.wireprotocolv2` for information on commands exposed
+to the frame-based protocol.
+
+batch
+-----
+
+Issue multiple commands while sending a single command request. The purpose
+of this command is to allow a client to issue multiple commands while avoiding
+multiple round trips to the server therefore enabling commands to complete
+quicker.
+
+The command accepts a ``cmds`` argument that contains a list of commands to
+execute.
+
+The value of ``cmds`` is a ``;`` delimited list of strings. Each string has the
+form ``<command> <arguments>``. That is, the command name followed by a space
+followed by an argument string.
+
+The argument string is a ``,`` delimited list of ``<key>=<value>`` values
+corresponding to command arguments. Both the argument name and value are
+escaped using a special substitution map::
+
+   : -> :c
+   , -> :o
+   ; -> :s
+   = -> :e
+
+The response type for this command is ``string``. The value contains a
+``;`` delimited list of responses for each requested command. Each value
+in this list is escaped using the same substitution map used for arguments.
+
+If an error occurs, the generic error response may be sent.
+
+between
+-------
+
+(Legacy command used for discovery in old clients)
+
+Obtain nodes between pairs of nodes.
+
+The ``pairs`` arguments contains a space-delimited list of ``-`` delimited
+hex node pairs. e.g.::
+
+   a072279d3f7fd3a4aa7ffa1a5af8efc573e1c896-6dc58916e7c070f678682bfe404d2e2d68291a18
+
+Return type is a ``string``. Value consists of lines corresponding to each
+requested range. Each line contains a space-delimited list of hex nodes.
+A newline ``\n`` terminates each line, including the last one.
+
+branchmap
+---------
+
+Obtain heads in named branches.
+
+Accepts no arguments. Return type is a ``string``.
+
+Return value contains lines with URL encoded branch names followed by a space
+followed by a space-delimited list of hex nodes of heads on that branch.
+e.g.::
+
+    default a072279d3f7fd3a4aa7ffa1a5af8efc573e1c896 6dc58916e7c070f678682bfe404d2e2d68291a18
+    stable baae3bf31522f41dd5e6d7377d0edd8d1cf3fccc
+
+There is no trailing newline.
+
+branches
+--------
+
+(Legacy command used for discovery in old clients. Clients with ``getbundle``
+use the ``known`` and ``heads`` commands instead.)
+
+Obtain ancestor changesets of specific nodes back to a branch point.
+
+Despite the name, this command has nothing to do with Mercurial named branches.
+Instead, it is related to DAG branches.
+
+The command accepts a ``nodes`` argument, which is a string of space-delimited
+hex nodes.
+
+For each node requested, the server will find the first ancestor node that is
+a DAG root or is a merge.
+
+Return type is a ``string``. Return value contains lines with result data for
+each requested node. Each line contains space-delimited nodes followed by a
+newline (``\n``). The 4 nodes reported on each line correspond to the requested
+node, the ancestor node found, and its 2 parent nodes (which may be the null
+node).
+
+capabilities
+------------
+
+Obtain the capabilities string for the repo.
+
+Unlike the ``hello`` command, the capabilities string is not prefixed.
+There is no trailing newline.
+
+This command does not accept any arguments. Return type is a ``string``.
+
+This command was introduced in Mercurial 0.9.1 (released July 2006).
+
+changegroup
+-----------
+
+(Legacy command: use ``getbundle`` instead)
+
+Obtain a changegroup version 1 with data for changesets that are
+descendants of client-specified changesets.
+
+The ``roots`` arguments contains a list of space-delimited hex nodes.
+
+The server responds with a changegroup version 1 containing all
+changesets between the requested root/base nodes and the repo's head nodes
+at the time of the request.
+
+The return type is a ``stream``.
+
+changegroupsubset
+-----------------
+
+(Legacy command: use ``getbundle`` instead)
+
+Obtain a changegroup version 1 with data for changesetsets between
+client specified base and head nodes.
+
+The ``bases`` argument contains a list of space-delimited hex nodes.
+The ``heads`` argument contains a list of space-delimited hex nodes.
+
+The server responds with a changegroup version 1 containing all
+changesets between the requested base and head nodes at the time of the
+request.
+
+The return type is a ``stream``.
+
+clonebundles
+------------
+
+Obtains a manifest of bundle URLs available to seed clones.
+
+Each returned line contains a URL followed by metadata. See the
+documentation in the ``clonebundles`` extension for more.
+
+The return type is a ``string``.
+
+getbundle
+---------
+
+Obtain a bundle containing repository data.
+
+This command accepts the following arguments:
+
+heads
+   List of space-delimited hex nodes of heads to retrieve.
+common
+   List of space-delimited hex nodes that the client has in common with the
+   server.
+obsmarkers
+   Boolean indicating whether to include obsolescence markers as part
+   of the response. Only works with bundle2.
+bundlecaps
+   Comma-delimited set of strings defining client bundle capabilities.
+listkeys
+   Comma-delimited list of strings of ``pushkey`` namespaces. For each
+   namespace listed, a bundle2 part will be included with the content of
+   that namespace.
+cg
+   Boolean indicating whether changegroup data is requested.
+cbattempted
+   Boolean indicating whether the client attempted to use the *clone bundles*
+   feature before performing this request.
+bookmarks
+   Boolean indicating whether bookmark data is requested.
+phases
+   Boolean indicating whether phases data is requested.
+
+The return type on success is a ``stream`` where the value is bundle.
+On the HTTP version 1 transport, the response is zlib compressed.
+
+If an error occurs, a generic error response can be sent.
+
+Unless the client sends a false value for the ``cg`` argument, the returned
+bundle contains a changegroup with the nodes between the specified ``common``
+and ``heads`` nodes. Depending on the command arguments, the type and content
+of the returned bundle can vary significantly.
+
+The default behavior is for the server to send a raw changegroup version
+``01`` response.
+
+If the ``bundlecaps`` provided by the client contain a value beginning
+with ``HG2``, a bundle2 will be returned. The bundle2 data may contain
+additional repository data, such as ``pushkey`` namespace values.
+
+heads
+-----
+
+Returns a list of space-delimited hex nodes of repository heads followed
+by a newline. e.g.
+``a9eeb3adc7ddb5006c088e9eda61791c777cbf7c 31f91a3da534dc849f0d6bfc00a395a97cf218a1\n``
+
+This command does not accept any arguments. The return type is a ``string``.
+
+hello
+-----
+
+Returns lines describing interesting things about the server in an RFC-822
+like format.
+
+Currently, the only line defines the server capabilities. It has the form::
+
+    capabilities: <value>
+
+See above for more about the capabilities string.
+
+SSH clients typically issue this command as soon as a connection is
+established.
+
+This command does not accept any arguments. The return type is a ``string``.
+
+This command was introduced in Mercurial 0.9.1 (released July 2006).
+
+listkeys
+--------
+
+List values in a specified ``pushkey`` namespace.
+
+The ``namespace`` argument defines the pushkey namespace to operate on.
+
+The return type is a ``string``. The value is an encoded dictionary of keys.
+
+Key-value pairs are delimited by newlines (``\n``). Within each line, keys and
+values are separated by a tab (``\t``). Keys and values are both strings.
+
+lookup
+------
+
+Try to resolve a value to a known repository revision.
+
+The ``key`` argument is converted from bytes to an
+``encoding.localstr`` instance then passed into
+``localrepository.__getitem__`` in an attempt to resolve it.
+
+The return type is a ``string``.
+
+Upon successful resolution, returns ``1 <hex node>\n``. On failure,
+returns ``0 <error string>\n``. e.g.::
+
+   1 273ce12ad8f155317b2c078ec75a4eba507f1fba\n
+
+   0 unknown revision 'foo'\n
+
+known
+-----
+
+Determine whether multiple nodes are known.
+
+The ``nodes`` argument is a list of space-delimited hex nodes to check
+for existence.
+
+The return type is ``string``.
+
+Returns a string consisting of ``0``s and ``1``s indicating whether nodes
+are known. If the Nth node specified in the ``nodes`` argument is known,
+a ``1`` will be returned at byte offset N. If the node isn't known, ``0``
+will be present at byte offset N.
+
+There is no trailing newline.
+
+protocaps
+---------
+
+Notify the server about the client capabilities in the SSH V1 transport
+protocol.
+
+The ``caps`` argument is a space-delimited list of capabilities.
+
+The server will reply with the string ``OK``.
+
+pushkey
+-------
+
+Set a value using the ``pushkey`` protocol.
+
+Accepts arguments ``namespace``, ``key``, ``old``, and ``new``, which
+correspond to the pushkey namespace to operate on, the key within that
+namespace to change, the old value (which may be empty), and the new value.
+All arguments are string types.
+
+The return type is a ``string``. The value depends on the transport protocol.
+
+The SSH version 1 transport sends a string encoded integer followed by a
+newline (``\n``) which indicates operation result. The server may send
+additional output on the ``stderr`` stream that should be displayed to the
+user.
+
+The HTTP version 1 transport sends a string encoded integer followed by a
+newline followed by additional server output that should be displayed to
+the user. This may include output from hooks, etc.
+
+The integer result varies by namespace. ``0`` means an error has occurred
+and there should be additional output to display to the user.
+
+stream_out
+----------
+
+Obtain *streaming clone* data.
+
+The return type is either a ``string`` or a ``stream``, depending on
+whether the request was fulfilled properly.
+
+A return value of ``1\n`` indicates the server is not configured to serve
+this data. If this is seen by the client, they may not have verified the
+``stream`` capability is set before making the request.
+
+A return value of ``2\n`` indicates the server was unable to lock the
+repository to generate data.
+
+All other responses are a ``stream`` of bytes. The first line of this data
+contains 2 space-delimited integers corresponding to the path count and
+payload size, respectively::
+
+    <path count> <payload size>\n
+
+The ``<payload size>`` is the total size of path data: it does not include
+the size of the per-path header lines.
+
+Following that header are ``<path count>`` entries. Each entry consists of a
+line with metadata followed by raw revlog data. The line consists of::
+
+    <store path>\0<size>\n
+
+The ``<store path>`` is the encoded store path of the data that follows.
+``<size>`` is the amount of data for this store path/revlog that follows the
+newline.
+
+There is no trailer to indicate end of data. Instead, the client should stop
+reading after ``<path count>`` entries are consumed.
+
+unbundle
+--------
+
+Send a bundle containing data (usually changegroup data) to the server.
+
+Accepts the argument ``heads``, which is a space-delimited list of hex nodes
+corresponding to server repository heads observed by the client. This is used
+to detect race conditions and abort push operations before a server performs
+too much work or a client transfers too much data.
+
+The request payload consists of a bundle to be applied to the repository,
+similarly to as if :hg:`unbundle` were called.
+
+In most scenarios, a special ``push response`` type is returned. This type
+contains an integer describing the change in heads as a result of the
+operation. A value of ``0`` indicates nothing changed. ``1`` means the number
+of heads remained the same. Values ``2`` and larger indicate the number of
+added heads minus 1. e.g. ``3`` means 2 heads were added. Negative values
+indicate the number of fewer heads, also off by 1. e.g. ``-2`` means there
+is 1 fewer head.
+
+The encoding of the ``push response`` type varies by transport.
+
+For the SSH version 1 transport, this type is composed of 2 ``string``
+responses: an empty response (``0\n``) followed by the integer result value.
+e.g. ``1\n2``. So the full response might be ``0\n1\n2``.
+
+For the HTTP version 1 transport, the response is a ``string`` type composed
+of an integer result value followed by a newline (``\n``) followed by string
+content holding server output that should be displayed on the client (output
+hooks, etc).
+
+In some cases, the server may respond with a ``bundle2`` bundle. In this
+case, the response type is ``stream``. For the HTTP version 1 transport, the
+response is zlib compressed.
+
+The server may also respond with a generic error type, which contains a string
+indicating the failure.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/wireprotocolrpc.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,740 @@
+**Experimental and under development**
+
+This document describe's Mercurial's transport-agnostic remote procedure
+call (RPC) protocol which is used to perform interactions with remote
+servers. This protocol is also referred to as ``hgrpc``.
+
+The protocol has the following high-level features:
+
+* Concurrent request and response support (multiple commands can be issued
+  simultaneously and responses can be streamed simultaneously).
+* Supports half-duplex and full-duplex connections.
+* All data is transmitted within *frames*, which have a well-defined
+  header and encode their length.
+* Side-channels for sending progress updates and printing output. Text
+  output from the remote can be localized locally.
+* Support for simultaneous and long-lived compression streams, even across
+  requests.
+* Uses CBOR for data exchange.
+
+The protocol is not specific to Mercurial and could be used by other
+applications.
+
+High-level Overview
+===================
+
+To operate the protocol, a bi-directional, half-duplex pipe supporting
+ordered sends and receives is required. That is, each peer has one pipe
+for sending data and another for receiving. Full-duplex pipes are also
+supported.
+
+All data is read and written in atomic units called *frames*. These
+are conceptually similar to TCP packets. Higher-level functionality
+is built on the exchange and processing of frames.
+
+All frames are associated with a *stream*. A *stream* provides a
+unidirectional grouping of frames. Streams facilitate two goals:
+content encoding and parallelism. There is a dedicated section on
+streams below.
+
+The protocol is request-response based: the client issues requests to
+the server, which issues replies to those requests. Server-initiated
+messaging is not currently supported, but this specification carves
+out room to implement it.
+
+All frames are associated with a numbered request. Frames can thus
+be logically grouped by their request ID.
+
+Frames
+======
+
+Frames begin with an 8 octet header followed by a variable length
+payload::
+
+    +------------------------------------------------+
+    |                 Length (24)                    |
+    +--------------------------------+---------------+
+    |         Request ID (16)        | Stream ID (8) |
+    +------------------+-------------+---------------+
+    | Stream Flags (8) |
+    +-----------+------+
+    | Type (4)  |
+    +-----------+
+    | Flags (4) |
+    +===========+===================================================|
+    |                     Frame Payload (0...)                    ...
+    +---------------------------------------------------------------+
+
+The length of the frame payload is expressed as an unsigned 24 bit
+little endian integer. Values larger than 65535 MUST NOT be used unless
+given permission by the server as part of the negotiated capabilities
+during the handshake. The frame header is not part of the advertised
+frame length. The payload length is the over-the-wire length. If there
+is content encoding applied to the payload as part of the frame's stream,
+the length is the output of that content encoding, not the input.
+
+The 16-bit ``Request ID`` field denotes the integer request identifier,
+stored as an unsigned little endian integer. Odd numbered requests are
+client-initiated. Even numbered requests are server-initiated. This
+refers to where the *request* was initiated - not where the *frame* was
+initiated, so servers will send frames with odd ``Request ID`` in
+response to client-initiated requests. Implementations are advised to
+start ordering request identifiers at ``1`` and ``0``, increment by
+``2``, and wrap around if all available numbers have been exhausted.
+
+The 8-bit ``Stream ID`` field denotes the stream that the frame is
+associated with. Frames belonging to a stream may have content
+encoding applied and the receiver may need to decode the raw frame
+payload to obtain the original data. Odd numbered IDs are
+client-initiated. Even numbered IDs are server-initiated.
+
+The 8-bit ``Stream Flags`` field defines stream processing semantics.
+See the section on streams below.
+
+The 4-bit ``Type`` field denotes the type of frame being sent.
+
+The 4-bit ``Flags`` field defines special, per-type attributes for
+the frame.
+
+The sections below define the frame types and their behavior.
+
+Command Request (``0x01``)
+--------------------------
+
+This frame contains a request to run a command.
+
+The payload consists of a CBOR map defining the command request. The
+bytestring keys of that map are:
+
+name
+   Name of the command that should be executed (bytestring).
+args
+   Map of bytestring keys to various value types containing the named
+   arguments to this command.
+
+   Each command defines its own set of argument names and their expected
+   types.
+
+redirect (optional)
+   (map) Advertises client support for following response *redirects*.
+
+   This map has the following bytestring keys:
+
+   targets
+      (array of bytestring) List of named redirect targets supported by
+      this client. The names come from the targets advertised by the
+      server's *capabilities* message.
+
+   hashes
+      (array of bytestring) List of preferred hashing algorithms that can
+      be used for content integrity verification.
+
+   See the *Content Redirects* section below for more on content redirects.
+
+This frame type MUST ONLY be sent from clients to servers: it is illegal
+for a server to send this frame to a client.
+
+The following flag values are defined for this type:
+
+0x01
+   New command request. When set, this frame represents the beginning
+   of a new request to run a command. The ``Request ID`` attached to this
+   frame MUST NOT be active.
+0x02
+   Command request continuation. When set, this frame is a continuation
+   from a previous command request frame for its ``Request ID``. This
+   flag is set when the CBOR data for a command request does not fit
+   in a single frame.
+0x04
+   Additional frames expected. When set, the command request didn't fit
+   into a single frame and additional CBOR data follows in a subsequent
+   frame.
+0x08
+   Command data frames expected. When set, command data frames are
+   expected to follow the final command request frame for this request.
+
+``0x01`` MUST be set on the initial command request frame for a
+``Request ID``.
+
+``0x01`` or ``0x02`` MUST be set to indicate this frame's role in
+a series of command request frames.
+
+If command data frames are to be sent, ``0x08`` MUST be set on ALL
+command request frames.
+
+Command Data (``0x02``)
+-----------------------
+
+This frame contains raw data for a command.
+
+Most commands can be executed by specifying arguments. However,
+arguments have an upper bound to their length. For commands that
+accept data that is beyond this length or whose length isn't known
+when the command is initially sent, they will need to stream
+arbitrary data to the server. This frame type facilitates the sending
+of this data.
+
+The payload of this frame type consists of a stream of raw data to be
+consumed by the command handler on the server. The format of the data
+is command specific.
+
+The following flag values are defined for this type:
+
+0x01
+   Command data continuation. When set, the data for this command
+   continues into a subsequent frame.
+
+0x02
+   End of data. When set, command data has been fully sent to the
+   server. The command has been fully issued and no new data for this
+   command will be sent. The next frame will belong to a new command.
+
+Command Response Data (``0x03``)
+--------------------------------
+
+This frame contains response data to an issued command.
+
+Response data ALWAYS consists of a series of 1 or more CBOR encoded
+values. A CBOR value may be using indefinite length encoding. And the
+bytes constituting the value may span several frames.
+
+The following flag values are defined for this type:
+
+0x01
+   Data continuation. When set, an additional frame containing response data
+   will follow.
+0x02
+   End of data. When set, the response data has been fully sent and
+   no additional frames for this response will be sent.
+
+The ``0x01`` flag is mutually exclusive with the ``0x02`` flag.
+
+Error Occurred (``0x05``)
+-------------------------
+
+Some kind of error occurred.
+
+There are 3 general kinds of failures that can occur:
+
+* Command error encountered before any response issued
+* Command error encountered after a response was issued
+* Protocol or stream level error
+
+This frame type is used to capture the latter cases. (The general
+command error case is handled by the leading CBOR map in
+``Command Response`` frames.)
+
+The payload of this frame contains a CBOR map detailing the error. That
+map has the following bytestring keys:
+
+type
+   (bytestring) The overall type of error encountered. Can be one of the
+   following values:
+
+   protocol
+      A protocol-level error occurred. This typically means someone
+      is violating the framing protocol semantics and the server is
+      refusing to proceed.
+
+   server
+      A server-level error occurred. This typically indicates some kind of
+      logic error on the server, likely the fault of the server.
+
+   command
+      A command-level error, likely the fault of the client.
+
+message
+   (array of maps) A richly formatted message that is intended for
+   human consumption. See the ``Human Output Side-Channel`` frame
+   section for a description of the format of this data structure.
+
+Human Output Side-Channel (``0x06``)
+------------------------------------
+
+This frame contains a message that is intended to be displayed to
+people. Whereas most frames communicate machine readable data, this
+frame communicates textual data that is intended to be shown to
+humans.
+
+The frame consists of a series of *formatting requests*. Each formatting
+request consists of a formatting string, arguments for that formatting
+string, and labels to apply to that formatting string.
+
+A formatting string is a printf()-like string that allows variable
+substitution within the string. Labels allow the rendered text to be
+*decorated*. Assuming use of the canonical Mercurial code base, a
+formatting string can be the input to the ``i18n._`` function. This
+allows messages emitted from the server to be localized. So even if
+the server has different i18n settings, people could see messages in
+their *native* settings. Similarly, the use of labels allows
+decorations like coloring and underlining to be applied using the
+client's configured rendering settings.
+
+Formatting strings are similar to ``printf()`` strings or how
+Python's ``%`` operator works. The only supported formatting sequences
+are ``%s`` and ``%%``. ``%s`` will be replaced by whatever the string
+at that position resolves to. ``%%`` will be replaced by ``%``. All
+other 2-byte sequences beginning with ``%`` represent a literal
+``%`` followed by that character. However, future versions of the
+wire protocol reserve the right to allow clients to opt in to receiving
+formatting strings with additional formatters, hence why ``%%`` is
+required to represent the literal ``%``.
+
+The frame payload consists of a CBOR array of CBOR maps. Each map
+defines an *atom* of text data to print. Each *atom* has the following
+bytestring keys:
+
+msg
+   (bytestring) The formatting string. Content MUST be ASCII.
+args (optional)
+   Array of bytestrings defining arguments to the formatting string.
+labels (optional)
+   Array of bytestrings defining labels to apply to this atom.
+
+All data to be printed MUST be encoded into a single frame: this frame
+does not support spanning data across multiple frames.
+
+All textual data encoded in these frames is assumed to be line delimited.
+The last atom in the frame SHOULD end with a newline (``\n``). If it
+doesn't, clients MAY add a newline to facilitate immediate printing.
+
+Progress Update (``0x07``)
+--------------------------
+
+This frame holds the progress of an operation on the peer. Consumption
+of these frames allows clients to display progress bars, estimated
+completion times, etc.
+
+Each frame defines the progress of a single operation on the peer. The
+payload consists of a CBOR map with the following bytestring keys:
+
+topic
+   Topic name (string)
+pos
+   Current numeric position within the topic (integer)
+total
+   Total/end numeric position of this topic (unsigned integer)
+label (optional)
+   Unit label (string)
+item (optional)
+   Item name (string)
+
+Progress state is created when a frame is received referencing a
+*topic* that isn't currently tracked. Progress tracking for that
+*topic* is finished when a frame is received reporting the current
+position of that topic as ``-1``.
+
+Multiple *topics* may be active at any given time.
+
+Rendering of progress information is not mandated or governed by this
+specification: implementations MAY render progress information however
+they see fit, including not at all.
+
+The string data describing the topic SHOULD be static strings to
+facilitate receivers localizing that string data. The emitter
+MUST normalize all string data to valid UTF-8 and receivers SHOULD
+validate that received data conforms to UTF-8. The topic name
+SHOULD be ASCII.
+
+Sender Protocol Settings (``0x08``)
+-----------------------------------
+
+This frame type advertises the sender's support for various protocol and
+stream level features. The data advertised in this frame is used to influence
+subsequent behavior of the current frame exchange channel.
+
+The frame payload consists of a CBOR map. It may contain the following
+bytestring keys:
+
+contentencodings
+   (array of bytestring) A list of content encodings supported by the
+   sender, in order of most to least preferred.
+
+   Peers are allowed to encode stream data using any of the listed
+   encodings.
+
+   See the ``Content Encoding Profiles`` section for an enumeration
+   of supported content encodings.
+
+   If not defined, the value is assumed to be a list with the single value
+   ``identity``, meaning only the no-op encoding is supported.
+
+   Senders MAY filter the set of advertised encodings against what it
+   knows the receiver supports (e.g. if the receiver advertised encodings
+   via the capabilities descriptor). However, doing so will prevent
+   servers from gaining an understanding of the aggregate capabilities
+   of clients. So clients are discouraged from doing so.
+
+When this frame is not sent/received, the receiver assumes default values
+for all keys.
+
+If encountered, this frame type MUST be sent before any other frame type
+in a channel.
+
+The following flag values are defined for this frame type:
+
+0x01
+   Data continuation. When set, an additional frame containing more protocol
+   settings immediately follows.
+0x02
+   End of data. When set, the protocol settings data has been completely
+   sent.
+
+The ``0x01`` flag is mutually exclusive with the ``0x02`` flag.
+
+Stream Encoding Settings (``0x09``)
+-----------------------------------
+
+This frame type holds information defining the content encoding
+settings for a *stream*.
+
+This frame type is likely consumed by the protocol layer and is not
+passed on to applications.
+
+This frame type MUST ONLY occur on frames having the *Beginning of Stream*
+``Stream Flag`` set.
+
+The payload of this frame defines what content encoding has (possibly)
+been applied to the payloads of subsequent frames in this stream.
+
+The payload consists of a series of CBOR values. The first value is a
+bytestring denoting the content encoding profile of the data in this
+stream. Subsequent CBOR values supplement this simple value in a
+profile-specific manner. See the ``Content Encoding Profiles`` section
+for more.
+
+In the absence of this frame on a stream, it is assumed the stream is
+using the ``identity`` content encoding.
+
+The following flag values are defined for this frame type:
+
+0x01
+   Data continuation. When set, an additional frame containing more encoding
+   settings immediately follows.
+0x02
+   End of data. When set, the encoding settings data has been completely
+   sent.
+
+The ``0x01`` flag is mutually exclusive with the ``0x02`` flag.
+
+Stream States and Flags
+=======================
+
+Streams can be in two states: *open* and *closed*. An *open* stream
+is active and frames attached to that stream could arrive at any time.
+A *closed* stream is not active. If a frame attached to a *closed*
+stream arrives, that frame MUST have an appropriate stream flag
+set indicating beginning of stream. All streams are in the *closed*
+state by default.
+
+The ``Stream Flags`` field denotes a set of bit flags for defining
+the relationship of this frame within a stream. The following flags
+are defined:
+
+0x01
+   Beginning of stream. The first frame in the stream MUST set this
+   flag. When received, the ``Stream ID`` this frame is attached to
+   becomes ``open``.
+
+0x02
+   End of stream. The last frame in a stream MUST set this flag. When
+   received, the ``Stream ID`` this frame is attached to becomes
+   ``closed``. Any content encoding context associated with this stream
+   can be destroyed after processing the payload of this frame.
+
+0x04
+   Apply content encoding. When set, any content encoding settings
+   defined by the stream should be applied when attempting to read
+   the frame. When not set, the frame payload isn't encoded.
+
+TODO consider making stream opening and closing communicated via
+explicit frame types (e.g. a "stream state change" frame) rather than
+flags on all frames. This would make stream state changes more explicit,
+as they could only occur on specific frame types.
+
+Streams
+=======
+
+Streams - along with ``Request IDs`` - facilitate grouping of frames.
+But the purpose of each is quite different and the groupings they
+constitute are independent.
+
+A ``Request ID`` is essentially a tag. It tells you which logical
+request a frame is associated with.
+
+A *stream* is a sequence of frames grouped for the express purpose
+of applying a stateful encoding or for denoting sub-groups of frames.
+
+Unlike ``Request ID``s which span the request and response, a stream
+is unidirectional and stream IDs are independent from client to
+server.
+
+There is no strict hierarchical relationship between ``Request IDs``
+and *streams*. A stream can contain frames having multiple
+``Request IDs``. Frames belonging to the same ``Request ID`` can
+span multiple streams.
+
+One goal of streams is to facilitate content encoding. A stream can
+define an encoding to be applied to frame payloads. For example, the
+payload transmitted over the wire may contain output from a
+zstandard compression operation and the receiving end may decompress
+that payload to obtain the original data.
+
+The other goal of streams is to facilitate concurrent execution. For
+example, a server could spawn 4 threads to service a request that can
+be easily parallelized. Each of those 4 threads could write into its
+own stream. Those streams could then in turn be delivered to 4 threads
+on the receiving end, with each thread consuming its stream in near
+isolation. The *main* thread on both ends merely does I/O and
+encodes/decodes frame headers: the bulk of the work is done by worker
+threads.
+
+In addition, since content encoding is defined per stream, each
+*worker thread* could perform potentially CPU bound work concurrently
+with other threads. This approach of applying encoding at the
+sub-protocol / stream level eliminates a potential resource constraint
+on the protocol stream as a whole (it is common for the throughput of
+a compression engine to be smaller than the throughput of a network).
+
+Having multiple streams - each with their own encoding settings - also
+facilitates the use of advanced data compression techniques. For
+example, a transmitter could see that it is generating data faster
+and slower than the receiving end is consuming it and adjust its
+compression settings to trade CPU for compression ratio accordingly.
+
+While streams can define a content encoding, not all frames within
+that stream must use that content encoding. This can be useful when
+data is being served from caches and being derived dynamically. A
+cache could pre-compressed data so the server doesn't have to
+recompress it. The ability to pick and choose which frames are
+compressed allows servers to easily send data to the wire without
+involving potentially expensive encoding overhead.
+
+Content Encoding Profiles
+=========================
+
+Streams can have named content encoding *profiles* associated with
+them. A profile defines a shared understanding of content encoding
+settings and behavior.
+
+Profiles are described in the following sections.
+
+identity
+--------
+
+The ``identity`` profile is a no-op encoding: the encoded bytes are
+exactly the input bytes.
+
+This profile MUST be supported by all peers.
+
+In the absence of an identified profile, the ``identity`` profile is
+assumed.
+
+zstd-8mb
+--------
+
+Zstandard encoding (RFC 8478). Zstandard is a fast and effective lossless
+compression format.
+
+This profile allows decompressor window sizes of up to 8 MB.
+
+zlib
+----
+
+zlib compressed data (RFC 1950). zlib is a widely-used and supported
+lossless compression format.
+
+It isn't as fast as zstandard and it is recommended to use zstandard instead,
+if possible.
+
+Command Protocol
+================
+
+A client can request that a remote run a command by sending it
+frames defining that command. This logical stream is composed of
+1 or more ``Command Request`` frames and and 0 or more ``Command Data``
+frames.
+
+All frames composing a single command request MUST be associated with
+the same ``Request ID``.
+
+Clients MAY send additional command requests without waiting on the
+response to a previous command request. If they do so, they MUST ensure
+that the ``Request ID`` field of outbound frames does not conflict
+with that of an active ``Request ID`` whose response has not yet been
+fully received.
+
+Servers MAY respond to commands in a different order than they were
+sent over the wire. Clients MUST be prepared to deal with this. Servers
+also MAY start executing commands in a different order than they were
+received, or MAY execute multiple commands concurrently.
+
+If there is a dependency between commands or a race condition between
+commands executing (e.g. a read-only command that depends on the results
+of a command that mutates the repository), then clients MUST NOT send
+frames issuing a command until a response to all dependent commands has
+been received.
+TODO think about whether we should express dependencies between commands
+to avoid roundtrip latency.
+
+A command is defined by a command name, 0 or more command arguments,
+and optional command data.
+
+Arguments are the recommended mechanism for transferring fixed sets of
+parameters to a command. Data is appropriate for transferring variable
+data. Thinking in terms of HTTP, arguments would be headers and data
+would be the message body.
+
+It is recommended for servers to delay the dispatch of a command
+until all argument have been received. Servers MAY impose limits on the
+maximum argument size.
+TODO define failure mechanism.
+
+Servers MAY dispatch to commands immediately once argument data
+is available or delay until command data is received in full.
+
+Once a ``Command Request`` frame is sent, a client must be prepared to
+receive any of the following frames associated with that request:
+``Command Response``, ``Error Response``, ``Human Output Side-Channel``,
+``Progress Update``.
+
+The *main* response for a command will be in ``Command Response`` frames.
+The payloads of these frames consist of 1 or more CBOR encoded values.
+The first CBOR value on the first ``Command Response`` frame is special
+and denotes the overall status of the command. This CBOR map contains
+the following bytestring keys:
+
+status
+   (bytestring) A well-defined message containing the overall status of
+   this command request. The following values are defined:
+
+   ok
+      The command was received successfully and its response follows.
+   error
+      There was an error processing the command. More details about the
+      error are encoded in the ``error`` key.
+   redirect
+      The response for this command is available elsewhere. Details on
+      where are in the ``location`` key.
+
+error (optional)
+   A map containing information about an encountered error. The map has the
+   following keys:
+
+   message
+      (array of maps) A message describing the error. The message uses the
+      same format as those in the ``Human Output Side-Channel`` frame.
+
+location (optional)
+   (map) Presence indicates that a *content redirect* has occurred. The map
+   provides the external location of the content.
+
+   This map contains the following bytestring keys:
+
+   url
+      (bytestring) URL from which this content may be requested.
+
+   mediatype
+      (bytestring) The media type for the fetched content. e.g.
+      ``application/mercurial-*``.
+
+      In some transports, this value is also advertised by the transport.
+      e.g. as the ``Content-Type`` HTTP header.
+
+   size (optional)
+      (unsigned integer) Total size of remote object in bytes. This is
+      the raw size of the entity that will be fetched, minus any
+      non-Mercurial protocol encoding (e.g. HTTP content or transfer
+      encoding.)
+
+   fullhashes (optional)
+      (array of arrays) Content hashes for the entire payload. Each entry
+      is an array of bytestrings containing the hash name and the hash value.
+
+   fullhashseed (optional)
+      (bytestring) Optional seed value to feed into hasher for full content
+      hash verification.
+
+   serverdercerts (optional)
+      (array of bytestring) DER encoded x509 certificates for the server. When
+      defined, clients MAY validate that the x509 certificate on the target
+      server exactly matches the certificate used here.
+
+   servercadercerts (optional)
+      (array of bytestring) DER encoded x509 certificates for the certificate
+      authority of the target server. When defined, clients MAY validate that
+      the x509 on the target server was signed by CA certificate in this set.
+
+   # TODO support for giving client an x509 certificate pair to be used as a
+   # client certificate.
+
+   # TODO support common authentication mechanisms (e.g. HTTP basic/digest
+   # auth).
+
+   # TODO support custom authentication mechanisms. This likely requires
+   # server to advertise required auth mechanism so client can filter.
+
+   # TODO support chained hashes. e.g. hash for each 1MB segment so client
+   # can iteratively validate data without having to consume all of it first.
+
+TODO formalize when error frames can be seen and how errors can be
+recognized midway through a command response.
+
+Content Redirects
+=================
+
+Servers have the ability to respond to ANY command request with a
+*redirect* to another location. Such a response is referred to as a *redirect
+response*. (This feature is conceptually similar to HTTP redirects, but is
+more powerful.)
+
+A *redirect response* MUST ONLY be issued if the client advertises support
+for a redirect *target*.
+
+A *redirect response* MUST NOT be issued unless the client advertises support
+for one.
+
+Clients advertise support for *redirect responses* after looking at the server's
+*capabilities* data, which is fetched during initial server connection
+handshake. The server's capabilities data advertises named *targets* for
+potential redirects.
+
+Each target is described by a protocol name, connection and protocol features,
+etc. The server also advertises target-agnostic redirect settings, such as
+which hash algorithms are supported for content integrity checking. (See
+the documentation for the *capabilities* command for more.)
+
+Clients examine the set of advertised redirect targets for compatibility.
+When sending a command request, the client advertises the set of redirect
+target names it is willing to follow, along with some other settings influencing
+behavior.
+
+For example, say the server is advertising a ``cdn`` redirect target that
+requires SNI and TLS 1.2. If the client supports those features, it will
+send command requests stating that the ``cdn`` target is acceptable to use.
+But if the client doesn't support SNI or TLS 1.2 (or maybe it encountered an
+error using this target from a previous request), then it omits this target
+name.
+
+If the client advertises support for a redirect target, the server MAY
+substitute the normal, inline response data for a *redirect response* -
+one where the initial CBOR map has a ``status`` key with value ``redirect``.
+
+The *redirect response* at a minimum advertises the URL where the response
+can be retrieved.
+
+The *redirect response* MAY also advertise additional details about that
+content and how to retrieve it. Notably, the response may contain the
+x509 public certificates for the server being redirected to or the
+certificate authority that signed that server's certificate. Unless the
+client has existing settings that offer stronger trust validation than what
+the server advertises, the client SHOULD use the server-provided certificates
+when validating the connection to the remote server in place of any default
+connection verification checks. This is because certificates coming from
+the server SHOULD establish a stronger chain of trust than what the default
+certification validation mechanism in most environments provides. (By default,
+certificate validation ensures the signer of the cert chains up to a set of
+trusted root certificates. And if an explicit certificate or CA certificate
+is presented, that greadly reduces the set of certificates that will be
+recognized as valid, thus reducing the potential for a "bad" certificate
+to be used and trusted.)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/internals/wireprotocolv2.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,724 @@
+**Experimental and under active development**
+
+This section documents the wire protocol commands exposed to transports
+using the frame-based protocol. The set of commands exposed through
+these transports is distinct from the set of commands exposed to legacy
+transports.
+
+The frame-based protocol uses CBOR to encode command execution requests.
+All command arguments must be mapped to a specific or set of CBOR data
+types.
+
+The response to many commands is also CBOR. There is no common response
+format: each command defines its own response format.
+
+TODOs
+=====
+
+* Add "node namespace" support to each command. In order to support
+  SHA-1 hash transition, we want servers to be able to expose different
+  "node namespaces" for the same data. Every command operating on nodes
+  should specify which "node namespace" it is operating on and responses
+  should encode the "node namespace" accordingly.
+
+Commands
+========
+
+The sections below detail all commands available to wire protocol version
+2.
+
+branchmap
+---------
+
+Obtain heads in named branches.
+
+Receives no arguments.
+
+The response is a map with bytestring keys defining the branch name.
+Values are arrays of bytestring defining raw changeset nodes.
+
+capabilities
+------------
+
+Obtain the server's capabilities.
+
+Receives no arguments.
+
+This command is typically called only as part of the handshake during
+initial connection establishment.
+
+The response is a map with bytestring keys defining server information.
+
+The defined keys are:
+
+commands
+   A map defining available wire protocol commands on this server.
+
+   Keys in the map are the names of commands that can be invoked. Values
+   are maps defining information about that command. The bytestring keys
+   are:
+
+      args
+         (map) Describes arguments accepted by the command.
+
+         Keys are bytestrings denoting the argument name.
+
+         Values are maps describing the argument. The map has the following
+         bytestring keys:
+
+         default
+            (varied) The default value for this argument if not specified. Only
+            present if ``required`` is not true.
+
+         required
+            (boolean) Whether the argument must be specified. Failure to send
+            required arguments will result in an error executing the command.
+
+         type
+            (bytestring) The type of the argument. e.g. ``bytes`` or ``bool``.
+
+         validvalues
+            (set) Values that are recognized for this argument. Some arguments
+            only allow a fixed set of values to be specified. These arguments
+            may advertise that set in this key. If this set is advertised and
+            a value not in this set is specified, the command should result
+            in error.
+
+      permissions
+         An array of permissions required to execute this command.
+
+      *
+         (various) Individual commands may define extra keys that supplement
+         generic command metadata. See the command definition for more.
+
+framingmediatypes
+   An array of bytestrings defining the supported framing protocol
+   media types. Servers will not accept media types not in this list.
+
+pathfilterprefixes
+   (set of bytestring) Matcher prefixes that are recognized when performing
+   path filtering. Specifying a path filter whose type/prefix does not
+   match one in this set will likely be rejected by the server.
+
+rawrepoformats
+   An array of storage formats the repository is using. This set of
+   requirements can be used to determine whether a client can read a
+   *raw* copy of file data available.
+
+redirect
+   A map declaring potential *content redirects* that may be used by this
+   server. Contains the following bytestring keys:
+
+   targets
+      (array of maps) Potential redirect targets. Values are maps describing
+      this target in more detail. Each map has the following bytestring keys:
+
+      name
+         (bytestring) Identifier for this target. The identifier will be used
+         by clients to uniquely identify this target.
+
+      protocol
+         (bytestring) High-level network protocol. Values can be
+         ``http``, ```https``, ``ssh``, etc.
+
+      uris
+          (array of bytestrings) Representative URIs for this target.
+
+      snirequired (optional)
+          (boolean) Indicates whether Server Name Indication is required
+          to use this target. Defaults to False.
+
+      tlsversions (optional)
+          (array of bytestring) Indicates which TLS versions are supported by
+          this target. Values are ``1.1``, ``1.2``, ``1.3``, etc.
+
+   hashes
+      (array of bytestring) Indicates support for hashing algorithms that are
+      used to ensure content integrity. Values include ``sha1``, ``sha256``,
+      etc.
+
+changesetdata
+-------------
+
+Obtain various data related to changesets.
+
+The command accepts the following arguments:
+
+revisions
+   (array of maps) Specifies revisions whose data is being requested. Each
+   value in the array is a map describing revisions. See the
+   *Revisions Specifiers* section below for the format of this map.
+
+   Data will be sent for the union of all revisions resolved by all
+   revision specifiers.
+
+   Only revision specifiers operating on changeset revisions are allowed.
+
+fields
+   (set of bytestring) Which data associated with changelog revisions to
+   fetch. The following values are recognized:
+
+   bookmarks
+      Bookmarks associated with a revision.
+
+   parents
+      Parent revisions.
+
+   phase
+      The phase state of a revision.
+
+   revision
+      The raw, revision data for the changelog entry. The hash of this data
+      will match the revision's node value.
+
+The response bytestream starts with a CBOR map describing the data that follows.
+This map has the following bytestring keys:
+
+totalitems
+   (unsigned integer) Total number of changelog revisions whose data is being
+   transferred. This maps to the set of revisions in the requested node
+   range, not the total number of records that follow (see below for why).
+
+Following the map header is a series of 0 or more CBOR values. If values
+are present, the first value will always be a map describing a single changeset
+revision.
+
+If the ``fieldsfollowing`` key is present, the map will immediately be followed
+by N CBOR bytestring values, where N is the number of elements in
+``fieldsfollowing``. Each bytestring value corresponds to a field denoted
+by ``fieldsfollowing``.
+
+Following the optional bytestring field values is the next revision descriptor
+map, or end of stream.
+
+Each revision descriptor map has the following bytestring keys:
+
+node
+   (bytestring) The node value for this revision. This is the SHA-1 hash of
+   the raw revision data.
+
+bookmarks (optional)
+   (array of bytestrings) Bookmarks attached to this revision. Only present
+   if ``bookmarks`` data is being requested and the revision has bookmarks
+   attached.
+
+fieldsfollowing (optional)
+   (array of 2-array) Denotes what fields immediately follow this map. Each
+   value is an array with 2 elements: the bytestring field name and an unsigned
+   integer describing the length of the data, in bytes.
+
+   If this key isn't present, no special fields will follow this map.
+
+   The following fields may be present:
+
+   revision
+      Raw, revision data for the changelog entry. Contains a serialized form
+      of the changeset data, including the author, date, commit message, set
+      of changed files, manifest node, and other metadata.
+
+      Only present if the ``revision`` field was requested.
+
+parents (optional)
+   (array of bytestrings) The nodes representing the parent revisions of this
+   revision. Only present if ``parents`` data is being requested.
+
+phase (optional)
+   (bytestring) The phase that a revision is in. Recognized values are
+   ``secret``, ``draft``, and ``public``. Only present if ``phase`` data
+   is being requested.
+
+The set of changeset revisions emitted may not match the exact set of
+changesets requested. Furthermore, the set of keys present on each
+map may vary. This is to facilitate emitting changeset updates as well
+as new revisions.
+
+For example, if the request wants ``phase`` and ``revision`` data,
+the response may contain entries for each changeset in the common nodes
+set with the ``phase`` key and without the ``revision`` key in order
+to reflect a phase-only update.
+
+TODO support different revision selection mechanisms (e.g. non-public, specific
+revisions)
+TODO support different hash "namespaces" for revisions (e.g. sha-1 versus other)
+TODO support emitting obsolescence data
+TODO support filtering based on relevant paths (narrow clone)
+TODO support hgtagsfnodes cache / tags data
+TODO support branch heads cache
+TODO consider unify query mechanism. e.g. as an array of "query descriptors"
+rather than a set of top-level arguments that have semantics when combined.
+
+filedata
+--------
+
+Obtain various data related to an individual tracked file.
+
+The command accepts the following arguments:
+
+fields
+   (set of bytestring) Which data associated with a file to fetch.
+   The following values are recognized:
+
+   linknode
+      The changeset node introducing this revision.
+
+   parents
+      Parent nodes for the revision.
+
+   revision
+      The raw revision data for a file.
+
+haveparents
+   (bool) Whether the client has the parent revisions of all requested
+   nodes. If set, the server may emit revision data as deltas against
+   any parent revision. If not set, the server MUST only emit deltas for
+   revisions previously emitted by this command.
+
+   False is assumed in the absence of any value.
+
+nodes
+   (array of bytestrings) File nodes whose data to retrieve.
+
+path
+   (bytestring) Path of the tracked file whose data to retrieve.
+
+TODO allow specifying revisions via alternate means (such as from
+changeset revisions or ranges)
+
+The response bytestream starts with a CBOR map describing the data that
+follows. It has the following bytestream keys:
+
+totalitems
+   (unsigned integer) Total number of file revisions whose data is
+   being returned.
+
+Following the map header is a series of 0 or more CBOR values. If values
+are present, the first value will always be a map describing a single changeset
+revision.
+
+If the ``fieldsfollowing`` key is present, the map will immediately be followed
+by N CBOR bytestring values, where N is the number of elements in
+``fieldsfollowing``. Each bytestring value corresponds to a field denoted
+by ``fieldsfollowing``.
+
+Following the optional bytestring field values is the next revision descriptor
+map, or end of stream.
+
+Each revision descriptor map has the following bytestring keys:
+
+Each map has the following bytestring keys:
+
+node
+   (bytestring) The node of the file revision whose data is represented.
+
+deltabasenode
+   (bytestring) Node of the file revision the following delta is against.
+
+   Only present if the ``revision`` field is requested and delta data
+   follows this map.
+
+fieldsfollowing
+   (array of 2-array) Denotes extra bytestring fields that following this map.
+   See the documentation for ``changesetdata`` for semantics.
+
+   The following named fields may be present:
+
+   ``delta``
+      The delta data to use to construct the fulltext revision.
+
+      Only present if the ``revision`` field is requested and a delta is
+      being emitted. The ``deltabasenode`` top-level key will also be
+      present if this field is being emitted.
+
+   ``revision``
+      The fulltext revision data for this manifest. Only present if the
+      ``revision`` field is requested and a fulltext revision is being emitted.
+
+parents
+   (array of bytestring) The nodes of the parents of this file revision.
+
+   Only present if the ``parents`` field is requested.
+
+When ``revision`` data is requested, the server chooses to emit either fulltext
+revision data or a delta. What the server decides can be inferred by looking
+for the presence of the ``delta`` or ``revision`` keys in the
+``fieldsfollowing`` array.
+
+filesdata
+---------
+
+Obtain various data related to multiple tracked files for specific changesets.
+
+This command is similar to ``filedata`` with the main difference being that
+individual requests operate on multiple file paths. This allows clients to
+request data for multiple paths by issuing a single command.
+
+The command accepts the following arguments:
+
+fields
+   (set of bytestring) Which data associated with a file to fetch.
+   The following values are recognized:
+
+   linknode
+      The changeset node introducing this revision.
+
+   parents
+      Parent nodes for the revision.
+
+   revision
+      The raw revision data for a file.
+
+haveparents
+   (bool) Whether the client has the parent revisions of all requested
+   nodes.
+
+pathfilter
+   (map) Defines a filter that determines what file paths are relevant.
+
+   See the *Path Filters* section for more.
+
+   If the argument is omitted, it is assumed that all paths are relevant.
+
+revisions
+   (array of maps) Specifies revisions whose data is being requested. Each value
+   in the array is a map describing revisions. See the *Revisions Specifiers*
+   section below for the format of this map.
+
+   Data will be sent for the union of all revisions resolved by all revision
+   specifiers.
+
+   Only revision specifiers operating on changeset revisions are allowed.
+
+The response bytestream starts with a CBOR map describing the data that
+follows. This map has the following bytestring keys:
+
+totalpaths
+   (unsigned integer) Total number of paths whose data is being transferred.
+
+totalitems
+   (unsigned integer) Total number of file revisions whose data is being
+   transferred.
+
+Following the map header are 0 or more sequences of CBOR values. Each sequence
+represents data for a specific tracked path. Each sequence begins with a CBOR
+map describing the file data that follows. Following that map is N CBOR values
+describing file revision data. The format of this data is identical to that
+returned by the ``filedata`` command.
+
+Each sequence's map header has the following bytestring keys:
+
+path
+   (bytestring) The tracked file path whose data follows.
+
+totalitems
+   (unsigned integer) Total number of file revisions whose data is being
+   transferred.
+
+The ``haveparents`` argument has significant implications on the data
+transferred.
+
+When ``haveparents`` is true, the command MAY only emit data for file
+revisions introduced by the set of changeset revisions whose data is being
+requested. In other words, the command may assume that all file revisions
+for all relevant paths for ancestors of the requested changeset revisions
+are present on the receiver.
+
+When ``haveparents`` is false, the command MUST assume that the receiver
+has no file revisions data. This means that all referenced file revisions
+in the queried set of changeset revisions will be sent.
+
+TODO we want a more complicated mechanism for the client to specify which
+ancestor revisions are known. This is needed so intelligent deltas can be
+emitted and so updated linknodes can be sent if the client needs to adjust
+its linknodes for existing file nodes to older changeset revisions.
+TODO we may want to make linknodes an array so multiple changesets can be
+marked as introducing a file revision, since this can occur with e.g. hidden
+changesets.
+
+heads
+-----
+
+Obtain DAG heads in the repository.
+
+The command accepts the following arguments:
+
+publiconly (optional)
+   (boolean) If set, operate on the DAG for public phase changesets only.
+   Non-public (i.e. draft) phase DAG heads will not be returned.
+
+The response is a CBOR array of bytestrings defining changeset nodes
+of DAG heads. The array can be empty if the repository is empty or no
+changesets satisfied the request.
+
+TODO consider exposing phase of heads in response
+
+known
+-----
+
+Determine whether a series of changeset nodes is known to the server.
+
+The command accepts the following arguments:
+
+nodes
+   (array of bytestrings) List of changeset nodes whose presence to
+   query.
+
+The response is a bytestring where each byte contains a 0 or 1 for the
+corresponding requested node at the same index.
+
+TODO use a bit array for even more compact response
+
+listkeys
+--------
+
+List values in a specified ``pushkey`` namespace.
+
+The command receives the following arguments:
+
+namespace
+   (bytestring) Pushkey namespace to query.
+
+The response is a map with bytestring keys and values.
+
+TODO consider using binary to represent nodes in certain pushkey namespaces.
+
+lookup
+------
+
+Try to resolve a value to a changeset revision.
+
+Unlike ``known`` which operates on changeset nodes, lookup operates on
+node fragments and other names that a user may use.
+
+The command receives the following arguments:
+
+key
+   (bytestring) Value to try to resolve.
+
+On success, returns a bytestring containing the resolved node.
+
+manifestdata
+------------
+
+Obtain various data related to manifests (which are lists of files in
+a revision).
+
+The command accepts the following arguments:
+
+fields
+   (set of bytestring) Which data associated with manifests to fetch.
+   The following values are recognized:
+
+   parents
+      Parent nodes for the manifest.
+
+   revision
+      The raw revision data for the manifest.
+
+haveparents
+   (bool) Whether the client has the parent revisions of all requested
+   nodes. If set, the server may emit revision data as deltas against
+   any parent revision. If not set, the server MUST only emit deltas for
+   revisions previously emitted by this command.
+
+   False is assumed in the absence of any value.
+
+nodes
+   (array of bytestring) Manifest nodes whose data to retrieve.
+
+tree
+   (bytestring) Path to manifest to retrieve. The empty bytestring represents
+   the root manifest. All other values represent directories/trees within
+   the repository.
+
+TODO allow specifying revisions via alternate means (such as from changeset
+revisions or ranges)
+TODO consider recursive expansion of manifests (with path filtering for
+narrow use cases)
+
+The response bytestream starts with a CBOR map describing the data that
+follows. It has the following bytestring keys:
+
+totalitems
+   (unsigned integer) Total number of manifest revisions whose data is
+   being returned.
+
+Following the map header is a series of 0 or more CBOR values. If values
+are present, the first value will always be a map describing a single manifest
+revision.
+
+If the ``fieldsfollowing`` key is present, the map will immediately be followed
+by N CBOR bytestring values, where N is the number of elements in
+``fieldsfollowing``. Each bytestring value corresponds to a field denoted
+by ``fieldsfollowing``.
+
+Following the optional bytestring field values is the next revision descriptor
+map, or end of stream.
+
+Each revision descriptor map has the following bytestring keys:
+
+node
+   (bytestring) The node of the manifest revision whose data is represented.
+
+deltabasenode
+   (bytestring) The node that the delta representation of this revision is
+   computed against. Only present if the ``revision`` field is requested and
+   a delta is being emitted.
+
+fieldsfollowing
+   (array of 2-array) Denotes extra bytestring fields that following this map.
+   See the documentation for ``changesetdata`` for semantics.
+
+   The following named fields may be present:
+
+   ``delta``
+      The delta data to use to construct the fulltext revision.
+
+      Only present if the ``revision`` field is requested and a delta is
+      being emitted. The ``deltabasenode`` top-level key will also be
+      present if this field is being emitted.
+
+   ``revision``
+      The fulltext revision data for this manifest. Only present if the
+      ``revision`` field is requested and a fulltext revision is being emitted.
+
+parents
+   (array of bytestring) The nodes of the parents of this manifest revision.
+   Only present if the ``parents`` field is requested.
+
+When ``revision`` data is requested, the server chooses to emit either fulltext
+revision data or a delta. What the server decides can be inferred by looking
+for the presence of ``delta`` or ``revision`` in the ``fieldsfollowing`` array.
+
+Servers MAY advertise the following extra fields in the capabilities
+descriptor for this command:
+
+recommendedbatchsize
+   (unsigned integer) Number of revisions the server recommends as a batch
+   query size. If defined, clients needing to issue multiple ``manifestdata``
+   commands to obtain needed data SHOULD construct their commands to have
+   this many revisions per request.
+
+pushkey
+-------
+
+Set a value using the ``pushkey`` protocol.
+
+The command receives the following arguments:
+
+namespace
+   (bytestring) Pushkey namespace to operate on.
+key
+   (bytestring) The pushkey key to set.
+old
+   (bytestring) Old value for this key.
+new
+   (bytestring) New value for this key.
+
+TODO consider using binary to represent nodes is certain pushkey namespaces.
+TODO better define response type and meaning.
+
+rawstorefiledata
+----------------
+
+Allows retrieving raw files used to store repository data.
+
+The command accepts the following arguments:
+
+files
+   (array of bytestring) Describes the files that should be retrieved.
+
+   The meaning of values in this array is dependent on the storage backend used
+   by the server.
+
+The response bytestream starts with a CBOR map describing the data that follows.
+This map has the following bytestring keys:
+
+filecount
+   (unsigned integer) Total number of files whose data is being transferred.
+
+totalsize
+   (unsigned integer) Total size in bytes of files data that will be
+   transferred. This is file on-disk size and not wire size.
+
+Following the map header are N file segments. Each file segment consists of a
+CBOR map followed by an indefinite length bytestring. Each map has the following
+bytestring keys:
+
+location
+   (bytestring) Denotes the location in the repository where the file should be
+   written. Values map to vfs instances to use for the writing.
+
+path
+   (bytestring) Path of file being transferred. Path is the raw store
+   path and can be any sequence of bytes that can be tracked in a Mercurial
+   manifest.
+
+size
+   (unsigned integer) Size of file data. This will be the final written
+   file size. The total size of the data that follows the CBOR map
+   will be greater due to encoding overhead of CBOR.
+
+TODO this command is woefully incomplete. If we are to move forward with a
+stream clone analog, it needs a lot more metadata around how to describe what
+files are available to retrieve, other semantics.
+
+Revision Specifiers
+===================
+
+A *revision specifier* is a map that evaluates to a set of revisions.
+
+A *revision specifier* has a ``type`` key that defines the revision
+selection type to perform. Other keys in the map are used in a
+type-specific manner.
+
+The following types are defined:
+
+changesetexplicit
+   An explicit set of enumerated changeset revisions.
+
+   The ``nodes`` key MUST contain an array of full binary nodes, expressed
+   as bytestrings.
+
+changesetexplicitdepth
+   Like ``changesetexplicit``, but contains a ``depth`` key defining the
+   unsigned integer number of ancestor revisions to also resolve. For each
+   value in ``nodes``, DAG ancestors will be walked until up to N total
+   revisions from that ancestry walk are present in the final resolved set.
+
+changesetdagrange
+   Defines revisions via a DAG range of changesets on the changelog.
+
+   The ``roots`` key MUST contain an array of full, binary node values
+   representing the *root* revisions.
+
+   The ``heads`` key MUST contain an array of full, binary nodes values
+   representing the *head* revisions.
+
+   The DAG range between ``roots`` and ``heads`` will be resolved and all
+   revisions between will be used. Nodes in ``roots`` are not part of the
+   resolved set. Nodes in ``heads`` are. The ``roots`` array may be empty.
+   The ``heads`` array MUST be defined.
+
+Path Filters
+============
+
+Various commands accept a *path filter* argument that defines the set of file
+paths relevant to the request.
+
+A *path filter* is defined as a map with the bytestring keys ``include`` and
+``exclude``. Each is an array of bytestring values. Each value defines a pattern
+rule (see :hg:`help patterns`) that is used to match file paths.
+
+A path matches the path filter if it is matched by a rule in the ``include``
+set but doesn't match a rule in the ``exclude`` set. In other words, a path
+matcher takes the union of all ``include`` patterns and then substracts the
+union of all ``exclude`` patterns.
+
+Patterns MUST be prefixed with their pattern type. Only the following pattern
+types are allowed: ``path:``, ``rootfilesin:``.
+
+If the ``include`` key is omitted, it is assumed that all paths are
+relevant. The patterns from ``exclude`` will still be used, if defined.
+
+An example value is ``path:tests/foo``, which would match a file named
+``tests/foo`` or a directory ``tests/foo`` and all files under it.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/merge-tools.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,109 @@
+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:
+
+.. internaltoolsmarker
+
+Internal tools are always available and do not require a GUI but will
+by default not handle symlinks or binary files. See next section for
+detail about "actual capabilities" described above.
+
+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.
+
+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.
+
+For historical reason, Mercurial treats merge tools as below while
+examining rules above.
+
+==== =============== ====== =======
+step specified via   binary symlink
+==== =============== ====== =======
+1.   --tool          o/o    o/o
+2.   HGMERGE         o/o    o/o
+3.   merge-patterns  o/o(*) x/?(*)
+4.   ui.merge        x/?(*) x/?(*)
+==== =============== ====== =======
+
+Each capability column indicates Mercurial behavior for
+internal/external merge tools at examining each rule.
+
+- "o": "assume that a tool has capability"
+- "x": "assume that a tool does not have capability"
+- "?": "check actual capability of a tool"
+
+If ``merge.strict-capability-check`` configuration is true, Mercurial
+checks capabilities of merge tools strictly in (*) cases above (= each
+capability column becomes "?/?"). It is false by default for backward
+compatibility.
+
+.. note::
+
+   After selecting a merge program, Mercurial will by default attempt
+   to merge the files using a simple merge algorithm first. Only if it 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.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/pager.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,43 @@
+Some Mercurial commands can produce a lot of output, and Mercurial will
+attempt to use a pager to make those commands more pleasant.
+
+To set the pager that should be used, set the application variable::
+
+  [pager]
+  pager = less -FRX
+
+If no pager is set in the user or repository configuration, Mercurial uses the
+environment variable $PAGER. If $PAGER is not set, pager.pager from the default
+or system configuration is used. If none of these are set, a default pager will
+be used, typically `less` on Unix and `more` on Windows.
+
+.. container:: windows
+
+  On Windows, `more` is not color aware, so using it effectively disables color.
+  MSYS and Cygwin shells provide `less` as a pager, which can be configured to
+  support ANSI color codes.  See :hg:`help config.color.pagermode` to configure
+  the color mode when invoking a pager.
+
+You can disable the pager for certain commands by adding them to the
+pager.ignore list::
+
+  [pager]
+  ignore = version, help, update
+
+To ignore global commands like :hg:`version` or :hg:`help`, you have
+to specify them in your user configuration file.
+
+To control whether the pager is used at all for an individual command,
+you can use --pager=<value>:
+
+  - use as needed: `auto`.
+  - require the pager: `yes` or `on`.
+  - suppress the pager: `no` or `off` (any unrecognized value
+    will also work).
+
+To globally turn off all attempts to use a pager, set::
+
+  [ui]
+  paginate = never
+
+which will prevent the pager from running.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/patterns.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,86 @@
+Mercurial accepts several notations for identifying one or more files
+at a time.
+
+By default, Mercurial treats filenames as shell-style extended glob
+patterns.
+
+Alternate pattern notations must be specified explicitly.
+
+.. note::
+
+  Patterns specified in ``.hgignore`` are not rooted.
+  Please see :hg:`help hgignore` for details.
+
+To use a plain path name without any pattern matching, start it with
+``path:``. These path names must completely match starting at the
+current repository root, and when the path points to a directory, it is matched
+recursively. To match all files in a directory non-recursively (not including
+any files in subdirectories), ``rootfilesin:`` can be used, specifying an
+absolute path (relative to the repository root).
+
+To use an extended glob, start a name with ``glob:``. Globs are rooted
+at the current directory; a glob such as ``*.c`` will only match files
+in the current directory ending with ``.c``. ``rootglob:`` can be used
+instead of ``glob:`` for a glob that is rooted at the root of the
+repository.
+
+The supported glob syntax extensions are ``**`` to match any string
+across path separators and ``{a,b}`` to mean "a or b".
+
+To use a Perl/Python regular expression, start a name with ``re:``.
+Regexp pattern matching is anchored at the root of the repository.
+
+To read name patterns from a file, use ``listfile:`` or ``listfile0:``.
+The latter expects null delimited patterns while the former expects line
+feeds. Each string read from the file is itself treated as a file
+pattern.
+
+To read a set of patterns from a file, use ``include:`` or ``subinclude:``.
+``include:`` will use all the patterns from the given file and treat them as if
+they had been passed in manually.  ``subinclude:`` will only apply the patterns
+against files that are under the subinclude file's directory. See :hg:`help
+hgignore` for details on the format of these files.
+
+All patterns, except for ``glob:`` specified in command line (not for
+``-I`` or ``-X`` options), can match also against directories: files
+under matched directories are treated as matched.
+For ``-I`` and ``-X`` options, ``glob:`` will match directories recursively.
+
+Plain examples::
+
+  path:foo/bar        a name bar in a directory named foo in the root
+                      of the repository
+  path:path:name      a file or directory named "path:name"
+  rootfilesin:foo/bar the files in a directory called foo/bar, but not any files
+                      in its subdirectories and not a file bar in directory foo
+
+Glob examples::
+
+  glob:*.c       any name ending in ".c" in the current directory
+  *.c            any name ending in ".c" in the current directory
+  **.c           any name ending in ".c" in any subdirectory of the
+                 current directory including itself.
+  foo/*          any file in directory foo
+  foo/**         any file in directory foo plus all its subdirectories,
+                 recursively
+  foo/*.c        any name ending in ".c" in the directory foo
+  foo/**.c       any name ending in ".c" in any subdirectory of foo
+                 including itself.
+  rootglob:*.c   any name ending in ".c" in the root of the repository
+
+Regexp examples::
+
+  re:.*\.c$      any name ending in ".c", anywhere in the repository
+
+File examples::
+
+  listfile:list.txt  read list from list.txt with one file pattern per line
+  listfile0:list.txt read list from list.txt with null byte delimiters
+
+See also :hg:`help filesets`.
+
+Include examples::
+
+  include:path/to/mypatternfile    reads patterns to be applied to all paths
+  subinclude:path/to/subignorefile reads patterns specifically for paths in the
+                                   subdirectory
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/phases.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,100 @@
+What are phases?
+================
+
+Phases are a system for tracking which changesets have been or should
+be shared. This helps prevent common mistakes when modifying history
+(for instance, with the mq or rebase extensions).
+
+Each changeset in a repository is in one of the following phases:
+
+ - public : changeset is visible on a public server
+ - draft : changeset is not yet published
+ - secret : changeset should not be pushed, pulled, or cloned
+
+These phases are ordered (public < draft < secret) and no changeset
+can be in a lower phase than its ancestors. For instance, if a
+changeset is public, all its ancestors are also public. Lastly,
+changeset phases should only be changed towards the public phase.
+
+How are phases managed?
+=======================
+
+For the most part, phases should work transparently. By default, a
+changeset is created in the draft phase and is moved into the public
+phase when it is pushed to another repository.
+
+Once changesets become public, extensions like mq and rebase will
+refuse to operate on them to prevent creating duplicate changesets.
+Phases can also be manually manipulated with the :hg:`phase` command
+if needed. See :hg:`help -v phase` for examples.
+
+To make your commits secret by default, put this in your
+configuration file::
+
+  [phases]
+  new-commit = secret
+
+Phases and servers
+==================
+
+Normally, all servers are ``publishing`` by default. This means::
+
+ - all draft changesets that are pulled or cloned appear in phase
+ public on the client
+
+ - all draft changesets that are pushed appear as public on both
+ client and server
+
+ - secret changesets are neither pushed, pulled, or cloned
+
+.. note::
+
+  Pulling a draft changeset from a publishing server does not mark it
+  as public on the server side due to the read-only nature of pull.
+
+Sometimes it may be desirable to push and pull changesets in the draft
+phase to share unfinished work. This can be done by setting a
+repository to disable publishing in its configuration file::
+
+  [phases]
+  publish = False
+
+See :hg:`help config` for more information on configuration files.
+
+.. note::
+
+  Servers running older versions of Mercurial are treated as
+  publishing.
+
+.. note::
+
+   Changesets in secret phase are not exchanged with the server. This
+   applies to their content: file names, file contents, and changeset
+   metadata. For technical reasons, the identifier (e.g. d825e4025e39)
+   of the secret changeset may be communicated to the server.
+
+
+Examples
+========
+
+ - list changesets in draft or secret phase::
+
+     hg log -r "not public()"
+
+ - change all secret changesets to draft::
+
+     hg phase --draft "secret()"
+
+ - forcibly move the current changeset and descendants from public to draft::
+
+     hg phase --force --draft .
+
+ - show a list of changeset revisions and each corresponding phase::
+
+     hg log --template "{rev} {phase}\n"
+
+ - resynchronize draft changesets relative to a remote repository::
+
+     hg phase -fd "outgoing(URL)"
+
+See :hg:`help phase` for more information on manually manipulating phases.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/revisions.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,223 @@
+Mercurial supports several ways to specify revisions.
+
+Specifying single revisions
+===========================
+
+A plain integer is treated as a revision number. Negative integers are
+treated as sequential offsets from the tip, with -1 denoting the tip,
+-2 denoting the revision prior to the tip, and so forth.
+
+A 40-digit hexadecimal string is treated as a unique revision identifier.
+A hexadecimal string less than 40 characters long is treated as a
+unique revision identifier and is referred to as a short-form
+identifier. A short-form identifier is only valid if it is the prefix
+of exactly one full-length identifier.
+
+Any other string is treated as a bookmark, tag, or branch name. A
+bookmark is a movable pointer to a revision. A tag is a permanent name
+associated with a revision. A branch name denotes the tipmost open branch head
+of that branch - or if they are all closed, the tipmost closed head of the
+branch. Bookmark, tag, and branch names must not contain the ":" character.
+
+The reserved name "tip" always identifies the most recent revision.
+
+The reserved name "null" indicates the null revision. This is the
+revision of an empty repository, and the parent of revision 0.
+
+The reserved name "." indicates the working directory parent. If no
+working directory is checked out, it is equivalent to null. If an
+uncommitted merge is in progress, "." is the revision of the first
+parent.
+
+Finally, commands that expect a single revision (like ``hg update``) also
+accept revsets (see below for details). When given a revset, they use the
+last revision of the revset. A few commands accept two single revisions
+(like ``hg diff``). When given a revset, they use the first and the last
+revisions of the revset.
+
+Specifying multiple revisions
+=============================
+
+Mercurial supports a functional language for selecting a set of
+revisions. Expressions in this language are called revsets.
+
+The language supports a number of predicates which are joined by infix
+operators. Parenthesis can be used for grouping.
+
+Identifiers such as branch names may need quoting with single or
+double quotes if they contain characters like ``-`` or if they match
+one of the predefined predicates.
+
+Special characters can be used in quoted identifiers by escaping them,
+e.g., ``\n`` is interpreted as a newline. To prevent them from being
+interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``.
+
+Operators
+=========
+
+There is a single prefix operator:
+
+``not x``
+  Changesets not in x. Short form is ``! x``.
+
+These are the supported infix operators:
+
+``x::y``
+  A DAG range, meaning all changesets that are descendants of x and
+  ancestors of y, including x and y themselves. If the first endpoint
+  is left out, this is equivalent to ``ancestors(y)``, if the second
+  is left out it is equivalent to ``descendants(x)``.
+
+  An alternative syntax is ``x..y``.
+
+``x:y``
+  All changesets with revision numbers between x and y, both
+  inclusive. Either endpoint can be left out, they default to 0 and
+  tip.
+
+``x and y``
+  The intersection of changesets in x and y. Short form is ``x & y``.
+
+``x or y``
+  The union of changesets in x and y. There are two alternative short
+  forms: ``x | y`` and ``x + y``.
+
+``x - y``
+  Changesets in x but not in y.
+
+``x % y``
+  Changesets that are ancestors of x but not ancestors of y (i.e. ::x - ::y).
+  This is shorthand notation for ``only(x, y)`` (see below). The second
+  argument is optional and, if left out, is equivalent to ``only(x)``.
+
+``x^n``
+  The nth parent of x, n == 0, 1, or 2.
+  For n == 0, x; for n == 1, the first parent of each changeset in x;
+  for n == 2, the second parent of changeset in x.
+
+``x~n``
+  The nth first ancestor of x; ``x~0`` is x; ``x~3`` is ``x^^^``.
+  For n < 0, the nth unambiguous descendent of x.
+
+``x ## y``
+  Concatenate strings and identifiers into one string.
+
+  All other prefix, infix and postfix operators have lower priority than
+  ``##``. For example, ``a1 ## a2~2`` is equivalent to ``(a1 ## a2)~2``.
+
+  For example::
+
+    [revsetalias]
+    issue(a1) = grep(r'\bissue[ :]?' ## a1 ## r'\b|\bbug\(' ## a1 ## r'\)')
+
+  ``issue(1234)`` is equivalent to
+  ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')``
+  in this case. This matches against all of "issue 1234", "issue:1234",
+  "issue1234" and "bug(1234)".
+
+There is a single postfix operator:
+
+``x^``
+  Equivalent to ``x^1``, the first parent of each changeset in x.
+
+Patterns
+========
+
+Where noted, predicates that perform string matching can accept a pattern
+string. The pattern may be either a literal, or a regular expression. If the
+pattern starts with ``re:``, the remainder of the pattern is treated as a
+regular expression. Otherwise, it is treated as a literal. To match a pattern
+that actually starts with ``re:``, use the prefix ``literal:``.
+
+Matching is case-sensitive, unless otherwise noted.  To perform a case-
+insensitive match on a case-sensitive predicate, use a regular expression,
+prefixed with ``(?i)``.
+
+For example, ``tag(r're:(?i)release')`` matches "release" or "RELEASE"
+or "Release", etc.
+
+Predicates
+==========
+
+The following predicates are supported:
+
+.. predicatesmarker
+
+Aliases
+=======
+
+New predicates (known as "aliases") can be defined, using any combination of
+existing predicates or other aliases. An alias definition looks like::
+
+  <alias> = <definition>
+
+in the ``revsetalias`` section of a Mercurial configuration file. Arguments
+of the form `a1`, `a2`, etc. are substituted from the alias into the
+definition.
+
+For example,
+
+::
+
+  [revsetalias]
+  h = heads()
+  d(s) = sort(s, date)
+  rs(s, k) = reverse(sort(s, k))
+
+defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is
+exactly equivalent to ``reverse(sort(0:tip, author))``.
+
+Equivalents
+===========
+
+Command line equivalents for :hg:`log`::
+
+  -f    ->  ::.
+  -d x  ->  date(x)
+  -k x  ->  keyword(x)
+  -m    ->  merge()
+  -u x  ->  user(x)
+  -b x  ->  branch(x)
+  -P x  ->  !::x
+  -l x  ->  limit(expr, x)
+
+Examples
+========
+
+Some sample queries:
+
+- Changesets on the default branch::
+
+    hg log -r "branch(default)"
+
+- Changesets on the default branch since tag 1.5 (excluding merges)::
+
+    hg log -r "branch(default) and 1.5:: and not merge()"
+
+- Open branch heads::
+
+    hg log -r "head() and not closed()"
+
+- Changesets between tags 1.3 and 1.5 mentioning "bug" that affect
+  ``hgext/*``::
+
+    hg log -r "1.3::1.5 and keyword(bug) and file('hgext/*')"
+
+- Changesets committed in May 2008, sorted by user::
+
+    hg log -r "sort(date('May 2008'), user)"
+
+- Changesets mentioning "bug" or "issue" that are not in a tagged
+  release::
+
+    hg log -r "(keyword(bug) or keyword(issue)) and not ancestors(tag())"
+
+- Update to the commit that bookmark @ is pointing to, without activating the
+  bookmark (this works because the last revision of the revset is used)::
+
+    hg update :@
+
+- Show diff between tags 1.3 and 1.5 (this works because the first and the
+  last revisions of the revset are used)::
+
+    hg diff -r 1.3::1.5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/scripting.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,202 @@
+It is common for machines (as opposed to humans) to consume Mercurial.
+This help topic describes some of the considerations for interfacing
+machines with Mercurial.
+
+Choosing an Interface
+=====================
+
+Machines have a choice of several methods to interface with Mercurial.
+These include:
+
+- Executing the ``hg`` process
+- Querying a HTTP server
+- Calling out to a command server
+
+Executing ``hg`` processes is very similar to how humans interact with
+Mercurial in the shell. It should already be familiar to you.
+
+:hg:`serve` can be used to start a server. By default, this will start
+a "hgweb" HTTP server. This HTTP server has support for machine-readable
+output, such as JSON. For more, see :hg:`help hgweb`.
+
+:hg:`serve` can also start a "command server." Clients can connect
+to this server and issue Mercurial commands over a special protocol.
+For more details on the command server, including links to client
+libraries, see https://www.mercurial-scm.org/wiki/CommandServer.
+
+:hg:`serve` based interfaces (the hgweb and command servers) have the
+advantage over simple ``hg`` process invocations in that they are
+likely more efficient. This is because there is significant overhead
+to spawn new Python processes.
+
+.. tip::
+
+   If you need to invoke several ``hg`` processes in short order and/or
+   performance is important to you, use of a server-based interface
+   is highly recommended.
+
+Environment Variables
+=====================
+
+As documented in :hg:`help environment`, various environment variables
+influence the operation of Mercurial. The following are particularly
+relevant for machines consuming Mercurial:
+
+HGPLAIN
+    If not set, Mercurial's output could be influenced by configuration
+    settings that impact its encoding, verbose mode, localization, etc.
+
+    It is highly recommended for machines to set this variable when
+    invoking ``hg`` processes.
+
+HGENCODING
+    If not set, the locale used by Mercurial will be detected from the
+    environment. If the determined locale does not support display of
+    certain characters, Mercurial may render these character sequences
+    incorrectly (often by using "?" as a placeholder for invalid
+    characters in the current locale).
+
+    Explicitly setting this environment variable is a good practice to
+    guarantee consistent results. "utf-8" is a good choice on UNIX-like
+    environments.
+
+HGRCPATH
+    If not set, Mercurial will inherit config options from config files
+    using the process described in :hg:`help config`. This includes
+    inheriting user or system-wide config files.
+
+    When utmost control over the Mercurial configuration is desired, the
+    value of ``HGRCPATH`` can be set to an explicit file with known good
+    configs. In rare cases, the value can be set to an empty file or the
+    null device (often ``/dev/null``) to bypass loading of any user or
+    system config files. Note that these approaches can have unintended
+    consequences, as the user and system config files often define things
+    like the username and extensions that may be required to interface
+    with a repository.
+
+Command-line Flags
+==================
+
+Mercurial's default command-line parser is designed for humans, and is not
+robust against malicious input. For instance, you can start a debugger by
+passing ``--debugger`` as an option value::
+
+    $ REV=--debugger sh -c 'hg log -r "$REV"'
+
+This happens because several command-line flags need to be scanned without
+using a concrete command table, which may be modified while loading repository
+settings and extensions.
+
+Since Mercurial 4.4.2, the parsing of such flags may be restricted by setting
+``HGPLAIN=+strictflags``. When this feature is enabled, all early options
+(e.g. ``-R/--repository``, ``--cwd``, ``--config``) must be specified first
+amongst the other global options, and cannot be injected to an arbitrary
+location::
+
+    $ HGPLAIN=+strictflags hg -R "$REPO" log -r "$REV"
+
+In earlier Mercurial versions where ``+strictflags`` isn't available, you
+can mitigate the issue by concatenating an option value with its flag::
+
+    $ hg log -r"$REV" --keyword="$KEYWORD"
+
+Consuming Command Output
+========================
+
+It is common for machines to need to parse the output of Mercurial
+commands for relevant data. This section describes the various
+techniques for doing so.
+
+Parsing Raw Command Output
+--------------------------
+
+Likely the simplest and most effective solution for consuming command
+output is to simply invoke ``hg`` commands as you would as a user and
+parse their output.
+
+The output of many commands can easily be parsed with tools like
+``grep``, ``sed``, and ``awk``.
+
+A potential downside with parsing command output is that the output
+of commands can change when Mercurial is upgraded. While Mercurial
+does generally strive for strong backwards compatibility, command
+output does occasionally change. Having tests for your automated
+interactions with ``hg`` commands is generally recommended, but is
+even more important when raw command output parsing is involved.
+
+Using Templates to Control Output
+---------------------------------
+
+Many ``hg`` commands support templatized output via the
+``-T/--template`` argument. For more, see :hg:`help templates`.
+
+Templates are useful for explicitly controlling output so that
+you get exactly the data you want formatted how you want it. For
+example, ``log -T {node}\n`` can be used to print a newline
+delimited list of changeset nodes instead of a human-tailored
+output containing authors, dates, descriptions, etc.
+
+.. tip::
+
+   If parsing raw command output is too complicated, consider
+   using templates to make your life easier.
+
+The ``-T/--template`` argument allows specifying pre-defined styles.
+Mercurial ships with the machine-readable styles ``cbor``, ``json``,
+and ``xml``, which provide CBOR, JSON, and XML output, respectively.
+These are useful for producing output that is machine readable as-is.
+
+(Mercurial 5.0 is required for CBOR style.)
+
+.. important::
+
+   The ``json`` and ``xml`` styles are considered experimental. While
+   they may be attractive to use for easily obtaining machine-readable
+   output, their behavior may change in subsequent versions.
+
+   These styles may also exhibit unexpected results when dealing with
+   certain encodings. Mercurial treats things like filenames as a
+   series of bytes and normalizing certain byte sequences to JSON
+   or XML with certain encoding settings can lead to surprises.
+
+Command Server Output
+---------------------
+
+If using the command server to interact with Mercurial, you are likely
+using an existing library/API that abstracts implementation details of
+the command server. If so, this interface layer may perform parsing for
+you, saving you the work of implementing it yourself.
+
+Output Verbosity
+----------------
+
+Commands often have varying output verbosity, even when machine
+readable styles are being used (e.g. ``-T json``). Adding
+``-v/--verbose`` and ``--debug`` to the command's arguments can
+increase the amount of data exposed by Mercurial.
+
+An alternate way to get the data you need is by explicitly specifying
+a template.
+
+Other Topics
+============
+
+revsets
+   Revisions sets is a functional query language for selecting a set
+   of revisions. Think of it as SQL for Mercurial repositories. Revsets
+   are useful for querying repositories for specific data.
+
+   See :hg:`help revsets` for more.
+
+share extension
+   The ``share`` extension provides functionality for sharing
+   repository data across several working copies. It can even
+   automatically "pool" storage for logically related repositories when
+   cloning.
+
+   Configuring the ``share`` extension can lead to significant resource
+   utilization reduction, particularly around disk space and the
+   network. This is especially true for continuous integration (CI)
+   environments.
+
+   See :hg:`help -e share` for more.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/subrepos.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,171 @@
+Subrepositories let you nest external repositories or projects into a
+parent Mercurial repository, and make commands operate on them as a
+group.
+
+Mercurial currently supports Mercurial, Git, and Subversion
+subrepositories.
+
+Subrepositories are made of three components:
+
+1. Nested repository checkouts. They can appear anywhere in the
+   parent working directory.
+
+2. Nested repository references. They are defined in ``.hgsub``, which
+   should be placed in the root of working directory, and
+   tell where the subrepository checkouts come from. Mercurial
+   subrepositories are referenced like::
+
+     path/to/nested = https://example.com/nested/repo/path
+
+   Git and Subversion subrepos are also supported::
+
+     path/to/nested = [git]git://example.com/nested/repo/path
+     path/to/nested = [svn]https://example.com/nested/trunk/path
+
+   where ``path/to/nested`` is the checkout location relatively to the
+   parent Mercurial root, and ``https://example.com/nested/repo/path``
+   is the source repository path. The source can also reference a
+   filesystem path.
+
+   Note that ``.hgsub`` does not exist by default in Mercurial
+   repositories, you have to create and add it to the parent
+   repository before using subrepositories.
+
+3. Nested repository states. They are defined in ``.hgsubstate``, which
+   is placed in the root of working directory, and
+   capture whatever information is required to restore the
+   subrepositories to the state they were committed in a parent
+   repository changeset. Mercurial automatically record the nested
+   repositories states when committing in the parent repository.
+
+   .. note::
+
+      The ``.hgsubstate`` file should not be edited manually.
+
+
+Adding a Subrepository
+======================
+
+If ``.hgsub`` does not exist, create it and add it to the parent
+repository. Clone or checkout the external projects where you want it
+to live in the parent repository. Edit ``.hgsub`` and add the
+subrepository entry as described above. At this point, the
+subrepository is tracked and the next commit will record its state in
+``.hgsubstate`` and bind it to the committed changeset.
+
+Synchronizing a Subrepository
+=============================
+
+Subrepos do not automatically track the latest changeset of their
+sources. Instead, they are updated to the changeset that corresponds
+with the changeset checked out in the top-level changeset. This is so
+developers always get a consistent set of compatible code and
+libraries when they update.
+
+Thus, updating subrepos is a manual process. Simply check out target
+subrepo at the desired revision, test in the top-level repo, then
+commit in the parent repository to record the new combination.
+
+Deleting a Subrepository
+========================
+
+To remove a subrepository from the parent repository, delete its
+reference from ``.hgsub``, then remove its files.
+
+Interaction with Mercurial Commands
+===================================
+
+:add: add does not recurse in subrepos unless -S/--subrepos is
+    specified.  However, if you specify the full path of a file in a
+    subrepo, it will be added even without -S/--subrepos specified.
+    Subversion subrepositories are currently silently
+    ignored.
+
+:addremove: addremove does not recurse into subrepos unless
+    -S/--subrepos is specified.  However, if you specify the full
+    path of a directory in a subrepo, addremove will be performed on
+    it even without -S/--subrepos being specified.  Git and
+    Subversion subrepositories will print a warning and continue.
+
+:archive: archive does not recurse in subrepositories unless
+    -S/--subrepos is specified.
+
+:cat: Git subrepositories only support exact file matches.
+    Subversion subrepositories are currently ignored.
+
+:commit: commit creates a consistent snapshot of the state of the
+    entire project and its subrepositories. If any subrepositories
+    have been modified, Mercurial will abort.  Mercurial can be made
+    to instead commit all modified subrepositories by specifying
+    -S/--subrepos, or setting "ui.commitsubrepos=True" in a
+    configuration file (see :hg:`help config`).  After there are no
+    longer any modified subrepositories, it records their state and
+    finally commits it in the parent repository.  The --addremove
+    option also honors the -S/--subrepos option.  However, Git and
+    Subversion subrepositories will print a warning and abort.
+
+:diff: diff does not recurse in subrepos unless -S/--subrepos is
+    specified.  However, if you specify the full path of a file or
+    directory in a subrepo, it will be diffed even without
+    -S/--subrepos being specified.  Subversion subrepositories are
+    currently silently ignored.
+
+:files: files does not recurse into subrepos unless -S/--subrepos is
+    specified.  However, if you specify the full path of a file or
+    directory in a subrepo, it will be displayed even without
+    -S/--subrepos being specified.  Git and Subversion subrepositories
+    are currently silently ignored.
+
+:forget: forget currently only handles exact file matches in subrepos.
+    Git and Subversion subrepositories are currently silently ignored.
+
+:incoming: incoming does not recurse in subrepos unless -S/--subrepos
+    is specified. Git and Subversion subrepositories are currently
+    silently ignored.
+
+:outgoing: outgoing does not recurse in subrepos unless -S/--subrepos
+    is specified. Git and Subversion subrepositories are currently
+    silently ignored.
+
+:pull: pull is not recursive since it is not clear what to pull prior
+    to running :hg:`update`. Listing and retrieving all
+    subrepositories changes referenced by the parent repository pulled
+    changesets is expensive at best, impossible in the Subversion
+    case.
+
+:push: Mercurial will automatically push all subrepositories first
+    when the parent repository is being pushed. This ensures new
+    subrepository changes are available when referenced by top-level
+    repositories.  Push is a no-op for Subversion subrepositories.
+
+:serve: serve does not recurse into subrepositories unless
+    -S/--subrepos is specified.  Git and Subversion subrepositories
+    are currently silently ignored.
+
+:status: status does not recurse into subrepositories unless
+    -S/--subrepos is specified. Subrepository changes are displayed as
+    regular Mercurial changes on the subrepository
+    elements. Subversion subrepositories are currently silently
+    ignored.
+
+:remove: remove does not recurse into subrepositories unless
+    -S/--subrepos is specified.  However, if you specify a file or
+    directory path in a subrepo, it will be removed even without
+    -S/--subrepos.  Git and Subversion subrepositories are currently
+    silently ignored.
+
+:update: update restores the subrepos in the state they were
+    originally committed in target changeset. If the recorded
+    changeset is not available in the current subrepository, Mercurial
+    will pull it in first before updating.  This means that updating
+    can require network access when using subrepositories.
+
+Remapping Subrepositories Sources
+=================================
+
+A subrepository source location may change during a project life,
+invalidating references stored in the parent repository history. To
+fix this, rewriting rules can be defined in parent repository ``hgrc``
+file or in Mercurial configuration. See the ``[subpaths]`` section in
+hgrc(5) for more details.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/templates.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,215 @@
+Mercurial allows you to customize output of commands through
+templates. You can either pass in a template or select an existing
+template-style from the command line, via the --template option.
+
+You can customize output for any "log-like" command: log,
+outgoing, incoming, tip, parents, and heads.
+
+Some built-in styles are packaged with Mercurial. These can be listed
+with :hg:`log --template list`. Example usage::
+
+    $ hg log -r1.0::1.1 --template changelog
+
+A template is a piece of text, with markup to invoke variable
+expansion::
+
+    $ hg log -r1 --template "{node}\n"
+    b56ce7b07c52de7d5fd79fb89701ea538af65746
+
+Keywords
+========
+
+Strings in curly braces are called keywords. The availability of
+keywords depends on the exact context of the templater. These
+keywords are usually available for templating a log-like command:
+
+.. keywordsmarker
+
+The "date" keyword does not produce human-readable output. If you
+want to use a date in your output, you can use a filter to process
+it. Filters are functions which return a string based on the input
+variable. Be sure to use the stringify filter first when you're
+applying a string-input filter to a list-like input variable.
+You can also use a chain of filters to get the desired output::
+
+   $ hg tip --template "{date|isodate}\n"
+   2008-08-21 18:22 +0000
+
+Filters
+=======
+
+List of filters:
+
+.. filtersmarker
+
+Note that a filter is nothing more than a function call, i.e.
+``expr|filter`` is equivalent to ``filter(expr)``.
+
+Functions
+=========
+
+In addition to filters, there are some basic built-in functions:
+
+.. functionsmarker
+
+Operators
+=========
+
+We provide a limited set of infix arithmetic operations on integers::
+
+  + for addition
+  - for subtraction
+  * for multiplication
+  / for floor division (division rounded to integer nearest -infinity)
+
+Division fulfills the law x = x / y + mod(x, y).
+
+Also, for any expression that returns a list, there is a list operator::
+
+    expr % "{template}"
+
+As seen in the above example, ``{template}`` is interpreted as a template.
+To prevent it from being interpreted, you can use an escape character ``\{``
+or a raw string prefix, ``r'...'``.
+
+The dot operator can be used as a shorthand for accessing a sub item:
+
+- ``expr.member`` is roughly equivalent to ``expr % '{member}'`` if ``expr``
+  returns a non-list/dict. The returned value is not stringified.
+- ``dict.key`` is identical to ``get(dict, 'key')``.
+
+Aliases
+=======
+
+New keywords and functions can be defined in the ``templatealias`` section of
+a Mercurial configuration file::
+
+  <alias> = <definition>
+
+Arguments of the form `a1`, `a2`, etc. are substituted from the alias into
+the definition.
+
+For example,
+
+::
+
+  [templatealias]
+  r = rev
+  rn = "{r}:{node|short}"
+  leftpad(s, w) = pad(s, w, ' ', True)
+
+defines two symbol aliases, ``r`` and ``rn``, and a function alias
+``leftpad()``.
+
+It's also possible to specify complete template strings, using the
+``templates`` section. The syntax used is the general template string syntax.
+
+For example,
+
+::
+
+  [templates]
+  nodedate = "{node|short}: {date(date, "%Y-%m-%d")}\n"
+
+defines a template, ``nodedate``, which can be called like::
+
+  $ hg log -r . -Tnodedate
+
+A template defined in ``templates`` section can also be referenced from
+another template::
+
+  $ hg log -r . -T "{rev} {nodedate}"
+
+but be aware that the keywords cannot be overridden by templates. For example,
+a template defined as ``templates.rev`` cannot be referenced as ``{rev}``.
+
+A template defined in ``templates`` section may have sub templates which
+are inserted before/after/between items::
+
+  [templates]
+  myjson = ' {dict(rev, node|short)|json}'
+  myjson:docheader = '\{\n'
+  myjson:docfooter = '\n}\n'
+  myjson:separator = ',\n'
+
+Examples
+========
+
+Some sample command line templates:
+
+- Format lists, e.g. files::
+
+   $ hg log -r 0 --template "files:\n{files % '  {file}\n'}"
+
+- Join the list of files with a ", "::
+
+   $ hg log -r 0 --template "files: {join(files, ', ')}\n"
+
+- Join the list of files ending with ".py" with a ", "::
+
+   $ hg log -r 0 --template "pythonfiles: {join(files('**.py'), ', ')}\n"
+
+- Separate non-empty arguments by a " "::
+
+   $ hg log -r 0 --template "{separate(' ', node, bookmarks, tags}\n"
+
+- Modify each line of a commit description::
+
+   $ hg log --template "{splitlines(desc) % '**** {line}\n'}"
+
+- Format date::
+
+   $ hg log -r 0 --template "{date(date, '%Y')}\n"
+
+- Display date in UTC::
+
+   $ hg log -r 0 --template "{localdate(date, 'UTC')|date}\n"
+
+- Output the description set to a fill-width of 30::
+
+   $ hg log -r 0 --template "{fill(desc, 30)}"
+
+- Use a conditional to test for the default branch::
+
+   $ hg log -r 0 --template "{ifeq(branch, 'default', 'on the main branch',
+   'on branch {branch}')}\n"
+
+- Append a newline if not empty::
+
+   $ hg tip --template "{if(author, '{author}\n')}"
+
+- Label the output for use with the color extension::
+
+   $ hg log -r 0 --template "{label('changeset.{phase}', node|short)}\n"
+
+- Invert the firstline filter, i.e. everything but the first line::
+
+   $ hg log -r 0 --template "{sub(r'^.*\n?\n?', '', desc)}\n"
+
+- Display the contents of the 'extra' field, one per line::
+
+   $ hg log -r 0 --template "{join(extras, '\n')}\n"
+
+- Mark the active bookmark with '*'::
+
+   $ hg log --template "{bookmarks % '{bookmark}{ifeq(bookmark, active, '*')} '}\n"
+
+- Find the previous release candidate tag, the distance and changes since the tag::
+
+   $ hg log -r . --template "{latesttag('re:^.*-rc$') % '{tag}, {changes}, {distance}'}\n"
+
+- Mark the working copy parent with '@'::
+
+   $ hg log --template "{ifcontains(rev, revset('.'), '@')}\n"
+
+- Show details of parent revisions::
+
+   $ hg log --template "{revset('parents(%d)', rev) % '{desc|firstline}\n'}"
+
+- Show only commit descriptions that start with "template"::
+
+   $ hg log --template "{startswith('template', firstline(desc))}\n"
+
+- Print the first word of each line of a commit message::
+
+   $ hg log --template "{word(0, desc)}\n"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mercurial/helptext/urls.txt	Wed Nov 13 21:52:25 2019 -0500
@@ -0,0 +1,66 @@
+Valid URLs are of the form::
+
+  local/filesystem/path[#revision]
+  file://local/filesystem/path[#revision]
+  http://[user[:pass]@]host[:port]/[path][#revision]
+  https://[user[:pass]@]host[:port]/[path][#revision]
+  ssh://[user@]host[:port]/[path][#revision]
+
+Paths in the local filesystem can either point to Mercurial
+repositories or to bundle files (as created by :hg:`bundle` or
+:hg:`incoming --bundle`). See also :hg:`help paths`.
+
+An optional identifier after # indicates a particular branch, tag, or
+changeset to use from the remote repository. See also :hg:`help
+revisions`.
+
+Some features, such as pushing to http:// and https:// URLs are only
+possible if the feature is explicitly enabled on the remote Mercurial
+server.
+
+Note that the security of HTTPS URLs depends on proper configuration of
+web.cacerts.
+
+Some notes about using SSH with Mercurial:
+
+- SSH requires an accessible shell account on the destination machine
+  and a copy of hg in the remote path or specified with remotecmd.
+- path is relative to the remote user's home directory by default. Use
+  an extra slash at the start of a path to specify an absolute path::
+
+    ssh://example.com//tmp/repository
+
+- Mercurial doesn't use its own compression via SSH; the right thing
+  to do is to configure it in your ~/.ssh/config, e.g.::
+
+    Host *.mylocalnetwork.example.com
+      Compression no
+    Host *
+      Compression yes
+
+  Alternatively specify "ssh -C" as your ssh command in your
+  configuration file or with the --ssh command line option.
+
+These URLs can all be stored in your configuration file with path
+aliases under the [paths] section like so::
+
+  [paths]
+  alias1 = URL1
+  alias2 = URL2
+  ...
+
+You can then use the alias for any command that uses a URL (for
+example :hg:`pull alias1` will be treated as :hg:`pull URL1`).
+
+Two path aliases are special because they are used as defaults when
+you do not provide the URL to a command:
+
+default:
+  When you create a repository with hg clone, the clone command saves
+  the location of the source repository as the new repository's
+  'default' path. This is then used when you omit path from push- and
+  pull-like commands (including incoming and outgoing).
+
+default-push:
+  The push command will look for a path named 'default-push', and
+  prefer it over 'default' if both are defined.
--- a/setup.py	Thu Nov 14 11:33:05 2019 +0100
+++ b/setup.py	Wed Nov 13 21:52:25 2019 -0500
@@ -1191,6 +1191,8 @@
     'mercurial',
     'mercurial.cext',
     'mercurial.cffi',
+    'mercurial.helptext',
+    'mercurial.helptext.internals',
     'mercurial.hgweb',
     'mercurial.interfaces',
     'mercurial.pure',
@@ -1535,11 +1537,11 @@
 packagedata = {
     'mercurial': [
         'locale/*/LC_MESSAGES/hg.mo',
-        'help/*.txt',
-        'help/internals/*.txt',
         'default.d/*.rc',
         'dummycert.pem',
-    ]
+    ],
+    'mercurial.helptext': ['*.txt',],
+    'mercurial.helptext.internals': ['*.txt',],
 }
 
 
--- a/tests/test-check-config.t	Thu Nov 14 11:33:05 2019 +0100
+++ b/tests/test-check-config.t	Wed Nov 13 21:52:25 2019 -0500
@@ -24,7 +24,7 @@
   > EOF
 
   $ cat > files << EOF
-  > mercurial/help/config.txt
+  > mercurial/helptext/config.txt
   > $TESTTMP/testfile.py
   > EOF