##// END OF EJS Templates
help: document requirements...
Gregory Szorc -
r28523:045fe704 default
parent child Browse files
Show More
@@ -0,0 +1,110 b''
1 Requirements
2 ============
3
4 Repositories contain a file (``.hg/requires``) containing a list of
5 features/capabilities that are *required* for clients to interface
6 with the repository. This file has been present in Mercurial since
7 version 0.9.2 (released December 2006).
8
9 One of the first things clients do when opening a repository is read
10 ``.hg/requires`` and verify that all listed requirements are supported,
11 aborting if not. Requirements are therefore a strong mechanism to
12 prevent incompatible clients from reading from unknown repository
13 formats or even corrupting them by writing to them.
14
15 Extensions may add requirements. When they do this, clients not running
16 an extension will be unable to read from repositories.
17
18 The following sections describe the requirements defined by the
19 Mercurial core distribution.
20
21 revlogv1
22 --------
23
24 When present, revlogs are version 1 (RevlogNG). RevlogNG was introduced
25 in 2006. The ``revlogv1`` requirement has been enabled by default
26 since the ``requires`` file was introduced in Mercurial 0.9.2.
27
28 If this requirement is not present, version 0 revlogs are assumed.
29
30 store
31 -----
32
33 The *store* repository layout should be used.
34
35 This requirement has been enabled by default since the ``requires`` file
36 was introduced in Mercurial 0.9.2.
37
38 fncache
39 -------
40
41 The *fncache* repository layout should be used.
42
43 The *fncache* layout hash encodes filenames with long paths and
44 encodes reserved filenames.
45
46 This requirement is enabled by default when the *store* requirement is
47 enabled (which is the default behavior). It was introduced in Mercurial
48 1.1 (released December 2008).
49
50 shared
51 ------
52
53 Denotes that the store for a repository is shared from another location
54 (defined by the ``.hg/sharedpath`` file).
55
56 This requirement is set when a repository is created via :hg:`share`.
57
58 The requirement was added in Mercurial 1.3 (released July 2009).
59
60 dotencode
61 ---------
62
63 The *dotencode* repository layout should be used.
64
65 The *dotencode* layout encodes the first period or space in filenames
66 to prevent issues on OS X and Windows.
67
68 This requirement is enabled by default when the *store* requirement
69 is enabled (which is the default behavior). It was introduced in
70 Mercurial 1.7 (released November 2010).
71
72 parentdelta
73 -----------
74
75 Denotes a revlog delta encoding format that was experimental and
76 replaced by *generaldelta*. It should not be seen in the wild because
77 it was never enabled by default.
78
79 This requirement was added in Mercurial 1.7 and removed in Mercurial
80 1.9.
81
82 generaldelta
83 ------------
84
85 Revlogs should be created with the *generaldelta* flag enabled. The
86 generaldelta flag will cause deltas to be encoded against a parent
87 revision instead of the previous revision in the revlog.
88
89 Support for this requirement was added in Mercurial 1.9 (released
90 July 2011). The requirement was disabled on new repositories by
91 default until Mercurial 3.7 (released February 2016).
92
93 manifestv2
94 ----------
95
96 Denotes that version 2 of manifests are being used.
97
98 Support for this requirement was added in Mercurial 3.4 (released
99 May 2015). The requirement is currently experimental and is disabled
100 by default.
101
102 treemanifest
103 ------------
104
105 Denotes that tree manifests are being used. Tree manifests are
106 one manifest per directory (as opposed to a single flat manifest).
107
108 Support for this requirement was added in Mercurial 3.4 (released
109 August 2015). The requirement is currently experimental and is
110 disabled by default.
@@ -1,51 +1,52 b''
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="config.txt" KeyPath="yes" />
19 19 <File Name="dates.txt" />
20 20 <File Name="diffs.txt" />
21 21 <File Name="environment.txt" />
22 22 <File Name="extensions.txt" />
23 23 <File Name="filesets.txt" />
24 24 <File Name="glossary.txt" />
25 25 <File Name="hgignore.txt" />
26 26 <File Name="hgweb.txt" />
27 27 <File Name="merge-tools.txt" />
28 28 <File Name="multirevs.txt" />
29 29 <File Name="patterns.txt" />
30 30 <File Name="phases.txt" />
31 31 <File Name="revisions.txt" />
32 32 <File Name="revsets.txt" />
33 33 <File Name="scripting.txt" />
34 34 <File Name="subrepos.txt" />
35 35 <File Name="templates.txt" />
36 36 <File Name="urls.txt" />
37 37 </Component>
38 38
39 39 <Directory Id="help.internaldir" Name="internals">
40 40 <Component Id="help.internals" Guid="$(var.help.internals.guid)" Win64='$(var.IsX64)'>
41 41 <File Id="internals.bundles.txt" Name="bundles.txt" KeyPath="yes" />
42 42 <File Id="internals.changegroups.txt" Name="changegroups.txt" />
43 <File Id="internals.requirements.txt" Name="requirements.txt" />
43 44 <File Id="internals.revlogs.txt" Name="revlogs.txt" />
44 45 </Component>
45 46 </Directory>
46 47
47 48 </Directory>
48 49 </DirectoryRef>
49 50 </Fragment>
50 51
51 52 </Wix>
@@ -1,602 +1,604 b''
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 textwrap
13 13
14 14 from .i18n import (
15 15 _,
16 16 gettext,
17 17 )
18 18 from . import (
19 19 cmdutil,
20 20 encoding,
21 21 error,
22 22 extensions,
23 23 filemerge,
24 24 fileset,
25 25 minirst,
26 26 revset,
27 27 templatefilters,
28 28 templatekw,
29 29 templater,
30 30 util,
31 31 )
32 32 from .hgweb import (
33 33 webcommands,
34 34 )
35 35
36 36 _exclkeywords = [
37 37 "(DEPRECATED)",
38 38 "(EXPERIMENTAL)",
39 39 # i18n: "(DEPRECATED)" is a keyword, must be translated consistently
40 40 _("(DEPRECATED)"),
41 41 # i18n: "(EXPERIMENTAL)" is a keyword, must be translated consistently
42 42 _("(EXPERIMENTAL)"),
43 43 ]
44 44
45 45 def listexts(header, exts, indent=1, showdeprecated=False):
46 46 '''return a text listing of the given extensions'''
47 47 rst = []
48 48 if exts:
49 49 for name, desc in sorted(exts.iteritems()):
50 50 if not showdeprecated and any(w in desc for w in _exclkeywords):
51 51 continue
52 52 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
53 53 if rst:
54 54 rst.insert(0, '\n%s\n\n' % header)
55 55 return rst
56 56
57 57 def extshelp(ui):
58 58 rst = loaddoc('extensions')(ui).splitlines(True)
59 59 rst.extend(listexts(
60 60 _('enabled extensions:'), extensions.enabled(), showdeprecated=True))
61 61 rst.extend(listexts(_('disabled extensions:'), extensions.disabled()))
62 62 doc = ''.join(rst)
63 63 return doc
64 64
65 65 def optrst(header, options, verbose):
66 66 data = []
67 67 multioccur = False
68 68 for option in options:
69 69 if len(option) == 5:
70 70 shortopt, longopt, default, desc, optlabel = option
71 71 else:
72 72 shortopt, longopt, default, desc = option
73 73 optlabel = _("VALUE") # default label
74 74
75 75 if not verbose and any(w in desc for w in _exclkeywords):
76 76 continue
77 77
78 78 so = ''
79 79 if shortopt:
80 80 so = '-' + shortopt
81 81 lo = '--' + longopt
82 82 if default:
83 83 desc += _(" (default: %s)") % default
84 84
85 85 if isinstance(default, list):
86 86 lo += " %s [+]" % optlabel
87 87 multioccur = True
88 88 elif (default is not None) and not isinstance(default, bool):
89 89 lo += " %s" % optlabel
90 90
91 91 data.append((so, lo, desc))
92 92
93 93 if multioccur:
94 94 header += (_(" ([+] can be repeated)"))
95 95
96 96 rst = ['\n%s:\n\n' % header]
97 97 rst.extend(minirst.maketable(data, 1))
98 98
99 99 return ''.join(rst)
100 100
101 101 def indicateomitted(rst, omitted, notomitted=None):
102 102 rst.append('\n\n.. container:: omitted\n\n %s\n\n' % omitted)
103 103 if notomitted:
104 104 rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted)
105 105
106 106 def filtercmd(ui, cmd, kw, doc):
107 107 if not ui.debugflag and cmd.startswith("debug") and kw != "debug":
108 108 return True
109 109 if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
110 110 return True
111 111 return False
112 112
113 113 def topicmatch(ui, kw):
114 114 """Return help topics matching kw.
115 115
116 116 Returns {'section': [(name, summary), ...], ...} where section is
117 117 one of topics, commands, extensions, or extensioncommands.
118 118 """
119 119 kw = encoding.lower(kw)
120 120 def lowercontains(container):
121 121 return kw in encoding.lower(container) # translated in helptable
122 122 results = {'topics': [],
123 123 'commands': [],
124 124 'extensions': [],
125 125 'extensioncommands': [],
126 126 }
127 127 for names, header, doc in helptable:
128 128 # Old extensions may use a str as doc.
129 129 if (sum(map(lowercontains, names))
130 130 or lowercontains(header)
131 131 or (callable(doc) and lowercontains(doc(ui)))):
132 132 results['topics'].append((names[0], header))
133 133 from . import commands # avoid cycle
134 134 for cmd, entry in commands.table.iteritems():
135 135 if len(entry) == 3:
136 136 summary = entry[2]
137 137 else:
138 138 summary = ''
139 139 # translate docs *before* searching there
140 140 docs = _(getattr(entry[0], '__doc__', None)) or ''
141 141 if kw in cmd or lowercontains(summary) or lowercontains(docs):
142 142 doclines = docs.splitlines()
143 143 if doclines:
144 144 summary = doclines[0]
145 145 cmdname = cmd.partition('|')[0].lstrip('^')
146 146 if filtercmd(ui, cmdname, kw, docs):
147 147 continue
148 148 results['commands'].append((cmdname, summary))
149 149 for name, docs in itertools.chain(
150 150 extensions.enabled(False).iteritems(),
151 151 extensions.disabled().iteritems()):
152 152 if not docs:
153 153 continue
154 154 mod = extensions.load(ui, name, '')
155 155 name = name.rpartition('.')[-1]
156 156 if lowercontains(name) or lowercontains(docs):
157 157 # extension docs are already translated
158 158 results['extensions'].append((name, docs.splitlines()[0]))
159 159 for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems():
160 160 if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])):
161 161 cmdname = cmd.partition('|')[0].lstrip('^')
162 162 if entry[0].__doc__:
163 163 cmddoc = gettext(entry[0].__doc__).splitlines()[0]
164 164 else:
165 165 cmddoc = _('(no help text available)')
166 166 if filtercmd(ui, cmdname, kw, cmddoc):
167 167 continue
168 168 results['extensioncommands'].append((cmdname, cmddoc))
169 169 return results
170 170
171 171 def loaddoc(topic, subdir=None):
172 172 """Return a delayed loader for help/topic.txt."""
173 173
174 174 def loader(ui):
175 175 docdir = os.path.join(util.datapath, 'help')
176 176 if subdir:
177 177 docdir = os.path.join(docdir, subdir)
178 178 path = os.path.join(docdir, topic + ".txt")
179 179 doc = gettext(util.readfile(path))
180 180 for rewriter in helphooks.get(topic, []):
181 181 doc = rewriter(ui, topic, doc)
182 182 return doc
183 183
184 184 return loader
185 185
186 186 internalstable = sorted([
187 187 (['bundles'], _('container for exchange of repository data'),
188 188 loaddoc('bundles', subdir='internals')),
189 189 (['changegroups'], _('representation of revlog data'),
190 190 loaddoc('changegroups', subdir='internals')),
191 (['requirements'], _('repository requirements'),
192 loaddoc('requirements', subdir='internals')),
191 193 (['revlogs'], _('revision storage mechanism'),
192 194 loaddoc('revlogs', subdir='internals')),
193 195 ])
194 196
195 197 def internalshelp(ui):
196 198 """Generate the index for the "internals" topic."""
197 199 lines = []
198 200 for names, header, doc in internalstable:
199 201 lines.append(' :%s: %s\n' % (names[0], header))
200 202
201 203 return ''.join(lines)
202 204
203 205 helptable = sorted([
204 206 (["config", "hgrc"], _("Configuration Files"), loaddoc('config')),
205 207 (["dates"], _("Date Formats"), loaddoc('dates')),
206 208 (["patterns"], _("File Name Patterns"), loaddoc('patterns')),
207 209 (['environment', 'env'], _('Environment Variables'),
208 210 loaddoc('environment')),
209 211 (['revisions', 'revs'], _('Specifying Single Revisions'),
210 212 loaddoc('revisions')),
211 213 (['multirevs', 'mrevs'], _('Specifying Multiple Revisions'),
212 214 loaddoc('multirevs')),
213 215 (['revsets', 'revset'], _("Specifying Revision Sets"), loaddoc('revsets')),
214 216 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets')),
215 217 (['diffs'], _('Diff Formats'), loaddoc('diffs')),
216 218 (['merge-tools', 'mergetools'], _('Merge Tools'), loaddoc('merge-tools')),
217 219 (['templating', 'templates', 'template', 'style'], _('Template Usage'),
218 220 loaddoc('templates')),
219 221 (['urls'], _('URL Paths'), loaddoc('urls')),
220 222 (["extensions"], _("Using Additional Features"), extshelp),
221 223 (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos')),
222 224 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')),
223 225 (["glossary"], _("Glossary"), loaddoc('glossary')),
224 226 (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"),
225 227 loaddoc('hgignore')),
226 228 (["phases"], _("Working with Phases"), loaddoc('phases')),
227 229 (['scripting'], _('Using Mercurial from scripts and automation'),
228 230 loaddoc('scripting')),
229 231 (['internals'], _("Technical implementation topics"),
230 232 internalshelp),
231 233 ])
232 234
233 235 # Maps topics with sub-topics to a list of their sub-topics.
234 236 subtopics = {
235 237 'internals': internalstable,
236 238 }
237 239
238 240 # Map topics to lists of callable taking the current topic help and
239 241 # returning the updated version
240 242 helphooks = {}
241 243
242 244 def addtopichook(topic, rewriter):
243 245 helphooks.setdefault(topic, []).append(rewriter)
244 246
245 247 def makeitemsdoc(ui, topic, doc, marker, items, dedent=False):
246 248 """Extract docstring from the items key to function mapping, build a
247 249 single documentation block and use it to overwrite the marker in doc.
248 250 """
249 251 entries = []
250 252 for name in sorted(items):
251 253 text = (items[name].__doc__ or '').rstrip()
252 254 if (not text
253 255 or not ui.verbose and any(w in text for w in _exclkeywords)):
254 256 continue
255 257 text = gettext(text)
256 258 if dedent:
257 259 text = textwrap.dedent(text)
258 260 lines = text.splitlines()
259 261 doclines = [(lines[0])]
260 262 for l in lines[1:]:
261 263 # Stop once we find some Python doctest
262 264 if l.strip().startswith('>>>'):
263 265 break
264 266 if dedent:
265 267 doclines.append(l.rstrip())
266 268 else:
267 269 doclines.append(' ' + l.strip())
268 270 entries.append('\n'.join(doclines))
269 271 entries = '\n\n'.join(entries)
270 272 return doc.replace(marker, entries)
271 273
272 274 def addtopicsymbols(topic, marker, symbols, dedent=False):
273 275 def add(ui, topic, doc):
274 276 return makeitemsdoc(ui, topic, doc, marker, symbols, dedent=dedent)
275 277 addtopichook(topic, add)
276 278
277 279 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
278 280 addtopicsymbols('merge-tools', '.. internaltoolsmarker',
279 281 filemerge.internalsdoc)
280 282 addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols)
281 283 addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords)
282 284 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
283 285 addtopicsymbols('templates', '.. functionsmarker', templater.funcs)
284 286 addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands,
285 287 dedent=True)
286 288
287 289 def help_(ui, name, unknowncmd=False, full=True, subtopic=None, **opts):
288 290 '''
289 291 Generate the help for 'name' as unformatted restructured text. If
290 292 'name' is None, describe the commands available.
291 293 '''
292 294
293 295 from . import commands # avoid cycle
294 296
295 297 def helpcmd(name, subtopic=None):
296 298 try:
297 299 aliases, entry = cmdutil.findcmd(name, commands.table,
298 300 strict=unknowncmd)
299 301 except error.AmbiguousCommand as inst:
300 302 # py3k fix: except vars can't be used outside the scope of the
301 303 # except block, nor can be used inside a lambda. python issue4617
302 304 prefix = inst.args[0]
303 305 select = lambda c: c.lstrip('^').startswith(prefix)
304 306 rst = helplist(select)
305 307 return rst
306 308
307 309 rst = []
308 310
309 311 # check if it's an invalid alias and display its error if it is
310 312 if getattr(entry[0], 'badalias', None):
311 313 rst.append(entry[0].badalias + '\n')
312 314 if entry[0].unknowncmd:
313 315 try:
314 316 rst.extend(helpextcmd(entry[0].cmdname))
315 317 except error.UnknownCommand:
316 318 pass
317 319 return rst
318 320
319 321 # synopsis
320 322 if len(entry) > 2:
321 323 if entry[2].startswith('hg'):
322 324 rst.append("%s\n" % entry[2])
323 325 else:
324 326 rst.append('hg %s %s\n' % (aliases[0], entry[2]))
325 327 else:
326 328 rst.append('hg %s\n' % aliases[0])
327 329 # aliases
328 330 if full and not ui.quiet and len(aliases) > 1:
329 331 rst.append(_("\naliases: %s\n") % ', '.join(aliases[1:]))
330 332 rst.append('\n')
331 333
332 334 # description
333 335 doc = gettext(entry[0].__doc__)
334 336 if not doc:
335 337 doc = _("(no help text available)")
336 338 if util.safehasattr(entry[0], 'definition'): # aliased command
337 339 if entry[0].definition.startswith('!'): # shell alias
338 340 doc = _('shell alias for::\n\n %s') % entry[0].definition[1:]
339 341 else:
340 342 doc = _('alias for: hg %s\n\n%s') % (entry[0].definition, doc)
341 343 doc = doc.splitlines(True)
342 344 if ui.quiet or not full:
343 345 rst.append(doc[0])
344 346 else:
345 347 rst.extend(doc)
346 348 rst.append('\n')
347 349
348 350 # check if this command shadows a non-trivial (multi-line)
349 351 # extension help text
350 352 try:
351 353 mod = extensions.find(name)
352 354 doc = gettext(mod.__doc__) or ''
353 355 if '\n' in doc.strip():
354 356 msg = _('(use "hg help -e %s" to show help for '
355 357 'the %s extension)') % (name, name)
356 358 rst.append('\n%s\n' % msg)
357 359 except KeyError:
358 360 pass
359 361
360 362 # options
361 363 if not ui.quiet and entry[1]:
362 364 rst.append(optrst(_("options"), entry[1], ui.verbose))
363 365
364 366 if ui.verbose:
365 367 rst.append(optrst(_("global options"),
366 368 commands.globalopts, ui.verbose))
367 369
368 370 if not ui.verbose:
369 371 if not full:
370 372 rst.append(_('\n(use "hg %s -h" to show more help)\n')
371 373 % name)
372 374 elif not ui.quiet:
373 375 rst.append(_('\n(some details hidden, use --verbose '
374 376 'to show complete help)'))
375 377
376 378 return rst
377 379
378 380
379 381 def helplist(select=None, **opts):
380 382 # list of commands
381 383 if name == "shortlist":
382 384 header = _('basic commands:\n\n')
383 385 elif name == "debug":
384 386 header = _('debug commands (internal and unsupported):\n\n')
385 387 else:
386 388 header = _('list of commands:\n\n')
387 389
388 390 h = {}
389 391 cmds = {}
390 392 for c, e in commands.table.iteritems():
391 393 f = c.partition("|")[0]
392 394 if select and not select(f):
393 395 continue
394 396 if (not select and name != 'shortlist' and
395 397 e[0].__module__ != commands.__name__):
396 398 continue
397 399 if name == "shortlist" and not f.startswith("^"):
398 400 continue
399 401 f = f.lstrip("^")
400 402 doc = e[0].__doc__
401 403 if filtercmd(ui, f, name, doc):
402 404 continue
403 405 doc = gettext(doc)
404 406 if not doc:
405 407 doc = _("(no help text available)")
406 408 h[f] = doc.splitlines()[0].rstrip()
407 409 cmds[f] = c.lstrip("^")
408 410
409 411 rst = []
410 412 if not h:
411 413 if not ui.quiet:
412 414 rst.append(_('no commands defined\n'))
413 415 return rst
414 416
415 417 if not ui.quiet:
416 418 rst.append(header)
417 419 fns = sorted(h)
418 420 for f in fns:
419 421 if ui.verbose:
420 422 commacmds = cmds[f].replace("|",", ")
421 423 rst.append(" :%s: %s\n" % (commacmds, h[f]))
422 424 else:
423 425 rst.append(' :%s: %s\n' % (f, h[f]))
424 426
425 427 ex = opts.get
426 428 anyopts = (ex('keyword') or not (ex('command') or ex('extension')))
427 429 if not name and anyopts:
428 430 exts = listexts(_('enabled extensions:'), extensions.enabled())
429 431 if exts:
430 432 rst.append('\n')
431 433 rst.extend(exts)
432 434
433 435 rst.append(_("\nadditional help topics:\n\n"))
434 436 topics = []
435 437 for names, header, doc in helptable:
436 438 topics.append((names[0], header))
437 439 for t, desc in topics:
438 440 rst.append(" :%s: %s\n" % (t, desc))
439 441
440 442 if ui.quiet:
441 443 pass
442 444 elif ui.verbose:
443 445 rst.append('\n%s\n' % optrst(_("global options"),
444 446 commands.globalopts, ui.verbose))
445 447 if name == 'shortlist':
446 448 rst.append(_('\n(use "hg help" for the full list '
447 449 'of commands)\n'))
448 450 else:
449 451 if name == 'shortlist':
450 452 rst.append(_('\n(use "hg help" for the full list of commands '
451 453 'or "hg -v" for details)\n'))
452 454 elif name and not full:
453 455 rst.append(_('\n(use "hg help %s" to show the full help '
454 456 'text)\n') % name)
455 457 elif name and cmds and name in cmds.keys():
456 458 rst.append(_('\n(use "hg help -v -e %s" to show built-in '
457 459 'aliases and global options)\n') % name)
458 460 else:
459 461 rst.append(_('\n(use "hg help -v%s" to show built-in aliases '
460 462 'and global options)\n')
461 463 % (name and " " + name or ""))
462 464 return rst
463 465
464 466 def helptopic(name, subtopic=None):
465 467 # Look for sub-topic entry first.
466 468 header, doc = None, None
467 469 if subtopic and name in subtopics:
468 470 for names, header, doc in subtopics[name]:
469 471 if subtopic in names:
470 472 break
471 473
472 474 if not header:
473 475 for names, header, doc in helptable:
474 476 if name in names:
475 477 break
476 478 else:
477 479 raise error.UnknownCommand(name)
478 480
479 481 rst = [minirst.section(header)]
480 482
481 483 # description
482 484 if not doc:
483 485 rst.append(" %s\n" % _("(no help text available)"))
484 486 if callable(doc):
485 487 rst += [" %s\n" % l for l in doc(ui).splitlines()]
486 488
487 489 if not ui.verbose:
488 490 omitted = _('(some details hidden, use --verbose'
489 491 ' to show complete help)')
490 492 indicateomitted(rst, omitted)
491 493
492 494 try:
493 495 cmdutil.findcmd(name, commands.table)
494 496 rst.append(_('\nuse "hg help -c %s" to see help for '
495 497 'the %s command\n') % (name, name))
496 498 except error.UnknownCommand:
497 499 pass
498 500 return rst
499 501
500 502 def helpext(name, subtopic=None):
501 503 try:
502 504 mod = extensions.find(name)
503 505 doc = gettext(mod.__doc__) or _('no help text available')
504 506 except KeyError:
505 507 mod = None
506 508 doc = extensions.disabledext(name)
507 509 if not doc:
508 510 raise error.UnknownCommand(name)
509 511
510 512 if '\n' not in doc:
511 513 head, tail = doc, ""
512 514 else:
513 515 head, tail = doc.split('\n', 1)
514 516 rst = [_('%s extension - %s\n\n') % (name.rpartition('.')[-1], head)]
515 517 if tail:
516 518 rst.extend(tail.splitlines(True))
517 519 rst.append('\n')
518 520
519 521 if not ui.verbose:
520 522 omitted = _('(some details hidden, use --verbose'
521 523 ' to show complete help)')
522 524 indicateomitted(rst, omitted)
523 525
524 526 if mod:
525 527 try:
526 528 ct = mod.cmdtable
527 529 except AttributeError:
528 530 ct = {}
529 531 modcmds = set([c.partition('|')[0] for c in ct])
530 532 rst.extend(helplist(modcmds.__contains__))
531 533 else:
532 534 rst.append(_('(use "hg help extensions" for information on enabling'
533 535 ' extensions)\n'))
534 536 return rst
535 537
536 538 def helpextcmd(name, subtopic=None):
537 539 cmd, ext, mod = extensions.disabledcmd(ui, name,
538 540 ui.configbool('ui', 'strict'))
539 541 doc = gettext(mod.__doc__).splitlines()[0]
540 542
541 543 rst = listexts(_("'%s' is provided by the following "
542 544 "extension:") % cmd, {ext: doc}, indent=4,
543 545 showdeprecated=True)
544 546 rst.append('\n')
545 547 rst.append(_('(use "hg help extensions" for information on enabling '
546 548 'extensions)\n'))
547 549 return rst
548 550
549 551
550 552 rst = []
551 553 kw = opts.get('keyword')
552 554 if kw or name is None and any(opts[o] for o in opts):
553 555 matches = topicmatch(ui, name or '')
554 556 helpareas = []
555 557 if opts.get('extension'):
556 558 helpareas += [('extensions', _('Extensions'))]
557 559 if opts.get('command'):
558 560 helpareas += [('commands', _('Commands'))]
559 561 if not helpareas:
560 562 helpareas = [('topics', _('Topics')),
561 563 ('commands', _('Commands')),
562 564 ('extensions', _('Extensions')),
563 565 ('extensioncommands', _('Extension Commands'))]
564 566 for t, title in helpareas:
565 567 if matches[t]:
566 568 rst.append('%s:\n\n' % title)
567 569 rst.extend(minirst.maketable(sorted(matches[t]), 1))
568 570 rst.append('\n')
569 571 if not rst:
570 572 msg = _('no matches')
571 573 hint = _('try "hg help" for a list of topics')
572 574 raise error.Abort(msg, hint=hint)
573 575 elif name and name != 'shortlist':
574 576 queries = []
575 577 if unknowncmd:
576 578 queries += [helpextcmd]
577 579 if opts.get('extension'):
578 580 queries += [helpext]
579 581 if opts.get('command'):
580 582 queries += [helpcmd]
581 583 if not queries:
582 584 queries = (helptopic, helpcmd, helpext, helpextcmd)
583 585 for f in queries:
584 586 try:
585 587 rst = f(name, subtopic)
586 588 break
587 589 except error.UnknownCommand:
588 590 pass
589 591 else:
590 592 if unknowncmd:
591 593 raise error.UnknownCommand(name)
592 594 else:
593 595 msg = _('no such help topic: %s') % name
594 596 hint = _('try "hg help --keyword %s"') % name
595 597 raise error.Abort(msg, hint=hint)
596 598 else:
597 599 # program name
598 600 if not ui.quiet:
599 601 rst = [_("Mercurial Distributed SCM\n"), '\n']
600 602 rst.extend(helplist(None, **opts))
601 603
602 604 return ''.join(rst)
@@ -1,2994 +1,3002 b''
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 $ hg help
48 48 Mercurial Distributed SCM
49 49
50 50 list of commands:
51 51
52 52 add add the specified files on the next commit
53 53 addremove add all new files, delete all missing files
54 54 annotate show changeset information by line for each file
55 55 archive create an unversioned archive of a repository revision
56 56 backout reverse effect of earlier changeset
57 57 bisect subdivision search of changesets
58 58 bookmarks create a new bookmark or list existing bookmarks
59 59 branch set or show the current branch name
60 60 branches list repository named branches
61 61 bundle create a changegroup file
62 62 cat output the current or given revision of files
63 63 clone make a copy of an existing repository
64 64 commit commit the specified files or all outstanding changes
65 65 config show combined config settings from all hgrc files
66 66 copy mark files as copied for the next commit
67 67 diff diff repository (or selected files)
68 68 export dump the header and diffs for one or more changesets
69 69 files list tracked files
70 70 forget forget the specified files on the next commit
71 71 graft copy changes from other branches onto the current branch
72 72 grep search for a pattern in specified files and revisions
73 73 heads show branch heads
74 74 help show help for a given topic or a help overview
75 75 identify identify the working directory or specified revision
76 76 import import an ordered set of patches
77 77 incoming show new changesets found in source
78 78 init create a new repository in the given directory
79 79 log show revision history of entire repository or files
80 80 manifest output the current or given revision of the project manifest
81 81 merge merge another revision into working directory
82 82 outgoing show changesets not found in the destination
83 83 paths show aliases for remote repositories
84 84 phase set or show the current phase name
85 85 pull pull changes from the specified source
86 86 push push changes to the specified destination
87 87 recover roll back an interrupted transaction
88 88 remove remove the specified files on the next commit
89 89 rename rename files; equivalent of copy + remove
90 90 resolve redo merges or set/view the merge status of files
91 91 revert restore files to their checkout state
92 92 root print the root (top) of the current working directory
93 93 serve start stand-alone webserver
94 94 status show changed files in the working directory
95 95 summary summarize working directory state
96 96 tag add one or more tags for the current or given revision
97 97 tags list repository tags
98 98 unbundle apply one or more changegroup files
99 99 update update working directory (or switch revisions)
100 100 verify verify the integrity of the repository
101 101 version output version and copyright information
102 102
103 103 additional help topics:
104 104
105 105 config Configuration Files
106 106 dates Date Formats
107 107 diffs Diff Formats
108 108 environment Environment Variables
109 109 extensions Using Additional Features
110 110 filesets Specifying File Sets
111 111 glossary Glossary
112 112 hgignore Syntax for Mercurial Ignore Files
113 113 hgweb Configuring hgweb
114 114 internals Technical implementation topics
115 115 merge-tools Merge Tools
116 116 multirevs Specifying Multiple Revisions
117 117 patterns File Name Patterns
118 118 phases Working with Phases
119 119 revisions Specifying Single Revisions
120 120 revsets Specifying Revision Sets
121 121 scripting Using Mercurial from scripts and automation
122 122 subrepos Subrepositories
123 123 templating Template Usage
124 124 urls URL Paths
125 125
126 126 (use "hg help -v" to show built-in aliases and global options)
127 127
128 128 $ hg -q help
129 129 add add the specified files on the next commit
130 130 addremove add all new files, delete all missing files
131 131 annotate show changeset information by line for each file
132 132 archive create an unversioned archive of a repository revision
133 133 backout reverse effect of earlier changeset
134 134 bisect subdivision search of changesets
135 135 bookmarks create a new bookmark or list existing bookmarks
136 136 branch set or show the current branch name
137 137 branches list repository named branches
138 138 bundle create a changegroup file
139 139 cat output the current or given revision of files
140 140 clone make a copy of an existing repository
141 141 commit commit the specified files or all outstanding changes
142 142 config show combined config settings from all hgrc files
143 143 copy mark files as copied for the next commit
144 144 diff diff repository (or selected files)
145 145 export dump the header and diffs for one or more changesets
146 146 files list tracked files
147 147 forget forget the specified files on the next commit
148 148 graft copy changes from other branches onto the current branch
149 149 grep search for a pattern in specified files and revisions
150 150 heads show branch heads
151 151 help show help for a given topic or a help overview
152 152 identify identify the working directory or specified revision
153 153 import import an ordered set of patches
154 154 incoming show new changesets found in source
155 155 init create a new repository in the given directory
156 156 log show revision history of entire repository or files
157 157 manifest output the current or given revision of the project manifest
158 158 merge merge another revision into working directory
159 159 outgoing show changesets not found in the destination
160 160 paths show aliases for remote repositories
161 161 phase set or show the current phase name
162 162 pull pull changes from the specified source
163 163 push push changes to the specified destination
164 164 recover roll back an interrupted transaction
165 165 remove remove the specified files on the next commit
166 166 rename rename files; equivalent of copy + remove
167 167 resolve redo merges or set/view the merge status of files
168 168 revert restore files to their checkout state
169 169 root print the root (top) of the current working directory
170 170 serve start stand-alone webserver
171 171 status show changed files in the working directory
172 172 summary summarize working directory state
173 173 tag add one or more tags for the current or given revision
174 174 tags list repository tags
175 175 unbundle apply one or more changegroup files
176 176 update update working directory (or switch revisions)
177 177 verify verify the integrity of the repository
178 178 version output version and copyright information
179 179
180 180 additional help topics:
181 181
182 182 config Configuration Files
183 183 dates Date Formats
184 184 diffs Diff Formats
185 185 environment Environment Variables
186 186 extensions Using Additional Features
187 187 filesets Specifying File Sets
188 188 glossary Glossary
189 189 hgignore Syntax for Mercurial Ignore Files
190 190 hgweb Configuring hgweb
191 191 internals Technical implementation topics
192 192 merge-tools Merge Tools
193 193 multirevs Specifying Multiple Revisions
194 194 patterns File Name Patterns
195 195 phases Working with Phases
196 196 revisions Specifying Single Revisions
197 197 revsets Specifying Revision Sets
198 198 scripting Using Mercurial from scripts and automation
199 199 subrepos Subrepositories
200 200 templating Template Usage
201 201 urls URL Paths
202 202
203 203 Test extension help:
204 204 $ hg help extensions --config extensions.rebase= --config extensions.children=
205 205 Using Additional Features
206 206 """""""""""""""""""""""""
207 207
208 208 Mercurial has the ability to add new features through the use of
209 209 extensions. Extensions may add new commands, add options to existing
210 210 commands, change the default behavior of commands, or implement hooks.
211 211
212 212 To enable the "foo" extension, either shipped with Mercurial or in the
213 213 Python search path, create an entry for it in your configuration file,
214 214 like this:
215 215
216 216 [extensions]
217 217 foo =
218 218
219 219 You may also specify the full path to an extension:
220 220
221 221 [extensions]
222 222 myfeature = ~/.hgext/myfeature.py
223 223
224 224 See 'hg help config' for more information on configuration files.
225 225
226 226 Extensions are not loaded by default for a variety of reasons: they can
227 227 increase startup overhead; they may be meant for advanced usage only; they
228 228 may provide potentially dangerous abilities (such as letting you destroy
229 229 or modify history); they might not be ready for prime time; or they may
230 230 alter some usual behaviors of stock Mercurial. It is thus up to the user
231 231 to activate extensions as needed.
232 232
233 233 To explicitly disable an extension enabled in a configuration file of
234 234 broader scope, prepend its path with !:
235 235
236 236 [extensions]
237 237 # disabling extension bar residing in /path/to/extension/bar.py
238 238 bar = !/path/to/extension/bar.py
239 239 # ditto, but no path was supplied for extension baz
240 240 baz = !
241 241
242 242 enabled extensions:
243 243
244 244 children command to display child changesets (DEPRECATED)
245 245 rebase command to move sets of revisions to a different ancestor
246 246
247 247 disabled extensions:
248 248
249 249 acl hooks for controlling repository access
250 250 blackbox log repository events to a blackbox for debugging
251 251 bugzilla hooks for integrating with the Bugzilla bug tracker
252 252 censor erase file content at a given revision
253 253 churn command to display statistics about repository history
254 254 clonebundles advertise pre-generated bundles to seed clones
255 255 color colorize output from some commands
256 256 convert import revisions from foreign VCS repositories into
257 257 Mercurial
258 258 eol automatically manage newlines in repository files
259 259 extdiff command to allow external programs to compare revisions
260 260 factotum http authentication with factotum
261 261 gpg commands to sign and verify changesets
262 262 hgcia hooks for integrating with the CIA.vc notification service
263 263 hgk browse the repository in a graphical way
264 264 highlight syntax highlighting for hgweb (requires Pygments)
265 265 histedit interactive history editing
266 266 keyword expand keywords in tracked files
267 267 largefiles track large binary files
268 268 mq manage a stack of patches
269 269 notify hooks for sending email push notifications
270 270 pager browse command output with an external pager
271 271 patchbomb command to send changesets as (a series of) patch emails
272 272 purge command to delete untracked files from the working
273 273 directory
274 274 record commands to interactively select changes for
275 275 commit/qrefresh
276 276 relink recreates hardlinks between repository clones
277 277 schemes extend schemes with shortcuts to repository swarms
278 278 share share a common history between several working directories
279 279 shelve save and restore changes to the working directory
280 280 strip strip changesets and their descendants from history
281 281 transplant command to transplant changesets from another branch
282 282 win32mbcs allow the use of MBCS paths with problematic encodings
283 283 zeroconf discover and advertise repositories on the local network
284 284
285 285 Verify that extension keywords appear in help templates
286 286
287 287 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
288 288
289 289 Test short command list with verbose option
290 290
291 291 $ hg -v help shortlist
292 292 Mercurial Distributed SCM
293 293
294 294 basic commands:
295 295
296 296 add add the specified files on the next commit
297 297 annotate, blame
298 298 show changeset information by line for each file
299 299 clone make a copy of an existing repository
300 300 commit, ci commit the specified files or all outstanding changes
301 301 diff diff repository (or selected files)
302 302 export dump the header and diffs for one or more changesets
303 303 forget forget the specified files on the next commit
304 304 init create a new repository in the given directory
305 305 log, history show revision history of entire repository or files
306 306 merge merge another revision into working directory
307 307 pull pull changes from the specified source
308 308 push push changes to the specified destination
309 309 remove, rm remove the specified files on the next commit
310 310 serve start stand-alone webserver
311 311 status, st show changed files in the working directory
312 312 summary, sum summarize working directory state
313 313 update, up, checkout, co
314 314 update working directory (or switch revisions)
315 315
316 316 global options ([+] can be repeated):
317 317
318 318 -R --repository REPO repository root directory or name of overlay bundle
319 319 file
320 320 --cwd DIR change working directory
321 321 -y --noninteractive do not prompt, automatically pick the first choice for
322 322 all prompts
323 323 -q --quiet suppress output
324 324 -v --verbose enable additional output
325 325 --config CONFIG [+] set/override config option (use 'section.name=value')
326 326 --debug enable debugging output
327 327 --debugger start debugger
328 328 --encoding ENCODE set the charset encoding (default: ascii)
329 329 --encodingmode MODE set the charset encoding mode (default: strict)
330 330 --traceback always print a traceback on exception
331 331 --time time how long the command takes
332 332 --profile print command execution profile
333 333 --version output version information and exit
334 334 -h --help display help and exit
335 335 --hidden consider hidden changesets
336 336
337 337 (use "hg help" for the full list of commands)
338 338
339 339 $ hg add -h
340 340 hg add [OPTION]... [FILE]...
341 341
342 342 add the specified files on the next commit
343 343
344 344 Schedule files to be version controlled and added to the repository.
345 345
346 346 The files will be added to the repository at the next commit. To undo an
347 347 add before that, see 'hg forget'.
348 348
349 349 If no names are given, add all files to the repository (except files
350 350 matching ".hgignore").
351 351
352 352 Returns 0 if all files are successfully added.
353 353
354 354 options ([+] can be repeated):
355 355
356 356 -I --include PATTERN [+] include names matching the given patterns
357 357 -X --exclude PATTERN [+] exclude names matching the given patterns
358 358 -S --subrepos recurse into subrepositories
359 359 -n --dry-run do not perform actions, just print output
360 360
361 361 (some details hidden, use --verbose to show complete help)
362 362
363 363 Verbose help for add
364 364
365 365 $ hg add -hv
366 366 hg add [OPTION]... [FILE]...
367 367
368 368 add the specified files on the next commit
369 369
370 370 Schedule files to be version controlled and added to the repository.
371 371
372 372 The files will be added to the repository at the next commit. To undo an
373 373 add before that, see 'hg forget'.
374 374
375 375 If no names are given, add all files to the repository (except files
376 376 matching ".hgignore").
377 377
378 378 Examples:
379 379
380 380 - New (unknown) files are added automatically by 'hg add':
381 381
382 382 $ ls
383 383 foo.c
384 384 $ hg status
385 385 ? foo.c
386 386 $ hg add
387 387 adding foo.c
388 388 $ hg status
389 389 A foo.c
390 390
391 391 - Specific files to be added can be specified:
392 392
393 393 $ ls
394 394 bar.c foo.c
395 395 $ hg status
396 396 ? bar.c
397 397 ? foo.c
398 398 $ hg add bar.c
399 399 $ hg status
400 400 A bar.c
401 401 ? foo.c
402 402
403 403 Returns 0 if all files are successfully added.
404 404
405 405 options ([+] can be repeated):
406 406
407 407 -I --include PATTERN [+] include names matching the given patterns
408 408 -X --exclude PATTERN [+] exclude names matching the given patterns
409 409 -S --subrepos recurse into subrepositories
410 410 -n --dry-run do not perform actions, just print output
411 411
412 412 global options ([+] can be repeated):
413 413
414 414 -R --repository REPO repository root directory or name of overlay bundle
415 415 file
416 416 --cwd DIR change working directory
417 417 -y --noninteractive do not prompt, automatically pick the first choice for
418 418 all prompts
419 419 -q --quiet suppress output
420 420 -v --verbose enable additional output
421 421 --config CONFIG [+] set/override config option (use 'section.name=value')
422 422 --debug enable debugging output
423 423 --debugger start debugger
424 424 --encoding ENCODE set the charset encoding (default: ascii)
425 425 --encodingmode MODE set the charset encoding mode (default: strict)
426 426 --traceback always print a traceback on exception
427 427 --time time how long the command takes
428 428 --profile print command execution profile
429 429 --version output version information and exit
430 430 -h --help display help and exit
431 431 --hidden consider hidden changesets
432 432
433 433 Test help option with version option
434 434
435 435 $ hg add -h --version
436 436 Mercurial Distributed SCM (version *) (glob)
437 437 (see https://mercurial-scm.org for more information)
438 438
439 439 Copyright (C) 2005-2016 Matt Mackall and others
440 440 This is free software; see the source for copying conditions. There is NO
441 441 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
442 442
443 443 $ hg add --skjdfks
444 444 hg add: option --skjdfks not recognized
445 445 hg add [OPTION]... [FILE]...
446 446
447 447 add the specified files on the next commit
448 448
449 449 options ([+] can be repeated):
450 450
451 451 -I --include PATTERN [+] include names matching the given patterns
452 452 -X --exclude PATTERN [+] exclude names matching the given patterns
453 453 -S --subrepos recurse into subrepositories
454 454 -n --dry-run do not perform actions, just print output
455 455
456 456 (use "hg add -h" to show more help)
457 457 [255]
458 458
459 459 Test ambiguous command help
460 460
461 461 $ hg help ad
462 462 list of commands:
463 463
464 464 add add the specified files on the next commit
465 465 addremove add all new files, delete all missing files
466 466
467 467 (use "hg help -v ad" to show built-in aliases and global options)
468 468
469 469 Test command without options
470 470
471 471 $ hg help verify
472 472 hg verify
473 473
474 474 verify the integrity of the repository
475 475
476 476 Verify the integrity of the current repository.
477 477
478 478 This will perform an extensive check of the repository's integrity,
479 479 validating the hashes and checksums of each entry in the changelog,
480 480 manifest, and tracked files, as well as the integrity of their crosslinks
481 481 and indices.
482 482
483 483 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
484 484 information about recovery from corruption of the repository.
485 485
486 486 Returns 0 on success, 1 if errors are encountered.
487 487
488 488 (some details hidden, use --verbose to show complete help)
489 489
490 490 $ hg help diff
491 491 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
492 492
493 493 diff repository (or selected files)
494 494
495 495 Show differences between revisions for the specified files.
496 496
497 497 Differences between files are shown using the unified diff format.
498 498
499 499 Note:
500 500 'hg diff' may generate unexpected results for merges, as it will
501 501 default to comparing against the working directory's first parent
502 502 changeset if no revisions are specified.
503 503
504 504 When two revision arguments are given, then changes are shown between
505 505 those revisions. If only one revision is specified then that revision is
506 506 compared to the working directory, and, when no revisions are specified,
507 507 the working directory files are compared to its first parent.
508 508
509 509 Alternatively you can specify -c/--change with a revision to see the
510 510 changes in that changeset relative to its first parent.
511 511
512 512 Without the -a/--text option, diff will avoid generating diffs of files it
513 513 detects as binary. With -a, diff will generate a diff anyway, probably
514 514 with undesirable results.
515 515
516 516 Use the -g/--git option to generate diffs in the git extended diff format.
517 517 For more information, read 'hg help diffs'.
518 518
519 519 Returns 0 on success.
520 520
521 521 options ([+] can be repeated):
522 522
523 523 -r --rev REV [+] revision
524 524 -c --change REV change made by revision
525 525 -a --text treat all files as text
526 526 -g --git use git extended diff format
527 527 --nodates omit dates from diff headers
528 528 --noprefix omit a/ and b/ prefixes from filenames
529 529 -p --show-function show which function each change is in
530 530 --reverse produce a diff that undoes the changes
531 531 -w --ignore-all-space ignore white space when comparing lines
532 532 -b --ignore-space-change ignore changes in the amount of white space
533 533 -B --ignore-blank-lines ignore changes whose lines are all blank
534 534 -U --unified NUM number of lines of context to show
535 535 --stat output diffstat-style summary of changes
536 536 --root DIR produce diffs relative to subdirectory
537 537 -I --include PATTERN [+] include names matching the given patterns
538 538 -X --exclude PATTERN [+] exclude names matching the given patterns
539 539 -S --subrepos recurse into subrepositories
540 540
541 541 (some details hidden, use --verbose to show complete help)
542 542
543 543 $ hg help status
544 544 hg status [OPTION]... [FILE]...
545 545
546 546 aliases: st
547 547
548 548 show changed files in the working directory
549 549
550 550 Show status of files in the repository. If names are given, only files
551 551 that match are shown. Files that are clean or ignored or the source of a
552 552 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
553 553 -C/--copies or -A/--all are given. Unless options described with "show
554 554 only ..." are given, the options -mardu are used.
555 555
556 556 Option -q/--quiet hides untracked (unknown and ignored) files unless
557 557 explicitly requested with -u/--unknown or -i/--ignored.
558 558
559 559 Note:
560 560 'hg status' may appear to disagree with diff if permissions have
561 561 changed or a merge has occurred. The standard diff format does not
562 562 report permission changes and diff only reports changes relative to one
563 563 merge parent.
564 564
565 565 If one revision is given, it is used as the base revision. If two
566 566 revisions are given, the differences between them are shown. The --change
567 567 option can also be used as a shortcut to list the changed files of a
568 568 revision from its first parent.
569 569
570 570 The codes used to show the status of files are:
571 571
572 572 M = modified
573 573 A = added
574 574 R = removed
575 575 C = clean
576 576 ! = missing (deleted by non-hg command, but still tracked)
577 577 ? = not tracked
578 578 I = ignored
579 579 = origin of the previous file (with --copies)
580 580
581 581 Returns 0 on success.
582 582
583 583 options ([+] can be repeated):
584 584
585 585 -A --all show status of all files
586 586 -m --modified show only modified files
587 587 -a --added show only added files
588 588 -r --removed show only removed files
589 589 -d --deleted show only deleted (but tracked) files
590 590 -c --clean show only files without changes
591 591 -u --unknown show only unknown (not tracked) files
592 592 -i --ignored show only ignored files
593 593 -n --no-status hide status prefix
594 594 -C --copies show source of copied files
595 595 -0 --print0 end filenames with NUL, for use with xargs
596 596 --rev REV [+] show difference from revision
597 597 --change REV list the changed files of a revision
598 598 -I --include PATTERN [+] include names matching the given patterns
599 599 -X --exclude PATTERN [+] exclude names matching the given patterns
600 600 -S --subrepos recurse into subrepositories
601 601
602 602 (some details hidden, use --verbose to show complete help)
603 603
604 604 $ hg -q help status
605 605 hg status [OPTION]... [FILE]...
606 606
607 607 show changed files in the working directory
608 608
609 609 $ hg help foo
610 610 abort: no such help topic: foo
611 611 (try "hg help --keyword foo")
612 612 [255]
613 613
614 614 $ hg skjdfks
615 615 hg: unknown command 'skjdfks'
616 616 Mercurial Distributed SCM
617 617
618 618 basic commands:
619 619
620 620 add add the specified files on the next commit
621 621 annotate show changeset information by line for each file
622 622 clone make a copy of an existing repository
623 623 commit commit the specified files or all outstanding changes
624 624 diff diff repository (or selected files)
625 625 export dump the header and diffs for one or more changesets
626 626 forget forget the specified files on the next commit
627 627 init create a new repository in the given directory
628 628 log show revision history of entire repository or files
629 629 merge merge another revision into working directory
630 630 pull pull changes from the specified source
631 631 push push changes to the specified destination
632 632 remove remove the specified files on the next commit
633 633 serve start stand-alone webserver
634 634 status show changed files in the working directory
635 635 summary summarize working directory state
636 636 update update working directory (or switch revisions)
637 637
638 638 (use "hg help" for the full list of commands or "hg -v" for details)
639 639 [255]
640 640
641 641
642 642 Make sure that we don't run afoul of the help system thinking that
643 643 this is a section and erroring out weirdly.
644 644
645 645 $ hg .log
646 646 hg: unknown command '.log'
647 647 (did you mean log?)
648 648 [255]
649 649
650 650 $ hg log.
651 651 hg: unknown command 'log.'
652 652 (did you mean log?)
653 653 [255]
654 654 $ hg pu.lh
655 655 hg: unknown command 'pu.lh'
656 656 (did you mean one of pull, push?)
657 657 [255]
658 658
659 659 $ cat > helpext.py <<EOF
660 660 > import os
661 661 > from mercurial import cmdutil, commands
662 662 >
663 663 > cmdtable = {}
664 664 > command = cmdutil.command(cmdtable)
665 665 >
666 666 > @command('nohelp',
667 667 > [('', 'longdesc', 3, 'x'*90),
668 668 > ('n', '', None, 'normal desc'),
669 669 > ('', 'newline', '', 'line1\nline2')],
670 670 > 'hg nohelp',
671 671 > norepo=True)
672 672 > @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')])
673 673 > @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')])
674 674 > def nohelp(ui, *args, **kwargs):
675 675 > pass
676 676 >
677 677 > EOF
678 678 $ echo '[extensions]' >> $HGRCPATH
679 679 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
680 680
681 681 Test command with no help text
682 682
683 683 $ hg help nohelp
684 684 hg nohelp
685 685
686 686 (no help text available)
687 687
688 688 options:
689 689
690 690 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
691 691 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
692 692 -n -- normal desc
693 693 --newline VALUE line1 line2
694 694
695 695 (some details hidden, use --verbose to show complete help)
696 696
697 697 $ hg help -k nohelp
698 698 Commands:
699 699
700 700 nohelp hg nohelp
701 701
702 702 Extension Commands:
703 703
704 704 nohelp (no help text available)
705 705
706 706 Test that default list of commands omits extension commands
707 707
708 708 $ hg help
709 709 Mercurial Distributed SCM
710 710
711 711 list of commands:
712 712
713 713 add add the specified files on the next commit
714 714 addremove add all new files, delete all missing files
715 715 annotate show changeset information by line for each file
716 716 archive create an unversioned archive of a repository revision
717 717 backout reverse effect of earlier changeset
718 718 bisect subdivision search of changesets
719 719 bookmarks create a new bookmark or list existing bookmarks
720 720 branch set or show the current branch name
721 721 branches list repository named branches
722 722 bundle create a changegroup file
723 723 cat output the current or given revision of files
724 724 clone make a copy of an existing repository
725 725 commit commit the specified files or all outstanding changes
726 726 config show combined config settings from all hgrc files
727 727 copy mark files as copied for the next commit
728 728 diff diff repository (or selected files)
729 729 export dump the header and diffs for one or more changesets
730 730 files list tracked files
731 731 forget forget the specified files on the next commit
732 732 graft copy changes from other branches onto the current branch
733 733 grep search for a pattern in specified files and revisions
734 734 heads show branch heads
735 735 help show help for a given topic or a help overview
736 736 identify identify the working directory or specified revision
737 737 import import an ordered set of patches
738 738 incoming show new changesets found in source
739 739 init create a new repository in the given directory
740 740 log show revision history of entire repository or files
741 741 manifest output the current or given revision of the project manifest
742 742 merge merge another revision into working directory
743 743 outgoing show changesets not found in the destination
744 744 paths show aliases for remote repositories
745 745 phase set or show the current phase name
746 746 pull pull changes from the specified source
747 747 push push changes to the specified destination
748 748 recover roll back an interrupted transaction
749 749 remove remove the specified files on the next commit
750 750 rename rename files; equivalent of copy + remove
751 751 resolve redo merges or set/view the merge status of files
752 752 revert restore files to their checkout state
753 753 root print the root (top) of the current working directory
754 754 serve start stand-alone webserver
755 755 status show changed files in the working directory
756 756 summary summarize working directory state
757 757 tag add one or more tags for the current or given revision
758 758 tags list repository tags
759 759 unbundle apply one or more changegroup files
760 760 update update working directory (or switch revisions)
761 761 verify verify the integrity of the repository
762 762 version output version and copyright information
763 763
764 764 enabled extensions:
765 765
766 766 helpext (no help text available)
767 767
768 768 additional help topics:
769 769
770 770 config Configuration Files
771 771 dates Date Formats
772 772 diffs Diff Formats
773 773 environment Environment Variables
774 774 extensions Using Additional Features
775 775 filesets Specifying File Sets
776 776 glossary Glossary
777 777 hgignore Syntax for Mercurial Ignore Files
778 778 hgweb Configuring hgweb
779 779 internals Technical implementation topics
780 780 merge-tools Merge Tools
781 781 multirevs Specifying Multiple Revisions
782 782 patterns File Name Patterns
783 783 phases Working with Phases
784 784 revisions Specifying Single Revisions
785 785 revsets Specifying Revision Sets
786 786 scripting Using Mercurial from scripts and automation
787 787 subrepos Subrepositories
788 788 templating Template Usage
789 789 urls URL Paths
790 790
791 791 (use "hg help -v" to show built-in aliases and global options)
792 792
793 793
794 794 Test list of internal help commands
795 795
796 796 $ hg help debug
797 797 debug commands (internal and unsupported):
798 798
799 799 debugancestor
800 800 find the ancestor revision of two revisions in a given index
801 801 debugapplystreamclonebundle
802 802 apply a stream clone bundle file
803 803 debugbuilddag
804 804 builds a repo with a given DAG from scratch in the current
805 805 empty repo
806 806 debugbundle lists the contents of a bundle
807 807 debugcheckstate
808 808 validate the correctness of the current dirstate
809 809 debugcommands
810 810 list all available commands and options
811 811 debugcomplete
812 812 returns the completion list associated with the given command
813 813 debugcreatestreamclonebundle
814 814 create a stream clone bundle file
815 815 debugdag format the changelog or an index DAG as a concise textual
816 816 description
817 817 debugdata dump the contents of a data file revision
818 818 debugdate parse and display a date
819 819 debugdeltachain
820 820 dump information about delta chains in a revlog
821 821 debugdirstate
822 822 show the contents of the current dirstate
823 823 debugdiscovery
824 824 runs the changeset discovery protocol in isolation
825 825 debugextensions
826 826 show information about active extensions
827 827 debugfileset parse and apply a fileset specification
828 828 debugfsinfo show information detected about current filesystem
829 829 debuggetbundle
830 830 retrieves a bundle from a repo
831 831 debugignore display the combined ignore pattern and information about
832 832 ignored files
833 833 debugindex dump the contents of an index file
834 834 debugindexdot
835 835 dump an index DAG as a graphviz dot file
836 836 debuginstall test Mercurial installation
837 837 debugknown test whether node ids are known to a repo
838 838 debuglocks show or modify state of locks
839 839 debugmergestate
840 840 print merge state
841 841 debugnamecomplete
842 842 complete "names" - tags, open branch names, bookmark names
843 843 debugobsolete
844 844 create arbitrary obsolete marker
845 845 debugoptDEP (no help text available)
846 846 debugoptEXP (no help text available)
847 847 debugpathcomplete
848 848 complete part or all of a tracked path
849 849 debugpushkey access the pushkey key/value protocol
850 850 debugpvec (no help text available)
851 851 debugrebuilddirstate
852 852 rebuild the dirstate as it would look like for the given
853 853 revision
854 854 debugrebuildfncache
855 855 rebuild the fncache file
856 856 debugrename dump rename information
857 857 debugrevlog show data and statistics about a revlog
858 858 debugrevspec parse and apply a revision specification
859 859 debugsetparents
860 860 manually set the parents of the current working directory
861 861 debugsub (no help text available)
862 862 debugsuccessorssets
863 863 show set of successors for revision
864 864 debugwalk show how files match on given patterns
865 865 debugwireargs
866 866 (no help text available)
867 867
868 868 (use "hg help -v debug" to show built-in aliases and global options)
869 869
870 870 internals topic renders index of available sub-topics
871 871
872 872 $ hg help internals
873 873 Technical implementation topics
874 874 """""""""""""""""""""""""""""""
875 875
876 876 bundles container for exchange of repository data
877 877 changegroups representation of revlog data
878 requirements repository requirements
878 879 revlogs revision storage mechanism
879 880
880 881 sub-topics can be accessed
881 882
882 883 $ hg help internals.changegroups
883 884 Changegroups
884 885 ============
885 886
886 887 Changegroups are representations of repository revlog data, specifically
887 888 the changelog, manifest, and filelogs.
888 889
889 890 There are 3 versions of changegroups: "1", "2", and "3". From a high-
890 891 level, versions "1" and "2" are almost exactly the same, with the only
891 892 difference being a header on entries in the changeset segment. Version "3"
892 893 adds support for exchanging treemanifests and includes revlog flags in the
893 894 delta header.
894 895
895 896 Changegroups consists of 3 logical segments:
896 897
897 898 +---------------------------------+
898 899 | | | |
899 900 | changeset | manifest | filelogs |
900 901 | | | |
901 902 +---------------------------------+
902 903
903 904 The principle building block of each segment is a *chunk*. A *chunk* is a
904 905 framed piece of data:
905 906
906 907 +---------------------------------------+
907 908 | | |
908 909 | length | data |
909 910 | (32 bits) | <length> bytes |
910 911 | | |
911 912 +---------------------------------------+
912 913
913 914 Each chunk starts with a 32-bit big-endian signed integer indicating the
914 915 length of the raw data that follows.
915 916
916 917 There is a special case chunk that has 0 length ("0x00000000"). We call
917 918 this an *empty chunk*.
918 919
919 920 Delta Groups
920 921 ------------
921 922
922 923 A *delta group* expresses the content of a revlog as a series of deltas,
923 924 or patches against previous revisions.
924 925
925 926 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
926 927 to signal the end of the delta group:
927 928
928 929 +------------------------------------------------------------------------+
929 930 | | | | | |
930 931 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
931 932 | (32 bits) | (various) | (32 bits) | (various) | (32 bits) |
932 933 | | | | | |
933 934 +------------------------------------------------------------+-----------+
934 935
935 936 Each *chunk*'s data consists of the following:
936 937
937 938 +-----------------------------------------+
938 939 | | | |
939 940 | delta header | mdiff header | delta |
940 941 | (various) | (12 bytes) | (various) |
941 942 | | | |
942 943 +-----------------------------------------+
943 944
944 945 The *length* field is the byte length of the remaining 3 logical pieces of
945 946 data. The *delta* is a diff from an existing entry in the changelog.
946 947
947 948 The *delta header* is different between versions "1", "2", and "3" of the
948 949 changegroup format.
949 950
950 951 Version 1:
951 952
952 953 +------------------------------------------------------+
953 954 | | | | |
954 955 | node | p1 node | p2 node | link node |
955 956 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
956 957 | | | | |
957 958 +------------------------------------------------------+
958 959
959 960 Version 2:
960 961
961 962 +------------------------------------------------------------------+
962 963 | | | | | |
963 964 | node | p1 node | p2 node | base node | link node |
964 965 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
965 966 | | | | | |
966 967 +------------------------------------------------------------------+
967 968
968 969 Version 3:
969 970
970 971 +------------------------------------------------------------------------------+
971 972 | | | | | | |
972 973 | node | p1 node | p2 node | base node | link node | flags |
973 974 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
974 975 | | | | | | |
975 976 +------------------------------------------------------------------------------+
976 977
977 978 The *mdiff header* consists of 3 32-bit big-endian signed integers
978 979 describing offsets at which to apply the following delta content:
979 980
980 981 +-------------------------------------+
981 982 | | | |
982 983 | offset | old length | new length |
983 984 | (32 bits) | (32 bits) | (32 bits) |
984 985 | | | |
985 986 +-------------------------------------+
986 987
987 988 In version 1, the delta is always applied against the previous node from
988 989 the changegroup or the first parent if this is the first entry in the
989 990 changegroup.
990 991
991 992 In version 2, the delta base node is encoded in the entry in the
992 993 changegroup. This allows the delta to be expressed against any parent,
993 994 which can result in smaller deltas and more efficient encoding of data.
994 995
995 996 Changeset Segment
996 997 -----------------
997 998
998 999 The *changeset segment* consists of a single *delta group* holding
999 1000 changelog data. It is followed by an *empty chunk* to denote the boundary
1000 1001 to the *manifests segment*.
1001 1002
1002 1003 Manifest Segment
1003 1004 ----------------
1004 1005
1005 1006 The *manifest segment* consists of a single *delta group* holding manifest
1006 1007 data. It is followed by an *empty chunk* to denote the boundary to the
1007 1008 *filelogs segment*.
1008 1009
1009 1010 Filelogs Segment
1010 1011 ----------------
1011 1012
1012 1013 The *filelogs* segment consists of multiple sub-segments, each
1013 1014 corresponding to an individual file whose data is being described:
1014 1015
1015 1016 +--------------------------------------+
1016 1017 | | | | |
1017 1018 | filelog0 | filelog1 | filelog2 | ... |
1018 1019 | | | | |
1019 1020 +--------------------------------------+
1020 1021
1021 1022 In version "3" of the changegroup format, filelogs may include directory
1022 1023 logs when treemanifests are in use. directory logs are identified by
1023 1024 having a trailing '/' on their filename (see below).
1024 1025
1025 1026 The final filelog sub-segment is followed by an *empty chunk* to denote
1026 1027 the end of the segment and the overall changegroup.
1027 1028
1028 1029 Each filelog sub-segment consists of the following:
1029 1030
1030 1031 +------------------------------------------+
1031 1032 | | | |
1032 1033 | filename size | filename | delta group |
1033 1034 | (32 bits) | (various) | (various) |
1034 1035 | | | |
1035 1036 +------------------------------------------+
1036 1037
1037 1038 That is, a *chunk* consisting of the filename (not terminated or padded)
1038 1039 followed by N chunks constituting the *delta group* for this file.
1039 1040
1040 1041 Test list of commands with command with no help text
1041 1042
1042 1043 $ hg help helpext
1043 1044 helpext extension - no help text available
1044 1045
1045 1046 list of commands:
1046 1047
1047 1048 nohelp (no help text available)
1048 1049
1049 1050 (use "hg help -v helpext" to show built-in aliases and global options)
1050 1051
1051 1052
1052 1053 test deprecated and experimental options are hidden in command help
1053 1054 $ hg help debugoptDEP
1054 1055 hg debugoptDEP
1055 1056
1056 1057 (no help text available)
1057 1058
1058 1059 options:
1059 1060
1060 1061 (some details hidden, use --verbose to show complete help)
1061 1062
1062 1063 $ hg help debugoptEXP
1063 1064 hg debugoptEXP
1064 1065
1065 1066 (no help text available)
1066 1067
1067 1068 options:
1068 1069
1069 1070 (some details hidden, use --verbose to show complete help)
1070 1071
1071 1072 test deprecated and experimental options is shown with -v
1072 1073 $ hg help -v debugoptDEP | grep dopt
1073 1074 --dopt option is (DEPRECATED)
1074 1075 $ hg help -v debugoptEXP | grep eopt
1075 1076 --eopt option is (EXPERIMENTAL)
1076 1077
1077 1078 #if gettext
1078 1079 test deprecated option is hidden with translation with untranslated description
1079 1080 (use many globy for not failing on changed transaction)
1080 1081 $ LANGUAGE=sv hg help debugoptDEP
1081 1082 hg debugoptDEP
1082 1083
1083 1084 (*) (glob)
1084 1085
1085 1086 options:
1086 1087
1087 1088 (some details hidden, use --verbose to show complete help)
1088 1089 #endif
1089 1090
1090 1091 Test commands that collide with topics (issue4240)
1091 1092
1092 1093 $ hg config -hq
1093 1094 hg config [-u] [NAME]...
1094 1095
1095 1096 show combined config settings from all hgrc files
1096 1097 $ hg showconfig -hq
1097 1098 hg config [-u] [NAME]...
1098 1099
1099 1100 show combined config settings from all hgrc files
1100 1101
1101 1102 Test a help topic
1102 1103
1103 1104 $ hg help revs
1104 1105 Specifying Single Revisions
1105 1106 """""""""""""""""""""""""""
1106 1107
1107 1108 Mercurial supports several ways to specify individual revisions.
1108 1109
1109 1110 A plain integer is treated as a revision number. Negative integers are
1110 1111 treated as sequential offsets from the tip, with -1 denoting the tip, -2
1111 1112 denoting the revision prior to the tip, and so forth.
1112 1113
1113 1114 A 40-digit hexadecimal string is treated as a unique revision identifier.
1114 1115
1115 1116 A hexadecimal string less than 40 characters long is treated as a unique
1116 1117 revision identifier and is referred to as a short-form identifier. A
1117 1118 short-form identifier is only valid if it is the prefix of exactly one
1118 1119 full-length identifier.
1119 1120
1120 1121 Any other string is treated as a bookmark, tag, or branch name. A bookmark
1121 1122 is a movable pointer to a revision. A tag is a permanent name associated
1122 1123 with a revision. A branch name denotes the tipmost open branch head of
1123 1124 that branch - or if they are all closed, the tipmost closed head of the
1124 1125 branch. Bookmark, tag, and branch names must not contain the ":"
1125 1126 character.
1126 1127
1127 1128 The reserved name "tip" always identifies the most recent revision.
1128 1129
1129 1130 The reserved name "null" indicates the null revision. This is the revision
1130 1131 of an empty repository, and the parent of revision 0.
1131 1132
1132 1133 The reserved name "." indicates the working directory parent. If no
1133 1134 working directory is checked out, it is equivalent to null. If an
1134 1135 uncommitted merge is in progress, "." is the revision of the first parent.
1135 1136
1136 1137 Test repeated config section name
1137 1138
1138 1139 $ hg help config.host
1139 1140 "http_proxy.host"
1140 1141 Host name and (optional) port of the proxy server, for example
1141 1142 "myproxy:8000".
1142 1143
1143 1144 "smtp.host"
1144 1145 Host name of mail server, e.g. "mail.example.com".
1145 1146
1146 1147 Unrelated trailing paragraphs shouldn't be included
1147 1148
1148 1149 $ hg help config.extramsg | grep '^$'
1149 1150
1150 1151
1151 1152 Test capitalized section name
1152 1153
1153 1154 $ hg help scripting.HGPLAIN > /dev/null
1154 1155
1155 1156 Help subsection:
1156 1157
1157 1158 $ hg help config.charsets |grep "Email example:" > /dev/null
1158 1159 [1]
1159 1160
1160 1161 Show nested definitions
1161 1162 ("profiling.type"[break]"ls"[break]"stat"[break])
1162 1163
1163 1164 $ hg help config.type | egrep '^$'|wc -l
1164 1165 \s*3 (re)
1165 1166
1166 1167 Separate sections from subsections
1167 1168
1168 1169 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1169 1170 "format"
1170 1171 --------
1171 1172
1172 1173 "usegeneraldelta"
1173 1174
1174 1175 "dotencode"
1175 1176
1176 1177 "usefncache"
1177 1178
1178 1179 "usestore"
1179 1180
1180 1181 "profiling"
1181 1182 -----------
1182 1183
1183 1184 "format"
1184 1185
1185 1186 "progress"
1186 1187 ----------
1187 1188
1188 1189 "format"
1189 1190
1190 1191
1191 1192 Last item in help config.*:
1192 1193
1193 1194 $ hg help config.`hg help config|grep '^ "'| \
1194 1195 > tail -1|sed 's![ "]*!!g'`| \
1195 1196 > grep "hg help -c config" > /dev/null
1196 1197 [1]
1197 1198
1198 1199 note to use help -c for general hg help config:
1199 1200
1200 1201 $ hg help config |grep "hg help -c config" > /dev/null
1201 1202
1202 1203 Test templating help
1203 1204
1204 1205 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1205 1206 desc String. The text of the changeset description.
1206 1207 diffstat String. Statistics of changes with the following format:
1207 1208 firstline Any text. Returns the first line of text.
1208 1209 nonempty Any text. Returns '(none)' if the string is empty.
1209 1210
1210 1211 Test deprecated items
1211 1212
1212 1213 $ hg help -v templating | grep currentbookmark
1213 1214 currentbookmark
1214 1215 $ hg help templating | (grep currentbookmark || true)
1215 1216
1216 1217 Test help hooks
1217 1218
1218 1219 $ cat > helphook1.py <<EOF
1219 1220 > from mercurial import help
1220 1221 >
1221 1222 > def rewrite(ui, topic, doc):
1222 1223 > return doc + '\nhelphook1\n'
1223 1224 >
1224 1225 > def extsetup(ui):
1225 1226 > help.addtopichook('revsets', rewrite)
1226 1227 > EOF
1227 1228 $ cat > helphook2.py <<EOF
1228 1229 > from mercurial import help
1229 1230 >
1230 1231 > def rewrite(ui, topic, doc):
1231 1232 > return doc + '\nhelphook2\n'
1232 1233 >
1233 1234 > def extsetup(ui):
1234 1235 > help.addtopichook('revsets', rewrite)
1235 1236 > EOF
1236 1237 $ echo '[extensions]' >> $HGRCPATH
1237 1238 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1238 1239 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1239 1240 $ hg help revsets | grep helphook
1240 1241 helphook1
1241 1242 helphook2
1242 1243
1243 1244 help -c should only show debug --debug
1244 1245
1245 1246 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1246 1247 [1]
1247 1248
1248 1249 help -c should only show deprecated for -v
1249 1250
1250 1251 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1251 1252 [1]
1252 1253
1253 1254 Test -s / --system
1254 1255
1255 1256 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1256 1257 > wc -l | sed -e 's/ //g'
1257 1258 0
1258 1259 $ hg help config.files --system unix | grep 'USER' | \
1259 1260 > wc -l | sed -e 's/ //g'
1260 1261 0
1261 1262
1262 1263 Test -e / -c / -k combinations
1263 1264
1264 1265 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1265 1266 Commands:
1266 1267 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1267 1268 Extensions:
1268 1269 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1269 1270 Topics:
1270 1271 Commands:
1271 1272 Extensions:
1272 1273 Extension Commands:
1273 1274 $ hg help -c schemes
1274 1275 abort: no such help topic: schemes
1275 1276 (try "hg help --keyword schemes")
1276 1277 [255]
1277 1278 $ hg help -e schemes |head -1
1278 1279 schemes extension - extend schemes with shortcuts to repository swarms
1279 1280 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1280 1281 Commands:
1281 1282 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1282 1283 Extensions:
1283 1284 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1284 1285 Extensions:
1285 1286 Commands:
1286 1287 $ hg help -c commit > /dev/null
1287 1288 $ hg help -e -c commit > /dev/null
1288 1289 $ hg help -e commit > /dev/null
1289 1290 abort: no such help topic: commit
1290 1291 (try "hg help --keyword commit")
1291 1292 [255]
1292 1293
1293 1294 Test keyword search help
1294 1295
1295 1296 $ cat > prefixedname.py <<EOF
1296 1297 > '''matched against word "clone"
1297 1298 > '''
1298 1299 > EOF
1299 1300 $ echo '[extensions]' >> $HGRCPATH
1300 1301 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1301 1302 $ hg help -k clone
1302 1303 Topics:
1303 1304
1304 1305 config Configuration Files
1305 1306 extensions Using Additional Features
1306 1307 glossary Glossary
1307 1308 phases Working with Phases
1308 1309 subrepos Subrepositories
1309 1310 urls URL Paths
1310 1311
1311 1312 Commands:
1312 1313
1313 1314 bookmarks create a new bookmark or list existing bookmarks
1314 1315 clone make a copy of an existing repository
1315 1316 paths show aliases for remote repositories
1316 1317 update update working directory (or switch revisions)
1317 1318
1318 1319 Extensions:
1319 1320
1320 1321 clonebundles advertise pre-generated bundles to seed clones
1321 1322 prefixedname matched against word "clone"
1322 1323 relink recreates hardlinks between repository clones
1323 1324
1324 1325 Extension Commands:
1325 1326
1326 1327 qclone clone main and patch repository at same time
1327 1328
1328 1329 Test unfound topic
1329 1330
1330 1331 $ hg help nonexistingtopicthatwillneverexisteverever
1331 1332 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1332 1333 (try "hg help --keyword nonexistingtopicthatwillneverexisteverever")
1333 1334 [255]
1334 1335
1335 1336 Test unfound keyword
1336 1337
1337 1338 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1338 1339 abort: no matches
1339 1340 (try "hg help" for a list of topics)
1340 1341 [255]
1341 1342
1342 1343 Test omit indicating for help
1343 1344
1344 1345 $ cat > addverboseitems.py <<EOF
1345 1346 > '''extension to test omit indicating.
1346 1347 >
1347 1348 > This paragraph is never omitted (for extension)
1348 1349 >
1349 1350 > .. container:: verbose
1350 1351 >
1351 1352 > This paragraph is omitted,
1352 1353 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1353 1354 >
1354 1355 > This paragraph is never omitted, too (for extension)
1355 1356 > '''
1356 1357 >
1357 1358 > from mercurial import help, commands
1358 1359 > testtopic = """This paragraph is never omitted (for topic).
1359 1360 >
1360 1361 > .. container:: verbose
1361 1362 >
1362 1363 > This paragraph is omitted,
1363 1364 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1364 1365 >
1365 1366 > This paragraph is never omitted, too (for topic)
1366 1367 > """
1367 1368 > def extsetup(ui):
1368 1369 > help.helptable.append((["topic-containing-verbose"],
1369 1370 > "This is the topic to test omit indicating.",
1370 1371 > lambda ui: testtopic))
1371 1372 > EOF
1372 1373 $ echo '[extensions]' >> $HGRCPATH
1373 1374 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1374 1375 $ hg help addverboseitems
1375 1376 addverboseitems extension - extension to test omit indicating.
1376 1377
1377 1378 This paragraph is never omitted (for extension)
1378 1379
1379 1380 This paragraph is never omitted, too (for extension)
1380 1381
1381 1382 (some details hidden, use --verbose to show complete help)
1382 1383
1383 1384 no commands defined
1384 1385 $ hg help -v addverboseitems
1385 1386 addverboseitems extension - extension to test omit indicating.
1386 1387
1387 1388 This paragraph is never omitted (for extension)
1388 1389
1389 1390 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1390 1391 extension)
1391 1392
1392 1393 This paragraph is never omitted, too (for extension)
1393 1394
1394 1395 no commands defined
1395 1396 $ hg help topic-containing-verbose
1396 1397 This is the topic to test omit indicating.
1397 1398 """"""""""""""""""""""""""""""""""""""""""
1398 1399
1399 1400 This paragraph is never omitted (for topic).
1400 1401
1401 1402 This paragraph is never omitted, too (for topic)
1402 1403
1403 1404 (some details hidden, use --verbose to show complete help)
1404 1405 $ hg help -v topic-containing-verbose
1405 1406 This is the topic to test omit indicating.
1406 1407 """"""""""""""""""""""""""""""""""""""""""
1407 1408
1408 1409 This paragraph is never omitted (for topic).
1409 1410
1410 1411 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1411 1412 topic)
1412 1413
1413 1414 This paragraph is never omitted, too (for topic)
1414 1415
1415 1416 Test section lookup
1416 1417
1417 1418 $ hg help revset.merge
1418 1419 "merge()"
1419 1420 Changeset is a merge changeset.
1420 1421
1421 1422 $ hg help glossary.dag
1422 1423 DAG
1423 1424 The repository of changesets of a distributed version control system
1424 1425 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1425 1426 of nodes and edges, where nodes correspond to changesets and edges
1426 1427 imply a parent -> child relation. This graph can be visualized by
1427 1428 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1428 1429 limited by the requirement for children to have at most two parents.
1429 1430
1430 1431
1431 1432 $ hg help hgrc.paths
1432 1433 "paths"
1433 1434 -------
1434 1435
1435 1436 Assigns symbolic names and behavior to repositories.
1436 1437
1437 1438 Options are symbolic names defining the URL or directory that is the
1438 1439 location of the repository. Example:
1439 1440
1440 1441 [paths]
1441 1442 my_server = https://example.com/my_repo
1442 1443 local_path = /home/me/repo
1443 1444
1444 1445 These symbolic names can be used from the command line. To pull from
1445 1446 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1446 1447 local_path'.
1447 1448
1448 1449 Options containing colons (":") denote sub-options that can influence
1449 1450 behavior for that specific path. Example:
1450 1451
1451 1452 [paths]
1452 1453 my_server = https://example.com/my_path
1453 1454 my_server:pushurl = ssh://example.com/my_path
1454 1455
1455 1456 The following sub-options can be defined:
1456 1457
1457 1458 "pushurl"
1458 1459 The URL to use for push operations. If not defined, the location
1459 1460 defined by the path's main entry is used.
1460 1461
1461 1462 The following special named paths exist:
1462 1463
1463 1464 "default"
1464 1465 The URL or directory to use when no source or remote is specified.
1465 1466
1466 1467 'hg clone' will automatically define this path to the location the
1467 1468 repository was cloned from.
1468 1469
1469 1470 "default-push"
1470 1471 (deprecated) The URL or directory for the default 'hg push' location.
1471 1472 "default:pushurl" should be used instead.
1472 1473
1473 1474 $ hg help glossary.mcguffin
1474 1475 abort: help section not found
1475 1476 [255]
1476 1477
1477 1478 $ hg help glossary.mc.guffin
1478 1479 abort: help section not found
1479 1480 [255]
1480 1481
1481 1482 $ hg help template.files
1482 1483 files List of strings. All files modified, added, or removed by
1483 1484 this changeset.
1484 1485
1485 1486 Test dynamic list of merge tools only shows up once
1486 1487 $ hg help merge-tools
1487 1488 Merge Tools
1488 1489 """""""""""
1489 1490
1490 1491 To merge files Mercurial uses merge tools.
1491 1492
1492 1493 A merge tool combines two different versions of a file into a merged file.
1493 1494 Merge tools are given the two files and the greatest common ancestor of
1494 1495 the two file versions, so they can determine the changes made on both
1495 1496 branches.
1496 1497
1497 1498 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1498 1499 backout' and in several extensions.
1499 1500
1500 1501 Usually, the merge tool tries to automatically reconcile the files by
1501 1502 combining all non-overlapping changes that occurred separately in the two
1502 1503 different evolutions of the same initial base file. Furthermore, some
1503 1504 interactive merge programs make it easier to manually resolve conflicting
1504 1505 merges, either in a graphical way, or by inserting some conflict markers.
1505 1506 Mercurial does not include any interactive merge programs but relies on
1506 1507 external tools for that.
1507 1508
1508 1509 Available merge tools
1509 1510 =====================
1510 1511
1511 1512 External merge tools and their properties are configured in the merge-
1512 1513 tools configuration section - see hgrc(5) - but they can often just be
1513 1514 named by their executable.
1514 1515
1515 1516 A merge tool is generally usable if its executable can be found on the
1516 1517 system and if it can handle the merge. The executable is found if it is an
1517 1518 absolute or relative executable path or the name of an application in the
1518 1519 executable search path. The tool is assumed to be able to handle the merge
1519 1520 if it can handle symlinks if the file is a symlink, if it can handle
1520 1521 binary files if the file is binary, and if a GUI is available if the tool
1521 1522 requires a GUI.
1522 1523
1523 1524 There are some internal merge tools which can be used. The internal merge
1524 1525 tools are:
1525 1526
1526 1527 ":dump"
1527 1528 Creates three versions of the files to merge, containing the contents of
1528 1529 local, other and base. These files can then be used to perform a merge
1529 1530 manually. If the file to be merged is named "a.txt", these files will
1530 1531 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1531 1532 they will be placed in the same directory as "a.txt".
1532 1533
1533 1534 ":fail"
1534 1535 Rather than attempting to merge files that were modified on both
1535 1536 branches, it marks them as unresolved. The resolve command must be used
1536 1537 to resolve these conflicts.
1537 1538
1538 1539 ":local"
1539 1540 Uses the local version of files as the merged version.
1540 1541
1541 1542 ":merge"
1542 1543 Uses the internal non-interactive simple merge algorithm for merging
1543 1544 files. It will fail if there are any conflicts and leave markers in the
1544 1545 partially merged file. Markers will have two sections, one for each side
1545 1546 of merge.
1546 1547
1547 1548 ":merge-local"
1548 1549 Like :merge, but resolve all conflicts non-interactively in favor of the
1549 1550 local changes.
1550 1551
1551 1552 ":merge-other"
1552 1553 Like :merge, but resolve all conflicts non-interactively in favor of the
1553 1554 other changes.
1554 1555
1555 1556 ":merge3"
1556 1557 Uses the internal non-interactive simple merge algorithm for merging
1557 1558 files. It will fail if there are any conflicts and leave markers in the
1558 1559 partially merged file. Marker will have three sections, one from each
1559 1560 side of the merge and one for the base content.
1560 1561
1561 1562 ":other"
1562 1563 Uses the other version of files as the merged version.
1563 1564
1564 1565 ":prompt"
1565 1566 Asks the user which of the local or the other version to keep as the
1566 1567 merged version.
1567 1568
1568 1569 ":tagmerge"
1569 1570 Uses the internal tag merge algorithm (experimental).
1570 1571
1571 1572 ":union"
1572 1573 Uses the internal non-interactive simple merge algorithm for merging
1573 1574 files. It will use both left and right sides for conflict regions. No
1574 1575 markers are inserted.
1575 1576
1576 1577 Internal tools are always available and do not require a GUI but will by
1577 1578 default not handle symlinks or binary files.
1578 1579
1579 1580 Choosing a merge tool
1580 1581 =====================
1581 1582
1582 1583 Mercurial uses these rules when deciding which merge tool to use:
1583 1584
1584 1585 1. If a tool has been specified with the --tool option to merge or
1585 1586 resolve, it is used. If it is the name of a tool in the merge-tools
1586 1587 configuration, its configuration is used. Otherwise the specified tool
1587 1588 must be executable by the shell.
1588 1589 2. If the "HGMERGE" environment variable is present, its value is used and
1589 1590 must be executable by the shell.
1590 1591 3. If the filename of the file to be merged matches any of the patterns in
1591 1592 the merge-patterns configuration section, the first usable merge tool
1592 1593 corresponding to a matching pattern is used. Here, binary capabilities
1593 1594 of the merge tool are not considered.
1594 1595 4. If ui.merge is set it will be considered next. If the value is not the
1595 1596 name of a configured tool, the specified value is used and must be
1596 1597 executable by the shell. Otherwise the named tool is used if it is
1597 1598 usable.
1598 1599 5. If any usable merge tools are present in the merge-tools configuration
1599 1600 section, the one with the highest priority is used.
1600 1601 6. If a program named "hgmerge" can be found on the system, it is used -
1601 1602 but it will by default not be used for symlinks and binary files.
1602 1603 7. If the file to be merged is not binary and is not a symlink, then
1603 1604 internal ":merge" is used.
1604 1605 8. The merge of the file fails and must be resolved before commit.
1605 1606
1606 1607 Note:
1607 1608 After selecting a merge program, Mercurial will by default attempt to
1608 1609 merge the files using a simple merge algorithm first. Only if it
1609 1610 doesn't succeed because of conflicting changes Mercurial will actually
1610 1611 execute the merge program. Whether to use the simple merge algorithm
1611 1612 first can be controlled by the premerge setting of the merge tool.
1612 1613 Premerge is enabled by default unless the file is binary or a symlink.
1613 1614
1614 1615 See the merge-tools and ui sections of hgrc(5) for details on the
1615 1616 configuration of merge tools.
1616 1617
1617 1618 Test usage of section marks in help documents
1618 1619
1619 1620 $ cd "$TESTDIR"/../doc
1620 1621 $ python check-seclevel.py
1621 1622 $ cd $TESTTMP
1622 1623
1623 1624 #if serve
1624 1625
1625 1626 Test the help pages in hgweb.
1626 1627
1627 1628 Dish up an empty repo; serve it cold.
1628 1629
1629 1630 $ hg init "$TESTTMP/test"
1630 1631 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1631 1632 $ cat hg.pid >> $DAEMON_PIDS
1632 1633
1633 1634 $ get-with-headers.py 127.0.0.1:$HGPORT "help"
1634 1635 200 Script output follows
1635 1636
1636 1637 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1637 1638 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1638 1639 <head>
1639 1640 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1640 1641 <meta name="robots" content="index, nofollow" />
1641 1642 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1642 1643 <script type="text/javascript" src="/static/mercurial.js"></script>
1643 1644
1644 1645 <title>Help: Index</title>
1645 1646 </head>
1646 1647 <body>
1647 1648
1648 1649 <div class="container">
1649 1650 <div class="menu">
1650 1651 <div class="logo">
1651 1652 <a href="https://mercurial-scm.org/">
1652 1653 <img src="/static/hglogo.png" alt="mercurial" /></a>
1653 1654 </div>
1654 1655 <ul>
1655 1656 <li><a href="/shortlog">log</a></li>
1656 1657 <li><a href="/graph">graph</a></li>
1657 1658 <li><a href="/tags">tags</a></li>
1658 1659 <li><a href="/bookmarks">bookmarks</a></li>
1659 1660 <li><a href="/branches">branches</a></li>
1660 1661 </ul>
1661 1662 <ul>
1662 1663 <li class="active">help</li>
1663 1664 </ul>
1664 1665 </div>
1665 1666
1666 1667 <div class="main">
1667 1668 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1668 1669 <form class="search" action="/log">
1669 1670
1670 1671 <p><input name="rev" id="search1" type="text" size="30" /></p>
1671 1672 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1672 1673 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1673 1674 </form>
1674 1675 <table class="bigtable">
1675 1676 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
1676 1677
1677 1678 <tr><td>
1678 1679 <a href="/help/config">
1679 1680 config
1680 1681 </a>
1681 1682 </td><td>
1682 1683 Configuration Files
1683 1684 </td></tr>
1684 1685 <tr><td>
1685 1686 <a href="/help/dates">
1686 1687 dates
1687 1688 </a>
1688 1689 </td><td>
1689 1690 Date Formats
1690 1691 </td></tr>
1691 1692 <tr><td>
1692 1693 <a href="/help/diffs">
1693 1694 diffs
1694 1695 </a>
1695 1696 </td><td>
1696 1697 Diff Formats
1697 1698 </td></tr>
1698 1699 <tr><td>
1699 1700 <a href="/help/environment">
1700 1701 environment
1701 1702 </a>
1702 1703 </td><td>
1703 1704 Environment Variables
1704 1705 </td></tr>
1705 1706 <tr><td>
1706 1707 <a href="/help/extensions">
1707 1708 extensions
1708 1709 </a>
1709 1710 </td><td>
1710 1711 Using Additional Features
1711 1712 </td></tr>
1712 1713 <tr><td>
1713 1714 <a href="/help/filesets">
1714 1715 filesets
1715 1716 </a>
1716 1717 </td><td>
1717 1718 Specifying File Sets
1718 1719 </td></tr>
1719 1720 <tr><td>
1720 1721 <a href="/help/glossary">
1721 1722 glossary
1722 1723 </a>
1723 1724 </td><td>
1724 1725 Glossary
1725 1726 </td></tr>
1726 1727 <tr><td>
1727 1728 <a href="/help/hgignore">
1728 1729 hgignore
1729 1730 </a>
1730 1731 </td><td>
1731 1732 Syntax for Mercurial Ignore Files
1732 1733 </td></tr>
1733 1734 <tr><td>
1734 1735 <a href="/help/hgweb">
1735 1736 hgweb
1736 1737 </a>
1737 1738 </td><td>
1738 1739 Configuring hgweb
1739 1740 </td></tr>
1740 1741 <tr><td>
1741 1742 <a href="/help/internals">
1742 1743 internals
1743 1744 </a>
1744 1745 </td><td>
1745 1746 Technical implementation topics
1746 1747 </td></tr>
1747 1748 <tr><td>
1748 1749 <a href="/help/merge-tools">
1749 1750 merge-tools
1750 1751 </a>
1751 1752 </td><td>
1752 1753 Merge Tools
1753 1754 </td></tr>
1754 1755 <tr><td>
1755 1756 <a href="/help/multirevs">
1756 1757 multirevs
1757 1758 </a>
1758 1759 </td><td>
1759 1760 Specifying Multiple Revisions
1760 1761 </td></tr>
1761 1762 <tr><td>
1762 1763 <a href="/help/patterns">
1763 1764 patterns
1764 1765 </a>
1765 1766 </td><td>
1766 1767 File Name Patterns
1767 1768 </td></tr>
1768 1769 <tr><td>
1769 1770 <a href="/help/phases">
1770 1771 phases
1771 1772 </a>
1772 1773 </td><td>
1773 1774 Working with Phases
1774 1775 </td></tr>
1775 1776 <tr><td>
1776 1777 <a href="/help/revisions">
1777 1778 revisions
1778 1779 </a>
1779 1780 </td><td>
1780 1781 Specifying Single Revisions
1781 1782 </td></tr>
1782 1783 <tr><td>
1783 1784 <a href="/help/revsets">
1784 1785 revsets
1785 1786 </a>
1786 1787 </td><td>
1787 1788 Specifying Revision Sets
1788 1789 </td></tr>
1789 1790 <tr><td>
1790 1791 <a href="/help/scripting">
1791 1792 scripting
1792 1793 </a>
1793 1794 </td><td>
1794 1795 Using Mercurial from scripts and automation
1795 1796 </td></tr>
1796 1797 <tr><td>
1797 1798 <a href="/help/subrepos">
1798 1799 subrepos
1799 1800 </a>
1800 1801 </td><td>
1801 1802 Subrepositories
1802 1803 </td></tr>
1803 1804 <tr><td>
1804 1805 <a href="/help/templating">
1805 1806 templating
1806 1807 </a>
1807 1808 </td><td>
1808 1809 Template Usage
1809 1810 </td></tr>
1810 1811 <tr><td>
1811 1812 <a href="/help/urls">
1812 1813 urls
1813 1814 </a>
1814 1815 </td><td>
1815 1816 URL Paths
1816 1817 </td></tr>
1817 1818 <tr><td>
1818 1819 <a href="/help/topic-containing-verbose">
1819 1820 topic-containing-verbose
1820 1821 </a>
1821 1822 </td><td>
1822 1823 This is the topic to test omit indicating.
1823 1824 </td></tr>
1824 1825
1825 1826
1826 1827 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1827 1828
1828 1829 <tr><td>
1829 1830 <a href="/help/add">
1830 1831 add
1831 1832 </a>
1832 1833 </td><td>
1833 1834 add the specified files on the next commit
1834 1835 </td></tr>
1835 1836 <tr><td>
1836 1837 <a href="/help/annotate">
1837 1838 annotate
1838 1839 </a>
1839 1840 </td><td>
1840 1841 show changeset information by line for each file
1841 1842 </td></tr>
1842 1843 <tr><td>
1843 1844 <a href="/help/clone">
1844 1845 clone
1845 1846 </a>
1846 1847 </td><td>
1847 1848 make a copy of an existing repository
1848 1849 </td></tr>
1849 1850 <tr><td>
1850 1851 <a href="/help/commit">
1851 1852 commit
1852 1853 </a>
1853 1854 </td><td>
1854 1855 commit the specified files or all outstanding changes
1855 1856 </td></tr>
1856 1857 <tr><td>
1857 1858 <a href="/help/diff">
1858 1859 diff
1859 1860 </a>
1860 1861 </td><td>
1861 1862 diff repository (or selected files)
1862 1863 </td></tr>
1863 1864 <tr><td>
1864 1865 <a href="/help/export">
1865 1866 export
1866 1867 </a>
1867 1868 </td><td>
1868 1869 dump the header and diffs for one or more changesets
1869 1870 </td></tr>
1870 1871 <tr><td>
1871 1872 <a href="/help/forget">
1872 1873 forget
1873 1874 </a>
1874 1875 </td><td>
1875 1876 forget the specified files on the next commit
1876 1877 </td></tr>
1877 1878 <tr><td>
1878 1879 <a href="/help/init">
1879 1880 init
1880 1881 </a>
1881 1882 </td><td>
1882 1883 create a new repository in the given directory
1883 1884 </td></tr>
1884 1885 <tr><td>
1885 1886 <a href="/help/log">
1886 1887 log
1887 1888 </a>
1888 1889 </td><td>
1889 1890 show revision history of entire repository or files
1890 1891 </td></tr>
1891 1892 <tr><td>
1892 1893 <a href="/help/merge">
1893 1894 merge
1894 1895 </a>
1895 1896 </td><td>
1896 1897 merge another revision into working directory
1897 1898 </td></tr>
1898 1899 <tr><td>
1899 1900 <a href="/help/pull">
1900 1901 pull
1901 1902 </a>
1902 1903 </td><td>
1903 1904 pull changes from the specified source
1904 1905 </td></tr>
1905 1906 <tr><td>
1906 1907 <a href="/help/push">
1907 1908 push
1908 1909 </a>
1909 1910 </td><td>
1910 1911 push changes to the specified destination
1911 1912 </td></tr>
1912 1913 <tr><td>
1913 1914 <a href="/help/remove">
1914 1915 remove
1915 1916 </a>
1916 1917 </td><td>
1917 1918 remove the specified files on the next commit
1918 1919 </td></tr>
1919 1920 <tr><td>
1920 1921 <a href="/help/serve">
1921 1922 serve
1922 1923 </a>
1923 1924 </td><td>
1924 1925 start stand-alone webserver
1925 1926 </td></tr>
1926 1927 <tr><td>
1927 1928 <a href="/help/status">
1928 1929 status
1929 1930 </a>
1930 1931 </td><td>
1931 1932 show changed files in the working directory
1932 1933 </td></tr>
1933 1934 <tr><td>
1934 1935 <a href="/help/summary">
1935 1936 summary
1936 1937 </a>
1937 1938 </td><td>
1938 1939 summarize working directory state
1939 1940 </td></tr>
1940 1941 <tr><td>
1941 1942 <a href="/help/update">
1942 1943 update
1943 1944 </a>
1944 1945 </td><td>
1945 1946 update working directory (or switch revisions)
1946 1947 </td></tr>
1947 1948
1948 1949
1949 1950
1950 1951 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
1951 1952
1952 1953 <tr><td>
1953 1954 <a href="/help/addremove">
1954 1955 addremove
1955 1956 </a>
1956 1957 </td><td>
1957 1958 add all new files, delete all missing files
1958 1959 </td></tr>
1959 1960 <tr><td>
1960 1961 <a href="/help/archive">
1961 1962 archive
1962 1963 </a>
1963 1964 </td><td>
1964 1965 create an unversioned archive of a repository revision
1965 1966 </td></tr>
1966 1967 <tr><td>
1967 1968 <a href="/help/backout">
1968 1969 backout
1969 1970 </a>
1970 1971 </td><td>
1971 1972 reverse effect of earlier changeset
1972 1973 </td></tr>
1973 1974 <tr><td>
1974 1975 <a href="/help/bisect">
1975 1976 bisect
1976 1977 </a>
1977 1978 </td><td>
1978 1979 subdivision search of changesets
1979 1980 </td></tr>
1980 1981 <tr><td>
1981 1982 <a href="/help/bookmarks">
1982 1983 bookmarks
1983 1984 </a>
1984 1985 </td><td>
1985 1986 create a new bookmark or list existing bookmarks
1986 1987 </td></tr>
1987 1988 <tr><td>
1988 1989 <a href="/help/branch">
1989 1990 branch
1990 1991 </a>
1991 1992 </td><td>
1992 1993 set or show the current branch name
1993 1994 </td></tr>
1994 1995 <tr><td>
1995 1996 <a href="/help/branches">
1996 1997 branches
1997 1998 </a>
1998 1999 </td><td>
1999 2000 list repository named branches
2000 2001 </td></tr>
2001 2002 <tr><td>
2002 2003 <a href="/help/bundle">
2003 2004 bundle
2004 2005 </a>
2005 2006 </td><td>
2006 2007 create a changegroup file
2007 2008 </td></tr>
2008 2009 <tr><td>
2009 2010 <a href="/help/cat">
2010 2011 cat
2011 2012 </a>
2012 2013 </td><td>
2013 2014 output the current or given revision of files
2014 2015 </td></tr>
2015 2016 <tr><td>
2016 2017 <a href="/help/config">
2017 2018 config
2018 2019 </a>
2019 2020 </td><td>
2020 2021 show combined config settings from all hgrc files
2021 2022 </td></tr>
2022 2023 <tr><td>
2023 2024 <a href="/help/copy">
2024 2025 copy
2025 2026 </a>
2026 2027 </td><td>
2027 2028 mark files as copied for the next commit
2028 2029 </td></tr>
2029 2030 <tr><td>
2030 2031 <a href="/help/files">
2031 2032 files
2032 2033 </a>
2033 2034 </td><td>
2034 2035 list tracked files
2035 2036 </td></tr>
2036 2037 <tr><td>
2037 2038 <a href="/help/graft">
2038 2039 graft
2039 2040 </a>
2040 2041 </td><td>
2041 2042 copy changes from other branches onto the current branch
2042 2043 </td></tr>
2043 2044 <tr><td>
2044 2045 <a href="/help/grep">
2045 2046 grep
2046 2047 </a>
2047 2048 </td><td>
2048 2049 search for a pattern in specified files and revisions
2049 2050 </td></tr>
2050 2051 <tr><td>
2051 2052 <a href="/help/heads">
2052 2053 heads
2053 2054 </a>
2054 2055 </td><td>
2055 2056 show branch heads
2056 2057 </td></tr>
2057 2058 <tr><td>
2058 2059 <a href="/help/help">
2059 2060 help
2060 2061 </a>
2061 2062 </td><td>
2062 2063 show help for a given topic or a help overview
2063 2064 </td></tr>
2064 2065 <tr><td>
2065 2066 <a href="/help/identify">
2066 2067 identify
2067 2068 </a>
2068 2069 </td><td>
2069 2070 identify the working directory or specified revision
2070 2071 </td></tr>
2071 2072 <tr><td>
2072 2073 <a href="/help/import">
2073 2074 import
2074 2075 </a>
2075 2076 </td><td>
2076 2077 import an ordered set of patches
2077 2078 </td></tr>
2078 2079 <tr><td>
2079 2080 <a href="/help/incoming">
2080 2081 incoming
2081 2082 </a>
2082 2083 </td><td>
2083 2084 show new changesets found in source
2084 2085 </td></tr>
2085 2086 <tr><td>
2086 2087 <a href="/help/manifest">
2087 2088 manifest
2088 2089 </a>
2089 2090 </td><td>
2090 2091 output the current or given revision of the project manifest
2091 2092 </td></tr>
2092 2093 <tr><td>
2093 2094 <a href="/help/nohelp">
2094 2095 nohelp
2095 2096 </a>
2096 2097 </td><td>
2097 2098 (no help text available)
2098 2099 </td></tr>
2099 2100 <tr><td>
2100 2101 <a href="/help/outgoing">
2101 2102 outgoing
2102 2103 </a>
2103 2104 </td><td>
2104 2105 show changesets not found in the destination
2105 2106 </td></tr>
2106 2107 <tr><td>
2107 2108 <a href="/help/paths">
2108 2109 paths
2109 2110 </a>
2110 2111 </td><td>
2111 2112 show aliases for remote repositories
2112 2113 </td></tr>
2113 2114 <tr><td>
2114 2115 <a href="/help/phase">
2115 2116 phase
2116 2117 </a>
2117 2118 </td><td>
2118 2119 set or show the current phase name
2119 2120 </td></tr>
2120 2121 <tr><td>
2121 2122 <a href="/help/recover">
2122 2123 recover
2123 2124 </a>
2124 2125 </td><td>
2125 2126 roll back an interrupted transaction
2126 2127 </td></tr>
2127 2128 <tr><td>
2128 2129 <a href="/help/rename">
2129 2130 rename
2130 2131 </a>
2131 2132 </td><td>
2132 2133 rename files; equivalent of copy + remove
2133 2134 </td></tr>
2134 2135 <tr><td>
2135 2136 <a href="/help/resolve">
2136 2137 resolve
2137 2138 </a>
2138 2139 </td><td>
2139 2140 redo merges or set/view the merge status of files
2140 2141 </td></tr>
2141 2142 <tr><td>
2142 2143 <a href="/help/revert">
2143 2144 revert
2144 2145 </a>
2145 2146 </td><td>
2146 2147 restore files to their checkout state
2147 2148 </td></tr>
2148 2149 <tr><td>
2149 2150 <a href="/help/root">
2150 2151 root
2151 2152 </a>
2152 2153 </td><td>
2153 2154 print the root (top) of the current working directory
2154 2155 </td></tr>
2155 2156 <tr><td>
2156 2157 <a href="/help/tag">
2157 2158 tag
2158 2159 </a>
2159 2160 </td><td>
2160 2161 add one or more tags for the current or given revision
2161 2162 </td></tr>
2162 2163 <tr><td>
2163 2164 <a href="/help/tags">
2164 2165 tags
2165 2166 </a>
2166 2167 </td><td>
2167 2168 list repository tags
2168 2169 </td></tr>
2169 2170 <tr><td>
2170 2171 <a href="/help/unbundle">
2171 2172 unbundle
2172 2173 </a>
2173 2174 </td><td>
2174 2175 apply one or more changegroup files
2175 2176 </td></tr>
2176 2177 <tr><td>
2177 2178 <a href="/help/verify">
2178 2179 verify
2179 2180 </a>
2180 2181 </td><td>
2181 2182 verify the integrity of the repository
2182 2183 </td></tr>
2183 2184 <tr><td>
2184 2185 <a href="/help/version">
2185 2186 version
2186 2187 </a>
2187 2188 </td><td>
2188 2189 output version and copyright information
2189 2190 </td></tr>
2190 2191
2191 2192
2192 2193 </table>
2193 2194 </div>
2194 2195 </div>
2195 2196
2196 2197 <script type="text/javascript">process_dates()</script>
2197 2198
2198 2199
2199 2200 </body>
2200 2201 </html>
2201 2202
2202 2203
2203 2204 $ get-with-headers.py 127.0.0.1:$HGPORT "help/add"
2204 2205 200 Script output follows
2205 2206
2206 2207 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2207 2208 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2208 2209 <head>
2209 2210 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2210 2211 <meta name="robots" content="index, nofollow" />
2211 2212 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2212 2213 <script type="text/javascript" src="/static/mercurial.js"></script>
2213 2214
2214 2215 <title>Help: add</title>
2215 2216 </head>
2216 2217 <body>
2217 2218
2218 2219 <div class="container">
2219 2220 <div class="menu">
2220 2221 <div class="logo">
2221 2222 <a href="https://mercurial-scm.org/">
2222 2223 <img src="/static/hglogo.png" alt="mercurial" /></a>
2223 2224 </div>
2224 2225 <ul>
2225 2226 <li><a href="/shortlog">log</a></li>
2226 2227 <li><a href="/graph">graph</a></li>
2227 2228 <li><a href="/tags">tags</a></li>
2228 2229 <li><a href="/bookmarks">bookmarks</a></li>
2229 2230 <li><a href="/branches">branches</a></li>
2230 2231 </ul>
2231 2232 <ul>
2232 2233 <li class="active"><a href="/help">help</a></li>
2233 2234 </ul>
2234 2235 </div>
2235 2236
2236 2237 <div class="main">
2237 2238 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2238 2239 <h3>Help: add</h3>
2239 2240
2240 2241 <form class="search" action="/log">
2241 2242
2242 2243 <p><input name="rev" id="search1" type="text" size="30" /></p>
2243 2244 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2244 2245 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2245 2246 </form>
2246 2247 <div id="doc">
2247 2248 <p>
2248 2249 hg add [OPTION]... [FILE]...
2249 2250 </p>
2250 2251 <p>
2251 2252 add the specified files on the next commit
2252 2253 </p>
2253 2254 <p>
2254 2255 Schedule files to be version controlled and added to the
2255 2256 repository.
2256 2257 </p>
2257 2258 <p>
2258 2259 The files will be added to the repository at the next commit. To
2259 2260 undo an add before that, see 'hg forget'.
2260 2261 </p>
2261 2262 <p>
2262 2263 If no names are given, add all files to the repository (except
2263 2264 files matching &quot;.hgignore&quot;).
2264 2265 </p>
2265 2266 <p>
2266 2267 Examples:
2267 2268 </p>
2268 2269 <ul>
2269 2270 <li> New (unknown) files are added automatically by 'hg add':
2270 2271 <pre>
2271 2272 \$ ls (re)
2272 2273 foo.c
2273 2274 \$ hg status (re)
2274 2275 ? foo.c
2275 2276 \$ hg add (re)
2276 2277 adding foo.c
2277 2278 \$ hg status (re)
2278 2279 A foo.c
2279 2280 </pre>
2280 2281 <li> Specific files to be added can be specified:
2281 2282 <pre>
2282 2283 \$ ls (re)
2283 2284 bar.c foo.c
2284 2285 \$ hg status (re)
2285 2286 ? bar.c
2286 2287 ? foo.c
2287 2288 \$ hg add bar.c (re)
2288 2289 \$ hg status (re)
2289 2290 A bar.c
2290 2291 ? foo.c
2291 2292 </pre>
2292 2293 </ul>
2293 2294 <p>
2294 2295 Returns 0 if all files are successfully added.
2295 2296 </p>
2296 2297 <p>
2297 2298 options ([+] can be repeated):
2298 2299 </p>
2299 2300 <table>
2300 2301 <tr><td>-I</td>
2301 2302 <td>--include PATTERN [+]</td>
2302 2303 <td>include names matching the given patterns</td></tr>
2303 2304 <tr><td>-X</td>
2304 2305 <td>--exclude PATTERN [+]</td>
2305 2306 <td>exclude names matching the given patterns</td></tr>
2306 2307 <tr><td>-S</td>
2307 2308 <td>--subrepos</td>
2308 2309 <td>recurse into subrepositories</td></tr>
2309 2310 <tr><td>-n</td>
2310 2311 <td>--dry-run</td>
2311 2312 <td>do not perform actions, just print output</td></tr>
2312 2313 </table>
2313 2314 <p>
2314 2315 global options ([+] can be repeated):
2315 2316 </p>
2316 2317 <table>
2317 2318 <tr><td>-R</td>
2318 2319 <td>--repository REPO</td>
2319 2320 <td>repository root directory or name of overlay bundle file</td></tr>
2320 2321 <tr><td></td>
2321 2322 <td>--cwd DIR</td>
2322 2323 <td>change working directory</td></tr>
2323 2324 <tr><td>-y</td>
2324 2325 <td>--noninteractive</td>
2325 2326 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2326 2327 <tr><td>-q</td>
2327 2328 <td>--quiet</td>
2328 2329 <td>suppress output</td></tr>
2329 2330 <tr><td>-v</td>
2330 2331 <td>--verbose</td>
2331 2332 <td>enable additional output</td></tr>
2332 2333 <tr><td></td>
2333 2334 <td>--config CONFIG [+]</td>
2334 2335 <td>set/override config option (use 'section.name=value')</td></tr>
2335 2336 <tr><td></td>
2336 2337 <td>--debug</td>
2337 2338 <td>enable debugging output</td></tr>
2338 2339 <tr><td></td>
2339 2340 <td>--debugger</td>
2340 2341 <td>start debugger</td></tr>
2341 2342 <tr><td></td>
2342 2343 <td>--encoding ENCODE</td>
2343 2344 <td>set the charset encoding (default: ascii)</td></tr>
2344 2345 <tr><td></td>
2345 2346 <td>--encodingmode MODE</td>
2346 2347 <td>set the charset encoding mode (default: strict)</td></tr>
2347 2348 <tr><td></td>
2348 2349 <td>--traceback</td>
2349 2350 <td>always print a traceback on exception</td></tr>
2350 2351 <tr><td></td>
2351 2352 <td>--time</td>
2352 2353 <td>time how long the command takes</td></tr>
2353 2354 <tr><td></td>
2354 2355 <td>--profile</td>
2355 2356 <td>print command execution profile</td></tr>
2356 2357 <tr><td></td>
2357 2358 <td>--version</td>
2358 2359 <td>output version information and exit</td></tr>
2359 2360 <tr><td>-h</td>
2360 2361 <td>--help</td>
2361 2362 <td>display help and exit</td></tr>
2362 2363 <tr><td></td>
2363 2364 <td>--hidden</td>
2364 2365 <td>consider hidden changesets</td></tr>
2365 2366 </table>
2366 2367
2367 2368 </div>
2368 2369 </div>
2369 2370 </div>
2370 2371
2371 2372 <script type="text/javascript">process_dates()</script>
2372 2373
2373 2374
2374 2375 </body>
2375 2376 </html>
2376 2377
2377 2378
2378 2379 $ get-with-headers.py 127.0.0.1:$HGPORT "help/remove"
2379 2380 200 Script output follows
2380 2381
2381 2382 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2382 2383 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2383 2384 <head>
2384 2385 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2385 2386 <meta name="robots" content="index, nofollow" />
2386 2387 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2387 2388 <script type="text/javascript" src="/static/mercurial.js"></script>
2388 2389
2389 2390 <title>Help: remove</title>
2390 2391 </head>
2391 2392 <body>
2392 2393
2393 2394 <div class="container">
2394 2395 <div class="menu">
2395 2396 <div class="logo">
2396 2397 <a href="https://mercurial-scm.org/">
2397 2398 <img src="/static/hglogo.png" alt="mercurial" /></a>
2398 2399 </div>
2399 2400 <ul>
2400 2401 <li><a href="/shortlog">log</a></li>
2401 2402 <li><a href="/graph">graph</a></li>
2402 2403 <li><a href="/tags">tags</a></li>
2403 2404 <li><a href="/bookmarks">bookmarks</a></li>
2404 2405 <li><a href="/branches">branches</a></li>
2405 2406 </ul>
2406 2407 <ul>
2407 2408 <li class="active"><a href="/help">help</a></li>
2408 2409 </ul>
2409 2410 </div>
2410 2411
2411 2412 <div class="main">
2412 2413 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2413 2414 <h3>Help: remove</h3>
2414 2415
2415 2416 <form class="search" action="/log">
2416 2417
2417 2418 <p><input name="rev" id="search1" type="text" size="30" /></p>
2418 2419 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2419 2420 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2420 2421 </form>
2421 2422 <div id="doc">
2422 2423 <p>
2423 2424 hg remove [OPTION]... FILE...
2424 2425 </p>
2425 2426 <p>
2426 2427 aliases: rm
2427 2428 </p>
2428 2429 <p>
2429 2430 remove the specified files on the next commit
2430 2431 </p>
2431 2432 <p>
2432 2433 Schedule the indicated files for removal from the current branch.
2433 2434 </p>
2434 2435 <p>
2435 2436 This command schedules the files to be removed at the next commit.
2436 2437 To undo a remove before that, see 'hg revert'. To undo added
2437 2438 files, see 'hg forget'.
2438 2439 </p>
2439 2440 <p>
2440 2441 -A/--after can be used to remove only files that have already
2441 2442 been deleted, -f/--force can be used to force deletion, and -Af
2442 2443 can be used to remove files from the next revision without
2443 2444 deleting them from the working directory.
2444 2445 </p>
2445 2446 <p>
2446 2447 The following table details the behavior of remove for different
2447 2448 file states (columns) and option combinations (rows). The file
2448 2449 states are Added [A], Clean [C], Modified [M] and Missing [!]
2449 2450 (as reported by 'hg status'). The actions are Warn, Remove
2450 2451 (from branch) and Delete (from disk):
2451 2452 </p>
2452 2453 <table>
2453 2454 <tr><td>opt/state</td>
2454 2455 <td>A</td>
2455 2456 <td>C</td>
2456 2457 <td>M</td>
2457 2458 <td>!</td></tr>
2458 2459 <tr><td>none</td>
2459 2460 <td>W</td>
2460 2461 <td>RD</td>
2461 2462 <td>W</td>
2462 2463 <td>R</td></tr>
2463 2464 <tr><td>-f</td>
2464 2465 <td>R</td>
2465 2466 <td>RD</td>
2466 2467 <td>RD</td>
2467 2468 <td>R</td></tr>
2468 2469 <tr><td>-A</td>
2469 2470 <td>W</td>
2470 2471 <td>W</td>
2471 2472 <td>W</td>
2472 2473 <td>R</td></tr>
2473 2474 <tr><td>-Af</td>
2474 2475 <td>R</td>
2475 2476 <td>R</td>
2476 2477 <td>R</td>
2477 2478 <td>R</td></tr>
2478 2479 </table>
2479 2480 <p>
2480 2481 <b>Note:</b>
2481 2482 </p>
2482 2483 <p>
2483 2484 'hg remove' never deletes files in Added [A] state from the
2484 2485 working directory, not even if &quot;--force&quot; is specified.
2485 2486 </p>
2486 2487 <p>
2487 2488 Returns 0 on success, 1 if any warnings encountered.
2488 2489 </p>
2489 2490 <p>
2490 2491 options ([+] can be repeated):
2491 2492 </p>
2492 2493 <table>
2493 2494 <tr><td>-A</td>
2494 2495 <td>--after</td>
2495 2496 <td>record delete for missing files</td></tr>
2496 2497 <tr><td>-f</td>
2497 2498 <td>--force</td>
2498 2499 <td>remove (and delete) file even if added or modified</td></tr>
2499 2500 <tr><td>-S</td>
2500 2501 <td>--subrepos</td>
2501 2502 <td>recurse into subrepositories</td></tr>
2502 2503 <tr><td>-I</td>
2503 2504 <td>--include PATTERN [+]</td>
2504 2505 <td>include names matching the given patterns</td></tr>
2505 2506 <tr><td>-X</td>
2506 2507 <td>--exclude PATTERN [+]</td>
2507 2508 <td>exclude names matching the given patterns</td></tr>
2508 2509 </table>
2509 2510 <p>
2510 2511 global options ([+] can be repeated):
2511 2512 </p>
2512 2513 <table>
2513 2514 <tr><td>-R</td>
2514 2515 <td>--repository REPO</td>
2515 2516 <td>repository root directory or name of overlay bundle file</td></tr>
2516 2517 <tr><td></td>
2517 2518 <td>--cwd DIR</td>
2518 2519 <td>change working directory</td></tr>
2519 2520 <tr><td>-y</td>
2520 2521 <td>--noninteractive</td>
2521 2522 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2522 2523 <tr><td>-q</td>
2523 2524 <td>--quiet</td>
2524 2525 <td>suppress output</td></tr>
2525 2526 <tr><td>-v</td>
2526 2527 <td>--verbose</td>
2527 2528 <td>enable additional output</td></tr>
2528 2529 <tr><td></td>
2529 2530 <td>--config CONFIG [+]</td>
2530 2531 <td>set/override config option (use 'section.name=value')</td></tr>
2531 2532 <tr><td></td>
2532 2533 <td>--debug</td>
2533 2534 <td>enable debugging output</td></tr>
2534 2535 <tr><td></td>
2535 2536 <td>--debugger</td>
2536 2537 <td>start debugger</td></tr>
2537 2538 <tr><td></td>
2538 2539 <td>--encoding ENCODE</td>
2539 2540 <td>set the charset encoding (default: ascii)</td></tr>
2540 2541 <tr><td></td>
2541 2542 <td>--encodingmode MODE</td>
2542 2543 <td>set the charset encoding mode (default: strict)</td></tr>
2543 2544 <tr><td></td>
2544 2545 <td>--traceback</td>
2545 2546 <td>always print a traceback on exception</td></tr>
2546 2547 <tr><td></td>
2547 2548 <td>--time</td>
2548 2549 <td>time how long the command takes</td></tr>
2549 2550 <tr><td></td>
2550 2551 <td>--profile</td>
2551 2552 <td>print command execution profile</td></tr>
2552 2553 <tr><td></td>
2553 2554 <td>--version</td>
2554 2555 <td>output version information and exit</td></tr>
2555 2556 <tr><td>-h</td>
2556 2557 <td>--help</td>
2557 2558 <td>display help and exit</td></tr>
2558 2559 <tr><td></td>
2559 2560 <td>--hidden</td>
2560 2561 <td>consider hidden changesets</td></tr>
2561 2562 </table>
2562 2563
2563 2564 </div>
2564 2565 </div>
2565 2566 </div>
2566 2567
2567 2568 <script type="text/javascript">process_dates()</script>
2568 2569
2569 2570
2570 2571 </body>
2571 2572 </html>
2572 2573
2573 2574
2574 2575 $ get-with-headers.py 127.0.0.1:$HGPORT "help/revisions"
2575 2576 200 Script output follows
2576 2577
2577 2578 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2578 2579 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2579 2580 <head>
2580 2581 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2581 2582 <meta name="robots" content="index, nofollow" />
2582 2583 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2583 2584 <script type="text/javascript" src="/static/mercurial.js"></script>
2584 2585
2585 2586 <title>Help: revisions</title>
2586 2587 </head>
2587 2588 <body>
2588 2589
2589 2590 <div class="container">
2590 2591 <div class="menu">
2591 2592 <div class="logo">
2592 2593 <a href="https://mercurial-scm.org/">
2593 2594 <img src="/static/hglogo.png" alt="mercurial" /></a>
2594 2595 </div>
2595 2596 <ul>
2596 2597 <li><a href="/shortlog">log</a></li>
2597 2598 <li><a href="/graph">graph</a></li>
2598 2599 <li><a href="/tags">tags</a></li>
2599 2600 <li><a href="/bookmarks">bookmarks</a></li>
2600 2601 <li><a href="/branches">branches</a></li>
2601 2602 </ul>
2602 2603 <ul>
2603 2604 <li class="active"><a href="/help">help</a></li>
2604 2605 </ul>
2605 2606 </div>
2606 2607
2607 2608 <div class="main">
2608 2609 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2609 2610 <h3>Help: revisions</h3>
2610 2611
2611 2612 <form class="search" action="/log">
2612 2613
2613 2614 <p><input name="rev" id="search1" type="text" size="30" /></p>
2614 2615 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2615 2616 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2616 2617 </form>
2617 2618 <div id="doc">
2618 2619 <h1>Specifying Single Revisions</h1>
2619 2620 <p>
2620 2621 Mercurial supports several ways to specify individual revisions.
2621 2622 </p>
2622 2623 <p>
2623 2624 A plain integer is treated as a revision number. Negative integers are
2624 2625 treated as sequential offsets from the tip, with -1 denoting the tip,
2625 2626 -2 denoting the revision prior to the tip, and so forth.
2626 2627 </p>
2627 2628 <p>
2628 2629 A 40-digit hexadecimal string is treated as a unique revision
2629 2630 identifier.
2630 2631 </p>
2631 2632 <p>
2632 2633 A hexadecimal string less than 40 characters long is treated as a
2633 2634 unique revision identifier and is referred to as a short-form
2634 2635 identifier. A short-form identifier is only valid if it is the prefix
2635 2636 of exactly one full-length identifier.
2636 2637 </p>
2637 2638 <p>
2638 2639 Any other string is treated as a bookmark, tag, or branch name. A
2639 2640 bookmark is a movable pointer to a revision. A tag is a permanent name
2640 2641 associated with a revision. A branch name denotes the tipmost open branch head
2641 2642 of that branch - or if they are all closed, the tipmost closed head of the
2642 2643 branch. Bookmark, tag, and branch names must not contain the &quot;:&quot; character.
2643 2644 </p>
2644 2645 <p>
2645 2646 The reserved name &quot;tip&quot; always identifies the most recent revision.
2646 2647 </p>
2647 2648 <p>
2648 2649 The reserved name &quot;null&quot; indicates the null revision. This is the
2649 2650 revision of an empty repository, and the parent of revision 0.
2650 2651 </p>
2651 2652 <p>
2652 2653 The reserved name &quot;.&quot; indicates the working directory parent. If no
2653 2654 working directory is checked out, it is equivalent to null. If an
2654 2655 uncommitted merge is in progress, &quot;.&quot; is the revision of the first
2655 2656 parent.
2656 2657 </p>
2657 2658
2658 2659 </div>
2659 2660 </div>
2660 2661 </div>
2661 2662
2662 2663 <script type="text/javascript">process_dates()</script>
2663 2664
2664 2665
2665 2666 </body>
2666 2667 </html>
2667 2668
2668 2669
2669 2670 Sub-topic indexes rendered properly
2670 2671
2671 2672 $ get-with-headers.py 127.0.0.1:$HGPORT "help/internals"
2672 2673 200 Script output follows
2673 2674
2674 2675 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2675 2676 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2676 2677 <head>
2677 2678 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2678 2679 <meta name="robots" content="index, nofollow" />
2679 2680 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2680 2681 <script type="text/javascript" src="/static/mercurial.js"></script>
2681 2682
2682 2683 <title>Help: internals</title>
2683 2684 </head>
2684 2685 <body>
2685 2686
2686 2687 <div class="container">
2687 2688 <div class="menu">
2688 2689 <div class="logo">
2689 2690 <a href="https://mercurial-scm.org/">
2690 2691 <img src="/static/hglogo.png" alt="mercurial" /></a>
2691 2692 </div>
2692 2693 <ul>
2693 2694 <li><a href="/shortlog">log</a></li>
2694 2695 <li><a href="/graph">graph</a></li>
2695 2696 <li><a href="/tags">tags</a></li>
2696 2697 <li><a href="/bookmarks">bookmarks</a></li>
2697 2698 <li><a href="/branches">branches</a></li>
2698 2699 </ul>
2699 2700 <ul>
2700 2701 <li><a href="/help">help</a></li>
2701 2702 </ul>
2702 2703 </div>
2703 2704
2704 2705 <div class="main">
2705 2706 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2706 2707 <form class="search" action="/log">
2707 2708
2708 2709 <p><input name="rev" id="search1" type="text" size="30" /></p>
2709 2710 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2710 2711 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2711 2712 </form>
2712 2713 <table class="bigtable">
2713 2714 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
2714 2715
2715 2716 <tr><td>
2716 2717 <a href="/help/internals.bundles">
2717 2718 bundles
2718 2719 </a>
2719 2720 </td><td>
2720 2721 container for exchange of repository data
2721 2722 </td></tr>
2722 2723 <tr><td>
2723 2724 <a href="/help/internals.changegroups">
2724 2725 changegroups
2725 2726 </a>
2726 2727 </td><td>
2727 2728 representation of revlog data
2728 2729 </td></tr>
2729 2730 <tr><td>
2731 <a href="/help/internals.requirements">
2732 requirements
2733 </a>
2734 </td><td>
2735 repository requirements
2736 </td></tr>
2737 <tr><td>
2730 2738 <a href="/help/internals.revlogs">
2731 2739 revlogs
2732 2740 </a>
2733 2741 </td><td>
2734 2742 revision storage mechanism
2735 2743 </td></tr>
2736 2744
2737 2745
2738 2746
2739 2747
2740 2748
2741 2749 </table>
2742 2750 </div>
2743 2751 </div>
2744 2752
2745 2753 <script type="text/javascript">process_dates()</script>
2746 2754
2747 2755
2748 2756 </body>
2749 2757 </html>
2750 2758
2751 2759
2752 2760 Sub-topic topics rendered properly
2753 2761
2754 2762 $ get-with-headers.py 127.0.0.1:$HGPORT "help/internals.changegroups"
2755 2763 200 Script output follows
2756 2764
2757 2765 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2758 2766 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2759 2767 <head>
2760 2768 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2761 2769 <meta name="robots" content="index, nofollow" />
2762 2770 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2763 2771 <script type="text/javascript" src="/static/mercurial.js"></script>
2764 2772
2765 2773 <title>Help: internals.changegroups</title>
2766 2774 </head>
2767 2775 <body>
2768 2776
2769 2777 <div class="container">
2770 2778 <div class="menu">
2771 2779 <div class="logo">
2772 2780 <a href="https://mercurial-scm.org/">
2773 2781 <img src="/static/hglogo.png" alt="mercurial" /></a>
2774 2782 </div>
2775 2783 <ul>
2776 2784 <li><a href="/shortlog">log</a></li>
2777 2785 <li><a href="/graph">graph</a></li>
2778 2786 <li><a href="/tags">tags</a></li>
2779 2787 <li><a href="/bookmarks">bookmarks</a></li>
2780 2788 <li><a href="/branches">branches</a></li>
2781 2789 </ul>
2782 2790 <ul>
2783 2791 <li class="active"><a href="/help">help</a></li>
2784 2792 </ul>
2785 2793 </div>
2786 2794
2787 2795 <div class="main">
2788 2796 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2789 2797 <h3>Help: internals.changegroups</h3>
2790 2798
2791 2799 <form class="search" action="/log">
2792 2800
2793 2801 <p><input name="rev" id="search1" type="text" size="30" /></p>
2794 2802 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2795 2803 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2796 2804 </form>
2797 2805 <div id="doc">
2798 2806 <h1>representation of revlog data</h1>
2799 2807 <h2>Changegroups</h2>
2800 2808 <p>
2801 2809 Changegroups are representations of repository revlog data, specifically
2802 2810 the changelog, manifest, and filelogs.
2803 2811 </p>
2804 2812 <p>
2805 2813 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
2806 2814 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with
2807 2815 the only difference being a header on entries in the changeset
2808 2816 segment. Version &quot;3&quot; adds support for exchanging treemanifests and
2809 2817 includes revlog flags in the delta header.
2810 2818 </p>
2811 2819 <p>
2812 2820 Changegroups consists of 3 logical segments:
2813 2821 </p>
2814 2822 <pre>
2815 2823 +---------------------------------+
2816 2824 | | | |
2817 2825 | changeset | manifest | filelogs |
2818 2826 | | | |
2819 2827 +---------------------------------+
2820 2828 </pre>
2821 2829 <p>
2822 2830 The principle building block of each segment is a *chunk*. A *chunk*
2823 2831 is a framed piece of data:
2824 2832 </p>
2825 2833 <pre>
2826 2834 +---------------------------------------+
2827 2835 | | |
2828 2836 | length | data |
2829 2837 | (32 bits) | &lt;length&gt; bytes |
2830 2838 | | |
2831 2839 +---------------------------------------+
2832 2840 </pre>
2833 2841 <p>
2834 2842 Each chunk starts with a 32-bit big-endian signed integer indicating
2835 2843 the length of the raw data that follows.
2836 2844 </p>
2837 2845 <p>
2838 2846 There is a special case chunk that has 0 length (&quot;0x00000000&quot;). We
2839 2847 call this an *empty chunk*.
2840 2848 </p>
2841 2849 <h3>Delta Groups</h3>
2842 2850 <p>
2843 2851 A *delta group* expresses the content of a revlog as a series of deltas,
2844 2852 or patches against previous revisions.
2845 2853 </p>
2846 2854 <p>
2847 2855 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
2848 2856 to signal the end of the delta group:
2849 2857 </p>
2850 2858 <pre>
2851 2859 +------------------------------------------------------------------------+
2852 2860 | | | | | |
2853 2861 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
2854 2862 | (32 bits) | (various) | (32 bits) | (various) | (32 bits) |
2855 2863 | | | | | |
2856 2864 +------------------------------------------------------------+-----------+
2857 2865 </pre>
2858 2866 <p>
2859 2867 Each *chunk*'s data consists of the following:
2860 2868 </p>
2861 2869 <pre>
2862 2870 +-----------------------------------------+
2863 2871 | | | |
2864 2872 | delta header | mdiff header | delta |
2865 2873 | (various) | (12 bytes) | (various) |
2866 2874 | | | |
2867 2875 +-----------------------------------------+
2868 2876 </pre>
2869 2877 <p>
2870 2878 The *length* field is the byte length of the remaining 3 logical pieces
2871 2879 of data. The *delta* is a diff from an existing entry in the changelog.
2872 2880 </p>
2873 2881 <p>
2874 2882 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
2875 2883 &quot;3&quot; of the changegroup format.
2876 2884 </p>
2877 2885 <p>
2878 2886 Version 1:
2879 2887 </p>
2880 2888 <pre>
2881 2889 +------------------------------------------------------+
2882 2890 | | | | |
2883 2891 | node | p1 node | p2 node | link node |
2884 2892 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
2885 2893 | | | | |
2886 2894 +------------------------------------------------------+
2887 2895 </pre>
2888 2896 <p>
2889 2897 Version 2:
2890 2898 </p>
2891 2899 <pre>
2892 2900 +------------------------------------------------------------------+
2893 2901 | | | | | |
2894 2902 | node | p1 node | p2 node | base node | link node |
2895 2903 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
2896 2904 | | | | | |
2897 2905 +------------------------------------------------------------------+
2898 2906 </pre>
2899 2907 <p>
2900 2908 Version 3:
2901 2909 </p>
2902 2910 <pre>
2903 2911 +------------------------------------------------------------------------------+
2904 2912 | | | | | | |
2905 2913 | node | p1 node | p2 node | base node | link node | flags |
2906 2914 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
2907 2915 | | | | | | |
2908 2916 +------------------------------------------------------------------------------+
2909 2917 </pre>
2910 2918 <p>
2911 2919 The *mdiff header* consists of 3 32-bit big-endian signed integers
2912 2920 describing offsets at which to apply the following delta content:
2913 2921 </p>
2914 2922 <pre>
2915 2923 +-------------------------------------+
2916 2924 | | | |
2917 2925 | offset | old length | new length |
2918 2926 | (32 bits) | (32 bits) | (32 bits) |
2919 2927 | | | |
2920 2928 +-------------------------------------+
2921 2929 </pre>
2922 2930 <p>
2923 2931 In version 1, the delta is always applied against the previous node from
2924 2932 the changegroup or the first parent if this is the first entry in the
2925 2933 changegroup.
2926 2934 </p>
2927 2935 <p>
2928 2936 In version 2, the delta base node is encoded in the entry in the
2929 2937 changegroup. This allows the delta to be expressed against any parent,
2930 2938 which can result in smaller deltas and more efficient encoding of data.
2931 2939 </p>
2932 2940 <h3>Changeset Segment</h3>
2933 2941 <p>
2934 2942 The *changeset segment* consists of a single *delta group* holding
2935 2943 changelog data. It is followed by an *empty chunk* to denote the
2936 2944 boundary to the *manifests segment*.
2937 2945 </p>
2938 2946 <h3>Manifest Segment</h3>
2939 2947 <p>
2940 2948 The *manifest segment* consists of a single *delta group* holding
2941 2949 manifest data. It is followed by an *empty chunk* to denote the boundary
2942 2950 to the *filelogs segment*.
2943 2951 </p>
2944 2952 <h3>Filelogs Segment</h3>
2945 2953 <p>
2946 2954 The *filelogs* segment consists of multiple sub-segments, each
2947 2955 corresponding to an individual file whose data is being described:
2948 2956 </p>
2949 2957 <pre>
2950 2958 +--------------------------------------+
2951 2959 | | | | |
2952 2960 | filelog0 | filelog1 | filelog2 | ... |
2953 2961 | | | | |
2954 2962 +--------------------------------------+
2955 2963 </pre>
2956 2964 <p>
2957 2965 In version &quot;3&quot; of the changegroup format, filelogs may include
2958 2966 directory logs when treemanifests are in use. directory logs are
2959 2967 identified by having a trailing '/' on their filename (see below).
2960 2968 </p>
2961 2969 <p>
2962 2970 The final filelog sub-segment is followed by an *empty chunk* to denote
2963 2971 the end of the segment and the overall changegroup.
2964 2972 </p>
2965 2973 <p>
2966 2974 Each filelog sub-segment consists of the following:
2967 2975 </p>
2968 2976 <pre>
2969 2977 +------------------------------------------+
2970 2978 | | | |
2971 2979 | filename size | filename | delta group |
2972 2980 | (32 bits) | (various) | (various) |
2973 2981 | | | |
2974 2982 +------------------------------------------+
2975 2983 </pre>
2976 2984 <p>
2977 2985 That is, a *chunk* consisting of the filename (not terminated or padded)
2978 2986 followed by N chunks constituting the *delta group* for this file.
2979 2987 </p>
2980 2988
2981 2989 </div>
2982 2990 </div>
2983 2991 </div>
2984 2992
2985 2993 <script type="text/javascript">process_dates()</script>
2986 2994
2987 2995
2988 2996 </body>
2989 2997 </html>
2990 2998
2991 2999
2992 3000 $ killdaemons.py
2993 3001
2994 3002 #endif
General Comments 0
You need to be logged in to leave comments. Login now