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