##// END OF EJS Templates
debug: add a method to check the state of, and built an SSL cert chain...
Matt Harbison -
r33493:9a9f9521 default
parent child Browse files
Show More
@@ -1,2249 +1,2310 b''
1 1 # debugcommands.py - command processing for debug* commands
2 2 #
3 3 # Copyright 2005-2016 Matt Mackall <mpm@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 from __future__ import absolute_import
9 9
10 10 import difflib
11 11 import errno
12 12 import operator
13 13 import os
14 14 import random
15 15 import socket
16 import ssl
16 17 import string
17 18 import sys
18 19 import tempfile
19 20 import time
20 21
21 22 from .i18n import _
22 23 from .node import (
23 24 bin,
24 25 hex,
25 26 nullhex,
26 27 nullid,
27 28 nullrev,
28 29 short,
29 30 )
30 31 from . import (
31 32 bundle2,
32 33 changegroup,
33 34 cmdutil,
34 35 color,
35 36 context,
36 37 dagparser,
37 38 dagutil,
38 39 encoding,
39 40 error,
40 41 exchange,
41 42 extensions,
42 43 filemerge,
43 44 fileset,
44 45 formatter,
45 46 hg,
46 47 localrepo,
47 48 lock as lockmod,
48 49 merge as mergemod,
49 50 obsolete,
50 51 obsutil,
51 52 phases,
52 53 policy,
53 54 pvec,
54 55 pycompat,
55 56 registrar,
56 57 repair,
57 58 revlog,
58 59 revset,
59 60 revsetlang,
60 61 scmutil,
61 62 setdiscovery,
62 63 simplemerge,
63 64 smartset,
64 65 sslutil,
65 66 streamclone,
66 67 templater,
67 68 treediscovery,
68 69 upgrade,
69 70 util,
70 71 vfs as vfsmod,
71 72 )
72 73
73 74 release = lockmod.release
74 75
75 76 command = registrar.command()
76 77
77 78 @command('debugancestor', [], _('[INDEX] REV1 REV2'), optionalrepo=True)
78 79 def debugancestor(ui, repo, *args):
79 80 """find the ancestor revision of two revisions in a given index"""
80 81 if len(args) == 3:
81 82 index, rev1, rev2 = args
82 83 r = revlog.revlog(vfsmod.vfs(pycompat.getcwd(), audit=False), index)
83 84 lookup = r.lookup
84 85 elif len(args) == 2:
85 86 if not repo:
86 87 raise error.Abort(_('there is no Mercurial repository here '
87 88 '(.hg not found)'))
88 89 rev1, rev2 = args
89 90 r = repo.changelog
90 91 lookup = repo.lookup
91 92 else:
92 93 raise error.Abort(_('either two or three arguments required'))
93 94 a = r.ancestor(lookup(rev1), lookup(rev2))
94 95 ui.write('%d:%s\n' % (r.rev(a), hex(a)))
95 96
96 97 @command('debugapplystreamclonebundle', [], 'FILE')
97 98 def debugapplystreamclonebundle(ui, repo, fname):
98 99 """apply a stream clone bundle file"""
99 100 f = hg.openpath(ui, fname)
100 101 gen = exchange.readbundle(ui, f, fname)
101 102 gen.apply(repo)
102 103
103 104 @command('debugbuilddag',
104 105 [('m', 'mergeable-file', None, _('add single file mergeable changes')),
105 106 ('o', 'overwritten-file', None, _('add single file all revs overwrite')),
106 107 ('n', 'new-file', None, _('add new file at each rev'))],
107 108 _('[OPTION]... [TEXT]'))
108 109 def debugbuilddag(ui, repo, text=None,
109 110 mergeable_file=False,
110 111 overwritten_file=False,
111 112 new_file=False):
112 113 """builds a repo with a given DAG from scratch in the current empty repo
113 114
114 115 The description of the DAG is read from stdin if not given on the
115 116 command line.
116 117
117 118 Elements:
118 119
119 120 - "+n" is a linear run of n nodes based on the current default parent
120 121 - "." is a single node based on the current default parent
121 122 - "$" resets the default parent to null (implied at the start);
122 123 otherwise the default parent is always the last node created
123 124 - "<p" sets the default parent to the backref p
124 125 - "*p" is a fork at parent p, which is a backref
125 126 - "*p1/p2" is a merge of parents p1 and p2, which are backrefs
126 127 - "/p2" is a merge of the preceding node and p2
127 128 - ":tag" defines a local tag for the preceding node
128 129 - "@branch" sets the named branch for subsequent nodes
129 130 - "#...\\n" is a comment up to the end of the line
130 131
131 132 Whitespace between the above elements is ignored.
132 133
133 134 A backref is either
134 135
135 136 - a number n, which references the node curr-n, where curr is the current
136 137 node, or
137 138 - the name of a local tag you placed earlier using ":tag", or
138 139 - empty to denote the default parent.
139 140
140 141 All string valued-elements are either strictly alphanumeric, or must
141 142 be enclosed in double quotes ("..."), with "\\" as escape character.
142 143 """
143 144
144 145 if text is None:
145 146 ui.status(_("reading DAG from stdin\n"))
146 147 text = ui.fin.read()
147 148
148 149 cl = repo.changelog
149 150 if len(cl) > 0:
150 151 raise error.Abort(_('repository is not empty'))
151 152
152 153 # determine number of revs in DAG
153 154 total = 0
154 155 for type, data in dagparser.parsedag(text):
155 156 if type == 'n':
156 157 total += 1
157 158
158 159 if mergeable_file:
159 160 linesperrev = 2
160 161 # make a file with k lines per rev
161 162 initialmergedlines = [str(i) for i in xrange(0, total * linesperrev)]
162 163 initialmergedlines.append("")
163 164
164 165 tags = []
165 166
166 167 wlock = lock = tr = None
167 168 try:
168 169 wlock = repo.wlock()
169 170 lock = repo.lock()
170 171 tr = repo.transaction("builddag")
171 172
172 173 at = -1
173 174 atbranch = 'default'
174 175 nodeids = []
175 176 id = 0
176 177 ui.progress(_('building'), id, unit=_('revisions'), total=total)
177 178 for type, data in dagparser.parsedag(text):
178 179 if type == 'n':
179 180 ui.note(('node %s\n' % str(data)))
180 181 id, ps = data
181 182
182 183 files = []
183 184 fctxs = {}
184 185
185 186 p2 = None
186 187 if mergeable_file:
187 188 fn = "mf"
188 189 p1 = repo[ps[0]]
189 190 if len(ps) > 1:
190 191 p2 = repo[ps[1]]
191 192 pa = p1.ancestor(p2)
192 193 base, local, other = [x[fn].data() for x in (pa, p1,
193 194 p2)]
194 195 m3 = simplemerge.Merge3Text(base, local, other)
195 196 ml = [l.strip() for l in m3.merge_lines()]
196 197 ml.append("")
197 198 elif at > 0:
198 199 ml = p1[fn].data().split("\n")
199 200 else:
200 201 ml = initialmergedlines
201 202 ml[id * linesperrev] += " r%i" % id
202 203 mergedtext = "\n".join(ml)
203 204 files.append(fn)
204 205 fctxs[fn] = context.memfilectx(repo, fn, mergedtext)
205 206
206 207 if overwritten_file:
207 208 fn = "of"
208 209 files.append(fn)
209 210 fctxs[fn] = context.memfilectx(repo, fn, "r%i\n" % id)
210 211
211 212 if new_file:
212 213 fn = "nf%i" % id
213 214 files.append(fn)
214 215 fctxs[fn] = context.memfilectx(repo, fn, "r%i\n" % id)
215 216 if len(ps) > 1:
216 217 if not p2:
217 218 p2 = repo[ps[1]]
218 219 for fn in p2:
219 220 if fn.startswith("nf"):
220 221 files.append(fn)
221 222 fctxs[fn] = p2[fn]
222 223
223 224 def fctxfn(repo, cx, path):
224 225 return fctxs.get(path)
225 226
226 227 if len(ps) == 0 or ps[0] < 0:
227 228 pars = [None, None]
228 229 elif len(ps) == 1:
229 230 pars = [nodeids[ps[0]], None]
230 231 else:
231 232 pars = [nodeids[p] for p in ps]
232 233 cx = context.memctx(repo, pars, "r%i" % id, files, fctxfn,
233 234 date=(id, 0),
234 235 user="debugbuilddag",
235 236 extra={'branch': atbranch})
236 237 nodeid = repo.commitctx(cx)
237 238 nodeids.append(nodeid)
238 239 at = id
239 240 elif type == 'l':
240 241 id, name = data
241 242 ui.note(('tag %s\n' % name))
242 243 tags.append("%s %s\n" % (hex(repo.changelog.node(id)), name))
243 244 elif type == 'a':
244 245 ui.note(('branch %s\n' % data))
245 246 atbranch = data
246 247 ui.progress(_('building'), id, unit=_('revisions'), total=total)
247 248 tr.close()
248 249
249 250 if tags:
250 251 repo.vfs.write("localtags", "".join(tags))
251 252 finally:
252 253 ui.progress(_('building'), None)
253 254 release(tr, lock, wlock)
254 255
255 256 def _debugchangegroup(ui, gen, all=None, indent=0, **opts):
256 257 indent_string = ' ' * indent
257 258 if all:
258 259 ui.write(("%sformat: id, p1, p2, cset, delta base, len(delta)\n")
259 260 % indent_string)
260 261
261 262 def showchunks(named):
262 263 ui.write("\n%s%s\n" % (indent_string, named))
263 264 chain = None
264 265 for chunkdata in iter(lambda: gen.deltachunk(chain), {}):
265 266 node = chunkdata['node']
266 267 p1 = chunkdata['p1']
267 268 p2 = chunkdata['p2']
268 269 cs = chunkdata['cs']
269 270 deltabase = chunkdata['deltabase']
270 271 delta = chunkdata['delta']
271 272 ui.write("%s%s %s %s %s %s %s\n" %
272 273 (indent_string, hex(node), hex(p1), hex(p2),
273 274 hex(cs), hex(deltabase), len(delta)))
274 275 chain = node
275 276
276 277 chunkdata = gen.changelogheader()
277 278 showchunks("changelog")
278 279 chunkdata = gen.manifestheader()
279 280 showchunks("manifest")
280 281 for chunkdata in iter(gen.filelogheader, {}):
281 282 fname = chunkdata['filename']
282 283 showchunks(fname)
283 284 else:
284 285 if isinstance(gen, bundle2.unbundle20):
285 286 raise error.Abort(_('use debugbundle2 for this file'))
286 287 chunkdata = gen.changelogheader()
287 288 chain = None
288 289 for chunkdata in iter(lambda: gen.deltachunk(chain), {}):
289 290 node = chunkdata['node']
290 291 ui.write("%s%s\n" % (indent_string, hex(node)))
291 292 chain = node
292 293
293 294 def _debugobsmarkers(ui, part, indent=0, **opts):
294 295 """display version and markers contained in 'data'"""
295 296 opts = pycompat.byteskwargs(opts)
296 297 data = part.read()
297 298 indent_string = ' ' * indent
298 299 try:
299 300 version, markers = obsolete._readmarkers(data)
300 301 except error.UnknownVersion as exc:
301 302 msg = "%sunsupported version: %s (%d bytes)\n"
302 303 msg %= indent_string, exc.version, len(data)
303 304 ui.write(msg)
304 305 else:
305 306 msg = "%sversion: %s (%d bytes)\n"
306 307 msg %= indent_string, version, len(data)
307 308 ui.write(msg)
308 309 fm = ui.formatter('debugobsolete', opts)
309 310 for rawmarker in sorted(markers):
310 311 m = obsutil.marker(None, rawmarker)
311 312 fm.startitem()
312 313 fm.plain(indent_string)
313 314 cmdutil.showmarker(fm, m)
314 315 fm.end()
315 316
316 317 def _debugphaseheads(ui, data, indent=0):
317 318 """display version and markers contained in 'data'"""
318 319 indent_string = ' ' * indent
319 320 headsbyphase = bundle2._readphaseheads(data)
320 321 for phase in phases.allphases:
321 322 for head in headsbyphase[phase]:
322 323 ui.write(indent_string)
323 324 ui.write('%s %s\n' % (hex(head), phases.phasenames[phase]))
324 325
325 326 def _debugbundle2(ui, gen, all=None, **opts):
326 327 """lists the contents of a bundle2"""
327 328 if not isinstance(gen, bundle2.unbundle20):
328 329 raise error.Abort(_('not a bundle2 file'))
329 330 ui.write(('Stream params: %s\n' % repr(gen.params)))
330 331 parttypes = opts.get(r'part_type', [])
331 332 for part in gen.iterparts():
332 333 if parttypes and part.type not in parttypes:
333 334 continue
334 335 ui.write('%s -- %r\n' % (part.type, repr(part.params)))
335 336 if part.type == 'changegroup':
336 337 version = part.params.get('version', '01')
337 338 cg = changegroup.getunbundler(version, part, 'UN')
338 339 _debugchangegroup(ui, cg, all=all, indent=4, **opts)
339 340 if part.type == 'obsmarkers':
340 341 _debugobsmarkers(ui, part, indent=4, **opts)
341 342 if part.type == 'phase-heads':
342 343 _debugphaseheads(ui, part, indent=4)
343 344
344 345 @command('debugbundle',
345 346 [('a', 'all', None, _('show all details')),
346 347 ('', 'part-type', [], _('show only the named part type')),
347 348 ('', 'spec', None, _('print the bundlespec of the bundle'))],
348 349 _('FILE'),
349 350 norepo=True)
350 351 def debugbundle(ui, bundlepath, all=None, spec=None, **opts):
351 352 """lists the contents of a bundle"""
352 353 with hg.openpath(ui, bundlepath) as f:
353 354 if spec:
354 355 spec = exchange.getbundlespec(ui, f)
355 356 ui.write('%s\n' % spec)
356 357 return
357 358
358 359 gen = exchange.readbundle(ui, f, bundlepath)
359 360 if isinstance(gen, bundle2.unbundle20):
360 361 return _debugbundle2(ui, gen, all=all, **opts)
361 362 _debugchangegroup(ui, gen, all=all, **opts)
362 363
363 364 @command('debugcheckstate', [], '')
364 365 def debugcheckstate(ui, repo):
365 366 """validate the correctness of the current dirstate"""
366 367 parent1, parent2 = repo.dirstate.parents()
367 368 m1 = repo[parent1].manifest()
368 369 m2 = repo[parent2].manifest()
369 370 errors = 0
370 371 for f in repo.dirstate:
371 372 state = repo.dirstate[f]
372 373 if state in "nr" and f not in m1:
373 374 ui.warn(_("%s in state %s, but not in manifest1\n") % (f, state))
374 375 errors += 1
375 376 if state in "a" and f in m1:
376 377 ui.warn(_("%s in state %s, but also in manifest1\n") % (f, state))
377 378 errors += 1
378 379 if state in "m" and f not in m1 and f not in m2:
379 380 ui.warn(_("%s in state %s, but not in either manifest\n") %
380 381 (f, state))
381 382 errors += 1
382 383 for f in m1:
383 384 state = repo.dirstate[f]
384 385 if state not in "nrm":
385 386 ui.warn(_("%s in manifest1, but listed as state %s") % (f, state))
386 387 errors += 1
387 388 if errors:
388 389 error = _(".hg/dirstate inconsistent with current parent's manifest")
389 390 raise error.Abort(error)
390 391
391 392 @command('debugcolor',
392 393 [('', 'style', None, _('show all configured styles'))],
393 394 'hg debugcolor')
394 395 def debugcolor(ui, repo, **opts):
395 396 """show available color, effects or style"""
396 397 ui.write(('color mode: %s\n') % ui._colormode)
397 398 if opts.get(r'style'):
398 399 return _debugdisplaystyle(ui)
399 400 else:
400 401 return _debugdisplaycolor(ui)
401 402
402 403 def _debugdisplaycolor(ui):
403 404 ui = ui.copy()
404 405 ui._styles.clear()
405 406 for effect in color._activeeffects(ui).keys():
406 407 ui._styles[effect] = effect
407 408 if ui._terminfoparams:
408 409 for k, v in ui.configitems('color'):
409 410 if k.startswith('color.'):
410 411 ui._styles[k] = k[6:]
411 412 elif k.startswith('terminfo.'):
412 413 ui._styles[k] = k[9:]
413 414 ui.write(_('available colors:\n'))
414 415 # sort label with a '_' after the other to group '_background' entry.
415 416 items = sorted(ui._styles.items(),
416 417 key=lambda i: ('_' in i[0], i[0], i[1]))
417 418 for colorname, label in items:
418 419 ui.write(('%s\n') % colorname, label=label)
419 420
420 421 def _debugdisplaystyle(ui):
421 422 ui.write(_('available style:\n'))
422 423 width = max(len(s) for s in ui._styles)
423 424 for label, effects in sorted(ui._styles.items()):
424 425 ui.write('%s' % label, label=label)
425 426 if effects:
426 427 # 50
427 428 ui.write(': ')
428 429 ui.write(' ' * (max(0, width - len(label))))
429 430 ui.write(', '.join(ui.label(e, e) for e in effects.split()))
430 431 ui.write('\n')
431 432
432 433 @command('debugcreatestreamclonebundle', [], 'FILE')
433 434 def debugcreatestreamclonebundle(ui, repo, fname):
434 435 """create a stream clone bundle file
435 436
436 437 Stream bundles are special bundles that are essentially archives of
437 438 revlog files. They are commonly used for cloning very quickly.
438 439 """
439 440 # TODO we may want to turn this into an abort when this functionality
440 441 # is moved into `hg bundle`.
441 442 if phases.hassecret(repo):
442 443 ui.warn(_('(warning: stream clone bundle will contain secret '
443 444 'revisions)\n'))
444 445
445 446 requirements, gen = streamclone.generatebundlev1(repo)
446 447 changegroup.writechunks(ui, gen, fname)
447 448
448 449 ui.write(_('bundle requirements: %s\n') % ', '.join(sorted(requirements)))
449 450
450 451 @command('debugdag',
451 452 [('t', 'tags', None, _('use tags as labels')),
452 453 ('b', 'branches', None, _('annotate with branch names')),
453 454 ('', 'dots', None, _('use dots for runs')),
454 455 ('s', 'spaces', None, _('separate elements by spaces'))],
455 456 _('[OPTION]... [FILE [REV]...]'),
456 457 optionalrepo=True)
457 458 def debugdag(ui, repo, file_=None, *revs, **opts):
458 459 """format the changelog or an index DAG as a concise textual description
459 460
460 461 If you pass a revlog index, the revlog's DAG is emitted. If you list
461 462 revision numbers, they get labeled in the output as rN.
462 463
463 464 Otherwise, the changelog DAG of the current repo is emitted.
464 465 """
465 466 spaces = opts.get(r'spaces')
466 467 dots = opts.get(r'dots')
467 468 if file_:
468 469 rlog = revlog.revlog(vfsmod.vfs(pycompat.getcwd(), audit=False),
469 470 file_)
470 471 revs = set((int(r) for r in revs))
471 472 def events():
472 473 for r in rlog:
473 474 yield 'n', (r, list(p for p in rlog.parentrevs(r)
474 475 if p != -1))
475 476 if r in revs:
476 477 yield 'l', (r, "r%i" % r)
477 478 elif repo:
478 479 cl = repo.changelog
479 480 tags = opts.get(r'tags')
480 481 branches = opts.get(r'branches')
481 482 if tags:
482 483 labels = {}
483 484 for l, n in repo.tags().items():
484 485 labels.setdefault(cl.rev(n), []).append(l)
485 486 def events():
486 487 b = "default"
487 488 for r in cl:
488 489 if branches:
489 490 newb = cl.read(cl.node(r))[5]['branch']
490 491 if newb != b:
491 492 yield 'a', newb
492 493 b = newb
493 494 yield 'n', (r, list(p for p in cl.parentrevs(r)
494 495 if p != -1))
495 496 if tags:
496 497 ls = labels.get(r)
497 498 if ls:
498 499 for l in ls:
499 500 yield 'l', (r, l)
500 501 else:
501 502 raise error.Abort(_('need repo for changelog dag'))
502 503
503 504 for line in dagparser.dagtextlines(events(),
504 505 addspaces=spaces,
505 506 wraplabels=True,
506 507 wrapannotations=True,
507 508 wrapnonlinear=dots,
508 509 usedots=dots,
509 510 maxlinewidth=70):
510 511 ui.write(line)
511 512 ui.write("\n")
512 513
513 514 @command('debugdata', cmdutil.debugrevlogopts, _('-c|-m|FILE REV'))
514 515 def debugdata(ui, repo, file_, rev=None, **opts):
515 516 """dump the contents of a data file revision"""
516 517 opts = pycompat.byteskwargs(opts)
517 518 if opts.get('changelog') or opts.get('manifest') or opts.get('dir'):
518 519 if rev is not None:
519 520 raise error.CommandError('debugdata', _('invalid arguments'))
520 521 file_, rev = None, file_
521 522 elif rev is None:
522 523 raise error.CommandError('debugdata', _('invalid arguments'))
523 524 r = cmdutil.openrevlog(repo, 'debugdata', file_, opts)
524 525 try:
525 526 ui.write(r.revision(r.lookup(rev), raw=True))
526 527 except KeyError:
527 528 raise error.Abort(_('invalid revision identifier %s') % rev)
528 529
529 530 @command('debugdate',
530 531 [('e', 'extended', None, _('try extended date formats'))],
531 532 _('[-e] DATE [RANGE]'),
532 533 norepo=True, optionalrepo=True)
533 534 def debugdate(ui, date, range=None, **opts):
534 535 """parse and display a date"""
535 536 if opts[r"extended"]:
536 537 d = util.parsedate(date, util.extendeddateformats)
537 538 else:
538 539 d = util.parsedate(date)
539 540 ui.write(("internal: %s %s\n") % d)
540 541 ui.write(("standard: %s\n") % util.datestr(d))
541 542 if range:
542 543 m = util.matchdate(range)
543 544 ui.write(("match: %s\n") % m(d[0]))
544 545
545 546 @command('debugdeltachain',
546 547 cmdutil.debugrevlogopts + cmdutil.formatteropts,
547 548 _('-c|-m|FILE'),
548 549 optionalrepo=True)
549 550 def debugdeltachain(ui, repo, file_=None, **opts):
550 551 """dump information about delta chains in a revlog
551 552
552 553 Output can be templatized. Available template keywords are:
553 554
554 555 :``rev``: revision number
555 556 :``chainid``: delta chain identifier (numbered by unique base)
556 557 :``chainlen``: delta chain length to this revision
557 558 :``prevrev``: previous revision in delta chain
558 559 :``deltatype``: role of delta / how it was computed
559 560 :``compsize``: compressed size of revision
560 561 :``uncompsize``: uncompressed size of revision
561 562 :``chainsize``: total size of compressed revisions in chain
562 563 :``chainratio``: total chain size divided by uncompressed revision size
563 564 (new delta chains typically start at ratio 2.00)
564 565 :``lindist``: linear distance from base revision in delta chain to end
565 566 of this revision
566 567 :``extradist``: total size of revisions not part of this delta chain from
567 568 base of delta chain to end of this revision; a measurement
568 569 of how much extra data we need to read/seek across to read
569 570 the delta chain for this revision
570 571 :``extraratio``: extradist divided by chainsize; another representation of
571 572 how much unrelated data is needed to load this delta chain
572 573 """
573 574 opts = pycompat.byteskwargs(opts)
574 575 r = cmdutil.openrevlog(repo, 'debugdeltachain', file_, opts)
575 576 index = r.index
576 577 generaldelta = r.version & revlog.FLAG_GENERALDELTA
577 578
578 579 def revinfo(rev):
579 580 e = index[rev]
580 581 compsize = e[1]
581 582 uncompsize = e[2]
582 583 chainsize = 0
583 584
584 585 if generaldelta:
585 586 if e[3] == e[5]:
586 587 deltatype = 'p1'
587 588 elif e[3] == e[6]:
588 589 deltatype = 'p2'
589 590 elif e[3] == rev - 1:
590 591 deltatype = 'prev'
591 592 elif e[3] == rev:
592 593 deltatype = 'base'
593 594 else:
594 595 deltatype = 'other'
595 596 else:
596 597 if e[3] == rev:
597 598 deltatype = 'base'
598 599 else:
599 600 deltatype = 'prev'
600 601
601 602 chain = r._deltachain(rev)[0]
602 603 for iterrev in chain:
603 604 e = index[iterrev]
604 605 chainsize += e[1]
605 606
606 607 return compsize, uncompsize, deltatype, chain, chainsize
607 608
608 609 fm = ui.formatter('debugdeltachain', opts)
609 610
610 611 fm.plain(' rev chain# chainlen prev delta '
611 612 'size rawsize chainsize ratio lindist extradist '
612 613 'extraratio\n')
613 614
614 615 chainbases = {}
615 616 for rev in r:
616 617 comp, uncomp, deltatype, chain, chainsize = revinfo(rev)
617 618 chainbase = chain[0]
618 619 chainid = chainbases.setdefault(chainbase, len(chainbases) + 1)
619 620 basestart = r.start(chainbase)
620 621 revstart = r.start(rev)
621 622 lineardist = revstart + comp - basestart
622 623 extradist = lineardist - chainsize
623 624 try:
624 625 prevrev = chain[-2]
625 626 except IndexError:
626 627 prevrev = -1
627 628
628 629 chainratio = float(chainsize) / float(uncomp)
629 630 extraratio = float(extradist) / float(chainsize)
630 631
631 632 fm.startitem()
632 633 fm.write('rev chainid chainlen prevrev deltatype compsize '
633 634 'uncompsize chainsize chainratio lindist extradist '
634 635 'extraratio',
635 636 '%7d %7d %8d %8d %7s %10d %10d %10d %9.5f %9d %9d %10.5f\n',
636 637 rev, chainid, len(chain), prevrev, deltatype, comp,
637 638 uncomp, chainsize, chainratio, lineardist, extradist,
638 639 extraratio,
639 640 rev=rev, chainid=chainid, chainlen=len(chain),
640 641 prevrev=prevrev, deltatype=deltatype, compsize=comp,
641 642 uncompsize=uncomp, chainsize=chainsize,
642 643 chainratio=chainratio, lindist=lineardist,
643 644 extradist=extradist, extraratio=extraratio)
644 645
645 646 fm.end()
646 647
647 648 @command('debugdirstate|debugstate',
648 649 [('', 'nodates', None, _('do not display the saved mtime')),
649 650 ('', 'datesort', None, _('sort by saved mtime'))],
650 651 _('[OPTION]...'))
651 652 def debugstate(ui, repo, **opts):
652 653 """show the contents of the current dirstate"""
653 654
654 655 nodates = opts.get(r'nodates')
655 656 datesort = opts.get(r'datesort')
656 657
657 658 timestr = ""
658 659 if datesort:
659 660 keyfunc = lambda x: (x[1][3], x[0]) # sort by mtime, then by filename
660 661 else:
661 662 keyfunc = None # sort by filename
662 663 for file_, ent in sorted(repo.dirstate._map.iteritems(), key=keyfunc):
663 664 if ent[3] == -1:
664 665 timestr = 'unset '
665 666 elif nodates:
666 667 timestr = 'set '
667 668 else:
668 669 timestr = time.strftime("%Y-%m-%d %H:%M:%S ",
669 670 time.localtime(ent[3]))
670 671 if ent[1] & 0o20000:
671 672 mode = 'lnk'
672 673 else:
673 674 mode = '%3o' % (ent[1] & 0o777 & ~util.umask)
674 675 ui.write("%c %s %10d %s%s\n" % (ent[0], mode, ent[2], timestr, file_))
675 676 for f in repo.dirstate.copies():
676 677 ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
677 678
678 679 @command('debugdiscovery',
679 680 [('', 'old', None, _('use old-style discovery')),
680 681 ('', 'nonheads', None,
681 682 _('use old-style discovery with non-heads included')),
682 683 ] + cmdutil.remoteopts,
683 684 _('[-l REV] [-r REV] [-b BRANCH]... [OTHER]'))
684 685 def debugdiscovery(ui, repo, remoteurl="default", **opts):
685 686 """runs the changeset discovery protocol in isolation"""
686 687 opts = pycompat.byteskwargs(opts)
687 688 remoteurl, branches = hg.parseurl(ui.expandpath(remoteurl),
688 689 opts.get('branch'))
689 690 remote = hg.peer(repo, opts, remoteurl)
690 691 ui.status(_('comparing with %s\n') % util.hidepassword(remoteurl))
691 692
692 693 # make sure tests are repeatable
693 694 random.seed(12323)
694 695
695 696 def doit(localheads, remoteheads, remote=remote):
696 697 if opts.get('old'):
697 698 if localheads:
698 699 raise error.Abort('cannot use localheads with old style '
699 700 'discovery')
700 701 if not util.safehasattr(remote, 'branches'):
701 702 # enable in-client legacy support
702 703 remote = localrepo.locallegacypeer(remote.local())
703 704 common, _in, hds = treediscovery.findcommonincoming(repo, remote,
704 705 force=True)
705 706 common = set(common)
706 707 if not opts.get('nonheads'):
707 708 ui.write(("unpruned common: %s\n") %
708 709 " ".join(sorted(short(n) for n in common)))
709 710 dag = dagutil.revlogdag(repo.changelog)
710 711 all = dag.ancestorset(dag.internalizeall(common))
711 712 common = dag.externalizeall(dag.headsetofconnecteds(all))
712 713 else:
713 714 common, any, hds = setdiscovery.findcommonheads(ui, repo, remote)
714 715 common = set(common)
715 716 rheads = set(hds)
716 717 lheads = set(repo.heads())
717 718 ui.write(("common heads: %s\n") %
718 719 " ".join(sorted(short(n) for n in common)))
719 720 if lheads <= common:
720 721 ui.write(("local is subset\n"))
721 722 elif rheads <= common:
722 723 ui.write(("remote is subset\n"))
723 724
724 725 serverlogs = opts.get('serverlog')
725 726 if serverlogs:
726 727 for filename in serverlogs:
727 728 with open(filename, 'r') as logfile:
728 729 line = logfile.readline()
729 730 while line:
730 731 parts = line.strip().split(';')
731 732 op = parts[1]
732 733 if op == 'cg':
733 734 pass
734 735 elif op == 'cgss':
735 736 doit(parts[2].split(' '), parts[3].split(' '))
736 737 elif op == 'unb':
737 738 doit(parts[3].split(' '), parts[2].split(' '))
738 739 line = logfile.readline()
739 740 else:
740 741 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches,
741 742 opts.get('remote_head'))
742 743 localrevs = opts.get('local_head')
743 744 doit(localrevs, remoterevs)
744 745
745 746 @command('debugextensions', cmdutil.formatteropts, [], norepo=True)
746 747 def debugextensions(ui, **opts):
747 748 '''show information about active extensions'''
748 749 opts = pycompat.byteskwargs(opts)
749 750 exts = extensions.extensions(ui)
750 751 hgver = util.version()
751 752 fm = ui.formatter('debugextensions', opts)
752 753 for extname, extmod in sorted(exts, key=operator.itemgetter(0)):
753 754 isinternal = extensions.ismoduleinternal(extmod)
754 755 extsource = pycompat.fsencode(extmod.__file__)
755 756 if isinternal:
756 757 exttestedwith = [] # never expose magic string to users
757 758 else:
758 759 exttestedwith = getattr(extmod, 'testedwith', '').split()
759 760 extbuglink = getattr(extmod, 'buglink', None)
760 761
761 762 fm.startitem()
762 763
763 764 if ui.quiet or ui.verbose:
764 765 fm.write('name', '%s\n', extname)
765 766 else:
766 767 fm.write('name', '%s', extname)
767 768 if isinternal or hgver in exttestedwith:
768 769 fm.plain('\n')
769 770 elif not exttestedwith:
770 771 fm.plain(_(' (untested!)\n'))
771 772 else:
772 773 lasttestedversion = exttestedwith[-1]
773 774 fm.plain(' (%s!)\n' % lasttestedversion)
774 775
775 776 fm.condwrite(ui.verbose and extsource, 'source',
776 777 _(' location: %s\n'), extsource or "")
777 778
778 779 if ui.verbose:
779 780 fm.plain(_(' bundled: %s\n') % ['no', 'yes'][isinternal])
780 781 fm.data(bundled=isinternal)
781 782
782 783 fm.condwrite(ui.verbose and exttestedwith, 'testedwith',
783 784 _(' tested with: %s\n'),
784 785 fm.formatlist(exttestedwith, name='ver'))
785 786
786 787 fm.condwrite(ui.verbose and extbuglink, 'buglink',
787 788 _(' bug reporting: %s\n'), extbuglink or "")
788 789
789 790 fm.end()
790 791
791 792 @command('debugfileset',
792 793 [('r', 'rev', '', _('apply the filespec on this revision'), _('REV'))],
793 794 _('[-r REV] FILESPEC'))
794 795 def debugfileset(ui, repo, expr, **opts):
795 796 '''parse and apply a fileset specification'''
796 797 ctx = scmutil.revsingle(repo, opts.get(r'rev'), None)
797 798 if ui.verbose:
798 799 tree = fileset.parse(expr)
799 800 ui.note(fileset.prettyformat(tree), "\n")
800 801
801 802 for f in ctx.getfileset(expr):
802 803 ui.write("%s\n" % f)
803 804
804 805 @command('debugfsinfo', [], _('[PATH]'), norepo=True)
805 806 def debugfsinfo(ui, path="."):
806 807 """show information detected about current filesystem"""
807 808 ui.write(('exec: %s\n') % (util.checkexec(path) and 'yes' or 'no'))
808 809 ui.write(('fstype: %s\n') % (util.getfstype(path) or '(unknown)'))
809 810 ui.write(('symlink: %s\n') % (util.checklink(path) and 'yes' or 'no'))
810 811 ui.write(('hardlink: %s\n') % (util.checknlink(path) and 'yes' or 'no'))
811 812 casesensitive = '(unknown)'
812 813 try:
813 814 with tempfile.NamedTemporaryFile(prefix='.debugfsinfo', dir=path) as f:
814 815 casesensitive = util.fscasesensitive(f.name) and 'yes' or 'no'
815 816 except OSError:
816 817 pass
817 818 ui.write(('case-sensitive: %s\n') % casesensitive)
818 819
819 820 @command('debuggetbundle',
820 821 [('H', 'head', [], _('id of head node'), _('ID')),
821 822 ('C', 'common', [], _('id of common node'), _('ID')),
822 823 ('t', 'type', 'bzip2', _('bundle compression type to use'), _('TYPE'))],
823 824 _('REPO FILE [-H|-C ID]...'),
824 825 norepo=True)
825 826 def debuggetbundle(ui, repopath, bundlepath, head=None, common=None, **opts):
826 827 """retrieves a bundle from a repo
827 828
828 829 Every ID must be a full-length hex node id string. Saves the bundle to the
829 830 given file.
830 831 """
831 832 opts = pycompat.byteskwargs(opts)
832 833 repo = hg.peer(ui, opts, repopath)
833 834 if not repo.capable('getbundle'):
834 835 raise error.Abort("getbundle() not supported by target repository")
835 836 args = {}
836 837 if common:
837 838 args[r'common'] = [bin(s) for s in common]
838 839 if head:
839 840 args[r'heads'] = [bin(s) for s in head]
840 841 # TODO: get desired bundlecaps from command line.
841 842 args[r'bundlecaps'] = None
842 843 bundle = repo.getbundle('debug', **args)
843 844
844 845 bundletype = opts.get('type', 'bzip2').lower()
845 846 btypes = {'none': 'HG10UN',
846 847 'bzip2': 'HG10BZ',
847 848 'gzip': 'HG10GZ',
848 849 'bundle2': 'HG20'}
849 850 bundletype = btypes.get(bundletype)
850 851 if bundletype not in bundle2.bundletypes:
851 852 raise error.Abort(_('unknown bundle type specified with --type'))
852 853 bundle2.writebundle(ui, bundle, bundlepath, bundletype)
853 854
854 855 @command('debugignore', [], '[FILE]')
855 856 def debugignore(ui, repo, *files, **opts):
856 857 """display the combined ignore pattern and information about ignored files
857 858
858 859 With no argument display the combined ignore pattern.
859 860
860 861 Given space separated file names, shows if the given file is ignored and
861 862 if so, show the ignore rule (file and line number) that matched it.
862 863 """
863 864 ignore = repo.dirstate._ignore
864 865 if not files:
865 866 # Show all the patterns
866 867 ui.write("%s\n" % repr(ignore))
867 868 else:
868 869 for f in files:
869 870 nf = util.normpath(f)
870 871 ignored = None
871 872 ignoredata = None
872 873 if nf != '.':
873 874 if ignore(nf):
874 875 ignored = nf
875 876 ignoredata = repo.dirstate._ignorefileandline(nf)
876 877 else:
877 878 for p in util.finddirs(nf):
878 879 if ignore(p):
879 880 ignored = p
880 881 ignoredata = repo.dirstate._ignorefileandline(p)
881 882 break
882 883 if ignored:
883 884 if ignored == nf:
884 885 ui.write(_("%s is ignored\n") % f)
885 886 else:
886 887 ui.write(_("%s is ignored because of "
887 888 "containing folder %s\n")
888 889 % (f, ignored))
889 890 ignorefile, lineno, line = ignoredata
890 891 ui.write(_("(ignore rule in %s, line %d: '%s')\n")
891 892 % (ignorefile, lineno, line))
892 893 else:
893 894 ui.write(_("%s is not ignored\n") % f)
894 895
895 896 @command('debugindex', cmdutil.debugrevlogopts +
896 897 [('f', 'format', 0, _('revlog format'), _('FORMAT'))],
897 898 _('[-f FORMAT] -c|-m|FILE'),
898 899 optionalrepo=True)
899 900 def debugindex(ui, repo, file_=None, **opts):
900 901 """dump the contents of an index file"""
901 902 opts = pycompat.byteskwargs(opts)
902 903 r = cmdutil.openrevlog(repo, 'debugindex', file_, opts)
903 904 format = opts.get('format', 0)
904 905 if format not in (0, 1):
905 906 raise error.Abort(_("unknown format %d") % format)
906 907
907 908 generaldelta = r.version & revlog.FLAG_GENERALDELTA
908 909 if generaldelta:
909 910 basehdr = ' delta'
910 911 else:
911 912 basehdr = ' base'
912 913
913 914 if ui.debugflag:
914 915 shortfn = hex
915 916 else:
916 917 shortfn = short
917 918
918 919 # There might not be anything in r, so have a sane default
919 920 idlen = 12
920 921 for i in r:
921 922 idlen = len(shortfn(r.node(i)))
922 923 break
923 924
924 925 if format == 0:
925 926 ui.write((" rev offset length " + basehdr + " linkrev"
926 927 " %s %s p2\n") % ("nodeid".ljust(idlen), "p1".ljust(idlen)))
927 928 elif format == 1:
928 929 ui.write((" rev flag offset length"
929 930 " size " + basehdr + " link p1 p2"
930 931 " %s\n") % "nodeid".rjust(idlen))
931 932
932 933 for i in r:
933 934 node = r.node(i)
934 935 if generaldelta:
935 936 base = r.deltaparent(i)
936 937 else:
937 938 base = r.chainbase(i)
938 939 if format == 0:
939 940 try:
940 941 pp = r.parents(node)
941 942 except Exception:
942 943 pp = [nullid, nullid]
943 944 ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % (
944 945 i, r.start(i), r.length(i), base, r.linkrev(i),
945 946 shortfn(node), shortfn(pp[0]), shortfn(pp[1])))
946 947 elif format == 1:
947 948 pr = r.parentrevs(i)
948 949 ui.write("% 6d %04x % 8d % 8d % 8d % 6d % 6d % 6d % 6d %s\n" % (
949 950 i, r.flags(i), r.start(i), r.length(i), r.rawsize(i),
950 951 base, r.linkrev(i), pr[0], pr[1], shortfn(node)))
951 952
952 953 @command('debugindexdot', cmdutil.debugrevlogopts,
953 954 _('-c|-m|FILE'), optionalrepo=True)
954 955 def debugindexdot(ui, repo, file_=None, **opts):
955 956 """dump an index DAG as a graphviz dot file"""
956 957 opts = pycompat.byteskwargs(opts)
957 958 r = cmdutil.openrevlog(repo, 'debugindexdot', file_, opts)
958 959 ui.write(("digraph G {\n"))
959 960 for i in r:
960 961 node = r.node(i)
961 962 pp = r.parents(node)
962 963 ui.write("\t%d -> %d\n" % (r.rev(pp[0]), i))
963 964 if pp[1] != nullid:
964 965 ui.write("\t%d -> %d\n" % (r.rev(pp[1]), i))
965 966 ui.write("}\n")
966 967
967 968 @command('debuginstall', [] + cmdutil.formatteropts, '', norepo=True)
968 969 def debuginstall(ui, **opts):
969 970 '''test Mercurial installation
970 971
971 972 Returns 0 on success.
972 973 '''
973 974 opts = pycompat.byteskwargs(opts)
974 975
975 976 def writetemp(contents):
976 977 (fd, name) = tempfile.mkstemp(prefix="hg-debuginstall-")
977 978 f = os.fdopen(fd, pycompat.sysstr("wb"))
978 979 f.write(contents)
979 980 f.close()
980 981 return name
981 982
982 983 problems = 0
983 984
984 985 fm = ui.formatter('debuginstall', opts)
985 986 fm.startitem()
986 987
987 988 # encoding
988 989 fm.write('encoding', _("checking encoding (%s)...\n"), encoding.encoding)
989 990 err = None
990 991 try:
991 992 encoding.fromlocal("test")
992 993 except error.Abort as inst:
993 994 err = inst
994 995 problems += 1
995 996 fm.condwrite(err, 'encodingerror', _(" %s\n"
996 997 " (check that your locale is properly set)\n"), err)
997 998
998 999 # Python
999 1000 fm.write('pythonexe', _("checking Python executable (%s)\n"),
1000 1001 pycompat.sysexecutable)
1001 1002 fm.write('pythonver', _("checking Python version (%s)\n"),
1002 1003 ("%d.%d.%d" % sys.version_info[:3]))
1003 1004 fm.write('pythonlib', _("checking Python lib (%s)...\n"),
1004 1005 os.path.dirname(pycompat.fsencode(os.__file__)))
1005 1006
1006 1007 security = set(sslutil.supportedprotocols)
1007 1008 if sslutil.hassni:
1008 1009 security.add('sni')
1009 1010
1010 1011 fm.write('pythonsecurity', _("checking Python security support (%s)\n"),
1011 1012 fm.formatlist(sorted(security), name='protocol',
1012 1013 fmt='%s', sep=','))
1013 1014
1014 1015 # These are warnings, not errors. So don't increment problem count. This
1015 1016 # may change in the future.
1016 1017 if 'tls1.2' not in security:
1017 1018 fm.plain(_(' TLS 1.2 not supported by Python install; '
1018 1019 'network connections lack modern security\n'))
1019 1020 if 'sni' not in security:
1020 1021 fm.plain(_(' SNI not supported by Python install; may have '
1021 1022 'connectivity issues with some servers\n'))
1022 1023
1023 1024 # TODO print CA cert info
1024 1025
1025 1026 # hg version
1026 1027 hgver = util.version()
1027 1028 fm.write('hgver', _("checking Mercurial version (%s)\n"),
1028 1029 hgver.split('+')[0])
1029 1030 fm.write('hgverextra', _("checking Mercurial custom build (%s)\n"),
1030 1031 '+'.join(hgver.split('+')[1:]))
1031 1032
1032 1033 # compiled modules
1033 1034 fm.write('hgmodulepolicy', _("checking module policy (%s)\n"),
1034 1035 policy.policy)
1035 1036 fm.write('hgmodules', _("checking installed modules (%s)...\n"),
1036 1037 os.path.dirname(pycompat.fsencode(__file__)))
1037 1038
1038 1039 if policy.policy in ('c', 'allow'):
1039 1040 err = None
1040 1041 try:
1041 1042 from .cext import (
1042 1043 base85,
1043 1044 bdiff,
1044 1045 mpatch,
1045 1046 osutil,
1046 1047 )
1047 1048 dir(bdiff), dir(mpatch), dir(base85), dir(osutil) # quiet pyflakes
1048 1049 except Exception as inst:
1049 1050 err = inst
1050 1051 problems += 1
1051 1052 fm.condwrite(err, 'extensionserror', " %s\n", err)
1052 1053
1053 1054 compengines = util.compengines._engines.values()
1054 1055 fm.write('compengines', _('checking registered compression engines (%s)\n'),
1055 1056 fm.formatlist(sorted(e.name() for e in compengines),
1056 1057 name='compengine', fmt='%s', sep=', '))
1057 1058 fm.write('compenginesavail', _('checking available compression engines '
1058 1059 '(%s)\n'),
1059 1060 fm.formatlist(sorted(e.name() for e in compengines
1060 1061 if e.available()),
1061 1062 name='compengine', fmt='%s', sep=', '))
1062 1063 wirecompengines = util.compengines.supportedwireengines(util.SERVERROLE)
1063 1064 fm.write('compenginesserver', _('checking available compression engines '
1064 1065 'for wire protocol (%s)\n'),
1065 1066 fm.formatlist([e.name() for e in wirecompengines
1066 1067 if e.wireprotosupport()],
1067 1068 name='compengine', fmt='%s', sep=', '))
1068 1069
1069 1070 # templates
1070 1071 p = templater.templatepaths()
1071 1072 fm.write('templatedirs', 'checking templates (%s)...\n', ' '.join(p))
1072 1073 fm.condwrite(not p, '', _(" no template directories found\n"))
1073 1074 if p:
1074 1075 m = templater.templatepath("map-cmdline.default")
1075 1076 if m:
1076 1077 # template found, check if it is working
1077 1078 err = None
1078 1079 try:
1079 1080 templater.templater.frommapfile(m)
1080 1081 except Exception as inst:
1081 1082 err = inst
1082 1083 p = None
1083 1084 fm.condwrite(err, 'defaulttemplateerror', " %s\n", err)
1084 1085 else:
1085 1086 p = None
1086 1087 fm.condwrite(p, 'defaulttemplate',
1087 1088 _("checking default template (%s)\n"), m)
1088 1089 fm.condwrite(not m, 'defaulttemplatenotfound',
1089 1090 _(" template '%s' not found\n"), "default")
1090 1091 if not p:
1091 1092 problems += 1
1092 1093 fm.condwrite(not p, '',
1093 1094 _(" (templates seem to have been installed incorrectly)\n"))
1094 1095
1095 1096 # editor
1096 1097 editor = ui.geteditor()
1097 1098 editor = util.expandpath(editor)
1098 1099 fm.write('editor', _("checking commit editor... (%s)\n"), editor)
1099 1100 cmdpath = util.findexe(pycompat.shlexsplit(editor)[0])
1100 1101 fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound',
1101 1102 _(" No commit editor set and can't find %s in PATH\n"
1102 1103 " (specify a commit editor in your configuration"
1103 1104 " file)\n"), not cmdpath and editor == 'vi' and editor)
1104 1105 fm.condwrite(not cmdpath and editor != 'vi', 'editornotfound',
1105 1106 _(" Can't find editor '%s' in PATH\n"
1106 1107 " (specify a commit editor in your configuration"
1107 1108 " file)\n"), not cmdpath and editor)
1108 1109 if not cmdpath and editor != 'vi':
1109 1110 problems += 1
1110 1111
1111 1112 # check username
1112 1113 username = None
1113 1114 err = None
1114 1115 try:
1115 1116 username = ui.username()
1116 1117 except error.Abort as e:
1117 1118 err = e
1118 1119 problems += 1
1119 1120
1120 1121 fm.condwrite(username, 'username', _("checking username (%s)\n"), username)
1121 1122 fm.condwrite(err, 'usernameerror', _("checking username...\n %s\n"
1122 1123 " (specify a username in your configuration file)\n"), err)
1123 1124
1124 1125 fm.condwrite(not problems, '',
1125 1126 _("no problems detected\n"))
1126 1127 if not problems:
1127 1128 fm.data(problems=problems)
1128 1129 fm.condwrite(problems, 'problems',
1129 1130 _("%d problems detected,"
1130 1131 " please check your install!\n"), problems)
1131 1132 fm.end()
1132 1133
1133 1134 return problems
1134 1135
1135 1136 @command('debugknown', [], _('REPO ID...'), norepo=True)
1136 1137 def debugknown(ui, repopath, *ids, **opts):
1137 1138 """test whether node ids are known to a repo
1138 1139
1139 1140 Every ID must be a full-length hex node id string. Returns a list of 0s
1140 1141 and 1s indicating unknown/known.
1141 1142 """
1142 1143 opts = pycompat.byteskwargs(opts)
1143 1144 repo = hg.peer(ui, opts, repopath)
1144 1145 if not repo.capable('known'):
1145 1146 raise error.Abort("known() not supported by target repository")
1146 1147 flags = repo.known([bin(s) for s in ids])
1147 1148 ui.write("%s\n" % ("".join([f and "1" or "0" for f in flags])))
1148 1149
1149 1150 @command('debuglabelcomplete', [], _('LABEL...'))
1150 1151 def debuglabelcomplete(ui, repo, *args):
1151 1152 '''backwards compatibility with old bash completion scripts (DEPRECATED)'''
1152 1153 debugnamecomplete(ui, repo, *args)
1153 1154
1154 1155 @command('debuglocks',
1155 1156 [('L', 'force-lock', None, _('free the store lock (DANGEROUS)')),
1156 1157 ('W', 'force-wlock', None,
1157 1158 _('free the working state lock (DANGEROUS)'))],
1158 1159 _('[OPTION]...'))
1159 1160 def debuglocks(ui, repo, **opts):
1160 1161 """show or modify state of locks
1161 1162
1162 1163 By default, this command will show which locks are held. This
1163 1164 includes the user and process holding the lock, the amount of time
1164 1165 the lock has been held, and the machine name where the process is
1165 1166 running if it's not local.
1166 1167
1167 1168 Locks protect the integrity of Mercurial's data, so should be
1168 1169 treated with care. System crashes or other interruptions may cause
1169 1170 locks to not be properly released, though Mercurial will usually
1170 1171 detect and remove such stale locks automatically.
1171 1172
1172 1173 However, detecting stale locks may not always be possible (for
1173 1174 instance, on a shared filesystem). Removing locks may also be
1174 1175 blocked by filesystem permissions.
1175 1176
1176 1177 Returns 0 if no locks are held.
1177 1178
1178 1179 """
1179 1180
1180 1181 if opts.get(r'force_lock'):
1181 1182 repo.svfs.unlink('lock')
1182 1183 if opts.get(r'force_wlock'):
1183 1184 repo.vfs.unlink('wlock')
1184 1185 if opts.get(r'force_lock') or opts.get(r'force_lock'):
1185 1186 return 0
1186 1187
1187 1188 now = time.time()
1188 1189 held = 0
1189 1190
1190 1191 def report(vfs, name, method):
1191 1192 # this causes stale locks to get reaped for more accurate reporting
1192 1193 try:
1193 1194 l = method(False)
1194 1195 except error.LockHeld:
1195 1196 l = None
1196 1197
1197 1198 if l:
1198 1199 l.release()
1199 1200 else:
1200 1201 try:
1201 1202 stat = vfs.lstat(name)
1202 1203 age = now - stat.st_mtime
1203 1204 user = util.username(stat.st_uid)
1204 1205 locker = vfs.readlock(name)
1205 1206 if ":" in locker:
1206 1207 host, pid = locker.split(':')
1207 1208 if host == socket.gethostname():
1208 1209 locker = 'user %s, process %s' % (user, pid)
1209 1210 else:
1210 1211 locker = 'user %s, process %s, host %s' \
1211 1212 % (user, pid, host)
1212 1213 ui.write(("%-6s %s (%ds)\n") % (name + ":", locker, age))
1213 1214 return 1
1214 1215 except OSError as e:
1215 1216 if e.errno != errno.ENOENT:
1216 1217 raise
1217 1218
1218 1219 ui.write(("%-6s free\n") % (name + ":"))
1219 1220 return 0
1220 1221
1221 1222 held += report(repo.svfs, "lock", repo.lock)
1222 1223 held += report(repo.vfs, "wlock", repo.wlock)
1223 1224
1224 1225 return held
1225 1226
1226 1227 @command('debugmergestate', [], '')
1227 1228 def debugmergestate(ui, repo, *args):
1228 1229 """print merge state
1229 1230
1230 1231 Use --verbose to print out information about whether v1 or v2 merge state
1231 1232 was chosen."""
1232 1233 def _hashornull(h):
1233 1234 if h == nullhex:
1234 1235 return 'null'
1235 1236 else:
1236 1237 return h
1237 1238
1238 1239 def printrecords(version):
1239 1240 ui.write(('* version %s records\n') % version)
1240 1241 if version == 1:
1241 1242 records = v1records
1242 1243 else:
1243 1244 records = v2records
1244 1245
1245 1246 for rtype, record in records:
1246 1247 # pretty print some record types
1247 1248 if rtype == 'L':
1248 1249 ui.write(('local: %s\n') % record)
1249 1250 elif rtype == 'O':
1250 1251 ui.write(('other: %s\n') % record)
1251 1252 elif rtype == 'm':
1252 1253 driver, mdstate = record.split('\0', 1)
1253 1254 ui.write(('merge driver: %s (state "%s")\n')
1254 1255 % (driver, mdstate))
1255 1256 elif rtype in 'FDC':
1256 1257 r = record.split('\0')
1257 1258 f, state, hash, lfile, afile, anode, ofile = r[0:7]
1258 1259 if version == 1:
1259 1260 onode = 'not stored in v1 format'
1260 1261 flags = r[7]
1261 1262 else:
1262 1263 onode, flags = r[7:9]
1263 1264 ui.write(('file: %s (record type "%s", state "%s", hash %s)\n')
1264 1265 % (f, rtype, state, _hashornull(hash)))
1265 1266 ui.write((' local path: %s (flags "%s")\n') % (lfile, flags))
1266 1267 ui.write((' ancestor path: %s (node %s)\n')
1267 1268 % (afile, _hashornull(anode)))
1268 1269 ui.write((' other path: %s (node %s)\n')
1269 1270 % (ofile, _hashornull(onode)))
1270 1271 elif rtype == 'f':
1271 1272 filename, rawextras = record.split('\0', 1)
1272 1273 extras = rawextras.split('\0')
1273 1274 i = 0
1274 1275 extrastrings = []
1275 1276 while i < len(extras):
1276 1277 extrastrings.append('%s = %s' % (extras[i], extras[i + 1]))
1277 1278 i += 2
1278 1279
1279 1280 ui.write(('file extras: %s (%s)\n')
1280 1281 % (filename, ', '.join(extrastrings)))
1281 1282 elif rtype == 'l':
1282 1283 labels = record.split('\0', 2)
1283 1284 labels = [l for l in labels if len(l) > 0]
1284 1285 ui.write(('labels:\n'))
1285 1286 ui.write((' local: %s\n' % labels[0]))
1286 1287 ui.write((' other: %s\n' % labels[1]))
1287 1288 if len(labels) > 2:
1288 1289 ui.write((' base: %s\n' % labels[2]))
1289 1290 else:
1290 1291 ui.write(('unrecognized entry: %s\t%s\n')
1291 1292 % (rtype, record.replace('\0', '\t')))
1292 1293
1293 1294 # Avoid mergestate.read() since it may raise an exception for unsupported
1294 1295 # merge state records. We shouldn't be doing this, but this is OK since this
1295 1296 # command is pretty low-level.
1296 1297 ms = mergemod.mergestate(repo)
1297 1298
1298 1299 # sort so that reasonable information is on top
1299 1300 v1records = ms._readrecordsv1()
1300 1301 v2records = ms._readrecordsv2()
1301 1302 order = 'LOml'
1302 1303 def key(r):
1303 1304 idx = order.find(r[0])
1304 1305 if idx == -1:
1305 1306 return (1, r[1])
1306 1307 else:
1307 1308 return (0, idx)
1308 1309 v1records.sort(key=key)
1309 1310 v2records.sort(key=key)
1310 1311
1311 1312 if not v1records and not v2records:
1312 1313 ui.write(('no merge state found\n'))
1313 1314 elif not v2records:
1314 1315 ui.note(('no version 2 merge state\n'))
1315 1316 printrecords(1)
1316 1317 elif ms._v1v2match(v1records, v2records):
1317 1318 ui.note(('v1 and v2 states match: using v2\n'))
1318 1319 printrecords(2)
1319 1320 else:
1320 1321 ui.note(('v1 and v2 states mismatch: using v1\n'))
1321 1322 printrecords(1)
1322 1323 if ui.verbose:
1323 1324 printrecords(2)
1324 1325
1325 1326 @command('debugnamecomplete', [], _('NAME...'))
1326 1327 def debugnamecomplete(ui, repo, *args):
1327 1328 '''complete "names" - tags, open branch names, bookmark names'''
1328 1329
1329 1330 names = set()
1330 1331 # since we previously only listed open branches, we will handle that
1331 1332 # specially (after this for loop)
1332 1333 for name, ns in repo.names.iteritems():
1333 1334 if name != 'branches':
1334 1335 names.update(ns.listnames(repo))
1335 1336 names.update(tag for (tag, heads, tip, closed)
1336 1337 in repo.branchmap().iterbranches() if not closed)
1337 1338 completions = set()
1338 1339 if not args:
1339 1340 args = ['']
1340 1341 for a in args:
1341 1342 completions.update(n for n in names if n.startswith(a))
1342 1343 ui.write('\n'.join(sorted(completions)))
1343 1344 ui.write('\n')
1344 1345
1345 1346 @command('debugobsolete',
1346 1347 [('', 'flags', 0, _('markers flag')),
1347 1348 ('', 'record-parents', False,
1348 1349 _('record parent information for the precursor')),
1349 1350 ('r', 'rev', [], _('display markers relevant to REV')),
1350 1351 ('', 'exclusive', False, _('restrict display to markers only '
1351 1352 'relevant to REV')),
1352 1353 ('', 'index', False, _('display index of the marker')),
1353 1354 ('', 'delete', [], _('delete markers specified by indices')),
1354 1355 ] + cmdutil.commitopts2 + cmdutil.formatteropts,
1355 1356 _('[OBSOLETED [REPLACEMENT ...]]'))
1356 1357 def debugobsolete(ui, repo, precursor=None, *successors, **opts):
1357 1358 """create arbitrary obsolete marker
1358 1359
1359 1360 With no arguments, displays the list of obsolescence markers."""
1360 1361
1361 1362 opts = pycompat.byteskwargs(opts)
1362 1363
1363 1364 def parsenodeid(s):
1364 1365 try:
1365 1366 # We do not use revsingle/revrange functions here to accept
1366 1367 # arbitrary node identifiers, possibly not present in the
1367 1368 # local repository.
1368 1369 n = bin(s)
1369 1370 if len(n) != len(nullid):
1370 1371 raise TypeError()
1371 1372 return n
1372 1373 except TypeError:
1373 1374 raise error.Abort('changeset references must be full hexadecimal '
1374 1375 'node identifiers')
1375 1376
1376 1377 if opts.get('delete'):
1377 1378 indices = []
1378 1379 for v in opts.get('delete'):
1379 1380 try:
1380 1381 indices.append(int(v))
1381 1382 except ValueError:
1382 1383 raise error.Abort(_('invalid index value: %r') % v,
1383 1384 hint=_('use integers for indices'))
1384 1385
1385 1386 if repo.currenttransaction():
1386 1387 raise error.Abort(_('cannot delete obsmarkers in the middle '
1387 1388 'of transaction.'))
1388 1389
1389 1390 with repo.lock():
1390 1391 n = repair.deleteobsmarkers(repo.obsstore, indices)
1391 1392 ui.write(_('deleted %i obsolescence markers\n') % n)
1392 1393
1393 1394 return
1394 1395
1395 1396 if precursor is not None:
1396 1397 if opts['rev']:
1397 1398 raise error.Abort('cannot select revision when creating marker')
1398 1399 metadata = {}
1399 1400 metadata['user'] = opts['user'] or ui.username()
1400 1401 succs = tuple(parsenodeid(succ) for succ in successors)
1401 1402 l = repo.lock()
1402 1403 try:
1403 1404 tr = repo.transaction('debugobsolete')
1404 1405 try:
1405 1406 date = opts.get('date')
1406 1407 if date:
1407 1408 date = util.parsedate(date)
1408 1409 else:
1409 1410 date = None
1410 1411 prec = parsenodeid(precursor)
1411 1412 parents = None
1412 1413 if opts['record_parents']:
1413 1414 if prec not in repo.unfiltered():
1414 1415 raise error.Abort('cannot used --record-parents on '
1415 1416 'unknown changesets')
1416 1417 parents = repo.unfiltered()[prec].parents()
1417 1418 parents = tuple(p.node() for p in parents)
1418 1419 repo.obsstore.create(tr, prec, succs, opts['flags'],
1419 1420 parents=parents, date=date,
1420 1421 metadata=metadata, ui=ui)
1421 1422 tr.close()
1422 1423 except ValueError as exc:
1423 1424 raise error.Abort(_('bad obsmarker input: %s') % exc)
1424 1425 finally:
1425 1426 tr.release()
1426 1427 finally:
1427 1428 l.release()
1428 1429 else:
1429 1430 if opts['rev']:
1430 1431 revs = scmutil.revrange(repo, opts['rev'])
1431 1432 nodes = [repo[r].node() for r in revs]
1432 1433 markers = list(obsutil.getmarkers(repo, nodes=nodes,
1433 1434 exclusive=opts['exclusive']))
1434 1435 markers.sort(key=lambda x: x._data)
1435 1436 else:
1436 1437 markers = obsutil.getmarkers(repo)
1437 1438
1438 1439 markerstoiter = markers
1439 1440 isrelevant = lambda m: True
1440 1441 if opts.get('rev') and opts.get('index'):
1441 1442 markerstoiter = obsutil.getmarkers(repo)
1442 1443 markerset = set(markers)
1443 1444 isrelevant = lambda m: m in markerset
1444 1445
1445 1446 fm = ui.formatter('debugobsolete', opts)
1446 1447 for i, m in enumerate(markerstoiter):
1447 1448 if not isrelevant(m):
1448 1449 # marker can be irrelevant when we're iterating over a set
1449 1450 # of markers (markerstoiter) which is bigger than the set
1450 1451 # of markers we want to display (markers)
1451 1452 # this can happen if both --index and --rev options are
1452 1453 # provided and thus we need to iterate over all of the markers
1453 1454 # to get the correct indices, but only display the ones that
1454 1455 # are relevant to --rev value
1455 1456 continue
1456 1457 fm.startitem()
1457 1458 ind = i if opts.get('index') else None
1458 1459 cmdutil.showmarker(fm, m, index=ind)
1459 1460 fm.end()
1460 1461
1461 1462 @command('debugpathcomplete',
1462 1463 [('f', 'full', None, _('complete an entire path')),
1463 1464 ('n', 'normal', None, _('show only normal files')),
1464 1465 ('a', 'added', None, _('show only added files')),
1465 1466 ('r', 'removed', None, _('show only removed files'))],
1466 1467 _('FILESPEC...'))
1467 1468 def debugpathcomplete(ui, repo, *specs, **opts):
1468 1469 '''complete part or all of a tracked path
1469 1470
1470 1471 This command supports shells that offer path name completion. It
1471 1472 currently completes only files already known to the dirstate.
1472 1473
1473 1474 Completion extends only to the next path segment unless
1474 1475 --full is specified, in which case entire paths are used.'''
1475 1476
1476 1477 def complete(path, acceptable):
1477 1478 dirstate = repo.dirstate
1478 1479 spec = os.path.normpath(os.path.join(pycompat.getcwd(), path))
1479 1480 rootdir = repo.root + pycompat.ossep
1480 1481 if spec != repo.root and not spec.startswith(rootdir):
1481 1482 return [], []
1482 1483 if os.path.isdir(spec):
1483 1484 spec += '/'
1484 1485 spec = spec[len(rootdir):]
1485 1486 fixpaths = pycompat.ossep != '/'
1486 1487 if fixpaths:
1487 1488 spec = spec.replace(pycompat.ossep, '/')
1488 1489 speclen = len(spec)
1489 1490 fullpaths = opts[r'full']
1490 1491 files, dirs = set(), set()
1491 1492 adddir, addfile = dirs.add, files.add
1492 1493 for f, st in dirstate.iteritems():
1493 1494 if f.startswith(spec) and st[0] in acceptable:
1494 1495 if fixpaths:
1495 1496 f = f.replace('/', pycompat.ossep)
1496 1497 if fullpaths:
1497 1498 addfile(f)
1498 1499 continue
1499 1500 s = f.find(pycompat.ossep, speclen)
1500 1501 if s >= 0:
1501 1502 adddir(f[:s])
1502 1503 else:
1503 1504 addfile(f)
1504 1505 return files, dirs
1505 1506
1506 1507 acceptable = ''
1507 1508 if opts[r'normal']:
1508 1509 acceptable += 'nm'
1509 1510 if opts[r'added']:
1510 1511 acceptable += 'a'
1511 1512 if opts[r'removed']:
1512 1513 acceptable += 'r'
1513 1514 cwd = repo.getcwd()
1514 1515 if not specs:
1515 1516 specs = ['.']
1516 1517
1517 1518 files, dirs = set(), set()
1518 1519 for spec in specs:
1519 1520 f, d = complete(spec, acceptable or 'nmar')
1520 1521 files.update(f)
1521 1522 dirs.update(d)
1522 1523 files.update(dirs)
1523 1524 ui.write('\n'.join(repo.pathto(p, cwd) for p in sorted(files)))
1524 1525 ui.write('\n')
1525 1526
1526 1527 @command('debugpickmergetool',
1527 1528 [('r', 'rev', '', _('check for files in this revision'), _('REV')),
1528 1529 ('', 'changedelete', None, _('emulate merging change and delete')),
1529 1530 ] + cmdutil.walkopts + cmdutil.mergetoolopts,
1530 1531 _('[PATTERN]...'),
1531 1532 inferrepo=True)
1532 1533 def debugpickmergetool(ui, repo, *pats, **opts):
1533 1534 """examine which merge tool is chosen for specified file
1534 1535
1535 1536 As described in :hg:`help merge-tools`, Mercurial examines
1536 1537 configurations below in this order to decide which merge tool is
1537 1538 chosen for specified file.
1538 1539
1539 1540 1. ``--tool`` option
1540 1541 2. ``HGMERGE`` environment variable
1541 1542 3. configurations in ``merge-patterns`` section
1542 1543 4. configuration of ``ui.merge``
1543 1544 5. configurations in ``merge-tools`` section
1544 1545 6. ``hgmerge`` tool (for historical reason only)
1545 1546 7. default tool for fallback (``:merge`` or ``:prompt``)
1546 1547
1547 1548 This command writes out examination result in the style below::
1548 1549
1549 1550 FILE = MERGETOOL
1550 1551
1551 1552 By default, all files known in the first parent context of the
1552 1553 working directory are examined. Use file patterns and/or -I/-X
1553 1554 options to limit target files. -r/--rev is also useful to examine
1554 1555 files in another context without actual updating to it.
1555 1556
1556 1557 With --debug, this command shows warning messages while matching
1557 1558 against ``merge-patterns`` and so on, too. It is recommended to
1558 1559 use this option with explicit file patterns and/or -I/-X options,
1559 1560 because this option increases amount of output per file according
1560 1561 to configurations in hgrc.
1561 1562
1562 1563 With -v/--verbose, this command shows configurations below at
1563 1564 first (only if specified).
1564 1565
1565 1566 - ``--tool`` option
1566 1567 - ``HGMERGE`` environment variable
1567 1568 - configuration of ``ui.merge``
1568 1569
1569 1570 If merge tool is chosen before matching against
1570 1571 ``merge-patterns``, this command can't show any helpful
1571 1572 information, even with --debug. In such case, information above is
1572 1573 useful to know why a merge tool is chosen.
1573 1574 """
1574 1575 opts = pycompat.byteskwargs(opts)
1575 1576 overrides = {}
1576 1577 if opts['tool']:
1577 1578 overrides[('ui', 'forcemerge')] = opts['tool']
1578 1579 ui.note(('with --tool %r\n') % (opts['tool']))
1579 1580
1580 1581 with ui.configoverride(overrides, 'debugmergepatterns'):
1581 1582 hgmerge = encoding.environ.get("HGMERGE")
1582 1583 if hgmerge is not None:
1583 1584 ui.note(('with HGMERGE=%r\n') % (hgmerge))
1584 1585 uimerge = ui.config("ui", "merge")
1585 1586 if uimerge:
1586 1587 ui.note(('with ui.merge=%r\n') % (uimerge))
1587 1588
1588 1589 ctx = scmutil.revsingle(repo, opts.get('rev'))
1589 1590 m = scmutil.match(ctx, pats, opts)
1590 1591 changedelete = opts['changedelete']
1591 1592 for path in ctx.walk(m):
1592 1593 fctx = ctx[path]
1593 1594 try:
1594 1595 if not ui.debugflag:
1595 1596 ui.pushbuffer(error=True)
1596 1597 tool, toolpath = filemerge._picktool(repo, ui, path,
1597 1598 fctx.isbinary(),
1598 1599 'l' in fctx.flags(),
1599 1600 changedelete)
1600 1601 finally:
1601 1602 if not ui.debugflag:
1602 1603 ui.popbuffer()
1603 1604 ui.write(('%s = %s\n') % (path, tool))
1604 1605
1605 1606 @command('debugpushkey', [], _('REPO NAMESPACE [KEY OLD NEW]'), norepo=True)
1606 1607 def debugpushkey(ui, repopath, namespace, *keyinfo, **opts):
1607 1608 '''access the pushkey key/value protocol
1608 1609
1609 1610 With two args, list the keys in the given namespace.
1610 1611
1611 1612 With five args, set a key to new if it currently is set to old.
1612 1613 Reports success or failure.
1613 1614 '''
1614 1615
1615 1616 target = hg.peer(ui, {}, repopath)
1616 1617 if keyinfo:
1617 1618 key, old, new = keyinfo
1618 1619 r = target.pushkey(namespace, key, old, new)
1619 1620 ui.status(str(r) + '\n')
1620 1621 return not r
1621 1622 else:
1622 1623 for k, v in sorted(target.listkeys(namespace).iteritems()):
1623 1624 ui.write("%s\t%s\n" % (util.escapestr(k),
1624 1625 util.escapestr(v)))
1625 1626
1626 1627 @command('debugpvec', [], _('A B'))
1627 1628 def debugpvec(ui, repo, a, b=None):
1628 1629 ca = scmutil.revsingle(repo, a)
1629 1630 cb = scmutil.revsingle(repo, b)
1630 1631 pa = pvec.ctxpvec(ca)
1631 1632 pb = pvec.ctxpvec(cb)
1632 1633 if pa == pb:
1633 1634 rel = "="
1634 1635 elif pa > pb:
1635 1636 rel = ">"
1636 1637 elif pa < pb:
1637 1638 rel = "<"
1638 1639 elif pa | pb:
1639 1640 rel = "|"
1640 1641 ui.write(_("a: %s\n") % pa)
1641 1642 ui.write(_("b: %s\n") % pb)
1642 1643 ui.write(_("depth(a): %d depth(b): %d\n") % (pa._depth, pb._depth))
1643 1644 ui.write(_("delta: %d hdist: %d distance: %d relation: %s\n") %
1644 1645 (abs(pa._depth - pb._depth), pvec._hamming(pa._vec, pb._vec),
1645 1646 pa.distance(pb), rel))
1646 1647
1647 1648 @command('debugrebuilddirstate|debugrebuildstate',
1648 1649 [('r', 'rev', '', _('revision to rebuild to'), _('REV')),
1649 1650 ('', 'minimal', None, _('only rebuild files that are inconsistent with '
1650 1651 'the working copy parent')),
1651 1652 ],
1652 1653 _('[-r REV]'))
1653 1654 def debugrebuilddirstate(ui, repo, rev, **opts):
1654 1655 """rebuild the dirstate as it would look like for the given revision
1655 1656
1656 1657 If no revision is specified the first current parent will be used.
1657 1658
1658 1659 The dirstate will be set to the files of the given revision.
1659 1660 The actual working directory content or existing dirstate
1660 1661 information such as adds or removes is not considered.
1661 1662
1662 1663 ``minimal`` will only rebuild the dirstate status for files that claim to be
1663 1664 tracked but are not in the parent manifest, or that exist in the parent
1664 1665 manifest but are not in the dirstate. It will not change adds, removes, or
1665 1666 modified files that are in the working copy parent.
1666 1667
1667 1668 One use of this command is to make the next :hg:`status` invocation
1668 1669 check the actual file content.
1669 1670 """
1670 1671 ctx = scmutil.revsingle(repo, rev)
1671 1672 with repo.wlock():
1672 1673 dirstate = repo.dirstate
1673 1674 changedfiles = None
1674 1675 # See command doc for what minimal does.
1675 1676 if opts.get(r'minimal'):
1676 1677 manifestfiles = set(ctx.manifest().keys())
1677 1678 dirstatefiles = set(dirstate)
1678 1679 manifestonly = manifestfiles - dirstatefiles
1679 1680 dsonly = dirstatefiles - manifestfiles
1680 1681 dsnotadded = set(f for f in dsonly if dirstate[f] != 'a')
1681 1682 changedfiles = manifestonly | dsnotadded
1682 1683
1683 1684 dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles)
1684 1685
1685 1686 @command('debugrebuildfncache', [], '')
1686 1687 def debugrebuildfncache(ui, repo):
1687 1688 """rebuild the fncache file"""
1688 1689 repair.rebuildfncache(ui, repo)
1689 1690
1690 1691 @command('debugrename',
1691 1692 [('r', 'rev', '', _('revision to debug'), _('REV'))],
1692 1693 _('[-r REV] FILE'))
1693 1694 def debugrename(ui, repo, file1, *pats, **opts):
1694 1695 """dump rename information"""
1695 1696
1696 1697 opts = pycompat.byteskwargs(opts)
1697 1698 ctx = scmutil.revsingle(repo, opts.get('rev'))
1698 1699 m = scmutil.match(ctx, (file1,) + pats, opts)
1699 1700 for abs in ctx.walk(m):
1700 1701 fctx = ctx[abs]
1701 1702 o = fctx.filelog().renamed(fctx.filenode())
1702 1703 rel = m.rel(abs)
1703 1704 if o:
1704 1705 ui.write(_("%s renamed from %s:%s\n") % (rel, o[0], hex(o[1])))
1705 1706 else:
1706 1707 ui.write(_("%s not renamed\n") % rel)
1707 1708
1708 1709 @command('debugrevlog', cmdutil.debugrevlogopts +
1709 1710 [('d', 'dump', False, _('dump index data'))],
1710 1711 _('-c|-m|FILE'),
1711 1712 optionalrepo=True)
1712 1713 def debugrevlog(ui, repo, file_=None, **opts):
1713 1714 """show data and statistics about a revlog"""
1714 1715 opts = pycompat.byteskwargs(opts)
1715 1716 r = cmdutil.openrevlog(repo, 'debugrevlog', file_, opts)
1716 1717
1717 1718 if opts.get("dump"):
1718 1719 numrevs = len(r)
1719 1720 ui.write(("# rev p1rev p2rev start end deltastart base p1 p2"
1720 1721 " rawsize totalsize compression heads chainlen\n"))
1721 1722 ts = 0
1722 1723 heads = set()
1723 1724
1724 1725 for rev in xrange(numrevs):
1725 1726 dbase = r.deltaparent(rev)
1726 1727 if dbase == -1:
1727 1728 dbase = rev
1728 1729 cbase = r.chainbase(rev)
1729 1730 clen = r.chainlen(rev)
1730 1731 p1, p2 = r.parentrevs(rev)
1731 1732 rs = r.rawsize(rev)
1732 1733 ts = ts + rs
1733 1734 heads -= set(r.parentrevs(rev))
1734 1735 heads.add(rev)
1735 1736 try:
1736 1737 compression = ts / r.end(rev)
1737 1738 except ZeroDivisionError:
1738 1739 compression = 0
1739 1740 ui.write("%5d %5d %5d %5d %5d %10d %4d %4d %4d %7d %9d "
1740 1741 "%11d %5d %8d\n" %
1741 1742 (rev, p1, p2, r.start(rev), r.end(rev),
1742 1743 r.start(dbase), r.start(cbase),
1743 1744 r.start(p1), r.start(p2),
1744 1745 rs, ts, compression, len(heads), clen))
1745 1746 return 0
1746 1747
1747 1748 v = r.version
1748 1749 format = v & 0xFFFF
1749 1750 flags = []
1750 1751 gdelta = False
1751 1752 if v & revlog.FLAG_INLINE_DATA:
1752 1753 flags.append('inline')
1753 1754 if v & revlog.FLAG_GENERALDELTA:
1754 1755 gdelta = True
1755 1756 flags.append('generaldelta')
1756 1757 if not flags:
1757 1758 flags = ['(none)']
1758 1759
1759 1760 nummerges = 0
1760 1761 numfull = 0
1761 1762 numprev = 0
1762 1763 nump1 = 0
1763 1764 nump2 = 0
1764 1765 numother = 0
1765 1766 nump1prev = 0
1766 1767 nump2prev = 0
1767 1768 chainlengths = []
1768 1769 chainbases = []
1769 1770 chainspans = []
1770 1771
1771 1772 datasize = [None, 0, 0]
1772 1773 fullsize = [None, 0, 0]
1773 1774 deltasize = [None, 0, 0]
1774 1775 chunktypecounts = {}
1775 1776 chunktypesizes = {}
1776 1777
1777 1778 def addsize(size, l):
1778 1779 if l[0] is None or size < l[0]:
1779 1780 l[0] = size
1780 1781 if size > l[1]:
1781 1782 l[1] = size
1782 1783 l[2] += size
1783 1784
1784 1785 numrevs = len(r)
1785 1786 for rev in xrange(numrevs):
1786 1787 p1, p2 = r.parentrevs(rev)
1787 1788 delta = r.deltaparent(rev)
1788 1789 if format > 0:
1789 1790 addsize(r.rawsize(rev), datasize)
1790 1791 if p2 != nullrev:
1791 1792 nummerges += 1
1792 1793 size = r.length(rev)
1793 1794 if delta == nullrev:
1794 1795 chainlengths.append(0)
1795 1796 chainbases.append(r.start(rev))
1796 1797 chainspans.append(size)
1797 1798 numfull += 1
1798 1799 addsize(size, fullsize)
1799 1800 else:
1800 1801 chainlengths.append(chainlengths[delta] + 1)
1801 1802 baseaddr = chainbases[delta]
1802 1803 revaddr = r.start(rev)
1803 1804 chainbases.append(baseaddr)
1804 1805 chainspans.append((revaddr - baseaddr) + size)
1805 1806 addsize(size, deltasize)
1806 1807 if delta == rev - 1:
1807 1808 numprev += 1
1808 1809 if delta == p1:
1809 1810 nump1prev += 1
1810 1811 elif delta == p2:
1811 1812 nump2prev += 1
1812 1813 elif delta == p1:
1813 1814 nump1 += 1
1814 1815 elif delta == p2:
1815 1816 nump2 += 1
1816 1817 elif delta != nullrev:
1817 1818 numother += 1
1818 1819
1819 1820 # Obtain data on the raw chunks in the revlog.
1820 1821 segment = r._getsegmentforrevs(rev, rev)[1]
1821 1822 if segment:
1822 1823 chunktype = bytes(segment[0:1])
1823 1824 else:
1824 1825 chunktype = 'empty'
1825 1826
1826 1827 if chunktype not in chunktypecounts:
1827 1828 chunktypecounts[chunktype] = 0
1828 1829 chunktypesizes[chunktype] = 0
1829 1830
1830 1831 chunktypecounts[chunktype] += 1
1831 1832 chunktypesizes[chunktype] += size
1832 1833
1833 1834 # Adjust size min value for empty cases
1834 1835 for size in (datasize, fullsize, deltasize):
1835 1836 if size[0] is None:
1836 1837 size[0] = 0
1837 1838
1838 1839 numdeltas = numrevs - numfull
1839 1840 numoprev = numprev - nump1prev - nump2prev
1840 1841 totalrawsize = datasize[2]
1841 1842 datasize[2] /= numrevs
1842 1843 fulltotal = fullsize[2]
1843 1844 fullsize[2] /= numfull
1844 1845 deltatotal = deltasize[2]
1845 1846 if numrevs - numfull > 0:
1846 1847 deltasize[2] /= numrevs - numfull
1847 1848 totalsize = fulltotal + deltatotal
1848 1849 avgchainlen = sum(chainlengths) / numrevs
1849 1850 maxchainlen = max(chainlengths)
1850 1851 maxchainspan = max(chainspans)
1851 1852 compratio = 1
1852 1853 if totalsize:
1853 1854 compratio = totalrawsize / totalsize
1854 1855
1855 1856 basedfmtstr = '%%%dd\n'
1856 1857 basepcfmtstr = '%%%dd %s(%%5.2f%%%%)\n'
1857 1858
1858 1859 def dfmtstr(max):
1859 1860 return basedfmtstr % len(str(max))
1860 1861 def pcfmtstr(max, padding=0):
1861 1862 return basepcfmtstr % (len(str(max)), ' ' * padding)
1862 1863
1863 1864 def pcfmt(value, total):
1864 1865 if total:
1865 1866 return (value, 100 * float(value) / total)
1866 1867 else:
1867 1868 return value, 100.0
1868 1869
1869 1870 ui.write(('format : %d\n') % format)
1870 1871 ui.write(('flags : %s\n') % ', '.join(flags))
1871 1872
1872 1873 ui.write('\n')
1873 1874 fmt = pcfmtstr(totalsize)
1874 1875 fmt2 = dfmtstr(totalsize)
1875 1876 ui.write(('revisions : ') + fmt2 % numrevs)
1876 1877 ui.write((' merges : ') + fmt % pcfmt(nummerges, numrevs))
1877 1878 ui.write((' normal : ') + fmt % pcfmt(numrevs - nummerges, numrevs))
1878 1879 ui.write(('revisions : ') + fmt2 % numrevs)
1879 1880 ui.write((' full : ') + fmt % pcfmt(numfull, numrevs))
1880 1881 ui.write((' deltas : ') + fmt % pcfmt(numdeltas, numrevs))
1881 1882 ui.write(('revision size : ') + fmt2 % totalsize)
1882 1883 ui.write((' full : ') + fmt % pcfmt(fulltotal, totalsize))
1883 1884 ui.write((' deltas : ') + fmt % pcfmt(deltatotal, totalsize))
1884 1885
1885 1886 def fmtchunktype(chunktype):
1886 1887 if chunktype == 'empty':
1887 1888 return ' %s : ' % chunktype
1888 1889 elif chunktype in pycompat.bytestr(string.ascii_letters):
1889 1890 return ' 0x%s (%s) : ' % (hex(chunktype), chunktype)
1890 1891 else:
1891 1892 return ' 0x%s : ' % hex(chunktype)
1892 1893
1893 1894 ui.write('\n')
1894 1895 ui.write(('chunks : ') + fmt2 % numrevs)
1895 1896 for chunktype in sorted(chunktypecounts):
1896 1897 ui.write(fmtchunktype(chunktype))
1897 1898 ui.write(fmt % pcfmt(chunktypecounts[chunktype], numrevs))
1898 1899 ui.write(('chunks size : ') + fmt2 % totalsize)
1899 1900 for chunktype in sorted(chunktypecounts):
1900 1901 ui.write(fmtchunktype(chunktype))
1901 1902 ui.write(fmt % pcfmt(chunktypesizes[chunktype], totalsize))
1902 1903
1903 1904 ui.write('\n')
1904 1905 fmt = dfmtstr(max(avgchainlen, maxchainlen, maxchainspan, compratio))
1905 1906 ui.write(('avg chain length : ') + fmt % avgchainlen)
1906 1907 ui.write(('max chain length : ') + fmt % maxchainlen)
1907 1908 ui.write(('max chain reach : ') + fmt % maxchainspan)
1908 1909 ui.write(('compression ratio : ') + fmt % compratio)
1909 1910
1910 1911 if format > 0:
1911 1912 ui.write('\n')
1912 1913 ui.write(('uncompressed data size (min/max/avg) : %d / %d / %d\n')
1913 1914 % tuple(datasize))
1914 1915 ui.write(('full revision size (min/max/avg) : %d / %d / %d\n')
1915 1916 % tuple(fullsize))
1916 1917 ui.write(('delta size (min/max/avg) : %d / %d / %d\n')
1917 1918 % tuple(deltasize))
1918 1919
1919 1920 if numdeltas > 0:
1920 1921 ui.write('\n')
1921 1922 fmt = pcfmtstr(numdeltas)
1922 1923 fmt2 = pcfmtstr(numdeltas, 4)
1923 1924 ui.write(('deltas against prev : ') + fmt % pcfmt(numprev, numdeltas))
1924 1925 if numprev > 0:
1925 1926 ui.write((' where prev = p1 : ') + fmt2 % pcfmt(nump1prev,
1926 1927 numprev))
1927 1928 ui.write((' where prev = p2 : ') + fmt2 % pcfmt(nump2prev,
1928 1929 numprev))
1929 1930 ui.write((' other : ') + fmt2 % pcfmt(numoprev,
1930 1931 numprev))
1931 1932 if gdelta:
1932 1933 ui.write(('deltas against p1 : ')
1933 1934 + fmt % pcfmt(nump1, numdeltas))
1934 1935 ui.write(('deltas against p2 : ')
1935 1936 + fmt % pcfmt(nump2, numdeltas))
1936 1937 ui.write(('deltas against other : ') + fmt % pcfmt(numother,
1937 1938 numdeltas))
1938 1939
1939 1940 @command('debugrevspec',
1940 1941 [('', 'optimize', None,
1941 1942 _('print parsed tree after optimizing (DEPRECATED)')),
1942 1943 ('', 'show-revs', True, _('print list of result revisions (default)')),
1943 1944 ('s', 'show-set', None, _('print internal representation of result set')),
1944 1945 ('p', 'show-stage', [],
1945 1946 _('print parsed tree at the given stage'), _('NAME')),
1946 1947 ('', 'no-optimized', False, _('evaluate tree without optimization')),
1947 1948 ('', 'verify-optimized', False, _('verify optimized result')),
1948 1949 ],
1949 1950 ('REVSPEC'))
1950 1951 def debugrevspec(ui, repo, expr, **opts):
1951 1952 """parse and apply a revision specification
1952 1953
1953 1954 Use -p/--show-stage option to print the parsed tree at the given stages.
1954 1955 Use -p all to print tree at every stage.
1955 1956
1956 1957 Use --no-show-revs option with -s or -p to print only the set
1957 1958 representation or the parsed tree respectively.
1958 1959
1959 1960 Use --verify-optimized to compare the optimized result with the unoptimized
1960 1961 one. Returns 1 if the optimized result differs.
1961 1962 """
1962 1963 opts = pycompat.byteskwargs(opts)
1963 1964 aliases = ui.configitems('revsetalias')
1964 1965 stages = [
1965 1966 ('parsed', lambda tree: tree),
1966 1967 ('expanded', lambda tree: revsetlang.expandaliases(tree, aliases,
1967 1968 ui.warn)),
1968 1969 ('concatenated', revsetlang.foldconcat),
1969 1970 ('analyzed', revsetlang.analyze),
1970 1971 ('optimized', revsetlang.optimize),
1971 1972 ]
1972 1973 if opts['no_optimized']:
1973 1974 stages = stages[:-1]
1974 1975 if opts['verify_optimized'] and opts['no_optimized']:
1975 1976 raise error.Abort(_('cannot use --verify-optimized with '
1976 1977 '--no-optimized'))
1977 1978 stagenames = set(n for n, f in stages)
1978 1979
1979 1980 showalways = set()
1980 1981 showchanged = set()
1981 1982 if ui.verbose and not opts['show_stage']:
1982 1983 # show parsed tree by --verbose (deprecated)
1983 1984 showalways.add('parsed')
1984 1985 showchanged.update(['expanded', 'concatenated'])
1985 1986 if opts['optimize']:
1986 1987 showalways.add('optimized')
1987 1988 if opts['show_stage'] and opts['optimize']:
1988 1989 raise error.Abort(_('cannot use --optimize with --show-stage'))
1989 1990 if opts['show_stage'] == ['all']:
1990 1991 showalways.update(stagenames)
1991 1992 else:
1992 1993 for n in opts['show_stage']:
1993 1994 if n not in stagenames:
1994 1995 raise error.Abort(_('invalid stage name: %s') % n)
1995 1996 showalways.update(opts['show_stage'])
1996 1997
1997 1998 treebystage = {}
1998 1999 printedtree = None
1999 2000 tree = revsetlang.parse(expr, lookup=repo.__contains__)
2000 2001 for n, f in stages:
2001 2002 treebystage[n] = tree = f(tree)
2002 2003 if n in showalways or (n in showchanged and tree != printedtree):
2003 2004 if opts['show_stage'] or n != 'parsed':
2004 2005 ui.write(("* %s:\n") % n)
2005 2006 ui.write(revsetlang.prettyformat(tree), "\n")
2006 2007 printedtree = tree
2007 2008
2008 2009 if opts['verify_optimized']:
2009 2010 arevs = revset.makematcher(treebystage['analyzed'])(repo)
2010 2011 brevs = revset.makematcher(treebystage['optimized'])(repo)
2011 2012 if opts['show_set'] or (opts['show_set'] is None and ui.verbose):
2012 2013 ui.write(("* analyzed set:\n"), smartset.prettyformat(arevs), "\n")
2013 2014 ui.write(("* optimized set:\n"), smartset.prettyformat(brevs), "\n")
2014 2015 arevs = list(arevs)
2015 2016 brevs = list(brevs)
2016 2017 if arevs == brevs:
2017 2018 return 0
2018 2019 ui.write(('--- analyzed\n'), label='diff.file_a')
2019 2020 ui.write(('+++ optimized\n'), label='diff.file_b')
2020 2021 sm = difflib.SequenceMatcher(None, arevs, brevs)
2021 2022 for tag, alo, ahi, blo, bhi in sm.get_opcodes():
2022 2023 if tag in ('delete', 'replace'):
2023 2024 for c in arevs[alo:ahi]:
2024 2025 ui.write('-%s\n' % c, label='diff.deleted')
2025 2026 if tag in ('insert', 'replace'):
2026 2027 for c in brevs[blo:bhi]:
2027 2028 ui.write('+%s\n' % c, label='diff.inserted')
2028 2029 if tag == 'equal':
2029 2030 for c in arevs[alo:ahi]:
2030 2031 ui.write(' %s\n' % c)
2031 2032 return 1
2032 2033
2033 2034 func = revset.makematcher(tree)
2034 2035 revs = func(repo)
2035 2036 if opts['show_set'] or (opts['show_set'] is None and ui.verbose):
2036 2037 ui.write(("* set:\n"), smartset.prettyformat(revs), "\n")
2037 2038 if not opts['show_revs']:
2038 2039 return
2039 2040 for c in revs:
2040 2041 ui.write("%s\n" % c)
2041 2042
2042 2043 @command('debugsetparents', [], _('REV1 [REV2]'))
2043 2044 def debugsetparents(ui, repo, rev1, rev2=None):
2044 2045 """manually set the parents of the current working directory
2045 2046
2046 2047 This is useful for writing repository conversion tools, but should
2047 2048 be used with care. For example, neither the working directory nor the
2048 2049 dirstate is updated, so file status may be incorrect after running this
2049 2050 command.
2050 2051
2051 2052 Returns 0 on success.
2052 2053 """
2053 2054
2054 2055 r1 = scmutil.revsingle(repo, rev1).node()
2055 2056 r2 = scmutil.revsingle(repo, rev2, 'null').node()
2056 2057
2057 2058 with repo.wlock():
2058 2059 repo.setparents(r1, r2)
2059 2060
2061 @command('debugssl', [], '[SOURCE]', optionalrepo=True)
2062 def debugssl(ui, repo, source=None, **opts):
2063 '''test a secure connection to a server
2064
2065 This builds the certificate chain for the server on Windows, installing the
2066 missing intermediates and trusted root via Windows Update if necessary. It
2067 does nothing on other platforms.
2068
2069 If SOURCE is omitted, the 'default' path will be used. If a URL is given,
2070 that server is used. See :hg:`help urls` for more information.
2071
2072 If the update succeeds, retry the original operation. Otherwise, the cause
2073 of the SSL error is likely another issue.
2074 '''
2075 if pycompat.osname != 'nt':
2076 raise error.Abort(_('Certificate chain building is only possible on '
2077 'Windows'))
2078
2079 if not source:
2080 source = "default"
2081 elif not repo:
2082 raise error.Abort(_("there is no Mercurial repository here, and no "
2083 "server specified"))
2084
2085 source, branches = hg.parseurl(ui.expandpath(source))
2086 url = util.url(source)
2087 addr = None
2088
2089 if url.scheme == 'https':
2090 addr = (url.host, url.port or 443)
2091 elif url.scheme == 'ssh':
2092 addr = (url.host, url.port or 22)
2093 else:
2094 raise error.Abort(_("Only https and ssh connections are supported"))
2095
2096 from . import win32
2097
2098 s = ssl.wrap_socket(socket.socket(), ssl_version=ssl.PROTOCOL_TLS,
2099 cert_reqs=ssl.CERT_NONE, ca_certs=None)
2100
2101 try:
2102 s.connect(addr)
2103 cert = s.getpeercert(True)
2104
2105 ui.status(_('Checking the certificate chain for %s.\n') % url.host)
2106
2107 complete = win32.checkcertificatechain(cert, build=False)
2108
2109 if not complete:
2110 ui.status(_('The certificate chain is incomplete. Updating... '))
2111
2112 if not win32.checkcertificatechain(cert):
2113 ui.status(_('Failed.\n'))
2114 else:
2115 ui.status(_('Done.\n'))
2116 else:
2117 ui.status(_('The full certificate chain is available.\n'))
2118 finally:
2119 s.close()
2120
2060 2121 @command('debugsub',
2061 2122 [('r', 'rev', '',
2062 2123 _('revision to check'), _('REV'))],
2063 2124 _('[-r REV] [REV]'))
2064 2125 def debugsub(ui, repo, rev=None):
2065 2126 ctx = scmutil.revsingle(repo, rev, None)
2066 2127 for k, v in sorted(ctx.substate.items()):
2067 2128 ui.write(('path %s\n') % k)
2068 2129 ui.write((' source %s\n') % v[0])
2069 2130 ui.write((' revision %s\n') % v[1])
2070 2131
2071 2132 @command('debugsuccessorssets',
2072 2133 [('', 'closest', False, _('return closest successors sets only'))],
2073 2134 _('[REV]'))
2074 2135 def debugsuccessorssets(ui, repo, *revs, **opts):
2075 2136 """show set of successors for revision
2076 2137
2077 2138 A successors set of changeset A is a consistent group of revisions that
2078 2139 succeed A. It contains non-obsolete changesets only unless closests
2079 2140 successors set is set.
2080 2141
2081 2142 In most cases a changeset A has a single successors set containing a single
2082 2143 successor (changeset A replaced by A').
2083 2144
2084 2145 A changeset that is made obsolete with no successors are called "pruned".
2085 2146 Such changesets have no successors sets at all.
2086 2147
2087 2148 A changeset that has been "split" will have a successors set containing
2088 2149 more than one successor.
2089 2150
2090 2151 A changeset that has been rewritten in multiple different ways is called
2091 2152 "divergent". Such changesets have multiple successor sets (each of which
2092 2153 may also be split, i.e. have multiple successors).
2093 2154
2094 2155 Results are displayed as follows::
2095 2156
2096 2157 <rev1>
2097 2158 <successors-1A>
2098 2159 <rev2>
2099 2160 <successors-2A>
2100 2161 <successors-2B1> <successors-2B2> <successors-2B3>
2101 2162
2102 2163 Here rev2 has two possible (i.e. divergent) successors sets. The first
2103 2164 holds one element, whereas the second holds three (i.e. the changeset has
2104 2165 been split).
2105 2166 """
2106 2167 # passed to successorssets caching computation from one call to another
2107 2168 cache = {}
2108 2169 ctx2str = str
2109 2170 node2str = short
2110 2171 if ui.debug():
2111 2172 def ctx2str(ctx):
2112 2173 return ctx.hex()
2113 2174 node2str = hex
2114 2175 for rev in scmutil.revrange(repo, revs):
2115 2176 ctx = repo[rev]
2116 2177 ui.write('%s\n'% ctx2str(ctx))
2117 2178 for succsset in obsutil.successorssets(repo, ctx.node(),
2118 2179 closest=opts['closest'],
2119 2180 cache=cache):
2120 2181 if succsset:
2121 2182 ui.write(' ')
2122 2183 ui.write(node2str(succsset[0]))
2123 2184 for node in succsset[1:]:
2124 2185 ui.write(' ')
2125 2186 ui.write(node2str(node))
2126 2187 ui.write('\n')
2127 2188
2128 2189 @command('debugtemplate',
2129 2190 [('r', 'rev', [], _('apply template on changesets'), _('REV')),
2130 2191 ('D', 'define', [], _('define template keyword'), _('KEY=VALUE'))],
2131 2192 _('[-r REV]... [-D KEY=VALUE]... TEMPLATE'),
2132 2193 optionalrepo=True)
2133 2194 def debugtemplate(ui, repo, tmpl, **opts):
2134 2195 """parse and apply a template
2135 2196
2136 2197 If -r/--rev is given, the template is processed as a log template and
2137 2198 applied to the given changesets. Otherwise, it is processed as a generic
2138 2199 template.
2139 2200
2140 2201 Use --verbose to print the parsed tree.
2141 2202 """
2142 2203 revs = None
2143 2204 if opts[r'rev']:
2144 2205 if repo is None:
2145 2206 raise error.RepoError(_('there is no Mercurial repository here '
2146 2207 '(.hg not found)'))
2147 2208 revs = scmutil.revrange(repo, opts[r'rev'])
2148 2209
2149 2210 props = {}
2150 2211 for d in opts[r'define']:
2151 2212 try:
2152 2213 k, v = (e.strip() for e in d.split('=', 1))
2153 2214 if not k or k == 'ui':
2154 2215 raise ValueError
2155 2216 props[k] = v
2156 2217 except ValueError:
2157 2218 raise error.Abort(_('malformed keyword definition: %s') % d)
2158 2219
2159 2220 if ui.verbose:
2160 2221 aliases = ui.configitems('templatealias')
2161 2222 tree = templater.parse(tmpl)
2162 2223 ui.note(templater.prettyformat(tree), '\n')
2163 2224 newtree = templater.expandaliases(tree, aliases)
2164 2225 if newtree != tree:
2165 2226 ui.note(("* expanded:\n"), templater.prettyformat(newtree), '\n')
2166 2227
2167 2228 if revs is None:
2168 2229 t = formatter.maketemplater(ui, tmpl)
2169 2230 props['ui'] = ui
2170 2231 ui.write(t.render(props))
2171 2232 else:
2172 2233 displayer = cmdutil.makelogtemplater(ui, repo, tmpl)
2173 2234 for r in revs:
2174 2235 displayer.show(repo[r], **pycompat.strkwargs(props))
2175 2236 displayer.close()
2176 2237
2177 2238 @command('debugupdatecaches', [])
2178 2239 def debugupdatecaches(ui, repo, *pats, **opts):
2179 2240 """warm all known caches in the repository"""
2180 2241 with repo.wlock(), repo.lock():
2181 2242 repo.updatecaches()
2182 2243
2183 2244 @command('debugupgraderepo', [
2184 2245 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
2185 2246 ('', 'run', False, _('performs an upgrade')),
2186 2247 ])
2187 2248 def debugupgraderepo(ui, repo, run=False, optimize=None):
2188 2249 """upgrade a repository to use different features
2189 2250
2190 2251 If no arguments are specified, the repository is evaluated for upgrade
2191 2252 and a list of problems and potential optimizations is printed.
2192 2253
2193 2254 With ``--run``, a repository upgrade is performed. Behavior of the upgrade
2194 2255 can be influenced via additional arguments. More details will be provided
2195 2256 by the command output when run without ``--run``.
2196 2257
2197 2258 During the upgrade, the repository will be locked and no writes will be
2198 2259 allowed.
2199 2260
2200 2261 At the end of the upgrade, the repository may not be readable while new
2201 2262 repository data is swapped in. This window will be as long as it takes to
2202 2263 rename some directories inside the ``.hg`` directory. On most machines, this
2203 2264 should complete almost instantaneously and the chances of a consumer being
2204 2265 unable to access the repository should be low.
2205 2266 """
2206 2267 return upgrade.upgraderepo(ui, repo, run=run, optimize=optimize)
2207 2268
2208 2269 @command('debugwalk', cmdutil.walkopts, _('[OPTION]... [FILE]...'),
2209 2270 inferrepo=True)
2210 2271 def debugwalk(ui, repo, *pats, **opts):
2211 2272 """show how files match on given patterns"""
2212 2273 opts = pycompat.byteskwargs(opts)
2213 2274 m = scmutil.match(repo[None], pats, opts)
2214 2275 ui.write(('matcher: %r\n' % m))
2215 2276 items = list(repo[None].walk(m))
2216 2277 if not items:
2217 2278 return
2218 2279 f = lambda fn: fn
2219 2280 if ui.configbool('ui', 'slash') and pycompat.ossep != '/':
2220 2281 f = lambda fn: util.normpath(fn)
2221 2282 fmt = 'f %%-%ds %%-%ds %%s' % (
2222 2283 max([len(abs) for abs in items]),
2223 2284 max([len(m.rel(abs)) for abs in items]))
2224 2285 for abs in items:
2225 2286 line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '')
2226 2287 ui.write("%s\n" % line.rstrip())
2227 2288
2228 2289 @command('debugwireargs',
2229 2290 [('', 'three', '', 'three'),
2230 2291 ('', 'four', '', 'four'),
2231 2292 ('', 'five', '', 'five'),
2232 2293 ] + cmdutil.remoteopts,
2233 2294 _('REPO [OPTIONS]... [ONE [TWO]]'),
2234 2295 norepo=True)
2235 2296 def debugwireargs(ui, repopath, *vals, **opts):
2236 2297 opts = pycompat.byteskwargs(opts)
2237 2298 repo = hg.peer(ui, opts, repopath)
2238 2299 for opt in cmdutil.remoteopts:
2239 2300 del opts[opt[1]]
2240 2301 args = {}
2241 2302 for k, v in opts.iteritems():
2242 2303 if v:
2243 2304 args[k] = v
2244 2305 # run twice to check that we don't mess up the stream for the next command
2245 2306 res1 = repo.debugwireargs(*vals, **args)
2246 2307 res2 = repo.debugwireargs(*vals, **args)
2247 2308 ui.write("%s\n" % res1)
2248 2309 if res1 != res2:
2249 2310 ui.warn("%s\n" % res2)
@@ -1,381 +1,383 b''
1 1 Show all commands except debug commands
2 2 $ hg debugcomplete
3 3 add
4 4 addremove
5 5 annotate
6 6 archive
7 7 backout
8 8 bisect
9 9 bookmarks
10 10 branch
11 11 branches
12 12 bundle
13 13 cat
14 14 clone
15 15 commit
16 16 config
17 17 copy
18 18 diff
19 19 export
20 20 files
21 21 forget
22 22 graft
23 23 grep
24 24 heads
25 25 help
26 26 identify
27 27 import
28 28 incoming
29 29 init
30 30 locate
31 31 log
32 32 manifest
33 33 merge
34 34 outgoing
35 35 parents
36 36 paths
37 37 phase
38 38 pull
39 39 push
40 40 recover
41 41 remove
42 42 rename
43 43 resolve
44 44 revert
45 45 rollback
46 46 root
47 47 serve
48 48 status
49 49 summary
50 50 tag
51 51 tags
52 52 tip
53 53 unbundle
54 54 update
55 55 verify
56 56 version
57 57
58 58 Show all commands that start with "a"
59 59 $ hg debugcomplete a
60 60 add
61 61 addremove
62 62 annotate
63 63 archive
64 64
65 65 Do not show debug commands if there are other candidates
66 66 $ hg debugcomplete d
67 67 diff
68 68
69 69 Show debug commands if there are no other candidates
70 70 $ hg debugcomplete debug
71 71 debugancestor
72 72 debugapplystreamclonebundle
73 73 debugbuilddag
74 74 debugbundle
75 75 debugcheckstate
76 76 debugcolor
77 77 debugcommands
78 78 debugcomplete
79 79 debugconfig
80 80 debugcreatestreamclonebundle
81 81 debugdag
82 82 debugdata
83 83 debugdate
84 84 debugdeltachain
85 85 debugdirstate
86 86 debugdiscovery
87 87 debugextensions
88 88 debugfileset
89 89 debugfsinfo
90 90 debuggetbundle
91 91 debugignore
92 92 debugindex
93 93 debugindexdot
94 94 debuginstall
95 95 debugknown
96 96 debuglabelcomplete
97 97 debuglocks
98 98 debugmergestate
99 99 debugnamecomplete
100 100 debugobsolete
101 101 debugpathcomplete
102 102 debugpickmergetool
103 103 debugpushkey
104 104 debugpvec
105 105 debugrebuilddirstate
106 106 debugrebuildfncache
107 107 debugrename
108 108 debugrevlog
109 109 debugrevspec
110 110 debugsetparents
111 debugssl
111 112 debugsub
112 113 debugsuccessorssets
113 114 debugtemplate
114 115 debugupdatecaches
115 116 debugupgraderepo
116 117 debugwalk
117 118 debugwireargs
118 119
119 120 Do not show the alias of a debug command if there are other candidates
120 121 (this should hide rawcommit)
121 122 $ hg debugcomplete r
122 123 recover
123 124 remove
124 125 rename
125 126 resolve
126 127 revert
127 128 rollback
128 129 root
129 130 Show the alias of a debug command if there are no other candidates
130 131 $ hg debugcomplete rawc
131 132
132 133
133 134 Show the global options
134 135 $ hg debugcomplete --options | sort
135 136 --color
136 137 --config
137 138 --cwd
138 139 --debug
139 140 --debugger
140 141 --encoding
141 142 --encodingmode
142 143 --help
143 144 --hidden
144 145 --noninteractive
145 146 --pager
146 147 --profile
147 148 --quiet
148 149 --repository
149 150 --time
150 151 --traceback
151 152 --verbose
152 153 --version
153 154 -R
154 155 -h
155 156 -q
156 157 -v
157 158 -y
158 159
159 160 Show the options for the "serve" command
160 161 $ hg debugcomplete --options serve | sort
161 162 --accesslog
162 163 --address
163 164 --certificate
164 165 --cmdserver
165 166 --color
166 167 --config
167 168 --cwd
168 169 --daemon
169 170 --daemon-postexec
170 171 --debug
171 172 --debugger
172 173 --encoding
173 174 --encodingmode
174 175 --errorlog
175 176 --help
176 177 --hidden
177 178 --ipv6
178 179 --name
179 180 --noninteractive
180 181 --pager
181 182 --pid-file
182 183 --port
183 184 --prefix
184 185 --profile
185 186 --quiet
186 187 --repository
187 188 --stdio
188 189 --style
189 190 --subrepos
190 191 --templates
191 192 --time
192 193 --traceback
193 194 --verbose
194 195 --version
195 196 --web-conf
196 197 -6
197 198 -A
198 199 -E
199 200 -R
200 201 -S
201 202 -a
202 203 -d
203 204 -h
204 205 -n
205 206 -p
206 207 -q
207 208 -t
208 209 -v
209 210 -y
210 211
211 212 Show an error if we use --options with an ambiguous abbreviation
212 213 $ hg debugcomplete --options s
213 214 hg: command 's' is ambiguous:
214 215 serve showconfig status summary
215 216 [255]
216 217
217 218 Show all commands + options
218 219 $ hg debugcommands
219 220 add: include, exclude, subrepos, dry-run
220 221 annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, skip, ignore-all-space, ignore-space-change, ignore-blank-lines, include, exclude, template
221 222 clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd, insecure
222 223 commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos
223 224 diff: rev, change, text, git, binary, nodates, noprefix, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, root, include, exclude, subrepos
224 225 export: output, switch-parent, rev, text, git, binary, nodates
225 226 forget: include, exclude
226 227 init: ssh, remotecmd, insecure
227 228 log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, user, only-branch, branch, prune, patch, git, limit, no-merges, stat, graph, style, template, include, exclude
228 229 merge: force, rev, preview, tool
229 230 pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure
230 231 push: force, rev, bookmark, branch, new-branch, ssh, remotecmd, insecure
231 232 remove: after, force, subrepos, include, exclude
232 233 serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, ipv6, certificate, subrepos
233 234 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, copies, print0, rev, change, include, exclude, subrepos, template
234 235 summary: remote
235 236 update: clean, check, merge, date, rev, tool
236 237 addremove: similarity, subrepos, include, exclude, dry-run
237 238 archive: no-decode, prefix, rev, type, subrepos, include, exclude
238 239 backout: merge, commit, no-commit, parent, rev, edit, tool, include, exclude, message, logfile, date, user
239 240 bisect: reset, good, bad, skip, extend, command, noupdate
240 241 bookmarks: force, rev, delete, rename, inactive, template
241 242 branch: force, clean
242 243 branches: active, closed, template
243 244 bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure
244 245 cat: output, rev, decode, include, exclude, template
245 246 config: untrusted, edit, local, global, template
246 247 copy: after, force, include, exclude, dry-run
247 248 debugancestor:
248 249 debugapplystreamclonebundle:
249 250 debugbuilddag: mergeable-file, overwritten-file, new-file
250 251 debugbundle: all, part-type, spec
251 252 debugcheckstate:
252 253 debugcolor: style
253 254 debugcommands:
254 255 debugcomplete: options
255 256 debugcreatestreamclonebundle:
256 257 debugdag: tags, branches, dots, spaces
257 258 debugdata: changelog, manifest, dir
258 259 debugdate: extended
259 260 debugdeltachain: changelog, manifest, dir, template
260 261 debugdirstate: nodates, datesort
261 262 debugdiscovery: old, nonheads, ssh, remotecmd, insecure
262 263 debugextensions: template
263 264 debugfileset: rev
264 265 debugfsinfo:
265 266 debuggetbundle: head, common, type
266 267 debugignore:
267 268 debugindex: changelog, manifest, dir, format
268 269 debugindexdot: changelog, manifest, dir
269 270 debuginstall: template
270 271 debugknown:
271 272 debuglabelcomplete:
272 273 debuglocks: force-lock, force-wlock
273 274 debugmergestate:
274 275 debugnamecomplete:
275 276 debugobsolete: flags, record-parents, rev, exclusive, index, delete, date, user, template
276 277 debugpathcomplete: full, normal, added, removed
277 278 debugpickmergetool: rev, changedelete, include, exclude, tool
278 279 debugpushkey:
279 280 debugpvec:
280 281 debugrebuilddirstate: rev, minimal
281 282 debugrebuildfncache:
282 283 debugrename: rev
283 284 debugrevlog: changelog, manifest, dir, dump
284 285 debugrevspec: optimize, show-revs, show-set, show-stage, no-optimized, verify-optimized
285 286 debugsetparents:
287 debugssl:
286 288 debugsub: rev
287 289 debugsuccessorssets: closest
288 290 debugtemplate: rev, define
289 291 debugupdatecaches:
290 292 debugupgraderepo: optimize, run
291 293 debugwalk: include, exclude
292 294 debugwireargs: three, four, five, ssh, remotecmd, insecure
293 295 files: rev, print0, include, exclude, template, subrepos
294 296 graft: rev, continue, edit, log, force, currentdate, currentuser, date, user, tool, dry-run
295 297 grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, template, include, exclude
296 298 heads: rev, topo, active, closed, style, template
297 299 help: extension, command, keyword, system
298 300 identify: rev, num, id, branch, tags, bookmarks, ssh, remotecmd, insecure, template
299 301 import: strip, base, edit, force, no-commit, bypass, partial, exact, prefix, import-branch, message, logfile, date, user, similarity
300 302 incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
301 303 locate: rev, print0, fullpath, include, exclude
302 304 manifest: rev, all, template
303 305 outgoing: force, rev, newest-first, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
304 306 parents: rev, style, template
305 307 paths: template
306 308 phase: public, draft, secret, force, rev
307 309 recover:
308 310 rename: after, force, include, exclude, dry-run
309 311 resolve: all, list, mark, unmark, no-status, tool, include, exclude, template
310 312 revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
311 313 rollback: dry-run, force
312 314 root:
313 315 tag: force, local, rev, remove, edit, message, date, user
314 316 tags: template
315 317 tip: patch, git, style, template
316 318 unbundle: update
317 319 verify:
318 320 version: template
319 321
320 322 $ hg init a
321 323 $ cd a
322 324 $ echo fee > fee
323 325 $ hg ci -q -Amfee
324 326 $ hg tag fee
325 327 $ mkdir fie
326 328 $ echo dead > fie/dead
327 329 $ echo live > fie/live
328 330 $ hg bookmark fo
329 331 $ hg branch -q fie
330 332 $ hg ci -q -Amfie
331 333 $ echo fo > fo
332 334 $ hg branch -qf default
333 335 $ hg ci -q -Amfo
334 336 $ echo Fum > Fum
335 337 $ hg ci -q -AmFum
336 338 $ hg bookmark Fum
337 339
338 340 Test debugpathcomplete
339 341
340 342 $ hg debugpathcomplete f
341 343 fee
342 344 fie
343 345 fo
344 346 $ hg debugpathcomplete -f f
345 347 fee
346 348 fie/dead
347 349 fie/live
348 350 fo
349 351
350 352 $ hg rm Fum
351 353 $ hg debugpathcomplete -r F
352 354 Fum
353 355
354 356 Test debugnamecomplete
355 357
356 358 $ hg debugnamecomplete
357 359 Fum
358 360 default
359 361 fee
360 362 fie
361 363 fo
362 364 tip
363 365 $ hg debugnamecomplete f
364 366 fee
365 367 fie
366 368 fo
367 369
368 370 Test debuglabelcomplete, a deprecated name for debugnamecomplete that is still
369 371 used for completions in some shells.
370 372
371 373 $ hg debuglabelcomplete
372 374 Fum
373 375 default
374 376 fee
375 377 fie
376 378 fo
377 379 tip
378 380 $ hg debuglabelcomplete f
379 381 fee
380 382 fie
381 383 fo
@@ -1,3366 +1,3367 b''
1 1 Short help:
2 2
3 3 $ hg
4 4 Mercurial Distributed SCM
5 5
6 6 basic commands:
7 7
8 8 add add the specified files on the next commit
9 9 annotate show changeset information by line for each file
10 10 clone make a copy of an existing repository
11 11 commit commit the specified files or all outstanding changes
12 12 diff diff repository (or selected files)
13 13 export dump the header and diffs for one or more changesets
14 14 forget forget the specified files on the next commit
15 15 init create a new repository in the given directory
16 16 log show revision history of entire repository or files
17 17 merge merge another revision into working directory
18 18 pull pull changes from the specified source
19 19 push push changes to the specified destination
20 20 remove remove the specified files on the next commit
21 21 serve start stand-alone webserver
22 22 status show changed files in the working directory
23 23 summary summarize working directory state
24 24 update update working directory (or switch revisions)
25 25
26 26 (use 'hg help' for the full list of commands or 'hg -v' for details)
27 27
28 28 $ hg -q
29 29 add add the specified files on the next commit
30 30 annotate show changeset information by line for each file
31 31 clone make a copy of an existing repository
32 32 commit commit the specified files or all outstanding changes
33 33 diff diff repository (or selected files)
34 34 export dump the header and diffs for one or more changesets
35 35 forget forget the specified files on the next commit
36 36 init create a new repository in the given directory
37 37 log show revision history of entire repository or files
38 38 merge merge another revision into working directory
39 39 pull pull changes from the specified source
40 40 push push changes to the specified destination
41 41 remove remove the specified files on the next commit
42 42 serve start stand-alone webserver
43 43 status show changed files in the working directory
44 44 summary summarize working directory state
45 45 update update working directory (or switch revisions)
46 46
47 47 $ hg help
48 48 Mercurial Distributed SCM
49 49
50 50 list of commands:
51 51
52 52 add add the specified files on the next commit
53 53 addremove add all new files, delete all missing files
54 54 annotate show changeset information by line for each file
55 55 archive create an unversioned archive of a repository revision
56 56 backout reverse effect of earlier changeset
57 57 bisect subdivision search of changesets
58 58 bookmarks create a new bookmark or list existing bookmarks
59 59 branch set or show the current branch name
60 60 branches list repository named branches
61 61 bundle create a bundle file
62 62 cat output the current or given revision of files
63 63 clone make a copy of an existing repository
64 64 commit commit the specified files or all outstanding changes
65 65 config show combined config settings from all hgrc files
66 66 copy mark files as copied for the next commit
67 67 diff diff repository (or selected files)
68 68 export dump the header and diffs for one or more changesets
69 69 files list tracked files
70 70 forget forget the specified files on the next commit
71 71 graft copy changes from other branches onto the current branch
72 72 grep search revision history for a pattern in specified files
73 73 heads show branch heads
74 74 help show help for a given topic or a help overview
75 75 identify identify the working directory or specified revision
76 76 import import an ordered set of patches
77 77 incoming show new changesets found in source
78 78 init create a new repository in the given directory
79 79 log show revision history of entire repository or files
80 80 manifest output the current or given revision of the project manifest
81 81 merge merge another revision into working directory
82 82 outgoing show changesets not found in the destination
83 83 paths show aliases for remote repositories
84 84 phase set or show the current phase name
85 85 pull pull changes from the specified source
86 86 push push changes to the specified destination
87 87 recover roll back an interrupted transaction
88 88 remove remove the specified files on the next commit
89 89 rename rename files; equivalent of copy + remove
90 90 resolve redo merges or set/view the merge status of files
91 91 revert restore files to their checkout state
92 92 root print the root (top) of the current working directory
93 93 serve start stand-alone webserver
94 94 status show changed files in the working directory
95 95 summary summarize working directory state
96 96 tag add one or more tags for the current or given revision
97 97 tags list repository tags
98 98 unbundle apply one or more bundle files
99 99 update update working directory (or switch revisions)
100 100 verify verify the integrity of the repository
101 101 version output version and copyright information
102 102
103 103 additional help topics:
104 104
105 105 bundlespec Bundle File Formats
106 106 color Colorizing Outputs
107 107 config Configuration Files
108 108 dates Date Formats
109 109 diffs Diff Formats
110 110 environment Environment Variables
111 111 extensions Using Additional Features
112 112 filesets Specifying File Sets
113 113 glossary Glossary
114 114 hgignore Syntax for Mercurial Ignore Files
115 115 hgweb Configuring hgweb
116 116 internals Technical implementation topics
117 117 merge-tools Merge Tools
118 118 pager Pager Support
119 119 patterns File Name Patterns
120 120 phases Working with Phases
121 121 revisions Specifying Revisions
122 122 scripting Using Mercurial from scripts and automation
123 123 subrepos Subrepositories
124 124 templating Template Usage
125 125 urls URL Paths
126 126
127 127 (use 'hg help -v' to show built-in aliases and global options)
128 128
129 129 $ hg -q help
130 130 add add the specified files on the next commit
131 131 addremove add all new files, delete all missing files
132 132 annotate show changeset information by line for each file
133 133 archive create an unversioned archive of a repository revision
134 134 backout reverse effect of earlier changeset
135 135 bisect subdivision search of changesets
136 136 bookmarks create a new bookmark or list existing bookmarks
137 137 branch set or show the current branch name
138 138 branches list repository named branches
139 139 bundle create a bundle file
140 140 cat output the current or given revision of files
141 141 clone make a copy of an existing repository
142 142 commit commit the specified files or all outstanding changes
143 143 config show combined config settings from all hgrc files
144 144 copy mark files as copied for the next commit
145 145 diff diff repository (or selected files)
146 146 export dump the header and diffs for one or more changesets
147 147 files list tracked files
148 148 forget forget the specified files on the next commit
149 149 graft copy changes from other branches onto the current branch
150 150 grep search revision history for a pattern in specified files
151 151 heads show branch heads
152 152 help show help for a given topic or a help overview
153 153 identify identify the working directory or specified revision
154 154 import import an ordered set of patches
155 155 incoming show new changesets found in source
156 156 init create a new repository in the given directory
157 157 log show revision history of entire repository or files
158 158 manifest output the current or given revision of the project manifest
159 159 merge merge another revision into working directory
160 160 outgoing show changesets not found in the destination
161 161 paths show aliases for remote repositories
162 162 phase set or show the current phase name
163 163 pull pull changes from the specified source
164 164 push push changes to the specified destination
165 165 recover roll back an interrupted transaction
166 166 remove remove the specified files on the next commit
167 167 rename rename files; equivalent of copy + remove
168 168 resolve redo merges or set/view the merge status of files
169 169 revert restore files to their checkout state
170 170 root print the root (top) of the current working directory
171 171 serve start stand-alone webserver
172 172 status show changed files in the working directory
173 173 summary summarize working directory state
174 174 tag add one or more tags for the current or given revision
175 175 tags list repository tags
176 176 unbundle apply one or more bundle files
177 177 update update working directory (or switch revisions)
178 178 verify verify the integrity of the repository
179 179 version output version and copyright information
180 180
181 181 additional help topics:
182 182
183 183 bundlespec Bundle File Formats
184 184 color Colorizing Outputs
185 185 config Configuration Files
186 186 dates Date Formats
187 187 diffs Diff Formats
188 188 environment Environment Variables
189 189 extensions Using Additional Features
190 190 filesets Specifying File Sets
191 191 glossary Glossary
192 192 hgignore Syntax for Mercurial Ignore Files
193 193 hgweb Configuring hgweb
194 194 internals Technical implementation topics
195 195 merge-tools Merge Tools
196 196 pager Pager Support
197 197 patterns File Name Patterns
198 198 phases Working with Phases
199 199 revisions Specifying Revisions
200 200 scripting Using Mercurial from scripts and automation
201 201 subrepos Subrepositories
202 202 templating Template Usage
203 203 urls URL Paths
204 204
205 205 Test extension help:
206 206 $ hg help extensions --config extensions.rebase= --config extensions.children=
207 207 Using Additional Features
208 208 """""""""""""""""""""""""
209 209
210 210 Mercurial has the ability to add new features through the use of
211 211 extensions. Extensions may add new commands, add options to existing
212 212 commands, change the default behavior of commands, or implement hooks.
213 213
214 214 To enable the "foo" extension, either shipped with Mercurial or in the
215 215 Python search path, create an entry for it in your configuration file,
216 216 like this:
217 217
218 218 [extensions]
219 219 foo =
220 220
221 221 You may also specify the full path to an extension:
222 222
223 223 [extensions]
224 224 myfeature = ~/.hgext/myfeature.py
225 225
226 226 See 'hg help config' for more information on configuration files.
227 227
228 228 Extensions are not loaded by default for a variety of reasons: they can
229 229 increase startup overhead; they may be meant for advanced usage only; they
230 230 may provide potentially dangerous abilities (such as letting you destroy
231 231 or modify history); they might not be ready for prime time; or they may
232 232 alter some usual behaviors of stock Mercurial. It is thus up to the user
233 233 to activate extensions as needed.
234 234
235 235 To explicitly disable an extension enabled in a configuration file of
236 236 broader scope, prepend its path with !:
237 237
238 238 [extensions]
239 239 # disabling extension bar residing in /path/to/extension/bar.py
240 240 bar = !/path/to/extension/bar.py
241 241 # ditto, but no path was supplied for extension baz
242 242 baz = !
243 243
244 244 enabled extensions:
245 245
246 246 children command to display child changesets (DEPRECATED)
247 247 rebase command to move sets of revisions to a different ancestor
248 248
249 249 disabled extensions:
250 250
251 251 acl hooks for controlling repository access
252 252 blackbox log repository events to a blackbox for debugging
253 253 bugzilla hooks for integrating with the Bugzilla bug tracker
254 254 censor erase file content at a given revision
255 255 churn command to display statistics about repository history
256 256 clonebundles advertise pre-generated bundles to seed clones
257 257 convert import revisions from foreign VCS repositories into
258 258 Mercurial
259 259 eol automatically manage newlines in repository files
260 260 extdiff command to allow external programs to compare revisions
261 261 factotum http authentication with factotum
262 262 gpg commands to sign and verify changesets
263 263 hgk browse the repository in a graphical way
264 264 highlight syntax highlighting for hgweb (requires Pygments)
265 265 histedit interactive history editing
266 266 keyword expand keywords in tracked files
267 267 largefiles track large binary files
268 268 mq manage a stack of patches
269 269 notify hooks for sending email push notifications
270 270 patchbomb command to send changesets as (a series of) patch emails
271 271 purge command to delete untracked files from the working
272 272 directory
273 273 relink recreates hardlinks between repository clones
274 274 schemes extend schemes with shortcuts to repository swarms
275 275 share share a common history between several working directories
276 276 shelve save and restore changes to the working directory
277 277 strip strip changesets and their descendants from history
278 278 transplant command to transplant changesets from another branch
279 279 win32mbcs allow the use of MBCS paths with problematic encodings
280 280 zeroconf discover and advertise repositories on the local network
281 281
282 282 Verify that extension keywords appear in help templates
283 283
284 284 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
285 285
286 286 Test short command list with verbose option
287 287
288 288 $ hg -v help shortlist
289 289 Mercurial Distributed SCM
290 290
291 291 basic commands:
292 292
293 293 add add the specified files on the next commit
294 294 annotate, blame
295 295 show changeset information by line for each file
296 296 clone make a copy of an existing repository
297 297 commit, ci commit the specified files or all outstanding changes
298 298 diff diff repository (or selected files)
299 299 export dump the header and diffs for one or more changesets
300 300 forget forget the specified files on the next commit
301 301 init create a new repository in the given directory
302 302 log, history show revision history of entire repository or files
303 303 merge merge another revision into working directory
304 304 pull pull changes from the specified source
305 305 push push changes to the specified destination
306 306 remove, rm remove the specified files on the next commit
307 307 serve start stand-alone webserver
308 308 status, st show changed files in the working directory
309 309 summary, sum summarize working directory state
310 310 update, up, checkout, co
311 311 update working directory (or switch revisions)
312 312
313 313 global options ([+] can be repeated):
314 314
315 315 -R --repository REPO repository root directory or name of overlay bundle
316 316 file
317 317 --cwd DIR change working directory
318 318 -y --noninteractive do not prompt, automatically pick the first choice for
319 319 all prompts
320 320 -q --quiet suppress output
321 321 -v --verbose enable additional output
322 322 --color TYPE when to colorize (boolean, always, auto, never, or
323 323 debug)
324 324 --config CONFIG [+] set/override config option (use 'section.name=value')
325 325 --debug enable debugging output
326 326 --debugger start debugger
327 327 --encoding ENCODE set the charset encoding (default: ascii)
328 328 --encodingmode MODE set the charset encoding mode (default: strict)
329 329 --traceback always print a traceback on exception
330 330 --time time how long the command takes
331 331 --profile print command execution profile
332 332 --version output version information and exit
333 333 -h --help display help and exit
334 334 --hidden consider hidden changesets
335 335 --pager TYPE when to paginate (boolean, always, auto, or never)
336 336 (default: auto)
337 337
338 338 (use 'hg help' for the full list of commands)
339 339
340 340 $ hg add -h
341 341 hg add [OPTION]... [FILE]...
342 342
343 343 add the specified files on the next commit
344 344
345 345 Schedule files to be version controlled and added to the repository.
346 346
347 347 The files will be added to the repository at the next commit. To undo an
348 348 add before that, see 'hg forget'.
349 349
350 350 If no names are given, add all files to the repository (except files
351 351 matching ".hgignore").
352 352
353 353 Returns 0 if all files are successfully added.
354 354
355 355 options ([+] can be repeated):
356 356
357 357 -I --include PATTERN [+] include names matching the given patterns
358 358 -X --exclude PATTERN [+] exclude names matching the given patterns
359 359 -S --subrepos recurse into subrepositories
360 360 -n --dry-run do not perform actions, just print output
361 361
362 362 (some details hidden, use --verbose to show complete help)
363 363
364 364 Verbose help for add
365 365
366 366 $ hg add -hv
367 367 hg add [OPTION]... [FILE]...
368 368
369 369 add the specified files on the next commit
370 370
371 371 Schedule files to be version controlled and added to the repository.
372 372
373 373 The files will be added to the repository at the next commit. To undo an
374 374 add before that, see 'hg forget'.
375 375
376 376 If no names are given, add all files to the repository (except files
377 377 matching ".hgignore").
378 378
379 379 Examples:
380 380
381 381 - New (unknown) files are added automatically by 'hg add':
382 382
383 383 $ ls
384 384 foo.c
385 385 $ hg status
386 386 ? foo.c
387 387 $ hg add
388 388 adding foo.c
389 389 $ hg status
390 390 A foo.c
391 391
392 392 - Specific files to be added can be specified:
393 393
394 394 $ ls
395 395 bar.c foo.c
396 396 $ hg status
397 397 ? bar.c
398 398 ? foo.c
399 399 $ hg add bar.c
400 400 $ hg status
401 401 A bar.c
402 402 ? foo.c
403 403
404 404 Returns 0 if all files are successfully added.
405 405
406 406 options ([+] can be repeated):
407 407
408 408 -I --include PATTERN [+] include names matching the given patterns
409 409 -X --exclude PATTERN [+] exclude names matching the given patterns
410 410 -S --subrepos recurse into subrepositories
411 411 -n --dry-run do not perform actions, just print output
412 412
413 413 global options ([+] can be repeated):
414 414
415 415 -R --repository REPO repository root directory or name of overlay bundle
416 416 file
417 417 --cwd DIR change working directory
418 418 -y --noninteractive do not prompt, automatically pick the first choice for
419 419 all prompts
420 420 -q --quiet suppress output
421 421 -v --verbose enable additional output
422 422 --color TYPE when to colorize (boolean, always, auto, never, or
423 423 debug)
424 424 --config CONFIG [+] set/override config option (use 'section.name=value')
425 425 --debug enable debugging output
426 426 --debugger start debugger
427 427 --encoding ENCODE set the charset encoding (default: ascii)
428 428 --encodingmode MODE set the charset encoding mode (default: strict)
429 429 --traceback always print a traceback on exception
430 430 --time time how long the command takes
431 431 --profile print command execution profile
432 432 --version output version information and exit
433 433 -h --help display help and exit
434 434 --hidden consider hidden changesets
435 435 --pager TYPE when to paginate (boolean, always, auto, or never)
436 436 (default: auto)
437 437
438 438 Test the textwidth config option
439 439
440 440 $ hg root -h --config ui.textwidth=50
441 441 hg root
442 442
443 443 print the root (top) of the current working
444 444 directory
445 445
446 446 Print the root directory of the current
447 447 repository.
448 448
449 449 Returns 0 on success.
450 450
451 451 (some details hidden, use --verbose to show
452 452 complete help)
453 453
454 454 Test help option with version option
455 455
456 456 $ hg add -h --version
457 457 Mercurial Distributed SCM (version *) (glob)
458 458 (see https://mercurial-scm.org for more information)
459 459
460 460 Copyright (C) 2005-* Matt Mackall and others (glob)
461 461 This is free software; see the source for copying conditions. There is NO
462 462 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
463 463
464 464 $ hg add --skjdfks
465 465 hg add: option --skjdfks not recognized
466 466 hg add [OPTION]... [FILE]...
467 467
468 468 add the specified files on the next commit
469 469
470 470 options ([+] can be repeated):
471 471
472 472 -I --include PATTERN [+] include names matching the given patterns
473 473 -X --exclude PATTERN [+] exclude names matching the given patterns
474 474 -S --subrepos recurse into subrepositories
475 475 -n --dry-run do not perform actions, just print output
476 476
477 477 (use 'hg add -h' to show more help)
478 478 [255]
479 479
480 480 Test ambiguous command help
481 481
482 482 $ hg help ad
483 483 list of commands:
484 484
485 485 add add the specified files on the next commit
486 486 addremove add all new files, delete all missing files
487 487
488 488 (use 'hg help -v ad' to show built-in aliases and global options)
489 489
490 490 Test command without options
491 491
492 492 $ hg help verify
493 493 hg verify
494 494
495 495 verify the integrity of the repository
496 496
497 497 Verify the integrity of the current repository.
498 498
499 499 This will perform an extensive check of the repository's integrity,
500 500 validating the hashes and checksums of each entry in the changelog,
501 501 manifest, and tracked files, as well as the integrity of their crosslinks
502 502 and indices.
503 503
504 504 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
505 505 information about recovery from corruption of the repository.
506 506
507 507 Returns 0 on success, 1 if errors are encountered.
508 508
509 509 (some details hidden, use --verbose to show complete help)
510 510
511 511 $ hg help diff
512 512 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
513 513
514 514 diff repository (or selected files)
515 515
516 516 Show differences between revisions for the specified files.
517 517
518 518 Differences between files are shown using the unified diff format.
519 519
520 520 Note:
521 521 'hg diff' may generate unexpected results for merges, as it will
522 522 default to comparing against the working directory's first parent
523 523 changeset if no revisions are specified.
524 524
525 525 When two revision arguments are given, then changes are shown between
526 526 those revisions. If only one revision is specified then that revision is
527 527 compared to the working directory, and, when no revisions are specified,
528 528 the working directory files are compared to its first parent.
529 529
530 530 Alternatively you can specify -c/--change with a revision to see the
531 531 changes in that changeset relative to its first parent.
532 532
533 533 Without the -a/--text option, diff will avoid generating diffs of files it
534 534 detects as binary. With -a, diff will generate a diff anyway, probably
535 535 with undesirable results.
536 536
537 537 Use the -g/--git option to generate diffs in the git extended diff format.
538 538 For more information, read 'hg help diffs'.
539 539
540 540 Returns 0 on success.
541 541
542 542 options ([+] can be repeated):
543 543
544 544 -r --rev REV [+] revision
545 545 -c --change REV change made by revision
546 546 -a --text treat all files as text
547 547 -g --git use git extended diff format
548 548 --binary generate binary diffs in git mode (default)
549 549 --nodates omit dates from diff headers
550 550 --noprefix omit a/ and b/ prefixes from filenames
551 551 -p --show-function show which function each change is in
552 552 --reverse produce a diff that undoes the changes
553 553 -w --ignore-all-space ignore white space when comparing lines
554 554 -b --ignore-space-change ignore changes in the amount of white space
555 555 -B --ignore-blank-lines ignore changes whose lines are all blank
556 556 -U --unified NUM number of lines of context to show
557 557 --stat output diffstat-style summary of changes
558 558 --root DIR produce diffs relative to subdirectory
559 559 -I --include PATTERN [+] include names matching the given patterns
560 560 -X --exclude PATTERN [+] exclude names matching the given patterns
561 561 -S --subrepos recurse into subrepositories
562 562
563 563 (some details hidden, use --verbose to show complete help)
564 564
565 565 $ hg help status
566 566 hg status [OPTION]... [FILE]...
567 567
568 568 aliases: st
569 569
570 570 show changed files in the working directory
571 571
572 572 Show status of files in the repository. If names are given, only files
573 573 that match are shown. Files that are clean or ignored or the source of a
574 574 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
575 575 -C/--copies or -A/--all are given. Unless options described with "show
576 576 only ..." are given, the options -mardu are used.
577 577
578 578 Option -q/--quiet hides untracked (unknown and ignored) files unless
579 579 explicitly requested with -u/--unknown or -i/--ignored.
580 580
581 581 Note:
582 582 'hg status' may appear to disagree with diff if permissions have
583 583 changed or a merge has occurred. The standard diff format does not
584 584 report permission changes and diff only reports changes relative to one
585 585 merge parent.
586 586
587 587 If one revision is given, it is used as the base revision. If two
588 588 revisions are given, the differences between them are shown. The --change
589 589 option can also be used as a shortcut to list the changed files of a
590 590 revision from its first parent.
591 591
592 592 The codes used to show the status of files are:
593 593
594 594 M = modified
595 595 A = added
596 596 R = removed
597 597 C = clean
598 598 ! = missing (deleted by non-hg command, but still tracked)
599 599 ? = not tracked
600 600 I = ignored
601 601 = origin of the previous file (with --copies)
602 602
603 603 Returns 0 on success.
604 604
605 605 options ([+] can be repeated):
606 606
607 607 -A --all show status of all files
608 608 -m --modified show only modified files
609 609 -a --added show only added files
610 610 -r --removed show only removed files
611 611 -d --deleted show only deleted (but tracked) files
612 612 -c --clean show only files without changes
613 613 -u --unknown show only unknown (not tracked) files
614 614 -i --ignored show only ignored files
615 615 -n --no-status hide status prefix
616 616 -C --copies show source of copied files
617 617 -0 --print0 end filenames with NUL, for use with xargs
618 618 --rev REV [+] show difference from revision
619 619 --change REV list the changed files of a revision
620 620 -I --include PATTERN [+] include names matching the given patterns
621 621 -X --exclude PATTERN [+] exclude names matching the given patterns
622 622 -S --subrepos recurse into subrepositories
623 623
624 624 (some details hidden, use --verbose to show complete help)
625 625
626 626 $ hg -q help status
627 627 hg status [OPTION]... [FILE]...
628 628
629 629 show changed files in the working directory
630 630
631 631 $ hg help foo
632 632 abort: no such help topic: foo
633 633 (try 'hg help --keyword foo')
634 634 [255]
635 635
636 636 $ hg skjdfks
637 637 hg: unknown command 'skjdfks'
638 638 Mercurial Distributed SCM
639 639
640 640 basic commands:
641 641
642 642 add add the specified files on the next commit
643 643 annotate show changeset information by line for each file
644 644 clone make a copy of an existing repository
645 645 commit commit the specified files or all outstanding changes
646 646 diff diff repository (or selected files)
647 647 export dump the header and diffs for one or more changesets
648 648 forget forget the specified files on the next commit
649 649 init create a new repository in the given directory
650 650 log show revision history of entire repository or files
651 651 merge merge another revision into working directory
652 652 pull pull changes from the specified source
653 653 push push changes to the specified destination
654 654 remove remove the specified files on the next commit
655 655 serve start stand-alone webserver
656 656 status show changed files in the working directory
657 657 summary summarize working directory state
658 658 update update working directory (or switch revisions)
659 659
660 660 (use 'hg help' for the full list of commands or 'hg -v' for details)
661 661 [255]
662 662
663 663 Typoed command gives suggestion
664 664 $ hg puls
665 665 hg: unknown command 'puls'
666 666 (did you mean one of pull, push?)
667 667 [255]
668 668
669 669 Not enabled extension gets suggested
670 670
671 671 $ hg rebase
672 672 hg: unknown command 'rebase'
673 673 'rebase' is provided by the following extension:
674 674
675 675 rebase command to move sets of revisions to a different ancestor
676 676
677 677 (use 'hg help extensions' for information on enabling extensions)
678 678 [255]
679 679
680 680 Disabled extension gets suggested
681 681 $ hg --config extensions.rebase=! rebase
682 682 hg: unknown command 'rebase'
683 683 'rebase' is provided by the following extension:
684 684
685 685 rebase command to move sets of revisions to a different ancestor
686 686
687 687 (use 'hg help extensions' for information on enabling extensions)
688 688 [255]
689 689
690 690 Make sure that we don't run afoul of the help system thinking that
691 691 this is a section and erroring out weirdly.
692 692
693 693 $ hg .log
694 694 hg: unknown command '.log'
695 695 (did you mean log?)
696 696 [255]
697 697
698 698 $ hg log.
699 699 hg: unknown command 'log.'
700 700 (did you mean log?)
701 701 [255]
702 702 $ hg pu.lh
703 703 hg: unknown command 'pu.lh'
704 704 (did you mean one of pull, push?)
705 705 [255]
706 706
707 707 $ cat > helpext.py <<EOF
708 708 > import os
709 709 > from mercurial import commands, registrar
710 710 >
711 711 > cmdtable = {}
712 712 > command = registrar.command(cmdtable)
713 713 >
714 714 > @command(b'nohelp',
715 715 > [(b'', b'longdesc', 3, b'x'*90),
716 716 > (b'n', b'', None, b'normal desc'),
717 717 > (b'', b'newline', b'', b'line1\nline2')],
718 718 > b'hg nohelp',
719 719 > norepo=True)
720 720 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
721 721 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
722 722 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
723 723 > def nohelp(ui, *args, **kwargs):
724 724 > pass
725 725 >
726 726 > def uisetup(ui):
727 727 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
728 728 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
729 729 >
730 730 > EOF
731 731 $ echo '[extensions]' >> $HGRCPATH
732 732 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
733 733
734 734 Test for aliases
735 735
736 736 $ hg help hgalias
737 737 hg hgalias [--remote]
738 738
739 739 alias for: hg summary
740 740
741 741 summarize working directory state
742 742
743 743 This generates a brief summary of the working directory state, including
744 744 parents, branch, commit status, phase and available updates.
745 745
746 746 With the --remote option, this will check the default paths for incoming
747 747 and outgoing changes. This can be time-consuming.
748 748
749 749 Returns 0 on success.
750 750
751 751 defined by: helpext
752 752
753 753 options:
754 754
755 755 --remote check for push and pull
756 756
757 757 (some details hidden, use --verbose to show complete help)
758 758
759 759 $ hg help shellalias
760 760 hg shellalias
761 761
762 762 shell alias for:
763 763
764 764 echo hi
765 765
766 766 defined by: helpext
767 767
768 768 (some details hidden, use --verbose to show complete help)
769 769
770 770 Test command with no help text
771 771
772 772 $ hg help nohelp
773 773 hg nohelp
774 774
775 775 (no help text available)
776 776
777 777 options:
778 778
779 779 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
780 780 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
781 781 -n -- normal desc
782 782 --newline VALUE line1 line2
783 783
784 784 (some details hidden, use --verbose to show complete help)
785 785
786 786 $ hg help -k nohelp
787 787 Commands:
788 788
789 789 nohelp hg nohelp
790 790
791 791 Extension Commands:
792 792
793 793 nohelp (no help text available)
794 794
795 795 Test that default list of commands omits extension commands
796 796
797 797 $ hg help
798 798 Mercurial Distributed SCM
799 799
800 800 list of commands:
801 801
802 802 add add the specified files on the next commit
803 803 addremove add all new files, delete all missing files
804 804 annotate show changeset information by line for each file
805 805 archive create an unversioned archive of a repository revision
806 806 backout reverse effect of earlier changeset
807 807 bisect subdivision search of changesets
808 808 bookmarks create a new bookmark or list existing bookmarks
809 809 branch set or show the current branch name
810 810 branches list repository named branches
811 811 bundle create a bundle file
812 812 cat output the current or given revision of files
813 813 clone make a copy of an existing repository
814 814 commit commit the specified files or all outstanding changes
815 815 config show combined config settings from all hgrc files
816 816 copy mark files as copied for the next commit
817 817 diff diff repository (or selected files)
818 818 export dump the header and diffs for one or more changesets
819 819 files list tracked files
820 820 forget forget the specified files on the next commit
821 821 graft copy changes from other branches onto the current branch
822 822 grep search revision history for a pattern in specified files
823 823 heads show branch heads
824 824 help show help for a given topic or a help overview
825 825 identify identify the working directory or specified revision
826 826 import import an ordered set of patches
827 827 incoming show new changesets found in source
828 828 init create a new repository in the given directory
829 829 log show revision history of entire repository or files
830 830 manifest output the current or given revision of the project manifest
831 831 merge merge another revision into working directory
832 832 outgoing show changesets not found in the destination
833 833 paths show aliases for remote repositories
834 834 phase set or show the current phase name
835 835 pull pull changes from the specified source
836 836 push push changes to the specified destination
837 837 recover roll back an interrupted transaction
838 838 remove remove the specified files on the next commit
839 839 rename rename files; equivalent of copy + remove
840 840 resolve redo merges or set/view the merge status of files
841 841 revert restore files to their checkout state
842 842 root print the root (top) of the current working directory
843 843 serve start stand-alone webserver
844 844 status show changed files in the working directory
845 845 summary summarize working directory state
846 846 tag add one or more tags for the current or given revision
847 847 tags list repository tags
848 848 unbundle apply one or more bundle files
849 849 update update working directory (or switch revisions)
850 850 verify verify the integrity of the repository
851 851 version output version and copyright information
852 852
853 853 enabled extensions:
854 854
855 855 helpext (no help text available)
856 856
857 857 additional help topics:
858 858
859 859 bundlespec Bundle File Formats
860 860 color Colorizing Outputs
861 861 config Configuration Files
862 862 dates Date Formats
863 863 diffs Diff Formats
864 864 environment Environment Variables
865 865 extensions Using Additional Features
866 866 filesets Specifying File Sets
867 867 glossary Glossary
868 868 hgignore Syntax for Mercurial Ignore Files
869 869 hgweb Configuring hgweb
870 870 internals Technical implementation topics
871 871 merge-tools Merge Tools
872 872 pager Pager Support
873 873 patterns File Name Patterns
874 874 phases Working with Phases
875 875 revisions Specifying Revisions
876 876 scripting Using Mercurial from scripts and automation
877 877 subrepos Subrepositories
878 878 templating Template Usage
879 879 urls URL Paths
880 880
881 881 (use 'hg help -v' to show built-in aliases and global options)
882 882
883 883
884 884 Test list of internal help commands
885 885
886 886 $ hg help debug
887 887 debug commands (internal and unsupported):
888 888
889 889 debugancestor
890 890 find the ancestor revision of two revisions in a given index
891 891 debugapplystreamclonebundle
892 892 apply a stream clone bundle file
893 893 debugbuilddag
894 894 builds a repo with a given DAG from scratch in the current
895 895 empty repo
896 896 debugbundle lists the contents of a bundle
897 897 debugcheckstate
898 898 validate the correctness of the current dirstate
899 899 debugcolor show available color, effects or style
900 900 debugcommands
901 901 list all available commands and options
902 902 debugcomplete
903 903 returns the completion list associated with the given command
904 904 debugcreatestreamclonebundle
905 905 create a stream clone bundle file
906 906 debugdag format the changelog or an index DAG as a concise textual
907 907 description
908 908 debugdata dump the contents of a data file revision
909 909 debugdate parse and display a date
910 910 debugdeltachain
911 911 dump information about delta chains in a revlog
912 912 debugdirstate
913 913 show the contents of the current dirstate
914 914 debugdiscovery
915 915 runs the changeset discovery protocol in isolation
916 916 debugextensions
917 917 show information about active extensions
918 918 debugfileset parse and apply a fileset specification
919 919 debugfsinfo show information detected about current filesystem
920 920 debuggetbundle
921 921 retrieves a bundle from a repo
922 922 debugignore display the combined ignore pattern and information about
923 923 ignored files
924 924 debugindex dump the contents of an index file
925 925 debugindexdot
926 926 dump an index DAG as a graphviz dot file
927 927 debuginstall test Mercurial installation
928 928 debugknown test whether node ids are known to a repo
929 929 debuglocks show or modify state of locks
930 930 debugmergestate
931 931 print merge state
932 932 debugnamecomplete
933 933 complete "names" - tags, open branch names, bookmark names
934 934 debugobsolete
935 935 create arbitrary obsolete marker
936 936 debugoptADV (no help text available)
937 937 debugoptDEP (no help text available)
938 938 debugoptEXP (no help text available)
939 939 debugpathcomplete
940 940 complete part or all of a tracked path
941 941 debugpickmergetool
942 942 examine which merge tool is chosen for specified file
943 943 debugpushkey access the pushkey key/value protocol
944 944 debugpvec (no help text available)
945 945 debugrebuilddirstate
946 946 rebuild the dirstate as it would look like for the given
947 947 revision
948 948 debugrebuildfncache
949 949 rebuild the fncache file
950 950 debugrename dump rename information
951 951 debugrevlog show data and statistics about a revlog
952 952 debugrevspec parse and apply a revision specification
953 953 debugsetparents
954 954 manually set the parents of the current working directory
955 debugssl test a secure connection to a server
955 956 debugsub (no help text available)
956 957 debugsuccessorssets
957 958 show set of successors for revision
958 959 debugtemplate
959 960 parse and apply a template
960 961 debugupdatecaches
961 962 warm all known caches in the repository
962 963 debugupgraderepo
963 964 upgrade a repository to use different features
964 965 debugwalk show how files match on given patterns
965 966 debugwireargs
966 967 (no help text available)
967 968
968 969 (use 'hg help -v debug' to show built-in aliases and global options)
969 970
970 971 internals topic renders index of available sub-topics
971 972
972 973 $ hg help internals
973 974 Technical implementation topics
974 975 """""""""""""""""""""""""""""""
975 976
976 977 To access a subtopic, use "hg help internals.{subtopic-name}"
977 978
978 979 bundles Bundles
979 980 censor Censor
980 981 changegroups Changegroups
981 982 requirements Repository Requirements
982 983 revlogs Revision Logs
983 984 wireprotocol Wire Protocol
984 985
985 986 sub-topics can be accessed
986 987
987 988 $ hg help internals.changegroups
988 989 Changegroups
989 990 """"""""""""
990 991
991 992 Changegroups are representations of repository revlog data, specifically
992 993 the changelog data, root/flat manifest data, treemanifest data, and
993 994 filelogs.
994 995
995 996 There are 3 versions of changegroups: "1", "2", and "3". From a high-
996 997 level, versions "1" and "2" are almost exactly the same, with the only
997 998 difference being an additional item in the *delta header*. Version "3"
998 999 adds support for revlog flags in the *delta header* and optionally
999 1000 exchanging treemanifests (enabled by setting an option on the
1000 1001 "changegroup" part in the bundle2).
1001 1002
1002 1003 Changegroups when not exchanging treemanifests consist of 3 logical
1003 1004 segments:
1004 1005
1005 1006 +---------------------------------+
1006 1007 | | | |
1007 1008 | changeset | manifest | filelogs |
1008 1009 | | | |
1009 1010 | | | |
1010 1011 +---------------------------------+
1011 1012
1012 1013 When exchanging treemanifests, there are 4 logical segments:
1013 1014
1014 1015 +-------------------------------------------------+
1015 1016 | | | | |
1016 1017 | changeset | root | treemanifests | filelogs |
1017 1018 | | manifest | | |
1018 1019 | | | | |
1019 1020 +-------------------------------------------------+
1020 1021
1021 1022 The principle building block of each segment is a *chunk*. A *chunk* is a
1022 1023 framed piece of data:
1023 1024
1024 1025 +---------------------------------------+
1025 1026 | | |
1026 1027 | length | data |
1027 1028 | (4 bytes) | (<length - 4> bytes) |
1028 1029 | | |
1029 1030 +---------------------------------------+
1030 1031
1031 1032 All integers are big-endian signed integers. Each chunk starts with a
1032 1033 32-bit integer indicating the length of the entire chunk (including the
1033 1034 length field itself).
1034 1035
1035 1036 There is a special case chunk that has a value of 0 for the length
1036 1037 ("0x00000000"). We call this an *empty chunk*.
1037 1038
1038 1039 Delta Groups
1039 1040 ============
1040 1041
1041 1042 A *delta group* expresses the content of a revlog as a series of deltas,
1042 1043 or patches against previous revisions.
1043 1044
1044 1045 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1045 1046 to signal the end of the delta group:
1046 1047
1047 1048 +------------------------------------------------------------------------+
1048 1049 | | | | | |
1049 1050 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1050 1051 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1051 1052 | | | | | |
1052 1053 +------------------------------------------------------------------------+
1053 1054
1054 1055 Each *chunk*'s data consists of the following:
1055 1056
1056 1057 +---------------------------------------+
1057 1058 | | |
1058 1059 | delta header | delta data |
1059 1060 | (various by version) | (various) |
1060 1061 | | |
1061 1062 +---------------------------------------+
1062 1063
1063 1064 The *delta data* is a series of *delta*s that describe a diff from an
1064 1065 existing entry (either that the recipient already has, or previously
1065 1066 specified in the bundle/changegroup).
1066 1067
1067 1068 The *delta header* is different between versions "1", "2", and "3" of the
1068 1069 changegroup format.
1069 1070
1070 1071 Version 1 (headerlen=80):
1071 1072
1072 1073 +------------------------------------------------------+
1073 1074 | | | | |
1074 1075 | node | p1 node | p2 node | link node |
1075 1076 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1076 1077 | | | | |
1077 1078 +------------------------------------------------------+
1078 1079
1079 1080 Version 2 (headerlen=100):
1080 1081
1081 1082 +------------------------------------------------------------------+
1082 1083 | | | | | |
1083 1084 | node | p1 node | p2 node | base node | link node |
1084 1085 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1085 1086 | | | | | |
1086 1087 +------------------------------------------------------------------+
1087 1088
1088 1089 Version 3 (headerlen=102):
1089 1090
1090 1091 +------------------------------------------------------------------------------+
1091 1092 | | | | | | |
1092 1093 | node | p1 node | p2 node | base node | link node | flags |
1093 1094 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1094 1095 | | | | | | |
1095 1096 +------------------------------------------------------------------------------+
1096 1097
1097 1098 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1098 1099 contain a series of *delta*s, densely packed (no separators). These deltas
1099 1100 describe a diff from an existing entry (either that the recipient already
1100 1101 has, or previously specified in the bundle/changegroup). The format is
1101 1102 described more fully in "hg help internals.bdiff", but briefly:
1102 1103
1103 1104 +---------------------------------------------------------------+
1104 1105 | | | | |
1105 1106 | start offset | end offset | new length | content |
1106 1107 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1107 1108 | | | | |
1108 1109 +---------------------------------------------------------------+
1109 1110
1110 1111 Please note that the length field in the delta data does *not* include
1111 1112 itself.
1112 1113
1113 1114 In version 1, the delta is always applied against the previous node from
1114 1115 the changegroup or the first parent if this is the first entry in the
1115 1116 changegroup.
1116 1117
1117 1118 In version 2 and up, the delta base node is encoded in the entry in the
1118 1119 changegroup. This allows the delta to be expressed against any parent,
1119 1120 which can result in smaller deltas and more efficient encoding of data.
1120 1121
1121 1122 Changeset Segment
1122 1123 =================
1123 1124
1124 1125 The *changeset segment* consists of a single *delta group* holding
1125 1126 changelog data. The *empty chunk* at the end of the *delta group* denotes
1126 1127 the boundary to the *manifest segment*.
1127 1128
1128 1129 Manifest Segment
1129 1130 ================
1130 1131
1131 1132 The *manifest segment* consists of a single *delta group* holding manifest
1132 1133 data. If treemanifests are in use, it contains only the manifest for the
1133 1134 root directory of the repository. Otherwise, it contains the entire
1134 1135 manifest data. The *empty chunk* at the end of the *delta group* denotes
1135 1136 the boundary to the next segment (either the *treemanifests segment* or
1136 1137 the *filelogs segment*, depending on version and the request options).
1137 1138
1138 1139 Treemanifests Segment
1139 1140 ---------------------
1140 1141
1141 1142 The *treemanifests segment* only exists in changegroup version "3", and
1142 1143 only if the 'treemanifest' param is part of the bundle2 changegroup part
1143 1144 (it is not possible to use changegroup version 3 outside of bundle2).
1144 1145 Aside from the filenames in the *treemanifests segment* containing a
1145 1146 trailing "/" character, it behaves identically to the *filelogs segment*
1146 1147 (see below). The final sub-segment is followed by an *empty chunk*
1147 1148 (logically, a sub-segment with filename size 0). This denotes the boundary
1148 1149 to the *filelogs segment*.
1149 1150
1150 1151 Filelogs Segment
1151 1152 ================
1152 1153
1153 1154 The *filelogs segment* consists of multiple sub-segments, each
1154 1155 corresponding to an individual file whose data is being described:
1155 1156
1156 1157 +--------------------------------------------------+
1157 1158 | | | | | |
1158 1159 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1159 1160 | | | | | (4 bytes) |
1160 1161 | | | | | |
1161 1162 +--------------------------------------------------+
1162 1163
1163 1164 The final filelog sub-segment is followed by an *empty chunk* (logically,
1164 1165 a sub-segment with filename size 0). This denotes the end of the segment
1165 1166 and of the overall changegroup.
1166 1167
1167 1168 Each filelog sub-segment consists of the following:
1168 1169
1169 1170 +------------------------------------------------------+
1170 1171 | | | |
1171 1172 | filename length | filename | delta group |
1172 1173 | (4 bytes) | (<length - 4> bytes) | (various) |
1173 1174 | | | |
1174 1175 +------------------------------------------------------+
1175 1176
1176 1177 That is, a *chunk* consisting of the filename (not terminated or padded)
1177 1178 followed by N chunks constituting the *delta group* for this file. The
1178 1179 *empty chunk* at the end of each *delta group* denotes the boundary to the
1179 1180 next filelog sub-segment.
1180 1181
1181 1182 Test list of commands with command with no help text
1182 1183
1183 1184 $ hg help helpext
1184 1185 helpext extension - no help text available
1185 1186
1186 1187 list of commands:
1187 1188
1188 1189 nohelp (no help text available)
1189 1190
1190 1191 (use 'hg help -v helpext' to show built-in aliases and global options)
1191 1192
1192 1193
1193 1194 test advanced, deprecated and experimental options are hidden in command help
1194 1195 $ hg help debugoptADV
1195 1196 hg debugoptADV
1196 1197
1197 1198 (no help text available)
1198 1199
1199 1200 options:
1200 1201
1201 1202 (some details hidden, use --verbose to show complete help)
1202 1203 $ hg help debugoptDEP
1203 1204 hg debugoptDEP
1204 1205
1205 1206 (no help text available)
1206 1207
1207 1208 options:
1208 1209
1209 1210 (some details hidden, use --verbose to show complete help)
1210 1211
1211 1212 $ hg help debugoptEXP
1212 1213 hg debugoptEXP
1213 1214
1214 1215 (no help text available)
1215 1216
1216 1217 options:
1217 1218
1218 1219 (some details hidden, use --verbose to show complete help)
1219 1220
1220 1221 test advanced, deprecated and experimental options are shown with -v
1221 1222 $ hg help -v debugoptADV | grep aopt
1222 1223 --aopt option is (ADVANCED)
1223 1224 $ hg help -v debugoptDEP | grep dopt
1224 1225 --dopt option is (DEPRECATED)
1225 1226 $ hg help -v debugoptEXP | grep eopt
1226 1227 --eopt option is (EXPERIMENTAL)
1227 1228
1228 1229 #if gettext
1229 1230 test deprecated option is hidden with translation with untranslated description
1230 1231 (use many globy for not failing on changed transaction)
1231 1232 $ LANGUAGE=sv hg help debugoptDEP
1232 1233 hg debugoptDEP
1233 1234
1234 1235 (*) (glob)
1235 1236
1236 1237 options:
1237 1238
1238 1239 (some details hidden, use --verbose to show complete help)
1239 1240 #endif
1240 1241
1241 1242 Test commands that collide with topics (issue4240)
1242 1243
1243 1244 $ hg config -hq
1244 1245 hg config [-u] [NAME]...
1245 1246
1246 1247 show combined config settings from all hgrc files
1247 1248 $ hg showconfig -hq
1248 1249 hg config [-u] [NAME]...
1249 1250
1250 1251 show combined config settings from all hgrc files
1251 1252
1252 1253 Test a help topic
1253 1254
1254 1255 $ hg help dates
1255 1256 Date Formats
1256 1257 """"""""""""
1257 1258
1258 1259 Some commands allow the user to specify a date, e.g.:
1259 1260
1260 1261 - backout, commit, import, tag: Specify the commit date.
1261 1262 - log, revert, update: Select revision(s) by date.
1262 1263
1263 1264 Many date formats are valid. Here are some examples:
1264 1265
1265 1266 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1266 1267 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1267 1268 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1268 1269 - "Dec 6" (midnight)
1269 1270 - "13:18" (today assumed)
1270 1271 - "3:39" (3:39AM assumed)
1271 1272 - "3:39pm" (15:39)
1272 1273 - "2006-12-06 13:18:29" (ISO 8601 format)
1273 1274 - "2006-12-6 13:18"
1274 1275 - "2006-12-6"
1275 1276 - "12-6"
1276 1277 - "12/6"
1277 1278 - "12/6/6" (Dec 6 2006)
1278 1279 - "today" (midnight)
1279 1280 - "yesterday" (midnight)
1280 1281 - "now" - right now
1281 1282
1282 1283 Lastly, there is Mercurial's internal format:
1283 1284
1284 1285 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1285 1286
1286 1287 This is the internal representation format for dates. The first number is
1287 1288 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1288 1289 is the offset of the local timezone, in seconds west of UTC (negative if
1289 1290 the timezone is east of UTC).
1290 1291
1291 1292 The log command also accepts date ranges:
1292 1293
1293 1294 - "<DATE" - at or before a given date/time
1294 1295 - ">DATE" - on or after a given date/time
1295 1296 - "DATE to DATE" - a date range, inclusive
1296 1297 - "-DAYS" - within a given number of days of today
1297 1298
1298 1299 Test repeated config section name
1299 1300
1300 1301 $ hg help config.host
1301 1302 "http_proxy.host"
1302 1303 Host name and (optional) port of the proxy server, for example
1303 1304 "myproxy:8000".
1304 1305
1305 1306 "smtp.host"
1306 1307 Host name of mail server, e.g. "mail.example.com".
1307 1308
1308 1309 Unrelated trailing paragraphs shouldn't be included
1309 1310
1310 1311 $ hg help config.extramsg | grep '^$'
1311 1312
1312 1313
1313 1314 Test capitalized section name
1314 1315
1315 1316 $ hg help scripting.HGPLAIN > /dev/null
1316 1317
1317 1318 Help subsection:
1318 1319
1319 1320 $ hg help config.charsets |grep "Email example:" > /dev/null
1320 1321 [1]
1321 1322
1322 1323 Show nested definitions
1323 1324 ("profiling.type"[break]"ls"[break]"stat"[break])
1324 1325
1325 1326 $ hg help config.type | egrep '^$'|wc -l
1326 1327 \s*3 (re)
1327 1328
1328 1329 Separate sections from subsections
1329 1330
1330 1331 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1331 1332 "format"
1332 1333 --------
1333 1334
1334 1335 "usegeneraldelta"
1335 1336
1336 1337 "dotencode"
1337 1338
1338 1339 "usefncache"
1339 1340
1340 1341 "usestore"
1341 1342
1342 1343 "profiling"
1343 1344 -----------
1344 1345
1345 1346 "format"
1346 1347
1347 1348 "progress"
1348 1349 ----------
1349 1350
1350 1351 "format"
1351 1352
1352 1353
1353 1354 Last item in help config.*:
1354 1355
1355 1356 $ hg help config.`hg help config|grep '^ "'| \
1356 1357 > tail -1|sed 's![ "]*!!g'`| \
1357 1358 > grep 'hg help -c config' > /dev/null
1358 1359 [1]
1359 1360
1360 1361 note to use help -c for general hg help config:
1361 1362
1362 1363 $ hg help config |grep 'hg help -c config' > /dev/null
1363 1364
1364 1365 Test templating help
1365 1366
1366 1367 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1367 1368 desc String. The text of the changeset description.
1368 1369 diffstat String. Statistics of changes with the following format:
1369 1370 firstline Any text. Returns the first line of text.
1370 1371 nonempty Any text. Returns '(none)' if the string is empty.
1371 1372
1372 1373 Test deprecated items
1373 1374
1374 1375 $ hg help -v templating | grep currentbookmark
1375 1376 currentbookmark
1376 1377 $ hg help templating | (grep currentbookmark || true)
1377 1378
1378 1379 Test help hooks
1379 1380
1380 1381 $ cat > helphook1.py <<EOF
1381 1382 > from mercurial import help
1382 1383 >
1383 1384 > def rewrite(ui, topic, doc):
1384 1385 > return doc + '\nhelphook1\n'
1385 1386 >
1386 1387 > def extsetup(ui):
1387 1388 > help.addtopichook('revisions', rewrite)
1388 1389 > EOF
1389 1390 $ cat > helphook2.py <<EOF
1390 1391 > from mercurial import help
1391 1392 >
1392 1393 > def rewrite(ui, topic, doc):
1393 1394 > return doc + '\nhelphook2\n'
1394 1395 >
1395 1396 > def extsetup(ui):
1396 1397 > help.addtopichook('revisions', rewrite)
1397 1398 > EOF
1398 1399 $ echo '[extensions]' >> $HGRCPATH
1399 1400 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1400 1401 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1401 1402 $ hg help revsets | grep helphook
1402 1403 helphook1
1403 1404 helphook2
1404 1405
1405 1406 help -c should only show debug --debug
1406 1407
1407 1408 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1408 1409 [1]
1409 1410
1410 1411 help -c should only show deprecated for -v
1411 1412
1412 1413 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1413 1414 [1]
1414 1415
1415 1416 Test -s / --system
1416 1417
1417 1418 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1418 1419 > wc -l | sed -e 's/ //g'
1419 1420 0
1420 1421 $ hg help config.files --system unix | grep 'USER' | \
1421 1422 > wc -l | sed -e 's/ //g'
1422 1423 0
1423 1424
1424 1425 Test -e / -c / -k combinations
1425 1426
1426 1427 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1427 1428 Commands:
1428 1429 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1429 1430 Extensions:
1430 1431 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1431 1432 Topics:
1432 1433 Commands:
1433 1434 Extensions:
1434 1435 Extension Commands:
1435 1436 $ hg help -c schemes
1436 1437 abort: no such help topic: schemes
1437 1438 (try 'hg help --keyword schemes')
1438 1439 [255]
1439 1440 $ hg help -e schemes |head -1
1440 1441 schemes extension - extend schemes with shortcuts to repository swarms
1441 1442 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1442 1443 Commands:
1443 1444 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1444 1445 Extensions:
1445 1446 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1446 1447 Extensions:
1447 1448 Commands:
1448 1449 $ hg help -c commit > /dev/null
1449 1450 $ hg help -e -c commit > /dev/null
1450 1451 $ hg help -e commit > /dev/null
1451 1452 abort: no such help topic: commit
1452 1453 (try 'hg help --keyword commit')
1453 1454 [255]
1454 1455
1455 1456 Test keyword search help
1456 1457
1457 1458 $ cat > prefixedname.py <<EOF
1458 1459 > '''matched against word "clone"
1459 1460 > '''
1460 1461 > EOF
1461 1462 $ echo '[extensions]' >> $HGRCPATH
1462 1463 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1463 1464 $ hg help -k clone
1464 1465 Topics:
1465 1466
1466 1467 config Configuration Files
1467 1468 extensions Using Additional Features
1468 1469 glossary Glossary
1469 1470 phases Working with Phases
1470 1471 subrepos Subrepositories
1471 1472 urls URL Paths
1472 1473
1473 1474 Commands:
1474 1475
1475 1476 bookmarks create a new bookmark or list existing bookmarks
1476 1477 clone make a copy of an existing repository
1477 1478 paths show aliases for remote repositories
1478 1479 update update working directory (or switch revisions)
1479 1480
1480 1481 Extensions:
1481 1482
1482 1483 clonebundles advertise pre-generated bundles to seed clones
1483 1484 prefixedname matched against word "clone"
1484 1485 relink recreates hardlinks between repository clones
1485 1486
1486 1487 Extension Commands:
1487 1488
1488 1489 qclone clone main and patch repository at same time
1489 1490
1490 1491 Test unfound topic
1491 1492
1492 1493 $ hg help nonexistingtopicthatwillneverexisteverever
1493 1494 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1494 1495 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1495 1496 [255]
1496 1497
1497 1498 Test unfound keyword
1498 1499
1499 1500 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1500 1501 abort: no matches
1501 1502 (try 'hg help' for a list of topics)
1502 1503 [255]
1503 1504
1504 1505 Test omit indicating for help
1505 1506
1506 1507 $ cat > addverboseitems.py <<EOF
1507 1508 > '''extension to test omit indicating.
1508 1509 >
1509 1510 > This paragraph is never omitted (for extension)
1510 1511 >
1511 1512 > .. container:: verbose
1512 1513 >
1513 1514 > This paragraph is omitted,
1514 1515 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1515 1516 >
1516 1517 > This paragraph is never omitted, too (for extension)
1517 1518 > '''
1518 1519 >
1519 1520 > from mercurial import help, commands
1520 1521 > testtopic = """This paragraph is never omitted (for topic).
1521 1522 >
1522 1523 > .. container:: verbose
1523 1524 >
1524 1525 > This paragraph is omitted,
1525 1526 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1526 1527 >
1527 1528 > This paragraph is never omitted, too (for topic)
1528 1529 > """
1529 1530 > def extsetup(ui):
1530 1531 > help.helptable.append((["topic-containing-verbose"],
1531 1532 > "This is the topic to test omit indicating.",
1532 1533 > lambda ui: testtopic))
1533 1534 > EOF
1534 1535 $ echo '[extensions]' >> $HGRCPATH
1535 1536 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1536 1537 $ hg help addverboseitems
1537 1538 addverboseitems extension - extension to test omit indicating.
1538 1539
1539 1540 This paragraph is never omitted (for extension)
1540 1541
1541 1542 This paragraph is never omitted, too (for extension)
1542 1543
1543 1544 (some details hidden, use --verbose to show complete help)
1544 1545
1545 1546 no commands defined
1546 1547 $ hg help -v addverboseitems
1547 1548 addverboseitems extension - extension to test omit indicating.
1548 1549
1549 1550 This paragraph is never omitted (for extension)
1550 1551
1551 1552 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1552 1553 extension)
1553 1554
1554 1555 This paragraph is never omitted, too (for extension)
1555 1556
1556 1557 no commands defined
1557 1558 $ hg help topic-containing-verbose
1558 1559 This is the topic to test omit indicating.
1559 1560 """"""""""""""""""""""""""""""""""""""""""
1560 1561
1561 1562 This paragraph is never omitted (for topic).
1562 1563
1563 1564 This paragraph is never omitted, too (for topic)
1564 1565
1565 1566 (some details hidden, use --verbose to show complete help)
1566 1567 $ hg help -v topic-containing-verbose
1567 1568 This is the topic to test omit indicating.
1568 1569 """"""""""""""""""""""""""""""""""""""""""
1569 1570
1570 1571 This paragraph is never omitted (for topic).
1571 1572
1572 1573 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1573 1574 topic)
1574 1575
1575 1576 This paragraph is never omitted, too (for topic)
1576 1577
1577 1578 Test section lookup
1578 1579
1579 1580 $ hg help revset.merge
1580 1581 "merge()"
1581 1582 Changeset is a merge changeset.
1582 1583
1583 1584 $ hg help glossary.dag
1584 1585 DAG
1585 1586 The repository of changesets of a distributed version control system
1586 1587 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1587 1588 of nodes and edges, where nodes correspond to changesets and edges
1588 1589 imply a parent -> child relation. This graph can be visualized by
1589 1590 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1590 1591 limited by the requirement for children to have at most two parents.
1591 1592
1592 1593
1593 1594 $ hg help hgrc.paths
1594 1595 "paths"
1595 1596 -------
1596 1597
1597 1598 Assigns symbolic names and behavior to repositories.
1598 1599
1599 1600 Options are symbolic names defining the URL or directory that is the
1600 1601 location of the repository. Example:
1601 1602
1602 1603 [paths]
1603 1604 my_server = https://example.com/my_repo
1604 1605 local_path = /home/me/repo
1605 1606
1606 1607 These symbolic names can be used from the command line. To pull from
1607 1608 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1608 1609 local_path'.
1609 1610
1610 1611 Options containing colons (":") denote sub-options that can influence
1611 1612 behavior for that specific path. Example:
1612 1613
1613 1614 [paths]
1614 1615 my_server = https://example.com/my_path
1615 1616 my_server:pushurl = ssh://example.com/my_path
1616 1617
1617 1618 The following sub-options can be defined:
1618 1619
1619 1620 "pushurl"
1620 1621 The URL to use for push operations. If not defined, the location
1621 1622 defined by the path's main entry is used.
1622 1623
1623 1624 "pushrev"
1624 1625 A revset defining which revisions to push by default.
1625 1626
1626 1627 When 'hg push' is executed without a "-r" argument, the revset defined
1627 1628 by this sub-option is evaluated to determine what to push.
1628 1629
1629 1630 For example, a value of "." will push the working directory's revision
1630 1631 by default.
1631 1632
1632 1633 Revsets specifying bookmarks will not result in the bookmark being
1633 1634 pushed.
1634 1635
1635 1636 The following special named paths exist:
1636 1637
1637 1638 "default"
1638 1639 The URL or directory to use when no source or remote is specified.
1639 1640
1640 1641 'hg clone' will automatically define this path to the location the
1641 1642 repository was cloned from.
1642 1643
1643 1644 "default-push"
1644 1645 (deprecated) The URL or directory for the default 'hg push' location.
1645 1646 "default:pushurl" should be used instead.
1646 1647
1647 1648 $ hg help glossary.mcguffin
1648 1649 abort: help section not found: glossary.mcguffin
1649 1650 [255]
1650 1651
1651 1652 $ hg help glossary.mc.guffin
1652 1653 abort: help section not found: glossary.mc.guffin
1653 1654 [255]
1654 1655
1655 1656 $ hg help template.files
1656 1657 files List of strings. All files modified, added, or removed by
1657 1658 this changeset.
1658 1659 files(pattern)
1659 1660 All files of the current changeset matching the pattern. See
1660 1661 'hg help patterns'.
1661 1662
1662 1663 Test section lookup by translated message
1663 1664
1664 1665 str.lower() instead of encoding.lower(str) on translated message might
1665 1666 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1666 1667 as the second or later byte of multi-byte character.
1667 1668
1668 1669 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1669 1670 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1670 1671 replacement makes message meaningless.
1671 1672
1672 1673 This tests that section lookup by translated string isn't broken by
1673 1674 such str.lower().
1674 1675
1675 1676 $ $PYTHON <<EOF
1676 1677 > def escape(s):
1677 1678 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1678 1679 > # translation of "record" in ja_JP.cp932
1679 1680 > upper = "\x8bL\x98^"
1680 1681 > # str.lower()-ed section name should be treated as different one
1681 1682 > lower = "\x8bl\x98^"
1682 1683 > with open('ambiguous.py', 'w') as fp:
1683 1684 > fp.write("""# ambiguous section names in ja_JP.cp932
1684 1685 > u'''summary of extension
1685 1686 >
1686 1687 > %s
1687 1688 > ----
1688 1689 >
1689 1690 > Upper name should show only this message
1690 1691 >
1691 1692 > %s
1692 1693 > ----
1693 1694 >
1694 1695 > Lower name should show only this message
1695 1696 >
1696 1697 > subsequent section
1697 1698 > ------------------
1698 1699 >
1699 1700 > This should be hidden at 'hg help ambiguous' with section name.
1700 1701 > '''
1701 1702 > """ % (escape(upper), escape(lower)))
1702 1703 > EOF
1703 1704
1704 1705 $ cat >> $HGRCPATH <<EOF
1705 1706 > [extensions]
1706 1707 > ambiguous = ./ambiguous.py
1707 1708 > EOF
1708 1709
1709 1710 $ $PYTHON <<EOF | sh
1710 1711 > upper = "\x8bL\x98^"
1711 1712 > print "hg --encoding cp932 help -e ambiguous.%s" % upper
1712 1713 > EOF
1713 1714 \x8bL\x98^ (esc)
1714 1715 ----
1715 1716
1716 1717 Upper name should show only this message
1717 1718
1718 1719
1719 1720 $ $PYTHON <<EOF | sh
1720 1721 > lower = "\x8bl\x98^"
1721 1722 > print "hg --encoding cp932 help -e ambiguous.%s" % lower
1722 1723 > EOF
1723 1724 \x8bl\x98^ (esc)
1724 1725 ----
1725 1726
1726 1727 Lower name should show only this message
1727 1728
1728 1729
1729 1730 $ cat >> $HGRCPATH <<EOF
1730 1731 > [extensions]
1731 1732 > ambiguous = !
1732 1733 > EOF
1733 1734
1734 1735 Show help content of disabled extensions
1735 1736
1736 1737 $ cat >> $HGRCPATH <<EOF
1737 1738 > [extensions]
1738 1739 > ambiguous = !./ambiguous.py
1739 1740 > EOF
1740 1741 $ hg help -e ambiguous
1741 1742 ambiguous extension - (no help text available)
1742 1743
1743 1744 (use 'hg help extensions' for information on enabling extensions)
1744 1745
1745 1746 Test dynamic list of merge tools only shows up once
1746 1747 $ hg help merge-tools
1747 1748 Merge Tools
1748 1749 """""""""""
1749 1750
1750 1751 To merge files Mercurial uses merge tools.
1751 1752
1752 1753 A merge tool combines two different versions of a file into a merged file.
1753 1754 Merge tools are given the two files and the greatest common ancestor of
1754 1755 the two file versions, so they can determine the changes made on both
1755 1756 branches.
1756 1757
1757 1758 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1758 1759 backout' and in several extensions.
1759 1760
1760 1761 Usually, the merge tool tries to automatically reconcile the files by
1761 1762 combining all non-overlapping changes that occurred separately in the two
1762 1763 different evolutions of the same initial base file. Furthermore, some
1763 1764 interactive merge programs make it easier to manually resolve conflicting
1764 1765 merges, either in a graphical way, or by inserting some conflict markers.
1765 1766 Mercurial does not include any interactive merge programs but relies on
1766 1767 external tools for that.
1767 1768
1768 1769 Available merge tools
1769 1770 =====================
1770 1771
1771 1772 External merge tools and their properties are configured in the merge-
1772 1773 tools configuration section - see hgrc(5) - but they can often just be
1773 1774 named by their executable.
1774 1775
1775 1776 A merge tool is generally usable if its executable can be found on the
1776 1777 system and if it can handle the merge. The executable is found if it is an
1777 1778 absolute or relative executable path or the name of an application in the
1778 1779 executable search path. The tool is assumed to be able to handle the merge
1779 1780 if it can handle symlinks if the file is a symlink, if it can handle
1780 1781 binary files if the file is binary, and if a GUI is available if the tool
1781 1782 requires a GUI.
1782 1783
1783 1784 There are some internal merge tools which can be used. The internal merge
1784 1785 tools are:
1785 1786
1786 1787 ":dump"
1787 1788 Creates three versions of the files to merge, containing the contents of
1788 1789 local, other and base. These files can then be used to perform a merge
1789 1790 manually. If the file to be merged is named "a.txt", these files will
1790 1791 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1791 1792 they will be placed in the same directory as "a.txt".
1792 1793
1793 1794 This implies permerge. Therefore, files aren't dumped, if premerge runs
1794 1795 successfully. Use :forcedump to forcibly write files out.
1795 1796
1796 1797 ":fail"
1797 1798 Rather than attempting to merge files that were modified on both
1798 1799 branches, it marks them as unresolved. The resolve command must be used
1799 1800 to resolve these conflicts.
1800 1801
1801 1802 ":forcedump"
1802 1803 Creates three versions of the files as same as :dump, but omits
1803 1804 premerge.
1804 1805
1805 1806 ":local"
1806 1807 Uses the local 'p1()' version of files as the merged version.
1807 1808
1808 1809 ":merge"
1809 1810 Uses the internal non-interactive simple merge algorithm for merging
1810 1811 files. It will fail if there are any conflicts and leave markers in the
1811 1812 partially merged file. Markers will have two sections, one for each side
1812 1813 of merge.
1813 1814
1814 1815 ":merge-local"
1815 1816 Like :merge, but resolve all conflicts non-interactively in favor of the
1816 1817 local 'p1()' changes.
1817 1818
1818 1819 ":merge-other"
1819 1820 Like :merge, but resolve all conflicts non-interactively in favor of the
1820 1821 other 'p2()' changes.
1821 1822
1822 1823 ":merge3"
1823 1824 Uses the internal non-interactive simple merge algorithm for merging
1824 1825 files. It will fail if there are any conflicts and leave markers in the
1825 1826 partially merged file. Marker will have three sections, one from each
1826 1827 side of the merge and one for the base content.
1827 1828
1828 1829 ":other"
1829 1830 Uses the other 'p2()' version of files as the merged version.
1830 1831
1831 1832 ":prompt"
1832 1833 Asks the user which of the local 'p1()' or the other 'p2()' version to
1833 1834 keep as the merged version.
1834 1835
1835 1836 ":tagmerge"
1836 1837 Uses the internal tag merge algorithm (experimental).
1837 1838
1838 1839 ":union"
1839 1840 Uses the internal non-interactive simple merge algorithm for merging
1840 1841 files. It will use both left and right sides for conflict regions. No
1841 1842 markers are inserted.
1842 1843
1843 1844 Internal tools are always available and do not require a GUI but will by
1844 1845 default not handle symlinks or binary files.
1845 1846
1846 1847 Choosing a merge tool
1847 1848 =====================
1848 1849
1849 1850 Mercurial uses these rules when deciding which merge tool to use:
1850 1851
1851 1852 1. If a tool has been specified with the --tool option to merge or
1852 1853 resolve, it is used. If it is the name of a tool in the merge-tools
1853 1854 configuration, its configuration is used. Otherwise the specified tool
1854 1855 must be executable by the shell.
1855 1856 2. If the "HGMERGE" environment variable is present, its value is used and
1856 1857 must be executable by the shell.
1857 1858 3. If the filename of the file to be merged matches any of the patterns in
1858 1859 the merge-patterns configuration section, the first usable merge tool
1859 1860 corresponding to a matching pattern is used. Here, binary capabilities
1860 1861 of the merge tool are not considered.
1861 1862 4. If ui.merge is set it will be considered next. If the value is not the
1862 1863 name of a configured tool, the specified value is used and must be
1863 1864 executable by the shell. Otherwise the named tool is used if it is
1864 1865 usable.
1865 1866 5. If any usable merge tools are present in the merge-tools configuration
1866 1867 section, the one with the highest priority is used.
1867 1868 6. If a program named "hgmerge" can be found on the system, it is used -
1868 1869 but it will by default not be used for symlinks and binary files.
1869 1870 7. If the file to be merged is not binary and is not a symlink, then
1870 1871 internal ":merge" is used.
1871 1872 8. Otherwise, ":prompt" is used.
1872 1873
1873 1874 Note:
1874 1875 After selecting a merge program, Mercurial will by default attempt to
1875 1876 merge the files using a simple merge algorithm first. Only if it
1876 1877 doesn't succeed because of conflicting changes Mercurial will actually
1877 1878 execute the merge program. Whether to use the simple merge algorithm
1878 1879 first can be controlled by the premerge setting of the merge tool.
1879 1880 Premerge is enabled by default unless the file is binary or a symlink.
1880 1881
1881 1882 See the merge-tools and ui sections of hgrc(5) for details on the
1882 1883 configuration of merge tools.
1883 1884
1884 1885 Compression engines listed in `hg help bundlespec`
1885 1886
1886 1887 $ hg help bundlespec | grep gzip
1887 1888 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1888 1889 An algorithm that produces smaller bundles than "gzip".
1889 1890 This engine will likely produce smaller bundles than "gzip" but will be
1890 1891 "gzip"
1891 1892 better compression than "gzip". It also frequently yields better (?)
1892 1893
1893 1894 Test usage of section marks in help documents
1894 1895
1895 1896 $ cd "$TESTDIR"/../doc
1896 1897 $ $PYTHON check-seclevel.py
1897 1898 $ cd $TESTTMP
1898 1899
1899 1900 #if serve
1900 1901
1901 1902 Test the help pages in hgweb.
1902 1903
1903 1904 Dish up an empty repo; serve it cold.
1904 1905
1905 1906 $ hg init "$TESTTMP/test"
1906 1907 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1907 1908 $ cat hg.pid >> $DAEMON_PIDS
1908 1909
1909 1910 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1910 1911 200 Script output follows
1911 1912
1912 1913 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1913 1914 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1914 1915 <head>
1915 1916 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1916 1917 <meta name="robots" content="index, nofollow" />
1917 1918 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1918 1919 <script type="text/javascript" src="/static/mercurial.js"></script>
1919 1920
1920 1921 <title>Help: Index</title>
1921 1922 </head>
1922 1923 <body>
1923 1924
1924 1925 <div class="container">
1925 1926 <div class="menu">
1926 1927 <div class="logo">
1927 1928 <a href="https://mercurial-scm.org/">
1928 1929 <img src="/static/hglogo.png" alt="mercurial" /></a>
1929 1930 </div>
1930 1931 <ul>
1931 1932 <li><a href="/shortlog">log</a></li>
1932 1933 <li><a href="/graph">graph</a></li>
1933 1934 <li><a href="/tags">tags</a></li>
1934 1935 <li><a href="/bookmarks">bookmarks</a></li>
1935 1936 <li><a href="/branches">branches</a></li>
1936 1937 </ul>
1937 1938 <ul>
1938 1939 <li class="active">help</li>
1939 1940 </ul>
1940 1941 </div>
1941 1942
1942 1943 <div class="main">
1943 1944 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1944 1945
1945 1946 <form class="search" action="/log">
1946 1947
1947 1948 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1948 1949 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1949 1950 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1950 1951 </form>
1951 1952 <table class="bigtable">
1952 1953 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1953 1954
1954 1955 <tr><td>
1955 1956 <a href="/help/bundlespec">
1956 1957 bundlespec
1957 1958 </a>
1958 1959 </td><td>
1959 1960 Bundle File Formats
1960 1961 </td></tr>
1961 1962 <tr><td>
1962 1963 <a href="/help/color">
1963 1964 color
1964 1965 </a>
1965 1966 </td><td>
1966 1967 Colorizing Outputs
1967 1968 </td></tr>
1968 1969 <tr><td>
1969 1970 <a href="/help/config">
1970 1971 config
1971 1972 </a>
1972 1973 </td><td>
1973 1974 Configuration Files
1974 1975 </td></tr>
1975 1976 <tr><td>
1976 1977 <a href="/help/dates">
1977 1978 dates
1978 1979 </a>
1979 1980 </td><td>
1980 1981 Date Formats
1981 1982 </td></tr>
1982 1983 <tr><td>
1983 1984 <a href="/help/diffs">
1984 1985 diffs
1985 1986 </a>
1986 1987 </td><td>
1987 1988 Diff Formats
1988 1989 </td></tr>
1989 1990 <tr><td>
1990 1991 <a href="/help/environment">
1991 1992 environment
1992 1993 </a>
1993 1994 </td><td>
1994 1995 Environment Variables
1995 1996 </td></tr>
1996 1997 <tr><td>
1997 1998 <a href="/help/extensions">
1998 1999 extensions
1999 2000 </a>
2000 2001 </td><td>
2001 2002 Using Additional Features
2002 2003 </td></tr>
2003 2004 <tr><td>
2004 2005 <a href="/help/filesets">
2005 2006 filesets
2006 2007 </a>
2007 2008 </td><td>
2008 2009 Specifying File Sets
2009 2010 </td></tr>
2010 2011 <tr><td>
2011 2012 <a href="/help/glossary">
2012 2013 glossary
2013 2014 </a>
2014 2015 </td><td>
2015 2016 Glossary
2016 2017 </td></tr>
2017 2018 <tr><td>
2018 2019 <a href="/help/hgignore">
2019 2020 hgignore
2020 2021 </a>
2021 2022 </td><td>
2022 2023 Syntax for Mercurial Ignore Files
2023 2024 </td></tr>
2024 2025 <tr><td>
2025 2026 <a href="/help/hgweb">
2026 2027 hgweb
2027 2028 </a>
2028 2029 </td><td>
2029 2030 Configuring hgweb
2030 2031 </td></tr>
2031 2032 <tr><td>
2032 2033 <a href="/help/internals">
2033 2034 internals
2034 2035 </a>
2035 2036 </td><td>
2036 2037 Technical implementation topics
2037 2038 </td></tr>
2038 2039 <tr><td>
2039 2040 <a href="/help/merge-tools">
2040 2041 merge-tools
2041 2042 </a>
2042 2043 </td><td>
2043 2044 Merge Tools
2044 2045 </td></tr>
2045 2046 <tr><td>
2046 2047 <a href="/help/pager">
2047 2048 pager
2048 2049 </a>
2049 2050 </td><td>
2050 2051 Pager Support
2051 2052 </td></tr>
2052 2053 <tr><td>
2053 2054 <a href="/help/patterns">
2054 2055 patterns
2055 2056 </a>
2056 2057 </td><td>
2057 2058 File Name Patterns
2058 2059 </td></tr>
2059 2060 <tr><td>
2060 2061 <a href="/help/phases">
2061 2062 phases
2062 2063 </a>
2063 2064 </td><td>
2064 2065 Working with Phases
2065 2066 </td></tr>
2066 2067 <tr><td>
2067 2068 <a href="/help/revisions">
2068 2069 revisions
2069 2070 </a>
2070 2071 </td><td>
2071 2072 Specifying Revisions
2072 2073 </td></tr>
2073 2074 <tr><td>
2074 2075 <a href="/help/scripting">
2075 2076 scripting
2076 2077 </a>
2077 2078 </td><td>
2078 2079 Using Mercurial from scripts and automation
2079 2080 </td></tr>
2080 2081 <tr><td>
2081 2082 <a href="/help/subrepos">
2082 2083 subrepos
2083 2084 </a>
2084 2085 </td><td>
2085 2086 Subrepositories
2086 2087 </td></tr>
2087 2088 <tr><td>
2088 2089 <a href="/help/templating">
2089 2090 templating
2090 2091 </a>
2091 2092 </td><td>
2092 2093 Template Usage
2093 2094 </td></tr>
2094 2095 <tr><td>
2095 2096 <a href="/help/urls">
2096 2097 urls
2097 2098 </a>
2098 2099 </td><td>
2099 2100 URL Paths
2100 2101 </td></tr>
2101 2102 <tr><td>
2102 2103 <a href="/help/topic-containing-verbose">
2103 2104 topic-containing-verbose
2104 2105 </a>
2105 2106 </td><td>
2106 2107 This is the topic to test omit indicating.
2107 2108 </td></tr>
2108 2109
2109 2110
2110 2111 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2111 2112
2112 2113 <tr><td>
2113 2114 <a href="/help/add">
2114 2115 add
2115 2116 </a>
2116 2117 </td><td>
2117 2118 add the specified files on the next commit
2118 2119 </td></tr>
2119 2120 <tr><td>
2120 2121 <a href="/help/annotate">
2121 2122 annotate
2122 2123 </a>
2123 2124 </td><td>
2124 2125 show changeset information by line for each file
2125 2126 </td></tr>
2126 2127 <tr><td>
2127 2128 <a href="/help/clone">
2128 2129 clone
2129 2130 </a>
2130 2131 </td><td>
2131 2132 make a copy of an existing repository
2132 2133 </td></tr>
2133 2134 <tr><td>
2134 2135 <a href="/help/commit">
2135 2136 commit
2136 2137 </a>
2137 2138 </td><td>
2138 2139 commit the specified files or all outstanding changes
2139 2140 </td></tr>
2140 2141 <tr><td>
2141 2142 <a href="/help/diff">
2142 2143 diff
2143 2144 </a>
2144 2145 </td><td>
2145 2146 diff repository (or selected files)
2146 2147 </td></tr>
2147 2148 <tr><td>
2148 2149 <a href="/help/export">
2149 2150 export
2150 2151 </a>
2151 2152 </td><td>
2152 2153 dump the header and diffs for one or more changesets
2153 2154 </td></tr>
2154 2155 <tr><td>
2155 2156 <a href="/help/forget">
2156 2157 forget
2157 2158 </a>
2158 2159 </td><td>
2159 2160 forget the specified files on the next commit
2160 2161 </td></tr>
2161 2162 <tr><td>
2162 2163 <a href="/help/init">
2163 2164 init
2164 2165 </a>
2165 2166 </td><td>
2166 2167 create a new repository in the given directory
2167 2168 </td></tr>
2168 2169 <tr><td>
2169 2170 <a href="/help/log">
2170 2171 log
2171 2172 </a>
2172 2173 </td><td>
2173 2174 show revision history of entire repository or files
2174 2175 </td></tr>
2175 2176 <tr><td>
2176 2177 <a href="/help/merge">
2177 2178 merge
2178 2179 </a>
2179 2180 </td><td>
2180 2181 merge another revision into working directory
2181 2182 </td></tr>
2182 2183 <tr><td>
2183 2184 <a href="/help/pull">
2184 2185 pull
2185 2186 </a>
2186 2187 </td><td>
2187 2188 pull changes from the specified source
2188 2189 </td></tr>
2189 2190 <tr><td>
2190 2191 <a href="/help/push">
2191 2192 push
2192 2193 </a>
2193 2194 </td><td>
2194 2195 push changes to the specified destination
2195 2196 </td></tr>
2196 2197 <tr><td>
2197 2198 <a href="/help/remove">
2198 2199 remove
2199 2200 </a>
2200 2201 </td><td>
2201 2202 remove the specified files on the next commit
2202 2203 </td></tr>
2203 2204 <tr><td>
2204 2205 <a href="/help/serve">
2205 2206 serve
2206 2207 </a>
2207 2208 </td><td>
2208 2209 start stand-alone webserver
2209 2210 </td></tr>
2210 2211 <tr><td>
2211 2212 <a href="/help/status">
2212 2213 status
2213 2214 </a>
2214 2215 </td><td>
2215 2216 show changed files in the working directory
2216 2217 </td></tr>
2217 2218 <tr><td>
2218 2219 <a href="/help/summary">
2219 2220 summary
2220 2221 </a>
2221 2222 </td><td>
2222 2223 summarize working directory state
2223 2224 </td></tr>
2224 2225 <tr><td>
2225 2226 <a href="/help/update">
2226 2227 update
2227 2228 </a>
2228 2229 </td><td>
2229 2230 update working directory (or switch revisions)
2230 2231 </td></tr>
2231 2232
2232 2233
2233 2234
2234 2235 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2235 2236
2236 2237 <tr><td>
2237 2238 <a href="/help/addremove">
2238 2239 addremove
2239 2240 </a>
2240 2241 </td><td>
2241 2242 add all new files, delete all missing files
2242 2243 </td></tr>
2243 2244 <tr><td>
2244 2245 <a href="/help/archive">
2245 2246 archive
2246 2247 </a>
2247 2248 </td><td>
2248 2249 create an unversioned archive of a repository revision
2249 2250 </td></tr>
2250 2251 <tr><td>
2251 2252 <a href="/help/backout">
2252 2253 backout
2253 2254 </a>
2254 2255 </td><td>
2255 2256 reverse effect of earlier changeset
2256 2257 </td></tr>
2257 2258 <tr><td>
2258 2259 <a href="/help/bisect">
2259 2260 bisect
2260 2261 </a>
2261 2262 </td><td>
2262 2263 subdivision search of changesets
2263 2264 </td></tr>
2264 2265 <tr><td>
2265 2266 <a href="/help/bookmarks">
2266 2267 bookmarks
2267 2268 </a>
2268 2269 </td><td>
2269 2270 create a new bookmark or list existing bookmarks
2270 2271 </td></tr>
2271 2272 <tr><td>
2272 2273 <a href="/help/branch">
2273 2274 branch
2274 2275 </a>
2275 2276 </td><td>
2276 2277 set or show the current branch name
2277 2278 </td></tr>
2278 2279 <tr><td>
2279 2280 <a href="/help/branches">
2280 2281 branches
2281 2282 </a>
2282 2283 </td><td>
2283 2284 list repository named branches
2284 2285 </td></tr>
2285 2286 <tr><td>
2286 2287 <a href="/help/bundle">
2287 2288 bundle
2288 2289 </a>
2289 2290 </td><td>
2290 2291 create a bundle file
2291 2292 </td></tr>
2292 2293 <tr><td>
2293 2294 <a href="/help/cat">
2294 2295 cat
2295 2296 </a>
2296 2297 </td><td>
2297 2298 output the current or given revision of files
2298 2299 </td></tr>
2299 2300 <tr><td>
2300 2301 <a href="/help/config">
2301 2302 config
2302 2303 </a>
2303 2304 </td><td>
2304 2305 show combined config settings from all hgrc files
2305 2306 </td></tr>
2306 2307 <tr><td>
2307 2308 <a href="/help/copy">
2308 2309 copy
2309 2310 </a>
2310 2311 </td><td>
2311 2312 mark files as copied for the next commit
2312 2313 </td></tr>
2313 2314 <tr><td>
2314 2315 <a href="/help/files">
2315 2316 files
2316 2317 </a>
2317 2318 </td><td>
2318 2319 list tracked files
2319 2320 </td></tr>
2320 2321 <tr><td>
2321 2322 <a href="/help/graft">
2322 2323 graft
2323 2324 </a>
2324 2325 </td><td>
2325 2326 copy changes from other branches onto the current branch
2326 2327 </td></tr>
2327 2328 <tr><td>
2328 2329 <a href="/help/grep">
2329 2330 grep
2330 2331 </a>
2331 2332 </td><td>
2332 2333 search revision history for a pattern in specified files
2333 2334 </td></tr>
2334 2335 <tr><td>
2335 2336 <a href="/help/heads">
2336 2337 heads
2337 2338 </a>
2338 2339 </td><td>
2339 2340 show branch heads
2340 2341 </td></tr>
2341 2342 <tr><td>
2342 2343 <a href="/help/help">
2343 2344 help
2344 2345 </a>
2345 2346 </td><td>
2346 2347 show help for a given topic or a help overview
2347 2348 </td></tr>
2348 2349 <tr><td>
2349 2350 <a href="/help/hgalias">
2350 2351 hgalias
2351 2352 </a>
2352 2353 </td><td>
2353 2354 summarize working directory state
2354 2355 </td></tr>
2355 2356 <tr><td>
2356 2357 <a href="/help/identify">
2357 2358 identify
2358 2359 </a>
2359 2360 </td><td>
2360 2361 identify the working directory or specified revision
2361 2362 </td></tr>
2362 2363 <tr><td>
2363 2364 <a href="/help/import">
2364 2365 import
2365 2366 </a>
2366 2367 </td><td>
2367 2368 import an ordered set of patches
2368 2369 </td></tr>
2369 2370 <tr><td>
2370 2371 <a href="/help/incoming">
2371 2372 incoming
2372 2373 </a>
2373 2374 </td><td>
2374 2375 show new changesets found in source
2375 2376 </td></tr>
2376 2377 <tr><td>
2377 2378 <a href="/help/manifest">
2378 2379 manifest
2379 2380 </a>
2380 2381 </td><td>
2381 2382 output the current or given revision of the project manifest
2382 2383 </td></tr>
2383 2384 <tr><td>
2384 2385 <a href="/help/nohelp">
2385 2386 nohelp
2386 2387 </a>
2387 2388 </td><td>
2388 2389 (no help text available)
2389 2390 </td></tr>
2390 2391 <tr><td>
2391 2392 <a href="/help/outgoing">
2392 2393 outgoing
2393 2394 </a>
2394 2395 </td><td>
2395 2396 show changesets not found in the destination
2396 2397 </td></tr>
2397 2398 <tr><td>
2398 2399 <a href="/help/paths">
2399 2400 paths
2400 2401 </a>
2401 2402 </td><td>
2402 2403 show aliases for remote repositories
2403 2404 </td></tr>
2404 2405 <tr><td>
2405 2406 <a href="/help/phase">
2406 2407 phase
2407 2408 </a>
2408 2409 </td><td>
2409 2410 set or show the current phase name
2410 2411 </td></tr>
2411 2412 <tr><td>
2412 2413 <a href="/help/recover">
2413 2414 recover
2414 2415 </a>
2415 2416 </td><td>
2416 2417 roll back an interrupted transaction
2417 2418 </td></tr>
2418 2419 <tr><td>
2419 2420 <a href="/help/rename">
2420 2421 rename
2421 2422 </a>
2422 2423 </td><td>
2423 2424 rename files; equivalent of copy + remove
2424 2425 </td></tr>
2425 2426 <tr><td>
2426 2427 <a href="/help/resolve">
2427 2428 resolve
2428 2429 </a>
2429 2430 </td><td>
2430 2431 redo merges or set/view the merge status of files
2431 2432 </td></tr>
2432 2433 <tr><td>
2433 2434 <a href="/help/revert">
2434 2435 revert
2435 2436 </a>
2436 2437 </td><td>
2437 2438 restore files to their checkout state
2438 2439 </td></tr>
2439 2440 <tr><td>
2440 2441 <a href="/help/root">
2441 2442 root
2442 2443 </a>
2443 2444 </td><td>
2444 2445 print the root (top) of the current working directory
2445 2446 </td></tr>
2446 2447 <tr><td>
2447 2448 <a href="/help/shellalias">
2448 2449 shellalias
2449 2450 </a>
2450 2451 </td><td>
2451 2452 (no help text available)
2452 2453 </td></tr>
2453 2454 <tr><td>
2454 2455 <a href="/help/tag">
2455 2456 tag
2456 2457 </a>
2457 2458 </td><td>
2458 2459 add one or more tags for the current or given revision
2459 2460 </td></tr>
2460 2461 <tr><td>
2461 2462 <a href="/help/tags">
2462 2463 tags
2463 2464 </a>
2464 2465 </td><td>
2465 2466 list repository tags
2466 2467 </td></tr>
2467 2468 <tr><td>
2468 2469 <a href="/help/unbundle">
2469 2470 unbundle
2470 2471 </a>
2471 2472 </td><td>
2472 2473 apply one or more bundle files
2473 2474 </td></tr>
2474 2475 <tr><td>
2475 2476 <a href="/help/verify">
2476 2477 verify
2477 2478 </a>
2478 2479 </td><td>
2479 2480 verify the integrity of the repository
2480 2481 </td></tr>
2481 2482 <tr><td>
2482 2483 <a href="/help/version">
2483 2484 version
2484 2485 </a>
2485 2486 </td><td>
2486 2487 output version and copyright information
2487 2488 </td></tr>
2488 2489
2489 2490
2490 2491 </table>
2491 2492 </div>
2492 2493 </div>
2493 2494
2494 2495
2495 2496
2496 2497 </body>
2497 2498 </html>
2498 2499
2499 2500
2500 2501 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2501 2502 200 Script output follows
2502 2503
2503 2504 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2504 2505 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2505 2506 <head>
2506 2507 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2507 2508 <meta name="robots" content="index, nofollow" />
2508 2509 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2509 2510 <script type="text/javascript" src="/static/mercurial.js"></script>
2510 2511
2511 2512 <title>Help: add</title>
2512 2513 </head>
2513 2514 <body>
2514 2515
2515 2516 <div class="container">
2516 2517 <div class="menu">
2517 2518 <div class="logo">
2518 2519 <a href="https://mercurial-scm.org/">
2519 2520 <img src="/static/hglogo.png" alt="mercurial" /></a>
2520 2521 </div>
2521 2522 <ul>
2522 2523 <li><a href="/shortlog">log</a></li>
2523 2524 <li><a href="/graph">graph</a></li>
2524 2525 <li><a href="/tags">tags</a></li>
2525 2526 <li><a href="/bookmarks">bookmarks</a></li>
2526 2527 <li><a href="/branches">branches</a></li>
2527 2528 </ul>
2528 2529 <ul>
2529 2530 <li class="active"><a href="/help">help</a></li>
2530 2531 </ul>
2531 2532 </div>
2532 2533
2533 2534 <div class="main">
2534 2535 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2535 2536 <h3>Help: add</h3>
2536 2537
2537 2538 <form class="search" action="/log">
2538 2539
2539 2540 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2540 2541 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2541 2542 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2542 2543 </form>
2543 2544 <div id="doc">
2544 2545 <p>
2545 2546 hg add [OPTION]... [FILE]...
2546 2547 </p>
2547 2548 <p>
2548 2549 add the specified files on the next commit
2549 2550 </p>
2550 2551 <p>
2551 2552 Schedule files to be version controlled and added to the
2552 2553 repository.
2553 2554 </p>
2554 2555 <p>
2555 2556 The files will be added to the repository at the next commit. To
2556 2557 undo an add before that, see 'hg forget'.
2557 2558 </p>
2558 2559 <p>
2559 2560 If no names are given, add all files to the repository (except
2560 2561 files matching &quot;.hgignore&quot;).
2561 2562 </p>
2562 2563 <p>
2563 2564 Examples:
2564 2565 </p>
2565 2566 <ul>
2566 2567 <li> New (unknown) files are added automatically by 'hg add':
2567 2568 <pre>
2568 2569 \$ ls (re)
2569 2570 foo.c
2570 2571 \$ hg status (re)
2571 2572 ? foo.c
2572 2573 \$ hg add (re)
2573 2574 adding foo.c
2574 2575 \$ hg status (re)
2575 2576 A foo.c
2576 2577 </pre>
2577 2578 <li> Specific files to be added can be specified:
2578 2579 <pre>
2579 2580 \$ ls (re)
2580 2581 bar.c foo.c
2581 2582 \$ hg status (re)
2582 2583 ? bar.c
2583 2584 ? foo.c
2584 2585 \$ hg add bar.c (re)
2585 2586 \$ hg status (re)
2586 2587 A bar.c
2587 2588 ? foo.c
2588 2589 </pre>
2589 2590 </ul>
2590 2591 <p>
2591 2592 Returns 0 if all files are successfully added.
2592 2593 </p>
2593 2594 <p>
2594 2595 options ([+] can be repeated):
2595 2596 </p>
2596 2597 <table>
2597 2598 <tr><td>-I</td>
2598 2599 <td>--include PATTERN [+]</td>
2599 2600 <td>include names matching the given patterns</td></tr>
2600 2601 <tr><td>-X</td>
2601 2602 <td>--exclude PATTERN [+]</td>
2602 2603 <td>exclude names matching the given patterns</td></tr>
2603 2604 <tr><td>-S</td>
2604 2605 <td>--subrepos</td>
2605 2606 <td>recurse into subrepositories</td></tr>
2606 2607 <tr><td>-n</td>
2607 2608 <td>--dry-run</td>
2608 2609 <td>do not perform actions, just print output</td></tr>
2609 2610 </table>
2610 2611 <p>
2611 2612 global options ([+] can be repeated):
2612 2613 </p>
2613 2614 <table>
2614 2615 <tr><td>-R</td>
2615 2616 <td>--repository REPO</td>
2616 2617 <td>repository root directory or name of overlay bundle file</td></tr>
2617 2618 <tr><td></td>
2618 2619 <td>--cwd DIR</td>
2619 2620 <td>change working directory</td></tr>
2620 2621 <tr><td>-y</td>
2621 2622 <td>--noninteractive</td>
2622 2623 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2623 2624 <tr><td>-q</td>
2624 2625 <td>--quiet</td>
2625 2626 <td>suppress output</td></tr>
2626 2627 <tr><td>-v</td>
2627 2628 <td>--verbose</td>
2628 2629 <td>enable additional output</td></tr>
2629 2630 <tr><td></td>
2630 2631 <td>--color TYPE</td>
2631 2632 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2632 2633 <tr><td></td>
2633 2634 <td>--config CONFIG [+]</td>
2634 2635 <td>set/override config option (use 'section.name=value')</td></tr>
2635 2636 <tr><td></td>
2636 2637 <td>--debug</td>
2637 2638 <td>enable debugging output</td></tr>
2638 2639 <tr><td></td>
2639 2640 <td>--debugger</td>
2640 2641 <td>start debugger</td></tr>
2641 2642 <tr><td></td>
2642 2643 <td>--encoding ENCODE</td>
2643 2644 <td>set the charset encoding (default: ascii)</td></tr>
2644 2645 <tr><td></td>
2645 2646 <td>--encodingmode MODE</td>
2646 2647 <td>set the charset encoding mode (default: strict)</td></tr>
2647 2648 <tr><td></td>
2648 2649 <td>--traceback</td>
2649 2650 <td>always print a traceback on exception</td></tr>
2650 2651 <tr><td></td>
2651 2652 <td>--time</td>
2652 2653 <td>time how long the command takes</td></tr>
2653 2654 <tr><td></td>
2654 2655 <td>--profile</td>
2655 2656 <td>print command execution profile</td></tr>
2656 2657 <tr><td></td>
2657 2658 <td>--version</td>
2658 2659 <td>output version information and exit</td></tr>
2659 2660 <tr><td>-h</td>
2660 2661 <td>--help</td>
2661 2662 <td>display help and exit</td></tr>
2662 2663 <tr><td></td>
2663 2664 <td>--hidden</td>
2664 2665 <td>consider hidden changesets</td></tr>
2665 2666 <tr><td></td>
2666 2667 <td>--pager TYPE</td>
2667 2668 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2668 2669 </table>
2669 2670
2670 2671 </div>
2671 2672 </div>
2672 2673 </div>
2673 2674
2674 2675
2675 2676
2676 2677 </body>
2677 2678 </html>
2678 2679
2679 2680
2680 2681 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2681 2682 200 Script output follows
2682 2683
2683 2684 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2684 2685 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2685 2686 <head>
2686 2687 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2687 2688 <meta name="robots" content="index, nofollow" />
2688 2689 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2689 2690 <script type="text/javascript" src="/static/mercurial.js"></script>
2690 2691
2691 2692 <title>Help: remove</title>
2692 2693 </head>
2693 2694 <body>
2694 2695
2695 2696 <div class="container">
2696 2697 <div class="menu">
2697 2698 <div class="logo">
2698 2699 <a href="https://mercurial-scm.org/">
2699 2700 <img src="/static/hglogo.png" alt="mercurial" /></a>
2700 2701 </div>
2701 2702 <ul>
2702 2703 <li><a href="/shortlog">log</a></li>
2703 2704 <li><a href="/graph">graph</a></li>
2704 2705 <li><a href="/tags">tags</a></li>
2705 2706 <li><a href="/bookmarks">bookmarks</a></li>
2706 2707 <li><a href="/branches">branches</a></li>
2707 2708 </ul>
2708 2709 <ul>
2709 2710 <li class="active"><a href="/help">help</a></li>
2710 2711 </ul>
2711 2712 </div>
2712 2713
2713 2714 <div class="main">
2714 2715 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2715 2716 <h3>Help: remove</h3>
2716 2717
2717 2718 <form class="search" action="/log">
2718 2719
2719 2720 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2720 2721 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2721 2722 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2722 2723 </form>
2723 2724 <div id="doc">
2724 2725 <p>
2725 2726 hg remove [OPTION]... FILE...
2726 2727 </p>
2727 2728 <p>
2728 2729 aliases: rm
2729 2730 </p>
2730 2731 <p>
2731 2732 remove the specified files on the next commit
2732 2733 </p>
2733 2734 <p>
2734 2735 Schedule the indicated files for removal from the current branch.
2735 2736 </p>
2736 2737 <p>
2737 2738 This command schedules the files to be removed at the next commit.
2738 2739 To undo a remove before that, see 'hg revert'. To undo added
2739 2740 files, see 'hg forget'.
2740 2741 </p>
2741 2742 <p>
2742 2743 -A/--after can be used to remove only files that have already
2743 2744 been deleted, -f/--force can be used to force deletion, and -Af
2744 2745 can be used to remove files from the next revision without
2745 2746 deleting them from the working directory.
2746 2747 </p>
2747 2748 <p>
2748 2749 The following table details the behavior of remove for different
2749 2750 file states (columns) and option combinations (rows). The file
2750 2751 states are Added [A], Clean [C], Modified [M] and Missing [!]
2751 2752 (as reported by 'hg status'). The actions are Warn, Remove
2752 2753 (from branch) and Delete (from disk):
2753 2754 </p>
2754 2755 <table>
2755 2756 <tr><td>opt/state</td>
2756 2757 <td>A</td>
2757 2758 <td>C</td>
2758 2759 <td>M</td>
2759 2760 <td>!</td></tr>
2760 2761 <tr><td>none</td>
2761 2762 <td>W</td>
2762 2763 <td>RD</td>
2763 2764 <td>W</td>
2764 2765 <td>R</td></tr>
2765 2766 <tr><td>-f</td>
2766 2767 <td>R</td>
2767 2768 <td>RD</td>
2768 2769 <td>RD</td>
2769 2770 <td>R</td></tr>
2770 2771 <tr><td>-A</td>
2771 2772 <td>W</td>
2772 2773 <td>W</td>
2773 2774 <td>W</td>
2774 2775 <td>R</td></tr>
2775 2776 <tr><td>-Af</td>
2776 2777 <td>R</td>
2777 2778 <td>R</td>
2778 2779 <td>R</td>
2779 2780 <td>R</td></tr>
2780 2781 </table>
2781 2782 <p>
2782 2783 <b>Note:</b>
2783 2784 </p>
2784 2785 <p>
2785 2786 'hg remove' never deletes files in Added [A] state from the
2786 2787 working directory, not even if &quot;--force&quot; is specified.
2787 2788 </p>
2788 2789 <p>
2789 2790 Returns 0 on success, 1 if any warnings encountered.
2790 2791 </p>
2791 2792 <p>
2792 2793 options ([+] can be repeated):
2793 2794 </p>
2794 2795 <table>
2795 2796 <tr><td>-A</td>
2796 2797 <td>--after</td>
2797 2798 <td>record delete for missing files</td></tr>
2798 2799 <tr><td>-f</td>
2799 2800 <td>--force</td>
2800 2801 <td>forget added files, delete modified files</td></tr>
2801 2802 <tr><td>-S</td>
2802 2803 <td>--subrepos</td>
2803 2804 <td>recurse into subrepositories</td></tr>
2804 2805 <tr><td>-I</td>
2805 2806 <td>--include PATTERN [+]</td>
2806 2807 <td>include names matching the given patterns</td></tr>
2807 2808 <tr><td>-X</td>
2808 2809 <td>--exclude PATTERN [+]</td>
2809 2810 <td>exclude names matching the given patterns</td></tr>
2810 2811 </table>
2811 2812 <p>
2812 2813 global options ([+] can be repeated):
2813 2814 </p>
2814 2815 <table>
2815 2816 <tr><td>-R</td>
2816 2817 <td>--repository REPO</td>
2817 2818 <td>repository root directory or name of overlay bundle file</td></tr>
2818 2819 <tr><td></td>
2819 2820 <td>--cwd DIR</td>
2820 2821 <td>change working directory</td></tr>
2821 2822 <tr><td>-y</td>
2822 2823 <td>--noninteractive</td>
2823 2824 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2824 2825 <tr><td>-q</td>
2825 2826 <td>--quiet</td>
2826 2827 <td>suppress output</td></tr>
2827 2828 <tr><td>-v</td>
2828 2829 <td>--verbose</td>
2829 2830 <td>enable additional output</td></tr>
2830 2831 <tr><td></td>
2831 2832 <td>--color TYPE</td>
2832 2833 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2833 2834 <tr><td></td>
2834 2835 <td>--config CONFIG [+]</td>
2835 2836 <td>set/override config option (use 'section.name=value')</td></tr>
2836 2837 <tr><td></td>
2837 2838 <td>--debug</td>
2838 2839 <td>enable debugging output</td></tr>
2839 2840 <tr><td></td>
2840 2841 <td>--debugger</td>
2841 2842 <td>start debugger</td></tr>
2842 2843 <tr><td></td>
2843 2844 <td>--encoding ENCODE</td>
2844 2845 <td>set the charset encoding (default: ascii)</td></tr>
2845 2846 <tr><td></td>
2846 2847 <td>--encodingmode MODE</td>
2847 2848 <td>set the charset encoding mode (default: strict)</td></tr>
2848 2849 <tr><td></td>
2849 2850 <td>--traceback</td>
2850 2851 <td>always print a traceback on exception</td></tr>
2851 2852 <tr><td></td>
2852 2853 <td>--time</td>
2853 2854 <td>time how long the command takes</td></tr>
2854 2855 <tr><td></td>
2855 2856 <td>--profile</td>
2856 2857 <td>print command execution profile</td></tr>
2857 2858 <tr><td></td>
2858 2859 <td>--version</td>
2859 2860 <td>output version information and exit</td></tr>
2860 2861 <tr><td>-h</td>
2861 2862 <td>--help</td>
2862 2863 <td>display help and exit</td></tr>
2863 2864 <tr><td></td>
2864 2865 <td>--hidden</td>
2865 2866 <td>consider hidden changesets</td></tr>
2866 2867 <tr><td></td>
2867 2868 <td>--pager TYPE</td>
2868 2869 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2869 2870 </table>
2870 2871
2871 2872 </div>
2872 2873 </div>
2873 2874 </div>
2874 2875
2875 2876
2876 2877
2877 2878 </body>
2878 2879 </html>
2879 2880
2880 2881
2881 2882 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2882 2883 200 Script output follows
2883 2884
2884 2885 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2885 2886 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2886 2887 <head>
2887 2888 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2888 2889 <meta name="robots" content="index, nofollow" />
2889 2890 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2890 2891 <script type="text/javascript" src="/static/mercurial.js"></script>
2891 2892
2892 2893 <title>Help: dates</title>
2893 2894 </head>
2894 2895 <body>
2895 2896
2896 2897 <div class="container">
2897 2898 <div class="menu">
2898 2899 <div class="logo">
2899 2900 <a href="https://mercurial-scm.org/">
2900 2901 <img src="/static/hglogo.png" alt="mercurial" /></a>
2901 2902 </div>
2902 2903 <ul>
2903 2904 <li><a href="/shortlog">log</a></li>
2904 2905 <li><a href="/graph">graph</a></li>
2905 2906 <li><a href="/tags">tags</a></li>
2906 2907 <li><a href="/bookmarks">bookmarks</a></li>
2907 2908 <li><a href="/branches">branches</a></li>
2908 2909 </ul>
2909 2910 <ul>
2910 2911 <li class="active"><a href="/help">help</a></li>
2911 2912 </ul>
2912 2913 </div>
2913 2914
2914 2915 <div class="main">
2915 2916 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2916 2917 <h3>Help: dates</h3>
2917 2918
2918 2919 <form class="search" action="/log">
2919 2920
2920 2921 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2921 2922 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2922 2923 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2923 2924 </form>
2924 2925 <div id="doc">
2925 2926 <h1>Date Formats</h1>
2926 2927 <p>
2927 2928 Some commands allow the user to specify a date, e.g.:
2928 2929 </p>
2929 2930 <ul>
2930 2931 <li> backout, commit, import, tag: Specify the commit date.
2931 2932 <li> log, revert, update: Select revision(s) by date.
2932 2933 </ul>
2933 2934 <p>
2934 2935 Many date formats are valid. Here are some examples:
2935 2936 </p>
2936 2937 <ul>
2937 2938 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2938 2939 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2939 2940 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2940 2941 <li> &quot;Dec 6&quot; (midnight)
2941 2942 <li> &quot;13:18&quot; (today assumed)
2942 2943 <li> &quot;3:39&quot; (3:39AM assumed)
2943 2944 <li> &quot;3:39pm&quot; (15:39)
2944 2945 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2945 2946 <li> &quot;2006-12-6 13:18&quot;
2946 2947 <li> &quot;2006-12-6&quot;
2947 2948 <li> &quot;12-6&quot;
2948 2949 <li> &quot;12/6&quot;
2949 2950 <li> &quot;12/6/6&quot; (Dec 6 2006)
2950 2951 <li> &quot;today&quot; (midnight)
2951 2952 <li> &quot;yesterday&quot; (midnight)
2952 2953 <li> &quot;now&quot; - right now
2953 2954 </ul>
2954 2955 <p>
2955 2956 Lastly, there is Mercurial's internal format:
2956 2957 </p>
2957 2958 <ul>
2958 2959 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
2959 2960 </ul>
2960 2961 <p>
2961 2962 This is the internal representation format for dates. The first number
2962 2963 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2963 2964 second is the offset of the local timezone, in seconds west of UTC
2964 2965 (negative if the timezone is east of UTC).
2965 2966 </p>
2966 2967 <p>
2967 2968 The log command also accepts date ranges:
2968 2969 </p>
2969 2970 <ul>
2970 2971 <li> &quot;&lt;DATE&quot; - at or before a given date/time
2971 2972 <li> &quot;&gt;DATE&quot; - on or after a given date/time
2972 2973 <li> &quot;DATE to DATE&quot; - a date range, inclusive
2973 2974 <li> &quot;-DAYS&quot; - within a given number of days of today
2974 2975 </ul>
2975 2976
2976 2977 </div>
2977 2978 </div>
2978 2979 </div>
2979 2980
2980 2981
2981 2982
2982 2983 </body>
2983 2984 </html>
2984 2985
2985 2986
2986 2987 Sub-topic indexes rendered properly
2987 2988
2988 2989 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
2989 2990 200 Script output follows
2990 2991
2991 2992 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2992 2993 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2993 2994 <head>
2994 2995 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2995 2996 <meta name="robots" content="index, nofollow" />
2996 2997 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2997 2998 <script type="text/javascript" src="/static/mercurial.js"></script>
2998 2999
2999 3000 <title>Help: internals</title>
3000 3001 </head>
3001 3002 <body>
3002 3003
3003 3004 <div class="container">
3004 3005 <div class="menu">
3005 3006 <div class="logo">
3006 3007 <a href="https://mercurial-scm.org/">
3007 3008 <img src="/static/hglogo.png" alt="mercurial" /></a>
3008 3009 </div>
3009 3010 <ul>
3010 3011 <li><a href="/shortlog">log</a></li>
3011 3012 <li><a href="/graph">graph</a></li>
3012 3013 <li><a href="/tags">tags</a></li>
3013 3014 <li><a href="/bookmarks">bookmarks</a></li>
3014 3015 <li><a href="/branches">branches</a></li>
3015 3016 </ul>
3016 3017 <ul>
3017 3018 <li><a href="/help">help</a></li>
3018 3019 </ul>
3019 3020 </div>
3020 3021
3021 3022 <div class="main">
3022 3023 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3023 3024
3024 3025 <form class="search" action="/log">
3025 3026
3026 3027 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3027 3028 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3028 3029 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3029 3030 </form>
3030 3031 <table class="bigtable">
3031 3032 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3032 3033
3033 3034 <tr><td>
3034 3035 <a href="/help/internals.bundles">
3035 3036 bundles
3036 3037 </a>
3037 3038 </td><td>
3038 3039 Bundles
3039 3040 </td></tr>
3040 3041 <tr><td>
3041 3042 <a href="/help/internals.censor">
3042 3043 censor
3043 3044 </a>
3044 3045 </td><td>
3045 3046 Censor
3046 3047 </td></tr>
3047 3048 <tr><td>
3048 3049 <a href="/help/internals.changegroups">
3049 3050 changegroups
3050 3051 </a>
3051 3052 </td><td>
3052 3053 Changegroups
3053 3054 </td></tr>
3054 3055 <tr><td>
3055 3056 <a href="/help/internals.requirements">
3056 3057 requirements
3057 3058 </a>
3058 3059 </td><td>
3059 3060 Repository Requirements
3060 3061 </td></tr>
3061 3062 <tr><td>
3062 3063 <a href="/help/internals.revlogs">
3063 3064 revlogs
3064 3065 </a>
3065 3066 </td><td>
3066 3067 Revision Logs
3067 3068 </td></tr>
3068 3069 <tr><td>
3069 3070 <a href="/help/internals.wireprotocol">
3070 3071 wireprotocol
3071 3072 </a>
3072 3073 </td><td>
3073 3074 Wire Protocol
3074 3075 </td></tr>
3075 3076
3076 3077
3077 3078
3078 3079
3079 3080
3080 3081 </table>
3081 3082 </div>
3082 3083 </div>
3083 3084
3084 3085
3085 3086
3086 3087 </body>
3087 3088 </html>
3088 3089
3089 3090
3090 3091 Sub-topic topics rendered properly
3091 3092
3092 3093 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3093 3094 200 Script output follows
3094 3095
3095 3096 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3096 3097 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3097 3098 <head>
3098 3099 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3099 3100 <meta name="robots" content="index, nofollow" />
3100 3101 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3101 3102 <script type="text/javascript" src="/static/mercurial.js"></script>
3102 3103
3103 3104 <title>Help: internals.changegroups</title>
3104 3105 </head>
3105 3106 <body>
3106 3107
3107 3108 <div class="container">
3108 3109 <div class="menu">
3109 3110 <div class="logo">
3110 3111 <a href="https://mercurial-scm.org/">
3111 3112 <img src="/static/hglogo.png" alt="mercurial" /></a>
3112 3113 </div>
3113 3114 <ul>
3114 3115 <li><a href="/shortlog">log</a></li>
3115 3116 <li><a href="/graph">graph</a></li>
3116 3117 <li><a href="/tags">tags</a></li>
3117 3118 <li><a href="/bookmarks">bookmarks</a></li>
3118 3119 <li><a href="/branches">branches</a></li>
3119 3120 </ul>
3120 3121 <ul>
3121 3122 <li class="active"><a href="/help">help</a></li>
3122 3123 </ul>
3123 3124 </div>
3124 3125
3125 3126 <div class="main">
3126 3127 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3127 3128 <h3>Help: internals.changegroups</h3>
3128 3129
3129 3130 <form class="search" action="/log">
3130 3131
3131 3132 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3132 3133 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3133 3134 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3134 3135 </form>
3135 3136 <div id="doc">
3136 3137 <h1>Changegroups</h1>
3137 3138 <p>
3138 3139 Changegroups are representations of repository revlog data, specifically
3139 3140 the changelog data, root/flat manifest data, treemanifest data, and
3140 3141 filelogs.
3141 3142 </p>
3142 3143 <p>
3143 3144 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3144 3145 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3145 3146 only difference being an additional item in the *delta header*. Version
3146 3147 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3147 3148 exchanging treemanifests (enabled by setting an option on the
3148 3149 &quot;changegroup&quot; part in the bundle2).
3149 3150 </p>
3150 3151 <p>
3151 3152 Changegroups when not exchanging treemanifests consist of 3 logical
3152 3153 segments:
3153 3154 </p>
3154 3155 <pre>
3155 3156 +---------------------------------+
3156 3157 | | | |
3157 3158 | changeset | manifest | filelogs |
3158 3159 | | | |
3159 3160 | | | |
3160 3161 +---------------------------------+
3161 3162 </pre>
3162 3163 <p>
3163 3164 When exchanging treemanifests, there are 4 logical segments:
3164 3165 </p>
3165 3166 <pre>
3166 3167 +-------------------------------------------------+
3167 3168 | | | | |
3168 3169 | changeset | root | treemanifests | filelogs |
3169 3170 | | manifest | | |
3170 3171 | | | | |
3171 3172 +-------------------------------------------------+
3172 3173 </pre>
3173 3174 <p>
3174 3175 The principle building block of each segment is a *chunk*. A *chunk*
3175 3176 is a framed piece of data:
3176 3177 </p>
3177 3178 <pre>
3178 3179 +---------------------------------------+
3179 3180 | | |
3180 3181 | length | data |
3181 3182 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3182 3183 | | |
3183 3184 +---------------------------------------+
3184 3185 </pre>
3185 3186 <p>
3186 3187 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3187 3188 integer indicating the length of the entire chunk (including the length field
3188 3189 itself).
3189 3190 </p>
3190 3191 <p>
3191 3192 There is a special case chunk that has a value of 0 for the length
3192 3193 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3193 3194 </p>
3194 3195 <h2>Delta Groups</h2>
3195 3196 <p>
3196 3197 A *delta group* expresses the content of a revlog as a series of deltas,
3197 3198 or patches against previous revisions.
3198 3199 </p>
3199 3200 <p>
3200 3201 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3201 3202 to signal the end of the delta group:
3202 3203 </p>
3203 3204 <pre>
3204 3205 +------------------------------------------------------------------------+
3205 3206 | | | | | |
3206 3207 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3207 3208 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3208 3209 | | | | | |
3209 3210 +------------------------------------------------------------------------+
3210 3211 </pre>
3211 3212 <p>
3212 3213 Each *chunk*'s data consists of the following:
3213 3214 </p>
3214 3215 <pre>
3215 3216 +---------------------------------------+
3216 3217 | | |
3217 3218 | delta header | delta data |
3218 3219 | (various by version) | (various) |
3219 3220 | | |
3220 3221 +---------------------------------------+
3221 3222 </pre>
3222 3223 <p>
3223 3224 The *delta data* is a series of *delta*s that describe a diff from an existing
3224 3225 entry (either that the recipient already has, or previously specified in the
3225 3226 bundle/changegroup).
3226 3227 </p>
3227 3228 <p>
3228 3229 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3229 3230 &quot;3&quot; of the changegroup format.
3230 3231 </p>
3231 3232 <p>
3232 3233 Version 1 (headerlen=80):
3233 3234 </p>
3234 3235 <pre>
3235 3236 +------------------------------------------------------+
3236 3237 | | | | |
3237 3238 | node | p1 node | p2 node | link node |
3238 3239 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3239 3240 | | | | |
3240 3241 +------------------------------------------------------+
3241 3242 </pre>
3242 3243 <p>
3243 3244 Version 2 (headerlen=100):
3244 3245 </p>
3245 3246 <pre>
3246 3247 +------------------------------------------------------------------+
3247 3248 | | | | | |
3248 3249 | node | p1 node | p2 node | base node | link node |
3249 3250 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3250 3251 | | | | | |
3251 3252 +------------------------------------------------------------------+
3252 3253 </pre>
3253 3254 <p>
3254 3255 Version 3 (headerlen=102):
3255 3256 </p>
3256 3257 <pre>
3257 3258 +------------------------------------------------------------------------------+
3258 3259 | | | | | | |
3259 3260 | node | p1 node | p2 node | base node | link node | flags |
3260 3261 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3261 3262 | | | | | | |
3262 3263 +------------------------------------------------------------------------------+
3263 3264 </pre>
3264 3265 <p>
3265 3266 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3266 3267 series of *delta*s, densely packed (no separators). These deltas describe a diff
3267 3268 from an existing entry (either that the recipient already has, or previously
3268 3269 specified in the bundle/changegroup). The format is described more fully in
3269 3270 &quot;hg help internals.bdiff&quot;, but briefly:
3270 3271 </p>
3271 3272 <pre>
3272 3273 +---------------------------------------------------------------+
3273 3274 | | | | |
3274 3275 | start offset | end offset | new length | content |
3275 3276 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3276 3277 | | | | |
3277 3278 +---------------------------------------------------------------+
3278 3279 </pre>
3279 3280 <p>
3280 3281 Please note that the length field in the delta data does *not* include itself.
3281 3282 </p>
3282 3283 <p>
3283 3284 In version 1, the delta is always applied against the previous node from
3284 3285 the changegroup or the first parent if this is the first entry in the
3285 3286 changegroup.
3286 3287 </p>
3287 3288 <p>
3288 3289 In version 2 and up, the delta base node is encoded in the entry in the
3289 3290 changegroup. This allows the delta to be expressed against any parent,
3290 3291 which can result in smaller deltas and more efficient encoding of data.
3291 3292 </p>
3292 3293 <h2>Changeset Segment</h2>
3293 3294 <p>
3294 3295 The *changeset segment* consists of a single *delta group* holding
3295 3296 changelog data. The *empty chunk* at the end of the *delta group* denotes
3296 3297 the boundary to the *manifest segment*.
3297 3298 </p>
3298 3299 <h2>Manifest Segment</h2>
3299 3300 <p>
3300 3301 The *manifest segment* consists of a single *delta group* holding manifest
3301 3302 data. If treemanifests are in use, it contains only the manifest for the
3302 3303 root directory of the repository. Otherwise, it contains the entire
3303 3304 manifest data. The *empty chunk* at the end of the *delta group* denotes
3304 3305 the boundary to the next segment (either the *treemanifests segment* or the
3305 3306 *filelogs segment*, depending on version and the request options).
3306 3307 </p>
3307 3308 <h3>Treemanifests Segment</h3>
3308 3309 <p>
3309 3310 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3310 3311 only if the 'treemanifest' param is part of the bundle2 changegroup part
3311 3312 (it is not possible to use changegroup version 3 outside of bundle2).
3312 3313 Aside from the filenames in the *treemanifests segment* containing a
3313 3314 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3314 3315 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3315 3316 a sub-segment with filename size 0). This denotes the boundary to the
3316 3317 *filelogs segment*.
3317 3318 </p>
3318 3319 <h2>Filelogs Segment</h2>
3319 3320 <p>
3320 3321 The *filelogs segment* consists of multiple sub-segments, each
3321 3322 corresponding to an individual file whose data is being described:
3322 3323 </p>
3323 3324 <pre>
3324 3325 +--------------------------------------------------+
3325 3326 | | | | | |
3326 3327 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3327 3328 | | | | | (4 bytes) |
3328 3329 | | | | | |
3329 3330 +--------------------------------------------------+
3330 3331 </pre>
3331 3332 <p>
3332 3333 The final filelog sub-segment is followed by an *empty chunk* (logically,
3333 3334 a sub-segment with filename size 0). This denotes the end of the segment
3334 3335 and of the overall changegroup.
3335 3336 </p>
3336 3337 <p>
3337 3338 Each filelog sub-segment consists of the following:
3338 3339 </p>
3339 3340 <pre>
3340 3341 +------------------------------------------------------+
3341 3342 | | | |
3342 3343 | filename length | filename | delta group |
3343 3344 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3344 3345 | | | |
3345 3346 +------------------------------------------------------+
3346 3347 </pre>
3347 3348 <p>
3348 3349 That is, a *chunk* consisting of the filename (not terminated or padded)
3349 3350 followed by N chunks constituting the *delta group* for this file. The
3350 3351 *empty chunk* at the end of each *delta group* denotes the boundary to the
3351 3352 next filelog sub-segment.
3352 3353 </p>
3353 3354
3354 3355 </div>
3355 3356 </div>
3356 3357 </div>
3357 3358
3358 3359
3359 3360
3360 3361 </body>
3361 3362 </html>
3362 3363
3363 3364
3364 3365 $ killdaemons.py
3365 3366
3366 3367 #endif
General Comments 0
You need to be logged in to leave comments. Login now