Show More
help.py
499 lines
| 19.5 KiB
| text/x-python
|
PythonLexer
/ mercurial / help.py
Matt Mackall
|
r3795 | # help.py - help data for mercurial | ||
# | ||||
# Copyright 2006 Matt Mackall <mpm@selenic.com> | ||||
# | ||||
Martin Geisler
|
r8225 | # This software may be used and distributed according to the terms of the | ||
# GNU General Public License version 2, incorporated herein by reference. | ||||
Matt Mackall
|
r3795 | |||
Cédric Duval
|
r8871 | from i18n import _ | ||
Martin Geisler
|
r8938 | import extensions, util | ||
Cédric Duval
|
r8863 | |||
def moduledoc(file): | ||||
Cédric Duval
|
r8879 | '''return the top-level python documentation for the given file | ||
Loosely inspired by pydoc.source_synopsis(), but rewritten to handle \''' | ||||
as well as """ and to return the whole text instead of just the synopsis''' | ||||
Cédric Duval
|
r8863 | result = [] | ||
line = file.readline() | ||||
while line[:1] == '#' or not line.strip(): | ||||
line = file.readline() | ||||
if not line: break | ||||
start = line[:3] | ||||
if start == '"""' or start == "'''": | ||||
line = line[3:] | ||||
while line: | ||||
if line.rstrip().endswith(start): | ||||
line = line.split(start)[0] | ||||
if line: | ||||
result.append(line) | ||||
break | ||||
elif not line: | ||||
return None # unmatched delimiter | ||||
result.append(line) | ||||
line = file.readline() | ||||
else: | ||||
return None | ||||
return ''.join(result) | ||||
Cédric Duval
|
r8879 | def listexts(header, exts, maxlength): | ||
'''return a text listing of the given extensions''' | ||||
if not exts: | ||||
return '' | ||||
Martin Geisler
|
r9157 | # TODO: literal block is wrong, should be a field list or a simple table. | ||
result = '\n%s\n\n ::\n\n' % header | ||||
Cédric Duval
|
r8879 | for name, desc in sorted(exts.iteritems()): | ||
Martin Geisler
|
r9157 | desc = util.wrap(desc, maxlength + 5) | ||
result += ' %s %s\n' % (name.ljust(maxlength), desc) | ||||
Cédric Duval
|
r8864 | return result | ||
Cédric Duval
|
r8879 | def extshelp(): | ||
Cédric Duval
|
r8863 | doc = _(r''' | ||
Greg Ward
|
r8880 | Mercurial has the ability to add new features through the use of | ||
Martin Geisler
|
r9082 | extensions. Extensions may add new commands, add options to existing | ||
commands, change the default behavior of commands, or implement hooks. | ||||
Cédric Duval
|
r8865 | |||
Martin Geisler
|
r9082 | 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. | ||||
Cédric Duval
|
r8865 | |||
Martin Geisler
|
r9082 | To enable the "foo" extension, either shipped with Mercurial or in the | ||
Martin Geisler
|
r9157 | Python search path, create an entry for it in your hgrc, like this:: | ||
Cédric Duval
|
r8863 | |||
Cédric Duval
|
r8865 | [extensions] | ||
foo = | ||||
Martin Geisler
|
r9157 | You may also specify the full path to an extension:: | ||
Cédric Duval
|
r8865 | |||
[extensions] | ||||
myfeature = ~/.hgext/myfeature.py | ||||
Martin Geisler
|
r9082 | To explicitly disable an extension enabled in an hgrc of broader scope, | ||
Martin Geisler
|
r9157 | prepend its path with !:: | ||
Cédric Duval
|
r8865 | |||
[extensions] | ||||
Cédric Duval
|
r8895 | # disabling extension bar residing in /path/to/extension/bar.py | ||
Cédric Duval
|
r8865 | hgext.bar = !/path/to/extension/bar.py | ||
# ditto, but no path was supplied for extension baz | ||||
hgext.baz = ! | ||||
Cédric Duval
|
r8863 | ''') | ||
Cédric Duval
|
r8871 | exts, maxlength = extensions.enabled() | ||
Cédric Duval
|
r8879 | doc += listexts(_('enabled extensions:'), exts, maxlength) | ||
Cédric Duval
|
r8864 | |||
Cédric Duval
|
r8871 | exts, maxlength = extensions.disabled() | ||
Cédric Duval
|
r8879 | doc += listexts(_('disabled extensions:'), exts, maxlength) | ||
Cédric Duval
|
r8863 | |||
return doc | ||||
Martin Geisler
|
r7013 | |||
Johannes Stezenbach
|
r6654 | helptable = ( | ||
Martin Geisler
|
r7013 | (["dates"], _("Date Formats"), | ||
_(r''' | ||||
timeless
|
r7764 | Some commands allow the user to specify a date, e.g.: | ||
Thomas Arendsen Hein
|
r6163 | |||
Martin Geisler
|
r9157 | - 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:: | ||||
Matt Mackall
|
r3795 | |||
Martin Geisler
|
r9157 | "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) | ||||
Matt Mackall
|
r3795 | |||
Matt Mackall
|
r3811 | Lastly, there is Mercurial's internal format: | ||
Matt Mackall
|
r3795 | |||
Matt Mackall
|
r3811 | "1165432709 0" (Wed Dec 6 13:18:29 2006 UTC) | ||
Matt Mackall
|
r3795 | |||
Martin Geisler
|
r9082 | This is the internal representation format for dates. unixtime is the | ||
number of seconds since the epoch (1970-01-01 00:00 UTC). offset is the | ||||
offset of the local timezone, in seconds west of UTC (negative if the | ||||
timezone is east of UTC). | ||||
Thomas Arendsen Hein
|
r6163 | |||
Martin Geisler
|
r9157 | The log command also accepts date ranges:: | ||
Thomas Arendsen Hein
|
r6163 | |||
Martin Geisler
|
r9157 | "<{datetime}" - at or before a given date/time | ||
">{datetime}" - on or after a given date/time | ||||
"{datetime} to {datetime}" - a date range, inclusive | ||||
"-{days}" - within a given number of days of today | ||||
Martin Geisler
|
r7013 | ''')), | ||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r7013 | (["patterns"], _("File Name Patterns"), | ||
_(r''' | ||||
Martin Geisler
|
r9082 | Mercurial accepts several notations for identifying one or more files at a | ||
time. | ||||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r9082 | By default, Mercurial treats filenames as shell-style extended glob | ||
patterns. | ||||
Johannes Stezenbach
|
r6654 | |||
Alternate pattern notations must be specified explicitly. | ||||
Martin Geisler
|
r9082 | 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. | ||||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r9082 | To use an extended glob, start a name with "glob:". Globs are rooted at | ||
Martin Geisler
|
r9158 | the current directory; a glob such as "``*.c``" will only match files in the | ||
Martin Geisler
|
r9082 | current directory ending with ".c". | ||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r9158 | The supported glob syntax extensions are "``**``" to match any string across | ||
Martin Geisler
|
r9082 | path separators and "{a,b}" to mean "a or b". | ||
Matt Mackall
|
r3799 | |||
Martin Geisler
|
r9082 | To use a Perl/Python regular expression, start a name with "re:". Regexp | ||
pattern matching is anchored at the root of the repository. | ||||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r9157 | Plain examples:: | ||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r9157 | 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" | ||||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r9157 | Glob examples:: | ||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r9157 | 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/*.c any name ending in ".c" in the directory foo | ||||
foo/**.c any name ending in ".c" in any subdirectory of foo | ||||
including itself. | ||||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r9157 | Regexp examples:: | ||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r9157 | re:.*\.c$ any name ending in ".c", anywhere in the repository | ||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r7013 | ''')), | ||
Johannes Stezenbach
|
r6654 | |||
Martin Geisler
|
r7013 | (['environment', 'env'], _('Environment Variables'), | ||
_(r''' | ||||
Martin Geisler
|
r9157 | HG | ||
Martin Geisler
|
r9082 | 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. | ||||
Thomas Arendsen Hein
|
r4686 | |||
Martin Geisler
|
r9157 | HGEDITOR | ||
timeless
|
r7804 | This is the name of the editor to run when committing. See EDITOR. | ||
Matt Mackall
|
r3798 | |||
(deprecated, use .hgrc) | ||||
Martin Geisler
|
r9157 | HGENCODING | ||
Martin Geisler
|
r9082 | 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. | ||||
Matt Mackall
|
r3798 | |||
Martin Geisler
|
r9157 | HGENCODINGMODE | ||
Martin Geisler
|
r9082 | 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. | ||||
Matt Mackall
|
r3798 | |||
Martin Geisler
|
r9157 | HGMERGE | ||
Martin Geisler
|
r9082 | An executable to use for resolving merge conflicts. The program will be | ||
executed with three arguments: local file, remote file, ancestor file. | ||||
Matt Mackall
|
r3798 | |||
(deprecated, use .hgrc) | ||||
Martin Geisler
|
r9157 | HGRCPATH | ||
Martin Geisler
|
r9082 | A list of files or directories to search for hgrc 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. | ||||
Matt Mackall
|
r3798 | |||
Dirkjan Ochtman
|
r7805 | For each element in HGRCPATH: | ||
Matt Mackall
|
r3798 | |||
Martin Geisler
|
r9157 | - if it's a directory, all files ending with .rc are added | ||
- otherwise, the file itself will be added | ||||
HGUSER | ||||
Martin Geisler
|
r9082 | This is the string used as the author of a commit. If not set, available | ||
values will be considered in this order: | ||||
Dirkjan Ochtman
|
r7805 | |||
Martin Geisler
|
r9157 | - HGUSER (deprecated) | ||
- hgrc files from the HGRCPATH | ||||
- interactive prompt | ||||
- LOGNAME (with '@hostname' appended) | ||||
Matt Mackall
|
r3798 | |||
(deprecated, use .hgrc) | ||||
Martin Geisler
|
r9157 | |||
Dirkjan Ochtman
|
r7805 | May be used as the author of a commit; see HGUSER. | ||
Matt Mackall
|
r3798 | |||
Martin Geisler
|
r9157 | LOGNAME | ||
Dirkjan Ochtman
|
r7805 | May be used as the author of a commit; see HGUSER. | ||
Matt Mackall
|
r3798 | |||
Martin Geisler
|
r9157 | VISUAL | ||
Osku Salerma
|
r5660 | This is the name of the editor to use when committing. See EDITOR. | ||
Martin Geisler
|
r9157 | EDITOR | ||
Martin Geisler
|
r9082 | 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'. | ||||
Matt Mackall
|
r3798 | |||
Martin Geisler
|
r9157 | PYTHONPATH | ||
Martin Geisler
|
r9082 | This is used by Python to find imported modules and may need to be set | ||
appropriately if this Mercurial is not installed system-wide. | ||||
Martin Geisler
|
r7013 | ''')), | ||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r7013 | (['revs', 'revisions'], _('Specifying Single Revisions'), | ||
_(r''' | ||||
Martin Geisler
|
r8005 | Mercurial supports several ways to specify individual revisions. | ||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r9082 | A plain integer is treated as a revision number. Negative integers are | ||
treated as topological offsets from the tip, with -1 denoting the tip. As | ||||
such, negative numbers are only useful if you've memorized your local tree | ||||
numbers and want to save typing a single digit. This editor suggests copy | ||||
and paste. | ||||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r9082 | A 40-digit hexadecimal string is treated as a unique revision identifier. | ||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r9082 | A hexadecimal string less than 40 characters long is treated as a unique | ||
revision identifier, and 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. | ||||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r9082 | Any other string is treated as a tag name, which is a symbolic name | ||
associated with a revision identifier. Tag names may not contain the ":" | ||||
character. | ||||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r9082 | The reserved name "tip" is a special tag that always identifies the most | ||
recent revision. | ||||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r9082 | The reserved name "null" indicates the null revision. This is the revision | ||
of an empty repository, and the parent of revision 0. | ||||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r9082 | 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. | ||||
Martin Geisler
|
r7013 | ''')), | ||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r7013 | (['mrevs', 'multirevs'], _('Specifying Multiple Revisions'), | ||
_(r''' | ||||
Martin Geisler
|
r9082 | When Mercurial accepts more than one revision, they may be specified | ||
individually, or provided as a topologically continuous range, separated | ||||
by the ":" character. | ||||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r9082 | The syntax of range notation is [BEGIN]:[END], where BEGIN and END are | ||
revision identifiers. Both BEGIN and END are optional. If BEGIN is not | ||||
specified, it defaults to revision number 0. If END is not specified, it | ||||
defaults to the tip. The range ":" thus means "all revisions". | ||||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r9082 | If BEGIN is greater than END, revisions are treated in reverse order. | ||
Johannes Stezenbach
|
r6655 | |||
Martin Geisler
|
r9082 | A range acts as a closed interval. This means that a range of 3:5 gives 3, | ||
4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6. | ||||
Martin Geisler
|
r7013 | ''')), | ||
Dirkjan Ochtman
|
r7293 | |||
Matt Mackall
|
r7387 | (['diffs'], _('Diff Formats'), | ||
Dirkjan Ochtman
|
r7293 | _(r''' | ||
Martin Geisler
|
r9082 | 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. | ||||
Dirkjan Ochtman
|
r7293 | |||
Matt Mackall
|
r7387 | While this standard format is often enough, it does not encode the | ||
following information: | ||||
Thomas Arendsen Hein
|
r7328 | |||
timeless
|
r7804 | - executable status and other permission bits | ||
Thomas Arendsen Hein
|
r7328 | - copy or rename information | ||
- changes in binary files | ||||
- creation or deletion of empty files | ||||
Dirkjan Ochtman
|
r7293 | |||
Martin Geisler
|
r9082 | 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. | ||||
Thomas Arendsen Hein
|
r7328 | |||
Martin Geisler
|
r9082 | 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. | ||||
Thomas Arendsen Hein
|
r7328 | |||
Martin Geisler
|
r9082 | 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 hgrc. You do not need to set this option when importing | ||||
diffs in this format or using them in the mq extension. | ||||
Dirkjan Ochtman
|
r7293 | ''')), | ||
Dirkjan Ochtman
|
r7678 | (['templating'], _('Template Usage'), | ||
Alexander Solovyov
|
r7677 | _(r''' | ||
Martin Geisler
|
r9082 | Mercurial allows you to customize output of commands through templates. | ||
You can either pass in a template from the command line, via the | ||||
--template option, or select an existing template-style (--style). | ||||
Alexander Solovyov
|
r7677 | |||
Martin Geisler
|
r9082 | You can customize output for any "log-like" command: log, outgoing, | ||
incoming, tip, parents, heads and glog. | ||||
Alexander Solovyov
|
r7677 | |||
Martin Geisler
|
r9082 | Three styles are packaged with Mercurial: default (the style used when no | ||
explicit preference is passed), compact and changelog. Usage: | ||||
Alexander Solovyov
|
r7677 | |||
Dirkjan Ochtman
|
r7678 | $ hg log -r1 --style changelog | ||
Alexander Solovyov
|
r7677 | |||
Martin Geisler
|
r9082 | A template is a piece of text, with markup to invoke variable expansion: | ||
Dirkjan Ochtman
|
r7678 | |||
$ hg log -r1 --template "{node}\n" | ||||
Alexander Solovyov
|
r7677 | b56ce7b07c52de7d5fd79fb89701ea538af65746 | ||
Martin Geisler
|
r9082 | 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: | ||||
Alexander Solovyov
|
r7677 | |||
- author: String. The unmodified author of the changeset. | ||||
Martin Geisler
|
r9082 | - branches: String. The name of the branch on which the changeset was | ||
Martin Geisler
|
r9160 | committed. Will be empty if the branch name was default. | ||
Alexander Solovyov
|
r7677 | - date: Date information. The date when the changeset was committed. | ||
- desc: String. The text of the changeset description. | ||||
Martin Geisler
|
r9082 | - diffstat: String. Statistics of changes with the following format: | ||
Martin Geisler
|
r9160 | "modified files: +added/-removed lines" | ||
Martin Geisler
|
r9082 | - files: List of strings. All files modified, added, or removed by this | ||
Martin Geisler
|
r9160 | changeset. | ||
Alexander Solovyov
|
r7677 | - file_adds: List of strings. Files added by this changeset. | ||
Dirkjan Ochtman
|
r7678 | - file_mods: List of strings. Files modified by this changeset. | ||
Alexander Solovyov
|
r7677 | - file_dels: List of strings. Files removed by this changeset. | ||
Martin Geisler
|
r9082 | - node: String. The changeset identification hash, as a 40-character | ||
Martin Geisler
|
r9160 | hexadecimal string. | ||
Alexander Solovyov
|
r7677 | - parents: List of strings. The parents of the changeset. | ||
- rev: Integer. The repository-local changeset revision number. | ||||
- tags: List of strings. Any tags associated with the changeset. | ||||
Martin Geisler
|
r9082 | 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. You can also | ||||
use a chain of filters to get the desired output: | ||||
Alexander Solovyov
|
r7677 | |||
Dirkjan Ochtman
|
r7678 | $ hg tip --template "{date|isodate}\n" | ||
Alexander Solovyov
|
r7677 | 2008-08-21 18:22 +0000 | ||
List of filters: | ||||
Martin Geisler
|
r9082 | - addbreaks: Any text. Add an XHTML "<br />" tag before the end of every | ||
Martin Geisler
|
r9160 | line except the last. | ||
Martin Geisler
|
r9082 | - age: Date. Returns a human-readable date/time difference between the | ||
Martin Geisler
|
r9160 | given date/time and the current date/time. | ||
Martin Geisler
|
r9082 | - basename: Any text. Treats the text as a path, and returns the last | ||
Martin Geisler
|
r9160 | component of the path after splitting by the path separator (ignoring | ||
trailing separators). For example, "foo/bar/baz" becomes "baz" and | ||||
"foo/bar//" becomes "bar". | ||||
Martin Geisler
|
r8159 | - stripdir: Treat the text as path and strip a directory level, if | ||
Martin Geisler
|
r9160 | possible. For example, "foo" and "foo/bar" becomes "foo". | ||
Martin Geisler
|
r9082 | - date: Date. Returns a date in a Unix date format, including the | ||
Martin Geisler
|
r9160 | timezone: "Mon Sep 04 15:13:13 2006 0700". | ||
Martin Geisler
|
r9082 | - domain: Any text. Finds the first string that looks like an email | ||
Martin Geisler
|
r9160 | address, and extracts just the domain component. Example: 'User | ||
<user@example.com>' becomes 'example.com'. | ||||
Martin Geisler
|
r9082 | - email: Any text. Extracts the first string that looks like an email | ||
Martin Geisler
|
r9160 | address. Example: 'User <user@example.com>' becomes 'user@example.com'. | ||
Martin Geisler
|
r9082 | - escape: Any text. Replaces the special XML/XHTML characters "&", "<" and | ||
Martin Geisler
|
r9160 | ">" with XML entities. | ||
Dirkjan Ochtman
|
r7678 | - fill68: Any text. Wraps the text to fit in 68 columns. | ||
- fill76: Any text. Wraps the text to fit in 76 columns. | ||||
- firstline: Any text. Returns the first line of text. | ||||
Martin Geisler
|
r8237 | - nonempty: Any text. Returns '(none)' if the string is empty. | ||
Martin Geisler
|
r9082 | - hgdate: Date. Returns the date as a pair of numbers: "1157407993 25200" | ||
Martin Geisler
|
r9160 | (Unix timestamp, timezone offset). | ||
Dirkjan Ochtman
|
r7678 | - isodate: Date. Returns the date in ISO 8601 format. | ||
Henrik Stuart
|
r8591 | - localdate: Date. Converts a date to local date. | ||
Martin Geisler
|
r9082 | - obfuscate: Any text. Returns the input text rendered as a sequence of | ||
Martin Geisler
|
r9160 | XML entities. | ||
Dirkjan Ochtman
|
r7678 | - person: Any text. Returns the text before an email address. | ||
Martin Geisler
|
r9082 | - rfc822date: Date. Returns a date using the same format used in email | ||
Martin Geisler
|
r9160 | headers. | ||
Martin Geisler
|
r9082 | - short: Changeset hash. Returns the short form of a changeset hash, i.e. | ||
Martin Geisler
|
r9160 | a 12-byte hexadecimal string. | ||
Dirkjan Ochtman
|
r7806 | - shortdate: Date. Returns a date like "2006-09-18". | ||
Dirkjan Ochtman
|
r7678 | - strip: Any text. Strips all leading and trailing whitespace. | ||
Martin Geisler
|
r9082 | - tabindent: Any text. Returns the text, with every line except the first | ||
Martin Geisler
|
r9160 | starting with a tab character. | ||
Martin Geisler
|
r9082 | - urlescape: Any text. Escapes all "special" characters. For example, "foo | ||
Martin Geisler
|
r9160 | bar" becomes "foo%20bar". | ||
Dirkjan Ochtman
|
r7678 | - user: Any text. Returns the user portion of an email address. | ||
Alexander Solovyov
|
r7677 | ''')), | ||
Bill Barry
|
r7693 | |||
Martin Geisler
|
r7979 | (['urls'], _('URL Paths'), | ||
Bill Barry
|
r7693 | _(r''' | ||
Martin Geisler
|
r9157 | Valid URLs are of the form:: | ||
Bill Barry
|
r7693 | |||
David Wolever
|
r9023 | 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[:pass]@]host[:port]/[path][#revision] | ||||
Bill Barry
|
r7693 | |||
Martin Geisler
|
r9082 | Paths in the local filesystem can either point to Mercurial repositories | ||
or to bundle files (as created by 'hg bundle' or 'hg incoming --bundle'). | ||||
Bill Barry
|
r7693 | |||
Martin Geisler
|
r9082 | An optional identifier after # indicates a particular branch, tag, or | ||
changeset to use from the remote repository. See also 'hg help revisions'. | ||||
Bill Barry
|
r7693 | |||
Martin Geisler
|
r9082 | Some features, such as pushing to http:// and https:// URLs are only | ||
possible if the feature is explicitly enabled on the remote Mercurial | ||||
server. | ||||
Bill Barry
|
r7693 | |||
Some notes about using SSH with Mercurial: | ||||
Martin Geisler
|
r9157 | |||
Martin Geisler
|
r9082 | - SSH requires an accessible shell account on the destination machine and | ||
a copy of hg in the remote path or specified with as remotecmd. | ||||
- path is relative to the remote user's home directory by default. Use an | ||||
Martin Geisler
|
r9157 | extra slash at the start of a path to specify an absolute path:: | ||
Bill Barry
|
r7693 | ssh://example.com//tmp/repository | ||
Martin Geisler
|
r9157 | |||
Martin Geisler
|
r9082 | - Mercurial doesn't use its own compression via SSH; the right thing to do | ||
Martin Geisler
|
r9157 | is to configure it in your ~/.ssh/config, e.g.:: | ||
Bill Barry
|
r7693 | Host *.mylocalnetwork.example.com | ||
Compression no | ||||
Host * | ||||
Compression yes | ||||
Martin Geisler
|
r9157 | |||
Martin Geisler
|
r9082 | Alternatively specify "ssh -C" as your ssh command in your hgrc or with | ||
the --ssh command line option. | ||||
Bill Barry
|
r7693 | |||
Martin Geisler
|
r9082 | These URLs can all be stored in your hgrc with path aliases under the | ||
Martin Geisler
|
r9157 | [paths] section like so:: | ||
[paths] | ||||
alias1 = URL1 | ||||
alias2 = URL2 | ||||
... | ||||
Bill Barry
|
r7693 | |||
Martin Geisler
|
r9082 | You can then use the alias for any command that uses a URL (for example | ||
'hg pull alias1' would pull from the 'alias1' path). | ||||
Bill Barry
|
r7693 | |||
Martin Geisler
|
r9082 | Two path aliases are special because they are used as defaults when you do | ||
not provide the URL to a command: | ||||
Bill Barry
|
r7693 | |||
default: | ||||
Martin Geisler
|
r9082 | 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). | ||||
Bill Barry
|
r7693 | |||
default-push: | ||||
Martin Geisler
|
r9082 | The push command will look for a path named 'default-push', and prefer | ||
it over 'default' if both are defined. | ||||
Bill Barry
|
r7693 | ''')), | ||
Cédric Duval
|
r8879 | (["extensions"], _("Using additional features"), extshelp), | ||
Johannes Stezenbach
|
r6654 | ) | ||