mercurial/help/pager.txt
author Martijn Pieters <mj@zopatista.com>
Wed, 11 Jul 2018 14:28:13 +0100
changeset 38661 8ac0c9cd4c48
parent 32608 85b978031a75
permissions -rw-r--r--
fncache: avoid loading the filename cache when not actually modifying it With time, fncache can become very large. The mozilla-central repo for example, has a 31M and growing fncache file. Loading this file takes time (280ms for the mozilla-central repository). In many scenarios, we don't need to load fncache at all. For example, when committing changes to existing files, or pushing such commits to another clone. This patch detects when a name is added via store.vfs(), and only loads the cache if a) the data metadata file doesn't already exist, or b) when opening for appending, the data or metadata file exists but has size (a transaction rollback leaves behind such files). Benchmarks (run on Macos 10.13 on a 2017-model Macbook Pro with Core i7 2.9GHz and flash drive), each test without and with patch run 5 times: * committing to an existing file, against the mozilla-central repository. Baseline real time average 2.3736, with patch 1.9884. * unbundling a large changeset consisting *only* of existing-file modifications (159 revisions, 1050 modifications, mozilla-central 4a250a0e4f29:beea9ac7d823), into a clone limited to the ancestor revision of that revset). Baseline real time average 1.5048, with patch 1.3108.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32138
edbbd18a47ab help: attempt to clarify that pager usage is not output length based
Matt Harbison <matt_harbison@yahoo.com>
parents: 32137
diff changeset
     1
Some Mercurial commands can produce a lot of output, and Mercurial will
31061
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
     2
attempt to use a pager to make those commands more pleasant.
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
     3
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
     4
To set the pager that should be used, set the application variable::
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
     5
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
     6
  [pager]
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
     7
  pager = less -FRX
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
     8
32608
85b978031a75 help: clarify the choice of pager
Xavier Lepaul <xalep@google.com>
parents: 32138
diff changeset
     9
If no pager is set in the user or repository configuration, Mercurial uses the
85b978031a75 help: clarify the choice of pager
Xavier Lepaul <xalep@google.com>
parents: 32138
diff changeset
    10
environment variable $PAGER. If $PAGER is not set, pager.pager from the default
85b978031a75 help: clarify the choice of pager
Xavier Lepaul <xalep@google.com>
parents: 32138
diff changeset
    11
or system configuration is used. If none of these are set, a default pager will
85b978031a75 help: clarify the choice of pager
Xavier Lepaul <xalep@google.com>
parents: 32138
diff changeset
    12
be used, typically `less` on Unix and `more` on Windows.
31061
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    13
32137
c4eb23116a09 help: document color/pager pitfalls on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 32104
diff changeset
    14
.. container:: windows
c4eb23116a09 help: document color/pager pitfalls on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 32104
diff changeset
    15
c4eb23116a09 help: document color/pager pitfalls on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 32104
diff changeset
    16
  On Windows, `more` is not color aware, so using it effectively disables color.
c4eb23116a09 help: document color/pager pitfalls on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 32104
diff changeset
    17
  MSYS and Cygwin shells provide `less` as a pager, which can be configured to
c4eb23116a09 help: document color/pager pitfalls on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 32104
diff changeset
    18
  support ANSI color codes.  See :hg:`help config.color.pagermode` to configure
c4eb23116a09 help: document color/pager pitfalls on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 32104
diff changeset
    19
  the color mode when invoking a pager.
c4eb23116a09 help: document color/pager pitfalls on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 32104
diff changeset
    20
31061
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    21
You can disable the pager for certain commands by adding them to the
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    22
pager.ignore list::
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    23
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    24
  [pager]
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    25
  ignore = version, help, update
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    26
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    27
To ignore global commands like :hg:`version` or :hg:`help`, you have
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    28
to specify them in your user configuration file.
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    29
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    30
To control whether the pager is used at all for an individual command,
32084
091d6b9157da help: apply bulk fixes for indentation and literal blocking issues
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32081
diff changeset
    31
you can use --pager=<value>:
31061
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    32
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    33
  - use as needed: `auto`.
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    34
  - require the pager: `yes` or `on`.
900996da577a pager: move most help to a new help topic and deprecate extension
Augie Fackler <augie@google.com>
parents:
diff changeset
    35
  - suppress the pager: `no` or `off` (any unrecognized value
32084
091d6b9157da help: apply bulk fixes for indentation and literal blocking issues
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32081
diff changeset
    36
    will also work).
31062
88203f26ea57 pager: add a config knob to just globally turn off the pager
Augie Fackler <augie@google.com>
parents: 31061
diff changeset
    37
88203f26ea57 pager: add a config knob to just globally turn off the pager
Augie Fackler <augie@google.com>
parents: 31061
diff changeset
    38
To globally turn off all attempts to use a pager, set::
88203f26ea57 pager: add a config knob to just globally turn off the pager
Augie Fackler <augie@google.com>
parents: 31061
diff changeset
    39
32104
f06d23af6cdf pager: rename 'pager.enable' to 'ui.paginate'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 32084
diff changeset
    40
  [ui]
f06d23af6cdf pager: rename 'pager.enable' to 'ui.paginate'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 32084
diff changeset
    41
  paginate = never
31062
88203f26ea57 pager: add a config knob to just globally turn off the pager
Augie Fackler <augie@google.com>
parents: 31061
diff changeset
    42
88203f26ea57 pager: add a config knob to just globally turn off the pager
Augie Fackler <augie@google.com>
parents: 31061
diff changeset
    43
which will prevent the pager from running.