##// END OF EJS Templates
help: add internals.extensions topic...
Yuya Nishihara -
r40631:419d7031 default
parent child Browse files
Show More
@@ -0,0 +1,321
1 Extensions allow the creation of new features and using them directly from
2 the main hg command line as if they were built-in commands. The extensions
3 have full access to the *internal* API.
4
5 Use of Mercurial's internal API very likely makes your code subject to
6 Mercurial's license. Before going any further, read the License page.
7
8 There are NO guarantees that third-party code calling into Mercurial's
9 internals won't break from release to release. If you do use Mercurial's API
10 for published third-party code, we expect you to test your code before each
11 major Mercurial release. This will prevent various bug reports from your users
12 when they upgrade their copy of Mercurial.
13
14 File Layout
15 ===========
16
17 Extensions are usually written as simple python modules. Larger ones are
18 better split into multiple modules of a single package (see the convert
19 extension). The package root module gives its name to the extension and
20 implements the ``cmdtable`` and optional callbacks described below.
21
22 Command table
23 =============
24
25 To write your own extension, your python module can provide an optional dict
26 named ``cmdtable`` with entries describing each command. A command should be
27 registered to the ``cmdtable`` by ``@command`` decorator.
28
29 Example using ``@command`` decorator (requires Mercurial 1.9)::
30
31 from mercurial import cmdutil
32 from mercurial.i18n import _
33
34 cmdtable = {}
35 command = cmdutil.command(cmdtable)
36
37 @command('print-parents',
38 [('s', 'short', None, _('print short form')),
39 ('l', 'long', None, _('print long form'))],
40 _('[options] node'))
41 def printparents(ui, repo, node, **opts):
42 ...
43
44 The cmdtable dictionary
45 -----------------------
46
47 The ``cmdtable`` dictionary uses as key the new command names, and, as value,
48 a tuple containing:
49
50 1. the function to be called when the command is used.
51 2. a list of options the command can take.
52 3. a command line synopsis for the command (the function docstring is used for
53 the full help).
54
55 List of options
56 ---------------
57
58 All the command flag options are documented in the mercurial/fancyopts.py
59 sources.
60
61 The options list is a list of tuples containing:
62
63 1. the short option letter, or ``''`` if no short option is available
64 (for example, ``o`` for a ``-o`` option).
65 2. the long option name (for example, ``option`` for a ``--option`` option).
66 3. a default value for the option.
67 4. a help string for the option (it's possible to omit the "hg newcommand"
68 part and only the options and parameter substring is needed).
69
70 Command function signatures
71 ---------------------------
72
73 Functions that implement new commands always receive a ``ui`` and usually
74 a ``repo`` parameter. The rest of parameters are taken from the command line
75 items that don't start with a dash and are passed in the same order they were
76 written. If no default value is given in the parameter list they are required.
77
78 If there is no repo to be associated with the command and consequently no
79 ``repo`` passed, then ``norepo=True`` should be passed to the ``@command``
80 decorator::
81
82 @command('mycommand', [], norepo=True)
83 def mycommand(ui, **opts):
84 ...
85
86 For examples of ``norepo``, see the convert extension.
87
88 Command function docstrings
89 ===========================
90
91 The docstring of your function is used as the main help text, shown by
92 ``hg help mycommand``. The docstring should be formatted using a simple
93 subset of reStructuredText markup. The supported constructs include:
94
95 Paragraphs::
96
97 This is a paragraph.
98
99 Paragraphs are separated
100 by blank lines.
101
102 A verbatim block is introduced with a double colon followed by an indented
103 block. The double colon is turned into a single colon on display::
104
105 Some text::
106
107 verbatim
108 text
109 !!
110
111 We have field lists::
112
113 :key1: value1
114 :key2: value2
115
116 Bullet lists::
117
118 - foo
119 - bar
120
121 Enumerated lists::
122
123 1. foo
124 2. bar
125
126 Inline markup::
127
128 ``*bold*``, ``monospace``, :hg:`command`
129
130 Mark Mercurial commands with ``:hg:`` to make a nice link to the corresponding
131 documentation. We'll expand the support if new constructs can be parsed
132 without too much trouble.
133
134 Communicating with the user
135 ===========================
136
137 Besides the ``ui`` methods, like ``ui.write(*msg)`` or
138 ``ui.prompt(msg, default="y")``, an extension can add help text for each
139 of its commands and the extension itself.
140
141 The module docstring will be used as help string when ``hg help extensionname``
142 is used and, similarly, the help string for a command and the docstring
143 belonging to the function that's wrapped by the command will be shown when
144 ``hg help command`` is invoked.
145
146 Setup Callbacks
147 ===============
148
149 Extensions are loaded in phases. All extensions are processed in a given phase
150 before the next phase begins. In the first phase, all extension modules are
151 loaded and registered with Mercurial. This means that you can find all enabled
152 extensions with ``extensions.find`` in the following phases.
153
154 ui setup
155 --------
156
157 Extensions can implement an optional callback named ``uisetup``. ``uisetup``
158 is called when the extension is first loaded and receives a ui object::
159
160 def uisetup(ui):
161 # ...
162
163 Extension setup
164 ---------------
165
166 Extensions can implement an optional callback named ``extsetup``. It is
167 called after all the extension are loaded, and can be useful in case one
168 extension optionally depends on another extension. Signature::
169
170 def extsetup():
171 # ...
172
173 Mercurial version 8e6019b16a7d and later (that is post-1.3.1) will pass
174 a ``ui``` argument to ``extsetup``::
175
176 def extsetup(ui):
177 # ...
178
179 Command table setup
180 -------------------
181
182 After ``extsetup``, the ``cmdtable`` is copied into the global command table
183 in Mercurial.
184
185 Repository setup
186 ----------------
187
188 Extensions can implement an optional callback named ``reposetup``. It is
189 called after the main Mercurial repository initialization, and can be used
190 to setup any local state the extension might need.
191
192 As other command functions it receives an ``ui`` object and a ``repo`` object
193 (no additional parameters for this, though)::
194
195 def reposetup(ui, repo):
196 #do initialization here.
197
198 It is important to take into account that the ``ui`` object that is received
199 by the ``reposetup`` function is not the same as the one received by the
200 ``uisetup`` and ``extsetup`` functions. This is particularly important when
201 setting up hooks as described in the following section, since not all hooks
202 use the same ``ui`` object and hence different hooks must be configured in
203 different setup functions.
204
205 Wrapping methods on the ui and repo classes
206 -------------------------------------------
207
208 Because extensions can be loaded *per repository*, you should avoid using
209 ``extensions.wrapfunction()`` on methods of the ``ui`` and ``repo`` objects.
210 Instead, create a subclass of the specific class of the instance passed into
211 the ``*setup()`` hook; e.g. use ``ui.__class__`` as the base class, then
212 reassign your new class to ``ui.__class__`` again. Mercurial will then use
213 your updated ``ui`` or ``repo`` instance only for repositories where your
214 extension is enabled (or copies thereof, reusing your new class).
215
216 For example::
217
218 def uisetup(ui):
219 class echologui(ui.__class__):
220 def log(self, service, *msg, **opts):
221 if msg:
222 self.write('%s: %s\n' % (service, msg[0] % msg[1:]))
223 super(echologui, self).log(service, *msg, **opts)
224
225 ui.__class__ = echologui
226
227 Configuring Hooks
228 =================
229
230 Some extensions must use hooks to do their work. These required hooks can
231 be configured manually by the user by modifying the ``[hook]`` section of
232 their hgrc, but they can also be configured automatically by calling the
233 ``ui.setconfig('hooks', ...)`` function in one of the setup functions
234 described above.
235
236 The main difference between manually modifying the hooks section in the hgrc
237 and using ``ui.setconfig()`` is that when using ``ui.setconfig()`` you have
238 access to the actual hook function object, which you can pass directly to
239 ``ui.setconfig()``, while when you use the hooks section of the hgrc file
240 you must refer to the hook function by using the
241 ``python:modulename.functioname`` idiom (e.g. ``python:hgext.notify.hook``).
242
243 For example::
244
245 # Define hooks -- note that the actual function name it irrelevant.
246 def preupdatehook(ui, repo, **kwargs):
247 ui.write("Pre-update hook triggered\n")
248
249 def updatehook(ui, repo, **kwargs):
250 ui.write("Update hook triggered\n")
251
252 def uisetup(ui):
253 # When pre-<cmd> and post-<cmd> hooks are configured by means of
254 # the ui.setconfig() function, you must use the ui object passed
255 # to uisetup or extsetup.
256 ui.setconfig("hooks", "pre-update.myextension", preupdatehook)
257
258 def reposetup(ui, repo):
259 # Repository-specific hooks can be configured here. These include
260 # the update hook.
261 ui.setconfig("hooks", "update.myextension", updatehook)
262
263 Note how different hooks may need to be configured in different setup
264 functions. In the example you can see that the ``update`` hook must be
265 configured in the ``reposetup`` function, while the ``pre-update`` hook
266 must be configured on the ``uisetup`` or the ``extsetup`` functions.
267
268 Marking compatible versions
269 ===========================
270
271 Every extension should use the ``testedwith`` variable to specify Mercurial
272 releases it's known to be compatible with. This helps us and users diagnose
273 where problems are coming from::
274
275 testedwith = '2.0 2.0.1 2.1 2.1.1 2.1.2'
276
277 Do not use the ``internal`` marker in third-party extensions; we will
278 immediately drop all bug reports mentioning your extension if we catch you
279 doing this.
280
281 Similarly, an extension can use the ``buglink`` variable to specify how users
282 should report issues with the extension. This link will be included in the
283 error message if the extension produces errors::
284
285 buglink = 'https://bitbucket.org/USER/REPO/issues'
286
287 Wrap up: what belongs where?
288 ============================
289
290 You will find here a list of most common tasks, based on setups from the
291 extensions included in Mercurial core.
292
293 uisetup
294 -------
295
296 * Changes to ``ui.__class__`` . The ``ui`` object that will be used to run
297 the command has not yet been created. Changes made here will affect ``ui``
298 objects created after this, and in particular the ``ui`` that will be passed
299 to ``runcommand``
300 * Command wraps (``extensions.wrapcommand``)
301 * Changes that need to be visible by other extensions: because initialization
302 occurs in phases (all extensions run ``uisetup``, then all run ``extsetup``),
303 a change made here will be visible by other extensions during ``extsetup``.
304 * Monkeypatches or function wraps (``extensions.wrapfunction``) of ``dispatch``
305 module members
306 * Setup of ``pre-*`` and ``post-*`` hooks
307 * ``pushkey`` setup
308
309 extsetup
310 --------
311
312 * Changes depending on the status of other extensions. (``if extensions.find('mq')``)
313 * Add a global option to all commands
314 * Extend revsets
315
316 reposetup
317 ---------
318
319 * All hooks but ``pre-*`` and ``post-*``
320 * Modify configuration variables
321 * Changes to ``repo.__class__``, ``repo.dirstate.__class__``
@@ -1,63 +1,64
1 1 <?xml version="1.0" encoding="utf-8"?>
2 2 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3 3
4 4 <?include guids.wxi ?>
5 5 <?include defines.wxi ?>
6 6
7 7 <Fragment>
8 8 <ComponentGroup Id='helpFolder'>
9 9 <ComponentRef Id='help.root' />
10 10 <ComponentRef Id='help.internals' />
11 11 </ComponentGroup>
12 12 </Fragment>
13 13
14 14 <Fragment>
15 15 <DirectoryRef Id="INSTALLDIR">
16 16 <Directory Id="helpdir" Name="help" FileSource="$(var.SourceDir)">
17 17 <Component Id="help.root" Guid="$(var.help.root.guid)" Win64='$(var.IsX64)'>
18 18 <File Name="bundlespec.txt" />
19 19 <File Name="color.txt" />
20 20 <File Name="config.txt" KeyPath="yes" />
21 21 <File Name="dates.txt" />
22 22 <File Name="deprecated.txt" />
23 23 <File Name="diffs.txt" />
24 24 <File Name="environment.txt" />
25 25 <File Name="extensions.txt" />
26 26 <File Name="filesets.txt" />
27 27 <File Name="flags.txt" />
28 28 <File Name="glossary.txt" />
29 29 <File Name="hgignore.txt" />
30 30 <File Name="hgweb.txt" />
31 31 <File Name="merge-tools.txt" />
32 32 <File Name="pager.txt" />
33 33 <File Name="patterns.txt" />
34 34 <File Name="phases.txt" />
35 35 <File Name="revisions.txt" />
36 36 <File Name="scripting.txt" />
37 37 <File Name="subrepos.txt" />
38 38 <File Name="templates.txt" />
39 39 <File Name="urls.txt" />
40 40 </Component>
41 41
42 42 <Directory Id="help.internaldir" Name="internals">
43 43 <Component Id="help.internals" Guid="$(var.help.internals.guid)" Win64='$(var.IsX64)'>
44 44 <File Id="internals.bundle2.txt" Name="bundle2.txt" />
45 45 <File Id="internals.bundles.txt" Name="bundles.txt" KeyPath="yes" />
46 46 <File Id="internals.cbor.txt" Name="cbor.txt" />
47 47 <File Id="internals.censor.txt" Name="censor.txt" />
48 48 <File Id="internals.changegroups.txt" Name="changegroups.txt" />
49 49 <File Id="internals.config.txt" Name="config.txt" />
50 <File Id="internals.extensions.txt" Name="extensions.txt" />
50 51 <File Id="internals.linelog.txt" Name="linelog.txt" />
51 52 <File Id="internals.requirements.txt" Name="requirements.txt" />
52 53 <File Id="internals.revlogs.txt" Name="revlogs.txt" />
53 54 <File Id="internals.wireprotocol.txt" Name="wireprotocol.txt" />
54 55 <File Id="internals.wireprotocolrpc.txt" Name="wireprotocolrpc.txt" />
55 56 <File Id="internals.wireprotocolv2.txt" Name="wireprotocolv2.txt" />
56 57 </Component>
57 58 </Directory>
58 59
59 60 </Directory>
60 61 </DirectoryRef>
61 62 </Fragment>
62 63
63 64 </Wix>
@@ -1,859 +1,861
1 1 # help.py - help data for mercurial
2 2 #
3 3 # Copyright 2006 Matt Mackall <mpm@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 from __future__ import absolute_import
9 9
10 10 import itertools
11 11 import os
12 12 import re
13 13 import textwrap
14 14
15 15 from .i18n import (
16 16 _,
17 17 gettext,
18 18 )
19 19 from . import (
20 20 cmdutil,
21 21 encoding,
22 22 error,
23 23 extensions,
24 24 fancyopts,
25 25 filemerge,
26 26 fileset,
27 27 minirst,
28 28 pycompat,
29 29 registrar,
30 30 revset,
31 31 templatefilters,
32 32 templatefuncs,
33 33 templatekw,
34 34 ui as uimod,
35 35 util,
36 36 )
37 37 from .hgweb import (
38 38 webcommands,
39 39 )
40 40
41 41 _exclkeywords = {
42 42 "(ADVANCED)",
43 43 "(DEPRECATED)",
44 44 "(EXPERIMENTAL)",
45 45 # i18n: "(ADVANCED)" is a keyword, must be translated consistently
46 46 _("(ADVANCED)"),
47 47 # i18n: "(DEPRECATED)" is a keyword, must be translated consistently
48 48 _("(DEPRECATED)"),
49 49 # i18n: "(EXPERIMENTAL)" is a keyword, must be translated consistently
50 50 _("(EXPERIMENTAL)"),
51 51 }
52 52
53 53 # The order in which command categories will be displayed.
54 54 # Extensions with custom categories should insert them into this list
55 55 # after/before the appropriate item, rather than replacing the list or
56 56 # assuming absolute positions.
57 57 CATEGORY_ORDER = [
58 58 registrar.command.CATEGORY_REPO_CREATION,
59 59 registrar.command.CATEGORY_REMOTE_REPO_MANAGEMENT,
60 60 registrar.command.CATEGORY_COMMITTING,
61 61 registrar.command.CATEGORY_CHANGE_MANAGEMENT,
62 62 registrar.command.CATEGORY_CHANGE_ORGANIZATION,
63 63 registrar.command.CATEGORY_FILE_CONTENTS,
64 64 registrar.command.CATEGORY_CHANGE_NAVIGATION ,
65 65 registrar.command.CATEGORY_WORKING_DIRECTORY,
66 66 registrar.command.CATEGORY_IMPORT_EXPORT,
67 67 registrar.command.CATEGORY_MAINTENANCE,
68 68 registrar.command.CATEGORY_HELP,
69 69 registrar.command.CATEGORY_MISC,
70 70 registrar.command.CATEGORY_NONE,
71 71 ]
72 72
73 73 # Human-readable category names. These are translated.
74 74 # Extensions with custom categories should add their names here.
75 75 CATEGORY_NAMES = {
76 76 registrar.command.CATEGORY_REPO_CREATION: 'Repository creation',
77 77 registrar.command.CATEGORY_REMOTE_REPO_MANAGEMENT:
78 78 'Remote repository management',
79 79 registrar.command.CATEGORY_COMMITTING: 'Change creation',
80 80 registrar.command.CATEGORY_CHANGE_NAVIGATION: 'Change navigation',
81 81 registrar.command.CATEGORY_CHANGE_MANAGEMENT: 'Change manipulation',
82 82 registrar.command.CATEGORY_CHANGE_ORGANIZATION: 'Change organization',
83 83 registrar.command.CATEGORY_WORKING_DIRECTORY:
84 84 'Working directory management',
85 85 registrar.command.CATEGORY_FILE_CONTENTS: 'File content management',
86 86 registrar.command.CATEGORY_IMPORT_EXPORT: 'Change import/export',
87 87 registrar.command.CATEGORY_MAINTENANCE: 'Repository maintenance',
88 88 registrar.command.CATEGORY_HELP: 'Help',
89 89 registrar.command.CATEGORY_MISC: 'Miscellaneous commands',
90 90 registrar.command.CATEGORY_NONE: 'Uncategorized commands',
91 91 }
92 92
93 93 # Topic categories.
94 94 TOPIC_CATEGORY_IDS = 'ids'
95 95 TOPIC_CATEGORY_OUTPUT = 'output'
96 96 TOPIC_CATEGORY_CONFIG = 'config'
97 97 TOPIC_CATEGORY_CONCEPTS = 'concepts'
98 98 TOPIC_CATEGORY_MISC = 'misc'
99 99 TOPIC_CATEGORY_NONE = 'none'
100 100
101 101 # The order in which topic categories will be displayed.
102 102 # Extensions with custom categories should insert them into this list
103 103 # after/before the appropriate item, rather than replacing the list or
104 104 # assuming absolute positions.
105 105 TOPIC_CATEGORY_ORDER = [
106 106 TOPIC_CATEGORY_IDS,
107 107 TOPIC_CATEGORY_OUTPUT,
108 108 TOPIC_CATEGORY_CONFIG,
109 109 TOPIC_CATEGORY_CONCEPTS,
110 110 TOPIC_CATEGORY_MISC,
111 111 TOPIC_CATEGORY_NONE,
112 112 ]
113 113
114 114 # Human-readable topic category names. These are translated.
115 115 TOPIC_CATEGORY_NAMES = {
116 116 TOPIC_CATEGORY_IDS: 'Mercurial identifiers',
117 117 TOPIC_CATEGORY_OUTPUT: 'Mercurial output',
118 118 TOPIC_CATEGORY_CONFIG: 'Mercurial configuration',
119 119 TOPIC_CATEGORY_CONCEPTS: 'Concepts',
120 120 TOPIC_CATEGORY_MISC: 'Miscellaneous',
121 121 TOPIC_CATEGORY_NONE: 'Uncategorized topics',
122 122 TOPIC_CATEGORY_NONE: 'Uncategorized topics',
123 123 }
124 124
125 125 def listexts(header, exts, indent=1, showdeprecated=False):
126 126 '''return a text listing of the given extensions'''
127 127 rst = []
128 128 if exts:
129 129 for name, desc in sorted(exts.iteritems()):
130 130 if not showdeprecated and any(w in desc for w in _exclkeywords):
131 131 continue
132 132 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
133 133 if rst:
134 134 rst.insert(0, '\n%s\n\n' % header)
135 135 return rst
136 136
137 137 def extshelp(ui):
138 138 rst = loaddoc('extensions')(ui).splitlines(True)
139 139 rst.extend(listexts(
140 140 _('enabled extensions:'), extensions.enabled(), showdeprecated=True))
141 141 rst.extend(listexts(_('disabled extensions:'), extensions.disabled(),
142 142 showdeprecated=ui.verbose))
143 143 doc = ''.join(rst)
144 144 return doc
145 145
146 146 def optrst(header, options, verbose):
147 147 data = []
148 148 multioccur = False
149 149 for option in options:
150 150 if len(option) == 5:
151 151 shortopt, longopt, default, desc, optlabel = option
152 152 else:
153 153 shortopt, longopt, default, desc = option
154 154 optlabel = _("VALUE") # default label
155 155
156 156 if not verbose and any(w in desc for w in _exclkeywords):
157 157 continue
158 158
159 159 so = ''
160 160 if shortopt:
161 161 so = '-' + shortopt
162 162 lo = '--' + longopt
163 163
164 164 if isinstance(default, fancyopts.customopt):
165 165 default = default.getdefaultvalue()
166 166 if default and not callable(default):
167 167 # default is of unknown type, and in Python 2 we abused
168 168 # the %s-shows-repr property to handle integers etc. To
169 169 # match that behavior on Python 3, we do str(default) and
170 170 # then convert it to bytes.
171 171 desc += _(" (default: %s)") % pycompat.bytestr(default)
172 172
173 173 if isinstance(default, list):
174 174 lo += " %s [+]" % optlabel
175 175 multioccur = True
176 176 elif (default is not None) and not isinstance(default, bool):
177 177 lo += " %s" % optlabel
178 178
179 179 data.append((so, lo, desc))
180 180
181 181 if multioccur:
182 182 header += (_(" ([+] can be repeated)"))
183 183
184 184 rst = ['\n%s:\n\n' % header]
185 185 rst.extend(minirst.maketable(data, 1))
186 186
187 187 return ''.join(rst)
188 188
189 189 def indicateomitted(rst, omitted, notomitted=None):
190 190 rst.append('\n\n.. container:: omitted\n\n %s\n\n' % omitted)
191 191 if notomitted:
192 192 rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted)
193 193
194 194 def filtercmd(ui, cmd, func, kw, doc):
195 195 if not ui.debugflag and cmd.startswith("debug") and kw != "debug":
196 196 # Debug command, and user is not looking for those.
197 197 return True
198 198 if not ui.verbose:
199 199 if not kw and not doc:
200 200 # Command had no documentation, no point in showing it by default.
201 201 return True
202 202 if getattr(func, 'alias', False) and not getattr(func, 'owndoc', False):
203 203 # Alias didn't have its own documentation.
204 204 return True
205 205 if doc and any(w in doc for w in _exclkeywords):
206 206 # Documentation has excluded keywords.
207 207 return True
208 208 if kw == "shortlist" and not getattr(func, 'helpbasic', False):
209 209 # We're presenting the short list but the command is not basic.
210 210 return True
211 211 if ui.configbool('help', 'hidden-command.%s' % cmd):
212 212 # Configuration explicitly hides the command.
213 213 return True
214 214 return False
215 215
216 216 def filtertopic(ui, topic):
217 217 return ui.configbool('help', 'hidden-topic.%s' % topic, False)
218 218
219 219 def topicmatch(ui, commands, kw):
220 220 """Return help topics matching kw.
221 221
222 222 Returns {'section': [(name, summary), ...], ...} where section is
223 223 one of topics, commands, extensions, or extensioncommands.
224 224 """
225 225 kw = encoding.lower(kw)
226 226 def lowercontains(container):
227 227 return kw in encoding.lower(container) # translated in helptable
228 228 results = {'topics': [],
229 229 'commands': [],
230 230 'extensions': [],
231 231 'extensioncommands': [],
232 232 }
233 233 for topic in helptable:
234 234 names, header, doc = topic[0:3]
235 235 # Old extensions may use a str as doc.
236 236 if (sum(map(lowercontains, names))
237 237 or lowercontains(header)
238 238 or (callable(doc) and lowercontains(doc(ui)))):
239 239 name = names[0]
240 240 if not filtertopic(ui, name):
241 241 results['topics'].append((names[0], header))
242 242 for cmd, entry in commands.table.iteritems():
243 243 if len(entry) == 3:
244 244 summary = entry[2]
245 245 else:
246 246 summary = ''
247 247 # translate docs *before* searching there
248 248 func = entry[0]
249 249 docs = _(pycompat.getdoc(func)) or ''
250 250 if kw in cmd or lowercontains(summary) or lowercontains(docs):
251 251 doclines = docs.splitlines()
252 252 if doclines:
253 253 summary = doclines[0]
254 254 cmdname = cmdutil.parsealiases(cmd)[0]
255 255 if filtercmd(ui, cmdname, func, kw, docs):
256 256 continue
257 257 results['commands'].append((cmdname, summary))
258 258 for name, docs in itertools.chain(
259 259 extensions.enabled(False).iteritems(),
260 260 extensions.disabled().iteritems()):
261 261 if not docs:
262 262 continue
263 263 name = name.rpartition('.')[-1]
264 264 if lowercontains(name) or lowercontains(docs):
265 265 # extension docs are already translated
266 266 results['extensions'].append((name, docs.splitlines()[0]))
267 267 try:
268 268 mod = extensions.load(ui, name, '')
269 269 except ImportError:
270 270 # debug message would be printed in extensions.load()
271 271 continue
272 272 for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems():
273 273 if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])):
274 274 cmdname = cmdutil.parsealiases(cmd)[0]
275 275 func = entry[0]
276 276 cmddoc = pycompat.getdoc(func)
277 277 if cmddoc:
278 278 cmddoc = gettext(cmddoc).splitlines()[0]
279 279 else:
280 280 cmddoc = _('(no help text available)')
281 281 if filtercmd(ui, cmdname, func, kw, cmddoc):
282 282 continue
283 283 results['extensioncommands'].append((cmdname, cmddoc))
284 284 return results
285 285
286 286 def loaddoc(topic, subdir=None):
287 287 """Return a delayed loader for help/topic.txt."""
288 288
289 289 def loader(ui):
290 290 docdir = os.path.join(util.datapath, 'help')
291 291 if subdir:
292 292 docdir = os.path.join(docdir, subdir)
293 293 path = os.path.join(docdir, topic + ".txt")
294 294 doc = gettext(util.readfile(path))
295 295 for rewriter in helphooks.get(topic, []):
296 296 doc = rewriter(ui, topic, doc)
297 297 return doc
298 298
299 299 return loader
300 300
301 301 internalstable = sorted([
302 302 (['bundle2'], _('Bundle2'),
303 303 loaddoc('bundle2', subdir='internals')),
304 304 (['bundles'], _('Bundles'),
305 305 loaddoc('bundles', subdir='internals')),
306 306 (['cbor'], _('CBOR'),
307 307 loaddoc('cbor', subdir='internals')),
308 308 (['censor'], _('Censor'),
309 309 loaddoc('censor', subdir='internals')),
310 310 (['changegroups'], _('Changegroups'),
311 311 loaddoc('changegroups', subdir='internals')),
312 312 (['config'], _('Config Registrar'),
313 313 loaddoc('config', subdir='internals')),
314 (['extensions', 'extension'], _('Extension API'),
315 loaddoc('extensions', subdir='internals')),
314 316 (['requirements'], _('Repository Requirements'),
315 317 loaddoc('requirements', subdir='internals')),
316 318 (['revlogs'], _('Revision Logs'),
317 319 loaddoc('revlogs', subdir='internals')),
318 320 (['wireprotocol'], _('Wire Protocol'),
319 321 loaddoc('wireprotocol', subdir='internals')),
320 322 (['wireprotocolrpc'], _('Wire Protocol RPC'),
321 323 loaddoc('wireprotocolrpc', subdir='internals')),
322 324 (['wireprotocolv2'], _('Wire Protocol Version 2'),
323 325 loaddoc('wireprotocolv2', subdir='internals')),
324 326 ])
325 327
326 328 def internalshelp(ui):
327 329 """Generate the index for the "internals" topic."""
328 330 lines = ['To access a subtopic, use "hg help internals.{subtopic-name}"\n',
329 331 '\n']
330 332 for names, header, doc in internalstable:
331 333 lines.append(' :%s: %s\n' % (names[0], header))
332 334
333 335 return ''.join(lines)
334 336
335 337 helptable = sorted([
336 338 (['bundlespec'], _("Bundle File Formats"), loaddoc('bundlespec'),
337 339 TOPIC_CATEGORY_CONCEPTS),
338 340 (['color'], _("Colorizing Outputs"), loaddoc('color'),
339 341 TOPIC_CATEGORY_OUTPUT),
340 342 (["config", "hgrc"], _("Configuration Files"), loaddoc('config'),
341 343 TOPIC_CATEGORY_CONFIG),
342 344 (['deprecated'], _("Deprecated Features"), loaddoc('deprecated'),
343 345 TOPIC_CATEGORY_MISC),
344 346 (["dates"], _("Date Formats"), loaddoc('dates'), TOPIC_CATEGORY_OUTPUT),
345 347 (["flags"], _("Command-line flags"), loaddoc('flags'),
346 348 TOPIC_CATEGORY_CONFIG),
347 349 (["patterns"], _("File Name Patterns"), loaddoc('patterns'),
348 350 TOPIC_CATEGORY_IDS),
349 351 (['environment', 'env'], _('Environment Variables'),
350 352 loaddoc('environment'), TOPIC_CATEGORY_CONFIG),
351 353 (['revisions', 'revs', 'revsets', 'revset', 'multirevs', 'mrevs'],
352 354 _('Specifying Revisions'), loaddoc('revisions'), TOPIC_CATEGORY_IDS),
353 355 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets'),
354 356 TOPIC_CATEGORY_IDS),
355 357 (['diffs'], _('Diff Formats'), loaddoc('diffs'), TOPIC_CATEGORY_OUTPUT),
356 358 (['merge-tools', 'mergetools', 'mergetool'], _('Merge Tools'),
357 359 loaddoc('merge-tools'), TOPIC_CATEGORY_CONFIG),
358 360 (['templating', 'templates', 'template', 'style'], _('Template Usage'),
359 361 loaddoc('templates'), TOPIC_CATEGORY_OUTPUT),
360 362 (['urls'], _('URL Paths'), loaddoc('urls'), TOPIC_CATEGORY_IDS),
361 363 (["extensions"], _("Using Additional Features"), extshelp,
362 364 TOPIC_CATEGORY_CONFIG),
363 365 (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos'),
364 366 TOPIC_CATEGORY_CONCEPTS),
365 367 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb'),
366 368 TOPIC_CATEGORY_CONFIG),
367 369 (["glossary"], _("Glossary"), loaddoc('glossary'), TOPIC_CATEGORY_CONCEPTS),
368 370 (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"),
369 371 loaddoc('hgignore'), TOPIC_CATEGORY_IDS),
370 372 (["phases"], _("Working with Phases"), loaddoc('phases'),
371 373 TOPIC_CATEGORY_CONCEPTS),
372 374 (['scripting'], _('Using Mercurial from scripts and automation'),
373 375 loaddoc('scripting'), TOPIC_CATEGORY_MISC),
374 376 (['internals'], _("Technical implementation topics"), internalshelp,
375 377 TOPIC_CATEGORY_MISC),
376 378 (['pager'], _("Pager Support"), loaddoc('pager'), TOPIC_CATEGORY_CONFIG),
377 379 ])
378 380
379 381 # Maps topics with sub-topics to a list of their sub-topics.
380 382 subtopics = {
381 383 'internals': internalstable,
382 384 }
383 385
384 386 # Map topics to lists of callable taking the current topic help and
385 387 # returning the updated version
386 388 helphooks = {}
387 389
388 390 def addtopichook(topic, rewriter):
389 391 helphooks.setdefault(topic, []).append(rewriter)
390 392
391 393 def makeitemsdoc(ui, topic, doc, marker, items, dedent=False):
392 394 """Extract docstring from the items key to function mapping, build a
393 395 single documentation block and use it to overwrite the marker in doc.
394 396 """
395 397 entries = []
396 398 for name in sorted(items):
397 399 text = (pycompat.getdoc(items[name]) or '').rstrip()
398 400 if (not text
399 401 or not ui.verbose and any(w in text for w in _exclkeywords)):
400 402 continue
401 403 text = gettext(text)
402 404 if dedent:
403 405 # Abuse latin1 to use textwrap.dedent() on bytes.
404 406 text = textwrap.dedent(text.decode('latin1')).encode('latin1')
405 407 lines = text.splitlines()
406 408 doclines = [(lines[0])]
407 409 for l in lines[1:]:
408 410 # Stop once we find some Python doctest
409 411 if l.strip().startswith('>>>'):
410 412 break
411 413 if dedent:
412 414 doclines.append(l.rstrip())
413 415 else:
414 416 doclines.append(' ' + l.strip())
415 417 entries.append('\n'.join(doclines))
416 418 entries = '\n\n'.join(entries)
417 419 return doc.replace(marker, entries)
418 420
419 421 def addtopicsymbols(topic, marker, symbols, dedent=False):
420 422 def add(ui, topic, doc):
421 423 return makeitemsdoc(ui, topic, doc, marker, symbols, dedent=dedent)
422 424 addtopichook(topic, add)
423 425
424 426 addtopicsymbols('bundlespec', '.. bundlecompressionmarker',
425 427 util.bundlecompressiontopics())
426 428 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
427 429 addtopicsymbols('merge-tools', '.. internaltoolsmarker',
428 430 filemerge.internalsdoc)
429 431 addtopicsymbols('revisions', '.. predicatesmarker', revset.symbols)
430 432 addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords)
431 433 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
432 434 addtopicsymbols('templates', '.. functionsmarker', templatefuncs.funcs)
433 435 addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands,
434 436 dedent=True)
435 437
436 438 def inserttweakrc(ui, topic, doc):
437 439 marker = '.. tweakdefaultsmarker'
438 440 repl = uimod.tweakrc
439 441 def sub(m):
440 442 lines = [m.group(1) + s for s in repl.splitlines()]
441 443 return '\n'.join(lines)
442 444 return re.sub(br'( *)%s' % re.escape(marker), sub, doc)
443 445
444 446 addtopichook('config', inserttweakrc)
445 447
446 448 def help_(ui, commands, name, unknowncmd=False, full=True, subtopic=None,
447 449 **opts):
448 450 '''
449 451 Generate the help for 'name' as unformatted restructured text. If
450 452 'name' is None, describe the commands available.
451 453 '''
452 454
453 455 opts = pycompat.byteskwargs(opts)
454 456
455 457 def helpcmd(name, subtopic=None):
456 458 try:
457 459 aliases, entry = cmdutil.findcmd(name, commands.table,
458 460 strict=unknowncmd)
459 461 except error.AmbiguousCommand as inst:
460 462 # py3 fix: except vars can't be used outside the scope of the
461 463 # except block, nor can be used inside a lambda. python issue4617
462 464 prefix = inst.args[0]
463 465 select = lambda c: cmdutil.parsealiases(c)[0].startswith(prefix)
464 466 rst = helplist(select)
465 467 return rst
466 468
467 469 rst = []
468 470
469 471 # check if it's an invalid alias and display its error if it is
470 472 if getattr(entry[0], 'badalias', None):
471 473 rst.append(entry[0].badalias + '\n')
472 474 if entry[0].unknowncmd:
473 475 try:
474 476 rst.extend(helpextcmd(entry[0].cmdname))
475 477 except error.UnknownCommand:
476 478 pass
477 479 return rst
478 480
479 481 # synopsis
480 482 if len(entry) > 2:
481 483 if entry[2].startswith('hg'):
482 484 rst.append("%s\n" % entry[2])
483 485 else:
484 486 rst.append('hg %s %s\n' % (aliases[0], entry[2]))
485 487 else:
486 488 rst.append('hg %s\n' % aliases[0])
487 489 # aliases
488 490 if full and not ui.quiet and len(aliases) > 1:
489 491 rst.append(_("\naliases: %s\n") % ', '.join(aliases[1:]))
490 492 rst.append('\n')
491 493
492 494 # description
493 495 doc = gettext(pycompat.getdoc(entry[0]))
494 496 if not doc:
495 497 doc = _("(no help text available)")
496 498 if util.safehasattr(entry[0], 'definition'): # aliased command
497 499 source = entry[0].source
498 500 if entry[0].definition.startswith('!'): # shell alias
499 501 doc = (_('shell alias for: %s\n\n%s\n\ndefined by: %s\n') %
500 502 (entry[0].definition[1:], doc, source))
501 503 else:
502 504 doc = (_('alias for: hg %s\n\n%s\n\ndefined by: %s\n') %
503 505 (entry[0].definition, doc, source))
504 506 doc = doc.splitlines(True)
505 507 if ui.quiet or not full:
506 508 rst.append(doc[0])
507 509 else:
508 510 rst.extend(doc)
509 511 rst.append('\n')
510 512
511 513 # check if this command shadows a non-trivial (multi-line)
512 514 # extension help text
513 515 try:
514 516 mod = extensions.find(name)
515 517 doc = gettext(pycompat.getdoc(mod)) or ''
516 518 if '\n' in doc.strip():
517 519 msg = _("(use 'hg help -e %s' to show help for "
518 520 "the %s extension)") % (name, name)
519 521 rst.append('\n%s\n' % msg)
520 522 except KeyError:
521 523 pass
522 524
523 525 # options
524 526 if not ui.quiet and entry[1]:
525 527 rst.append(optrst(_("options"), entry[1], ui.verbose))
526 528
527 529 if ui.verbose:
528 530 rst.append(optrst(_("global options"),
529 531 commands.globalopts, ui.verbose))
530 532
531 533 if not ui.verbose:
532 534 if not full:
533 535 rst.append(_("\n(use 'hg %s -h' to show more help)\n")
534 536 % name)
535 537 elif not ui.quiet:
536 538 rst.append(_('\n(some details hidden, use --verbose '
537 539 'to show complete help)'))
538 540
539 541 return rst
540 542
541 543 def helplist(select=None, **opts):
542 544 # Category -> list of commands
543 545 cats = {}
544 546 # Command -> short description
545 547 h = {}
546 548 # Command -> string showing synonyms
547 549 syns = {}
548 550 for c, e in commands.table.iteritems():
549 551 fs = cmdutil.parsealiases(c)
550 552 f = fs[0]
551 553 syns[f] = ', '.join(fs)
552 554 func = e[0]
553 555 if select and not select(f):
554 556 continue
555 557 doc = pycompat.getdoc(func)
556 558 if filtercmd(ui, f, func, name, doc):
557 559 continue
558 560 doc = gettext(doc)
559 561 if not doc:
560 562 doc = _("(no help text available)")
561 563 h[f] = doc.splitlines()[0].rstrip()
562 564
563 565 cat = getattr(func, 'helpcategory', None) or (
564 566 registrar.command.CATEGORY_NONE)
565 567 cats.setdefault(cat, []).append(f)
566 568
567 569 rst = []
568 570 if not h:
569 571 if not ui.quiet:
570 572 rst.append(_('no commands defined\n'))
571 573 return rst
572 574
573 575 # Output top header.
574 576 if not ui.quiet:
575 577 if name == "shortlist":
576 578 rst.append(_('basic commands:\n\n'))
577 579 elif name == "debug":
578 580 rst.append(_('debug commands (internal and unsupported):\n\n'))
579 581 else:
580 582 rst.append(_('list of commands:\n'))
581 583
582 584 def appendcmds(cmds):
583 585 cmds = sorted(cmds)
584 586 for c in cmds:
585 587 if ui.verbose:
586 588 rst.append(" :%s: %s\n" % (syns[c], h[c]))
587 589 else:
588 590 rst.append(' :%s: %s\n' % (c, h[c]))
589 591
590 592 if name in ('shortlist', 'debug'):
591 593 # List without categories.
592 594 appendcmds(h)
593 595 else:
594 596 # Check that all categories have an order.
595 597 missing_order = set(cats.keys()) - set(CATEGORY_ORDER)
596 598 if missing_order:
597 599 ui.develwarn('help categories missing from CATEGORY_ORDER: %s' %
598 600 missing_order)
599 601
600 602 # List per category.
601 603 for cat in CATEGORY_ORDER:
602 604 catfns = cats.get(cat, [])
603 605 if catfns:
604 606 if len(cats) > 1:
605 607 catname = gettext(CATEGORY_NAMES[cat])
606 608 rst.append("\n%s:\n" % catname)
607 609 rst.append("\n")
608 610 appendcmds(catfns)
609 611
610 612 ex = opts.get
611 613 anyopts = (ex(r'keyword') or not (ex(r'command') or ex(r'extension')))
612 614 if not name and anyopts:
613 615 exts = listexts(_('enabled extensions:'), extensions.enabled())
614 616 if exts:
615 617 rst.append('\n')
616 618 rst.extend(exts)
617 619
618 620 rst.append(_("\nadditional help topics:\n"))
619 621 # Group commands by category.
620 622 topiccats = {}
621 623 for topic in helptable:
622 624 names, header, doc = topic[0:3]
623 625 if len(topic) > 3 and topic[3]:
624 626 category = topic[3]
625 627 else:
626 628 category = TOPIC_CATEGORY_NONE
627 629
628 630 topicname = names[0]
629 631 if not filtertopic(ui, topicname):
630 632 topiccats.setdefault(category, []).append(
631 633 (topicname, header))
632 634
633 635 # Check that all categories have an order.
634 636 missing_order = set(topiccats.keys()) - set(TOPIC_CATEGORY_ORDER)
635 637 if missing_order:
636 638 ui.develwarn(
637 639 'help categories missing from TOPIC_CATEGORY_ORDER: %s' %
638 640 missing_order)
639 641
640 642 # Output topics per category.
641 643 for cat in TOPIC_CATEGORY_ORDER:
642 644 topics = topiccats.get(cat, [])
643 645 if topics:
644 646 if len(topiccats) > 1:
645 647 catname = gettext(TOPIC_CATEGORY_NAMES[cat])
646 648 rst.append("\n%s:\n" % catname)
647 649 rst.append("\n")
648 650 for t, desc in topics:
649 651 rst.append(" :%s: %s\n" % (t, desc))
650 652
651 653 if ui.quiet:
652 654 pass
653 655 elif ui.verbose:
654 656 rst.append('\n%s\n' % optrst(_("global options"),
655 657 commands.globalopts, ui.verbose))
656 658 if name == 'shortlist':
657 659 rst.append(_("\n(use 'hg help' for the full list "
658 660 "of commands)\n"))
659 661 else:
660 662 if name == 'shortlist':
661 663 rst.append(_("\n(use 'hg help' for the full list of commands "
662 664 "or 'hg -v' for details)\n"))
663 665 elif name and not full:
664 666 rst.append(_("\n(use 'hg help %s' to show the full help "
665 667 "text)\n") % name)
666 668 elif name and syns and name in syns.keys():
667 669 rst.append(_("\n(use 'hg help -v -e %s' to show built-in "
668 670 "aliases and global options)\n") % name)
669 671 else:
670 672 rst.append(_("\n(use 'hg help -v%s' to show built-in aliases "
671 673 "and global options)\n")
672 674 % (name and " " + name or ""))
673 675 return rst
674 676
675 677 def helptopic(name, subtopic=None):
676 678 # Look for sub-topic entry first.
677 679 header, doc = None, None
678 680 if subtopic and name in subtopics:
679 681 for names, header, doc in subtopics[name]:
680 682 if subtopic in names:
681 683 break
682 684
683 685 if not header:
684 686 for topic in helptable:
685 687 names, header, doc = topic[0:3]
686 688 if name in names:
687 689 break
688 690 else:
689 691 raise error.UnknownCommand(name)
690 692
691 693 rst = [minirst.section(header)]
692 694
693 695 # description
694 696 if not doc:
695 697 rst.append(" %s\n" % _("(no help text available)"))
696 698 if callable(doc):
697 699 rst += [" %s\n" % l for l in doc(ui).splitlines()]
698 700
699 701 if not ui.verbose:
700 702 omitted = _('(some details hidden, use --verbose'
701 703 ' to show complete help)')
702 704 indicateomitted(rst, omitted)
703 705
704 706 try:
705 707 cmdutil.findcmd(name, commands.table)
706 708 rst.append(_("\nuse 'hg help -c %s' to see help for "
707 709 "the %s command\n") % (name, name))
708 710 except error.UnknownCommand:
709 711 pass
710 712 return rst
711 713
712 714 def helpext(name, subtopic=None):
713 715 try:
714 716 mod = extensions.find(name)
715 717 doc = gettext(pycompat.getdoc(mod)) or _('no help text available')
716 718 except KeyError:
717 719 mod = None
718 720 doc = extensions.disabledext(name)
719 721 if not doc:
720 722 raise error.UnknownCommand(name)
721 723
722 724 if '\n' not in doc:
723 725 head, tail = doc, ""
724 726 else:
725 727 head, tail = doc.split('\n', 1)
726 728 rst = [_('%s extension - %s\n\n') % (name.rpartition('.')[-1], head)]
727 729 if tail:
728 730 rst.extend(tail.splitlines(True))
729 731 rst.append('\n')
730 732
731 733 if not ui.verbose:
732 734 omitted = _('(some details hidden, use --verbose'
733 735 ' to show complete help)')
734 736 indicateomitted(rst, omitted)
735 737
736 738 if mod:
737 739 try:
738 740 ct = mod.cmdtable
739 741 except AttributeError:
740 742 ct = {}
741 743 modcmds = set([c.partition('|')[0] for c in ct])
742 744 rst.extend(helplist(modcmds.__contains__))
743 745 else:
744 746 rst.append(_("(use 'hg help extensions' for information on enabling"
745 747 " extensions)\n"))
746 748 return rst
747 749
748 750 def helpextcmd(name, subtopic=None):
749 751 cmd, ext, doc = extensions.disabledcmd(ui, name,
750 752 ui.configbool('ui', 'strict'))
751 753 doc = doc.splitlines()[0]
752 754
753 755 rst = listexts(_("'%s' is provided by the following "
754 756 "extension:") % cmd, {ext: doc}, indent=4,
755 757 showdeprecated=True)
756 758 rst.append('\n')
757 759 rst.append(_("(use 'hg help extensions' for information on enabling "
758 760 "extensions)\n"))
759 761 return rst
760 762
761 763
762 764 rst = []
763 765 kw = opts.get('keyword')
764 766 if kw or name is None and any(opts[o] for o in opts):
765 767 matches = topicmatch(ui, commands, name or '')
766 768 helpareas = []
767 769 if opts.get('extension'):
768 770 helpareas += [('extensions', _('Extensions'))]
769 771 if opts.get('command'):
770 772 helpareas += [('commands', _('Commands'))]
771 773 if not helpareas:
772 774 helpareas = [('topics', _('Topics')),
773 775 ('commands', _('Commands')),
774 776 ('extensions', _('Extensions')),
775 777 ('extensioncommands', _('Extension Commands'))]
776 778 for t, title in helpareas:
777 779 if matches[t]:
778 780 rst.append('%s:\n\n' % title)
779 781 rst.extend(minirst.maketable(sorted(matches[t]), 1))
780 782 rst.append('\n')
781 783 if not rst:
782 784 msg = _('no matches')
783 785 hint = _("try 'hg help' for a list of topics")
784 786 raise error.Abort(msg, hint=hint)
785 787 elif name and name != 'shortlist':
786 788 queries = []
787 789 if unknowncmd:
788 790 queries += [helpextcmd]
789 791 if opts.get('extension'):
790 792 queries += [helpext]
791 793 if opts.get('command'):
792 794 queries += [helpcmd]
793 795 if not queries:
794 796 queries = (helptopic, helpcmd, helpext, helpextcmd)
795 797 for f in queries:
796 798 try:
797 799 rst = f(name, subtopic)
798 800 break
799 801 except error.UnknownCommand:
800 802 pass
801 803 else:
802 804 if unknowncmd:
803 805 raise error.UnknownCommand(name)
804 806 else:
805 807 msg = _('no such help topic: %s') % name
806 808 hint = _("try 'hg help --keyword %s'") % name
807 809 raise error.Abort(msg, hint=hint)
808 810 else:
809 811 # program name
810 812 if not ui.quiet:
811 813 rst = [_("Mercurial Distributed SCM\n"), '\n']
812 814 rst.extend(helplist(None, **pycompat.strkwargs(opts)))
813 815
814 816 return ''.join(rst)
815 817
816 818 def formattedhelp(ui, commands, fullname, keep=None, unknowncmd=False,
817 819 full=True, **opts):
818 820 """get help for a given topic (as a dotted name) as rendered rst
819 821
820 822 Either returns the rendered help text or raises an exception.
821 823 """
822 824 if keep is None:
823 825 keep = []
824 826 else:
825 827 keep = list(keep) # make a copy so we can mutate this later
826 828
827 829 # <fullname> := <name>[.<subtopic][.<section>]
828 830 name = subtopic = section = None
829 831 if fullname is not None:
830 832 nameparts = fullname.split('.')
831 833 name = nameparts.pop(0)
832 834 if nameparts and name in subtopics:
833 835 subtopic = nameparts.pop(0)
834 836 if nameparts:
835 837 section = encoding.lower('.'.join(nameparts))
836 838
837 839 textwidth = ui.configint('ui', 'textwidth')
838 840 termwidth = ui.termwidth() - 2
839 841 if textwidth <= 0 or termwidth < textwidth:
840 842 textwidth = termwidth
841 843 text = help_(ui, commands, name,
842 844 subtopic=subtopic, unknowncmd=unknowncmd, full=full, **opts)
843 845
844 846 blocks, pruned = minirst.parse(text, keep=keep)
845 847 if 'verbose' in pruned:
846 848 keep.append('omitted')
847 849 else:
848 850 keep.append('notomitted')
849 851 blocks, pruned = minirst.parse(text, keep=keep)
850 852 if section:
851 853 blocks = minirst.filtersections(blocks, section)
852 854
853 855 # We could have been given a weird ".foo" section without a name
854 856 # to look for, or we could have simply failed to found "foo.bar"
855 857 # because bar isn't a section of foo
856 858 if section and not (blocks and name):
857 859 raise error.Abort(_("help section not found: %s") % fullname)
858 860
859 861 return minirst.formatplain(blocks, textwidth)
@@ -1,3814 +1,3822
1 1 Short help:
2 2
3 3 $ hg
4 4 Mercurial Distributed SCM
5 5
6 6 basic commands:
7 7
8 8 add add the specified files on the next commit
9 9 annotate show changeset information by line for each file
10 10 clone make a copy of an existing repository
11 11 commit commit the specified files or all outstanding changes
12 12 diff diff repository (or selected files)
13 13 export dump the header and diffs for one or more changesets
14 14 forget forget the specified files on the next commit
15 15 init create a new repository in the given directory
16 16 log show revision history of entire repository or files
17 17 merge merge another revision into working directory
18 18 pull pull changes from the specified source
19 19 push push changes to the specified destination
20 20 remove remove the specified files on the next commit
21 21 serve start stand-alone webserver
22 22 status show changed files in the working directory
23 23 summary summarize working directory state
24 24 update update working directory (or switch revisions)
25 25
26 26 (use 'hg help' for the full list of commands or 'hg -v' for details)
27 27
28 28 $ hg -q
29 29 add add the specified files on the next commit
30 30 annotate show changeset information by line for each file
31 31 clone make a copy of an existing repository
32 32 commit commit the specified files or all outstanding changes
33 33 diff diff repository (or selected files)
34 34 export dump the header and diffs for one or more changesets
35 35 forget forget the specified files on the next commit
36 36 init create a new repository in the given directory
37 37 log show revision history of entire repository or files
38 38 merge merge another revision into working directory
39 39 pull pull changes from the specified source
40 40 push push changes to the specified destination
41 41 remove remove the specified files on the next commit
42 42 serve start stand-alone webserver
43 43 status show changed files in the working directory
44 44 summary summarize working directory state
45 45 update update working directory (or switch revisions)
46 46
47 47 Extra extensions will be printed in help output in a non-reliable order since
48 48 the extension is unknown.
49 49 #if no-extraextensions
50 50
51 51 $ hg help
52 52 Mercurial Distributed SCM
53 53
54 54 list of commands:
55 55
56 56 Repository creation:
57 57
58 58 clone make a copy of an existing repository
59 59 init create a new repository in the given directory
60 60
61 61 Remote repository management:
62 62
63 63 incoming show new changesets found in source
64 64 outgoing show changesets not found in the destination
65 65 paths show aliases for remote repositories
66 66 pull pull changes from the specified source
67 67 push push changes to the specified destination
68 68 serve start stand-alone webserver
69 69
70 70 Change creation:
71 71
72 72 commit commit the specified files or all outstanding changes
73 73
74 74 Change manipulation:
75 75
76 76 backout reverse effect of earlier changeset
77 77 graft copy changes from other branches onto the current branch
78 78 merge merge another revision into working directory
79 79
80 80 Change organization:
81 81
82 82 bookmarks create a new bookmark or list existing bookmarks
83 83 branch set or show the current branch name
84 84 branches list repository named branches
85 85 phase set or show the current phase name
86 86 tag add one or more tags for the current or given revision
87 87 tags list repository tags
88 88
89 89 File content management:
90 90
91 91 annotate show changeset information by line for each file
92 92 cat output the current or given revision of files
93 93 copy mark files as copied for the next commit
94 94 diff diff repository (or selected files)
95 95 grep search revision history for a pattern in specified files
96 96
97 97 Change navigation:
98 98
99 99 bisect subdivision search of changesets
100 100 heads show branch heads
101 101 identify identify the working directory or specified revision
102 102 log show revision history of entire repository or files
103 103
104 104 Working directory management:
105 105
106 106 add add the specified files on the next commit
107 107 addremove add all new files, delete all missing files
108 108 files list tracked files
109 109 forget forget the specified files on the next commit
110 110 remove remove the specified files on the next commit
111 111 rename rename files; equivalent of copy + remove
112 112 resolve redo merges or set/view the merge status of files
113 113 revert restore files to their checkout state
114 114 root print the root (top) of the current working directory
115 115 status show changed files in the working directory
116 116 summary summarize working directory state
117 117 update update working directory (or switch revisions)
118 118
119 119 Change import/export:
120 120
121 121 archive create an unversioned archive of a repository revision
122 122 bundle create a bundle file
123 123 export dump the header and diffs for one or more changesets
124 124 import import an ordered set of patches
125 125 unbundle apply one or more bundle files
126 126
127 127 Repository maintenance:
128 128
129 129 manifest output the current or given revision of the project manifest
130 130 recover roll back an interrupted transaction
131 131 verify verify the integrity of the repository
132 132
133 133 Help:
134 134
135 135 config show combined config settings from all hgrc files
136 136 help show help for a given topic or a help overview
137 137 version output version and copyright information
138 138
139 139 additional help topics:
140 140
141 141 Mercurial identifiers:
142 142
143 143 filesets Specifying File Sets
144 144 hgignore Syntax for Mercurial Ignore Files
145 145 patterns File Name Patterns
146 146 revisions Specifying Revisions
147 147 urls URL Paths
148 148
149 149 Mercurial output:
150 150
151 151 color Colorizing Outputs
152 152 dates Date Formats
153 153 diffs Diff Formats
154 154 templating Template Usage
155 155
156 156 Mercurial configuration:
157 157
158 158 config Configuration Files
159 159 environment Environment Variables
160 160 extensions Using Additional Features
161 161 flags Command-line flags
162 162 hgweb Configuring hgweb
163 163 merge-tools Merge Tools
164 164 pager Pager Support
165 165
166 166 Concepts:
167 167
168 168 bundlespec Bundle File Formats
169 169 glossary Glossary
170 170 phases Working with Phases
171 171 subrepos Subrepositories
172 172
173 173 Miscellaneous:
174 174
175 175 deprecated Deprecated Features
176 176 internals Technical implementation topics
177 177 scripting Using Mercurial from scripts and automation
178 178
179 179 (use 'hg help -v' to show built-in aliases and global options)
180 180
181 181 $ hg -q help
182 182 Repository creation:
183 183
184 184 clone make a copy of an existing repository
185 185 init create a new repository in the given directory
186 186
187 187 Remote repository management:
188 188
189 189 incoming show new changesets found in source
190 190 outgoing show changesets not found in the destination
191 191 paths show aliases for remote repositories
192 192 pull pull changes from the specified source
193 193 push push changes to the specified destination
194 194 serve start stand-alone webserver
195 195
196 196 Change creation:
197 197
198 198 commit commit the specified files or all outstanding changes
199 199
200 200 Change manipulation:
201 201
202 202 backout reverse effect of earlier changeset
203 203 graft copy changes from other branches onto the current branch
204 204 merge merge another revision into working directory
205 205
206 206 Change organization:
207 207
208 208 bookmarks create a new bookmark or list existing bookmarks
209 209 branch set or show the current branch name
210 210 branches list repository named branches
211 211 phase set or show the current phase name
212 212 tag add one or more tags for the current or given revision
213 213 tags list repository tags
214 214
215 215 File content management:
216 216
217 217 annotate show changeset information by line for each file
218 218 cat output the current or given revision of files
219 219 copy mark files as copied for the next commit
220 220 diff diff repository (or selected files)
221 221 grep search revision history for a pattern in specified files
222 222
223 223 Change navigation:
224 224
225 225 bisect subdivision search of changesets
226 226 heads show branch heads
227 227 identify identify the working directory or specified revision
228 228 log show revision history of entire repository or files
229 229
230 230 Working directory management:
231 231
232 232 add add the specified files on the next commit
233 233 addremove add all new files, delete all missing files
234 234 files list tracked files
235 235 forget forget the specified files on the next commit
236 236 remove remove the specified files on the next commit
237 237 rename rename files; equivalent of copy + remove
238 238 resolve redo merges or set/view the merge status of files
239 239 revert restore files to their checkout state
240 240 root print the root (top) of the current working directory
241 241 status show changed files in the working directory
242 242 summary summarize working directory state
243 243 update update working directory (or switch revisions)
244 244
245 245 Change import/export:
246 246
247 247 archive create an unversioned archive of a repository revision
248 248 bundle create a bundle file
249 249 export dump the header and diffs for one or more changesets
250 250 import import an ordered set of patches
251 251 unbundle apply one or more bundle files
252 252
253 253 Repository maintenance:
254 254
255 255 manifest output the current or given revision of the project manifest
256 256 recover roll back an interrupted transaction
257 257 verify verify the integrity of the repository
258 258
259 259 Help:
260 260
261 261 config show combined config settings from all hgrc files
262 262 help show help for a given topic or a help overview
263 263 version output version and copyright information
264 264
265 265 additional help topics:
266 266
267 267 Mercurial identifiers:
268 268
269 269 filesets Specifying File Sets
270 270 hgignore Syntax for Mercurial Ignore Files
271 271 patterns File Name Patterns
272 272 revisions Specifying Revisions
273 273 urls URL Paths
274 274
275 275 Mercurial output:
276 276
277 277 color Colorizing Outputs
278 278 dates Date Formats
279 279 diffs Diff Formats
280 280 templating Template Usage
281 281
282 282 Mercurial configuration:
283 283
284 284 config Configuration Files
285 285 environment Environment Variables
286 286 extensions Using Additional Features
287 287 flags Command-line flags
288 288 hgweb Configuring hgweb
289 289 merge-tools Merge Tools
290 290 pager Pager Support
291 291
292 292 Concepts:
293 293
294 294 bundlespec Bundle File Formats
295 295 glossary Glossary
296 296 phases Working with Phases
297 297 subrepos Subrepositories
298 298
299 299 Miscellaneous:
300 300
301 301 deprecated Deprecated Features
302 302 internals Technical implementation topics
303 303 scripting Using Mercurial from scripts and automation
304 304
305 305 Test extension help:
306 306 $ hg help extensions --config extensions.rebase= --config extensions.children=
307 307 Using Additional Features
308 308 """""""""""""""""""""""""
309 309
310 310 Mercurial has the ability to add new features through the use of
311 311 extensions. Extensions may add new commands, add options to existing
312 312 commands, change the default behavior of commands, or implement hooks.
313 313
314 314 To enable the "foo" extension, either shipped with Mercurial or in the
315 315 Python search path, create an entry for it in your configuration file,
316 316 like this:
317 317
318 318 [extensions]
319 319 foo =
320 320
321 321 You may also specify the full path to an extension:
322 322
323 323 [extensions]
324 324 myfeature = ~/.hgext/myfeature.py
325 325
326 326 See 'hg help config' for more information on configuration files.
327 327
328 328 Extensions are not loaded by default for a variety of reasons: they can
329 329 increase startup overhead; they may be meant for advanced usage only; they
330 330 may provide potentially dangerous abilities (such as letting you destroy
331 331 or modify history); they might not be ready for prime time; or they may
332 332 alter some usual behaviors of stock Mercurial. It is thus up to the user
333 333 to activate extensions as needed.
334 334
335 335 To explicitly disable an extension enabled in a configuration file of
336 336 broader scope, prepend its path with !:
337 337
338 338 [extensions]
339 339 # disabling extension bar residing in /path/to/extension/bar.py
340 340 bar = !/path/to/extension/bar.py
341 341 # ditto, but no path was supplied for extension baz
342 342 baz = !
343 343
344 344 enabled extensions:
345 345
346 346 children command to display child changesets (DEPRECATED)
347 347 rebase command to move sets of revisions to a different ancestor
348 348
349 349 disabled extensions:
350 350
351 351 acl hooks for controlling repository access
352 352 blackbox log repository events to a blackbox for debugging
353 353 bugzilla hooks for integrating with the Bugzilla bug tracker
354 354 censor erase file content at a given revision
355 355 churn command to display statistics about repository history
356 356 clonebundles advertise pre-generated bundles to seed clones
357 357 closehead close arbitrary heads without checking them out first
358 358 convert import revisions from foreign VCS repositories into
359 359 Mercurial
360 360 eol automatically manage newlines in repository files
361 361 extdiff command to allow external programs to compare revisions
362 362 factotum http authentication with factotum
363 363 githelp try mapping git commands to Mercurial commands
364 364 gpg commands to sign and verify changesets
365 365 hgk browse the repository in a graphical way
366 366 highlight syntax highlighting for hgweb (requires Pygments)
367 367 histedit interactive history editing
368 368 keyword expand keywords in tracked files
369 369 largefiles track large binary files
370 370 mq manage a stack of patches
371 371 notify hooks for sending email push notifications
372 372 patchbomb command to send changesets as (a series of) patch emails
373 373 purge command to delete untracked files from the working
374 374 directory
375 375 relink recreates hardlinks between repository clones
376 376 schemes extend schemes with shortcuts to repository swarms
377 377 share share a common history between several working directories
378 378 shelve save and restore changes to the working directory
379 379 strip strip changesets and their descendants from history
380 380 transplant command to transplant changesets from another branch
381 381 win32mbcs allow the use of MBCS paths with problematic encodings
382 382 zeroconf discover and advertise repositories on the local network
383 383
384 384 #endif
385 385
386 386 Verify that deprecated extensions are included if --verbose:
387 387
388 388 $ hg -v help extensions | grep children
389 389 children command to display child changesets (DEPRECATED)
390 390
391 391 Verify that extension keywords appear in help templates
392 392
393 393 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
394 394
395 395 Test short command list with verbose option
396 396
397 397 $ hg -v help shortlist
398 398 Mercurial Distributed SCM
399 399
400 400 basic commands:
401 401
402 402 add add the specified files on the next commit
403 403 annotate, blame
404 404 show changeset information by line for each file
405 405 clone make a copy of an existing repository
406 406 commit, ci commit the specified files or all outstanding changes
407 407 diff diff repository (or selected files)
408 408 export dump the header and diffs for one or more changesets
409 409 forget forget the specified files on the next commit
410 410 init create a new repository in the given directory
411 411 log, history show revision history of entire repository or files
412 412 merge merge another revision into working directory
413 413 pull pull changes from the specified source
414 414 push push changes to the specified destination
415 415 remove, rm remove the specified files on the next commit
416 416 serve start stand-alone webserver
417 417 status, st show changed files in the working directory
418 418 summary, sum summarize working directory state
419 419 update, up, checkout, co
420 420 update working directory (or switch revisions)
421 421
422 422 global options ([+] can be repeated):
423 423
424 424 -R --repository REPO repository root directory or name of overlay bundle
425 425 file
426 426 --cwd DIR change working directory
427 427 -y --noninteractive do not prompt, automatically pick the first choice for
428 428 all prompts
429 429 -q --quiet suppress output
430 430 -v --verbose enable additional output
431 431 --color TYPE when to colorize (boolean, always, auto, never, or
432 432 debug)
433 433 --config CONFIG [+] set/override config option (use 'section.name=value')
434 434 --debug enable debugging output
435 435 --debugger start debugger
436 436 --encoding ENCODE set the charset encoding (default: ascii)
437 437 --encodingmode MODE set the charset encoding mode (default: strict)
438 438 --traceback always print a traceback on exception
439 439 --time time how long the command takes
440 440 --profile print command execution profile
441 441 --version output version information and exit
442 442 -h --help display help and exit
443 443 --hidden consider hidden changesets
444 444 --pager TYPE when to paginate (boolean, always, auto, or never)
445 445 (default: auto)
446 446
447 447 (use 'hg help' for the full list of commands)
448 448
449 449 $ hg add -h
450 450 hg add [OPTION]... [FILE]...
451 451
452 452 add the specified files on the next commit
453 453
454 454 Schedule files to be version controlled and added to the repository.
455 455
456 456 The files will be added to the repository at the next commit. To undo an
457 457 add before that, see 'hg forget'.
458 458
459 459 If no names are given, add all files to the repository (except files
460 460 matching ".hgignore").
461 461
462 462 Returns 0 if all files are successfully added.
463 463
464 464 options ([+] can be repeated):
465 465
466 466 -I --include PATTERN [+] include names matching the given patterns
467 467 -X --exclude PATTERN [+] exclude names matching the given patterns
468 468 -S --subrepos recurse into subrepositories
469 469 -n --dry-run do not perform actions, just print output
470 470
471 471 (some details hidden, use --verbose to show complete help)
472 472
473 473 Verbose help for add
474 474
475 475 $ hg add -hv
476 476 hg add [OPTION]... [FILE]...
477 477
478 478 add the specified files on the next commit
479 479
480 480 Schedule files to be version controlled and added to the repository.
481 481
482 482 The files will be added to the repository at the next commit. To undo an
483 483 add before that, see 'hg forget'.
484 484
485 485 If no names are given, add all files to the repository (except files
486 486 matching ".hgignore").
487 487
488 488 Examples:
489 489
490 490 - New (unknown) files are added automatically by 'hg add':
491 491
492 492 $ ls
493 493 foo.c
494 494 $ hg status
495 495 ? foo.c
496 496 $ hg add
497 497 adding foo.c
498 498 $ hg status
499 499 A foo.c
500 500
501 501 - Specific files to be added can be specified:
502 502
503 503 $ ls
504 504 bar.c foo.c
505 505 $ hg status
506 506 ? bar.c
507 507 ? foo.c
508 508 $ hg add bar.c
509 509 $ hg status
510 510 A bar.c
511 511 ? foo.c
512 512
513 513 Returns 0 if all files are successfully added.
514 514
515 515 options ([+] can be repeated):
516 516
517 517 -I --include PATTERN [+] include names matching the given patterns
518 518 -X --exclude PATTERN [+] exclude names matching the given patterns
519 519 -S --subrepos recurse into subrepositories
520 520 -n --dry-run do not perform actions, just print output
521 521
522 522 global options ([+] can be repeated):
523 523
524 524 -R --repository REPO repository root directory or name of overlay bundle
525 525 file
526 526 --cwd DIR change working directory
527 527 -y --noninteractive do not prompt, automatically pick the first choice for
528 528 all prompts
529 529 -q --quiet suppress output
530 530 -v --verbose enable additional output
531 531 --color TYPE when to colorize (boolean, always, auto, never, or
532 532 debug)
533 533 --config CONFIG [+] set/override config option (use 'section.name=value')
534 534 --debug enable debugging output
535 535 --debugger start debugger
536 536 --encoding ENCODE set the charset encoding (default: ascii)
537 537 --encodingmode MODE set the charset encoding mode (default: strict)
538 538 --traceback always print a traceback on exception
539 539 --time time how long the command takes
540 540 --profile print command execution profile
541 541 --version output version information and exit
542 542 -h --help display help and exit
543 543 --hidden consider hidden changesets
544 544 --pager TYPE when to paginate (boolean, always, auto, or never)
545 545 (default: auto)
546 546
547 547 Test the textwidth config option
548 548
549 549 $ hg root -h --config ui.textwidth=50
550 550 hg root
551 551
552 552 print the root (top) of the current working
553 553 directory
554 554
555 555 Print the root directory of the current
556 556 repository.
557 557
558 558 Returns 0 on success.
559 559
560 560 (some details hidden, use --verbose to show
561 561 complete help)
562 562
563 563 Test help option with version option
564 564
565 565 $ hg add -h --version
566 566 Mercurial Distributed SCM (version *) (glob)
567 567 (see https://mercurial-scm.org for more information)
568 568
569 569 Copyright (C) 2005-* Matt Mackall and others (glob)
570 570 This is free software; see the source for copying conditions. There is NO
571 571 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
572 572
573 573 $ hg add --skjdfks
574 574 hg add: option --skjdfks not recognized
575 575 hg add [OPTION]... [FILE]...
576 576
577 577 add the specified files on the next commit
578 578
579 579 options ([+] can be repeated):
580 580
581 581 -I --include PATTERN [+] include names matching the given patterns
582 582 -X --exclude PATTERN [+] exclude names matching the given patterns
583 583 -S --subrepos recurse into subrepositories
584 584 -n --dry-run do not perform actions, just print output
585 585
586 586 (use 'hg add -h' to show more help)
587 587 [255]
588 588
589 589 Test ambiguous command help
590 590
591 591 $ hg help ad
592 592 list of commands:
593 593
594 594 add add the specified files on the next commit
595 595 addremove add all new files, delete all missing files
596 596
597 597 (use 'hg help -v ad' to show built-in aliases and global options)
598 598
599 599 Test command without options
600 600
601 601 $ hg help verify
602 602 hg verify
603 603
604 604 verify the integrity of the repository
605 605
606 606 Verify the integrity of the current repository.
607 607
608 608 This will perform an extensive check of the repository's integrity,
609 609 validating the hashes and checksums of each entry in the changelog,
610 610 manifest, and tracked files, as well as the integrity of their crosslinks
611 611 and indices.
612 612
613 613 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
614 614 information about recovery from corruption of the repository.
615 615
616 616 Returns 0 on success, 1 if errors are encountered.
617 617
618 618 (some details hidden, use --verbose to show complete help)
619 619
620 620 $ hg help diff
621 621 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
622 622
623 623 diff repository (or selected files)
624 624
625 625 Show differences between revisions for the specified files.
626 626
627 627 Differences between files are shown using the unified diff format.
628 628
629 629 Note:
630 630 'hg diff' may generate unexpected results for merges, as it will
631 631 default to comparing against the working directory's first parent
632 632 changeset if no revisions are specified.
633 633
634 634 When two revision arguments are given, then changes are shown between
635 635 those revisions. If only one revision is specified then that revision is
636 636 compared to the working directory, and, when no revisions are specified,
637 637 the working directory files are compared to its first parent.
638 638
639 639 Alternatively you can specify -c/--change with a revision to see the
640 640 changes in that changeset relative to its first parent.
641 641
642 642 Without the -a/--text option, diff will avoid generating diffs of files it
643 643 detects as binary. With -a, diff will generate a diff anyway, probably
644 644 with undesirable results.
645 645
646 646 Use the -g/--git option to generate diffs in the git extended diff format.
647 647 For more information, read 'hg help diffs'.
648 648
649 649 Returns 0 on success.
650 650
651 651 options ([+] can be repeated):
652 652
653 653 -r --rev REV [+] revision
654 654 -c --change REV change made by revision
655 655 -a --text treat all files as text
656 656 -g --git use git extended diff format
657 657 --binary generate binary diffs in git mode (default)
658 658 --nodates omit dates from diff headers
659 659 --noprefix omit a/ and b/ prefixes from filenames
660 660 -p --show-function show which function each change is in
661 661 --reverse produce a diff that undoes the changes
662 662 -w --ignore-all-space ignore white space when comparing lines
663 663 -b --ignore-space-change ignore changes in the amount of white space
664 664 -B --ignore-blank-lines ignore changes whose lines are all blank
665 665 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
666 666 -U --unified NUM number of lines of context to show
667 667 --stat output diffstat-style summary of changes
668 668 --root DIR produce diffs relative to subdirectory
669 669 -I --include PATTERN [+] include names matching the given patterns
670 670 -X --exclude PATTERN [+] exclude names matching the given patterns
671 671 -S --subrepos recurse into subrepositories
672 672
673 673 (some details hidden, use --verbose to show complete help)
674 674
675 675 $ hg help status
676 676 hg status [OPTION]... [FILE]...
677 677
678 678 aliases: st
679 679
680 680 show changed files in the working directory
681 681
682 682 Show status of files in the repository. If names are given, only files
683 683 that match are shown. Files that are clean or ignored or the source of a
684 684 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
685 685 -C/--copies or -A/--all are given. Unless options described with "show
686 686 only ..." are given, the options -mardu are used.
687 687
688 688 Option -q/--quiet hides untracked (unknown and ignored) files unless
689 689 explicitly requested with -u/--unknown or -i/--ignored.
690 690
691 691 Note:
692 692 'hg status' may appear to disagree with diff if permissions have
693 693 changed or a merge has occurred. The standard diff format does not
694 694 report permission changes and diff only reports changes relative to one
695 695 merge parent.
696 696
697 697 If one revision is given, it is used as the base revision. If two
698 698 revisions are given, the differences between them are shown. The --change
699 699 option can also be used as a shortcut to list the changed files of a
700 700 revision from its first parent.
701 701
702 702 The codes used to show the status of files are:
703 703
704 704 M = modified
705 705 A = added
706 706 R = removed
707 707 C = clean
708 708 ! = missing (deleted by non-hg command, but still tracked)
709 709 ? = not tracked
710 710 I = ignored
711 711 = origin of the previous file (with --copies)
712 712
713 713 Returns 0 on success.
714 714
715 715 options ([+] can be repeated):
716 716
717 717 -A --all show status of all files
718 718 -m --modified show only modified files
719 719 -a --added show only added files
720 720 -r --removed show only removed files
721 721 -d --deleted show only deleted (but tracked) files
722 722 -c --clean show only files without changes
723 723 -u --unknown show only unknown (not tracked) files
724 724 -i --ignored show only ignored files
725 725 -n --no-status hide status prefix
726 726 -C --copies show source of copied files
727 727 -0 --print0 end filenames with NUL, for use with xargs
728 728 --rev REV [+] show difference from revision
729 729 --change REV list the changed files of a revision
730 730 -I --include PATTERN [+] include names matching the given patterns
731 731 -X --exclude PATTERN [+] exclude names matching the given patterns
732 732 -S --subrepos recurse into subrepositories
733 733 -T --template TEMPLATE display with template
734 734
735 735 (some details hidden, use --verbose to show complete help)
736 736
737 737 $ hg -q help status
738 738 hg status [OPTION]... [FILE]...
739 739
740 740 show changed files in the working directory
741 741
742 742 $ hg help foo
743 743 abort: no such help topic: foo
744 744 (try 'hg help --keyword foo')
745 745 [255]
746 746
747 747 $ hg skjdfks
748 748 hg: unknown command 'skjdfks'
749 749 (use 'hg help' for a list of commands)
750 750 [255]
751 751
752 752 Typoed command gives suggestion
753 753 $ hg puls
754 754 hg: unknown command 'puls'
755 755 (did you mean one of pull, push?)
756 756 [255]
757 757
758 758 Not enabled extension gets suggested
759 759
760 760 $ hg rebase
761 761 hg: unknown command 'rebase'
762 762 'rebase' is provided by the following extension:
763 763
764 764 rebase command to move sets of revisions to a different ancestor
765 765
766 766 (use 'hg help extensions' for information on enabling extensions)
767 767 [255]
768 768
769 769 Disabled extension gets suggested
770 770 $ hg --config extensions.rebase=! rebase
771 771 hg: unknown command 'rebase'
772 772 'rebase' is provided by the following extension:
773 773
774 774 rebase command to move sets of revisions to a different ancestor
775 775
776 776 (use 'hg help extensions' for information on enabling extensions)
777 777 [255]
778 778
779 779 Make sure that we don't run afoul of the help system thinking that
780 780 this is a section and erroring out weirdly.
781 781
782 782 $ hg .log
783 783 hg: unknown command '.log'
784 784 (did you mean log?)
785 785 [255]
786 786
787 787 $ hg log.
788 788 hg: unknown command 'log.'
789 789 (did you mean log?)
790 790 [255]
791 791 $ hg pu.lh
792 792 hg: unknown command 'pu.lh'
793 793 (did you mean one of pull, push?)
794 794 [255]
795 795
796 796 $ cat > helpext.py <<EOF
797 797 > import os
798 798 > from mercurial import commands, fancyopts, registrar
799 799 >
800 800 > def func(arg):
801 801 > return '%sfoo' % arg
802 802 > class customopt(fancyopts.customopt):
803 803 > def newstate(self, oldstate, newparam, abort):
804 804 > return '%sbar' % oldstate
805 805 > cmdtable = {}
806 806 > command = registrar.command(cmdtable)
807 807 >
808 808 > @command(b'nohelp',
809 809 > [(b'', b'longdesc', 3, b'x'*67),
810 810 > (b'n', b'', None, b'normal desc'),
811 811 > (b'', b'newline', b'', b'line1\nline2'),
812 812 > (b'', b'callableopt', func, b'adds foo'),
813 813 > (b'', b'customopt', customopt(''), b'adds bar'),
814 814 > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')],
815 815 > b'hg nohelp',
816 816 > norepo=True)
817 817 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
818 818 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
819 819 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
820 820 > def nohelp(ui, *args, **kwargs):
821 821 > pass
822 822 >
823 823 > @command(b'hashelp', [], b'hg hashelp', norepo=True)
824 824 > def hashelp(ui, *args, **kwargs):
825 825 > """Extension command's help"""
826 826 > pass
827 827 >
828 828 > def uisetup(ui):
829 829 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
830 830 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
831 831 > ui.setconfig(b'alias', b'hgalias:doc', b'My doc', b'helpext')
832 832 > ui.setconfig(b'alias', b'hgalias:category', b'navigation', b'helpext')
833 833 > ui.setconfig(b'alias', b'hgaliasnodoc', b'summary', b'helpext')
834 834 >
835 835 > EOF
836 836 $ echo '[extensions]' >> $HGRCPATH
837 837 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
838 838
839 839 Test for aliases
840 840
841 841 $ hg help | grep hgalias
842 842 hgalias My doc
843 843
844 844 $ hg help hgalias
845 845 hg hgalias [--remote]
846 846
847 847 alias for: hg summary
848 848
849 849 My doc
850 850
851 851 defined by: helpext
852 852
853 853 options:
854 854
855 855 --remote check for push and pull
856 856
857 857 (some details hidden, use --verbose to show complete help)
858 858 $ hg help hgaliasnodoc
859 859 hg hgaliasnodoc [--remote]
860 860
861 861 alias for: hg summary
862 862
863 863 summarize working directory state
864 864
865 865 This generates a brief summary of the working directory state, including
866 866 parents, branch, commit status, phase and available updates.
867 867
868 868 With the --remote option, this will check the default paths for incoming
869 869 and outgoing changes. This can be time-consuming.
870 870
871 871 Returns 0 on success.
872 872
873 873 defined by: helpext
874 874
875 875 options:
876 876
877 877 --remote check for push and pull
878 878
879 879 (some details hidden, use --verbose to show complete help)
880 880
881 881 $ hg help shellalias
882 882 hg shellalias
883 883
884 884 shell alias for: echo hi
885 885
886 886 (no help text available)
887 887
888 888 defined by: helpext
889 889
890 890 (some details hidden, use --verbose to show complete help)
891 891
892 892 Test command with no help text
893 893
894 894 $ hg help nohelp
895 895 hg nohelp
896 896
897 897 (no help text available)
898 898
899 899 options:
900 900
901 901 --longdesc VALUE
902 902 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
903 903 xxxxxxxxxxxxxxxxxxxxxxx (default: 3)
904 904 -n -- normal desc
905 905 --newline VALUE line1 line2
906 906 --callableopt VALUE adds foo
907 907 --customopt VALUE adds bar
908 908 --customopt-withdefault VALUE adds bar (default: foo)
909 909
910 910 (some details hidden, use --verbose to show complete help)
911 911
912 912 Test that default list of commands includes extension commands that have help,
913 913 but not those that don't, except in verbose mode, when a keyword is passed, or
914 914 when help about the extension is requested.
915 915
916 916 #if no-extraextensions
917 917
918 918 $ hg help | grep hashelp
919 919 hashelp Extension command's help
920 920 $ hg help | grep nohelp
921 921 [1]
922 922 $ hg help -v | grep nohelp
923 923 nohelp (no help text available)
924 924
925 925 $ hg help -k nohelp
926 926 Commands:
927 927
928 928 nohelp hg nohelp
929 929
930 930 Extension Commands:
931 931
932 932 nohelp (no help text available)
933 933
934 934 $ hg help helpext
935 935 helpext extension - no help text available
936 936
937 937 list of commands:
938 938
939 939 hashelp Extension command's help
940 940 nohelp (no help text available)
941 941
942 942 (use 'hg help -v helpext' to show built-in aliases and global options)
943 943
944 944 #endif
945 945
946 946 Test list of internal help commands
947 947
948 948 $ hg help debug
949 949 debug commands (internal and unsupported):
950 950
951 951 debugancestor
952 952 find the ancestor revision of two revisions in a given index
953 953 debugapplystreamclonebundle
954 954 apply a stream clone bundle file
955 955 debugbuilddag
956 956 builds a repo with a given DAG from scratch in the current
957 957 empty repo
958 958 debugbundle lists the contents of a bundle
959 959 debugcapabilities
960 960 lists the capabilities of a remote peer
961 961 debugcheckstate
962 962 validate the correctness of the current dirstate
963 963 debugcolor show available color, effects or style
964 964 debugcommands
965 965 list all available commands and options
966 966 debugcomplete
967 967 returns the completion list associated with the given command
968 968 debugcreatestreamclonebundle
969 969 create a stream clone bundle file
970 970 debugdag format the changelog or an index DAG as a concise textual
971 971 description
972 972 debugdata dump the contents of a data file revision
973 973 debugdate parse and display a date
974 974 debugdeltachain
975 975 dump information about delta chains in a revlog
976 976 debugdirstate
977 977 show the contents of the current dirstate
978 978 debugdiscovery
979 979 runs the changeset discovery protocol in isolation
980 980 debugdownload
981 981 download a resource using Mercurial logic and config
982 982 debugextensions
983 983 show information about active extensions
984 984 debugfileset parse and apply a fileset specification
985 985 debugformat display format information about the current repository
986 986 debugfsinfo show information detected about current filesystem
987 987 debuggetbundle
988 988 retrieves a bundle from a repo
989 989 debugignore display the combined ignore pattern and information about
990 990 ignored files
991 991 debugindex dump index data for a storage primitive
992 992 debugindexdot
993 993 dump an index DAG as a graphviz dot file
994 994 debugindexstats
995 995 show stats related to the changelog index
996 996 debuginstall test Mercurial installation
997 997 debugknown test whether node ids are known to a repo
998 998 debuglocks show or modify state of locks
999 999 debugmanifestfulltextcache
1000 1000 show, clear or amend the contents of the manifest fulltext
1001 1001 cache
1002 1002 debugmergestate
1003 1003 print merge state
1004 1004 debugnamecomplete
1005 1005 complete "names" - tags, open branch names, bookmark names
1006 1006 debugobsolete
1007 1007 create arbitrary obsolete marker
1008 1008 debugoptADV (no help text available)
1009 1009 debugoptDEP (no help text available)
1010 1010 debugoptEXP (no help text available)
1011 1011 debugpathcomplete
1012 1012 complete part or all of a tracked path
1013 1013 debugpeer establish a connection to a peer repository
1014 1014 debugpickmergetool
1015 1015 examine which merge tool is chosen for specified file
1016 1016 debugpushkey access the pushkey key/value protocol
1017 1017 debugpvec (no help text available)
1018 1018 debugrebuilddirstate
1019 1019 rebuild the dirstate as it would look like for the given
1020 1020 revision
1021 1021 debugrebuildfncache
1022 1022 rebuild the fncache file
1023 1023 debugrename dump rename information
1024 1024 debugrevlog show data and statistics about a revlog
1025 1025 debugrevlogindex
1026 1026 dump the contents of a revlog index
1027 1027 debugrevspec parse and apply a revision specification
1028 1028 debugserve run a server with advanced settings
1029 1029 debugsetparents
1030 1030 manually set the parents of the current working directory
1031 1031 debugssl test a secure connection to a server
1032 1032 debugsub (no help text available)
1033 1033 debugsuccessorssets
1034 1034 show set of successors for revision
1035 1035 debugtemplate
1036 1036 parse and apply a template
1037 1037 debuguigetpass
1038 1038 show prompt to type password
1039 1039 debuguiprompt
1040 1040 show plain prompt
1041 1041 debugupdatecaches
1042 1042 warm all known caches in the repository
1043 1043 debugupgraderepo
1044 1044 upgrade a repository to use different features
1045 1045 debugwalk show how files match on given patterns
1046 1046 debugwhyunstable
1047 1047 explain instabilities of a changeset
1048 1048 debugwireargs
1049 1049 (no help text available)
1050 1050 debugwireproto
1051 1051 send wire protocol commands to a server
1052 1052
1053 1053 (use 'hg help -v debug' to show built-in aliases and global options)
1054 1054
1055 1055 internals topic renders index of available sub-topics
1056 1056
1057 1057 $ hg help internals
1058 1058 Technical implementation topics
1059 1059 """""""""""""""""""""""""""""""
1060 1060
1061 1061 To access a subtopic, use "hg help internals.{subtopic-name}"
1062 1062
1063 1063 bundle2 Bundle2
1064 1064 bundles Bundles
1065 1065 cbor CBOR
1066 1066 censor Censor
1067 1067 changegroups Changegroups
1068 1068 config Config Registrar
1069 extensions Extension API
1069 1070 requirements Repository Requirements
1070 1071 revlogs Revision Logs
1071 1072 wireprotocol Wire Protocol
1072 1073 wireprotocolrpc
1073 1074 Wire Protocol RPC
1074 1075 wireprotocolv2
1075 1076 Wire Protocol Version 2
1076 1077
1077 1078 sub-topics can be accessed
1078 1079
1079 1080 $ hg help internals.changegroups
1080 1081 Changegroups
1081 1082 """"""""""""
1082 1083
1083 1084 Changegroups are representations of repository revlog data, specifically
1084 1085 the changelog data, root/flat manifest data, treemanifest data, and
1085 1086 filelogs.
1086 1087
1087 1088 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1088 1089 level, versions "1" and "2" are almost exactly the same, with the only
1089 1090 difference being an additional item in the *delta header*. Version "3"
1090 1091 adds support for storage flags in the *delta header* and optionally
1091 1092 exchanging treemanifests (enabled by setting an option on the
1092 1093 "changegroup" part in the bundle2).
1093 1094
1094 1095 Changegroups when not exchanging treemanifests consist of 3 logical
1095 1096 segments:
1096 1097
1097 1098 +---------------------------------+
1098 1099 | | | |
1099 1100 | changeset | manifest | filelogs |
1100 1101 | | | |
1101 1102 | | | |
1102 1103 +---------------------------------+
1103 1104
1104 1105 When exchanging treemanifests, there are 4 logical segments:
1105 1106
1106 1107 +-------------------------------------------------+
1107 1108 | | | | |
1108 1109 | changeset | root | treemanifests | filelogs |
1109 1110 | | manifest | | |
1110 1111 | | | | |
1111 1112 +-------------------------------------------------+
1112 1113
1113 1114 The principle building block of each segment is a *chunk*. A *chunk* is a
1114 1115 framed piece of data:
1115 1116
1116 1117 +---------------------------------------+
1117 1118 | | |
1118 1119 | length | data |
1119 1120 | (4 bytes) | (<length - 4> bytes) |
1120 1121 | | |
1121 1122 +---------------------------------------+
1122 1123
1123 1124 All integers are big-endian signed integers. Each chunk starts with a
1124 1125 32-bit integer indicating the length of the entire chunk (including the
1125 1126 length field itself).
1126 1127
1127 1128 There is a special case chunk that has a value of 0 for the length
1128 1129 ("0x00000000"). We call this an *empty chunk*.
1129 1130
1130 1131 Delta Groups
1131 1132 ============
1132 1133
1133 1134 A *delta group* expresses the content of a revlog as a series of deltas,
1134 1135 or patches against previous revisions.
1135 1136
1136 1137 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1137 1138 to signal the end of the delta group:
1138 1139
1139 1140 +------------------------------------------------------------------------+
1140 1141 | | | | | |
1141 1142 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1142 1143 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1143 1144 | | | | | |
1144 1145 +------------------------------------------------------------------------+
1145 1146
1146 1147 Each *chunk*'s data consists of the following:
1147 1148
1148 1149 +---------------------------------------+
1149 1150 | | |
1150 1151 | delta header | delta data |
1151 1152 | (various by version) | (various) |
1152 1153 | | |
1153 1154 +---------------------------------------+
1154 1155
1155 1156 The *delta data* is a series of *delta*s that describe a diff from an
1156 1157 existing entry (either that the recipient already has, or previously
1157 1158 specified in the bundle/changegroup).
1158 1159
1159 1160 The *delta header* is different between versions "1", "2", and "3" of the
1160 1161 changegroup format.
1161 1162
1162 1163 Version 1 (headerlen=80):
1163 1164
1164 1165 +------------------------------------------------------+
1165 1166 | | | | |
1166 1167 | node | p1 node | p2 node | link node |
1167 1168 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1168 1169 | | | | |
1169 1170 +------------------------------------------------------+
1170 1171
1171 1172 Version 2 (headerlen=100):
1172 1173
1173 1174 +------------------------------------------------------------------+
1174 1175 | | | | | |
1175 1176 | node | p1 node | p2 node | base node | link node |
1176 1177 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1177 1178 | | | | | |
1178 1179 +------------------------------------------------------------------+
1179 1180
1180 1181 Version 3 (headerlen=102):
1181 1182
1182 1183 +------------------------------------------------------------------------------+
1183 1184 | | | | | | |
1184 1185 | node | p1 node | p2 node | base node | link node | flags |
1185 1186 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1186 1187 | | | | | | |
1187 1188 +------------------------------------------------------------------------------+
1188 1189
1189 1190 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1190 1191 contain a series of *delta*s, densely packed (no separators). These deltas
1191 1192 describe a diff from an existing entry (either that the recipient already
1192 1193 has, or previously specified in the bundle/changegroup). The format is
1193 1194 described more fully in "hg help internals.bdiff", but briefly:
1194 1195
1195 1196 +---------------------------------------------------------------+
1196 1197 | | | | |
1197 1198 | start offset | end offset | new length | content |
1198 1199 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1199 1200 | | | | |
1200 1201 +---------------------------------------------------------------+
1201 1202
1202 1203 Please note that the length field in the delta data does *not* include
1203 1204 itself.
1204 1205
1205 1206 In version 1, the delta is always applied against the previous node from
1206 1207 the changegroup or the first parent if this is the first entry in the
1207 1208 changegroup.
1208 1209
1209 1210 In version 2 and up, the delta base node is encoded in the entry in the
1210 1211 changegroup. This allows the delta to be expressed against any parent,
1211 1212 which can result in smaller deltas and more efficient encoding of data.
1212 1213
1213 1214 The *flags* field holds bitwise flags affecting the processing of revision
1214 1215 data. The following flags are defined:
1215 1216
1216 1217 32768
1217 1218 Censored revision. The revision's fulltext has been replaced by censor
1218 1219 metadata. May only occur on file revisions.
1219 1220
1220 1221 16384
1221 1222 Ellipsis revision. Revision hash does not match data (likely due to
1222 1223 rewritten parents).
1223 1224
1224 1225 8192
1225 1226 Externally stored. The revision fulltext contains "key:value" "\n"
1226 1227 delimited metadata defining an object stored elsewhere. Used by the LFS
1227 1228 extension.
1228 1229
1229 1230 For historical reasons, the integer values are identical to revlog version
1230 1231 1 per-revision storage flags and correspond to bits being set in this
1231 1232 2-byte field. Bits were allocated starting from the most-significant bit,
1232 1233 hence the reverse ordering and allocation of these flags.
1233 1234
1234 1235 Changeset Segment
1235 1236 =================
1236 1237
1237 1238 The *changeset segment* consists of a single *delta group* holding
1238 1239 changelog data. The *empty chunk* at the end of the *delta group* denotes
1239 1240 the boundary to the *manifest segment*.
1240 1241
1241 1242 Manifest Segment
1242 1243 ================
1243 1244
1244 1245 The *manifest segment* consists of a single *delta group* holding manifest
1245 1246 data. If treemanifests are in use, it contains only the manifest for the
1246 1247 root directory of the repository. Otherwise, it contains the entire
1247 1248 manifest data. The *empty chunk* at the end of the *delta group* denotes
1248 1249 the boundary to the next segment (either the *treemanifests segment* or
1249 1250 the *filelogs segment*, depending on version and the request options).
1250 1251
1251 1252 Treemanifests Segment
1252 1253 ---------------------
1253 1254
1254 1255 The *treemanifests segment* only exists in changegroup version "3", and
1255 1256 only if the 'treemanifest' param is part of the bundle2 changegroup part
1256 1257 (it is not possible to use changegroup version 3 outside of bundle2).
1257 1258 Aside from the filenames in the *treemanifests segment* containing a
1258 1259 trailing "/" character, it behaves identically to the *filelogs segment*
1259 1260 (see below). The final sub-segment is followed by an *empty chunk*
1260 1261 (logically, a sub-segment with filename size 0). This denotes the boundary
1261 1262 to the *filelogs segment*.
1262 1263
1263 1264 Filelogs Segment
1264 1265 ================
1265 1266
1266 1267 The *filelogs segment* consists of multiple sub-segments, each
1267 1268 corresponding to an individual file whose data is being described:
1268 1269
1269 1270 +--------------------------------------------------+
1270 1271 | | | | | |
1271 1272 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1272 1273 | | | | | (4 bytes) |
1273 1274 | | | | | |
1274 1275 +--------------------------------------------------+
1275 1276
1276 1277 The final filelog sub-segment is followed by an *empty chunk* (logically,
1277 1278 a sub-segment with filename size 0). This denotes the end of the segment
1278 1279 and of the overall changegroup.
1279 1280
1280 1281 Each filelog sub-segment consists of the following:
1281 1282
1282 1283 +------------------------------------------------------+
1283 1284 | | | |
1284 1285 | filename length | filename | delta group |
1285 1286 | (4 bytes) | (<length - 4> bytes) | (various) |
1286 1287 | | | |
1287 1288 +------------------------------------------------------+
1288 1289
1289 1290 That is, a *chunk* consisting of the filename (not terminated or padded)
1290 1291 followed by N chunks constituting the *delta group* for this file. The
1291 1292 *empty chunk* at the end of each *delta group* denotes the boundary to the
1292 1293 next filelog sub-segment.
1293 1294
1294 1295 test advanced, deprecated and experimental options are hidden in command help
1295 1296 $ hg help debugoptADV
1296 1297 hg debugoptADV
1297 1298
1298 1299 (no help text available)
1299 1300
1300 1301 options:
1301 1302
1302 1303 (some details hidden, use --verbose to show complete help)
1303 1304 $ hg help debugoptDEP
1304 1305 hg debugoptDEP
1305 1306
1306 1307 (no help text available)
1307 1308
1308 1309 options:
1309 1310
1310 1311 (some details hidden, use --verbose to show complete help)
1311 1312
1312 1313 $ hg help debugoptEXP
1313 1314 hg debugoptEXP
1314 1315
1315 1316 (no help text available)
1316 1317
1317 1318 options:
1318 1319
1319 1320 (some details hidden, use --verbose to show complete help)
1320 1321
1321 1322 test advanced, deprecated and experimental options are shown with -v
1322 1323 $ hg help -v debugoptADV | grep aopt
1323 1324 --aopt option is (ADVANCED)
1324 1325 $ hg help -v debugoptDEP | grep dopt
1325 1326 --dopt option is (DEPRECATED)
1326 1327 $ hg help -v debugoptEXP | grep eopt
1327 1328 --eopt option is (EXPERIMENTAL)
1328 1329
1329 1330 #if gettext
1330 1331 test deprecated option is hidden with translation with untranslated description
1331 1332 (use many globy for not failing on changed transaction)
1332 1333 $ LANGUAGE=sv hg help debugoptDEP
1333 1334 hg debugoptDEP
1334 1335
1335 1336 (*) (glob)
1336 1337
1337 1338 options:
1338 1339
1339 1340 (some details hidden, use --verbose to show complete help)
1340 1341 #endif
1341 1342
1342 1343 Test commands that collide with topics (issue4240)
1343 1344
1344 1345 $ hg config -hq
1345 1346 hg config [-u] [NAME]...
1346 1347
1347 1348 show combined config settings from all hgrc files
1348 1349 $ hg showconfig -hq
1349 1350 hg config [-u] [NAME]...
1350 1351
1351 1352 show combined config settings from all hgrc files
1352 1353
1353 1354 Test a help topic
1354 1355
1355 1356 $ hg help dates
1356 1357 Date Formats
1357 1358 """"""""""""
1358 1359
1359 1360 Some commands allow the user to specify a date, e.g.:
1360 1361
1361 1362 - backout, commit, import, tag: Specify the commit date.
1362 1363 - log, revert, update: Select revision(s) by date.
1363 1364
1364 1365 Many date formats are valid. Here are some examples:
1365 1366
1366 1367 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1367 1368 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1368 1369 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1369 1370 - "Dec 6" (midnight)
1370 1371 - "13:18" (today assumed)
1371 1372 - "3:39" (3:39AM assumed)
1372 1373 - "3:39pm" (15:39)
1373 1374 - "2006-12-06 13:18:29" (ISO 8601 format)
1374 1375 - "2006-12-6 13:18"
1375 1376 - "2006-12-6"
1376 1377 - "12-6"
1377 1378 - "12/6"
1378 1379 - "12/6/6" (Dec 6 2006)
1379 1380 - "today" (midnight)
1380 1381 - "yesterday" (midnight)
1381 1382 - "now" - right now
1382 1383
1383 1384 Lastly, there is Mercurial's internal format:
1384 1385
1385 1386 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1386 1387
1387 1388 This is the internal representation format for dates. The first number is
1388 1389 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1389 1390 is the offset of the local timezone, in seconds west of UTC (negative if
1390 1391 the timezone is east of UTC).
1391 1392
1392 1393 The log command also accepts date ranges:
1393 1394
1394 1395 - "<DATE" - at or before a given date/time
1395 1396 - ">DATE" - on or after a given date/time
1396 1397 - "DATE to DATE" - a date range, inclusive
1397 1398 - "-DAYS" - within a given number of days of today
1398 1399
1399 1400 Test repeated config section name
1400 1401
1401 1402 $ hg help config.host
1402 1403 "http_proxy.host"
1403 1404 Host name and (optional) port of the proxy server, for example
1404 1405 "myproxy:8000".
1405 1406
1406 1407 "smtp.host"
1407 1408 Host name of mail server, e.g. "mail.example.com".
1408 1409
1409 1410
1410 1411 Test section name with dot
1411 1412
1412 1413 $ hg help config.ui.username
1413 1414 "ui.username"
1414 1415 The committer of a changeset created when running "commit". Typically
1415 1416 a person's name and email address, e.g. "Fred Widget
1416 1417 <fred@example.com>". Environment variables in the username are
1417 1418 expanded.
1418 1419
1419 1420 (default: "$EMAIL" or "username@hostname". If the username in hgrc is
1420 1421 empty, e.g. if the system admin set "username =" in the system hgrc,
1421 1422 it has to be specified manually or in a different hgrc file)
1422 1423
1423 1424
1424 1425 $ hg help config.annotate.git
1425 1426 abort: help section not found: config.annotate.git
1426 1427 [255]
1427 1428
1428 1429 $ hg help config.update.check
1429 1430 "commands.update.check"
1430 1431 Determines what level of checking 'hg update' will perform before
1431 1432 moving to a destination revision. Valid values are "abort", "none",
1432 1433 "linear", and "noconflict". "abort" always fails if the working
1433 1434 directory has uncommitted changes. "none" performs no checking, and
1434 1435 may result in a merge with uncommitted changes. "linear" allows any
1435 1436 update as long as it follows a straight line in the revision history,
1436 1437 and may trigger a merge with uncommitted changes. "noconflict" will
1437 1438 allow any update which would not trigger a merge with uncommitted
1438 1439 changes, if any are present. (default: "linear")
1439 1440
1440 1441
1441 1442 $ hg help config.commands.update.check
1442 1443 "commands.update.check"
1443 1444 Determines what level of checking 'hg update' will perform before
1444 1445 moving to a destination revision. Valid values are "abort", "none",
1445 1446 "linear", and "noconflict". "abort" always fails if the working
1446 1447 directory has uncommitted changes. "none" performs no checking, and
1447 1448 may result in a merge with uncommitted changes. "linear" allows any
1448 1449 update as long as it follows a straight line in the revision history,
1449 1450 and may trigger a merge with uncommitted changes. "noconflict" will
1450 1451 allow any update which would not trigger a merge with uncommitted
1451 1452 changes, if any are present. (default: "linear")
1452 1453
1453 1454
1454 1455 $ hg help config.ommands.update.check
1455 1456 abort: help section not found: config.ommands.update.check
1456 1457 [255]
1457 1458
1458 1459 Unrelated trailing paragraphs shouldn't be included
1459 1460
1460 1461 $ hg help config.extramsg | grep '^$'
1461 1462
1462 1463
1463 1464 Test capitalized section name
1464 1465
1465 1466 $ hg help scripting.HGPLAIN > /dev/null
1466 1467
1467 1468 Help subsection:
1468 1469
1469 1470 $ hg help config.charsets |grep "Email example:" > /dev/null
1470 1471 [1]
1471 1472
1472 1473 Show nested definitions
1473 1474 ("profiling.type"[break]"ls"[break]"stat"[break])
1474 1475
1475 1476 $ hg help config.type | egrep '^$'|wc -l
1476 1477 \s*3 (re)
1477 1478
1478 1479 $ hg help config.profiling.type.ls
1479 1480 "profiling.type.ls"
1480 1481 Use Python's built-in instrumenting profiler. This profiler works on
1481 1482 all platforms, but each line number it reports is the first line of
1482 1483 a function. This restriction makes it difficult to identify the
1483 1484 expensive parts of a non-trivial function.
1484 1485
1485 1486
1486 1487 Separate sections from subsections
1487 1488
1488 1489 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1489 1490 "format"
1490 1491 --------
1491 1492
1492 1493 "usegeneraldelta"
1493 1494
1494 1495 "dotencode"
1495 1496
1496 1497 "usefncache"
1497 1498
1498 1499 "usestore"
1499 1500
1500 1501 "profiling"
1501 1502 -----------
1502 1503
1503 1504 "format"
1504 1505
1505 1506 "progress"
1506 1507 ----------
1507 1508
1508 1509 "format"
1509 1510
1510 1511
1511 1512 Last item in help config.*:
1512 1513
1513 1514 $ hg help config.`hg help config|grep '^ "'| \
1514 1515 > tail -1|sed 's![ "]*!!g'`| \
1515 1516 > grep 'hg help -c config' > /dev/null
1516 1517 [1]
1517 1518
1518 1519 note to use help -c for general hg help config:
1519 1520
1520 1521 $ hg help config |grep 'hg help -c config' > /dev/null
1521 1522
1522 1523 Test templating help
1523 1524
1524 1525 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1525 1526 desc String. The text of the changeset description.
1526 1527 diffstat String. Statistics of changes with the following format:
1527 1528 firstline Any text. Returns the first line of text.
1528 1529 nonempty Any text. Returns '(none)' if the string is empty.
1529 1530
1530 1531 Test deprecated items
1531 1532
1532 1533 $ hg help -v templating | grep currentbookmark
1533 1534 currentbookmark
1534 1535 $ hg help templating | (grep currentbookmark || true)
1535 1536
1536 1537 Test help hooks
1537 1538
1538 1539 $ cat > helphook1.py <<EOF
1539 1540 > from mercurial import help
1540 1541 >
1541 1542 > def rewrite(ui, topic, doc):
1542 1543 > return doc + b'\nhelphook1\n'
1543 1544 >
1544 1545 > def extsetup(ui):
1545 1546 > help.addtopichook(b'revisions', rewrite)
1546 1547 > EOF
1547 1548 $ cat > helphook2.py <<EOF
1548 1549 > from mercurial import help
1549 1550 >
1550 1551 > def rewrite(ui, topic, doc):
1551 1552 > return doc + b'\nhelphook2\n'
1552 1553 >
1553 1554 > def extsetup(ui):
1554 1555 > help.addtopichook(b'revisions', rewrite)
1555 1556 > EOF
1556 1557 $ echo '[extensions]' >> $HGRCPATH
1557 1558 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1558 1559 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1559 1560 $ hg help revsets | grep helphook
1560 1561 helphook1
1561 1562 helphook2
1562 1563
1563 1564 help -c should only show debug --debug
1564 1565
1565 1566 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1566 1567 [1]
1567 1568
1568 1569 help -c should only show deprecated for -v
1569 1570
1570 1571 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1571 1572 [1]
1572 1573
1573 1574 Test -s / --system
1574 1575
1575 1576 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1576 1577 > wc -l | sed -e 's/ //g'
1577 1578 0
1578 1579 $ hg help config.files --system unix | grep 'USER' | \
1579 1580 > wc -l | sed -e 's/ //g'
1580 1581 0
1581 1582
1582 1583 Test -e / -c / -k combinations
1583 1584
1584 1585 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1585 1586 Commands:
1586 1587 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1587 1588 Extensions:
1588 1589 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1589 1590 Topics:
1590 1591 Commands:
1591 1592 Extensions:
1592 1593 Extension Commands:
1593 1594 $ hg help -c schemes
1594 1595 abort: no such help topic: schemes
1595 1596 (try 'hg help --keyword schemes')
1596 1597 [255]
1597 1598 $ hg help -e schemes |head -1
1598 1599 schemes extension - extend schemes with shortcuts to repository swarms
1599 1600 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1600 1601 Commands:
1601 1602 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1602 1603 Extensions:
1603 1604 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1604 1605 Extensions:
1605 1606 Commands:
1606 1607 $ hg help -c commit > /dev/null
1607 1608 $ hg help -e -c commit > /dev/null
1608 1609 $ hg help -e commit
1609 1610 abort: no such help topic: commit
1610 1611 (try 'hg help --keyword commit')
1611 1612 [255]
1612 1613
1613 1614 Test keyword search help
1614 1615
1615 1616 $ cat > prefixedname.py <<EOF
1616 1617 > '''matched against word "clone"
1617 1618 > '''
1618 1619 > EOF
1619 1620 $ echo '[extensions]' >> $HGRCPATH
1620 1621 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1621 1622 $ hg help -k clone
1622 1623 Topics:
1623 1624
1624 1625 config Configuration Files
1625 1626 extensions Using Additional Features
1626 1627 glossary Glossary
1627 1628 phases Working with Phases
1628 1629 subrepos Subrepositories
1629 1630 urls URL Paths
1630 1631
1631 1632 Commands:
1632 1633
1633 1634 bookmarks create a new bookmark or list existing bookmarks
1634 1635 clone make a copy of an existing repository
1635 1636 paths show aliases for remote repositories
1636 1637 pull pull changes from the specified source
1637 1638 update update working directory (or switch revisions)
1638 1639
1639 1640 Extensions:
1640 1641
1641 1642 clonebundles advertise pre-generated bundles to seed clones
1642 1643 narrow create clones which fetch history data for subset of files
1643 1644 (EXPERIMENTAL)
1644 1645 prefixedname matched against word "clone"
1645 1646 relink recreates hardlinks between repository clones
1646 1647
1647 1648 Extension Commands:
1648 1649
1649 1650 qclone clone main and patch repository at same time
1650 1651
1651 1652 Test unfound topic
1652 1653
1653 1654 $ hg help nonexistingtopicthatwillneverexisteverever
1654 1655 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1655 1656 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1656 1657 [255]
1657 1658
1658 1659 Test unfound keyword
1659 1660
1660 1661 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1661 1662 abort: no matches
1662 1663 (try 'hg help' for a list of topics)
1663 1664 [255]
1664 1665
1665 1666 Test omit indicating for help
1666 1667
1667 1668 $ cat > addverboseitems.py <<EOF
1668 1669 > '''extension to test omit indicating.
1669 1670 >
1670 1671 > This paragraph is never omitted (for extension)
1671 1672 >
1672 1673 > .. container:: verbose
1673 1674 >
1674 1675 > This paragraph is omitted,
1675 1676 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1676 1677 >
1677 1678 > This paragraph is never omitted, too (for extension)
1678 1679 > '''
1679 1680 > from __future__ import absolute_import
1680 1681 > from mercurial import commands, help
1681 1682 > testtopic = b"""This paragraph is never omitted (for topic).
1682 1683 >
1683 1684 > .. container:: verbose
1684 1685 >
1685 1686 > This paragraph is omitted,
1686 1687 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1687 1688 >
1688 1689 > This paragraph is never omitted, too (for topic)
1689 1690 > """
1690 1691 > def extsetup(ui):
1691 1692 > help.helptable.append(([b"topic-containing-verbose"],
1692 1693 > b"This is the topic to test omit indicating.",
1693 1694 > lambda ui: testtopic))
1694 1695 > EOF
1695 1696 $ echo '[extensions]' >> $HGRCPATH
1696 1697 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1697 1698 $ hg help addverboseitems
1698 1699 addverboseitems extension - extension to test omit indicating.
1699 1700
1700 1701 This paragraph is never omitted (for extension)
1701 1702
1702 1703 This paragraph is never omitted, too (for extension)
1703 1704
1704 1705 (some details hidden, use --verbose to show complete help)
1705 1706
1706 1707 no commands defined
1707 1708 $ hg help -v addverboseitems
1708 1709 addverboseitems extension - extension to test omit indicating.
1709 1710
1710 1711 This paragraph is never omitted (for extension)
1711 1712
1712 1713 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1713 1714 extension)
1714 1715
1715 1716 This paragraph is never omitted, too (for extension)
1716 1717
1717 1718 no commands defined
1718 1719 $ hg help topic-containing-verbose
1719 1720 This is the topic to test omit indicating.
1720 1721 """"""""""""""""""""""""""""""""""""""""""
1721 1722
1722 1723 This paragraph is never omitted (for topic).
1723 1724
1724 1725 This paragraph is never omitted, too (for topic)
1725 1726
1726 1727 (some details hidden, use --verbose to show complete help)
1727 1728 $ hg help -v topic-containing-verbose
1728 1729 This is the topic to test omit indicating.
1729 1730 """"""""""""""""""""""""""""""""""""""""""
1730 1731
1731 1732 This paragraph is never omitted (for topic).
1732 1733
1733 1734 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1734 1735 topic)
1735 1736
1736 1737 This paragraph is never omitted, too (for topic)
1737 1738
1738 1739 Test section lookup
1739 1740
1740 1741 $ hg help revset.merge
1741 1742 "merge()"
1742 1743 Changeset is a merge changeset.
1743 1744
1744 1745 $ hg help glossary.dag
1745 1746 DAG
1746 1747 The repository of changesets of a distributed version control system
1747 1748 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1748 1749 of nodes and edges, where nodes correspond to changesets and edges
1749 1750 imply a parent -> child relation. This graph can be visualized by
1750 1751 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1751 1752 limited by the requirement for children to have at most two parents.
1752 1753
1753 1754
1754 1755 $ hg help hgrc.paths
1755 1756 "paths"
1756 1757 -------
1757 1758
1758 1759 Assigns symbolic names and behavior to repositories.
1759 1760
1760 1761 Options are symbolic names defining the URL or directory that is the
1761 1762 location of the repository. Example:
1762 1763
1763 1764 [paths]
1764 1765 my_server = https://example.com/my_repo
1765 1766 local_path = /home/me/repo
1766 1767
1767 1768 These symbolic names can be used from the command line. To pull from
1768 1769 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1769 1770 local_path'.
1770 1771
1771 1772 Options containing colons (":") denote sub-options that can influence
1772 1773 behavior for that specific path. Example:
1773 1774
1774 1775 [paths]
1775 1776 my_server = https://example.com/my_path
1776 1777 my_server:pushurl = ssh://example.com/my_path
1777 1778
1778 1779 The following sub-options can be defined:
1779 1780
1780 1781 "pushurl"
1781 1782 The URL to use for push operations. If not defined, the location
1782 1783 defined by the path's main entry is used.
1783 1784
1784 1785 "pushrev"
1785 1786 A revset defining which revisions to push by default.
1786 1787
1787 1788 When 'hg push' is executed without a "-r" argument, the revset defined
1788 1789 by this sub-option is evaluated to determine what to push.
1789 1790
1790 1791 For example, a value of "." will push the working directory's revision
1791 1792 by default.
1792 1793
1793 1794 Revsets specifying bookmarks will not result in the bookmark being
1794 1795 pushed.
1795 1796
1796 1797 The following special named paths exist:
1797 1798
1798 1799 "default"
1799 1800 The URL or directory to use when no source or remote is specified.
1800 1801
1801 1802 'hg clone' will automatically define this path to the location the
1802 1803 repository was cloned from.
1803 1804
1804 1805 "default-push"
1805 1806 (deprecated) The URL or directory for the default 'hg push' location.
1806 1807 "default:pushurl" should be used instead.
1807 1808
1808 1809 $ hg help glossary.mcguffin
1809 1810 abort: help section not found: glossary.mcguffin
1810 1811 [255]
1811 1812
1812 1813 $ hg help glossary.mc.guffin
1813 1814 abort: help section not found: glossary.mc.guffin
1814 1815 [255]
1815 1816
1816 1817 $ hg help template.files
1817 1818 files List of strings. All files modified, added, or removed by
1818 1819 this changeset.
1819 1820 files(pattern)
1820 1821 All files of the current changeset matching the pattern. See
1821 1822 'hg help patterns'.
1822 1823
1823 1824 Test section lookup by translated message
1824 1825
1825 1826 str.lower() instead of encoding.lower(str) on translated message might
1826 1827 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1827 1828 as the second or later byte of multi-byte character.
1828 1829
1829 1830 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1830 1831 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1831 1832 replacement makes message meaningless.
1832 1833
1833 1834 This tests that section lookup by translated string isn't broken by
1834 1835 such str.lower().
1835 1836
1836 1837 $ "$PYTHON" <<EOF
1837 1838 > def escape(s):
1838 1839 > return b''.join(b'\\u%x' % ord(uc) for uc in s.decode('cp932'))
1839 1840 > # translation of "record" in ja_JP.cp932
1840 1841 > upper = b"\x8bL\x98^"
1841 1842 > # str.lower()-ed section name should be treated as different one
1842 1843 > lower = b"\x8bl\x98^"
1843 1844 > with open('ambiguous.py', 'wb') as fp:
1844 1845 > fp.write(b"""# ambiguous section names in ja_JP.cp932
1845 1846 > u'''summary of extension
1846 1847 >
1847 1848 > %s
1848 1849 > ----
1849 1850 >
1850 1851 > Upper name should show only this message
1851 1852 >
1852 1853 > %s
1853 1854 > ----
1854 1855 >
1855 1856 > Lower name should show only this message
1856 1857 >
1857 1858 > subsequent section
1858 1859 > ------------------
1859 1860 >
1860 1861 > This should be hidden at 'hg help ambiguous' with section name.
1861 1862 > '''
1862 1863 > """ % (escape(upper), escape(lower)))
1863 1864 > EOF
1864 1865
1865 1866 $ cat >> $HGRCPATH <<EOF
1866 1867 > [extensions]
1867 1868 > ambiguous = ./ambiguous.py
1868 1869 > EOF
1869 1870
1870 1871 $ "$PYTHON" <<EOF | sh
1871 1872 > from mercurial import pycompat
1872 1873 > upper = b"\x8bL\x98^"
1873 1874 > pycompat.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % upper)
1874 1875 > EOF
1875 1876 \x8bL\x98^ (esc)
1876 1877 ----
1877 1878
1878 1879 Upper name should show only this message
1879 1880
1880 1881
1881 1882 $ "$PYTHON" <<EOF | sh
1882 1883 > from mercurial import pycompat
1883 1884 > lower = b"\x8bl\x98^"
1884 1885 > pycompat.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % lower)
1885 1886 > EOF
1886 1887 \x8bl\x98^ (esc)
1887 1888 ----
1888 1889
1889 1890 Lower name should show only this message
1890 1891
1891 1892
1892 1893 $ cat >> $HGRCPATH <<EOF
1893 1894 > [extensions]
1894 1895 > ambiguous = !
1895 1896 > EOF
1896 1897
1897 1898 Show help content of disabled extensions
1898 1899
1899 1900 $ cat >> $HGRCPATH <<EOF
1900 1901 > [extensions]
1901 1902 > ambiguous = !./ambiguous.py
1902 1903 > EOF
1903 1904 $ hg help -e ambiguous
1904 1905 ambiguous extension - (no help text available)
1905 1906
1906 1907 (use 'hg help extensions' for information on enabling extensions)
1907 1908
1908 1909 Test dynamic list of merge tools only shows up once
1909 1910 $ hg help merge-tools
1910 1911 Merge Tools
1911 1912 """""""""""
1912 1913
1913 1914 To merge files Mercurial uses merge tools.
1914 1915
1915 1916 A merge tool combines two different versions of a file into a merged file.
1916 1917 Merge tools are given the two files and the greatest common ancestor of
1917 1918 the two file versions, so they can determine the changes made on both
1918 1919 branches.
1919 1920
1920 1921 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1921 1922 backout' and in several extensions.
1922 1923
1923 1924 Usually, the merge tool tries to automatically reconcile the files by
1924 1925 combining all non-overlapping changes that occurred separately in the two
1925 1926 different evolutions of the same initial base file. Furthermore, some
1926 1927 interactive merge programs make it easier to manually resolve conflicting
1927 1928 merges, either in a graphical way, or by inserting some conflict markers.
1928 1929 Mercurial does not include any interactive merge programs but relies on
1929 1930 external tools for that.
1930 1931
1931 1932 Available merge tools
1932 1933 =====================
1933 1934
1934 1935 External merge tools and their properties are configured in the merge-
1935 1936 tools configuration section - see hgrc(5) - but they can often just be
1936 1937 named by their executable.
1937 1938
1938 1939 A merge tool is generally usable if its executable can be found on the
1939 1940 system and if it can handle the merge. The executable is found if it is an
1940 1941 absolute or relative executable path or the name of an application in the
1941 1942 executable search path. The tool is assumed to be able to handle the merge
1942 1943 if it can handle symlinks if the file is a symlink, if it can handle
1943 1944 binary files if the file is binary, and if a GUI is available if the tool
1944 1945 requires a GUI.
1945 1946
1946 1947 There are some internal merge tools which can be used. The internal merge
1947 1948 tools are:
1948 1949
1949 1950 ":dump"
1950 1951 Creates three versions of the files to merge, containing the contents of
1951 1952 local, other and base. These files can then be used to perform a merge
1952 1953 manually. If the file to be merged is named "a.txt", these files will
1953 1954 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1954 1955 they will be placed in the same directory as "a.txt".
1955 1956
1956 1957 This implies premerge. Therefore, files aren't dumped, if premerge runs
1957 1958 successfully. Use :forcedump to forcibly write files out.
1958 1959
1959 1960 (actual capabilities: binary, symlink)
1960 1961
1961 1962 ":fail"
1962 1963 Rather than attempting to merge files that were modified on both
1963 1964 branches, it marks them as unresolved. The resolve command must be used
1964 1965 to resolve these conflicts.
1965 1966
1966 1967 (actual capabilities: binary, symlink)
1967 1968
1968 1969 ":forcedump"
1969 1970 Creates three versions of the files as same as :dump, but omits
1970 1971 premerge.
1971 1972
1972 1973 (actual capabilities: binary, symlink)
1973 1974
1974 1975 ":local"
1975 1976 Uses the local 'p1()' version of files as the merged version.
1976 1977
1977 1978 (actual capabilities: binary, symlink)
1978 1979
1979 1980 ":merge"
1980 1981 Uses the internal non-interactive simple merge algorithm for merging
1981 1982 files. It will fail if there are any conflicts and leave markers in the
1982 1983 partially merged file. Markers will have two sections, one for each side
1983 1984 of merge.
1984 1985
1985 1986 ":merge-local"
1986 1987 Like :merge, but resolve all conflicts non-interactively in favor of the
1987 1988 local 'p1()' changes.
1988 1989
1989 1990 ":merge-other"
1990 1991 Like :merge, but resolve all conflicts non-interactively in favor of the
1991 1992 other 'p2()' changes.
1992 1993
1993 1994 ":merge3"
1994 1995 Uses the internal non-interactive simple merge algorithm for merging
1995 1996 files. It will fail if there are any conflicts and leave markers in the
1996 1997 partially merged file. Marker will have three sections, one from each
1997 1998 side of the merge and one for the base content.
1998 1999
1999 2000 ":other"
2000 2001 Uses the other 'p2()' version of files as the merged version.
2001 2002
2002 2003 (actual capabilities: binary, symlink)
2003 2004
2004 2005 ":prompt"
2005 2006 Asks the user which of the local 'p1()' or the other 'p2()' version to
2006 2007 keep as the merged version.
2007 2008
2008 2009 (actual capabilities: binary, symlink)
2009 2010
2010 2011 ":tagmerge"
2011 2012 Uses the internal tag merge algorithm (experimental).
2012 2013
2013 2014 ":union"
2014 2015 Uses the internal non-interactive simple merge algorithm for merging
2015 2016 files. It will use both left and right sides for conflict regions. No
2016 2017 markers are inserted.
2017 2018
2018 2019 Internal tools are always available and do not require a GUI but will by
2019 2020 default not handle symlinks or binary files. See next section for detail
2020 2021 about "actual capabilities" described above.
2021 2022
2022 2023 Choosing a merge tool
2023 2024 =====================
2024 2025
2025 2026 Mercurial uses these rules when deciding which merge tool to use:
2026 2027
2027 2028 1. If a tool has been specified with the --tool option to merge or
2028 2029 resolve, it is used. If it is the name of a tool in the merge-tools
2029 2030 configuration, its configuration is used. Otherwise the specified tool
2030 2031 must be executable by the shell.
2031 2032 2. If the "HGMERGE" environment variable is present, its value is used and
2032 2033 must be executable by the shell.
2033 2034 3. If the filename of the file to be merged matches any of the patterns in
2034 2035 the merge-patterns configuration section, the first usable merge tool
2035 2036 corresponding to a matching pattern is used.
2036 2037 4. If ui.merge is set it will be considered next. If the value is not the
2037 2038 name of a configured tool, the specified value is used and must be
2038 2039 executable by the shell. Otherwise the named tool is used if it is
2039 2040 usable.
2040 2041 5. If any usable merge tools are present in the merge-tools configuration
2041 2042 section, the one with the highest priority is used.
2042 2043 6. If a program named "hgmerge" can be found on the system, it is used -
2043 2044 but it will by default not be used for symlinks and binary files.
2044 2045 7. If the file to be merged is not binary and is not a symlink, then
2045 2046 internal ":merge" is used.
2046 2047 8. Otherwise, ":prompt" is used.
2047 2048
2048 2049 For historical reason, Mercurial treats merge tools as below while
2049 2050 examining rules above.
2050 2051
2051 2052 step specified via binary symlink
2052 2053 ----------------------------------
2053 2054 1. --tool o/o o/o
2054 2055 2. HGMERGE o/o o/o
2055 2056 3. merge-patterns o/o(*) x/?(*)
2056 2057 4. ui.merge x/?(*) x/?(*)
2057 2058
2058 2059 Each capability column indicates Mercurial behavior for internal/external
2059 2060 merge tools at examining each rule.
2060 2061
2061 2062 - "o": "assume that a tool has capability"
2062 2063 - "x": "assume that a tool does not have capability"
2063 2064 - "?": "check actual capability of a tool"
2064 2065
2065 2066 If "merge.strict-capability-check" configuration is true, Mercurial checks
2066 2067 capabilities of merge tools strictly in (*) cases above (= each capability
2067 2068 column becomes "?/?"). It is false by default for backward compatibility.
2068 2069
2069 2070 Note:
2070 2071 After selecting a merge program, Mercurial will by default attempt to
2071 2072 merge the files using a simple merge algorithm first. Only if it
2072 2073 doesn't succeed because of conflicting changes will Mercurial actually
2073 2074 execute the merge program. Whether to use the simple merge algorithm
2074 2075 first can be controlled by the premerge setting of the merge tool.
2075 2076 Premerge is enabled by default unless the file is binary or a symlink.
2076 2077
2077 2078 See the merge-tools and ui sections of hgrc(5) for details on the
2078 2079 configuration of merge tools.
2079 2080
2080 2081 Compression engines listed in `hg help bundlespec`
2081 2082
2082 2083 $ hg help bundlespec | grep gzip
2083 2084 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
2084 2085 An algorithm that produces smaller bundles than "gzip".
2085 2086 This engine will likely produce smaller bundles than "gzip" but will be
2086 2087 "gzip"
2087 2088 better compression than "gzip". It also frequently yields better (?)
2088 2089
2089 2090 Test usage of section marks in help documents
2090 2091
2091 2092 $ cd "$TESTDIR"/../doc
2092 2093 $ "$PYTHON" check-seclevel.py
2093 2094 $ cd $TESTTMP
2094 2095
2095 2096 #if serve
2096 2097
2097 2098 Test the help pages in hgweb.
2098 2099
2099 2100 Dish up an empty repo; serve it cold.
2100 2101
2101 2102 $ hg init "$TESTTMP/test"
2102 2103 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
2103 2104 $ cat hg.pid >> $DAEMON_PIDS
2104 2105
2105 2106 $ get-with-headers.py $LOCALIP:$HGPORT "help"
2106 2107 200 Script output follows
2107 2108
2108 2109 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2109 2110 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2110 2111 <head>
2111 2112 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2112 2113 <meta name="robots" content="index, nofollow" />
2113 2114 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2114 2115 <script type="text/javascript" src="/static/mercurial.js"></script>
2115 2116
2116 2117 <title>Help: Index</title>
2117 2118 </head>
2118 2119 <body>
2119 2120
2120 2121 <div class="container">
2121 2122 <div class="menu">
2122 2123 <div class="logo">
2123 2124 <a href="https://mercurial-scm.org/">
2124 2125 <img src="/static/hglogo.png" alt="mercurial" /></a>
2125 2126 </div>
2126 2127 <ul>
2127 2128 <li><a href="/shortlog">log</a></li>
2128 2129 <li><a href="/graph">graph</a></li>
2129 2130 <li><a href="/tags">tags</a></li>
2130 2131 <li><a href="/bookmarks">bookmarks</a></li>
2131 2132 <li><a href="/branches">branches</a></li>
2132 2133 </ul>
2133 2134 <ul>
2134 2135 <li class="active">help</li>
2135 2136 </ul>
2136 2137 </div>
2137 2138
2138 2139 <div class="main">
2139 2140 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2140 2141
2141 2142 <form class="search" action="/log">
2142 2143
2143 2144 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2144 2145 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2145 2146 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2146 2147 </form>
2147 2148 <table class="bigtable">
2148 2149 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2149 2150
2150 2151 <tr><td>
2151 2152 <a href="/help/bundlespec">
2152 2153 bundlespec
2153 2154 </a>
2154 2155 </td><td>
2155 2156 Bundle File Formats
2156 2157 </td></tr>
2157 2158 <tr><td>
2158 2159 <a href="/help/color">
2159 2160 color
2160 2161 </a>
2161 2162 </td><td>
2162 2163 Colorizing Outputs
2163 2164 </td></tr>
2164 2165 <tr><td>
2165 2166 <a href="/help/config">
2166 2167 config
2167 2168 </a>
2168 2169 </td><td>
2169 2170 Configuration Files
2170 2171 </td></tr>
2171 2172 <tr><td>
2172 2173 <a href="/help/dates">
2173 2174 dates
2174 2175 </a>
2175 2176 </td><td>
2176 2177 Date Formats
2177 2178 </td></tr>
2178 2179 <tr><td>
2179 2180 <a href="/help/deprecated">
2180 2181 deprecated
2181 2182 </a>
2182 2183 </td><td>
2183 2184 Deprecated Features
2184 2185 </td></tr>
2185 2186 <tr><td>
2186 2187 <a href="/help/diffs">
2187 2188 diffs
2188 2189 </a>
2189 2190 </td><td>
2190 2191 Diff Formats
2191 2192 </td></tr>
2192 2193 <tr><td>
2193 2194 <a href="/help/environment">
2194 2195 environment
2195 2196 </a>
2196 2197 </td><td>
2197 2198 Environment Variables
2198 2199 </td></tr>
2199 2200 <tr><td>
2200 2201 <a href="/help/extensions">
2201 2202 extensions
2202 2203 </a>
2203 2204 </td><td>
2204 2205 Using Additional Features
2205 2206 </td></tr>
2206 2207 <tr><td>
2207 2208 <a href="/help/filesets">
2208 2209 filesets
2209 2210 </a>
2210 2211 </td><td>
2211 2212 Specifying File Sets
2212 2213 </td></tr>
2213 2214 <tr><td>
2214 2215 <a href="/help/flags">
2215 2216 flags
2216 2217 </a>
2217 2218 </td><td>
2218 2219 Command-line flags
2219 2220 </td></tr>
2220 2221 <tr><td>
2221 2222 <a href="/help/glossary">
2222 2223 glossary
2223 2224 </a>
2224 2225 </td><td>
2225 2226 Glossary
2226 2227 </td></tr>
2227 2228 <tr><td>
2228 2229 <a href="/help/hgignore">
2229 2230 hgignore
2230 2231 </a>
2231 2232 </td><td>
2232 2233 Syntax for Mercurial Ignore Files
2233 2234 </td></tr>
2234 2235 <tr><td>
2235 2236 <a href="/help/hgweb">
2236 2237 hgweb
2237 2238 </a>
2238 2239 </td><td>
2239 2240 Configuring hgweb
2240 2241 </td></tr>
2241 2242 <tr><td>
2242 2243 <a href="/help/internals">
2243 2244 internals
2244 2245 </a>
2245 2246 </td><td>
2246 2247 Technical implementation topics
2247 2248 </td></tr>
2248 2249 <tr><td>
2249 2250 <a href="/help/merge-tools">
2250 2251 merge-tools
2251 2252 </a>
2252 2253 </td><td>
2253 2254 Merge Tools
2254 2255 </td></tr>
2255 2256 <tr><td>
2256 2257 <a href="/help/pager">
2257 2258 pager
2258 2259 </a>
2259 2260 </td><td>
2260 2261 Pager Support
2261 2262 </td></tr>
2262 2263 <tr><td>
2263 2264 <a href="/help/patterns">
2264 2265 patterns
2265 2266 </a>
2266 2267 </td><td>
2267 2268 File Name Patterns
2268 2269 </td></tr>
2269 2270 <tr><td>
2270 2271 <a href="/help/phases">
2271 2272 phases
2272 2273 </a>
2273 2274 </td><td>
2274 2275 Working with Phases
2275 2276 </td></tr>
2276 2277 <tr><td>
2277 2278 <a href="/help/revisions">
2278 2279 revisions
2279 2280 </a>
2280 2281 </td><td>
2281 2282 Specifying Revisions
2282 2283 </td></tr>
2283 2284 <tr><td>
2284 2285 <a href="/help/scripting">
2285 2286 scripting
2286 2287 </a>
2287 2288 </td><td>
2288 2289 Using Mercurial from scripts and automation
2289 2290 </td></tr>
2290 2291 <tr><td>
2291 2292 <a href="/help/subrepos">
2292 2293 subrepos
2293 2294 </a>
2294 2295 </td><td>
2295 2296 Subrepositories
2296 2297 </td></tr>
2297 2298 <tr><td>
2298 2299 <a href="/help/templating">
2299 2300 templating
2300 2301 </a>
2301 2302 </td><td>
2302 2303 Template Usage
2303 2304 </td></tr>
2304 2305 <tr><td>
2305 2306 <a href="/help/urls">
2306 2307 urls
2307 2308 </a>
2308 2309 </td><td>
2309 2310 URL Paths
2310 2311 </td></tr>
2311 2312 <tr><td>
2312 2313 <a href="/help/topic-containing-verbose">
2313 2314 topic-containing-verbose
2314 2315 </a>
2315 2316 </td><td>
2316 2317 This is the topic to test omit indicating.
2317 2318 </td></tr>
2318 2319
2319 2320
2320 2321 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2321 2322
2322 2323 <tr><td>
2323 2324 <a href="/help/add">
2324 2325 add
2325 2326 </a>
2326 2327 </td><td>
2327 2328 add the specified files on the next commit
2328 2329 </td></tr>
2329 2330 <tr><td>
2330 2331 <a href="/help/annotate">
2331 2332 annotate
2332 2333 </a>
2333 2334 </td><td>
2334 2335 show changeset information by line for each file
2335 2336 </td></tr>
2336 2337 <tr><td>
2337 2338 <a href="/help/clone">
2338 2339 clone
2339 2340 </a>
2340 2341 </td><td>
2341 2342 make a copy of an existing repository
2342 2343 </td></tr>
2343 2344 <tr><td>
2344 2345 <a href="/help/commit">
2345 2346 commit
2346 2347 </a>
2347 2348 </td><td>
2348 2349 commit the specified files or all outstanding changes
2349 2350 </td></tr>
2350 2351 <tr><td>
2351 2352 <a href="/help/diff">
2352 2353 diff
2353 2354 </a>
2354 2355 </td><td>
2355 2356 diff repository (or selected files)
2356 2357 </td></tr>
2357 2358 <tr><td>
2358 2359 <a href="/help/export">
2359 2360 export
2360 2361 </a>
2361 2362 </td><td>
2362 2363 dump the header and diffs for one or more changesets
2363 2364 </td></tr>
2364 2365 <tr><td>
2365 2366 <a href="/help/forget">
2366 2367 forget
2367 2368 </a>
2368 2369 </td><td>
2369 2370 forget the specified files on the next commit
2370 2371 </td></tr>
2371 2372 <tr><td>
2372 2373 <a href="/help/init">
2373 2374 init
2374 2375 </a>
2375 2376 </td><td>
2376 2377 create a new repository in the given directory
2377 2378 </td></tr>
2378 2379 <tr><td>
2379 2380 <a href="/help/log">
2380 2381 log
2381 2382 </a>
2382 2383 </td><td>
2383 2384 show revision history of entire repository or files
2384 2385 </td></tr>
2385 2386 <tr><td>
2386 2387 <a href="/help/merge">
2387 2388 merge
2388 2389 </a>
2389 2390 </td><td>
2390 2391 merge another revision into working directory
2391 2392 </td></tr>
2392 2393 <tr><td>
2393 2394 <a href="/help/pull">
2394 2395 pull
2395 2396 </a>
2396 2397 </td><td>
2397 2398 pull changes from the specified source
2398 2399 </td></tr>
2399 2400 <tr><td>
2400 2401 <a href="/help/push">
2401 2402 push
2402 2403 </a>
2403 2404 </td><td>
2404 2405 push changes to the specified destination
2405 2406 </td></tr>
2406 2407 <tr><td>
2407 2408 <a href="/help/remove">
2408 2409 remove
2409 2410 </a>
2410 2411 </td><td>
2411 2412 remove the specified files on the next commit
2412 2413 </td></tr>
2413 2414 <tr><td>
2414 2415 <a href="/help/serve">
2415 2416 serve
2416 2417 </a>
2417 2418 </td><td>
2418 2419 start stand-alone webserver
2419 2420 </td></tr>
2420 2421 <tr><td>
2421 2422 <a href="/help/status">
2422 2423 status
2423 2424 </a>
2424 2425 </td><td>
2425 2426 show changed files in the working directory
2426 2427 </td></tr>
2427 2428 <tr><td>
2428 2429 <a href="/help/summary">
2429 2430 summary
2430 2431 </a>
2431 2432 </td><td>
2432 2433 summarize working directory state
2433 2434 </td></tr>
2434 2435 <tr><td>
2435 2436 <a href="/help/update">
2436 2437 update
2437 2438 </a>
2438 2439 </td><td>
2439 2440 update working directory (or switch revisions)
2440 2441 </td></tr>
2441 2442
2442 2443
2443 2444
2444 2445 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2445 2446
2446 2447 <tr><td>
2447 2448 <a href="/help/addremove">
2448 2449 addremove
2449 2450 </a>
2450 2451 </td><td>
2451 2452 add all new files, delete all missing files
2452 2453 </td></tr>
2453 2454 <tr><td>
2454 2455 <a href="/help/archive">
2455 2456 archive
2456 2457 </a>
2457 2458 </td><td>
2458 2459 create an unversioned archive of a repository revision
2459 2460 </td></tr>
2460 2461 <tr><td>
2461 2462 <a href="/help/backout">
2462 2463 backout
2463 2464 </a>
2464 2465 </td><td>
2465 2466 reverse effect of earlier changeset
2466 2467 </td></tr>
2467 2468 <tr><td>
2468 2469 <a href="/help/bisect">
2469 2470 bisect
2470 2471 </a>
2471 2472 </td><td>
2472 2473 subdivision search of changesets
2473 2474 </td></tr>
2474 2475 <tr><td>
2475 2476 <a href="/help/bookmarks">
2476 2477 bookmarks
2477 2478 </a>
2478 2479 </td><td>
2479 2480 create a new bookmark or list existing bookmarks
2480 2481 </td></tr>
2481 2482 <tr><td>
2482 2483 <a href="/help/branch">
2483 2484 branch
2484 2485 </a>
2485 2486 </td><td>
2486 2487 set or show the current branch name
2487 2488 </td></tr>
2488 2489 <tr><td>
2489 2490 <a href="/help/branches">
2490 2491 branches
2491 2492 </a>
2492 2493 </td><td>
2493 2494 list repository named branches
2494 2495 </td></tr>
2495 2496 <tr><td>
2496 2497 <a href="/help/bundle">
2497 2498 bundle
2498 2499 </a>
2499 2500 </td><td>
2500 2501 create a bundle file
2501 2502 </td></tr>
2502 2503 <tr><td>
2503 2504 <a href="/help/cat">
2504 2505 cat
2505 2506 </a>
2506 2507 </td><td>
2507 2508 output the current or given revision of files
2508 2509 </td></tr>
2509 2510 <tr><td>
2510 2511 <a href="/help/config">
2511 2512 config
2512 2513 </a>
2513 2514 </td><td>
2514 2515 show combined config settings from all hgrc files
2515 2516 </td></tr>
2516 2517 <tr><td>
2517 2518 <a href="/help/copy">
2518 2519 copy
2519 2520 </a>
2520 2521 </td><td>
2521 2522 mark files as copied for the next commit
2522 2523 </td></tr>
2523 2524 <tr><td>
2524 2525 <a href="/help/files">
2525 2526 files
2526 2527 </a>
2527 2528 </td><td>
2528 2529 list tracked files
2529 2530 </td></tr>
2530 2531 <tr><td>
2531 2532 <a href="/help/graft">
2532 2533 graft
2533 2534 </a>
2534 2535 </td><td>
2535 2536 copy changes from other branches onto the current branch
2536 2537 </td></tr>
2537 2538 <tr><td>
2538 2539 <a href="/help/grep">
2539 2540 grep
2540 2541 </a>
2541 2542 </td><td>
2542 2543 search revision history for a pattern in specified files
2543 2544 </td></tr>
2544 2545 <tr><td>
2545 2546 <a href="/help/hashelp">
2546 2547 hashelp
2547 2548 </a>
2548 2549 </td><td>
2549 2550 Extension command's help
2550 2551 </td></tr>
2551 2552 <tr><td>
2552 2553 <a href="/help/heads">
2553 2554 heads
2554 2555 </a>
2555 2556 </td><td>
2556 2557 show branch heads
2557 2558 </td></tr>
2558 2559 <tr><td>
2559 2560 <a href="/help/help">
2560 2561 help
2561 2562 </a>
2562 2563 </td><td>
2563 2564 show help for a given topic or a help overview
2564 2565 </td></tr>
2565 2566 <tr><td>
2566 2567 <a href="/help/hgalias">
2567 2568 hgalias
2568 2569 </a>
2569 2570 </td><td>
2570 2571 My doc
2571 2572 </td></tr>
2572 2573 <tr><td>
2573 2574 <a href="/help/hgaliasnodoc">
2574 2575 hgaliasnodoc
2575 2576 </a>
2576 2577 </td><td>
2577 2578 summarize working directory state
2578 2579 </td></tr>
2579 2580 <tr><td>
2580 2581 <a href="/help/identify">
2581 2582 identify
2582 2583 </a>
2583 2584 </td><td>
2584 2585 identify the working directory or specified revision
2585 2586 </td></tr>
2586 2587 <tr><td>
2587 2588 <a href="/help/import">
2588 2589 import
2589 2590 </a>
2590 2591 </td><td>
2591 2592 import an ordered set of patches
2592 2593 </td></tr>
2593 2594 <tr><td>
2594 2595 <a href="/help/incoming">
2595 2596 incoming
2596 2597 </a>
2597 2598 </td><td>
2598 2599 show new changesets found in source
2599 2600 </td></tr>
2600 2601 <tr><td>
2601 2602 <a href="/help/manifest">
2602 2603 manifest
2603 2604 </a>
2604 2605 </td><td>
2605 2606 output the current or given revision of the project manifest
2606 2607 </td></tr>
2607 2608 <tr><td>
2608 2609 <a href="/help/nohelp">
2609 2610 nohelp
2610 2611 </a>
2611 2612 </td><td>
2612 2613 (no help text available)
2613 2614 </td></tr>
2614 2615 <tr><td>
2615 2616 <a href="/help/outgoing">
2616 2617 outgoing
2617 2618 </a>
2618 2619 </td><td>
2619 2620 show changesets not found in the destination
2620 2621 </td></tr>
2621 2622 <tr><td>
2622 2623 <a href="/help/paths">
2623 2624 paths
2624 2625 </a>
2625 2626 </td><td>
2626 2627 show aliases for remote repositories
2627 2628 </td></tr>
2628 2629 <tr><td>
2629 2630 <a href="/help/phase">
2630 2631 phase
2631 2632 </a>
2632 2633 </td><td>
2633 2634 set or show the current phase name
2634 2635 </td></tr>
2635 2636 <tr><td>
2636 2637 <a href="/help/recover">
2637 2638 recover
2638 2639 </a>
2639 2640 </td><td>
2640 2641 roll back an interrupted transaction
2641 2642 </td></tr>
2642 2643 <tr><td>
2643 2644 <a href="/help/rename">
2644 2645 rename
2645 2646 </a>
2646 2647 </td><td>
2647 2648 rename files; equivalent of copy + remove
2648 2649 </td></tr>
2649 2650 <tr><td>
2650 2651 <a href="/help/resolve">
2651 2652 resolve
2652 2653 </a>
2653 2654 </td><td>
2654 2655 redo merges or set/view the merge status of files
2655 2656 </td></tr>
2656 2657 <tr><td>
2657 2658 <a href="/help/revert">
2658 2659 revert
2659 2660 </a>
2660 2661 </td><td>
2661 2662 restore files to their checkout state
2662 2663 </td></tr>
2663 2664 <tr><td>
2664 2665 <a href="/help/root">
2665 2666 root
2666 2667 </a>
2667 2668 </td><td>
2668 2669 print the root (top) of the current working directory
2669 2670 </td></tr>
2670 2671 <tr><td>
2671 2672 <a href="/help/shellalias">
2672 2673 shellalias
2673 2674 </a>
2674 2675 </td><td>
2675 2676 (no help text available)
2676 2677 </td></tr>
2677 2678 <tr><td>
2678 2679 <a href="/help/tag">
2679 2680 tag
2680 2681 </a>
2681 2682 </td><td>
2682 2683 add one or more tags for the current or given revision
2683 2684 </td></tr>
2684 2685 <tr><td>
2685 2686 <a href="/help/tags">
2686 2687 tags
2687 2688 </a>
2688 2689 </td><td>
2689 2690 list repository tags
2690 2691 </td></tr>
2691 2692 <tr><td>
2692 2693 <a href="/help/unbundle">
2693 2694 unbundle
2694 2695 </a>
2695 2696 </td><td>
2696 2697 apply one or more bundle files
2697 2698 </td></tr>
2698 2699 <tr><td>
2699 2700 <a href="/help/verify">
2700 2701 verify
2701 2702 </a>
2702 2703 </td><td>
2703 2704 verify the integrity of the repository
2704 2705 </td></tr>
2705 2706 <tr><td>
2706 2707 <a href="/help/version">
2707 2708 version
2708 2709 </a>
2709 2710 </td><td>
2710 2711 output version and copyright information
2711 2712 </td></tr>
2712 2713
2713 2714
2714 2715 </table>
2715 2716 </div>
2716 2717 </div>
2717 2718
2718 2719
2719 2720
2720 2721 </body>
2721 2722 </html>
2722 2723
2723 2724
2724 2725 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2725 2726 200 Script output follows
2726 2727
2727 2728 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2728 2729 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2729 2730 <head>
2730 2731 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2731 2732 <meta name="robots" content="index, nofollow" />
2732 2733 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2733 2734 <script type="text/javascript" src="/static/mercurial.js"></script>
2734 2735
2735 2736 <title>Help: add</title>
2736 2737 </head>
2737 2738 <body>
2738 2739
2739 2740 <div class="container">
2740 2741 <div class="menu">
2741 2742 <div class="logo">
2742 2743 <a href="https://mercurial-scm.org/">
2743 2744 <img src="/static/hglogo.png" alt="mercurial" /></a>
2744 2745 </div>
2745 2746 <ul>
2746 2747 <li><a href="/shortlog">log</a></li>
2747 2748 <li><a href="/graph">graph</a></li>
2748 2749 <li><a href="/tags">tags</a></li>
2749 2750 <li><a href="/bookmarks">bookmarks</a></li>
2750 2751 <li><a href="/branches">branches</a></li>
2751 2752 </ul>
2752 2753 <ul>
2753 2754 <li class="active"><a href="/help">help</a></li>
2754 2755 </ul>
2755 2756 </div>
2756 2757
2757 2758 <div class="main">
2758 2759 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2759 2760 <h3>Help: add</h3>
2760 2761
2761 2762 <form class="search" action="/log">
2762 2763
2763 2764 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2764 2765 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2765 2766 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2766 2767 </form>
2767 2768 <div id="doc">
2768 2769 <p>
2769 2770 hg add [OPTION]... [FILE]...
2770 2771 </p>
2771 2772 <p>
2772 2773 add the specified files on the next commit
2773 2774 </p>
2774 2775 <p>
2775 2776 Schedule files to be version controlled and added to the
2776 2777 repository.
2777 2778 </p>
2778 2779 <p>
2779 2780 The files will be added to the repository at the next commit. To
2780 2781 undo an add before that, see 'hg forget'.
2781 2782 </p>
2782 2783 <p>
2783 2784 If no names are given, add all files to the repository (except
2784 2785 files matching &quot;.hgignore&quot;).
2785 2786 </p>
2786 2787 <p>
2787 2788 Examples:
2788 2789 </p>
2789 2790 <ul>
2790 2791 <li> New (unknown) files are added automatically by 'hg add':
2791 2792 <pre>
2792 2793 \$ ls (re)
2793 2794 foo.c
2794 2795 \$ hg status (re)
2795 2796 ? foo.c
2796 2797 \$ hg add (re)
2797 2798 adding foo.c
2798 2799 \$ hg status (re)
2799 2800 A foo.c
2800 2801 </pre>
2801 2802 <li> Specific files to be added can be specified:
2802 2803 <pre>
2803 2804 \$ ls (re)
2804 2805 bar.c foo.c
2805 2806 \$ hg status (re)
2806 2807 ? bar.c
2807 2808 ? foo.c
2808 2809 \$ hg add bar.c (re)
2809 2810 \$ hg status (re)
2810 2811 A bar.c
2811 2812 ? foo.c
2812 2813 </pre>
2813 2814 </ul>
2814 2815 <p>
2815 2816 Returns 0 if all files are successfully added.
2816 2817 </p>
2817 2818 <p>
2818 2819 options ([+] can be repeated):
2819 2820 </p>
2820 2821 <table>
2821 2822 <tr><td>-I</td>
2822 2823 <td>--include PATTERN [+]</td>
2823 2824 <td>include names matching the given patterns</td></tr>
2824 2825 <tr><td>-X</td>
2825 2826 <td>--exclude PATTERN [+]</td>
2826 2827 <td>exclude names matching the given patterns</td></tr>
2827 2828 <tr><td>-S</td>
2828 2829 <td>--subrepos</td>
2829 2830 <td>recurse into subrepositories</td></tr>
2830 2831 <tr><td>-n</td>
2831 2832 <td>--dry-run</td>
2832 2833 <td>do not perform actions, just print output</td></tr>
2833 2834 </table>
2834 2835 <p>
2835 2836 global options ([+] can be repeated):
2836 2837 </p>
2837 2838 <table>
2838 2839 <tr><td>-R</td>
2839 2840 <td>--repository REPO</td>
2840 2841 <td>repository root directory or name of overlay bundle file</td></tr>
2841 2842 <tr><td></td>
2842 2843 <td>--cwd DIR</td>
2843 2844 <td>change working directory</td></tr>
2844 2845 <tr><td>-y</td>
2845 2846 <td>--noninteractive</td>
2846 2847 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2847 2848 <tr><td>-q</td>
2848 2849 <td>--quiet</td>
2849 2850 <td>suppress output</td></tr>
2850 2851 <tr><td>-v</td>
2851 2852 <td>--verbose</td>
2852 2853 <td>enable additional output</td></tr>
2853 2854 <tr><td></td>
2854 2855 <td>--color TYPE</td>
2855 2856 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2856 2857 <tr><td></td>
2857 2858 <td>--config CONFIG [+]</td>
2858 2859 <td>set/override config option (use 'section.name=value')</td></tr>
2859 2860 <tr><td></td>
2860 2861 <td>--debug</td>
2861 2862 <td>enable debugging output</td></tr>
2862 2863 <tr><td></td>
2863 2864 <td>--debugger</td>
2864 2865 <td>start debugger</td></tr>
2865 2866 <tr><td></td>
2866 2867 <td>--encoding ENCODE</td>
2867 2868 <td>set the charset encoding (default: ascii)</td></tr>
2868 2869 <tr><td></td>
2869 2870 <td>--encodingmode MODE</td>
2870 2871 <td>set the charset encoding mode (default: strict)</td></tr>
2871 2872 <tr><td></td>
2872 2873 <td>--traceback</td>
2873 2874 <td>always print a traceback on exception</td></tr>
2874 2875 <tr><td></td>
2875 2876 <td>--time</td>
2876 2877 <td>time how long the command takes</td></tr>
2877 2878 <tr><td></td>
2878 2879 <td>--profile</td>
2879 2880 <td>print command execution profile</td></tr>
2880 2881 <tr><td></td>
2881 2882 <td>--version</td>
2882 2883 <td>output version information and exit</td></tr>
2883 2884 <tr><td>-h</td>
2884 2885 <td>--help</td>
2885 2886 <td>display help and exit</td></tr>
2886 2887 <tr><td></td>
2887 2888 <td>--hidden</td>
2888 2889 <td>consider hidden changesets</td></tr>
2889 2890 <tr><td></td>
2890 2891 <td>--pager TYPE</td>
2891 2892 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2892 2893 </table>
2893 2894
2894 2895 </div>
2895 2896 </div>
2896 2897 </div>
2897 2898
2898 2899
2899 2900
2900 2901 </body>
2901 2902 </html>
2902 2903
2903 2904
2904 2905 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2905 2906 200 Script output follows
2906 2907
2907 2908 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2908 2909 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2909 2910 <head>
2910 2911 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2911 2912 <meta name="robots" content="index, nofollow" />
2912 2913 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2913 2914 <script type="text/javascript" src="/static/mercurial.js"></script>
2914 2915
2915 2916 <title>Help: remove</title>
2916 2917 </head>
2917 2918 <body>
2918 2919
2919 2920 <div class="container">
2920 2921 <div class="menu">
2921 2922 <div class="logo">
2922 2923 <a href="https://mercurial-scm.org/">
2923 2924 <img src="/static/hglogo.png" alt="mercurial" /></a>
2924 2925 </div>
2925 2926 <ul>
2926 2927 <li><a href="/shortlog">log</a></li>
2927 2928 <li><a href="/graph">graph</a></li>
2928 2929 <li><a href="/tags">tags</a></li>
2929 2930 <li><a href="/bookmarks">bookmarks</a></li>
2930 2931 <li><a href="/branches">branches</a></li>
2931 2932 </ul>
2932 2933 <ul>
2933 2934 <li class="active"><a href="/help">help</a></li>
2934 2935 </ul>
2935 2936 </div>
2936 2937
2937 2938 <div class="main">
2938 2939 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2939 2940 <h3>Help: remove</h3>
2940 2941
2941 2942 <form class="search" action="/log">
2942 2943
2943 2944 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2944 2945 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2945 2946 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2946 2947 </form>
2947 2948 <div id="doc">
2948 2949 <p>
2949 2950 hg remove [OPTION]... FILE...
2950 2951 </p>
2951 2952 <p>
2952 2953 aliases: rm
2953 2954 </p>
2954 2955 <p>
2955 2956 remove the specified files on the next commit
2956 2957 </p>
2957 2958 <p>
2958 2959 Schedule the indicated files for removal from the current branch.
2959 2960 </p>
2960 2961 <p>
2961 2962 This command schedules the files to be removed at the next commit.
2962 2963 To undo a remove before that, see 'hg revert'. To undo added
2963 2964 files, see 'hg forget'.
2964 2965 </p>
2965 2966 <p>
2966 2967 -A/--after can be used to remove only files that have already
2967 2968 been deleted, -f/--force can be used to force deletion, and -Af
2968 2969 can be used to remove files from the next revision without
2969 2970 deleting them from the working directory.
2970 2971 </p>
2971 2972 <p>
2972 2973 The following table details the behavior of remove for different
2973 2974 file states (columns) and option combinations (rows). The file
2974 2975 states are Added [A], Clean [C], Modified [M] and Missing [!]
2975 2976 (as reported by 'hg status'). The actions are Warn, Remove
2976 2977 (from branch) and Delete (from disk):
2977 2978 </p>
2978 2979 <table>
2979 2980 <tr><td>opt/state</td>
2980 2981 <td>A</td>
2981 2982 <td>C</td>
2982 2983 <td>M</td>
2983 2984 <td>!</td></tr>
2984 2985 <tr><td>none</td>
2985 2986 <td>W</td>
2986 2987 <td>RD</td>
2987 2988 <td>W</td>
2988 2989 <td>R</td></tr>
2989 2990 <tr><td>-f</td>
2990 2991 <td>R</td>
2991 2992 <td>RD</td>
2992 2993 <td>RD</td>
2993 2994 <td>R</td></tr>
2994 2995 <tr><td>-A</td>
2995 2996 <td>W</td>
2996 2997 <td>W</td>
2997 2998 <td>W</td>
2998 2999 <td>R</td></tr>
2999 3000 <tr><td>-Af</td>
3000 3001 <td>R</td>
3001 3002 <td>R</td>
3002 3003 <td>R</td>
3003 3004 <td>R</td></tr>
3004 3005 </table>
3005 3006 <p>
3006 3007 <b>Note:</b>
3007 3008 </p>
3008 3009 <p>
3009 3010 'hg remove' never deletes files in Added [A] state from the
3010 3011 working directory, not even if &quot;--force&quot; is specified.
3011 3012 </p>
3012 3013 <p>
3013 3014 Returns 0 on success, 1 if any warnings encountered.
3014 3015 </p>
3015 3016 <p>
3016 3017 options ([+] can be repeated):
3017 3018 </p>
3018 3019 <table>
3019 3020 <tr><td>-A</td>
3020 3021 <td>--after</td>
3021 3022 <td>record delete for missing files</td></tr>
3022 3023 <tr><td>-f</td>
3023 3024 <td>--force</td>
3024 3025 <td>forget added files, delete modified files</td></tr>
3025 3026 <tr><td>-S</td>
3026 3027 <td>--subrepos</td>
3027 3028 <td>recurse into subrepositories</td></tr>
3028 3029 <tr><td>-I</td>
3029 3030 <td>--include PATTERN [+]</td>
3030 3031 <td>include names matching the given patterns</td></tr>
3031 3032 <tr><td>-X</td>
3032 3033 <td>--exclude PATTERN [+]</td>
3033 3034 <td>exclude names matching the given patterns</td></tr>
3034 3035 <tr><td>-n</td>
3035 3036 <td>--dry-run</td>
3036 3037 <td>do not perform actions, just print output</td></tr>
3037 3038 </table>
3038 3039 <p>
3039 3040 global options ([+] can be repeated):
3040 3041 </p>
3041 3042 <table>
3042 3043 <tr><td>-R</td>
3043 3044 <td>--repository REPO</td>
3044 3045 <td>repository root directory or name of overlay bundle file</td></tr>
3045 3046 <tr><td></td>
3046 3047 <td>--cwd DIR</td>
3047 3048 <td>change working directory</td></tr>
3048 3049 <tr><td>-y</td>
3049 3050 <td>--noninteractive</td>
3050 3051 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3051 3052 <tr><td>-q</td>
3052 3053 <td>--quiet</td>
3053 3054 <td>suppress output</td></tr>
3054 3055 <tr><td>-v</td>
3055 3056 <td>--verbose</td>
3056 3057 <td>enable additional output</td></tr>
3057 3058 <tr><td></td>
3058 3059 <td>--color TYPE</td>
3059 3060 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3060 3061 <tr><td></td>
3061 3062 <td>--config CONFIG [+]</td>
3062 3063 <td>set/override config option (use 'section.name=value')</td></tr>
3063 3064 <tr><td></td>
3064 3065 <td>--debug</td>
3065 3066 <td>enable debugging output</td></tr>
3066 3067 <tr><td></td>
3067 3068 <td>--debugger</td>
3068 3069 <td>start debugger</td></tr>
3069 3070 <tr><td></td>
3070 3071 <td>--encoding ENCODE</td>
3071 3072 <td>set the charset encoding (default: ascii)</td></tr>
3072 3073 <tr><td></td>
3073 3074 <td>--encodingmode MODE</td>
3074 3075 <td>set the charset encoding mode (default: strict)</td></tr>
3075 3076 <tr><td></td>
3076 3077 <td>--traceback</td>
3077 3078 <td>always print a traceback on exception</td></tr>
3078 3079 <tr><td></td>
3079 3080 <td>--time</td>
3080 3081 <td>time how long the command takes</td></tr>
3081 3082 <tr><td></td>
3082 3083 <td>--profile</td>
3083 3084 <td>print command execution profile</td></tr>
3084 3085 <tr><td></td>
3085 3086 <td>--version</td>
3086 3087 <td>output version information and exit</td></tr>
3087 3088 <tr><td>-h</td>
3088 3089 <td>--help</td>
3089 3090 <td>display help and exit</td></tr>
3090 3091 <tr><td></td>
3091 3092 <td>--hidden</td>
3092 3093 <td>consider hidden changesets</td></tr>
3093 3094 <tr><td></td>
3094 3095 <td>--pager TYPE</td>
3095 3096 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3096 3097 </table>
3097 3098
3098 3099 </div>
3099 3100 </div>
3100 3101 </div>
3101 3102
3102 3103
3103 3104
3104 3105 </body>
3105 3106 </html>
3106 3107
3107 3108
3108 3109 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
3109 3110 200 Script output follows
3110 3111
3111 3112 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3112 3113 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3113 3114 <head>
3114 3115 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3115 3116 <meta name="robots" content="index, nofollow" />
3116 3117 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3117 3118 <script type="text/javascript" src="/static/mercurial.js"></script>
3118 3119
3119 3120 <title>Help: dates</title>
3120 3121 </head>
3121 3122 <body>
3122 3123
3123 3124 <div class="container">
3124 3125 <div class="menu">
3125 3126 <div class="logo">
3126 3127 <a href="https://mercurial-scm.org/">
3127 3128 <img src="/static/hglogo.png" alt="mercurial" /></a>
3128 3129 </div>
3129 3130 <ul>
3130 3131 <li><a href="/shortlog">log</a></li>
3131 3132 <li><a href="/graph">graph</a></li>
3132 3133 <li><a href="/tags">tags</a></li>
3133 3134 <li><a href="/bookmarks">bookmarks</a></li>
3134 3135 <li><a href="/branches">branches</a></li>
3135 3136 </ul>
3136 3137 <ul>
3137 3138 <li class="active"><a href="/help">help</a></li>
3138 3139 </ul>
3139 3140 </div>
3140 3141
3141 3142 <div class="main">
3142 3143 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3143 3144 <h3>Help: dates</h3>
3144 3145
3145 3146 <form class="search" action="/log">
3146 3147
3147 3148 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3148 3149 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3149 3150 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3150 3151 </form>
3151 3152 <div id="doc">
3152 3153 <h1>Date Formats</h1>
3153 3154 <p>
3154 3155 Some commands allow the user to specify a date, e.g.:
3155 3156 </p>
3156 3157 <ul>
3157 3158 <li> backout, commit, import, tag: Specify the commit date.
3158 3159 <li> log, revert, update: Select revision(s) by date.
3159 3160 </ul>
3160 3161 <p>
3161 3162 Many date formats are valid. Here are some examples:
3162 3163 </p>
3163 3164 <ul>
3164 3165 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
3165 3166 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
3166 3167 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
3167 3168 <li> &quot;Dec 6&quot; (midnight)
3168 3169 <li> &quot;13:18&quot; (today assumed)
3169 3170 <li> &quot;3:39&quot; (3:39AM assumed)
3170 3171 <li> &quot;3:39pm&quot; (15:39)
3171 3172 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
3172 3173 <li> &quot;2006-12-6 13:18&quot;
3173 3174 <li> &quot;2006-12-6&quot;
3174 3175 <li> &quot;12-6&quot;
3175 3176 <li> &quot;12/6&quot;
3176 3177 <li> &quot;12/6/6&quot; (Dec 6 2006)
3177 3178 <li> &quot;today&quot; (midnight)
3178 3179 <li> &quot;yesterday&quot; (midnight)
3179 3180 <li> &quot;now&quot; - right now
3180 3181 </ul>
3181 3182 <p>
3182 3183 Lastly, there is Mercurial's internal format:
3183 3184 </p>
3184 3185 <ul>
3185 3186 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
3186 3187 </ul>
3187 3188 <p>
3188 3189 This is the internal representation format for dates. The first number
3189 3190 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
3190 3191 second is the offset of the local timezone, in seconds west of UTC
3191 3192 (negative if the timezone is east of UTC).
3192 3193 </p>
3193 3194 <p>
3194 3195 The log command also accepts date ranges:
3195 3196 </p>
3196 3197 <ul>
3197 3198 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3198 3199 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3199 3200 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3200 3201 <li> &quot;-DAYS&quot; - within a given number of days of today
3201 3202 </ul>
3202 3203
3203 3204 </div>
3204 3205 </div>
3205 3206 </div>
3206 3207
3207 3208
3208 3209
3209 3210 </body>
3210 3211 </html>
3211 3212
3212 3213
3213 3214 $ get-with-headers.py $LOCALIP:$HGPORT "help/pager"
3214 3215 200 Script output follows
3215 3216
3216 3217 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3217 3218 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3218 3219 <head>
3219 3220 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3220 3221 <meta name="robots" content="index, nofollow" />
3221 3222 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3222 3223 <script type="text/javascript" src="/static/mercurial.js"></script>
3223 3224
3224 3225 <title>Help: pager</title>
3225 3226 </head>
3226 3227 <body>
3227 3228
3228 3229 <div class="container">
3229 3230 <div class="menu">
3230 3231 <div class="logo">
3231 3232 <a href="https://mercurial-scm.org/">
3232 3233 <img src="/static/hglogo.png" alt="mercurial" /></a>
3233 3234 </div>
3234 3235 <ul>
3235 3236 <li><a href="/shortlog">log</a></li>
3236 3237 <li><a href="/graph">graph</a></li>
3237 3238 <li><a href="/tags">tags</a></li>
3238 3239 <li><a href="/bookmarks">bookmarks</a></li>
3239 3240 <li><a href="/branches">branches</a></li>
3240 3241 </ul>
3241 3242 <ul>
3242 3243 <li class="active"><a href="/help">help</a></li>
3243 3244 </ul>
3244 3245 </div>
3245 3246
3246 3247 <div class="main">
3247 3248 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3248 3249 <h3>Help: pager</h3>
3249 3250
3250 3251 <form class="search" action="/log">
3251 3252
3252 3253 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3253 3254 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3254 3255 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3255 3256 </form>
3256 3257 <div id="doc">
3257 3258 <h1>Pager Support</h1>
3258 3259 <p>
3259 3260 Some Mercurial commands can produce a lot of output, and Mercurial will
3260 3261 attempt to use a pager to make those commands more pleasant.
3261 3262 </p>
3262 3263 <p>
3263 3264 To set the pager that should be used, set the application variable:
3264 3265 </p>
3265 3266 <pre>
3266 3267 [pager]
3267 3268 pager = less -FRX
3268 3269 </pre>
3269 3270 <p>
3270 3271 If no pager is set in the user or repository configuration, Mercurial uses the
3271 3272 environment variable $PAGER. If $PAGER is not set, pager.pager from the default
3272 3273 or system configuration is used. If none of these are set, a default pager will
3273 3274 be used, typically 'less' on Unix and 'more' on Windows.
3274 3275 </p>
3275 3276 <p>
3276 3277 You can disable the pager for certain commands by adding them to the
3277 3278 pager.ignore list:
3278 3279 </p>
3279 3280 <pre>
3280 3281 [pager]
3281 3282 ignore = version, help, update
3282 3283 </pre>
3283 3284 <p>
3284 3285 To ignore global commands like 'hg version' or 'hg help', you have
3285 3286 to specify them in your user configuration file.
3286 3287 </p>
3287 3288 <p>
3288 3289 To control whether the pager is used at all for an individual command,
3289 3290 you can use --pager=&lt;value&gt;:
3290 3291 </p>
3291 3292 <ul>
3292 3293 <li> use as needed: 'auto'.
3293 3294 <li> require the pager: 'yes' or 'on'.
3294 3295 <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work).
3295 3296 </ul>
3296 3297 <p>
3297 3298 To globally turn off all attempts to use a pager, set:
3298 3299 </p>
3299 3300 <pre>
3300 3301 [ui]
3301 3302 paginate = never
3302 3303 </pre>
3303 3304 <p>
3304 3305 which will prevent the pager from running.
3305 3306 </p>
3306 3307
3307 3308 </div>
3308 3309 </div>
3309 3310 </div>
3310 3311
3311 3312
3312 3313
3313 3314 </body>
3314 3315 </html>
3315 3316
3316 3317
3317 3318 Sub-topic indexes rendered properly
3318 3319
3319 3320 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3320 3321 200 Script output follows
3321 3322
3322 3323 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3323 3324 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3324 3325 <head>
3325 3326 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3326 3327 <meta name="robots" content="index, nofollow" />
3327 3328 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3328 3329 <script type="text/javascript" src="/static/mercurial.js"></script>
3329 3330
3330 3331 <title>Help: internals</title>
3331 3332 </head>
3332 3333 <body>
3333 3334
3334 3335 <div class="container">
3335 3336 <div class="menu">
3336 3337 <div class="logo">
3337 3338 <a href="https://mercurial-scm.org/">
3338 3339 <img src="/static/hglogo.png" alt="mercurial" /></a>
3339 3340 </div>
3340 3341 <ul>
3341 3342 <li><a href="/shortlog">log</a></li>
3342 3343 <li><a href="/graph">graph</a></li>
3343 3344 <li><a href="/tags">tags</a></li>
3344 3345 <li><a href="/bookmarks">bookmarks</a></li>
3345 3346 <li><a href="/branches">branches</a></li>
3346 3347 </ul>
3347 3348 <ul>
3348 3349 <li><a href="/help">help</a></li>
3349 3350 </ul>
3350 3351 </div>
3351 3352
3352 3353 <div class="main">
3353 3354 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3354 3355
3355 3356 <form class="search" action="/log">
3356 3357
3357 3358 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3358 3359 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3359 3360 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3360 3361 </form>
3361 3362 <table class="bigtable">
3362 3363 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3363 3364
3364 3365 <tr><td>
3365 3366 <a href="/help/internals.bundle2">
3366 3367 bundle2
3367 3368 </a>
3368 3369 </td><td>
3369 3370 Bundle2
3370 3371 </td></tr>
3371 3372 <tr><td>
3372 3373 <a href="/help/internals.bundles">
3373 3374 bundles
3374 3375 </a>
3375 3376 </td><td>
3376 3377 Bundles
3377 3378 </td></tr>
3378 3379 <tr><td>
3379 3380 <a href="/help/internals.cbor">
3380 3381 cbor
3381 3382 </a>
3382 3383 </td><td>
3383 3384 CBOR
3384 3385 </td></tr>
3385 3386 <tr><td>
3386 3387 <a href="/help/internals.censor">
3387 3388 censor
3388 3389 </a>
3389 3390 </td><td>
3390 3391 Censor
3391 3392 </td></tr>
3392 3393 <tr><td>
3393 3394 <a href="/help/internals.changegroups">
3394 3395 changegroups
3395 3396 </a>
3396 3397 </td><td>
3397 3398 Changegroups
3398 3399 </td></tr>
3399 3400 <tr><td>
3400 3401 <a href="/help/internals.config">
3401 3402 config
3402 3403 </a>
3403 3404 </td><td>
3404 3405 Config Registrar
3405 3406 </td></tr>
3406 3407 <tr><td>
3408 <a href="/help/internals.extensions">
3409 extensions
3410 </a>
3411 </td><td>
3412 Extension API
3413 </td></tr>
3414 <tr><td>
3407 3415 <a href="/help/internals.requirements">
3408 3416 requirements
3409 3417 </a>
3410 3418 </td><td>
3411 3419 Repository Requirements
3412 3420 </td></tr>
3413 3421 <tr><td>
3414 3422 <a href="/help/internals.revlogs">
3415 3423 revlogs
3416 3424 </a>
3417 3425 </td><td>
3418 3426 Revision Logs
3419 3427 </td></tr>
3420 3428 <tr><td>
3421 3429 <a href="/help/internals.wireprotocol">
3422 3430 wireprotocol
3423 3431 </a>
3424 3432 </td><td>
3425 3433 Wire Protocol
3426 3434 </td></tr>
3427 3435 <tr><td>
3428 3436 <a href="/help/internals.wireprotocolrpc">
3429 3437 wireprotocolrpc
3430 3438 </a>
3431 3439 </td><td>
3432 3440 Wire Protocol RPC
3433 3441 </td></tr>
3434 3442 <tr><td>
3435 3443 <a href="/help/internals.wireprotocolv2">
3436 3444 wireprotocolv2
3437 3445 </a>
3438 3446 </td><td>
3439 3447 Wire Protocol Version 2
3440 3448 </td></tr>
3441 3449
3442 3450
3443 3451
3444 3452
3445 3453
3446 3454 </table>
3447 3455 </div>
3448 3456 </div>
3449 3457
3450 3458
3451 3459
3452 3460 </body>
3453 3461 </html>
3454 3462
3455 3463
3456 3464 Sub-topic topics rendered properly
3457 3465
3458 3466 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3459 3467 200 Script output follows
3460 3468
3461 3469 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3462 3470 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3463 3471 <head>
3464 3472 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3465 3473 <meta name="robots" content="index, nofollow" />
3466 3474 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3467 3475 <script type="text/javascript" src="/static/mercurial.js"></script>
3468 3476
3469 3477 <title>Help: internals.changegroups</title>
3470 3478 </head>
3471 3479 <body>
3472 3480
3473 3481 <div class="container">
3474 3482 <div class="menu">
3475 3483 <div class="logo">
3476 3484 <a href="https://mercurial-scm.org/">
3477 3485 <img src="/static/hglogo.png" alt="mercurial" /></a>
3478 3486 </div>
3479 3487 <ul>
3480 3488 <li><a href="/shortlog">log</a></li>
3481 3489 <li><a href="/graph">graph</a></li>
3482 3490 <li><a href="/tags">tags</a></li>
3483 3491 <li><a href="/bookmarks">bookmarks</a></li>
3484 3492 <li><a href="/branches">branches</a></li>
3485 3493 </ul>
3486 3494 <ul>
3487 3495 <li class="active"><a href="/help">help</a></li>
3488 3496 </ul>
3489 3497 </div>
3490 3498
3491 3499 <div class="main">
3492 3500 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3493 3501 <h3>Help: internals.changegroups</h3>
3494 3502
3495 3503 <form class="search" action="/log">
3496 3504
3497 3505 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3498 3506 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3499 3507 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3500 3508 </form>
3501 3509 <div id="doc">
3502 3510 <h1>Changegroups</h1>
3503 3511 <p>
3504 3512 Changegroups are representations of repository revlog data, specifically
3505 3513 the changelog data, root/flat manifest data, treemanifest data, and
3506 3514 filelogs.
3507 3515 </p>
3508 3516 <p>
3509 3517 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3510 3518 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3511 3519 only difference being an additional item in the *delta header*. Version
3512 3520 &quot;3&quot; adds support for storage flags in the *delta header* and optionally
3513 3521 exchanging treemanifests (enabled by setting an option on the
3514 3522 &quot;changegroup&quot; part in the bundle2).
3515 3523 </p>
3516 3524 <p>
3517 3525 Changegroups when not exchanging treemanifests consist of 3 logical
3518 3526 segments:
3519 3527 </p>
3520 3528 <pre>
3521 3529 +---------------------------------+
3522 3530 | | | |
3523 3531 | changeset | manifest | filelogs |
3524 3532 | | | |
3525 3533 | | | |
3526 3534 +---------------------------------+
3527 3535 </pre>
3528 3536 <p>
3529 3537 When exchanging treemanifests, there are 4 logical segments:
3530 3538 </p>
3531 3539 <pre>
3532 3540 +-------------------------------------------------+
3533 3541 | | | | |
3534 3542 | changeset | root | treemanifests | filelogs |
3535 3543 | | manifest | | |
3536 3544 | | | | |
3537 3545 +-------------------------------------------------+
3538 3546 </pre>
3539 3547 <p>
3540 3548 The principle building block of each segment is a *chunk*. A *chunk*
3541 3549 is a framed piece of data:
3542 3550 </p>
3543 3551 <pre>
3544 3552 +---------------------------------------+
3545 3553 | | |
3546 3554 | length | data |
3547 3555 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3548 3556 | | |
3549 3557 +---------------------------------------+
3550 3558 </pre>
3551 3559 <p>
3552 3560 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3553 3561 integer indicating the length of the entire chunk (including the length field
3554 3562 itself).
3555 3563 </p>
3556 3564 <p>
3557 3565 There is a special case chunk that has a value of 0 for the length
3558 3566 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3559 3567 </p>
3560 3568 <h2>Delta Groups</h2>
3561 3569 <p>
3562 3570 A *delta group* expresses the content of a revlog as a series of deltas,
3563 3571 or patches against previous revisions.
3564 3572 </p>
3565 3573 <p>
3566 3574 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3567 3575 to signal the end of the delta group:
3568 3576 </p>
3569 3577 <pre>
3570 3578 +------------------------------------------------------------------------+
3571 3579 | | | | | |
3572 3580 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3573 3581 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3574 3582 | | | | | |
3575 3583 +------------------------------------------------------------------------+
3576 3584 </pre>
3577 3585 <p>
3578 3586 Each *chunk*'s data consists of the following:
3579 3587 </p>
3580 3588 <pre>
3581 3589 +---------------------------------------+
3582 3590 | | |
3583 3591 | delta header | delta data |
3584 3592 | (various by version) | (various) |
3585 3593 | | |
3586 3594 +---------------------------------------+
3587 3595 </pre>
3588 3596 <p>
3589 3597 The *delta data* is a series of *delta*s that describe a diff from an existing
3590 3598 entry (either that the recipient already has, or previously specified in the
3591 3599 bundle/changegroup).
3592 3600 </p>
3593 3601 <p>
3594 3602 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3595 3603 &quot;3&quot; of the changegroup format.
3596 3604 </p>
3597 3605 <p>
3598 3606 Version 1 (headerlen=80):
3599 3607 </p>
3600 3608 <pre>
3601 3609 +------------------------------------------------------+
3602 3610 | | | | |
3603 3611 | node | p1 node | p2 node | link node |
3604 3612 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3605 3613 | | | | |
3606 3614 +------------------------------------------------------+
3607 3615 </pre>
3608 3616 <p>
3609 3617 Version 2 (headerlen=100):
3610 3618 </p>
3611 3619 <pre>
3612 3620 +------------------------------------------------------------------+
3613 3621 | | | | | |
3614 3622 | node | p1 node | p2 node | base node | link node |
3615 3623 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3616 3624 | | | | | |
3617 3625 +------------------------------------------------------------------+
3618 3626 </pre>
3619 3627 <p>
3620 3628 Version 3 (headerlen=102):
3621 3629 </p>
3622 3630 <pre>
3623 3631 +------------------------------------------------------------------------------+
3624 3632 | | | | | | |
3625 3633 | node | p1 node | p2 node | base node | link node | flags |
3626 3634 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3627 3635 | | | | | | |
3628 3636 +------------------------------------------------------------------------------+
3629 3637 </pre>
3630 3638 <p>
3631 3639 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3632 3640 series of *delta*s, densely packed (no separators). These deltas describe a diff
3633 3641 from an existing entry (either that the recipient already has, or previously
3634 3642 specified in the bundle/changegroup). The format is described more fully in
3635 3643 &quot;hg help internals.bdiff&quot;, but briefly:
3636 3644 </p>
3637 3645 <pre>
3638 3646 +---------------------------------------------------------------+
3639 3647 | | | | |
3640 3648 | start offset | end offset | new length | content |
3641 3649 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3642 3650 | | | | |
3643 3651 +---------------------------------------------------------------+
3644 3652 </pre>
3645 3653 <p>
3646 3654 Please note that the length field in the delta data does *not* include itself.
3647 3655 </p>
3648 3656 <p>
3649 3657 In version 1, the delta is always applied against the previous node from
3650 3658 the changegroup or the first parent if this is the first entry in the
3651 3659 changegroup.
3652 3660 </p>
3653 3661 <p>
3654 3662 In version 2 and up, the delta base node is encoded in the entry in the
3655 3663 changegroup. This allows the delta to be expressed against any parent,
3656 3664 which can result in smaller deltas and more efficient encoding of data.
3657 3665 </p>
3658 3666 <p>
3659 3667 The *flags* field holds bitwise flags affecting the processing of revision
3660 3668 data. The following flags are defined:
3661 3669 </p>
3662 3670 <dl>
3663 3671 <dt>32768
3664 3672 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions.
3665 3673 <dt>16384
3666 3674 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents).
3667 3675 <dt>8192
3668 3676 <dd>Externally stored. The revision fulltext contains &quot;key:value&quot; &quot;\n&quot; delimited metadata defining an object stored elsewhere. Used by the LFS extension.
3669 3677 </dl>
3670 3678 <p>
3671 3679 For historical reasons, the integer values are identical to revlog version 1
3672 3680 per-revision storage flags and correspond to bits being set in this 2-byte
3673 3681 field. Bits were allocated starting from the most-significant bit, hence the
3674 3682 reverse ordering and allocation of these flags.
3675 3683 </p>
3676 3684 <h2>Changeset Segment</h2>
3677 3685 <p>
3678 3686 The *changeset segment* consists of a single *delta group* holding
3679 3687 changelog data. The *empty chunk* at the end of the *delta group* denotes
3680 3688 the boundary to the *manifest segment*.
3681 3689 </p>
3682 3690 <h2>Manifest Segment</h2>
3683 3691 <p>
3684 3692 The *manifest segment* consists of a single *delta group* holding manifest
3685 3693 data. If treemanifests are in use, it contains only the manifest for the
3686 3694 root directory of the repository. Otherwise, it contains the entire
3687 3695 manifest data. The *empty chunk* at the end of the *delta group* denotes
3688 3696 the boundary to the next segment (either the *treemanifests segment* or the
3689 3697 *filelogs segment*, depending on version and the request options).
3690 3698 </p>
3691 3699 <h3>Treemanifests Segment</h3>
3692 3700 <p>
3693 3701 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3694 3702 only if the 'treemanifest' param is part of the bundle2 changegroup part
3695 3703 (it is not possible to use changegroup version 3 outside of bundle2).
3696 3704 Aside from the filenames in the *treemanifests segment* containing a
3697 3705 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3698 3706 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3699 3707 a sub-segment with filename size 0). This denotes the boundary to the
3700 3708 *filelogs segment*.
3701 3709 </p>
3702 3710 <h2>Filelogs Segment</h2>
3703 3711 <p>
3704 3712 The *filelogs segment* consists of multiple sub-segments, each
3705 3713 corresponding to an individual file whose data is being described:
3706 3714 </p>
3707 3715 <pre>
3708 3716 +--------------------------------------------------+
3709 3717 | | | | | |
3710 3718 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3711 3719 | | | | | (4 bytes) |
3712 3720 | | | | | |
3713 3721 +--------------------------------------------------+
3714 3722 </pre>
3715 3723 <p>
3716 3724 The final filelog sub-segment is followed by an *empty chunk* (logically,
3717 3725 a sub-segment with filename size 0). This denotes the end of the segment
3718 3726 and of the overall changegroup.
3719 3727 </p>
3720 3728 <p>
3721 3729 Each filelog sub-segment consists of the following:
3722 3730 </p>
3723 3731 <pre>
3724 3732 +------------------------------------------------------+
3725 3733 | | | |
3726 3734 | filename length | filename | delta group |
3727 3735 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3728 3736 | | | |
3729 3737 +------------------------------------------------------+
3730 3738 </pre>
3731 3739 <p>
3732 3740 That is, a *chunk* consisting of the filename (not terminated or padded)
3733 3741 followed by N chunks constituting the *delta group* for this file. The
3734 3742 *empty chunk* at the end of each *delta group* denotes the boundary to the
3735 3743 next filelog sub-segment.
3736 3744 </p>
3737 3745
3738 3746 </div>
3739 3747 </div>
3740 3748 </div>
3741 3749
3742 3750
3743 3751
3744 3752 </body>
3745 3753 </html>
3746 3754
3747 3755
3748 3756 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
3749 3757 404 Not Found
3750 3758
3751 3759 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3752 3760 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3753 3761 <head>
3754 3762 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3755 3763 <meta name="robots" content="index, nofollow" />
3756 3764 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3757 3765 <script type="text/javascript" src="/static/mercurial.js"></script>
3758 3766
3759 3767 <title>test: error</title>
3760 3768 </head>
3761 3769 <body>
3762 3770
3763 3771 <div class="container">
3764 3772 <div class="menu">
3765 3773 <div class="logo">
3766 3774 <a href="https://mercurial-scm.org/">
3767 3775 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
3768 3776 </div>
3769 3777 <ul>
3770 3778 <li><a href="/shortlog">log</a></li>
3771 3779 <li><a href="/graph">graph</a></li>
3772 3780 <li><a href="/tags">tags</a></li>
3773 3781 <li><a href="/bookmarks">bookmarks</a></li>
3774 3782 <li><a href="/branches">branches</a></li>
3775 3783 </ul>
3776 3784 <ul>
3777 3785 <li><a href="/help">help</a></li>
3778 3786 </ul>
3779 3787 </div>
3780 3788
3781 3789 <div class="main">
3782 3790
3783 3791 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3784 3792 <h3>error</h3>
3785 3793
3786 3794
3787 3795 <form class="search" action="/log">
3788 3796
3789 3797 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3790 3798 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3791 3799 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3792 3800 </form>
3793 3801
3794 3802 <div class="description">
3795 3803 <p>
3796 3804 An error occurred while processing your request:
3797 3805 </p>
3798 3806 <p>
3799 3807 Not Found
3800 3808 </p>
3801 3809 </div>
3802 3810 </div>
3803 3811 </div>
3804 3812
3805 3813
3806 3814
3807 3815 </body>
3808 3816 </html>
3809 3817
3810 3818 [1]
3811 3819
3812 3820 $ killdaemons.py
3813 3821
3814 3822 #endif
General Comments 0
You need to be logged in to leave comments. Login now