[issue2804] help: 'hg help' supports subtopics

Yun Lee bugs at mercurial.selenic.com
Wed May 11 10:13:32 CDT 2011


New submission from Yun Lee <yun.lee.bj at gmail.com>:

Make 'hg help' supports subtopics. For example,
for 'hg help config', we get description and subtopics of the topic 'config' :
Configuration Files

    Mercurial reads configuration data from several files, if they exist.
    Below we list the most specific file first.

    On Windows, these configuration files are read:

    - "<repo>\.hg\hgrc"
    - "%USERPROFILE%\.hgrc"
    - "%USERPROFILE%\mercurial.ini"
    - "%HOME%\.hgrc"
    - "%HOME%\mercurial.ini"
    - "C:\mercurial\mercurial.ini" (unless regkey or hgrc.d\ or mercurial.ini
      found)
    - "HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial" (unless hgrc.d\ or mercurial.ini
      found)
    - "<hg.exe-dir>\hgrc.d\*.rc" (unless mercurial.ini found)
    - "<hg.exe-dir>\mercurial.ini"

    On Unix, these files are read:

    - "<repo>/.hg/hgrc"
    - "$HOME/.hgrc"
    - "/etc/mercurial/hgrc"
    - "/etc/mercurial/hgrc.d/*.rc"
    - "<install-root>/etc/mercurial/hgrc"
    - "<install-root>/etc/mercurial/hgrc.d/*.rc"

    These files do not exist by default and you will have to create the
    appropriate configuration files yourself: global configuration like the
    username setting is typically put into "%USERPROFILE%\mercurial.ini" or
    "$HOME/.hgrc" and local configuration is put into the per-repository
    "<repo>/.hg/hgrc" file.

    If there is a per-repository configuration file which is not owned by the
    active user, Mercurial will warn you that the file is skipped:

      not trusting file <repo>/.hg/hgrc from untrusted user USER, group GROUP

    If this bothers you, the warning can be silenced (the file would still be
    ignored) or trust can be established. Use one of the following settings,
    the syntax is explained below:

    - "ui.report_untrusted = False"
    - "trusted.users = USER"
    - "trusted.groups = GROUP"

    The configuration files for Mercurial 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 at example.net>
      verbose = True

    The above entries will be referred to as "ui.username" and "ui.verbose",
    respectively. Please see the hgrc man page for a full description of the
    possible configuration values:

    - on Unix-like systems: "man hgrc"
    - online: http://www.selenic.com/mercurial/hgrc.5.html


subtitles:
  alias      : Defines command aliases
  auth       : Defines  Authentication credentials
  defaults   : Defines command defaults
--------------------------------
And for 'hg help config.alias', we get the subtopic 'alias' of 'config':

Defines command aliases

    Aliases allow you to define your own commands in terms of other commands
    (or aliases), optionally including arguments.

    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!

----------
assignedto: yunlee
messages: 16258
nosy: yunlee
priority: feature
status: unread
title: help: 'hg help' supports subtopics

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2804>
____________________________________________________


More information about the Mercurial-devel mailing list