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