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