mercurial/help/flags.txt
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 16 Oct 2019 17:49:30 +0200
changeset 43254 181d28ba05da
parent 35045 b0262b25ab48
permissions -rw-r--r--
copies: avoid instancing more changectx to access parent revisions We just need to know the revision numbers of the parents, creating full context is needlessly expensive. This provide a small, but noticeable performance boost. revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29 before: ! wall 2.885636 comb 2.900000 user 2.870000 sys 0.030000 (median of 10) after: ! wall 2.702270 comb 2.710000 user 2.690000 sys 0.020000 (median of 10) revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2 before: ! wall 4.298271 comb 4.290000 user 4.240000 sys 0.050000 (median of 10) after: ! wall 3.976610 comb 3.970000 user 3.920000 sys 0.050000 (median of 10) revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0 before: ! wall 0.773397 comb 0.770000 user 0.770000 sys 0.000000 (median of 11) after: ! wall 0.701634 comb 0.700000 user 0.700000 sys 0.000000 (median of 13) revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f before: ! wall 0.013585 comb 0.010000 user 0.010000 sys 0.000000 (median of 217) after: ! wall 0.013550 comb 0.010000 user 0.010000 sys 0.000000 (median of 218) revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63 before: ! wall 0.003202 comb 0.000000 user 0.000000 sys 0.000000 (median of 929) after: ! wall 0.002993 comb 0.010000 user 0.010000 sys 0.000000 (median of 992) revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e before: ! wall 0.000077 comb 0.000000 user 0.000000 sys 0.000000 (median of 12060) after: ! wall 0.000072 comb 0.000000 user 0.000000 sys 0.000000 (median of 12804) revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe before: ! wall 0.510614 comb 0.500000 user 0.500000 sys 0.000000 (median of 18) after: ! wall 0.473681 comb 0.470000 user 0.470000 sys 0.000000 (median of 20) revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d before: ! wall 0.126552 comb 0.130000 user 0.130000 sys 0.000000 (median of 77) after: ! wall 0.115240 comb 0.110000 user 0.110000 sys 0.000000 (median of 85) Differential Revision: https://phab.mercurial-scm.org/D7122
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35045
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
     1
Most Mercurial commands accept various flags.
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
     2
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
     3
Flag names
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
     4
==========
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
     5
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
     6
Flags for each command are listed in :hg:`help` for that command.
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
     7
Additionally, some flags, such as --repository, are global and can be used with
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
     8
any command - those are seen in :hg:`help -v`, and can be specified before or
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
     9
after the command.
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    10
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    11
Every flag has at least a long name, such as --repository. Some flags may also
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    12
have a short one-letter name, such as the equivalent -R. Using the short or long
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    13
name is equivalent and has the same effect.
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    14
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    15
Flags that have a short name can also be bundled together - for instance, to
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    16
specify both --edit (short -e) and --interactive (short -i), one could use::
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    17
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    18
    hg commit -ei
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    19
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    20
If any of the bundled flags takes a value (i.e. is not a boolean), it must be
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    21
last, followed by the value::
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    22
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    23
    hg commit -im 'Message'
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    24
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    25
Flag types
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    26
==========
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    27
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    28
Mercurial command-line flags can be strings, numbers, booleans, or lists of
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    29
strings.
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    30
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    31
Specifying flag values
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    32
======================
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    33
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    34
The following syntaxes are allowed, assuming a flag 'flagname' with short name
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    35
'f'::
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    36
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    37
    --flagname=foo
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    38
    --flagname foo
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    39
    -f foo
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    40
    -ffoo
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    41
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    42
This syntax applies to all non-boolean flags (strings, numbers or lists).
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    43
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    44
Specifying boolean flags
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    45
========================
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    46
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    47
Boolean flags do not take a value parameter. To specify a boolean, use the flag
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    48
name to set it to true, or the same name prefixed with 'no-' to set it to
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    49
false::
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    50
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    51
    hg commit --interactive
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    52
    hg commit --no-interactive
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    53
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    54
Specifying list flags
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    55
=====================
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    56
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    57
List flags take multiple values. To specify them, pass the flag multiple times::
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    58
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    59
    hg files --include mercurial --include tests
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    60
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    61
Setting flag defaults
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    62
=====================
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    63
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    64
In order to set a default value for a flag in an hgrc file, it is recommended to
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    65
use aliases::
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    66
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    67
    [alias]
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    68
    commit = commit --interactive
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    69
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    70
For more information on hgrc files, see :hg:`help config`.
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    71
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    72
Overriding flags on the command line
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    73
====================================
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    74
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    75
If the same non-list flag is specified multiple times on the command line, the
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    76
latest specification is used::
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    77
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    78
    hg commit -m "Ignored value" -m "Used value"
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    79
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    80
This includes the use of aliases - e.g., if one has::
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    81
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    82
    [alias]
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    83
    committemp = commit -m "Ignored value"
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    84
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    85
then the following command will override that -m::
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    86
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    87
    hg committemp -m "Used value"
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    88
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    89
Overriding flag defaults
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    90
========================
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    91
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    92
Every flag has a default value, and you may also set your own defaults in hgrc
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    93
as described above.
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    94
Except for list flags, defaults can be overridden on the command line simply by
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    95
specifying the flag in that location.
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    96
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    97
Hidden flags
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    98
============
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
    99
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
   100
Some flags are not shown in a command's help by default - specifically, those
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
   101
that are deemed to be experimental, deprecated or advanced. To show all flags,
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
   102
add the --verbose flag for the help command::
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
   103
b0262b25ab48 help: adding a topic on flags
Rodrigo Damazio Bovendorp <rdamazio@google.com>
parents:
diff changeset
   104
    hg help --verbose commit