Mercurial > hg
view mercurial/help/environment.txt @ 35616:706aa203b396
fileset: add a lightweight file filtering language
This patch was inspired by one that Jun Wu authored for the fb-experimental
repo, to avoid using matcher for efficiency[1]. We want a way to specify what
files will be converted to LFS at commit time. And per discussion, we also want
to specify what files to skip, text diff, or merge in another config option.
The current `lfs.threshold` config option could not satisfy complex needs. I'm
putting it in a core package because Augie floated the idea of also using it for
narrow and sparse.
Yuya suggested farming out to fileset.parse(), which added support for more
symbols. The only fileset element not supported here is 'negate'. (List isn't
supported by filesets either.) I also changed the 'always' token to the 'all()'
predicate for consistency, and introduced 'none()' to improve readability in a
future tracked file based config. The extension operator was changed from '.'
to '**', to match how recursive path globs are specified. Finally, I changed
the path matcher from '/' to 'path:' at Yuya's suggestion, for consistency with
matcher. Unfortunately, ':' is currently reserved in filesets, so this has to
be quoted to be processed as a string instead of a symbol[2]. We should
probably revisit that, because it's seriously ugly. But it's only used by an
experimental extension, and I think using a file based config for LFS may drive
some more tweaks, so I'm settling for this for now.
I reserved all of the glob characters in fileset except '.' and '_' for the
extension test because those are likely valid extension characters.
Sample filter settings:
all() # everything
size(">20MB") # larger than 20MB
!**.txt # except for .txt files
**.zip | **.tar.gz | **.7z # some types of compressed files
"path:bin" # files under "bin" in the project root
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-December/109387.html
[2] https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-January/109729.html
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 10 Jan 2018 22:23:34 -0500 |
parents | aef2b98d9352 |
children |
line wrap: on
line source
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.