##// END OF EJS Templates
debugcommands: add debugserve command...
Gregory Szorc -
r36544:44dc34b8 default
parent child Browse files
Show More
@@ -1,2499 +1,2531 b''
1 # debugcommands.py - command processing for debug* commands
1 # debugcommands.py - command processing for debug* commands
2 #
2 #
3 # Copyright 2005-2016 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2016 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import codecs
10 import codecs
11 import collections
11 import collections
12 import difflib
12 import difflib
13 import errno
13 import errno
14 import operator
14 import operator
15 import os
15 import os
16 import random
16 import random
17 import socket
17 import socket
18 import ssl
18 import ssl
19 import string
19 import string
20 import sys
20 import sys
21 import tempfile
21 import tempfile
22 import time
22 import time
23
23
24 from .i18n import _
24 from .i18n import _
25 from .node import (
25 from .node import (
26 bin,
26 bin,
27 hex,
27 hex,
28 nullhex,
28 nullhex,
29 nullid,
29 nullid,
30 nullrev,
30 nullrev,
31 short,
31 short,
32 )
32 )
33 from . import (
33 from . import (
34 bundle2,
34 bundle2,
35 changegroup,
35 changegroup,
36 cmdutil,
36 cmdutil,
37 color,
37 color,
38 context,
38 context,
39 dagparser,
39 dagparser,
40 dagutil,
40 dagutil,
41 encoding,
41 encoding,
42 error,
42 error,
43 exchange,
43 exchange,
44 extensions,
44 extensions,
45 filemerge,
45 filemerge,
46 fileset,
46 fileset,
47 formatter,
47 formatter,
48 hg,
48 hg,
49 localrepo,
49 localrepo,
50 lock as lockmod,
50 lock as lockmod,
51 logcmdutil,
51 logcmdutil,
52 merge as mergemod,
52 merge as mergemod,
53 obsolete,
53 obsolete,
54 obsutil,
54 obsutil,
55 phases,
55 phases,
56 policy,
56 policy,
57 pvec,
57 pvec,
58 pycompat,
58 pycompat,
59 registrar,
59 registrar,
60 repair,
60 repair,
61 revlog,
61 revlog,
62 revset,
62 revset,
63 revsetlang,
63 revsetlang,
64 scmutil,
64 scmutil,
65 setdiscovery,
65 setdiscovery,
66 simplemerge,
66 simplemerge,
67 smartset,
67 smartset,
68 sslutil,
68 sslutil,
69 streamclone,
69 streamclone,
70 templater,
70 templater,
71 treediscovery,
71 treediscovery,
72 upgrade,
72 upgrade,
73 url as urlmod,
73 url as urlmod,
74 util,
74 util,
75 vfs as vfsmod,
75 vfs as vfsmod,
76 wireprotoserver,
76 )
77 )
77
78
78 release = lockmod.release
79 release = lockmod.release
79
80
80 command = registrar.command()
81 command = registrar.command()
81
82
82 @command('debugancestor', [], _('[INDEX] REV1 REV2'), optionalrepo=True)
83 @command('debugancestor', [], _('[INDEX] REV1 REV2'), optionalrepo=True)
83 def debugancestor(ui, repo, *args):
84 def debugancestor(ui, repo, *args):
84 """find the ancestor revision of two revisions in a given index"""
85 """find the ancestor revision of two revisions in a given index"""
85 if len(args) == 3:
86 if len(args) == 3:
86 index, rev1, rev2 = args
87 index, rev1, rev2 = args
87 r = revlog.revlog(vfsmod.vfs(pycompat.getcwd(), audit=False), index)
88 r = revlog.revlog(vfsmod.vfs(pycompat.getcwd(), audit=False), index)
88 lookup = r.lookup
89 lookup = r.lookup
89 elif len(args) == 2:
90 elif len(args) == 2:
90 if not repo:
91 if not repo:
91 raise error.Abort(_('there is no Mercurial repository here '
92 raise error.Abort(_('there is no Mercurial repository here '
92 '(.hg not found)'))
93 '(.hg not found)'))
93 rev1, rev2 = args
94 rev1, rev2 = args
94 r = repo.changelog
95 r = repo.changelog
95 lookup = repo.lookup
96 lookup = repo.lookup
96 else:
97 else:
97 raise error.Abort(_('either two or three arguments required'))
98 raise error.Abort(_('either two or three arguments required'))
98 a = r.ancestor(lookup(rev1), lookup(rev2))
99 a = r.ancestor(lookup(rev1), lookup(rev2))
99 ui.write('%d:%s\n' % (r.rev(a), hex(a)))
100 ui.write('%d:%s\n' % (r.rev(a), hex(a)))
100
101
101 @command('debugapplystreamclonebundle', [], 'FILE')
102 @command('debugapplystreamclonebundle', [], 'FILE')
102 def debugapplystreamclonebundle(ui, repo, fname):
103 def debugapplystreamclonebundle(ui, repo, fname):
103 """apply a stream clone bundle file"""
104 """apply a stream clone bundle file"""
104 f = hg.openpath(ui, fname)
105 f = hg.openpath(ui, fname)
105 gen = exchange.readbundle(ui, f, fname)
106 gen = exchange.readbundle(ui, f, fname)
106 gen.apply(repo)
107 gen.apply(repo)
107
108
108 @command('debugbuilddag',
109 @command('debugbuilddag',
109 [('m', 'mergeable-file', None, _('add single file mergeable changes')),
110 [('m', 'mergeable-file', None, _('add single file mergeable changes')),
110 ('o', 'overwritten-file', None, _('add single file all revs overwrite')),
111 ('o', 'overwritten-file', None, _('add single file all revs overwrite')),
111 ('n', 'new-file', None, _('add new file at each rev'))],
112 ('n', 'new-file', None, _('add new file at each rev'))],
112 _('[OPTION]... [TEXT]'))
113 _('[OPTION]... [TEXT]'))
113 def debugbuilddag(ui, repo, text=None,
114 def debugbuilddag(ui, repo, text=None,
114 mergeable_file=False,
115 mergeable_file=False,
115 overwritten_file=False,
116 overwritten_file=False,
116 new_file=False):
117 new_file=False):
117 """builds a repo with a given DAG from scratch in the current empty repo
118 """builds a repo with a given DAG from scratch in the current empty repo
118
119
119 The description of the DAG is read from stdin if not given on the
120 The description of the DAG is read from stdin if not given on the
120 command line.
121 command line.
121
122
122 Elements:
123 Elements:
123
124
124 - "+n" is a linear run of n nodes based on the current default parent
125 - "+n" is a linear run of n nodes based on the current default parent
125 - "." is a single node based on the current default parent
126 - "." is a single node based on the current default parent
126 - "$" resets the default parent to null (implied at the start);
127 - "$" resets the default parent to null (implied at the start);
127 otherwise the default parent is always the last node created
128 otherwise the default parent is always the last node created
128 - "<p" sets the default parent to the backref p
129 - "<p" sets the default parent to the backref p
129 - "*p" is a fork at parent p, which is a backref
130 - "*p" is a fork at parent p, which is a backref
130 - "*p1/p2" is a merge of parents p1 and p2, which are backrefs
131 - "*p1/p2" is a merge of parents p1 and p2, which are backrefs
131 - "/p2" is a merge of the preceding node and p2
132 - "/p2" is a merge of the preceding node and p2
132 - ":tag" defines a local tag for the preceding node
133 - ":tag" defines a local tag for the preceding node
133 - "@branch" sets the named branch for subsequent nodes
134 - "@branch" sets the named branch for subsequent nodes
134 - "#...\\n" is a comment up to the end of the line
135 - "#...\\n" is a comment up to the end of the line
135
136
136 Whitespace between the above elements is ignored.
137 Whitespace between the above elements is ignored.
137
138
138 A backref is either
139 A backref is either
139
140
140 - a number n, which references the node curr-n, where curr is the current
141 - a number n, which references the node curr-n, where curr is the current
141 node, or
142 node, or
142 - the name of a local tag you placed earlier using ":tag", or
143 - the name of a local tag you placed earlier using ":tag", or
143 - empty to denote the default parent.
144 - empty to denote the default parent.
144
145
145 All string valued-elements are either strictly alphanumeric, or must
146 All string valued-elements are either strictly alphanumeric, or must
146 be enclosed in double quotes ("..."), with "\\" as escape character.
147 be enclosed in double quotes ("..."), with "\\" as escape character.
147 """
148 """
148
149
149 if text is None:
150 if text is None:
150 ui.status(_("reading DAG from stdin\n"))
151 ui.status(_("reading DAG from stdin\n"))
151 text = ui.fin.read()
152 text = ui.fin.read()
152
153
153 cl = repo.changelog
154 cl = repo.changelog
154 if len(cl) > 0:
155 if len(cl) > 0:
155 raise error.Abort(_('repository is not empty'))
156 raise error.Abort(_('repository is not empty'))
156
157
157 # determine number of revs in DAG
158 # determine number of revs in DAG
158 total = 0
159 total = 0
159 for type, data in dagparser.parsedag(text):
160 for type, data in dagparser.parsedag(text):
160 if type == 'n':
161 if type == 'n':
161 total += 1
162 total += 1
162
163
163 if mergeable_file:
164 if mergeable_file:
164 linesperrev = 2
165 linesperrev = 2
165 # make a file with k lines per rev
166 # make a file with k lines per rev
166 initialmergedlines = ['%d' % i for i in xrange(0, total * linesperrev)]
167 initialmergedlines = ['%d' % i for i in xrange(0, total * linesperrev)]
167 initialmergedlines.append("")
168 initialmergedlines.append("")
168
169
169 tags = []
170 tags = []
170
171
171 wlock = lock = tr = None
172 wlock = lock = tr = None
172 try:
173 try:
173 wlock = repo.wlock()
174 wlock = repo.wlock()
174 lock = repo.lock()
175 lock = repo.lock()
175 tr = repo.transaction("builddag")
176 tr = repo.transaction("builddag")
176
177
177 at = -1
178 at = -1
178 atbranch = 'default'
179 atbranch = 'default'
179 nodeids = []
180 nodeids = []
180 id = 0
181 id = 0
181 ui.progress(_('building'), id, unit=_('revisions'), total=total)
182 ui.progress(_('building'), id, unit=_('revisions'), total=total)
182 for type, data in dagparser.parsedag(text):
183 for type, data in dagparser.parsedag(text):
183 if type == 'n':
184 if type == 'n':
184 ui.note(('node %s\n' % pycompat.bytestr(data)))
185 ui.note(('node %s\n' % pycompat.bytestr(data)))
185 id, ps = data
186 id, ps = data
186
187
187 files = []
188 files = []
188 filecontent = {}
189 filecontent = {}
189
190
190 p2 = None
191 p2 = None
191 if mergeable_file:
192 if mergeable_file:
192 fn = "mf"
193 fn = "mf"
193 p1 = repo[ps[0]]
194 p1 = repo[ps[0]]
194 if len(ps) > 1:
195 if len(ps) > 1:
195 p2 = repo[ps[1]]
196 p2 = repo[ps[1]]
196 pa = p1.ancestor(p2)
197 pa = p1.ancestor(p2)
197 base, local, other = [x[fn].data() for x in (pa, p1,
198 base, local, other = [x[fn].data() for x in (pa, p1,
198 p2)]
199 p2)]
199 m3 = simplemerge.Merge3Text(base, local, other)
200 m3 = simplemerge.Merge3Text(base, local, other)
200 ml = [l.strip() for l in m3.merge_lines()]
201 ml = [l.strip() for l in m3.merge_lines()]
201 ml.append("")
202 ml.append("")
202 elif at > 0:
203 elif at > 0:
203 ml = p1[fn].data().split("\n")
204 ml = p1[fn].data().split("\n")
204 else:
205 else:
205 ml = initialmergedlines
206 ml = initialmergedlines
206 ml[id * linesperrev] += " r%i" % id
207 ml[id * linesperrev] += " r%i" % id
207 mergedtext = "\n".join(ml)
208 mergedtext = "\n".join(ml)
208 files.append(fn)
209 files.append(fn)
209 filecontent[fn] = mergedtext
210 filecontent[fn] = mergedtext
210
211
211 if overwritten_file:
212 if overwritten_file:
212 fn = "of"
213 fn = "of"
213 files.append(fn)
214 files.append(fn)
214 filecontent[fn] = "r%i\n" % id
215 filecontent[fn] = "r%i\n" % id
215
216
216 if new_file:
217 if new_file:
217 fn = "nf%i" % id
218 fn = "nf%i" % id
218 files.append(fn)
219 files.append(fn)
219 filecontent[fn] = "r%i\n" % id
220 filecontent[fn] = "r%i\n" % id
220 if len(ps) > 1:
221 if len(ps) > 1:
221 if not p2:
222 if not p2:
222 p2 = repo[ps[1]]
223 p2 = repo[ps[1]]
223 for fn in p2:
224 for fn in p2:
224 if fn.startswith("nf"):
225 if fn.startswith("nf"):
225 files.append(fn)
226 files.append(fn)
226 filecontent[fn] = p2[fn].data()
227 filecontent[fn] = p2[fn].data()
227
228
228 def fctxfn(repo, cx, path):
229 def fctxfn(repo, cx, path):
229 if path in filecontent:
230 if path in filecontent:
230 return context.memfilectx(repo, cx, path,
231 return context.memfilectx(repo, cx, path,
231 filecontent[path])
232 filecontent[path])
232 return None
233 return None
233
234
234 if len(ps) == 0 or ps[0] < 0:
235 if len(ps) == 0 or ps[0] < 0:
235 pars = [None, None]
236 pars = [None, None]
236 elif len(ps) == 1:
237 elif len(ps) == 1:
237 pars = [nodeids[ps[0]], None]
238 pars = [nodeids[ps[0]], None]
238 else:
239 else:
239 pars = [nodeids[p] for p in ps]
240 pars = [nodeids[p] for p in ps]
240 cx = context.memctx(repo, pars, "r%i" % id, files, fctxfn,
241 cx = context.memctx(repo, pars, "r%i" % id, files, fctxfn,
241 date=(id, 0),
242 date=(id, 0),
242 user="debugbuilddag",
243 user="debugbuilddag",
243 extra={'branch': atbranch})
244 extra={'branch': atbranch})
244 nodeid = repo.commitctx(cx)
245 nodeid = repo.commitctx(cx)
245 nodeids.append(nodeid)
246 nodeids.append(nodeid)
246 at = id
247 at = id
247 elif type == 'l':
248 elif type == 'l':
248 id, name = data
249 id, name = data
249 ui.note(('tag %s\n' % name))
250 ui.note(('tag %s\n' % name))
250 tags.append("%s %s\n" % (hex(repo.changelog.node(id)), name))
251 tags.append("%s %s\n" % (hex(repo.changelog.node(id)), name))
251 elif type == 'a':
252 elif type == 'a':
252 ui.note(('branch %s\n' % data))
253 ui.note(('branch %s\n' % data))
253 atbranch = data
254 atbranch = data
254 ui.progress(_('building'), id, unit=_('revisions'), total=total)
255 ui.progress(_('building'), id, unit=_('revisions'), total=total)
255 tr.close()
256 tr.close()
256
257
257 if tags:
258 if tags:
258 repo.vfs.write("localtags", "".join(tags))
259 repo.vfs.write("localtags", "".join(tags))
259 finally:
260 finally:
260 ui.progress(_('building'), None)
261 ui.progress(_('building'), None)
261 release(tr, lock, wlock)
262 release(tr, lock, wlock)
262
263
263 def _debugchangegroup(ui, gen, all=None, indent=0, **opts):
264 def _debugchangegroup(ui, gen, all=None, indent=0, **opts):
264 indent_string = ' ' * indent
265 indent_string = ' ' * indent
265 if all:
266 if all:
266 ui.write(("%sformat: id, p1, p2, cset, delta base, len(delta)\n")
267 ui.write(("%sformat: id, p1, p2, cset, delta base, len(delta)\n")
267 % indent_string)
268 % indent_string)
268
269
269 def showchunks(named):
270 def showchunks(named):
270 ui.write("\n%s%s\n" % (indent_string, named))
271 ui.write("\n%s%s\n" % (indent_string, named))
271 for deltadata in gen.deltaiter():
272 for deltadata in gen.deltaiter():
272 node, p1, p2, cs, deltabase, delta, flags = deltadata
273 node, p1, p2, cs, deltabase, delta, flags = deltadata
273 ui.write("%s%s %s %s %s %s %d\n" %
274 ui.write("%s%s %s %s %s %s %d\n" %
274 (indent_string, hex(node), hex(p1), hex(p2),
275 (indent_string, hex(node), hex(p1), hex(p2),
275 hex(cs), hex(deltabase), len(delta)))
276 hex(cs), hex(deltabase), len(delta)))
276
277
277 chunkdata = gen.changelogheader()
278 chunkdata = gen.changelogheader()
278 showchunks("changelog")
279 showchunks("changelog")
279 chunkdata = gen.manifestheader()
280 chunkdata = gen.manifestheader()
280 showchunks("manifest")
281 showchunks("manifest")
281 for chunkdata in iter(gen.filelogheader, {}):
282 for chunkdata in iter(gen.filelogheader, {}):
282 fname = chunkdata['filename']
283 fname = chunkdata['filename']
283 showchunks(fname)
284 showchunks(fname)
284 else:
285 else:
285 if isinstance(gen, bundle2.unbundle20):
286 if isinstance(gen, bundle2.unbundle20):
286 raise error.Abort(_('use debugbundle2 for this file'))
287 raise error.Abort(_('use debugbundle2 for this file'))
287 chunkdata = gen.changelogheader()
288 chunkdata = gen.changelogheader()
288 for deltadata in gen.deltaiter():
289 for deltadata in gen.deltaiter():
289 node, p1, p2, cs, deltabase, delta, flags = deltadata
290 node, p1, p2, cs, deltabase, delta, flags = deltadata
290 ui.write("%s%s\n" % (indent_string, hex(node)))
291 ui.write("%s%s\n" % (indent_string, hex(node)))
291
292
292 def _debugobsmarkers(ui, part, indent=0, **opts):
293 def _debugobsmarkers(ui, part, indent=0, **opts):
293 """display version and markers contained in 'data'"""
294 """display version and markers contained in 'data'"""
294 opts = pycompat.byteskwargs(opts)
295 opts = pycompat.byteskwargs(opts)
295 data = part.read()
296 data = part.read()
296 indent_string = ' ' * indent
297 indent_string = ' ' * indent
297 try:
298 try:
298 version, markers = obsolete._readmarkers(data)
299 version, markers = obsolete._readmarkers(data)
299 except error.UnknownVersion as exc:
300 except error.UnknownVersion as exc:
300 msg = "%sunsupported version: %s (%d bytes)\n"
301 msg = "%sunsupported version: %s (%d bytes)\n"
301 msg %= indent_string, exc.version, len(data)
302 msg %= indent_string, exc.version, len(data)
302 ui.write(msg)
303 ui.write(msg)
303 else:
304 else:
304 msg = "%sversion: %d (%d bytes)\n"
305 msg = "%sversion: %d (%d bytes)\n"
305 msg %= indent_string, version, len(data)
306 msg %= indent_string, version, len(data)
306 ui.write(msg)
307 ui.write(msg)
307 fm = ui.formatter('debugobsolete', opts)
308 fm = ui.formatter('debugobsolete', opts)
308 for rawmarker in sorted(markers):
309 for rawmarker in sorted(markers):
309 m = obsutil.marker(None, rawmarker)
310 m = obsutil.marker(None, rawmarker)
310 fm.startitem()
311 fm.startitem()
311 fm.plain(indent_string)
312 fm.plain(indent_string)
312 cmdutil.showmarker(fm, m)
313 cmdutil.showmarker(fm, m)
313 fm.end()
314 fm.end()
314
315
315 def _debugphaseheads(ui, data, indent=0):
316 def _debugphaseheads(ui, data, indent=0):
316 """display version and markers contained in 'data'"""
317 """display version and markers contained in 'data'"""
317 indent_string = ' ' * indent
318 indent_string = ' ' * indent
318 headsbyphase = phases.binarydecode(data)
319 headsbyphase = phases.binarydecode(data)
319 for phase in phases.allphases:
320 for phase in phases.allphases:
320 for head in headsbyphase[phase]:
321 for head in headsbyphase[phase]:
321 ui.write(indent_string)
322 ui.write(indent_string)
322 ui.write('%s %s\n' % (hex(head), phases.phasenames[phase]))
323 ui.write('%s %s\n' % (hex(head), phases.phasenames[phase]))
323
324
324 def _quasirepr(thing):
325 def _quasirepr(thing):
325 if isinstance(thing, (dict, util.sortdict, collections.OrderedDict)):
326 if isinstance(thing, (dict, util.sortdict, collections.OrderedDict)):
326 return '{%s}' % (
327 return '{%s}' % (
327 b', '.join(b'%s: %s' % (k, thing[k]) for k in sorted(thing)))
328 b', '.join(b'%s: %s' % (k, thing[k]) for k in sorted(thing)))
328 return pycompat.bytestr(repr(thing))
329 return pycompat.bytestr(repr(thing))
329
330
330 def _debugbundle2(ui, gen, all=None, **opts):
331 def _debugbundle2(ui, gen, all=None, **opts):
331 """lists the contents of a bundle2"""
332 """lists the contents of a bundle2"""
332 if not isinstance(gen, bundle2.unbundle20):
333 if not isinstance(gen, bundle2.unbundle20):
333 raise error.Abort(_('not a bundle2 file'))
334 raise error.Abort(_('not a bundle2 file'))
334 ui.write(('Stream params: %s\n' % _quasirepr(gen.params)))
335 ui.write(('Stream params: %s\n' % _quasirepr(gen.params)))
335 parttypes = opts.get(r'part_type', [])
336 parttypes = opts.get(r'part_type', [])
336 for part in gen.iterparts():
337 for part in gen.iterparts():
337 if parttypes and part.type not in parttypes:
338 if parttypes and part.type not in parttypes:
338 continue
339 continue
339 ui.write('%s -- %s\n' % (part.type, _quasirepr(part.params)))
340 ui.write('%s -- %s\n' % (part.type, _quasirepr(part.params)))
340 if part.type == 'changegroup':
341 if part.type == 'changegroup':
341 version = part.params.get('version', '01')
342 version = part.params.get('version', '01')
342 cg = changegroup.getunbundler(version, part, 'UN')
343 cg = changegroup.getunbundler(version, part, 'UN')
343 _debugchangegroup(ui, cg, all=all, indent=4, **opts)
344 _debugchangegroup(ui, cg, all=all, indent=4, **opts)
344 if part.type == 'obsmarkers':
345 if part.type == 'obsmarkers':
345 _debugobsmarkers(ui, part, indent=4, **opts)
346 _debugobsmarkers(ui, part, indent=4, **opts)
346 if part.type == 'phase-heads':
347 if part.type == 'phase-heads':
347 _debugphaseheads(ui, part, indent=4)
348 _debugphaseheads(ui, part, indent=4)
348
349
349 @command('debugbundle',
350 @command('debugbundle',
350 [('a', 'all', None, _('show all details')),
351 [('a', 'all', None, _('show all details')),
351 ('', 'part-type', [], _('show only the named part type')),
352 ('', 'part-type', [], _('show only the named part type')),
352 ('', 'spec', None, _('print the bundlespec of the bundle'))],
353 ('', 'spec', None, _('print the bundlespec of the bundle'))],
353 _('FILE'),
354 _('FILE'),
354 norepo=True)
355 norepo=True)
355 def debugbundle(ui, bundlepath, all=None, spec=None, **opts):
356 def debugbundle(ui, bundlepath, all=None, spec=None, **opts):
356 """lists the contents of a bundle"""
357 """lists the contents of a bundle"""
357 with hg.openpath(ui, bundlepath) as f:
358 with hg.openpath(ui, bundlepath) as f:
358 if spec:
359 if spec:
359 spec = exchange.getbundlespec(ui, f)
360 spec = exchange.getbundlespec(ui, f)
360 ui.write('%s\n' % spec)
361 ui.write('%s\n' % spec)
361 return
362 return
362
363
363 gen = exchange.readbundle(ui, f, bundlepath)
364 gen = exchange.readbundle(ui, f, bundlepath)
364 if isinstance(gen, bundle2.unbundle20):
365 if isinstance(gen, bundle2.unbundle20):
365 return _debugbundle2(ui, gen, all=all, **opts)
366 return _debugbundle2(ui, gen, all=all, **opts)
366 _debugchangegroup(ui, gen, all=all, **opts)
367 _debugchangegroup(ui, gen, all=all, **opts)
367
368
368 @command('debugcapabilities',
369 @command('debugcapabilities',
369 [], _('PATH'),
370 [], _('PATH'),
370 norepo=True)
371 norepo=True)
371 def debugcapabilities(ui, path, **opts):
372 def debugcapabilities(ui, path, **opts):
372 """lists the capabilities of a remote peer"""
373 """lists the capabilities of a remote peer"""
373 opts = pycompat.byteskwargs(opts)
374 opts = pycompat.byteskwargs(opts)
374 peer = hg.peer(ui, opts, path)
375 peer = hg.peer(ui, opts, path)
375 caps = peer.capabilities()
376 caps = peer.capabilities()
376 ui.write(('Main capabilities:\n'))
377 ui.write(('Main capabilities:\n'))
377 for c in sorted(caps):
378 for c in sorted(caps):
378 ui.write((' %s\n') % c)
379 ui.write((' %s\n') % c)
379 b2caps = bundle2.bundle2caps(peer)
380 b2caps = bundle2.bundle2caps(peer)
380 if b2caps:
381 if b2caps:
381 ui.write(('Bundle2 capabilities:\n'))
382 ui.write(('Bundle2 capabilities:\n'))
382 for key, values in sorted(b2caps.iteritems()):
383 for key, values in sorted(b2caps.iteritems()):
383 ui.write((' %s\n') % key)
384 ui.write((' %s\n') % key)
384 for v in values:
385 for v in values:
385 ui.write((' %s\n') % v)
386 ui.write((' %s\n') % v)
386
387
387 @command('debugcheckstate', [], '')
388 @command('debugcheckstate', [], '')
388 def debugcheckstate(ui, repo):
389 def debugcheckstate(ui, repo):
389 """validate the correctness of the current dirstate"""
390 """validate the correctness of the current dirstate"""
390 parent1, parent2 = repo.dirstate.parents()
391 parent1, parent2 = repo.dirstate.parents()
391 m1 = repo[parent1].manifest()
392 m1 = repo[parent1].manifest()
392 m2 = repo[parent2].manifest()
393 m2 = repo[parent2].manifest()
393 errors = 0
394 errors = 0
394 for f in repo.dirstate:
395 for f in repo.dirstate:
395 state = repo.dirstate[f]
396 state = repo.dirstate[f]
396 if state in "nr" and f not in m1:
397 if state in "nr" and f not in m1:
397 ui.warn(_("%s in state %s, but not in manifest1\n") % (f, state))
398 ui.warn(_("%s in state %s, but not in manifest1\n") % (f, state))
398 errors += 1
399 errors += 1
399 if state in "a" and f in m1:
400 if state in "a" and f in m1:
400 ui.warn(_("%s in state %s, but also in manifest1\n") % (f, state))
401 ui.warn(_("%s in state %s, but also in manifest1\n") % (f, state))
401 errors += 1
402 errors += 1
402 if state in "m" and f not in m1 and f not in m2:
403 if state in "m" and f not in m1 and f not in m2:
403 ui.warn(_("%s in state %s, but not in either manifest\n") %
404 ui.warn(_("%s in state %s, but not in either manifest\n") %
404 (f, state))
405 (f, state))
405 errors += 1
406 errors += 1
406 for f in m1:
407 for f in m1:
407 state = repo.dirstate[f]
408 state = repo.dirstate[f]
408 if state not in "nrm":
409 if state not in "nrm":
409 ui.warn(_("%s in manifest1, but listed as state %s") % (f, state))
410 ui.warn(_("%s in manifest1, but listed as state %s") % (f, state))
410 errors += 1
411 errors += 1
411 if errors:
412 if errors:
412 error = _(".hg/dirstate inconsistent with current parent's manifest")
413 error = _(".hg/dirstate inconsistent with current parent's manifest")
413 raise error.Abort(error)
414 raise error.Abort(error)
414
415
415 @command('debugcolor',
416 @command('debugcolor',
416 [('', 'style', None, _('show all configured styles'))],
417 [('', 'style', None, _('show all configured styles'))],
417 'hg debugcolor')
418 'hg debugcolor')
418 def debugcolor(ui, repo, **opts):
419 def debugcolor(ui, repo, **opts):
419 """show available color, effects or style"""
420 """show available color, effects or style"""
420 ui.write(('color mode: %s\n') % ui._colormode)
421 ui.write(('color mode: %s\n') % ui._colormode)
421 if opts.get(r'style'):
422 if opts.get(r'style'):
422 return _debugdisplaystyle(ui)
423 return _debugdisplaystyle(ui)
423 else:
424 else:
424 return _debugdisplaycolor(ui)
425 return _debugdisplaycolor(ui)
425
426
426 def _debugdisplaycolor(ui):
427 def _debugdisplaycolor(ui):
427 ui = ui.copy()
428 ui = ui.copy()
428 ui._styles.clear()
429 ui._styles.clear()
429 for effect in color._activeeffects(ui).keys():
430 for effect in color._activeeffects(ui).keys():
430 ui._styles[effect] = effect
431 ui._styles[effect] = effect
431 if ui._terminfoparams:
432 if ui._terminfoparams:
432 for k, v in ui.configitems('color'):
433 for k, v in ui.configitems('color'):
433 if k.startswith('color.'):
434 if k.startswith('color.'):
434 ui._styles[k] = k[6:]
435 ui._styles[k] = k[6:]
435 elif k.startswith('terminfo.'):
436 elif k.startswith('terminfo.'):
436 ui._styles[k] = k[9:]
437 ui._styles[k] = k[9:]
437 ui.write(_('available colors:\n'))
438 ui.write(_('available colors:\n'))
438 # sort label with a '_' after the other to group '_background' entry.
439 # sort label with a '_' after the other to group '_background' entry.
439 items = sorted(ui._styles.items(),
440 items = sorted(ui._styles.items(),
440 key=lambda i: ('_' in i[0], i[0], i[1]))
441 key=lambda i: ('_' in i[0], i[0], i[1]))
441 for colorname, label in items:
442 for colorname, label in items:
442 ui.write(('%s\n') % colorname, label=label)
443 ui.write(('%s\n') % colorname, label=label)
443
444
444 def _debugdisplaystyle(ui):
445 def _debugdisplaystyle(ui):
445 ui.write(_('available style:\n'))
446 ui.write(_('available style:\n'))
446 width = max(len(s) for s in ui._styles)
447 width = max(len(s) for s in ui._styles)
447 for label, effects in sorted(ui._styles.items()):
448 for label, effects in sorted(ui._styles.items()):
448 ui.write('%s' % label, label=label)
449 ui.write('%s' % label, label=label)
449 if effects:
450 if effects:
450 # 50
451 # 50
451 ui.write(': ')
452 ui.write(': ')
452 ui.write(' ' * (max(0, width - len(label))))
453 ui.write(' ' * (max(0, width - len(label))))
453 ui.write(', '.join(ui.label(e, e) for e in effects.split()))
454 ui.write(', '.join(ui.label(e, e) for e in effects.split()))
454 ui.write('\n')
455 ui.write('\n')
455
456
456 @command('debugcreatestreamclonebundle', [], 'FILE')
457 @command('debugcreatestreamclonebundle', [], 'FILE')
457 def debugcreatestreamclonebundle(ui, repo, fname):
458 def debugcreatestreamclonebundle(ui, repo, fname):
458 """create a stream clone bundle file
459 """create a stream clone bundle file
459
460
460 Stream bundles are special bundles that are essentially archives of
461 Stream bundles are special bundles that are essentially archives of
461 revlog files. They are commonly used for cloning very quickly.
462 revlog files. They are commonly used for cloning very quickly.
462 """
463 """
463 # TODO we may want to turn this into an abort when this functionality
464 # TODO we may want to turn this into an abort when this functionality
464 # is moved into `hg bundle`.
465 # is moved into `hg bundle`.
465 if phases.hassecret(repo):
466 if phases.hassecret(repo):
466 ui.warn(_('(warning: stream clone bundle will contain secret '
467 ui.warn(_('(warning: stream clone bundle will contain secret '
467 'revisions)\n'))
468 'revisions)\n'))
468
469
469 requirements, gen = streamclone.generatebundlev1(repo)
470 requirements, gen = streamclone.generatebundlev1(repo)
470 changegroup.writechunks(ui, gen, fname)
471 changegroup.writechunks(ui, gen, fname)
471
472
472 ui.write(_('bundle requirements: %s\n') % ', '.join(sorted(requirements)))
473 ui.write(_('bundle requirements: %s\n') % ', '.join(sorted(requirements)))
473
474
474 @command('debugdag',
475 @command('debugdag',
475 [('t', 'tags', None, _('use tags as labels')),
476 [('t', 'tags', None, _('use tags as labels')),
476 ('b', 'branches', None, _('annotate with branch names')),
477 ('b', 'branches', None, _('annotate with branch names')),
477 ('', 'dots', None, _('use dots for runs')),
478 ('', 'dots', None, _('use dots for runs')),
478 ('s', 'spaces', None, _('separate elements by spaces'))],
479 ('s', 'spaces', None, _('separate elements by spaces'))],
479 _('[OPTION]... [FILE [REV]...]'),
480 _('[OPTION]... [FILE [REV]...]'),
480 optionalrepo=True)
481 optionalrepo=True)
481 def debugdag(ui, repo, file_=None, *revs, **opts):
482 def debugdag(ui, repo, file_=None, *revs, **opts):
482 """format the changelog or an index DAG as a concise textual description
483 """format the changelog or an index DAG as a concise textual description
483
484
484 If you pass a revlog index, the revlog's DAG is emitted. If you list
485 If you pass a revlog index, the revlog's DAG is emitted. If you list
485 revision numbers, they get labeled in the output as rN.
486 revision numbers, they get labeled in the output as rN.
486
487
487 Otherwise, the changelog DAG of the current repo is emitted.
488 Otherwise, the changelog DAG of the current repo is emitted.
488 """
489 """
489 spaces = opts.get(r'spaces')
490 spaces = opts.get(r'spaces')
490 dots = opts.get(r'dots')
491 dots = opts.get(r'dots')
491 if file_:
492 if file_:
492 rlog = revlog.revlog(vfsmod.vfs(pycompat.getcwd(), audit=False),
493 rlog = revlog.revlog(vfsmod.vfs(pycompat.getcwd(), audit=False),
493 file_)
494 file_)
494 revs = set((int(r) for r in revs))
495 revs = set((int(r) for r in revs))
495 def events():
496 def events():
496 for r in rlog:
497 for r in rlog:
497 yield 'n', (r, list(p for p in rlog.parentrevs(r)
498 yield 'n', (r, list(p for p in rlog.parentrevs(r)
498 if p != -1))
499 if p != -1))
499 if r in revs:
500 if r in revs:
500 yield 'l', (r, "r%i" % r)
501 yield 'l', (r, "r%i" % r)
501 elif repo:
502 elif repo:
502 cl = repo.changelog
503 cl = repo.changelog
503 tags = opts.get(r'tags')
504 tags = opts.get(r'tags')
504 branches = opts.get(r'branches')
505 branches = opts.get(r'branches')
505 if tags:
506 if tags:
506 labels = {}
507 labels = {}
507 for l, n in repo.tags().items():
508 for l, n in repo.tags().items():
508 labels.setdefault(cl.rev(n), []).append(l)
509 labels.setdefault(cl.rev(n), []).append(l)
509 def events():
510 def events():
510 b = "default"
511 b = "default"
511 for r in cl:
512 for r in cl:
512 if branches:
513 if branches:
513 newb = cl.read(cl.node(r))[5]['branch']
514 newb = cl.read(cl.node(r))[5]['branch']
514 if newb != b:
515 if newb != b:
515 yield 'a', newb
516 yield 'a', newb
516 b = newb
517 b = newb
517 yield 'n', (r, list(p for p in cl.parentrevs(r)
518 yield 'n', (r, list(p for p in cl.parentrevs(r)
518 if p != -1))
519 if p != -1))
519 if tags:
520 if tags:
520 ls = labels.get(r)
521 ls = labels.get(r)
521 if ls:
522 if ls:
522 for l in ls:
523 for l in ls:
523 yield 'l', (r, l)
524 yield 'l', (r, l)
524 else:
525 else:
525 raise error.Abort(_('need repo for changelog dag'))
526 raise error.Abort(_('need repo for changelog dag'))
526
527
527 for line in dagparser.dagtextlines(events(),
528 for line in dagparser.dagtextlines(events(),
528 addspaces=spaces,
529 addspaces=spaces,
529 wraplabels=True,
530 wraplabels=True,
530 wrapannotations=True,
531 wrapannotations=True,
531 wrapnonlinear=dots,
532 wrapnonlinear=dots,
532 usedots=dots,
533 usedots=dots,
533 maxlinewidth=70):
534 maxlinewidth=70):
534 ui.write(line)
535 ui.write(line)
535 ui.write("\n")
536 ui.write("\n")
536
537
537 @command('debugdata', cmdutil.debugrevlogopts, _('-c|-m|FILE REV'))
538 @command('debugdata', cmdutil.debugrevlogopts, _('-c|-m|FILE REV'))
538 def debugdata(ui, repo, file_, rev=None, **opts):
539 def debugdata(ui, repo, file_, rev=None, **opts):
539 """dump the contents of a data file revision"""
540 """dump the contents of a data file revision"""
540 opts = pycompat.byteskwargs(opts)
541 opts = pycompat.byteskwargs(opts)
541 if opts.get('changelog') or opts.get('manifest') or opts.get('dir'):
542 if opts.get('changelog') or opts.get('manifest') or opts.get('dir'):
542 if rev is not None:
543 if rev is not None:
543 raise error.CommandError('debugdata', _('invalid arguments'))
544 raise error.CommandError('debugdata', _('invalid arguments'))
544 file_, rev = None, file_
545 file_, rev = None, file_
545 elif rev is None:
546 elif rev is None:
546 raise error.CommandError('debugdata', _('invalid arguments'))
547 raise error.CommandError('debugdata', _('invalid arguments'))
547 r = cmdutil.openrevlog(repo, 'debugdata', file_, opts)
548 r = cmdutil.openrevlog(repo, 'debugdata', file_, opts)
548 try:
549 try:
549 ui.write(r.revision(r.lookup(rev), raw=True))
550 ui.write(r.revision(r.lookup(rev), raw=True))
550 except KeyError:
551 except KeyError:
551 raise error.Abort(_('invalid revision identifier %s') % rev)
552 raise error.Abort(_('invalid revision identifier %s') % rev)
552
553
553 @command('debugdate',
554 @command('debugdate',
554 [('e', 'extended', None, _('try extended date formats'))],
555 [('e', 'extended', None, _('try extended date formats'))],
555 _('[-e] DATE [RANGE]'),
556 _('[-e] DATE [RANGE]'),
556 norepo=True, optionalrepo=True)
557 norepo=True, optionalrepo=True)
557 def debugdate(ui, date, range=None, **opts):
558 def debugdate(ui, date, range=None, **opts):
558 """parse and display a date"""
559 """parse and display a date"""
559 if opts[r"extended"]:
560 if opts[r"extended"]:
560 d = util.parsedate(date, util.extendeddateformats)
561 d = util.parsedate(date, util.extendeddateformats)
561 else:
562 else:
562 d = util.parsedate(date)
563 d = util.parsedate(date)
563 ui.write(("internal: %d %d\n") % d)
564 ui.write(("internal: %d %d\n") % d)
564 ui.write(("standard: %s\n") % util.datestr(d))
565 ui.write(("standard: %s\n") % util.datestr(d))
565 if range:
566 if range:
566 m = util.matchdate(range)
567 m = util.matchdate(range)
567 ui.write(("match: %s\n") % m(d[0]))
568 ui.write(("match: %s\n") % m(d[0]))
568
569
569 @command('debugdeltachain',
570 @command('debugdeltachain',
570 cmdutil.debugrevlogopts + cmdutil.formatteropts,
571 cmdutil.debugrevlogopts + cmdutil.formatteropts,
571 _('-c|-m|FILE'),
572 _('-c|-m|FILE'),
572 optionalrepo=True)
573 optionalrepo=True)
573 def debugdeltachain(ui, repo, file_=None, **opts):
574 def debugdeltachain(ui, repo, file_=None, **opts):
574 """dump information about delta chains in a revlog
575 """dump information about delta chains in a revlog
575
576
576 Output can be templatized. Available template keywords are:
577 Output can be templatized. Available template keywords are:
577
578
578 :``rev``: revision number
579 :``rev``: revision number
579 :``chainid``: delta chain identifier (numbered by unique base)
580 :``chainid``: delta chain identifier (numbered by unique base)
580 :``chainlen``: delta chain length to this revision
581 :``chainlen``: delta chain length to this revision
581 :``prevrev``: previous revision in delta chain
582 :``prevrev``: previous revision in delta chain
582 :``deltatype``: role of delta / how it was computed
583 :``deltatype``: role of delta / how it was computed
583 :``compsize``: compressed size of revision
584 :``compsize``: compressed size of revision
584 :``uncompsize``: uncompressed size of revision
585 :``uncompsize``: uncompressed size of revision
585 :``chainsize``: total size of compressed revisions in chain
586 :``chainsize``: total size of compressed revisions in chain
586 :``chainratio``: total chain size divided by uncompressed revision size
587 :``chainratio``: total chain size divided by uncompressed revision size
587 (new delta chains typically start at ratio 2.00)
588 (new delta chains typically start at ratio 2.00)
588 :``lindist``: linear distance from base revision in delta chain to end
589 :``lindist``: linear distance from base revision in delta chain to end
589 of this revision
590 of this revision
590 :``extradist``: total size of revisions not part of this delta chain from
591 :``extradist``: total size of revisions not part of this delta chain from
591 base of delta chain to end of this revision; a measurement
592 base of delta chain to end of this revision; a measurement
592 of how much extra data we need to read/seek across to read
593 of how much extra data we need to read/seek across to read
593 the delta chain for this revision
594 the delta chain for this revision
594 :``extraratio``: extradist divided by chainsize; another representation of
595 :``extraratio``: extradist divided by chainsize; another representation of
595 how much unrelated data is needed to load this delta chain
596 how much unrelated data is needed to load this delta chain
596
597
597 If the repository is configured to use the sparse read, additional keywords
598 If the repository is configured to use the sparse read, additional keywords
598 are available:
599 are available:
599
600
600 :``readsize``: total size of data read from the disk for a revision
601 :``readsize``: total size of data read from the disk for a revision
601 (sum of the sizes of all the blocks)
602 (sum of the sizes of all the blocks)
602 :``largestblock``: size of the largest block of data read from the disk
603 :``largestblock``: size of the largest block of data read from the disk
603 :``readdensity``: density of useful bytes in the data read from the disk
604 :``readdensity``: density of useful bytes in the data read from the disk
604 :``srchunks``: in how many data hunks the whole revision would be read
605 :``srchunks``: in how many data hunks the whole revision would be read
605
606
606 The sparse read can be enabled with experimental.sparse-read = True
607 The sparse read can be enabled with experimental.sparse-read = True
607 """
608 """
608 opts = pycompat.byteskwargs(opts)
609 opts = pycompat.byteskwargs(opts)
609 r = cmdutil.openrevlog(repo, 'debugdeltachain', file_, opts)
610 r = cmdutil.openrevlog(repo, 'debugdeltachain', file_, opts)
610 index = r.index
611 index = r.index
611 generaldelta = r.version & revlog.FLAG_GENERALDELTA
612 generaldelta = r.version & revlog.FLAG_GENERALDELTA
612 withsparseread = getattr(r, '_withsparseread', False)
613 withsparseread = getattr(r, '_withsparseread', False)
613
614
614 def revinfo(rev):
615 def revinfo(rev):
615 e = index[rev]
616 e = index[rev]
616 compsize = e[1]
617 compsize = e[1]
617 uncompsize = e[2]
618 uncompsize = e[2]
618 chainsize = 0
619 chainsize = 0
619
620
620 if generaldelta:
621 if generaldelta:
621 if e[3] == e[5]:
622 if e[3] == e[5]:
622 deltatype = 'p1'
623 deltatype = 'p1'
623 elif e[3] == e[6]:
624 elif e[3] == e[6]:
624 deltatype = 'p2'
625 deltatype = 'p2'
625 elif e[3] == rev - 1:
626 elif e[3] == rev - 1:
626 deltatype = 'prev'
627 deltatype = 'prev'
627 elif e[3] == rev:
628 elif e[3] == rev:
628 deltatype = 'base'
629 deltatype = 'base'
629 else:
630 else:
630 deltatype = 'other'
631 deltatype = 'other'
631 else:
632 else:
632 if e[3] == rev:
633 if e[3] == rev:
633 deltatype = 'base'
634 deltatype = 'base'
634 else:
635 else:
635 deltatype = 'prev'
636 deltatype = 'prev'
636
637
637 chain = r._deltachain(rev)[0]
638 chain = r._deltachain(rev)[0]
638 for iterrev in chain:
639 for iterrev in chain:
639 e = index[iterrev]
640 e = index[iterrev]
640 chainsize += e[1]
641 chainsize += e[1]
641
642
642 return compsize, uncompsize, deltatype, chain, chainsize
643 return compsize, uncompsize, deltatype, chain, chainsize
643
644
644 fm = ui.formatter('debugdeltachain', opts)
645 fm = ui.formatter('debugdeltachain', opts)
645
646
646 fm.plain(' rev chain# chainlen prev delta '
647 fm.plain(' rev chain# chainlen prev delta '
647 'size rawsize chainsize ratio lindist extradist '
648 'size rawsize chainsize ratio lindist extradist '
648 'extraratio')
649 'extraratio')
649 if withsparseread:
650 if withsparseread:
650 fm.plain(' readsize largestblk rddensity srchunks')
651 fm.plain(' readsize largestblk rddensity srchunks')
651 fm.plain('\n')
652 fm.plain('\n')
652
653
653 chainbases = {}
654 chainbases = {}
654 for rev in r:
655 for rev in r:
655 comp, uncomp, deltatype, chain, chainsize = revinfo(rev)
656 comp, uncomp, deltatype, chain, chainsize = revinfo(rev)
656 chainbase = chain[0]
657 chainbase = chain[0]
657 chainid = chainbases.setdefault(chainbase, len(chainbases) + 1)
658 chainid = chainbases.setdefault(chainbase, len(chainbases) + 1)
658 start = r.start
659 start = r.start
659 length = r.length
660 length = r.length
660 basestart = start(chainbase)
661 basestart = start(chainbase)
661 revstart = start(rev)
662 revstart = start(rev)
662 lineardist = revstart + comp - basestart
663 lineardist = revstart + comp - basestart
663 extradist = lineardist - chainsize
664 extradist = lineardist - chainsize
664 try:
665 try:
665 prevrev = chain[-2]
666 prevrev = chain[-2]
666 except IndexError:
667 except IndexError:
667 prevrev = -1
668 prevrev = -1
668
669
669 chainratio = float(chainsize) / float(uncomp)
670 chainratio = float(chainsize) / float(uncomp)
670 extraratio = float(extradist) / float(chainsize)
671 extraratio = float(extradist) / float(chainsize)
671
672
672 fm.startitem()
673 fm.startitem()
673 fm.write('rev chainid chainlen prevrev deltatype compsize '
674 fm.write('rev chainid chainlen prevrev deltatype compsize '
674 'uncompsize chainsize chainratio lindist extradist '
675 'uncompsize chainsize chainratio lindist extradist '
675 'extraratio',
676 'extraratio',
676 '%7d %7d %8d %8d %7s %10d %10d %10d %9.5f %9d %9d %10.5f',
677 '%7d %7d %8d %8d %7s %10d %10d %10d %9.5f %9d %9d %10.5f',
677 rev, chainid, len(chain), prevrev, deltatype, comp,
678 rev, chainid, len(chain), prevrev, deltatype, comp,
678 uncomp, chainsize, chainratio, lineardist, extradist,
679 uncomp, chainsize, chainratio, lineardist, extradist,
679 extraratio,
680 extraratio,
680 rev=rev, chainid=chainid, chainlen=len(chain),
681 rev=rev, chainid=chainid, chainlen=len(chain),
681 prevrev=prevrev, deltatype=deltatype, compsize=comp,
682 prevrev=prevrev, deltatype=deltatype, compsize=comp,
682 uncompsize=uncomp, chainsize=chainsize,
683 uncompsize=uncomp, chainsize=chainsize,
683 chainratio=chainratio, lindist=lineardist,
684 chainratio=chainratio, lindist=lineardist,
684 extradist=extradist, extraratio=extraratio)
685 extradist=extradist, extraratio=extraratio)
685 if withsparseread:
686 if withsparseread:
686 readsize = 0
687 readsize = 0
687 largestblock = 0
688 largestblock = 0
688 srchunks = 0
689 srchunks = 0
689
690
690 for revschunk in revlog._slicechunk(r, chain):
691 for revschunk in revlog._slicechunk(r, chain):
691 srchunks += 1
692 srchunks += 1
692 blkend = start(revschunk[-1]) + length(revschunk[-1])
693 blkend = start(revschunk[-1]) + length(revschunk[-1])
693 blksize = blkend - start(revschunk[0])
694 blksize = blkend - start(revschunk[0])
694
695
695 readsize += blksize
696 readsize += blksize
696 if largestblock < blksize:
697 if largestblock < blksize:
697 largestblock = blksize
698 largestblock = blksize
698
699
699 readdensity = float(chainsize) / float(readsize)
700 readdensity = float(chainsize) / float(readsize)
700
701
701 fm.write('readsize largestblock readdensity srchunks',
702 fm.write('readsize largestblock readdensity srchunks',
702 ' %10d %10d %9.5f %8d',
703 ' %10d %10d %9.5f %8d',
703 readsize, largestblock, readdensity, srchunks,
704 readsize, largestblock, readdensity, srchunks,
704 readsize=readsize, largestblock=largestblock,
705 readsize=readsize, largestblock=largestblock,
705 readdensity=readdensity, srchunks=srchunks)
706 readdensity=readdensity, srchunks=srchunks)
706
707
707 fm.plain('\n')
708 fm.plain('\n')
708
709
709 fm.end()
710 fm.end()
710
711
711 @command('debugdirstate|debugstate',
712 @command('debugdirstate|debugstate',
712 [('', 'nodates', None, _('do not display the saved mtime')),
713 [('', 'nodates', None, _('do not display the saved mtime')),
713 ('', 'datesort', None, _('sort by saved mtime'))],
714 ('', 'datesort', None, _('sort by saved mtime'))],
714 _('[OPTION]...'))
715 _('[OPTION]...'))
715 def debugstate(ui, repo, **opts):
716 def debugstate(ui, repo, **opts):
716 """show the contents of the current dirstate"""
717 """show the contents of the current dirstate"""
717
718
718 nodates = opts.get(r'nodates')
719 nodates = opts.get(r'nodates')
719 datesort = opts.get(r'datesort')
720 datesort = opts.get(r'datesort')
720
721
721 timestr = ""
722 timestr = ""
722 if datesort:
723 if datesort:
723 keyfunc = lambda x: (x[1][3], x[0]) # sort by mtime, then by filename
724 keyfunc = lambda x: (x[1][3], x[0]) # sort by mtime, then by filename
724 else:
725 else:
725 keyfunc = None # sort by filename
726 keyfunc = None # sort by filename
726 for file_, ent in sorted(repo.dirstate._map.iteritems(), key=keyfunc):
727 for file_, ent in sorted(repo.dirstate._map.iteritems(), key=keyfunc):
727 if ent[3] == -1:
728 if ent[3] == -1:
728 timestr = 'unset '
729 timestr = 'unset '
729 elif nodates:
730 elif nodates:
730 timestr = 'set '
731 timestr = 'set '
731 else:
732 else:
732 timestr = time.strftime(r"%Y-%m-%d %H:%M:%S ",
733 timestr = time.strftime(r"%Y-%m-%d %H:%M:%S ",
733 time.localtime(ent[3]))
734 time.localtime(ent[3]))
734 timestr = encoding.strtolocal(timestr)
735 timestr = encoding.strtolocal(timestr)
735 if ent[1] & 0o20000:
736 if ent[1] & 0o20000:
736 mode = 'lnk'
737 mode = 'lnk'
737 else:
738 else:
738 mode = '%3o' % (ent[1] & 0o777 & ~util.umask)
739 mode = '%3o' % (ent[1] & 0o777 & ~util.umask)
739 ui.write("%c %s %10d %s%s\n" % (ent[0], mode, ent[2], timestr, file_))
740 ui.write("%c %s %10d %s%s\n" % (ent[0], mode, ent[2], timestr, file_))
740 for f in repo.dirstate.copies():
741 for f in repo.dirstate.copies():
741 ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
742 ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
742
743
743 @command('debugdiscovery',
744 @command('debugdiscovery',
744 [('', 'old', None, _('use old-style discovery')),
745 [('', 'old', None, _('use old-style discovery')),
745 ('', 'nonheads', None,
746 ('', 'nonheads', None,
746 _('use old-style discovery with non-heads included')),
747 _('use old-style discovery with non-heads included')),
747 ('', 'rev', [], 'restrict discovery to this set of revs'),
748 ('', 'rev', [], 'restrict discovery to this set of revs'),
748 ] + cmdutil.remoteopts,
749 ] + cmdutil.remoteopts,
749 _('[--rev REV] [OTHER]'))
750 _('[--rev REV] [OTHER]'))
750 def debugdiscovery(ui, repo, remoteurl="default", **opts):
751 def debugdiscovery(ui, repo, remoteurl="default", **opts):
751 """runs the changeset discovery protocol in isolation"""
752 """runs the changeset discovery protocol in isolation"""
752 opts = pycompat.byteskwargs(opts)
753 opts = pycompat.byteskwargs(opts)
753 remoteurl, branches = hg.parseurl(ui.expandpath(remoteurl))
754 remoteurl, branches = hg.parseurl(ui.expandpath(remoteurl))
754 remote = hg.peer(repo, opts, remoteurl)
755 remote = hg.peer(repo, opts, remoteurl)
755 ui.status(_('comparing with %s\n') % util.hidepassword(remoteurl))
756 ui.status(_('comparing with %s\n') % util.hidepassword(remoteurl))
756
757
757 # make sure tests are repeatable
758 # make sure tests are repeatable
758 random.seed(12323)
759 random.seed(12323)
759
760
760 def doit(pushedrevs, remoteheads, remote=remote):
761 def doit(pushedrevs, remoteheads, remote=remote):
761 if opts.get('old'):
762 if opts.get('old'):
762 if not util.safehasattr(remote, 'branches'):
763 if not util.safehasattr(remote, 'branches'):
763 # enable in-client legacy support
764 # enable in-client legacy support
764 remote = localrepo.locallegacypeer(remote.local())
765 remote = localrepo.locallegacypeer(remote.local())
765 common, _in, hds = treediscovery.findcommonincoming(repo, remote,
766 common, _in, hds = treediscovery.findcommonincoming(repo, remote,
766 force=True)
767 force=True)
767 common = set(common)
768 common = set(common)
768 if not opts.get('nonheads'):
769 if not opts.get('nonheads'):
769 ui.write(("unpruned common: %s\n") %
770 ui.write(("unpruned common: %s\n") %
770 " ".join(sorted(short(n) for n in common)))
771 " ".join(sorted(short(n) for n in common)))
771 dag = dagutil.revlogdag(repo.changelog)
772 dag = dagutil.revlogdag(repo.changelog)
772 all = dag.ancestorset(dag.internalizeall(common))
773 all = dag.ancestorset(dag.internalizeall(common))
773 common = dag.externalizeall(dag.headsetofconnecteds(all))
774 common = dag.externalizeall(dag.headsetofconnecteds(all))
774 else:
775 else:
775 nodes = None
776 nodes = None
776 if pushedrevs:
777 if pushedrevs:
777 revs = scmutil.revrange(repo, pushedrevs)
778 revs = scmutil.revrange(repo, pushedrevs)
778 nodes = [repo[r].node() for r in revs]
779 nodes = [repo[r].node() for r in revs]
779 common, any, hds = setdiscovery.findcommonheads(ui, repo, remote,
780 common, any, hds = setdiscovery.findcommonheads(ui, repo, remote,
780 ancestorsof=nodes)
781 ancestorsof=nodes)
781 common = set(common)
782 common = set(common)
782 rheads = set(hds)
783 rheads = set(hds)
783 lheads = set(repo.heads())
784 lheads = set(repo.heads())
784 ui.write(("common heads: %s\n") %
785 ui.write(("common heads: %s\n") %
785 " ".join(sorted(short(n) for n in common)))
786 " ".join(sorted(short(n) for n in common)))
786 if lheads <= common:
787 if lheads <= common:
787 ui.write(("local is subset\n"))
788 ui.write(("local is subset\n"))
788 elif rheads <= common:
789 elif rheads <= common:
789 ui.write(("remote is subset\n"))
790 ui.write(("remote is subset\n"))
790
791
791 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None)
792 remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None)
792 localrevs = opts['rev']
793 localrevs = opts['rev']
793 doit(localrevs, remoterevs)
794 doit(localrevs, remoterevs)
794
795
795 _chunksize = 4 << 10
796 _chunksize = 4 << 10
796
797
797 @command('debugdownload',
798 @command('debugdownload',
798 [
799 [
799 ('o', 'output', '', _('path')),
800 ('o', 'output', '', _('path')),
800 ],
801 ],
801 optionalrepo=True)
802 optionalrepo=True)
802 def debugdownload(ui, repo, url, output=None, **opts):
803 def debugdownload(ui, repo, url, output=None, **opts):
803 """download a resource using Mercurial logic and config
804 """download a resource using Mercurial logic and config
804 """
805 """
805 fh = urlmod.open(ui, url, output)
806 fh = urlmod.open(ui, url, output)
806
807
807 dest = ui
808 dest = ui
808 if output:
809 if output:
809 dest = open(output, "wb", _chunksize)
810 dest = open(output, "wb", _chunksize)
810 try:
811 try:
811 data = fh.read(_chunksize)
812 data = fh.read(_chunksize)
812 while data:
813 while data:
813 dest.write(data)
814 dest.write(data)
814 data = fh.read(_chunksize)
815 data = fh.read(_chunksize)
815 finally:
816 finally:
816 if output:
817 if output:
817 dest.close()
818 dest.close()
818
819
819 @command('debugextensions', cmdutil.formatteropts, [], norepo=True)
820 @command('debugextensions', cmdutil.formatteropts, [], norepo=True)
820 def debugextensions(ui, **opts):
821 def debugextensions(ui, **opts):
821 '''show information about active extensions'''
822 '''show information about active extensions'''
822 opts = pycompat.byteskwargs(opts)
823 opts = pycompat.byteskwargs(opts)
823 exts = extensions.extensions(ui)
824 exts = extensions.extensions(ui)
824 hgver = util.version()
825 hgver = util.version()
825 fm = ui.formatter('debugextensions', opts)
826 fm = ui.formatter('debugextensions', opts)
826 for extname, extmod in sorted(exts, key=operator.itemgetter(0)):
827 for extname, extmod in sorted(exts, key=operator.itemgetter(0)):
827 isinternal = extensions.ismoduleinternal(extmod)
828 isinternal = extensions.ismoduleinternal(extmod)
828 extsource = pycompat.fsencode(extmod.__file__)
829 extsource = pycompat.fsencode(extmod.__file__)
829 if isinternal:
830 if isinternal:
830 exttestedwith = [] # never expose magic string to users
831 exttestedwith = [] # never expose magic string to users
831 else:
832 else:
832 exttestedwith = getattr(extmod, 'testedwith', '').split()
833 exttestedwith = getattr(extmod, 'testedwith', '').split()
833 extbuglink = getattr(extmod, 'buglink', None)
834 extbuglink = getattr(extmod, 'buglink', None)
834
835
835 fm.startitem()
836 fm.startitem()
836
837
837 if ui.quiet or ui.verbose:
838 if ui.quiet or ui.verbose:
838 fm.write('name', '%s\n', extname)
839 fm.write('name', '%s\n', extname)
839 else:
840 else:
840 fm.write('name', '%s', extname)
841 fm.write('name', '%s', extname)
841 if isinternal or hgver in exttestedwith:
842 if isinternal or hgver in exttestedwith:
842 fm.plain('\n')
843 fm.plain('\n')
843 elif not exttestedwith:
844 elif not exttestedwith:
844 fm.plain(_(' (untested!)\n'))
845 fm.plain(_(' (untested!)\n'))
845 else:
846 else:
846 lasttestedversion = exttestedwith[-1]
847 lasttestedversion = exttestedwith[-1]
847 fm.plain(' (%s!)\n' % lasttestedversion)
848 fm.plain(' (%s!)\n' % lasttestedversion)
848
849
849 fm.condwrite(ui.verbose and extsource, 'source',
850 fm.condwrite(ui.verbose and extsource, 'source',
850 _(' location: %s\n'), extsource or "")
851 _(' location: %s\n'), extsource or "")
851
852
852 if ui.verbose:
853 if ui.verbose:
853 fm.plain(_(' bundled: %s\n') % ['no', 'yes'][isinternal])
854 fm.plain(_(' bundled: %s\n') % ['no', 'yes'][isinternal])
854 fm.data(bundled=isinternal)
855 fm.data(bundled=isinternal)
855
856
856 fm.condwrite(ui.verbose and exttestedwith, 'testedwith',
857 fm.condwrite(ui.verbose and exttestedwith, 'testedwith',
857 _(' tested with: %s\n'),
858 _(' tested with: %s\n'),
858 fm.formatlist(exttestedwith, name='ver'))
859 fm.formatlist(exttestedwith, name='ver'))
859
860
860 fm.condwrite(ui.verbose and extbuglink, 'buglink',
861 fm.condwrite(ui.verbose and extbuglink, 'buglink',
861 _(' bug reporting: %s\n'), extbuglink or "")
862 _(' bug reporting: %s\n'), extbuglink or "")
862
863
863 fm.end()
864 fm.end()
864
865
865 @command('debugfileset',
866 @command('debugfileset',
866 [('r', 'rev', '', _('apply the filespec on this revision'), _('REV'))],
867 [('r', 'rev', '', _('apply the filespec on this revision'), _('REV'))],
867 _('[-r REV] FILESPEC'))
868 _('[-r REV] FILESPEC'))
868 def debugfileset(ui, repo, expr, **opts):
869 def debugfileset(ui, repo, expr, **opts):
869 '''parse and apply a fileset specification'''
870 '''parse and apply a fileset specification'''
870 ctx = scmutil.revsingle(repo, opts.get(r'rev'), None)
871 ctx = scmutil.revsingle(repo, opts.get(r'rev'), None)
871 if ui.verbose:
872 if ui.verbose:
872 tree = fileset.parse(expr)
873 tree = fileset.parse(expr)
873 ui.note(fileset.prettyformat(tree), "\n")
874 ui.note(fileset.prettyformat(tree), "\n")
874
875
875 for f in ctx.getfileset(expr):
876 for f in ctx.getfileset(expr):
876 ui.write("%s\n" % f)
877 ui.write("%s\n" % f)
877
878
878 @command('debugformat',
879 @command('debugformat',
879 [] + cmdutil.formatteropts,
880 [] + cmdutil.formatteropts,
880 _(''))
881 _(''))
881 def debugformat(ui, repo, **opts):
882 def debugformat(ui, repo, **opts):
882 """display format information about the current repository
883 """display format information about the current repository
883
884
884 Use --verbose to get extra information about current config value and
885 Use --verbose to get extra information about current config value and
885 Mercurial default."""
886 Mercurial default."""
886 opts = pycompat.byteskwargs(opts)
887 opts = pycompat.byteskwargs(opts)
887 maxvariantlength = max(len(fv.name) for fv in upgrade.allformatvariant)
888 maxvariantlength = max(len(fv.name) for fv in upgrade.allformatvariant)
888 maxvariantlength = max(len('format-variant'), maxvariantlength)
889 maxvariantlength = max(len('format-variant'), maxvariantlength)
889
890
890 def makeformatname(name):
891 def makeformatname(name):
891 return '%s:' + (' ' * (maxvariantlength - len(name)))
892 return '%s:' + (' ' * (maxvariantlength - len(name)))
892
893
893 fm = ui.formatter('debugformat', opts)
894 fm = ui.formatter('debugformat', opts)
894 if fm.isplain():
895 if fm.isplain():
895 def formatvalue(value):
896 def formatvalue(value):
896 if util.safehasattr(value, 'startswith'):
897 if util.safehasattr(value, 'startswith'):
897 return value
898 return value
898 if value:
899 if value:
899 return 'yes'
900 return 'yes'
900 else:
901 else:
901 return 'no'
902 return 'no'
902 else:
903 else:
903 formatvalue = pycompat.identity
904 formatvalue = pycompat.identity
904
905
905 fm.plain('format-variant')
906 fm.plain('format-variant')
906 fm.plain(' ' * (maxvariantlength - len('format-variant')))
907 fm.plain(' ' * (maxvariantlength - len('format-variant')))
907 fm.plain(' repo')
908 fm.plain(' repo')
908 if ui.verbose:
909 if ui.verbose:
909 fm.plain(' config default')
910 fm.plain(' config default')
910 fm.plain('\n')
911 fm.plain('\n')
911 for fv in upgrade.allformatvariant:
912 for fv in upgrade.allformatvariant:
912 fm.startitem()
913 fm.startitem()
913 repovalue = fv.fromrepo(repo)
914 repovalue = fv.fromrepo(repo)
914 configvalue = fv.fromconfig(repo)
915 configvalue = fv.fromconfig(repo)
915
916
916 if repovalue != configvalue:
917 if repovalue != configvalue:
917 namelabel = 'formatvariant.name.mismatchconfig'
918 namelabel = 'formatvariant.name.mismatchconfig'
918 repolabel = 'formatvariant.repo.mismatchconfig'
919 repolabel = 'formatvariant.repo.mismatchconfig'
919 elif repovalue != fv.default:
920 elif repovalue != fv.default:
920 namelabel = 'formatvariant.name.mismatchdefault'
921 namelabel = 'formatvariant.name.mismatchdefault'
921 repolabel = 'formatvariant.repo.mismatchdefault'
922 repolabel = 'formatvariant.repo.mismatchdefault'
922 else:
923 else:
923 namelabel = 'formatvariant.name.uptodate'
924 namelabel = 'formatvariant.name.uptodate'
924 repolabel = 'formatvariant.repo.uptodate'
925 repolabel = 'formatvariant.repo.uptodate'
925
926
926 fm.write('name', makeformatname(fv.name), fv.name,
927 fm.write('name', makeformatname(fv.name), fv.name,
927 label=namelabel)
928 label=namelabel)
928 fm.write('repo', ' %3s', formatvalue(repovalue),
929 fm.write('repo', ' %3s', formatvalue(repovalue),
929 label=repolabel)
930 label=repolabel)
930 if fv.default != configvalue:
931 if fv.default != configvalue:
931 configlabel = 'formatvariant.config.special'
932 configlabel = 'formatvariant.config.special'
932 else:
933 else:
933 configlabel = 'formatvariant.config.default'
934 configlabel = 'formatvariant.config.default'
934 fm.condwrite(ui.verbose, 'config', ' %6s', formatvalue(configvalue),
935 fm.condwrite(ui.verbose, 'config', ' %6s', formatvalue(configvalue),
935 label=configlabel)
936 label=configlabel)
936 fm.condwrite(ui.verbose, 'default', ' %7s', formatvalue(fv.default),
937 fm.condwrite(ui.verbose, 'default', ' %7s', formatvalue(fv.default),
937 label='formatvariant.default')
938 label='formatvariant.default')
938 fm.plain('\n')
939 fm.plain('\n')
939 fm.end()
940 fm.end()
940
941
941 @command('debugfsinfo', [], _('[PATH]'), norepo=True)
942 @command('debugfsinfo', [], _('[PATH]'), norepo=True)
942 def debugfsinfo(ui, path="."):
943 def debugfsinfo(ui, path="."):
943 """show information detected about current filesystem"""
944 """show information detected about current filesystem"""
944 ui.write(('path: %s\n') % path)
945 ui.write(('path: %s\n') % path)
945 ui.write(('mounted on: %s\n') % (util.getfsmountpoint(path) or '(unknown)'))
946 ui.write(('mounted on: %s\n') % (util.getfsmountpoint(path) or '(unknown)'))
946 ui.write(('exec: %s\n') % (util.checkexec(path) and 'yes' or 'no'))
947 ui.write(('exec: %s\n') % (util.checkexec(path) and 'yes' or 'no'))
947 ui.write(('fstype: %s\n') % (util.getfstype(path) or '(unknown)'))
948 ui.write(('fstype: %s\n') % (util.getfstype(path) or '(unknown)'))
948 ui.write(('symlink: %s\n') % (util.checklink(path) and 'yes' or 'no'))
949 ui.write(('symlink: %s\n') % (util.checklink(path) and 'yes' or 'no'))
949 ui.write(('hardlink: %s\n') % (util.checknlink(path) and 'yes' or 'no'))
950 ui.write(('hardlink: %s\n') % (util.checknlink(path) and 'yes' or 'no'))
950 casesensitive = '(unknown)'
951 casesensitive = '(unknown)'
951 try:
952 try:
952 with tempfile.NamedTemporaryFile(prefix='.debugfsinfo', dir=path) as f:
953 with tempfile.NamedTemporaryFile(prefix='.debugfsinfo', dir=path) as f:
953 casesensitive = util.fscasesensitive(f.name) and 'yes' or 'no'
954 casesensitive = util.fscasesensitive(f.name) and 'yes' or 'no'
954 except OSError:
955 except OSError:
955 pass
956 pass
956 ui.write(('case-sensitive: %s\n') % casesensitive)
957 ui.write(('case-sensitive: %s\n') % casesensitive)
957
958
958 @command('debuggetbundle',
959 @command('debuggetbundle',
959 [('H', 'head', [], _('id of head node'), _('ID')),
960 [('H', 'head', [], _('id of head node'), _('ID')),
960 ('C', 'common', [], _('id of common node'), _('ID')),
961 ('C', 'common', [], _('id of common node'), _('ID')),
961 ('t', 'type', 'bzip2', _('bundle compression type to use'), _('TYPE'))],
962 ('t', 'type', 'bzip2', _('bundle compression type to use'), _('TYPE'))],
962 _('REPO FILE [-H|-C ID]...'),
963 _('REPO FILE [-H|-C ID]...'),
963 norepo=True)
964 norepo=True)
964 def debuggetbundle(ui, repopath, bundlepath, head=None, common=None, **opts):
965 def debuggetbundle(ui, repopath, bundlepath, head=None, common=None, **opts):
965 """retrieves a bundle from a repo
966 """retrieves a bundle from a repo
966
967
967 Every ID must be a full-length hex node id string. Saves the bundle to the
968 Every ID must be a full-length hex node id string. Saves the bundle to the
968 given file.
969 given file.
969 """
970 """
970 opts = pycompat.byteskwargs(opts)
971 opts = pycompat.byteskwargs(opts)
971 repo = hg.peer(ui, opts, repopath)
972 repo = hg.peer(ui, opts, repopath)
972 if not repo.capable('getbundle'):
973 if not repo.capable('getbundle'):
973 raise error.Abort("getbundle() not supported by target repository")
974 raise error.Abort("getbundle() not supported by target repository")
974 args = {}
975 args = {}
975 if common:
976 if common:
976 args[r'common'] = [bin(s) for s in common]
977 args[r'common'] = [bin(s) for s in common]
977 if head:
978 if head:
978 args[r'heads'] = [bin(s) for s in head]
979 args[r'heads'] = [bin(s) for s in head]
979 # TODO: get desired bundlecaps from command line.
980 # TODO: get desired bundlecaps from command line.
980 args[r'bundlecaps'] = None
981 args[r'bundlecaps'] = None
981 bundle = repo.getbundle('debug', **args)
982 bundle = repo.getbundle('debug', **args)
982
983
983 bundletype = opts.get('type', 'bzip2').lower()
984 bundletype = opts.get('type', 'bzip2').lower()
984 btypes = {'none': 'HG10UN',
985 btypes = {'none': 'HG10UN',
985 'bzip2': 'HG10BZ',
986 'bzip2': 'HG10BZ',
986 'gzip': 'HG10GZ',
987 'gzip': 'HG10GZ',
987 'bundle2': 'HG20'}
988 'bundle2': 'HG20'}
988 bundletype = btypes.get(bundletype)
989 bundletype = btypes.get(bundletype)
989 if bundletype not in bundle2.bundletypes:
990 if bundletype not in bundle2.bundletypes:
990 raise error.Abort(_('unknown bundle type specified with --type'))
991 raise error.Abort(_('unknown bundle type specified with --type'))
991 bundle2.writebundle(ui, bundle, bundlepath, bundletype)
992 bundle2.writebundle(ui, bundle, bundlepath, bundletype)
992
993
993 @command('debugignore', [], '[FILE]')
994 @command('debugignore', [], '[FILE]')
994 def debugignore(ui, repo, *files, **opts):
995 def debugignore(ui, repo, *files, **opts):
995 """display the combined ignore pattern and information about ignored files
996 """display the combined ignore pattern and information about ignored files
996
997
997 With no argument display the combined ignore pattern.
998 With no argument display the combined ignore pattern.
998
999
999 Given space separated file names, shows if the given file is ignored and
1000 Given space separated file names, shows if the given file is ignored and
1000 if so, show the ignore rule (file and line number) that matched it.
1001 if so, show the ignore rule (file and line number) that matched it.
1001 """
1002 """
1002 ignore = repo.dirstate._ignore
1003 ignore = repo.dirstate._ignore
1003 if not files:
1004 if not files:
1004 # Show all the patterns
1005 # Show all the patterns
1005 ui.write("%s\n" % repr(ignore))
1006 ui.write("%s\n" % repr(ignore))
1006 else:
1007 else:
1007 m = scmutil.match(repo[None], pats=files)
1008 m = scmutil.match(repo[None], pats=files)
1008 for f in m.files():
1009 for f in m.files():
1009 nf = util.normpath(f)
1010 nf = util.normpath(f)
1010 ignored = None
1011 ignored = None
1011 ignoredata = None
1012 ignoredata = None
1012 if nf != '.':
1013 if nf != '.':
1013 if ignore(nf):
1014 if ignore(nf):
1014 ignored = nf
1015 ignored = nf
1015 ignoredata = repo.dirstate._ignorefileandline(nf)
1016 ignoredata = repo.dirstate._ignorefileandline(nf)
1016 else:
1017 else:
1017 for p in util.finddirs(nf):
1018 for p in util.finddirs(nf):
1018 if ignore(p):
1019 if ignore(p):
1019 ignored = p
1020 ignored = p
1020 ignoredata = repo.dirstate._ignorefileandline(p)
1021 ignoredata = repo.dirstate._ignorefileandline(p)
1021 break
1022 break
1022 if ignored:
1023 if ignored:
1023 if ignored == nf:
1024 if ignored == nf:
1024 ui.write(_("%s is ignored\n") % m.uipath(f))
1025 ui.write(_("%s is ignored\n") % m.uipath(f))
1025 else:
1026 else:
1026 ui.write(_("%s is ignored because of "
1027 ui.write(_("%s is ignored because of "
1027 "containing folder %s\n")
1028 "containing folder %s\n")
1028 % (m.uipath(f), ignored))
1029 % (m.uipath(f), ignored))
1029 ignorefile, lineno, line = ignoredata
1030 ignorefile, lineno, line = ignoredata
1030 ui.write(_("(ignore rule in %s, line %d: '%s')\n")
1031 ui.write(_("(ignore rule in %s, line %d: '%s')\n")
1031 % (ignorefile, lineno, line))
1032 % (ignorefile, lineno, line))
1032 else:
1033 else:
1033 ui.write(_("%s is not ignored\n") % m.uipath(f))
1034 ui.write(_("%s is not ignored\n") % m.uipath(f))
1034
1035
1035 @command('debugindex', cmdutil.debugrevlogopts +
1036 @command('debugindex', cmdutil.debugrevlogopts +
1036 [('f', 'format', 0, _('revlog format'), _('FORMAT'))],
1037 [('f', 'format', 0, _('revlog format'), _('FORMAT'))],
1037 _('[-f FORMAT] -c|-m|FILE'),
1038 _('[-f FORMAT] -c|-m|FILE'),
1038 optionalrepo=True)
1039 optionalrepo=True)
1039 def debugindex(ui, repo, file_=None, **opts):
1040 def debugindex(ui, repo, file_=None, **opts):
1040 """dump the contents of an index file"""
1041 """dump the contents of an index file"""
1041 opts = pycompat.byteskwargs(opts)
1042 opts = pycompat.byteskwargs(opts)
1042 r = cmdutil.openrevlog(repo, 'debugindex', file_, opts)
1043 r = cmdutil.openrevlog(repo, 'debugindex', file_, opts)
1043 format = opts.get('format', 0)
1044 format = opts.get('format', 0)
1044 if format not in (0, 1):
1045 if format not in (0, 1):
1045 raise error.Abort(_("unknown format %d") % format)
1046 raise error.Abort(_("unknown format %d") % format)
1046
1047
1047 generaldelta = r.version & revlog.FLAG_GENERALDELTA
1048 generaldelta = r.version & revlog.FLAG_GENERALDELTA
1048 if generaldelta:
1049 if generaldelta:
1049 basehdr = ' delta'
1050 basehdr = ' delta'
1050 else:
1051 else:
1051 basehdr = ' base'
1052 basehdr = ' base'
1052
1053
1053 if ui.debugflag:
1054 if ui.debugflag:
1054 shortfn = hex
1055 shortfn = hex
1055 else:
1056 else:
1056 shortfn = short
1057 shortfn = short
1057
1058
1058 # There might not be anything in r, so have a sane default
1059 # There might not be anything in r, so have a sane default
1059 idlen = 12
1060 idlen = 12
1060 for i in r:
1061 for i in r:
1061 idlen = len(shortfn(r.node(i)))
1062 idlen = len(shortfn(r.node(i)))
1062 break
1063 break
1063
1064
1064 if format == 0:
1065 if format == 0:
1065 ui.write((" rev offset length " + basehdr + " linkrev"
1066 ui.write((" rev offset length " + basehdr + " linkrev"
1066 " %s %s p2\n") % ("nodeid".ljust(idlen), "p1".ljust(idlen)))
1067 " %s %s p2\n") % ("nodeid".ljust(idlen), "p1".ljust(idlen)))
1067 elif format == 1:
1068 elif format == 1:
1068 ui.write((" rev flag offset length"
1069 ui.write((" rev flag offset length"
1069 " size " + basehdr + " link p1 p2"
1070 " size " + basehdr + " link p1 p2"
1070 " %s\n") % "nodeid".rjust(idlen))
1071 " %s\n") % "nodeid".rjust(idlen))
1071
1072
1072 for i in r:
1073 for i in r:
1073 node = r.node(i)
1074 node = r.node(i)
1074 if generaldelta:
1075 if generaldelta:
1075 base = r.deltaparent(i)
1076 base = r.deltaparent(i)
1076 else:
1077 else:
1077 base = r.chainbase(i)
1078 base = r.chainbase(i)
1078 if format == 0:
1079 if format == 0:
1079 try:
1080 try:
1080 pp = r.parents(node)
1081 pp = r.parents(node)
1081 except Exception:
1082 except Exception:
1082 pp = [nullid, nullid]
1083 pp = [nullid, nullid]
1083 ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % (
1084 ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % (
1084 i, r.start(i), r.length(i), base, r.linkrev(i),
1085 i, r.start(i), r.length(i), base, r.linkrev(i),
1085 shortfn(node), shortfn(pp[0]), shortfn(pp[1])))
1086 shortfn(node), shortfn(pp[0]), shortfn(pp[1])))
1086 elif format == 1:
1087 elif format == 1:
1087 pr = r.parentrevs(i)
1088 pr = r.parentrevs(i)
1088 ui.write("% 6d %04x % 8d % 8d % 8d % 6d % 6d % 6d % 6d %s\n" % (
1089 ui.write("% 6d %04x % 8d % 8d % 8d % 6d % 6d % 6d % 6d %s\n" % (
1089 i, r.flags(i), r.start(i), r.length(i), r.rawsize(i),
1090 i, r.flags(i), r.start(i), r.length(i), r.rawsize(i),
1090 base, r.linkrev(i), pr[0], pr[1], shortfn(node)))
1091 base, r.linkrev(i), pr[0], pr[1], shortfn(node)))
1091
1092
1092 @command('debugindexdot', cmdutil.debugrevlogopts,
1093 @command('debugindexdot', cmdutil.debugrevlogopts,
1093 _('-c|-m|FILE'), optionalrepo=True)
1094 _('-c|-m|FILE'), optionalrepo=True)
1094 def debugindexdot(ui, repo, file_=None, **opts):
1095 def debugindexdot(ui, repo, file_=None, **opts):
1095 """dump an index DAG as a graphviz dot file"""
1096 """dump an index DAG as a graphviz dot file"""
1096 opts = pycompat.byteskwargs(opts)
1097 opts = pycompat.byteskwargs(opts)
1097 r = cmdutil.openrevlog(repo, 'debugindexdot', file_, opts)
1098 r = cmdutil.openrevlog(repo, 'debugindexdot', file_, opts)
1098 ui.write(("digraph G {\n"))
1099 ui.write(("digraph G {\n"))
1099 for i in r:
1100 for i in r:
1100 node = r.node(i)
1101 node = r.node(i)
1101 pp = r.parents(node)
1102 pp = r.parents(node)
1102 ui.write("\t%d -> %d\n" % (r.rev(pp[0]), i))
1103 ui.write("\t%d -> %d\n" % (r.rev(pp[0]), i))
1103 if pp[1] != nullid:
1104 if pp[1] != nullid:
1104 ui.write("\t%d -> %d\n" % (r.rev(pp[1]), i))
1105 ui.write("\t%d -> %d\n" % (r.rev(pp[1]), i))
1105 ui.write("}\n")
1106 ui.write("}\n")
1106
1107
1107 @command('debuginstall', [] + cmdutil.formatteropts, '', norepo=True)
1108 @command('debuginstall', [] + cmdutil.formatteropts, '', norepo=True)
1108 def debuginstall(ui, **opts):
1109 def debuginstall(ui, **opts):
1109 '''test Mercurial installation
1110 '''test Mercurial installation
1110
1111
1111 Returns 0 on success.
1112 Returns 0 on success.
1112 '''
1113 '''
1113 opts = pycompat.byteskwargs(opts)
1114 opts = pycompat.byteskwargs(opts)
1114
1115
1115 def writetemp(contents):
1116 def writetemp(contents):
1116 (fd, name) = tempfile.mkstemp(prefix="hg-debuginstall-")
1117 (fd, name) = tempfile.mkstemp(prefix="hg-debuginstall-")
1117 f = os.fdopen(fd, pycompat.sysstr("wb"))
1118 f = os.fdopen(fd, pycompat.sysstr("wb"))
1118 f.write(contents)
1119 f.write(contents)
1119 f.close()
1120 f.close()
1120 return name
1121 return name
1121
1122
1122 problems = 0
1123 problems = 0
1123
1124
1124 fm = ui.formatter('debuginstall', opts)
1125 fm = ui.formatter('debuginstall', opts)
1125 fm.startitem()
1126 fm.startitem()
1126
1127
1127 # encoding
1128 # encoding
1128 fm.write('encoding', _("checking encoding (%s)...\n"), encoding.encoding)
1129 fm.write('encoding', _("checking encoding (%s)...\n"), encoding.encoding)
1129 err = None
1130 err = None
1130 try:
1131 try:
1131 codecs.lookup(pycompat.sysstr(encoding.encoding))
1132 codecs.lookup(pycompat.sysstr(encoding.encoding))
1132 except LookupError as inst:
1133 except LookupError as inst:
1133 err = util.forcebytestr(inst)
1134 err = util.forcebytestr(inst)
1134 problems += 1
1135 problems += 1
1135 fm.condwrite(err, 'encodingerror', _(" %s\n"
1136 fm.condwrite(err, 'encodingerror', _(" %s\n"
1136 " (check that your locale is properly set)\n"), err)
1137 " (check that your locale is properly set)\n"), err)
1137
1138
1138 # Python
1139 # Python
1139 fm.write('pythonexe', _("checking Python executable (%s)\n"),
1140 fm.write('pythonexe', _("checking Python executable (%s)\n"),
1140 pycompat.sysexecutable)
1141 pycompat.sysexecutable)
1141 fm.write('pythonver', _("checking Python version (%s)\n"),
1142 fm.write('pythonver', _("checking Python version (%s)\n"),
1142 ("%d.%d.%d" % sys.version_info[:3]))
1143 ("%d.%d.%d" % sys.version_info[:3]))
1143 fm.write('pythonlib', _("checking Python lib (%s)...\n"),
1144 fm.write('pythonlib', _("checking Python lib (%s)...\n"),
1144 os.path.dirname(pycompat.fsencode(os.__file__)))
1145 os.path.dirname(pycompat.fsencode(os.__file__)))
1145
1146
1146 security = set(sslutil.supportedprotocols)
1147 security = set(sslutil.supportedprotocols)
1147 if sslutil.hassni:
1148 if sslutil.hassni:
1148 security.add('sni')
1149 security.add('sni')
1149
1150
1150 fm.write('pythonsecurity', _("checking Python security support (%s)\n"),
1151 fm.write('pythonsecurity', _("checking Python security support (%s)\n"),
1151 fm.formatlist(sorted(security), name='protocol',
1152 fm.formatlist(sorted(security), name='protocol',
1152 fmt='%s', sep=','))
1153 fmt='%s', sep=','))
1153
1154
1154 # These are warnings, not errors. So don't increment problem count. This
1155 # These are warnings, not errors. So don't increment problem count. This
1155 # may change in the future.
1156 # may change in the future.
1156 if 'tls1.2' not in security:
1157 if 'tls1.2' not in security:
1157 fm.plain(_(' TLS 1.2 not supported by Python install; '
1158 fm.plain(_(' TLS 1.2 not supported by Python install; '
1158 'network connections lack modern security\n'))
1159 'network connections lack modern security\n'))
1159 if 'sni' not in security:
1160 if 'sni' not in security:
1160 fm.plain(_(' SNI not supported by Python install; may have '
1161 fm.plain(_(' SNI not supported by Python install; may have '
1161 'connectivity issues with some servers\n'))
1162 'connectivity issues with some servers\n'))
1162
1163
1163 # TODO print CA cert info
1164 # TODO print CA cert info
1164
1165
1165 # hg version
1166 # hg version
1166 hgver = util.version()
1167 hgver = util.version()
1167 fm.write('hgver', _("checking Mercurial version (%s)\n"),
1168 fm.write('hgver', _("checking Mercurial version (%s)\n"),
1168 hgver.split('+')[0])
1169 hgver.split('+')[0])
1169 fm.write('hgverextra', _("checking Mercurial custom build (%s)\n"),
1170 fm.write('hgverextra', _("checking Mercurial custom build (%s)\n"),
1170 '+'.join(hgver.split('+')[1:]))
1171 '+'.join(hgver.split('+')[1:]))
1171
1172
1172 # compiled modules
1173 # compiled modules
1173 fm.write('hgmodulepolicy', _("checking module policy (%s)\n"),
1174 fm.write('hgmodulepolicy', _("checking module policy (%s)\n"),
1174 policy.policy)
1175 policy.policy)
1175 fm.write('hgmodules', _("checking installed modules (%s)...\n"),
1176 fm.write('hgmodules', _("checking installed modules (%s)...\n"),
1176 os.path.dirname(pycompat.fsencode(__file__)))
1177 os.path.dirname(pycompat.fsencode(__file__)))
1177
1178
1178 if policy.policy in ('c', 'allow'):
1179 if policy.policy in ('c', 'allow'):
1179 err = None
1180 err = None
1180 try:
1181 try:
1181 from .cext import (
1182 from .cext import (
1182 base85,
1183 base85,
1183 bdiff,
1184 bdiff,
1184 mpatch,
1185 mpatch,
1185 osutil,
1186 osutil,
1186 )
1187 )
1187 dir(bdiff), dir(mpatch), dir(base85), dir(osutil) # quiet pyflakes
1188 dir(bdiff), dir(mpatch), dir(base85), dir(osutil) # quiet pyflakes
1188 except Exception as inst:
1189 except Exception as inst:
1189 err = util.forcebytestr(inst)
1190 err = util.forcebytestr(inst)
1190 problems += 1
1191 problems += 1
1191 fm.condwrite(err, 'extensionserror', " %s\n", err)
1192 fm.condwrite(err, 'extensionserror', " %s\n", err)
1192
1193
1193 compengines = util.compengines._engines.values()
1194 compengines = util.compengines._engines.values()
1194 fm.write('compengines', _('checking registered compression engines (%s)\n'),
1195 fm.write('compengines', _('checking registered compression engines (%s)\n'),
1195 fm.formatlist(sorted(e.name() for e in compengines),
1196 fm.formatlist(sorted(e.name() for e in compengines),
1196 name='compengine', fmt='%s', sep=', '))
1197 name='compengine', fmt='%s', sep=', '))
1197 fm.write('compenginesavail', _('checking available compression engines '
1198 fm.write('compenginesavail', _('checking available compression engines '
1198 '(%s)\n'),
1199 '(%s)\n'),
1199 fm.formatlist(sorted(e.name() for e in compengines
1200 fm.formatlist(sorted(e.name() for e in compengines
1200 if e.available()),
1201 if e.available()),
1201 name='compengine', fmt='%s', sep=', '))
1202 name='compengine', fmt='%s', sep=', '))
1202 wirecompengines = util.compengines.supportedwireengines(util.SERVERROLE)
1203 wirecompengines = util.compengines.supportedwireengines(util.SERVERROLE)
1203 fm.write('compenginesserver', _('checking available compression engines '
1204 fm.write('compenginesserver', _('checking available compression engines '
1204 'for wire protocol (%s)\n'),
1205 'for wire protocol (%s)\n'),
1205 fm.formatlist([e.name() for e in wirecompengines
1206 fm.formatlist([e.name() for e in wirecompengines
1206 if e.wireprotosupport()],
1207 if e.wireprotosupport()],
1207 name='compengine', fmt='%s', sep=', '))
1208 name='compengine', fmt='%s', sep=', '))
1208 re2 = 'missing'
1209 re2 = 'missing'
1209 if util._re2:
1210 if util._re2:
1210 re2 = 'available'
1211 re2 = 'available'
1211 fm.plain(_('checking "re2" regexp engine (%s)\n') % re2)
1212 fm.plain(_('checking "re2" regexp engine (%s)\n') % re2)
1212 fm.data(re2=bool(util._re2))
1213 fm.data(re2=bool(util._re2))
1213
1214
1214 # templates
1215 # templates
1215 p = templater.templatepaths()
1216 p = templater.templatepaths()
1216 fm.write('templatedirs', 'checking templates (%s)...\n', ' '.join(p))
1217 fm.write('templatedirs', 'checking templates (%s)...\n', ' '.join(p))
1217 fm.condwrite(not p, '', _(" no template directories found\n"))
1218 fm.condwrite(not p, '', _(" no template directories found\n"))
1218 if p:
1219 if p:
1219 m = templater.templatepath("map-cmdline.default")
1220 m = templater.templatepath("map-cmdline.default")
1220 if m:
1221 if m:
1221 # template found, check if it is working
1222 # template found, check if it is working
1222 err = None
1223 err = None
1223 try:
1224 try:
1224 templater.templater.frommapfile(m)
1225 templater.templater.frommapfile(m)
1225 except Exception as inst:
1226 except Exception as inst:
1226 err = util.forcebytestr(inst)
1227 err = util.forcebytestr(inst)
1227 p = None
1228 p = None
1228 fm.condwrite(err, 'defaulttemplateerror', " %s\n", err)
1229 fm.condwrite(err, 'defaulttemplateerror', " %s\n", err)
1229 else:
1230 else:
1230 p = None
1231 p = None
1231 fm.condwrite(p, 'defaulttemplate',
1232 fm.condwrite(p, 'defaulttemplate',
1232 _("checking default template (%s)\n"), m)
1233 _("checking default template (%s)\n"), m)
1233 fm.condwrite(not m, 'defaulttemplatenotfound',
1234 fm.condwrite(not m, 'defaulttemplatenotfound',
1234 _(" template '%s' not found\n"), "default")
1235 _(" template '%s' not found\n"), "default")
1235 if not p:
1236 if not p:
1236 problems += 1
1237 problems += 1
1237 fm.condwrite(not p, '',
1238 fm.condwrite(not p, '',
1238 _(" (templates seem to have been installed incorrectly)\n"))
1239 _(" (templates seem to have been installed incorrectly)\n"))
1239
1240
1240 # editor
1241 # editor
1241 editor = ui.geteditor()
1242 editor = ui.geteditor()
1242 editor = util.expandpath(editor)
1243 editor = util.expandpath(editor)
1243 editorbin = util.shellsplit(editor)[0]
1244 editorbin = util.shellsplit(editor)[0]
1244 fm.write('editor', _("checking commit editor... (%s)\n"), editorbin)
1245 fm.write('editor', _("checking commit editor... (%s)\n"), editorbin)
1245 cmdpath = util.findexe(editorbin)
1246 cmdpath = util.findexe(editorbin)
1246 fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound',
1247 fm.condwrite(not cmdpath and editor == 'vi', 'vinotfound',
1247 _(" No commit editor set and can't find %s in PATH\n"
1248 _(" No commit editor set and can't find %s in PATH\n"
1248 " (specify a commit editor in your configuration"
1249 " (specify a commit editor in your configuration"
1249 " file)\n"), not cmdpath and editor == 'vi' and editorbin)
1250 " file)\n"), not cmdpath and editor == 'vi' and editorbin)
1250 fm.condwrite(not cmdpath and editor != 'vi', 'editornotfound',
1251 fm.condwrite(not cmdpath and editor != 'vi', 'editornotfound',
1251 _(" Can't find editor '%s' in PATH\n"
1252 _(" Can't find editor '%s' in PATH\n"
1252 " (specify a commit editor in your configuration"
1253 " (specify a commit editor in your configuration"
1253 " file)\n"), not cmdpath and editorbin)
1254 " file)\n"), not cmdpath and editorbin)
1254 if not cmdpath and editor != 'vi':
1255 if not cmdpath and editor != 'vi':
1255 problems += 1
1256 problems += 1
1256
1257
1257 # check username
1258 # check username
1258 username = None
1259 username = None
1259 err = None
1260 err = None
1260 try:
1261 try:
1261 username = ui.username()
1262 username = ui.username()
1262 except error.Abort as e:
1263 except error.Abort as e:
1263 err = util.forcebytestr(e)
1264 err = util.forcebytestr(e)
1264 problems += 1
1265 problems += 1
1265
1266
1266 fm.condwrite(username, 'username', _("checking username (%s)\n"), username)
1267 fm.condwrite(username, 'username', _("checking username (%s)\n"), username)
1267 fm.condwrite(err, 'usernameerror', _("checking username...\n %s\n"
1268 fm.condwrite(err, 'usernameerror', _("checking username...\n %s\n"
1268 " (specify a username in your configuration file)\n"), err)
1269 " (specify a username in your configuration file)\n"), err)
1269
1270
1270 fm.condwrite(not problems, '',
1271 fm.condwrite(not problems, '',
1271 _("no problems detected\n"))
1272 _("no problems detected\n"))
1272 if not problems:
1273 if not problems:
1273 fm.data(problems=problems)
1274 fm.data(problems=problems)
1274 fm.condwrite(problems, 'problems',
1275 fm.condwrite(problems, 'problems',
1275 _("%d problems detected,"
1276 _("%d problems detected,"
1276 " please check your install!\n"), problems)
1277 " please check your install!\n"), problems)
1277 fm.end()
1278 fm.end()
1278
1279
1279 return problems
1280 return problems
1280
1281
1281 @command('debugknown', [], _('REPO ID...'), norepo=True)
1282 @command('debugknown', [], _('REPO ID...'), norepo=True)
1282 def debugknown(ui, repopath, *ids, **opts):
1283 def debugknown(ui, repopath, *ids, **opts):
1283 """test whether node ids are known to a repo
1284 """test whether node ids are known to a repo
1284
1285
1285 Every ID must be a full-length hex node id string. Returns a list of 0s
1286 Every ID must be a full-length hex node id string. Returns a list of 0s
1286 and 1s indicating unknown/known.
1287 and 1s indicating unknown/known.
1287 """
1288 """
1288 opts = pycompat.byteskwargs(opts)
1289 opts = pycompat.byteskwargs(opts)
1289 repo = hg.peer(ui, opts, repopath)
1290 repo = hg.peer(ui, opts, repopath)
1290 if not repo.capable('known'):
1291 if not repo.capable('known'):
1291 raise error.Abort("known() not supported by target repository")
1292 raise error.Abort("known() not supported by target repository")
1292 flags = repo.known([bin(s) for s in ids])
1293 flags = repo.known([bin(s) for s in ids])
1293 ui.write("%s\n" % ("".join([f and "1" or "0" for f in flags])))
1294 ui.write("%s\n" % ("".join([f and "1" or "0" for f in flags])))
1294
1295
1295 @command('debuglabelcomplete', [], _('LABEL...'))
1296 @command('debuglabelcomplete', [], _('LABEL...'))
1296 def debuglabelcomplete(ui, repo, *args):
1297 def debuglabelcomplete(ui, repo, *args):
1297 '''backwards compatibility with old bash completion scripts (DEPRECATED)'''
1298 '''backwards compatibility with old bash completion scripts (DEPRECATED)'''
1298 debugnamecomplete(ui, repo, *args)
1299 debugnamecomplete(ui, repo, *args)
1299
1300
1300 @command('debuglocks',
1301 @command('debuglocks',
1301 [('L', 'force-lock', None, _('free the store lock (DANGEROUS)')),
1302 [('L', 'force-lock', None, _('free the store lock (DANGEROUS)')),
1302 ('W', 'force-wlock', None,
1303 ('W', 'force-wlock', None,
1303 _('free the working state lock (DANGEROUS)')),
1304 _('free the working state lock (DANGEROUS)')),
1304 ('s', 'set-lock', None, _('set the store lock until stopped')),
1305 ('s', 'set-lock', None, _('set the store lock until stopped')),
1305 ('S', 'set-wlock', None,
1306 ('S', 'set-wlock', None,
1306 _('set the working state lock until stopped'))],
1307 _('set the working state lock until stopped'))],
1307 _('[OPTION]...'))
1308 _('[OPTION]...'))
1308 def debuglocks(ui, repo, **opts):
1309 def debuglocks(ui, repo, **opts):
1309 """show or modify state of locks
1310 """show or modify state of locks
1310
1311
1311 By default, this command will show which locks are held. This
1312 By default, this command will show which locks are held. This
1312 includes the user and process holding the lock, the amount of time
1313 includes the user and process holding the lock, the amount of time
1313 the lock has been held, and the machine name where the process is
1314 the lock has been held, and the machine name where the process is
1314 running if it's not local.
1315 running if it's not local.
1315
1316
1316 Locks protect the integrity of Mercurial's data, so should be
1317 Locks protect the integrity of Mercurial's data, so should be
1317 treated with care. System crashes or other interruptions may cause
1318 treated with care. System crashes or other interruptions may cause
1318 locks to not be properly released, though Mercurial will usually
1319 locks to not be properly released, though Mercurial will usually
1319 detect and remove such stale locks automatically.
1320 detect and remove such stale locks automatically.
1320
1321
1321 However, detecting stale locks may not always be possible (for
1322 However, detecting stale locks may not always be possible (for
1322 instance, on a shared filesystem). Removing locks may also be
1323 instance, on a shared filesystem). Removing locks may also be
1323 blocked by filesystem permissions.
1324 blocked by filesystem permissions.
1324
1325
1325 Setting a lock will prevent other commands from changing the data.
1326 Setting a lock will prevent other commands from changing the data.
1326 The command will wait until an interruption (SIGINT, SIGTERM, ...) occurs.
1327 The command will wait until an interruption (SIGINT, SIGTERM, ...) occurs.
1327 The set locks are removed when the command exits.
1328 The set locks are removed when the command exits.
1328
1329
1329 Returns 0 if no locks are held.
1330 Returns 0 if no locks are held.
1330
1331
1331 """
1332 """
1332
1333
1333 if opts.get(r'force_lock'):
1334 if opts.get(r'force_lock'):
1334 repo.svfs.unlink('lock')
1335 repo.svfs.unlink('lock')
1335 if opts.get(r'force_wlock'):
1336 if opts.get(r'force_wlock'):
1336 repo.vfs.unlink('wlock')
1337 repo.vfs.unlink('wlock')
1337 if opts.get(r'force_lock') or opts.get(r'force_wlock'):
1338 if opts.get(r'force_lock') or opts.get(r'force_wlock'):
1338 return 0
1339 return 0
1339
1340
1340 locks = []
1341 locks = []
1341 try:
1342 try:
1342 if opts.get(r'set_wlock'):
1343 if opts.get(r'set_wlock'):
1343 try:
1344 try:
1344 locks.append(repo.wlock(False))
1345 locks.append(repo.wlock(False))
1345 except error.LockHeld:
1346 except error.LockHeld:
1346 raise error.Abort(_('wlock is already held'))
1347 raise error.Abort(_('wlock is already held'))
1347 if opts.get(r'set_lock'):
1348 if opts.get(r'set_lock'):
1348 try:
1349 try:
1349 locks.append(repo.lock(False))
1350 locks.append(repo.lock(False))
1350 except error.LockHeld:
1351 except error.LockHeld:
1351 raise error.Abort(_('lock is already held'))
1352 raise error.Abort(_('lock is already held'))
1352 if len(locks):
1353 if len(locks):
1353 ui.promptchoice(_("ready to release the lock (y)? $$ &Yes"))
1354 ui.promptchoice(_("ready to release the lock (y)? $$ &Yes"))
1354 return 0
1355 return 0
1355 finally:
1356 finally:
1356 release(*locks)
1357 release(*locks)
1357
1358
1358 now = time.time()
1359 now = time.time()
1359 held = 0
1360 held = 0
1360
1361
1361 def report(vfs, name, method):
1362 def report(vfs, name, method):
1362 # this causes stale locks to get reaped for more accurate reporting
1363 # this causes stale locks to get reaped for more accurate reporting
1363 try:
1364 try:
1364 l = method(False)
1365 l = method(False)
1365 except error.LockHeld:
1366 except error.LockHeld:
1366 l = None
1367 l = None
1367
1368
1368 if l:
1369 if l:
1369 l.release()
1370 l.release()
1370 else:
1371 else:
1371 try:
1372 try:
1372 stat = vfs.lstat(name)
1373 stat = vfs.lstat(name)
1373 age = now - stat.st_mtime
1374 age = now - stat.st_mtime
1374 user = util.username(stat.st_uid)
1375 user = util.username(stat.st_uid)
1375 locker = vfs.readlock(name)
1376 locker = vfs.readlock(name)
1376 if ":" in locker:
1377 if ":" in locker:
1377 host, pid = locker.split(':')
1378 host, pid = locker.split(':')
1378 if host == socket.gethostname():
1379 if host == socket.gethostname():
1379 locker = 'user %s, process %s' % (user, pid)
1380 locker = 'user %s, process %s' % (user, pid)
1380 else:
1381 else:
1381 locker = 'user %s, process %s, host %s' \
1382 locker = 'user %s, process %s, host %s' \
1382 % (user, pid, host)
1383 % (user, pid, host)
1383 ui.write(("%-6s %s (%ds)\n") % (name + ":", locker, age))
1384 ui.write(("%-6s %s (%ds)\n") % (name + ":", locker, age))
1384 return 1
1385 return 1
1385 except OSError as e:
1386 except OSError as e:
1386 if e.errno != errno.ENOENT:
1387 if e.errno != errno.ENOENT:
1387 raise
1388 raise
1388
1389
1389 ui.write(("%-6s free\n") % (name + ":"))
1390 ui.write(("%-6s free\n") % (name + ":"))
1390 return 0
1391 return 0
1391
1392
1392 held += report(repo.svfs, "lock", repo.lock)
1393 held += report(repo.svfs, "lock", repo.lock)
1393 held += report(repo.vfs, "wlock", repo.wlock)
1394 held += report(repo.vfs, "wlock", repo.wlock)
1394
1395
1395 return held
1396 return held
1396
1397
1397 @command('debugmergestate', [], '')
1398 @command('debugmergestate', [], '')
1398 def debugmergestate(ui, repo, *args):
1399 def debugmergestate(ui, repo, *args):
1399 """print merge state
1400 """print merge state
1400
1401
1401 Use --verbose to print out information about whether v1 or v2 merge state
1402 Use --verbose to print out information about whether v1 or v2 merge state
1402 was chosen."""
1403 was chosen."""
1403 def _hashornull(h):
1404 def _hashornull(h):
1404 if h == nullhex:
1405 if h == nullhex:
1405 return 'null'
1406 return 'null'
1406 else:
1407 else:
1407 return h
1408 return h
1408
1409
1409 def printrecords(version):
1410 def printrecords(version):
1410 ui.write(('* version %d records\n') % version)
1411 ui.write(('* version %d records\n') % version)
1411 if version == 1:
1412 if version == 1:
1412 records = v1records
1413 records = v1records
1413 else:
1414 else:
1414 records = v2records
1415 records = v2records
1415
1416
1416 for rtype, record in records:
1417 for rtype, record in records:
1417 # pretty print some record types
1418 # pretty print some record types
1418 if rtype == 'L':
1419 if rtype == 'L':
1419 ui.write(('local: %s\n') % record)
1420 ui.write(('local: %s\n') % record)
1420 elif rtype == 'O':
1421 elif rtype == 'O':
1421 ui.write(('other: %s\n') % record)
1422 ui.write(('other: %s\n') % record)
1422 elif rtype == 'm':
1423 elif rtype == 'm':
1423 driver, mdstate = record.split('\0', 1)
1424 driver, mdstate = record.split('\0', 1)
1424 ui.write(('merge driver: %s (state "%s")\n')
1425 ui.write(('merge driver: %s (state "%s")\n')
1425 % (driver, mdstate))
1426 % (driver, mdstate))
1426 elif rtype in 'FDC':
1427 elif rtype in 'FDC':
1427 r = record.split('\0')
1428 r = record.split('\0')
1428 f, state, hash, lfile, afile, anode, ofile = r[0:7]
1429 f, state, hash, lfile, afile, anode, ofile = r[0:7]
1429 if version == 1:
1430 if version == 1:
1430 onode = 'not stored in v1 format'
1431 onode = 'not stored in v1 format'
1431 flags = r[7]
1432 flags = r[7]
1432 else:
1433 else:
1433 onode, flags = r[7:9]
1434 onode, flags = r[7:9]
1434 ui.write(('file: %s (record type "%s", state "%s", hash %s)\n')
1435 ui.write(('file: %s (record type "%s", state "%s", hash %s)\n')
1435 % (f, rtype, state, _hashornull(hash)))
1436 % (f, rtype, state, _hashornull(hash)))
1436 ui.write((' local path: %s (flags "%s")\n') % (lfile, flags))
1437 ui.write((' local path: %s (flags "%s")\n') % (lfile, flags))
1437 ui.write((' ancestor path: %s (node %s)\n')
1438 ui.write((' ancestor path: %s (node %s)\n')
1438 % (afile, _hashornull(anode)))
1439 % (afile, _hashornull(anode)))
1439 ui.write((' other path: %s (node %s)\n')
1440 ui.write((' other path: %s (node %s)\n')
1440 % (ofile, _hashornull(onode)))
1441 % (ofile, _hashornull(onode)))
1441 elif rtype == 'f':
1442 elif rtype == 'f':
1442 filename, rawextras = record.split('\0', 1)
1443 filename, rawextras = record.split('\0', 1)
1443 extras = rawextras.split('\0')
1444 extras = rawextras.split('\0')
1444 i = 0
1445 i = 0
1445 extrastrings = []
1446 extrastrings = []
1446 while i < len(extras):
1447 while i < len(extras):
1447 extrastrings.append('%s = %s' % (extras[i], extras[i + 1]))
1448 extrastrings.append('%s = %s' % (extras[i], extras[i + 1]))
1448 i += 2
1449 i += 2
1449
1450
1450 ui.write(('file extras: %s (%s)\n')
1451 ui.write(('file extras: %s (%s)\n')
1451 % (filename, ', '.join(extrastrings)))
1452 % (filename, ', '.join(extrastrings)))
1452 elif rtype == 'l':
1453 elif rtype == 'l':
1453 labels = record.split('\0', 2)
1454 labels = record.split('\0', 2)
1454 labels = [l for l in labels if len(l) > 0]
1455 labels = [l for l in labels if len(l) > 0]
1455 ui.write(('labels:\n'))
1456 ui.write(('labels:\n'))
1456 ui.write((' local: %s\n' % labels[0]))
1457 ui.write((' local: %s\n' % labels[0]))
1457 ui.write((' other: %s\n' % labels[1]))
1458 ui.write((' other: %s\n' % labels[1]))
1458 if len(labels) > 2:
1459 if len(labels) > 2:
1459 ui.write((' base: %s\n' % labels[2]))
1460 ui.write((' base: %s\n' % labels[2]))
1460 else:
1461 else:
1461 ui.write(('unrecognized entry: %s\t%s\n')
1462 ui.write(('unrecognized entry: %s\t%s\n')
1462 % (rtype, record.replace('\0', '\t')))
1463 % (rtype, record.replace('\0', '\t')))
1463
1464
1464 # Avoid mergestate.read() since it may raise an exception for unsupported
1465 # Avoid mergestate.read() since it may raise an exception for unsupported
1465 # merge state records. We shouldn't be doing this, but this is OK since this
1466 # merge state records. We shouldn't be doing this, but this is OK since this
1466 # command is pretty low-level.
1467 # command is pretty low-level.
1467 ms = mergemod.mergestate(repo)
1468 ms = mergemod.mergestate(repo)
1468
1469
1469 # sort so that reasonable information is on top
1470 # sort so that reasonable information is on top
1470 v1records = ms._readrecordsv1()
1471 v1records = ms._readrecordsv1()
1471 v2records = ms._readrecordsv2()
1472 v2records = ms._readrecordsv2()
1472 order = 'LOml'
1473 order = 'LOml'
1473 def key(r):
1474 def key(r):
1474 idx = order.find(r[0])
1475 idx = order.find(r[0])
1475 if idx == -1:
1476 if idx == -1:
1476 return (1, r[1])
1477 return (1, r[1])
1477 else:
1478 else:
1478 return (0, idx)
1479 return (0, idx)
1479 v1records.sort(key=key)
1480 v1records.sort(key=key)
1480 v2records.sort(key=key)
1481 v2records.sort(key=key)
1481
1482
1482 if not v1records and not v2records:
1483 if not v1records and not v2records:
1483 ui.write(('no merge state found\n'))
1484 ui.write(('no merge state found\n'))
1484 elif not v2records:
1485 elif not v2records:
1485 ui.note(('no version 2 merge state\n'))
1486 ui.note(('no version 2 merge state\n'))
1486 printrecords(1)
1487 printrecords(1)
1487 elif ms._v1v2match(v1records, v2records):
1488 elif ms._v1v2match(v1records, v2records):
1488 ui.note(('v1 and v2 states match: using v2\n'))
1489 ui.note(('v1 and v2 states match: using v2\n'))
1489 printrecords(2)
1490 printrecords(2)
1490 else:
1491 else:
1491 ui.note(('v1 and v2 states mismatch: using v1\n'))
1492 ui.note(('v1 and v2 states mismatch: using v1\n'))
1492 printrecords(1)
1493 printrecords(1)
1493 if ui.verbose:
1494 if ui.verbose:
1494 printrecords(2)
1495 printrecords(2)
1495
1496
1496 @command('debugnamecomplete', [], _('NAME...'))
1497 @command('debugnamecomplete', [], _('NAME...'))
1497 def debugnamecomplete(ui, repo, *args):
1498 def debugnamecomplete(ui, repo, *args):
1498 '''complete "names" - tags, open branch names, bookmark names'''
1499 '''complete "names" - tags, open branch names, bookmark names'''
1499
1500
1500 names = set()
1501 names = set()
1501 # since we previously only listed open branches, we will handle that
1502 # since we previously only listed open branches, we will handle that
1502 # specially (after this for loop)
1503 # specially (after this for loop)
1503 for name, ns in repo.names.iteritems():
1504 for name, ns in repo.names.iteritems():
1504 if name != 'branches':
1505 if name != 'branches':
1505 names.update(ns.listnames(repo))
1506 names.update(ns.listnames(repo))
1506 names.update(tag for (tag, heads, tip, closed)
1507 names.update(tag for (tag, heads, tip, closed)
1507 in repo.branchmap().iterbranches() if not closed)
1508 in repo.branchmap().iterbranches() if not closed)
1508 completions = set()
1509 completions = set()
1509 if not args:
1510 if not args:
1510 args = ['']
1511 args = ['']
1511 for a in args:
1512 for a in args:
1512 completions.update(n for n in names if n.startswith(a))
1513 completions.update(n for n in names if n.startswith(a))
1513 ui.write('\n'.join(sorted(completions)))
1514 ui.write('\n'.join(sorted(completions)))
1514 ui.write('\n')
1515 ui.write('\n')
1515
1516
1516 @command('debugobsolete',
1517 @command('debugobsolete',
1517 [('', 'flags', 0, _('markers flag')),
1518 [('', 'flags', 0, _('markers flag')),
1518 ('', 'record-parents', False,
1519 ('', 'record-parents', False,
1519 _('record parent information for the precursor')),
1520 _('record parent information for the precursor')),
1520 ('r', 'rev', [], _('display markers relevant to REV')),
1521 ('r', 'rev', [], _('display markers relevant to REV')),
1521 ('', 'exclusive', False, _('restrict display to markers only '
1522 ('', 'exclusive', False, _('restrict display to markers only '
1522 'relevant to REV')),
1523 'relevant to REV')),
1523 ('', 'index', False, _('display index of the marker')),
1524 ('', 'index', False, _('display index of the marker')),
1524 ('', 'delete', [], _('delete markers specified by indices')),
1525 ('', 'delete', [], _('delete markers specified by indices')),
1525 ] + cmdutil.commitopts2 + cmdutil.formatteropts,
1526 ] + cmdutil.commitopts2 + cmdutil.formatteropts,
1526 _('[OBSOLETED [REPLACEMENT ...]]'))
1527 _('[OBSOLETED [REPLACEMENT ...]]'))
1527 def debugobsolete(ui, repo, precursor=None, *successors, **opts):
1528 def debugobsolete(ui, repo, precursor=None, *successors, **opts):
1528 """create arbitrary obsolete marker
1529 """create arbitrary obsolete marker
1529
1530
1530 With no arguments, displays the list of obsolescence markers."""
1531 With no arguments, displays the list of obsolescence markers."""
1531
1532
1532 opts = pycompat.byteskwargs(opts)
1533 opts = pycompat.byteskwargs(opts)
1533
1534
1534 def parsenodeid(s):
1535 def parsenodeid(s):
1535 try:
1536 try:
1536 # We do not use revsingle/revrange functions here to accept
1537 # We do not use revsingle/revrange functions here to accept
1537 # arbitrary node identifiers, possibly not present in the
1538 # arbitrary node identifiers, possibly not present in the
1538 # local repository.
1539 # local repository.
1539 n = bin(s)
1540 n = bin(s)
1540 if len(n) != len(nullid):
1541 if len(n) != len(nullid):
1541 raise TypeError()
1542 raise TypeError()
1542 return n
1543 return n
1543 except TypeError:
1544 except TypeError:
1544 raise error.Abort('changeset references must be full hexadecimal '
1545 raise error.Abort('changeset references must be full hexadecimal '
1545 'node identifiers')
1546 'node identifiers')
1546
1547
1547 if opts.get('delete'):
1548 if opts.get('delete'):
1548 indices = []
1549 indices = []
1549 for v in opts.get('delete'):
1550 for v in opts.get('delete'):
1550 try:
1551 try:
1551 indices.append(int(v))
1552 indices.append(int(v))
1552 except ValueError:
1553 except ValueError:
1553 raise error.Abort(_('invalid index value: %r') % v,
1554 raise error.Abort(_('invalid index value: %r') % v,
1554 hint=_('use integers for indices'))
1555 hint=_('use integers for indices'))
1555
1556
1556 if repo.currenttransaction():
1557 if repo.currenttransaction():
1557 raise error.Abort(_('cannot delete obsmarkers in the middle '
1558 raise error.Abort(_('cannot delete obsmarkers in the middle '
1558 'of transaction.'))
1559 'of transaction.'))
1559
1560
1560 with repo.lock():
1561 with repo.lock():
1561 n = repair.deleteobsmarkers(repo.obsstore, indices)
1562 n = repair.deleteobsmarkers(repo.obsstore, indices)
1562 ui.write(_('deleted %i obsolescence markers\n') % n)
1563 ui.write(_('deleted %i obsolescence markers\n') % n)
1563
1564
1564 return
1565 return
1565
1566
1566 if precursor is not None:
1567 if precursor is not None:
1567 if opts['rev']:
1568 if opts['rev']:
1568 raise error.Abort('cannot select revision when creating marker')
1569 raise error.Abort('cannot select revision when creating marker')
1569 metadata = {}
1570 metadata = {}
1570 metadata['user'] = opts['user'] or ui.username()
1571 metadata['user'] = opts['user'] or ui.username()
1571 succs = tuple(parsenodeid(succ) for succ in successors)
1572 succs = tuple(parsenodeid(succ) for succ in successors)
1572 l = repo.lock()
1573 l = repo.lock()
1573 try:
1574 try:
1574 tr = repo.transaction('debugobsolete')
1575 tr = repo.transaction('debugobsolete')
1575 try:
1576 try:
1576 date = opts.get('date')
1577 date = opts.get('date')
1577 if date:
1578 if date:
1578 date = util.parsedate(date)
1579 date = util.parsedate(date)
1579 else:
1580 else:
1580 date = None
1581 date = None
1581 prec = parsenodeid(precursor)
1582 prec = parsenodeid(precursor)
1582 parents = None
1583 parents = None
1583 if opts['record_parents']:
1584 if opts['record_parents']:
1584 if prec not in repo.unfiltered():
1585 if prec not in repo.unfiltered():
1585 raise error.Abort('cannot used --record-parents on '
1586 raise error.Abort('cannot used --record-parents on '
1586 'unknown changesets')
1587 'unknown changesets')
1587 parents = repo.unfiltered()[prec].parents()
1588 parents = repo.unfiltered()[prec].parents()
1588 parents = tuple(p.node() for p in parents)
1589 parents = tuple(p.node() for p in parents)
1589 repo.obsstore.create(tr, prec, succs, opts['flags'],
1590 repo.obsstore.create(tr, prec, succs, opts['flags'],
1590 parents=parents, date=date,
1591 parents=parents, date=date,
1591 metadata=metadata, ui=ui)
1592 metadata=metadata, ui=ui)
1592 tr.close()
1593 tr.close()
1593 except ValueError as exc:
1594 except ValueError as exc:
1594 raise error.Abort(_('bad obsmarker input: %s') %
1595 raise error.Abort(_('bad obsmarker input: %s') %
1595 pycompat.bytestr(exc))
1596 pycompat.bytestr(exc))
1596 finally:
1597 finally:
1597 tr.release()
1598 tr.release()
1598 finally:
1599 finally:
1599 l.release()
1600 l.release()
1600 else:
1601 else:
1601 if opts['rev']:
1602 if opts['rev']:
1602 revs = scmutil.revrange(repo, opts['rev'])
1603 revs = scmutil.revrange(repo, opts['rev'])
1603 nodes = [repo[r].node() for r in revs]
1604 nodes = [repo[r].node() for r in revs]
1604 markers = list(obsutil.getmarkers(repo, nodes=nodes,
1605 markers = list(obsutil.getmarkers(repo, nodes=nodes,
1605 exclusive=opts['exclusive']))
1606 exclusive=opts['exclusive']))
1606 markers.sort(key=lambda x: x._data)
1607 markers.sort(key=lambda x: x._data)
1607 else:
1608 else:
1608 markers = obsutil.getmarkers(repo)
1609 markers = obsutil.getmarkers(repo)
1609
1610
1610 markerstoiter = markers
1611 markerstoiter = markers
1611 isrelevant = lambda m: True
1612 isrelevant = lambda m: True
1612 if opts.get('rev') and opts.get('index'):
1613 if opts.get('rev') and opts.get('index'):
1613 markerstoiter = obsutil.getmarkers(repo)
1614 markerstoiter = obsutil.getmarkers(repo)
1614 markerset = set(markers)
1615 markerset = set(markers)
1615 isrelevant = lambda m: m in markerset
1616 isrelevant = lambda m: m in markerset
1616
1617
1617 fm = ui.formatter('debugobsolete', opts)
1618 fm = ui.formatter('debugobsolete', opts)
1618 for i, m in enumerate(markerstoiter):
1619 for i, m in enumerate(markerstoiter):
1619 if not isrelevant(m):
1620 if not isrelevant(m):
1620 # marker can be irrelevant when we're iterating over a set
1621 # marker can be irrelevant when we're iterating over a set
1621 # of markers (markerstoiter) which is bigger than the set
1622 # of markers (markerstoiter) which is bigger than the set
1622 # of markers we want to display (markers)
1623 # of markers we want to display (markers)
1623 # this can happen if both --index and --rev options are
1624 # this can happen if both --index and --rev options are
1624 # provided and thus we need to iterate over all of the markers
1625 # provided and thus we need to iterate over all of the markers
1625 # to get the correct indices, but only display the ones that
1626 # to get the correct indices, but only display the ones that
1626 # are relevant to --rev value
1627 # are relevant to --rev value
1627 continue
1628 continue
1628 fm.startitem()
1629 fm.startitem()
1629 ind = i if opts.get('index') else None
1630 ind = i if opts.get('index') else None
1630 cmdutil.showmarker(fm, m, index=ind)
1631 cmdutil.showmarker(fm, m, index=ind)
1631 fm.end()
1632 fm.end()
1632
1633
1633 @command('debugpathcomplete',
1634 @command('debugpathcomplete',
1634 [('f', 'full', None, _('complete an entire path')),
1635 [('f', 'full', None, _('complete an entire path')),
1635 ('n', 'normal', None, _('show only normal files')),
1636 ('n', 'normal', None, _('show only normal files')),
1636 ('a', 'added', None, _('show only added files')),
1637 ('a', 'added', None, _('show only added files')),
1637 ('r', 'removed', None, _('show only removed files'))],
1638 ('r', 'removed', None, _('show only removed files'))],
1638 _('FILESPEC...'))
1639 _('FILESPEC...'))
1639 def debugpathcomplete(ui, repo, *specs, **opts):
1640 def debugpathcomplete(ui, repo, *specs, **opts):
1640 '''complete part or all of a tracked path
1641 '''complete part or all of a tracked path
1641
1642
1642 This command supports shells that offer path name completion. It
1643 This command supports shells that offer path name completion. It
1643 currently completes only files already known to the dirstate.
1644 currently completes only files already known to the dirstate.
1644
1645
1645 Completion extends only to the next path segment unless
1646 Completion extends only to the next path segment unless
1646 --full is specified, in which case entire paths are used.'''
1647 --full is specified, in which case entire paths are used.'''
1647
1648
1648 def complete(path, acceptable):
1649 def complete(path, acceptable):
1649 dirstate = repo.dirstate
1650 dirstate = repo.dirstate
1650 spec = os.path.normpath(os.path.join(pycompat.getcwd(), path))
1651 spec = os.path.normpath(os.path.join(pycompat.getcwd(), path))
1651 rootdir = repo.root + pycompat.ossep
1652 rootdir = repo.root + pycompat.ossep
1652 if spec != repo.root and not spec.startswith(rootdir):
1653 if spec != repo.root and not spec.startswith(rootdir):
1653 return [], []
1654 return [], []
1654 if os.path.isdir(spec):
1655 if os.path.isdir(spec):
1655 spec += '/'
1656 spec += '/'
1656 spec = spec[len(rootdir):]
1657 spec = spec[len(rootdir):]
1657 fixpaths = pycompat.ossep != '/'
1658 fixpaths = pycompat.ossep != '/'
1658 if fixpaths:
1659 if fixpaths:
1659 spec = spec.replace(pycompat.ossep, '/')
1660 spec = spec.replace(pycompat.ossep, '/')
1660 speclen = len(spec)
1661 speclen = len(spec)
1661 fullpaths = opts[r'full']
1662 fullpaths = opts[r'full']
1662 files, dirs = set(), set()
1663 files, dirs = set(), set()
1663 adddir, addfile = dirs.add, files.add
1664 adddir, addfile = dirs.add, files.add
1664 for f, st in dirstate.iteritems():
1665 for f, st in dirstate.iteritems():
1665 if f.startswith(spec) and st[0] in acceptable:
1666 if f.startswith(spec) and st[0] in acceptable:
1666 if fixpaths:
1667 if fixpaths:
1667 f = f.replace('/', pycompat.ossep)
1668 f = f.replace('/', pycompat.ossep)
1668 if fullpaths:
1669 if fullpaths:
1669 addfile(f)
1670 addfile(f)
1670 continue
1671 continue
1671 s = f.find(pycompat.ossep, speclen)
1672 s = f.find(pycompat.ossep, speclen)
1672 if s >= 0:
1673 if s >= 0:
1673 adddir(f[:s])
1674 adddir(f[:s])
1674 else:
1675 else:
1675 addfile(f)
1676 addfile(f)
1676 return files, dirs
1677 return files, dirs
1677
1678
1678 acceptable = ''
1679 acceptable = ''
1679 if opts[r'normal']:
1680 if opts[r'normal']:
1680 acceptable += 'nm'
1681 acceptable += 'nm'
1681 if opts[r'added']:
1682 if opts[r'added']:
1682 acceptable += 'a'
1683 acceptable += 'a'
1683 if opts[r'removed']:
1684 if opts[r'removed']:
1684 acceptable += 'r'
1685 acceptable += 'r'
1685 cwd = repo.getcwd()
1686 cwd = repo.getcwd()
1686 if not specs:
1687 if not specs:
1687 specs = ['.']
1688 specs = ['.']
1688
1689
1689 files, dirs = set(), set()
1690 files, dirs = set(), set()
1690 for spec in specs:
1691 for spec in specs:
1691 f, d = complete(spec, acceptable or 'nmar')
1692 f, d = complete(spec, acceptable or 'nmar')
1692 files.update(f)
1693 files.update(f)
1693 dirs.update(d)
1694 dirs.update(d)
1694 files.update(dirs)
1695 files.update(dirs)
1695 ui.write('\n'.join(repo.pathto(p, cwd) for p in sorted(files)))
1696 ui.write('\n'.join(repo.pathto(p, cwd) for p in sorted(files)))
1696 ui.write('\n')
1697 ui.write('\n')
1697
1698
1698 @command('debugpeer', [], _('PATH'), norepo=True)
1699 @command('debugpeer', [], _('PATH'), norepo=True)
1699 def debugpeer(ui, path):
1700 def debugpeer(ui, path):
1700 """establish a connection to a peer repository"""
1701 """establish a connection to a peer repository"""
1701 # Always enable peer request logging. Requires --debug to display
1702 # Always enable peer request logging. Requires --debug to display
1702 # though.
1703 # though.
1703 overrides = {
1704 overrides = {
1704 ('devel', 'debug.peer-request'): True,
1705 ('devel', 'debug.peer-request'): True,
1705 }
1706 }
1706
1707
1707 with ui.configoverride(overrides):
1708 with ui.configoverride(overrides):
1708 peer = hg.peer(ui, {}, path)
1709 peer = hg.peer(ui, {}, path)
1709
1710
1710 local = peer.local() is not None
1711 local = peer.local() is not None
1711 canpush = peer.canpush()
1712 canpush = peer.canpush()
1712
1713
1713 ui.write(_('url: %s\n') % peer.url())
1714 ui.write(_('url: %s\n') % peer.url())
1714 ui.write(_('local: %s\n') % (_('yes') if local else _('no')))
1715 ui.write(_('local: %s\n') % (_('yes') if local else _('no')))
1715 ui.write(_('pushable: %s\n') % (_('yes') if canpush else _('no')))
1716 ui.write(_('pushable: %s\n') % (_('yes') if canpush else _('no')))
1716
1717
1717 @command('debugpickmergetool',
1718 @command('debugpickmergetool',
1718 [('r', 'rev', '', _('check for files in this revision'), _('REV')),
1719 [('r', 'rev', '', _('check for files in this revision'), _('REV')),
1719 ('', 'changedelete', None, _('emulate merging change and delete')),
1720 ('', 'changedelete', None, _('emulate merging change and delete')),
1720 ] + cmdutil.walkopts + cmdutil.mergetoolopts,
1721 ] + cmdutil.walkopts + cmdutil.mergetoolopts,
1721 _('[PATTERN]...'),
1722 _('[PATTERN]...'),
1722 inferrepo=True)
1723 inferrepo=True)
1723 def debugpickmergetool(ui, repo, *pats, **opts):
1724 def debugpickmergetool(ui, repo, *pats, **opts):
1724 """examine which merge tool is chosen for specified file
1725 """examine which merge tool is chosen for specified file
1725
1726
1726 As described in :hg:`help merge-tools`, Mercurial examines
1727 As described in :hg:`help merge-tools`, Mercurial examines
1727 configurations below in this order to decide which merge tool is
1728 configurations below in this order to decide which merge tool is
1728 chosen for specified file.
1729 chosen for specified file.
1729
1730
1730 1. ``--tool`` option
1731 1. ``--tool`` option
1731 2. ``HGMERGE`` environment variable
1732 2. ``HGMERGE`` environment variable
1732 3. configurations in ``merge-patterns`` section
1733 3. configurations in ``merge-patterns`` section
1733 4. configuration of ``ui.merge``
1734 4. configuration of ``ui.merge``
1734 5. configurations in ``merge-tools`` section
1735 5. configurations in ``merge-tools`` section
1735 6. ``hgmerge`` tool (for historical reason only)
1736 6. ``hgmerge`` tool (for historical reason only)
1736 7. default tool for fallback (``:merge`` or ``:prompt``)
1737 7. default tool for fallback (``:merge`` or ``:prompt``)
1737
1738
1738 This command writes out examination result in the style below::
1739 This command writes out examination result in the style below::
1739
1740
1740 FILE = MERGETOOL
1741 FILE = MERGETOOL
1741
1742
1742 By default, all files known in the first parent context of the
1743 By default, all files known in the first parent context of the
1743 working directory are examined. Use file patterns and/or -I/-X
1744 working directory are examined. Use file patterns and/or -I/-X
1744 options to limit target files. -r/--rev is also useful to examine
1745 options to limit target files. -r/--rev is also useful to examine
1745 files in another context without actual updating to it.
1746 files in another context without actual updating to it.
1746
1747
1747 With --debug, this command shows warning messages while matching
1748 With --debug, this command shows warning messages while matching
1748 against ``merge-patterns`` and so on, too. It is recommended to
1749 against ``merge-patterns`` and so on, too. It is recommended to
1749 use this option with explicit file patterns and/or -I/-X options,
1750 use this option with explicit file patterns and/or -I/-X options,
1750 because this option increases amount of output per file according
1751 because this option increases amount of output per file according
1751 to configurations in hgrc.
1752 to configurations in hgrc.
1752
1753
1753 With -v/--verbose, this command shows configurations below at
1754 With -v/--verbose, this command shows configurations below at
1754 first (only if specified).
1755 first (only if specified).
1755
1756
1756 - ``--tool`` option
1757 - ``--tool`` option
1757 - ``HGMERGE`` environment variable
1758 - ``HGMERGE`` environment variable
1758 - configuration of ``ui.merge``
1759 - configuration of ``ui.merge``
1759
1760
1760 If merge tool is chosen before matching against
1761 If merge tool is chosen before matching against
1761 ``merge-patterns``, this command can't show any helpful
1762 ``merge-patterns``, this command can't show any helpful
1762 information, even with --debug. In such case, information above is
1763 information, even with --debug. In such case, information above is
1763 useful to know why a merge tool is chosen.
1764 useful to know why a merge tool is chosen.
1764 """
1765 """
1765 opts = pycompat.byteskwargs(opts)
1766 opts = pycompat.byteskwargs(opts)
1766 overrides = {}
1767 overrides = {}
1767 if opts['tool']:
1768 if opts['tool']:
1768 overrides[('ui', 'forcemerge')] = opts['tool']
1769 overrides[('ui', 'forcemerge')] = opts['tool']
1769 ui.note(('with --tool %r\n') % (opts['tool']))
1770 ui.note(('with --tool %r\n') % (opts['tool']))
1770
1771
1771 with ui.configoverride(overrides, 'debugmergepatterns'):
1772 with ui.configoverride(overrides, 'debugmergepatterns'):
1772 hgmerge = encoding.environ.get("HGMERGE")
1773 hgmerge = encoding.environ.get("HGMERGE")
1773 if hgmerge is not None:
1774 if hgmerge is not None:
1774 ui.note(('with HGMERGE=%r\n') % (hgmerge))
1775 ui.note(('with HGMERGE=%r\n') % (hgmerge))
1775 uimerge = ui.config("ui", "merge")
1776 uimerge = ui.config("ui", "merge")
1776 if uimerge:
1777 if uimerge:
1777 ui.note(('with ui.merge=%r\n') % (uimerge))
1778 ui.note(('with ui.merge=%r\n') % (uimerge))
1778
1779
1779 ctx = scmutil.revsingle(repo, opts.get('rev'))
1780 ctx = scmutil.revsingle(repo, opts.get('rev'))
1780 m = scmutil.match(ctx, pats, opts)
1781 m = scmutil.match(ctx, pats, opts)
1781 changedelete = opts['changedelete']
1782 changedelete = opts['changedelete']
1782 for path in ctx.walk(m):
1783 for path in ctx.walk(m):
1783 fctx = ctx[path]
1784 fctx = ctx[path]
1784 try:
1785 try:
1785 if not ui.debugflag:
1786 if not ui.debugflag:
1786 ui.pushbuffer(error=True)
1787 ui.pushbuffer(error=True)
1787 tool, toolpath = filemerge._picktool(repo, ui, path,
1788 tool, toolpath = filemerge._picktool(repo, ui, path,
1788 fctx.isbinary(),
1789 fctx.isbinary(),
1789 'l' in fctx.flags(),
1790 'l' in fctx.flags(),
1790 changedelete)
1791 changedelete)
1791 finally:
1792 finally:
1792 if not ui.debugflag:
1793 if not ui.debugflag:
1793 ui.popbuffer()
1794 ui.popbuffer()
1794 ui.write(('%s = %s\n') % (path, tool))
1795 ui.write(('%s = %s\n') % (path, tool))
1795
1796
1796 @command('debugpushkey', [], _('REPO NAMESPACE [KEY OLD NEW]'), norepo=True)
1797 @command('debugpushkey', [], _('REPO NAMESPACE [KEY OLD NEW]'), norepo=True)
1797 def debugpushkey(ui, repopath, namespace, *keyinfo, **opts):
1798 def debugpushkey(ui, repopath, namespace, *keyinfo, **opts):
1798 '''access the pushkey key/value protocol
1799 '''access the pushkey key/value protocol
1799
1800
1800 With two args, list the keys in the given namespace.
1801 With two args, list the keys in the given namespace.
1801
1802
1802 With five args, set a key to new if it currently is set to old.
1803 With five args, set a key to new if it currently is set to old.
1803 Reports success or failure.
1804 Reports success or failure.
1804 '''
1805 '''
1805
1806
1806 target = hg.peer(ui, {}, repopath)
1807 target = hg.peer(ui, {}, repopath)
1807 if keyinfo:
1808 if keyinfo:
1808 key, old, new = keyinfo
1809 key, old, new = keyinfo
1809 r = target.pushkey(namespace, key, old, new)
1810 r = target.pushkey(namespace, key, old, new)
1810 ui.status(str(r) + '\n')
1811 ui.status(str(r) + '\n')
1811 return not r
1812 return not r
1812 else:
1813 else:
1813 for k, v in sorted(target.listkeys(namespace).iteritems()):
1814 for k, v in sorted(target.listkeys(namespace).iteritems()):
1814 ui.write("%s\t%s\n" % (util.escapestr(k),
1815 ui.write("%s\t%s\n" % (util.escapestr(k),
1815 util.escapestr(v)))
1816 util.escapestr(v)))
1816
1817
1817 @command('debugpvec', [], _('A B'))
1818 @command('debugpvec', [], _('A B'))
1818 def debugpvec(ui, repo, a, b=None):
1819 def debugpvec(ui, repo, a, b=None):
1819 ca = scmutil.revsingle(repo, a)
1820 ca = scmutil.revsingle(repo, a)
1820 cb = scmutil.revsingle(repo, b)
1821 cb = scmutil.revsingle(repo, b)
1821 pa = pvec.ctxpvec(ca)
1822 pa = pvec.ctxpvec(ca)
1822 pb = pvec.ctxpvec(cb)
1823 pb = pvec.ctxpvec(cb)
1823 if pa == pb:
1824 if pa == pb:
1824 rel = "="
1825 rel = "="
1825 elif pa > pb:
1826 elif pa > pb:
1826 rel = ">"
1827 rel = ">"
1827 elif pa < pb:
1828 elif pa < pb:
1828 rel = "<"
1829 rel = "<"
1829 elif pa | pb:
1830 elif pa | pb:
1830 rel = "|"
1831 rel = "|"
1831 ui.write(_("a: %s\n") % pa)
1832 ui.write(_("a: %s\n") % pa)
1832 ui.write(_("b: %s\n") % pb)
1833 ui.write(_("b: %s\n") % pb)
1833 ui.write(_("depth(a): %d depth(b): %d\n") % (pa._depth, pb._depth))
1834 ui.write(_("depth(a): %d depth(b): %d\n") % (pa._depth, pb._depth))
1834 ui.write(_("delta: %d hdist: %d distance: %d relation: %s\n") %
1835 ui.write(_("delta: %d hdist: %d distance: %d relation: %s\n") %
1835 (abs(pa._depth - pb._depth), pvec._hamming(pa._vec, pb._vec),
1836 (abs(pa._depth - pb._depth), pvec._hamming(pa._vec, pb._vec),
1836 pa.distance(pb), rel))
1837 pa.distance(pb), rel))
1837
1838
1838 @command('debugrebuilddirstate|debugrebuildstate',
1839 @command('debugrebuilddirstate|debugrebuildstate',
1839 [('r', 'rev', '', _('revision to rebuild to'), _('REV')),
1840 [('r', 'rev', '', _('revision to rebuild to'), _('REV')),
1840 ('', 'minimal', None, _('only rebuild files that are inconsistent with '
1841 ('', 'minimal', None, _('only rebuild files that are inconsistent with '
1841 'the working copy parent')),
1842 'the working copy parent')),
1842 ],
1843 ],
1843 _('[-r REV]'))
1844 _('[-r REV]'))
1844 def debugrebuilddirstate(ui, repo, rev, **opts):
1845 def debugrebuilddirstate(ui, repo, rev, **opts):
1845 """rebuild the dirstate as it would look like for the given revision
1846 """rebuild the dirstate as it would look like for the given revision
1846
1847
1847 If no revision is specified the first current parent will be used.
1848 If no revision is specified the first current parent will be used.
1848
1849
1849 The dirstate will be set to the files of the given revision.
1850 The dirstate will be set to the files of the given revision.
1850 The actual working directory content or existing dirstate
1851 The actual working directory content or existing dirstate
1851 information such as adds or removes is not considered.
1852 information such as adds or removes is not considered.
1852
1853
1853 ``minimal`` will only rebuild the dirstate status for files that claim to be
1854 ``minimal`` will only rebuild the dirstate status for files that claim to be
1854 tracked but are not in the parent manifest, or that exist in the parent
1855 tracked but are not in the parent manifest, or that exist in the parent
1855 manifest but are not in the dirstate. It will not change adds, removes, or
1856 manifest but are not in the dirstate. It will not change adds, removes, or
1856 modified files that are in the working copy parent.
1857 modified files that are in the working copy parent.
1857
1858
1858 One use of this command is to make the next :hg:`status` invocation
1859 One use of this command is to make the next :hg:`status` invocation
1859 check the actual file content.
1860 check the actual file content.
1860 """
1861 """
1861 ctx = scmutil.revsingle(repo, rev)
1862 ctx = scmutil.revsingle(repo, rev)
1862 with repo.wlock():
1863 with repo.wlock():
1863 dirstate = repo.dirstate
1864 dirstate = repo.dirstate
1864 changedfiles = None
1865 changedfiles = None
1865 # See command doc for what minimal does.
1866 # See command doc for what minimal does.
1866 if opts.get(r'minimal'):
1867 if opts.get(r'minimal'):
1867 manifestfiles = set(ctx.manifest().keys())
1868 manifestfiles = set(ctx.manifest().keys())
1868 dirstatefiles = set(dirstate)
1869 dirstatefiles = set(dirstate)
1869 manifestonly = manifestfiles - dirstatefiles
1870 manifestonly = manifestfiles - dirstatefiles
1870 dsonly = dirstatefiles - manifestfiles
1871 dsonly = dirstatefiles - manifestfiles
1871 dsnotadded = set(f for f in dsonly if dirstate[f] != 'a')
1872 dsnotadded = set(f for f in dsonly if dirstate[f] != 'a')
1872 changedfiles = manifestonly | dsnotadded
1873 changedfiles = manifestonly | dsnotadded
1873
1874
1874 dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles)
1875 dirstate.rebuild(ctx.node(), ctx.manifest(), changedfiles)
1875
1876
1876 @command('debugrebuildfncache', [], '')
1877 @command('debugrebuildfncache', [], '')
1877 def debugrebuildfncache(ui, repo):
1878 def debugrebuildfncache(ui, repo):
1878 """rebuild the fncache file"""
1879 """rebuild the fncache file"""
1879 repair.rebuildfncache(ui, repo)
1880 repair.rebuildfncache(ui, repo)
1880
1881
1881 @command('debugrename',
1882 @command('debugrename',
1882 [('r', 'rev', '', _('revision to debug'), _('REV'))],
1883 [('r', 'rev', '', _('revision to debug'), _('REV'))],
1883 _('[-r REV] FILE'))
1884 _('[-r REV] FILE'))
1884 def debugrename(ui, repo, file1, *pats, **opts):
1885 def debugrename(ui, repo, file1, *pats, **opts):
1885 """dump rename information"""
1886 """dump rename information"""
1886
1887
1887 opts = pycompat.byteskwargs(opts)
1888 opts = pycompat.byteskwargs(opts)
1888 ctx = scmutil.revsingle(repo, opts.get('rev'))
1889 ctx = scmutil.revsingle(repo, opts.get('rev'))
1889 m = scmutil.match(ctx, (file1,) + pats, opts)
1890 m = scmutil.match(ctx, (file1,) + pats, opts)
1890 for abs in ctx.walk(m):
1891 for abs in ctx.walk(m):
1891 fctx = ctx[abs]
1892 fctx = ctx[abs]
1892 o = fctx.filelog().renamed(fctx.filenode())
1893 o = fctx.filelog().renamed(fctx.filenode())
1893 rel = m.rel(abs)
1894 rel = m.rel(abs)
1894 if o:
1895 if o:
1895 ui.write(_("%s renamed from %s:%s\n") % (rel, o[0], hex(o[1])))
1896 ui.write(_("%s renamed from %s:%s\n") % (rel, o[0], hex(o[1])))
1896 else:
1897 else:
1897 ui.write(_("%s not renamed\n") % rel)
1898 ui.write(_("%s not renamed\n") % rel)
1898
1899
1899 @command('debugrevlog', cmdutil.debugrevlogopts +
1900 @command('debugrevlog', cmdutil.debugrevlogopts +
1900 [('d', 'dump', False, _('dump index data'))],
1901 [('d', 'dump', False, _('dump index data'))],
1901 _('-c|-m|FILE'),
1902 _('-c|-m|FILE'),
1902 optionalrepo=True)
1903 optionalrepo=True)
1903 def debugrevlog(ui, repo, file_=None, **opts):
1904 def debugrevlog(ui, repo, file_=None, **opts):
1904 """show data and statistics about a revlog"""
1905 """show data and statistics about a revlog"""
1905 opts = pycompat.byteskwargs(opts)
1906 opts = pycompat.byteskwargs(opts)
1906 r = cmdutil.openrevlog(repo, 'debugrevlog', file_, opts)
1907 r = cmdutil.openrevlog(repo, 'debugrevlog', file_, opts)
1907
1908
1908 if opts.get("dump"):
1909 if opts.get("dump"):
1909 numrevs = len(r)
1910 numrevs = len(r)
1910 ui.write(("# rev p1rev p2rev start end deltastart base p1 p2"
1911 ui.write(("# rev p1rev p2rev start end deltastart base p1 p2"
1911 " rawsize totalsize compression heads chainlen\n"))
1912 " rawsize totalsize compression heads chainlen\n"))
1912 ts = 0
1913 ts = 0
1913 heads = set()
1914 heads = set()
1914
1915
1915 for rev in xrange(numrevs):
1916 for rev in xrange(numrevs):
1916 dbase = r.deltaparent(rev)
1917 dbase = r.deltaparent(rev)
1917 if dbase == -1:
1918 if dbase == -1:
1918 dbase = rev
1919 dbase = rev
1919 cbase = r.chainbase(rev)
1920 cbase = r.chainbase(rev)
1920 clen = r.chainlen(rev)
1921 clen = r.chainlen(rev)
1921 p1, p2 = r.parentrevs(rev)
1922 p1, p2 = r.parentrevs(rev)
1922 rs = r.rawsize(rev)
1923 rs = r.rawsize(rev)
1923 ts = ts + rs
1924 ts = ts + rs
1924 heads -= set(r.parentrevs(rev))
1925 heads -= set(r.parentrevs(rev))
1925 heads.add(rev)
1926 heads.add(rev)
1926 try:
1927 try:
1927 compression = ts / r.end(rev)
1928 compression = ts / r.end(rev)
1928 except ZeroDivisionError:
1929 except ZeroDivisionError:
1929 compression = 0
1930 compression = 0
1930 ui.write("%5d %5d %5d %5d %5d %10d %4d %4d %4d %7d %9d "
1931 ui.write("%5d %5d %5d %5d %5d %10d %4d %4d %4d %7d %9d "
1931 "%11d %5d %8d\n" %
1932 "%11d %5d %8d\n" %
1932 (rev, p1, p2, r.start(rev), r.end(rev),
1933 (rev, p1, p2, r.start(rev), r.end(rev),
1933 r.start(dbase), r.start(cbase),
1934 r.start(dbase), r.start(cbase),
1934 r.start(p1), r.start(p2),
1935 r.start(p1), r.start(p2),
1935 rs, ts, compression, len(heads), clen))
1936 rs, ts, compression, len(heads), clen))
1936 return 0
1937 return 0
1937
1938
1938 v = r.version
1939 v = r.version
1939 format = v & 0xFFFF
1940 format = v & 0xFFFF
1940 flags = []
1941 flags = []
1941 gdelta = False
1942 gdelta = False
1942 if v & revlog.FLAG_INLINE_DATA:
1943 if v & revlog.FLAG_INLINE_DATA:
1943 flags.append('inline')
1944 flags.append('inline')
1944 if v & revlog.FLAG_GENERALDELTA:
1945 if v & revlog.FLAG_GENERALDELTA:
1945 gdelta = True
1946 gdelta = True
1946 flags.append('generaldelta')
1947 flags.append('generaldelta')
1947 if not flags:
1948 if not flags:
1948 flags = ['(none)']
1949 flags = ['(none)']
1949
1950
1950 nummerges = 0
1951 nummerges = 0
1951 numfull = 0
1952 numfull = 0
1952 numprev = 0
1953 numprev = 0
1953 nump1 = 0
1954 nump1 = 0
1954 nump2 = 0
1955 nump2 = 0
1955 numother = 0
1956 numother = 0
1956 nump1prev = 0
1957 nump1prev = 0
1957 nump2prev = 0
1958 nump2prev = 0
1958 chainlengths = []
1959 chainlengths = []
1959 chainbases = []
1960 chainbases = []
1960 chainspans = []
1961 chainspans = []
1961
1962
1962 datasize = [None, 0, 0]
1963 datasize = [None, 0, 0]
1963 fullsize = [None, 0, 0]
1964 fullsize = [None, 0, 0]
1964 deltasize = [None, 0, 0]
1965 deltasize = [None, 0, 0]
1965 chunktypecounts = {}
1966 chunktypecounts = {}
1966 chunktypesizes = {}
1967 chunktypesizes = {}
1967
1968
1968 def addsize(size, l):
1969 def addsize(size, l):
1969 if l[0] is None or size < l[0]:
1970 if l[0] is None or size < l[0]:
1970 l[0] = size
1971 l[0] = size
1971 if size > l[1]:
1972 if size > l[1]:
1972 l[1] = size
1973 l[1] = size
1973 l[2] += size
1974 l[2] += size
1974
1975
1975 numrevs = len(r)
1976 numrevs = len(r)
1976 for rev in xrange(numrevs):
1977 for rev in xrange(numrevs):
1977 p1, p2 = r.parentrevs(rev)
1978 p1, p2 = r.parentrevs(rev)
1978 delta = r.deltaparent(rev)
1979 delta = r.deltaparent(rev)
1979 if format > 0:
1980 if format > 0:
1980 addsize(r.rawsize(rev), datasize)
1981 addsize(r.rawsize(rev), datasize)
1981 if p2 != nullrev:
1982 if p2 != nullrev:
1982 nummerges += 1
1983 nummerges += 1
1983 size = r.length(rev)
1984 size = r.length(rev)
1984 if delta == nullrev:
1985 if delta == nullrev:
1985 chainlengths.append(0)
1986 chainlengths.append(0)
1986 chainbases.append(r.start(rev))
1987 chainbases.append(r.start(rev))
1987 chainspans.append(size)
1988 chainspans.append(size)
1988 numfull += 1
1989 numfull += 1
1989 addsize(size, fullsize)
1990 addsize(size, fullsize)
1990 else:
1991 else:
1991 chainlengths.append(chainlengths[delta] + 1)
1992 chainlengths.append(chainlengths[delta] + 1)
1992 baseaddr = chainbases[delta]
1993 baseaddr = chainbases[delta]
1993 revaddr = r.start(rev)
1994 revaddr = r.start(rev)
1994 chainbases.append(baseaddr)
1995 chainbases.append(baseaddr)
1995 chainspans.append((revaddr - baseaddr) + size)
1996 chainspans.append((revaddr - baseaddr) + size)
1996 addsize(size, deltasize)
1997 addsize(size, deltasize)
1997 if delta == rev - 1:
1998 if delta == rev - 1:
1998 numprev += 1
1999 numprev += 1
1999 if delta == p1:
2000 if delta == p1:
2000 nump1prev += 1
2001 nump1prev += 1
2001 elif delta == p2:
2002 elif delta == p2:
2002 nump2prev += 1
2003 nump2prev += 1
2003 elif delta == p1:
2004 elif delta == p1:
2004 nump1 += 1
2005 nump1 += 1
2005 elif delta == p2:
2006 elif delta == p2:
2006 nump2 += 1
2007 nump2 += 1
2007 elif delta != nullrev:
2008 elif delta != nullrev:
2008 numother += 1
2009 numother += 1
2009
2010
2010 # Obtain data on the raw chunks in the revlog.
2011 # Obtain data on the raw chunks in the revlog.
2011 segment = r._getsegmentforrevs(rev, rev)[1]
2012 segment = r._getsegmentforrevs(rev, rev)[1]
2012 if segment:
2013 if segment:
2013 chunktype = bytes(segment[0:1])
2014 chunktype = bytes(segment[0:1])
2014 else:
2015 else:
2015 chunktype = 'empty'
2016 chunktype = 'empty'
2016
2017
2017 if chunktype not in chunktypecounts:
2018 if chunktype not in chunktypecounts:
2018 chunktypecounts[chunktype] = 0
2019 chunktypecounts[chunktype] = 0
2019 chunktypesizes[chunktype] = 0
2020 chunktypesizes[chunktype] = 0
2020
2021
2021 chunktypecounts[chunktype] += 1
2022 chunktypecounts[chunktype] += 1
2022 chunktypesizes[chunktype] += size
2023 chunktypesizes[chunktype] += size
2023
2024
2024 # Adjust size min value for empty cases
2025 # Adjust size min value for empty cases
2025 for size in (datasize, fullsize, deltasize):
2026 for size in (datasize, fullsize, deltasize):
2026 if size[0] is None:
2027 if size[0] is None:
2027 size[0] = 0
2028 size[0] = 0
2028
2029
2029 numdeltas = numrevs - numfull
2030 numdeltas = numrevs - numfull
2030 numoprev = numprev - nump1prev - nump2prev
2031 numoprev = numprev - nump1prev - nump2prev
2031 totalrawsize = datasize[2]
2032 totalrawsize = datasize[2]
2032 datasize[2] /= numrevs
2033 datasize[2] /= numrevs
2033 fulltotal = fullsize[2]
2034 fulltotal = fullsize[2]
2034 fullsize[2] /= numfull
2035 fullsize[2] /= numfull
2035 deltatotal = deltasize[2]
2036 deltatotal = deltasize[2]
2036 if numrevs - numfull > 0:
2037 if numrevs - numfull > 0:
2037 deltasize[2] /= numrevs - numfull
2038 deltasize[2] /= numrevs - numfull
2038 totalsize = fulltotal + deltatotal
2039 totalsize = fulltotal + deltatotal
2039 avgchainlen = sum(chainlengths) / numrevs
2040 avgchainlen = sum(chainlengths) / numrevs
2040 maxchainlen = max(chainlengths)
2041 maxchainlen = max(chainlengths)
2041 maxchainspan = max(chainspans)
2042 maxchainspan = max(chainspans)
2042 compratio = 1
2043 compratio = 1
2043 if totalsize:
2044 if totalsize:
2044 compratio = totalrawsize / totalsize
2045 compratio = totalrawsize / totalsize
2045
2046
2046 basedfmtstr = '%%%dd\n'
2047 basedfmtstr = '%%%dd\n'
2047 basepcfmtstr = '%%%dd %s(%%5.2f%%%%)\n'
2048 basepcfmtstr = '%%%dd %s(%%5.2f%%%%)\n'
2048
2049
2049 def dfmtstr(max):
2050 def dfmtstr(max):
2050 return basedfmtstr % len(str(max))
2051 return basedfmtstr % len(str(max))
2051 def pcfmtstr(max, padding=0):
2052 def pcfmtstr(max, padding=0):
2052 return basepcfmtstr % (len(str(max)), ' ' * padding)
2053 return basepcfmtstr % (len(str(max)), ' ' * padding)
2053
2054
2054 def pcfmt(value, total):
2055 def pcfmt(value, total):
2055 if total:
2056 if total:
2056 return (value, 100 * float(value) / total)
2057 return (value, 100 * float(value) / total)
2057 else:
2058 else:
2058 return value, 100.0
2059 return value, 100.0
2059
2060
2060 ui.write(('format : %d\n') % format)
2061 ui.write(('format : %d\n') % format)
2061 ui.write(('flags : %s\n') % ', '.join(flags))
2062 ui.write(('flags : %s\n') % ', '.join(flags))
2062
2063
2063 ui.write('\n')
2064 ui.write('\n')
2064 fmt = pcfmtstr(totalsize)
2065 fmt = pcfmtstr(totalsize)
2065 fmt2 = dfmtstr(totalsize)
2066 fmt2 = dfmtstr(totalsize)
2066 ui.write(('revisions : ') + fmt2 % numrevs)
2067 ui.write(('revisions : ') + fmt2 % numrevs)
2067 ui.write((' merges : ') + fmt % pcfmt(nummerges, numrevs))
2068 ui.write((' merges : ') + fmt % pcfmt(nummerges, numrevs))
2068 ui.write((' normal : ') + fmt % pcfmt(numrevs - nummerges, numrevs))
2069 ui.write((' normal : ') + fmt % pcfmt(numrevs - nummerges, numrevs))
2069 ui.write(('revisions : ') + fmt2 % numrevs)
2070 ui.write(('revisions : ') + fmt2 % numrevs)
2070 ui.write((' full : ') + fmt % pcfmt(numfull, numrevs))
2071 ui.write((' full : ') + fmt % pcfmt(numfull, numrevs))
2071 ui.write((' deltas : ') + fmt % pcfmt(numdeltas, numrevs))
2072 ui.write((' deltas : ') + fmt % pcfmt(numdeltas, numrevs))
2072 ui.write(('revision size : ') + fmt2 % totalsize)
2073 ui.write(('revision size : ') + fmt2 % totalsize)
2073 ui.write((' full : ') + fmt % pcfmt(fulltotal, totalsize))
2074 ui.write((' full : ') + fmt % pcfmt(fulltotal, totalsize))
2074 ui.write((' deltas : ') + fmt % pcfmt(deltatotal, totalsize))
2075 ui.write((' deltas : ') + fmt % pcfmt(deltatotal, totalsize))
2075
2076
2076 def fmtchunktype(chunktype):
2077 def fmtchunktype(chunktype):
2077 if chunktype == 'empty':
2078 if chunktype == 'empty':
2078 return ' %s : ' % chunktype
2079 return ' %s : ' % chunktype
2079 elif chunktype in pycompat.bytestr(string.ascii_letters):
2080 elif chunktype in pycompat.bytestr(string.ascii_letters):
2080 return ' 0x%s (%s) : ' % (hex(chunktype), chunktype)
2081 return ' 0x%s (%s) : ' % (hex(chunktype), chunktype)
2081 else:
2082 else:
2082 return ' 0x%s : ' % hex(chunktype)
2083 return ' 0x%s : ' % hex(chunktype)
2083
2084
2084 ui.write('\n')
2085 ui.write('\n')
2085 ui.write(('chunks : ') + fmt2 % numrevs)
2086 ui.write(('chunks : ') + fmt2 % numrevs)
2086 for chunktype in sorted(chunktypecounts):
2087 for chunktype in sorted(chunktypecounts):
2087 ui.write(fmtchunktype(chunktype))
2088 ui.write(fmtchunktype(chunktype))
2088 ui.write(fmt % pcfmt(chunktypecounts[chunktype], numrevs))
2089 ui.write(fmt % pcfmt(chunktypecounts[chunktype], numrevs))
2089 ui.write(('chunks size : ') + fmt2 % totalsize)
2090 ui.write(('chunks size : ') + fmt2 % totalsize)
2090 for chunktype in sorted(chunktypecounts):
2091 for chunktype in sorted(chunktypecounts):
2091 ui.write(fmtchunktype(chunktype))
2092 ui.write(fmtchunktype(chunktype))
2092 ui.write(fmt % pcfmt(chunktypesizes[chunktype], totalsize))
2093 ui.write(fmt % pcfmt(chunktypesizes[chunktype], totalsize))
2093
2094
2094 ui.write('\n')
2095 ui.write('\n')
2095 fmt = dfmtstr(max(avgchainlen, maxchainlen, maxchainspan, compratio))
2096 fmt = dfmtstr(max(avgchainlen, maxchainlen, maxchainspan, compratio))
2096 ui.write(('avg chain length : ') + fmt % avgchainlen)
2097 ui.write(('avg chain length : ') + fmt % avgchainlen)
2097 ui.write(('max chain length : ') + fmt % maxchainlen)
2098 ui.write(('max chain length : ') + fmt % maxchainlen)
2098 ui.write(('max chain reach : ') + fmt % maxchainspan)
2099 ui.write(('max chain reach : ') + fmt % maxchainspan)
2099 ui.write(('compression ratio : ') + fmt % compratio)
2100 ui.write(('compression ratio : ') + fmt % compratio)
2100
2101
2101 if format > 0:
2102 if format > 0:
2102 ui.write('\n')
2103 ui.write('\n')
2103 ui.write(('uncompressed data size (min/max/avg) : %d / %d / %d\n')
2104 ui.write(('uncompressed data size (min/max/avg) : %d / %d / %d\n')
2104 % tuple(datasize))
2105 % tuple(datasize))
2105 ui.write(('full revision size (min/max/avg) : %d / %d / %d\n')
2106 ui.write(('full revision size (min/max/avg) : %d / %d / %d\n')
2106 % tuple(fullsize))
2107 % tuple(fullsize))
2107 ui.write(('delta size (min/max/avg) : %d / %d / %d\n')
2108 ui.write(('delta size (min/max/avg) : %d / %d / %d\n')
2108 % tuple(deltasize))
2109 % tuple(deltasize))
2109
2110
2110 if numdeltas > 0:
2111 if numdeltas > 0:
2111 ui.write('\n')
2112 ui.write('\n')
2112 fmt = pcfmtstr(numdeltas)
2113 fmt = pcfmtstr(numdeltas)
2113 fmt2 = pcfmtstr(numdeltas, 4)
2114 fmt2 = pcfmtstr(numdeltas, 4)
2114 ui.write(('deltas against prev : ') + fmt % pcfmt(numprev, numdeltas))
2115 ui.write(('deltas against prev : ') + fmt % pcfmt(numprev, numdeltas))
2115 if numprev > 0:
2116 if numprev > 0:
2116 ui.write((' where prev = p1 : ') + fmt2 % pcfmt(nump1prev,
2117 ui.write((' where prev = p1 : ') + fmt2 % pcfmt(nump1prev,
2117 numprev))
2118 numprev))
2118 ui.write((' where prev = p2 : ') + fmt2 % pcfmt(nump2prev,
2119 ui.write((' where prev = p2 : ') + fmt2 % pcfmt(nump2prev,
2119 numprev))
2120 numprev))
2120 ui.write((' other : ') + fmt2 % pcfmt(numoprev,
2121 ui.write((' other : ') + fmt2 % pcfmt(numoprev,
2121 numprev))
2122 numprev))
2122 if gdelta:
2123 if gdelta:
2123 ui.write(('deltas against p1 : ')
2124 ui.write(('deltas against p1 : ')
2124 + fmt % pcfmt(nump1, numdeltas))
2125 + fmt % pcfmt(nump1, numdeltas))
2125 ui.write(('deltas against p2 : ')
2126 ui.write(('deltas against p2 : ')
2126 + fmt % pcfmt(nump2, numdeltas))
2127 + fmt % pcfmt(nump2, numdeltas))
2127 ui.write(('deltas against other : ') + fmt % pcfmt(numother,
2128 ui.write(('deltas against other : ') + fmt % pcfmt(numother,
2128 numdeltas))
2129 numdeltas))
2129
2130
2130 @command('debugrevspec',
2131 @command('debugrevspec',
2131 [('', 'optimize', None,
2132 [('', 'optimize', None,
2132 _('print parsed tree after optimizing (DEPRECATED)')),
2133 _('print parsed tree after optimizing (DEPRECATED)')),
2133 ('', 'show-revs', True, _('print list of result revisions (default)')),
2134 ('', 'show-revs', True, _('print list of result revisions (default)')),
2134 ('s', 'show-set', None, _('print internal representation of result set')),
2135 ('s', 'show-set', None, _('print internal representation of result set')),
2135 ('p', 'show-stage', [],
2136 ('p', 'show-stage', [],
2136 _('print parsed tree at the given stage'), _('NAME')),
2137 _('print parsed tree at the given stage'), _('NAME')),
2137 ('', 'no-optimized', False, _('evaluate tree without optimization')),
2138 ('', 'no-optimized', False, _('evaluate tree without optimization')),
2138 ('', 'verify-optimized', False, _('verify optimized result')),
2139 ('', 'verify-optimized', False, _('verify optimized result')),
2139 ],
2140 ],
2140 ('REVSPEC'))
2141 ('REVSPEC'))
2141 def debugrevspec(ui, repo, expr, **opts):
2142 def debugrevspec(ui, repo, expr, **opts):
2142 """parse and apply a revision specification
2143 """parse and apply a revision specification
2143
2144
2144 Use -p/--show-stage option to print the parsed tree at the given stages.
2145 Use -p/--show-stage option to print the parsed tree at the given stages.
2145 Use -p all to print tree at every stage.
2146 Use -p all to print tree at every stage.
2146
2147
2147 Use --no-show-revs option with -s or -p to print only the set
2148 Use --no-show-revs option with -s or -p to print only the set
2148 representation or the parsed tree respectively.
2149 representation or the parsed tree respectively.
2149
2150
2150 Use --verify-optimized to compare the optimized result with the unoptimized
2151 Use --verify-optimized to compare the optimized result with the unoptimized
2151 one. Returns 1 if the optimized result differs.
2152 one. Returns 1 if the optimized result differs.
2152 """
2153 """
2153 opts = pycompat.byteskwargs(opts)
2154 opts = pycompat.byteskwargs(opts)
2154 aliases = ui.configitems('revsetalias')
2155 aliases = ui.configitems('revsetalias')
2155 stages = [
2156 stages = [
2156 ('parsed', lambda tree: tree),
2157 ('parsed', lambda tree: tree),
2157 ('expanded', lambda tree: revsetlang.expandaliases(tree, aliases,
2158 ('expanded', lambda tree: revsetlang.expandaliases(tree, aliases,
2158 ui.warn)),
2159 ui.warn)),
2159 ('concatenated', revsetlang.foldconcat),
2160 ('concatenated', revsetlang.foldconcat),
2160 ('analyzed', revsetlang.analyze),
2161 ('analyzed', revsetlang.analyze),
2161 ('optimized', revsetlang.optimize),
2162 ('optimized', revsetlang.optimize),
2162 ]
2163 ]
2163 if opts['no_optimized']:
2164 if opts['no_optimized']:
2164 stages = stages[:-1]
2165 stages = stages[:-1]
2165 if opts['verify_optimized'] and opts['no_optimized']:
2166 if opts['verify_optimized'] and opts['no_optimized']:
2166 raise error.Abort(_('cannot use --verify-optimized with '
2167 raise error.Abort(_('cannot use --verify-optimized with '
2167 '--no-optimized'))
2168 '--no-optimized'))
2168 stagenames = set(n for n, f in stages)
2169 stagenames = set(n for n, f in stages)
2169
2170
2170 showalways = set()
2171 showalways = set()
2171 showchanged = set()
2172 showchanged = set()
2172 if ui.verbose and not opts['show_stage']:
2173 if ui.verbose and not opts['show_stage']:
2173 # show parsed tree by --verbose (deprecated)
2174 # show parsed tree by --verbose (deprecated)
2174 showalways.add('parsed')
2175 showalways.add('parsed')
2175 showchanged.update(['expanded', 'concatenated'])
2176 showchanged.update(['expanded', 'concatenated'])
2176 if opts['optimize']:
2177 if opts['optimize']:
2177 showalways.add('optimized')
2178 showalways.add('optimized')
2178 if opts['show_stage'] and opts['optimize']:
2179 if opts['show_stage'] and opts['optimize']:
2179 raise error.Abort(_('cannot use --optimize with --show-stage'))
2180 raise error.Abort(_('cannot use --optimize with --show-stage'))
2180 if opts['show_stage'] == ['all']:
2181 if opts['show_stage'] == ['all']:
2181 showalways.update(stagenames)
2182 showalways.update(stagenames)
2182 else:
2183 else:
2183 for n in opts['show_stage']:
2184 for n in opts['show_stage']:
2184 if n not in stagenames:
2185 if n not in stagenames:
2185 raise error.Abort(_('invalid stage name: %s') % n)
2186 raise error.Abort(_('invalid stage name: %s') % n)
2186 showalways.update(opts['show_stage'])
2187 showalways.update(opts['show_stage'])
2187
2188
2188 treebystage = {}
2189 treebystage = {}
2189 printedtree = None
2190 printedtree = None
2190 tree = revsetlang.parse(expr, lookup=repo.__contains__)
2191 tree = revsetlang.parse(expr, lookup=repo.__contains__)
2191 for n, f in stages:
2192 for n, f in stages:
2192 treebystage[n] = tree = f(tree)
2193 treebystage[n] = tree = f(tree)
2193 if n in showalways or (n in showchanged and tree != printedtree):
2194 if n in showalways or (n in showchanged and tree != printedtree):
2194 if opts['show_stage'] or n != 'parsed':
2195 if opts['show_stage'] or n != 'parsed':
2195 ui.write(("* %s:\n") % n)
2196 ui.write(("* %s:\n") % n)
2196 ui.write(revsetlang.prettyformat(tree), "\n")
2197 ui.write(revsetlang.prettyformat(tree), "\n")
2197 printedtree = tree
2198 printedtree = tree
2198
2199
2199 if opts['verify_optimized']:
2200 if opts['verify_optimized']:
2200 arevs = revset.makematcher(treebystage['analyzed'])(repo)
2201 arevs = revset.makematcher(treebystage['analyzed'])(repo)
2201 brevs = revset.makematcher(treebystage['optimized'])(repo)
2202 brevs = revset.makematcher(treebystage['optimized'])(repo)
2202 if opts['show_set'] or (opts['show_set'] is None and ui.verbose):
2203 if opts['show_set'] or (opts['show_set'] is None and ui.verbose):
2203 ui.write(("* analyzed set:\n"), smartset.prettyformat(arevs), "\n")
2204 ui.write(("* analyzed set:\n"), smartset.prettyformat(arevs), "\n")
2204 ui.write(("* optimized set:\n"), smartset.prettyformat(brevs), "\n")
2205 ui.write(("* optimized set:\n"), smartset.prettyformat(brevs), "\n")
2205 arevs = list(arevs)
2206 arevs = list(arevs)
2206 brevs = list(brevs)
2207 brevs = list(brevs)
2207 if arevs == brevs:
2208 if arevs == brevs:
2208 return 0
2209 return 0
2209 ui.write(('--- analyzed\n'), label='diff.file_a')
2210 ui.write(('--- analyzed\n'), label='diff.file_a')
2210 ui.write(('+++ optimized\n'), label='diff.file_b')
2211 ui.write(('+++ optimized\n'), label='diff.file_b')
2211 sm = difflib.SequenceMatcher(None, arevs, brevs)
2212 sm = difflib.SequenceMatcher(None, arevs, brevs)
2212 for tag, alo, ahi, blo, bhi in sm.get_opcodes():
2213 for tag, alo, ahi, blo, bhi in sm.get_opcodes():
2213 if tag in ('delete', 'replace'):
2214 if tag in ('delete', 'replace'):
2214 for c in arevs[alo:ahi]:
2215 for c in arevs[alo:ahi]:
2215 ui.write('-%s\n' % c, label='diff.deleted')
2216 ui.write('-%s\n' % c, label='diff.deleted')
2216 if tag in ('insert', 'replace'):
2217 if tag in ('insert', 'replace'):
2217 for c in brevs[blo:bhi]:
2218 for c in brevs[blo:bhi]:
2218 ui.write('+%s\n' % c, label='diff.inserted')
2219 ui.write('+%s\n' % c, label='diff.inserted')
2219 if tag == 'equal':
2220 if tag == 'equal':
2220 for c in arevs[alo:ahi]:
2221 for c in arevs[alo:ahi]:
2221 ui.write(' %s\n' % c)
2222 ui.write(' %s\n' % c)
2222 return 1
2223 return 1
2223
2224
2224 func = revset.makematcher(tree)
2225 func = revset.makematcher(tree)
2225 revs = func(repo)
2226 revs = func(repo)
2226 if opts['show_set'] or (opts['show_set'] is None and ui.verbose):
2227 if opts['show_set'] or (opts['show_set'] is None and ui.verbose):
2227 ui.write(("* set:\n"), smartset.prettyformat(revs), "\n")
2228 ui.write(("* set:\n"), smartset.prettyformat(revs), "\n")
2228 if not opts['show_revs']:
2229 if not opts['show_revs']:
2229 return
2230 return
2230 for c in revs:
2231 for c in revs:
2231 ui.write("%d\n" % c)
2232 ui.write("%d\n" % c)
2232
2233
2234 @command('debugserve', [
2235 ('', 'sshstdio', False, _('run an SSH server bound to process handles')),
2236 ('', 'logiofd', '', _('file descriptor to log server I/O to')),
2237 ('', 'logiofile', '', _('file to log server I/O to')),
2238 ], '')
2239 def debugserve(ui, repo, **opts):
2240 """run a server with advanced settings
2241
2242 This command is similar to :hg:`serve`. It exists partially as a
2243 workaround to the fact that ``hg serve --stdio`` must have specific
2244 arguments for security reasons.
2245 """
2246 opts = pycompat.byteskwargs(opts)
2247
2248 if not opts['sshstdio']:
2249 raise error.Abort(_('only --sshstdio is currently supported'))
2250
2251 logfh = None
2252
2253 if opts['logiofd'] and opts['logiofile']:
2254 raise error.Abort(_('cannot use both --logiofd and --logiofile'))
2255
2256 if opts['logiofd']:
2257 # Line buffered because output is line based.
2258 logfh = os.fdopen(int(opts['logiofd']), 'ab', 1)
2259 elif opts['logiofile']:
2260 logfh = open(opts['logiofile'], 'ab', 1)
2261
2262 s = wireprotoserver.sshserver(ui, repo, logfh=logfh)
2263 s.serve_forever()
2264
2233 @command('debugsetparents', [], _('REV1 [REV2]'))
2265 @command('debugsetparents', [], _('REV1 [REV2]'))
2234 def debugsetparents(ui, repo, rev1, rev2=None):
2266 def debugsetparents(ui, repo, rev1, rev2=None):
2235 """manually set the parents of the current working directory
2267 """manually set the parents of the current working directory
2236
2268
2237 This is useful for writing repository conversion tools, but should
2269 This is useful for writing repository conversion tools, but should
2238 be used with care. For example, neither the working directory nor the
2270 be used with care. For example, neither the working directory nor the
2239 dirstate is updated, so file status may be incorrect after running this
2271 dirstate is updated, so file status may be incorrect after running this
2240 command.
2272 command.
2241
2273
2242 Returns 0 on success.
2274 Returns 0 on success.
2243 """
2275 """
2244
2276
2245 r1 = scmutil.revsingle(repo, rev1).node()
2277 r1 = scmutil.revsingle(repo, rev1).node()
2246 r2 = scmutil.revsingle(repo, rev2, 'null').node()
2278 r2 = scmutil.revsingle(repo, rev2, 'null').node()
2247
2279
2248 with repo.wlock():
2280 with repo.wlock():
2249 repo.setparents(r1, r2)
2281 repo.setparents(r1, r2)
2250
2282
2251 @command('debugssl', [], '[SOURCE]', optionalrepo=True)
2283 @command('debugssl', [], '[SOURCE]', optionalrepo=True)
2252 def debugssl(ui, repo, source=None, **opts):
2284 def debugssl(ui, repo, source=None, **opts):
2253 '''test a secure connection to a server
2285 '''test a secure connection to a server
2254
2286
2255 This builds the certificate chain for the server on Windows, installing the
2287 This builds the certificate chain for the server on Windows, installing the
2256 missing intermediates and trusted root via Windows Update if necessary. It
2288 missing intermediates and trusted root via Windows Update if necessary. It
2257 does nothing on other platforms.
2289 does nothing on other platforms.
2258
2290
2259 If SOURCE is omitted, the 'default' path will be used. If a URL is given,
2291 If SOURCE is omitted, the 'default' path will be used. If a URL is given,
2260 that server is used. See :hg:`help urls` for more information.
2292 that server is used. See :hg:`help urls` for more information.
2261
2293
2262 If the update succeeds, retry the original operation. Otherwise, the cause
2294 If the update succeeds, retry the original operation. Otherwise, the cause
2263 of the SSL error is likely another issue.
2295 of the SSL error is likely another issue.
2264 '''
2296 '''
2265 if not pycompat.iswindows:
2297 if not pycompat.iswindows:
2266 raise error.Abort(_('certificate chain building is only possible on '
2298 raise error.Abort(_('certificate chain building is only possible on '
2267 'Windows'))
2299 'Windows'))
2268
2300
2269 if not source:
2301 if not source:
2270 if not repo:
2302 if not repo:
2271 raise error.Abort(_("there is no Mercurial repository here, and no "
2303 raise error.Abort(_("there is no Mercurial repository here, and no "
2272 "server specified"))
2304 "server specified"))
2273 source = "default"
2305 source = "default"
2274
2306
2275 source, branches = hg.parseurl(ui.expandpath(source))
2307 source, branches = hg.parseurl(ui.expandpath(source))
2276 url = util.url(source)
2308 url = util.url(source)
2277 addr = None
2309 addr = None
2278
2310
2279 defaultport = {'https': 443, 'ssh': 22}
2311 defaultport = {'https': 443, 'ssh': 22}
2280 if url.scheme in defaultport:
2312 if url.scheme in defaultport:
2281 try:
2313 try:
2282 addr = (url.host, int(url.port or defaultport[url.scheme]))
2314 addr = (url.host, int(url.port or defaultport[url.scheme]))
2283 except ValueError:
2315 except ValueError:
2284 raise error.Abort(_("malformed port number in URL"))
2316 raise error.Abort(_("malformed port number in URL"))
2285 else:
2317 else:
2286 raise error.Abort(_("only https and ssh connections are supported"))
2318 raise error.Abort(_("only https and ssh connections are supported"))
2287
2319
2288 from . import win32
2320 from . import win32
2289
2321
2290 s = ssl.wrap_socket(socket.socket(), ssl_version=ssl.PROTOCOL_TLS,
2322 s = ssl.wrap_socket(socket.socket(), ssl_version=ssl.PROTOCOL_TLS,
2291 cert_reqs=ssl.CERT_NONE, ca_certs=None)
2323 cert_reqs=ssl.CERT_NONE, ca_certs=None)
2292
2324
2293 try:
2325 try:
2294 s.connect(addr)
2326 s.connect(addr)
2295 cert = s.getpeercert(True)
2327 cert = s.getpeercert(True)
2296
2328
2297 ui.status(_('checking the certificate chain for %s\n') % url.host)
2329 ui.status(_('checking the certificate chain for %s\n') % url.host)
2298
2330
2299 complete = win32.checkcertificatechain(cert, build=False)
2331 complete = win32.checkcertificatechain(cert, build=False)
2300
2332
2301 if not complete:
2333 if not complete:
2302 ui.status(_('certificate chain is incomplete, updating... '))
2334 ui.status(_('certificate chain is incomplete, updating... '))
2303
2335
2304 if not win32.checkcertificatechain(cert):
2336 if not win32.checkcertificatechain(cert):
2305 ui.status(_('failed.\n'))
2337 ui.status(_('failed.\n'))
2306 else:
2338 else:
2307 ui.status(_('done.\n'))
2339 ui.status(_('done.\n'))
2308 else:
2340 else:
2309 ui.status(_('full certificate chain is available\n'))
2341 ui.status(_('full certificate chain is available\n'))
2310 finally:
2342 finally:
2311 s.close()
2343 s.close()
2312
2344
2313 @command('debugsub',
2345 @command('debugsub',
2314 [('r', 'rev', '',
2346 [('r', 'rev', '',
2315 _('revision to check'), _('REV'))],
2347 _('revision to check'), _('REV'))],
2316 _('[-r REV] [REV]'))
2348 _('[-r REV] [REV]'))
2317 def debugsub(ui, repo, rev=None):
2349 def debugsub(ui, repo, rev=None):
2318 ctx = scmutil.revsingle(repo, rev, None)
2350 ctx = scmutil.revsingle(repo, rev, None)
2319 for k, v in sorted(ctx.substate.items()):
2351 for k, v in sorted(ctx.substate.items()):
2320 ui.write(('path %s\n') % k)
2352 ui.write(('path %s\n') % k)
2321 ui.write((' source %s\n') % v[0])
2353 ui.write((' source %s\n') % v[0])
2322 ui.write((' revision %s\n') % v[1])
2354 ui.write((' revision %s\n') % v[1])
2323
2355
2324 @command('debugsuccessorssets',
2356 @command('debugsuccessorssets',
2325 [('', 'closest', False, _('return closest successors sets only'))],
2357 [('', 'closest', False, _('return closest successors sets only'))],
2326 _('[REV]'))
2358 _('[REV]'))
2327 def debugsuccessorssets(ui, repo, *revs, **opts):
2359 def debugsuccessorssets(ui, repo, *revs, **opts):
2328 """show set of successors for revision
2360 """show set of successors for revision
2329
2361
2330 A successors set of changeset A is a consistent group of revisions that
2362 A successors set of changeset A is a consistent group of revisions that
2331 succeed A. It contains non-obsolete changesets only unless closests
2363 succeed A. It contains non-obsolete changesets only unless closests
2332 successors set is set.
2364 successors set is set.
2333
2365
2334 In most cases a changeset A has a single successors set containing a single
2366 In most cases a changeset A has a single successors set containing a single
2335 successor (changeset A replaced by A').
2367 successor (changeset A replaced by A').
2336
2368
2337 A changeset that is made obsolete with no successors are called "pruned".
2369 A changeset that is made obsolete with no successors are called "pruned".
2338 Such changesets have no successors sets at all.
2370 Such changesets have no successors sets at all.
2339
2371
2340 A changeset that has been "split" will have a successors set containing
2372 A changeset that has been "split" will have a successors set containing
2341 more than one successor.
2373 more than one successor.
2342
2374
2343 A changeset that has been rewritten in multiple different ways is called
2375 A changeset that has been rewritten in multiple different ways is called
2344 "divergent". Such changesets have multiple successor sets (each of which
2376 "divergent". Such changesets have multiple successor sets (each of which
2345 may also be split, i.e. have multiple successors).
2377 may also be split, i.e. have multiple successors).
2346
2378
2347 Results are displayed as follows::
2379 Results are displayed as follows::
2348
2380
2349 <rev1>
2381 <rev1>
2350 <successors-1A>
2382 <successors-1A>
2351 <rev2>
2383 <rev2>
2352 <successors-2A>
2384 <successors-2A>
2353 <successors-2B1> <successors-2B2> <successors-2B3>
2385 <successors-2B1> <successors-2B2> <successors-2B3>
2354
2386
2355 Here rev2 has two possible (i.e. divergent) successors sets. The first
2387 Here rev2 has two possible (i.e. divergent) successors sets. The first
2356 holds one element, whereas the second holds three (i.e. the changeset has
2388 holds one element, whereas the second holds three (i.e. the changeset has
2357 been split).
2389 been split).
2358 """
2390 """
2359 # passed to successorssets caching computation from one call to another
2391 # passed to successorssets caching computation from one call to another
2360 cache = {}
2392 cache = {}
2361 ctx2str = bytes
2393 ctx2str = bytes
2362 node2str = short
2394 node2str = short
2363 for rev in scmutil.revrange(repo, revs):
2395 for rev in scmutil.revrange(repo, revs):
2364 ctx = repo[rev]
2396 ctx = repo[rev]
2365 ui.write('%s\n'% ctx2str(ctx))
2397 ui.write('%s\n'% ctx2str(ctx))
2366 for succsset in obsutil.successorssets(repo, ctx.node(),
2398 for succsset in obsutil.successorssets(repo, ctx.node(),
2367 closest=opts[r'closest'],
2399 closest=opts[r'closest'],
2368 cache=cache):
2400 cache=cache):
2369 if succsset:
2401 if succsset:
2370 ui.write(' ')
2402 ui.write(' ')
2371 ui.write(node2str(succsset[0]))
2403 ui.write(node2str(succsset[0]))
2372 for node in succsset[1:]:
2404 for node in succsset[1:]:
2373 ui.write(' ')
2405 ui.write(' ')
2374 ui.write(node2str(node))
2406 ui.write(node2str(node))
2375 ui.write('\n')
2407 ui.write('\n')
2376
2408
2377 @command('debugtemplate',
2409 @command('debugtemplate',
2378 [('r', 'rev', [], _('apply template on changesets'), _('REV')),
2410 [('r', 'rev', [], _('apply template on changesets'), _('REV')),
2379 ('D', 'define', [], _('define template keyword'), _('KEY=VALUE'))],
2411 ('D', 'define', [], _('define template keyword'), _('KEY=VALUE'))],
2380 _('[-r REV]... [-D KEY=VALUE]... TEMPLATE'),
2412 _('[-r REV]... [-D KEY=VALUE]... TEMPLATE'),
2381 optionalrepo=True)
2413 optionalrepo=True)
2382 def debugtemplate(ui, repo, tmpl, **opts):
2414 def debugtemplate(ui, repo, tmpl, **opts):
2383 """parse and apply a template
2415 """parse and apply a template
2384
2416
2385 If -r/--rev is given, the template is processed as a log template and
2417 If -r/--rev is given, the template is processed as a log template and
2386 applied to the given changesets. Otherwise, it is processed as a generic
2418 applied to the given changesets. Otherwise, it is processed as a generic
2387 template.
2419 template.
2388
2420
2389 Use --verbose to print the parsed tree.
2421 Use --verbose to print the parsed tree.
2390 """
2422 """
2391 revs = None
2423 revs = None
2392 if opts[r'rev']:
2424 if opts[r'rev']:
2393 if repo is None:
2425 if repo is None:
2394 raise error.RepoError(_('there is no Mercurial repository here '
2426 raise error.RepoError(_('there is no Mercurial repository here '
2395 '(.hg not found)'))
2427 '(.hg not found)'))
2396 revs = scmutil.revrange(repo, opts[r'rev'])
2428 revs = scmutil.revrange(repo, opts[r'rev'])
2397
2429
2398 props = {}
2430 props = {}
2399 for d in opts[r'define']:
2431 for d in opts[r'define']:
2400 try:
2432 try:
2401 k, v = (e.strip() for e in d.split('=', 1))
2433 k, v = (e.strip() for e in d.split('=', 1))
2402 if not k or k == 'ui':
2434 if not k or k == 'ui':
2403 raise ValueError
2435 raise ValueError
2404 props[k] = v
2436 props[k] = v
2405 except ValueError:
2437 except ValueError:
2406 raise error.Abort(_('malformed keyword definition: %s') % d)
2438 raise error.Abort(_('malformed keyword definition: %s') % d)
2407
2439
2408 if ui.verbose:
2440 if ui.verbose:
2409 aliases = ui.configitems('templatealias')
2441 aliases = ui.configitems('templatealias')
2410 tree = templater.parse(tmpl)
2442 tree = templater.parse(tmpl)
2411 ui.note(templater.prettyformat(tree), '\n')
2443 ui.note(templater.prettyformat(tree), '\n')
2412 newtree = templater.expandaliases(tree, aliases)
2444 newtree = templater.expandaliases(tree, aliases)
2413 if newtree != tree:
2445 if newtree != tree:
2414 ui.note(("* expanded:\n"), templater.prettyformat(newtree), '\n')
2446 ui.note(("* expanded:\n"), templater.prettyformat(newtree), '\n')
2415
2447
2416 if revs is None:
2448 if revs is None:
2417 tres = formatter.templateresources(ui, repo)
2449 tres = formatter.templateresources(ui, repo)
2418 t = formatter.maketemplater(ui, tmpl, resources=tres)
2450 t = formatter.maketemplater(ui, tmpl, resources=tres)
2419 ui.write(t.render(props))
2451 ui.write(t.render(props))
2420 else:
2452 else:
2421 displayer = logcmdutil.maketemplater(ui, repo, tmpl)
2453 displayer = logcmdutil.maketemplater(ui, repo, tmpl)
2422 for r in revs:
2454 for r in revs:
2423 displayer.show(repo[r], **pycompat.strkwargs(props))
2455 displayer.show(repo[r], **pycompat.strkwargs(props))
2424 displayer.close()
2456 displayer.close()
2425
2457
2426 @command('debugupdatecaches', [])
2458 @command('debugupdatecaches', [])
2427 def debugupdatecaches(ui, repo, *pats, **opts):
2459 def debugupdatecaches(ui, repo, *pats, **opts):
2428 """warm all known caches in the repository"""
2460 """warm all known caches in the repository"""
2429 with repo.wlock(), repo.lock():
2461 with repo.wlock(), repo.lock():
2430 repo.updatecaches()
2462 repo.updatecaches()
2431
2463
2432 @command('debugupgraderepo', [
2464 @command('debugupgraderepo', [
2433 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
2465 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
2434 ('', 'run', False, _('performs an upgrade')),
2466 ('', 'run', False, _('performs an upgrade')),
2435 ])
2467 ])
2436 def debugupgraderepo(ui, repo, run=False, optimize=None):
2468 def debugupgraderepo(ui, repo, run=False, optimize=None):
2437 """upgrade a repository to use different features
2469 """upgrade a repository to use different features
2438
2470
2439 If no arguments are specified, the repository is evaluated for upgrade
2471 If no arguments are specified, the repository is evaluated for upgrade
2440 and a list of problems and potential optimizations is printed.
2472 and a list of problems and potential optimizations is printed.
2441
2473
2442 With ``--run``, a repository upgrade is performed. Behavior of the upgrade
2474 With ``--run``, a repository upgrade is performed. Behavior of the upgrade
2443 can be influenced via additional arguments. More details will be provided
2475 can be influenced via additional arguments. More details will be provided
2444 by the command output when run without ``--run``.
2476 by the command output when run without ``--run``.
2445
2477
2446 During the upgrade, the repository will be locked and no writes will be
2478 During the upgrade, the repository will be locked and no writes will be
2447 allowed.
2479 allowed.
2448
2480
2449 At the end of the upgrade, the repository may not be readable while new
2481 At the end of the upgrade, the repository may not be readable while new
2450 repository data is swapped in. This window will be as long as it takes to
2482 repository data is swapped in. This window will be as long as it takes to
2451 rename some directories inside the ``.hg`` directory. On most machines, this
2483 rename some directories inside the ``.hg`` directory. On most machines, this
2452 should complete almost instantaneously and the chances of a consumer being
2484 should complete almost instantaneously and the chances of a consumer being
2453 unable to access the repository should be low.
2485 unable to access the repository should be low.
2454 """
2486 """
2455 return upgrade.upgraderepo(ui, repo, run=run, optimize=optimize)
2487 return upgrade.upgraderepo(ui, repo, run=run, optimize=optimize)
2456
2488
2457 @command('debugwalk', cmdutil.walkopts, _('[OPTION]... [FILE]...'),
2489 @command('debugwalk', cmdutil.walkopts, _('[OPTION]... [FILE]...'),
2458 inferrepo=True)
2490 inferrepo=True)
2459 def debugwalk(ui, repo, *pats, **opts):
2491 def debugwalk(ui, repo, *pats, **opts):
2460 """show how files match on given patterns"""
2492 """show how files match on given patterns"""
2461 opts = pycompat.byteskwargs(opts)
2493 opts = pycompat.byteskwargs(opts)
2462 m = scmutil.match(repo[None], pats, opts)
2494 m = scmutil.match(repo[None], pats, opts)
2463 ui.write(('matcher: %r\n' % m))
2495 ui.write(('matcher: %r\n' % m))
2464 items = list(repo[None].walk(m))
2496 items = list(repo[None].walk(m))
2465 if not items:
2497 if not items:
2466 return
2498 return
2467 f = lambda fn: fn
2499 f = lambda fn: fn
2468 if ui.configbool('ui', 'slash') and pycompat.ossep != '/':
2500 if ui.configbool('ui', 'slash') and pycompat.ossep != '/':
2469 f = lambda fn: util.normpath(fn)
2501 f = lambda fn: util.normpath(fn)
2470 fmt = 'f %%-%ds %%-%ds %%s' % (
2502 fmt = 'f %%-%ds %%-%ds %%s' % (
2471 max([len(abs) for abs in items]),
2503 max([len(abs) for abs in items]),
2472 max([len(m.rel(abs)) for abs in items]))
2504 max([len(m.rel(abs)) for abs in items]))
2473 for abs in items:
2505 for abs in items:
2474 line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '')
2506 line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '')
2475 ui.write("%s\n" % line.rstrip())
2507 ui.write("%s\n" % line.rstrip())
2476
2508
2477 @command('debugwireargs',
2509 @command('debugwireargs',
2478 [('', 'three', '', 'three'),
2510 [('', 'three', '', 'three'),
2479 ('', 'four', '', 'four'),
2511 ('', 'four', '', 'four'),
2480 ('', 'five', '', 'five'),
2512 ('', 'five', '', 'five'),
2481 ] + cmdutil.remoteopts,
2513 ] + cmdutil.remoteopts,
2482 _('REPO [OPTIONS]... [ONE [TWO]]'),
2514 _('REPO [OPTIONS]... [ONE [TWO]]'),
2483 norepo=True)
2515 norepo=True)
2484 def debugwireargs(ui, repopath, *vals, **opts):
2516 def debugwireargs(ui, repopath, *vals, **opts):
2485 opts = pycompat.byteskwargs(opts)
2517 opts = pycompat.byteskwargs(opts)
2486 repo = hg.peer(ui, opts, repopath)
2518 repo = hg.peer(ui, opts, repopath)
2487 for opt in cmdutil.remoteopts:
2519 for opt in cmdutil.remoteopts:
2488 del opts[opt[1]]
2520 del opts[opt[1]]
2489 args = {}
2521 args = {}
2490 for k, v in opts.iteritems():
2522 for k, v in opts.iteritems():
2491 if v:
2523 if v:
2492 args[k] = v
2524 args[k] = v
2493 args = pycompat.strkwargs(args)
2525 args = pycompat.strkwargs(args)
2494 # run twice to check that we don't mess up the stream for the next command
2526 # run twice to check that we don't mess up the stream for the next command
2495 res1 = repo.debugwireargs(*vals, **args)
2527 res1 = repo.debugwireargs(*vals, **args)
2496 res2 = repo.debugwireargs(*vals, **args)
2528 res2 = repo.debugwireargs(*vals, **args)
2497 ui.write("%s\n" % res1)
2529 ui.write("%s\n" % res1)
2498 if res1 != res2:
2530 if res1 != res2:
2499 ui.warn("%s\n" % res2)
2531 ui.warn("%s\n" % res2)
@@ -1,391 +1,393 b''
1 Show all commands except debug commands
1 Show all commands except debug commands
2 $ hg debugcomplete
2 $ hg debugcomplete
3 add
3 add
4 addremove
4 addremove
5 annotate
5 annotate
6 archive
6 archive
7 backout
7 backout
8 bisect
8 bisect
9 bookmarks
9 bookmarks
10 branch
10 branch
11 branches
11 branches
12 bundle
12 bundle
13 cat
13 cat
14 clone
14 clone
15 commit
15 commit
16 config
16 config
17 copy
17 copy
18 diff
18 diff
19 export
19 export
20 files
20 files
21 forget
21 forget
22 graft
22 graft
23 grep
23 grep
24 heads
24 heads
25 help
25 help
26 identify
26 identify
27 import
27 import
28 incoming
28 incoming
29 init
29 init
30 locate
30 locate
31 log
31 log
32 manifest
32 manifest
33 merge
33 merge
34 outgoing
34 outgoing
35 parents
35 parents
36 paths
36 paths
37 phase
37 phase
38 pull
38 pull
39 push
39 push
40 recover
40 recover
41 remove
41 remove
42 rename
42 rename
43 resolve
43 resolve
44 revert
44 revert
45 rollback
45 rollback
46 root
46 root
47 serve
47 serve
48 status
48 status
49 summary
49 summary
50 tag
50 tag
51 tags
51 tags
52 tip
52 tip
53 unbundle
53 unbundle
54 update
54 update
55 verify
55 verify
56 version
56 version
57
57
58 Show all commands that start with "a"
58 Show all commands that start with "a"
59 $ hg debugcomplete a
59 $ hg debugcomplete a
60 add
60 add
61 addremove
61 addremove
62 annotate
62 annotate
63 archive
63 archive
64
64
65 Do not show debug commands if there are other candidates
65 Do not show debug commands if there are other candidates
66 $ hg debugcomplete d
66 $ hg debugcomplete d
67 diff
67 diff
68
68
69 Show debug commands if there are no other candidates
69 Show debug commands if there are no other candidates
70 $ hg debugcomplete debug
70 $ hg debugcomplete debug
71 debugancestor
71 debugancestor
72 debugapplystreamclonebundle
72 debugapplystreamclonebundle
73 debugbuilddag
73 debugbuilddag
74 debugbundle
74 debugbundle
75 debugcapabilities
75 debugcapabilities
76 debugcheckstate
76 debugcheckstate
77 debugcolor
77 debugcolor
78 debugcommands
78 debugcommands
79 debugcomplete
79 debugcomplete
80 debugconfig
80 debugconfig
81 debugcreatestreamclonebundle
81 debugcreatestreamclonebundle
82 debugdag
82 debugdag
83 debugdata
83 debugdata
84 debugdate
84 debugdate
85 debugdeltachain
85 debugdeltachain
86 debugdirstate
86 debugdirstate
87 debugdiscovery
87 debugdiscovery
88 debugdownload
88 debugdownload
89 debugextensions
89 debugextensions
90 debugfileset
90 debugfileset
91 debugformat
91 debugformat
92 debugfsinfo
92 debugfsinfo
93 debuggetbundle
93 debuggetbundle
94 debugignore
94 debugignore
95 debugindex
95 debugindex
96 debugindexdot
96 debugindexdot
97 debuginstall
97 debuginstall
98 debugknown
98 debugknown
99 debuglabelcomplete
99 debuglabelcomplete
100 debuglocks
100 debuglocks
101 debugmergestate
101 debugmergestate
102 debugnamecomplete
102 debugnamecomplete
103 debugobsolete
103 debugobsolete
104 debugpathcomplete
104 debugpathcomplete
105 debugpeer
105 debugpeer
106 debugpickmergetool
106 debugpickmergetool
107 debugpushkey
107 debugpushkey
108 debugpvec
108 debugpvec
109 debugrebuilddirstate
109 debugrebuilddirstate
110 debugrebuildfncache
110 debugrebuildfncache
111 debugrename
111 debugrename
112 debugrevlog
112 debugrevlog
113 debugrevspec
113 debugrevspec
114 debugserve
114 debugsetparents
115 debugsetparents
115 debugssl
116 debugssl
116 debugsub
117 debugsub
117 debugsuccessorssets
118 debugsuccessorssets
118 debugtemplate
119 debugtemplate
119 debugupdatecaches
120 debugupdatecaches
120 debugupgraderepo
121 debugupgraderepo
121 debugwalk
122 debugwalk
122 debugwireargs
123 debugwireargs
123
124
124 Do not show the alias of a debug command if there are other candidates
125 Do not show the alias of a debug command if there are other candidates
125 (this should hide rawcommit)
126 (this should hide rawcommit)
126 $ hg debugcomplete r
127 $ hg debugcomplete r
127 recover
128 recover
128 remove
129 remove
129 rename
130 rename
130 resolve
131 resolve
131 revert
132 revert
132 rollback
133 rollback
133 root
134 root
134 Show the alias of a debug command if there are no other candidates
135 Show the alias of a debug command if there are no other candidates
135 $ hg debugcomplete rawc
136 $ hg debugcomplete rawc
136
137
137
138
138 Show the global options
139 Show the global options
139 $ hg debugcomplete --options | sort
140 $ hg debugcomplete --options | sort
140 --color
141 --color
141 --config
142 --config
142 --cwd
143 --cwd
143 --debug
144 --debug
144 --debugger
145 --debugger
145 --encoding
146 --encoding
146 --encodingmode
147 --encodingmode
147 --help
148 --help
148 --hidden
149 --hidden
149 --noninteractive
150 --noninteractive
150 --pager
151 --pager
151 --profile
152 --profile
152 --quiet
153 --quiet
153 --repository
154 --repository
154 --time
155 --time
155 --traceback
156 --traceback
156 --verbose
157 --verbose
157 --version
158 --version
158 -R
159 -R
159 -h
160 -h
160 -q
161 -q
161 -v
162 -v
162 -y
163 -y
163
164
164 Show the options for the "serve" command
165 Show the options for the "serve" command
165 $ hg debugcomplete --options serve | sort
166 $ hg debugcomplete --options serve | sort
166 --accesslog
167 --accesslog
167 --address
168 --address
168 --certificate
169 --certificate
169 --cmdserver
170 --cmdserver
170 --color
171 --color
171 --config
172 --config
172 --cwd
173 --cwd
173 --daemon
174 --daemon
174 --daemon-postexec
175 --daemon-postexec
175 --debug
176 --debug
176 --debugger
177 --debugger
177 --encoding
178 --encoding
178 --encodingmode
179 --encodingmode
179 --errorlog
180 --errorlog
180 --help
181 --help
181 --hidden
182 --hidden
182 --ipv6
183 --ipv6
183 --name
184 --name
184 --noninteractive
185 --noninteractive
185 --pager
186 --pager
186 --pid-file
187 --pid-file
187 --port
188 --port
188 --prefix
189 --prefix
189 --profile
190 --profile
190 --quiet
191 --quiet
191 --repository
192 --repository
192 --stdio
193 --stdio
193 --style
194 --style
194 --subrepos
195 --subrepos
195 --templates
196 --templates
196 --time
197 --time
197 --traceback
198 --traceback
198 --verbose
199 --verbose
199 --version
200 --version
200 --web-conf
201 --web-conf
201 -6
202 -6
202 -A
203 -A
203 -E
204 -E
204 -R
205 -R
205 -S
206 -S
206 -a
207 -a
207 -d
208 -d
208 -h
209 -h
209 -n
210 -n
210 -p
211 -p
211 -q
212 -q
212 -t
213 -t
213 -v
214 -v
214 -y
215 -y
215
216
216 Show an error if we use --options with an ambiguous abbreviation
217 Show an error if we use --options with an ambiguous abbreviation
217 $ hg debugcomplete --options s
218 $ hg debugcomplete --options s
218 hg: command 's' is ambiguous:
219 hg: command 's' is ambiguous:
219 serve showconfig status summary
220 serve showconfig status summary
220 [255]
221 [255]
221
222
222 Show all commands + options
223 Show all commands + options
223 $ hg debugcommands
224 $ hg debugcommands
224 add: include, exclude, subrepos, dry-run
225 add: include, exclude, subrepos, dry-run
225 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
226 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
226 clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure
227 clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure
227 commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos
228 commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos
228 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
229 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
229 export: output, switch-parent, rev, text, git, binary, nodates
230 export: output, switch-parent, rev, text, git, binary, nodates
230 forget: include, exclude
231 forget: include, exclude
231 init: ssh, remotecmd, insecure
232 init: ssh, remotecmd, insecure
232 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
233 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
233 merge: force, rev, preview, abort, tool
234 merge: force, rev, preview, abort, tool
234 pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure
235 pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure
235 push: force, rev, bookmark, branch, new-branch, pushvars, ssh, remotecmd, insecure
236 push: force, rev, bookmark, branch, new-branch, pushvars, ssh, remotecmd, insecure
236 remove: after, force, subrepos, include, exclude
237 remove: after, force, subrepos, include, exclude
237 serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, ipv6, certificate, subrepos
238 serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, ipv6, certificate, subrepos
238 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, terse, copies, print0, rev, change, include, exclude, subrepos, template
239 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, terse, copies, print0, rev, change, include, exclude, subrepos, template
239 summary: remote
240 summary: remote
240 update: clean, check, merge, date, rev, tool
241 update: clean, check, merge, date, rev, tool
241 addremove: similarity, subrepos, include, exclude, dry-run
242 addremove: similarity, subrepos, include, exclude, dry-run
242 archive: no-decode, prefix, rev, type, subrepos, include, exclude
243 archive: no-decode, prefix, rev, type, subrepos, include, exclude
243 backout: merge, commit, no-commit, parent, rev, edit, tool, include, exclude, message, logfile, date, user
244 backout: merge, commit, no-commit, parent, rev, edit, tool, include, exclude, message, logfile, date, user
244 bisect: reset, good, bad, skip, extend, command, noupdate
245 bisect: reset, good, bad, skip, extend, command, noupdate
245 bookmarks: force, rev, delete, rename, inactive, template
246 bookmarks: force, rev, delete, rename, inactive, template
246 branch: force, clean, rev
247 branch: force, clean, rev
247 branches: active, closed, template
248 branches: active, closed, template
248 bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure
249 bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure
249 cat: output, rev, decode, include, exclude, template
250 cat: output, rev, decode, include, exclude, template
250 config: untrusted, edit, local, global, template
251 config: untrusted, edit, local, global, template
251 copy: after, force, include, exclude, dry-run
252 copy: after, force, include, exclude, dry-run
252 debugancestor:
253 debugancestor:
253 debugapplystreamclonebundle:
254 debugapplystreamclonebundle:
254 debugbuilddag: mergeable-file, overwritten-file, new-file
255 debugbuilddag: mergeable-file, overwritten-file, new-file
255 debugbundle: all, part-type, spec
256 debugbundle: all, part-type, spec
256 debugcapabilities:
257 debugcapabilities:
257 debugcheckstate:
258 debugcheckstate:
258 debugcolor: style
259 debugcolor: style
259 debugcommands:
260 debugcommands:
260 debugcomplete: options
261 debugcomplete: options
261 debugcreatestreamclonebundle:
262 debugcreatestreamclonebundle:
262 debugdag: tags, branches, dots, spaces
263 debugdag: tags, branches, dots, spaces
263 debugdata: changelog, manifest, dir
264 debugdata: changelog, manifest, dir
264 debugdate: extended
265 debugdate: extended
265 debugdeltachain: changelog, manifest, dir, template
266 debugdeltachain: changelog, manifest, dir, template
266 debugdirstate: nodates, datesort
267 debugdirstate: nodates, datesort
267 debugdiscovery: old, nonheads, rev, ssh, remotecmd, insecure
268 debugdiscovery: old, nonheads, rev, ssh, remotecmd, insecure
268 debugdownload: output
269 debugdownload: output
269 debugextensions: template
270 debugextensions: template
270 debugfileset: rev
271 debugfileset: rev
271 debugformat: template
272 debugformat: template
272 debugfsinfo:
273 debugfsinfo:
273 debuggetbundle: head, common, type
274 debuggetbundle: head, common, type
274 debugignore:
275 debugignore:
275 debugindex: changelog, manifest, dir, format
276 debugindex: changelog, manifest, dir, format
276 debugindexdot: changelog, manifest, dir
277 debugindexdot: changelog, manifest, dir
277 debuginstall: template
278 debuginstall: template
278 debugknown:
279 debugknown:
279 debuglabelcomplete:
280 debuglabelcomplete:
280 debuglocks: force-lock, force-wlock, set-lock, set-wlock
281 debuglocks: force-lock, force-wlock, set-lock, set-wlock
281 debugmergestate:
282 debugmergestate:
282 debugnamecomplete:
283 debugnamecomplete:
283 debugobsolete: flags, record-parents, rev, exclusive, index, delete, date, user, template
284 debugobsolete: flags, record-parents, rev, exclusive, index, delete, date, user, template
284 debugpathcomplete: full, normal, added, removed
285 debugpathcomplete: full, normal, added, removed
285 debugpeer:
286 debugpeer:
286 debugpickmergetool: rev, changedelete, include, exclude, tool
287 debugpickmergetool: rev, changedelete, include, exclude, tool
287 debugpushkey:
288 debugpushkey:
288 debugpvec:
289 debugpvec:
289 debugrebuilddirstate: rev, minimal
290 debugrebuilddirstate: rev, minimal
290 debugrebuildfncache:
291 debugrebuildfncache:
291 debugrename: rev
292 debugrename: rev
292 debugrevlog: changelog, manifest, dir, dump
293 debugrevlog: changelog, manifest, dir, dump
293 debugrevspec: optimize, show-revs, show-set, show-stage, no-optimized, verify-optimized
294 debugrevspec: optimize, show-revs, show-set, show-stage, no-optimized, verify-optimized
295 debugserve: sshstdio, logiofd, logiofile
294 debugsetparents:
296 debugsetparents:
295 debugssl:
297 debugssl:
296 debugsub: rev
298 debugsub: rev
297 debugsuccessorssets: closest
299 debugsuccessorssets: closest
298 debugtemplate: rev, define
300 debugtemplate: rev, define
299 debugupdatecaches:
301 debugupdatecaches:
300 debugupgraderepo: optimize, run
302 debugupgraderepo: optimize, run
301 debugwalk: include, exclude
303 debugwalk: include, exclude
302 debugwireargs: three, four, five, ssh, remotecmd, insecure
304 debugwireargs: three, four, five, ssh, remotecmd, insecure
303 files: rev, print0, include, exclude, template, subrepos
305 files: rev, print0, include, exclude, template, subrepos
304 graft: rev, continue, edit, log, force, currentdate, currentuser, date, user, tool, dry-run
306 graft: rev, continue, edit, log, force, currentdate, currentuser, date, user, tool, dry-run
305 grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, template, include, exclude
307 grep: print0, all, text, follow, ignore-case, files-with-matches, line-number, rev, user, date, template, include, exclude
306 heads: rev, topo, active, closed, style, template
308 heads: rev, topo, active, closed, style, template
307 help: extension, command, keyword, system
309 help: extension, command, keyword, system
308 identify: rev, num, id, branch, tags, bookmarks, ssh, remotecmd, insecure, template
310 identify: rev, num, id, branch, tags, bookmarks, ssh, remotecmd, insecure, template
309 import: strip, base, edit, force, no-commit, bypass, partial, exact, prefix, import-branch, message, logfile, date, user, similarity
311 import: strip, base, edit, force, no-commit, bypass, partial, exact, prefix, import-branch, message, logfile, date, user, similarity
310 incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
312 incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
311 locate: rev, print0, fullpath, include, exclude
313 locate: rev, print0, fullpath, include, exclude
312 manifest: rev, all, template
314 manifest: rev, all, template
313 outgoing: force, rev, newest-first, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
315 outgoing: force, rev, newest-first, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
314 parents: rev, style, template
316 parents: rev, style, template
315 paths: template
317 paths: template
316 phase: public, draft, secret, force, rev
318 phase: public, draft, secret, force, rev
317 recover:
319 recover:
318 rename: after, force, include, exclude, dry-run
320 rename: after, force, include, exclude, dry-run
319 resolve: all, list, mark, unmark, no-status, tool, include, exclude, template
321 resolve: all, list, mark, unmark, no-status, tool, include, exclude, template
320 revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
322 revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
321 rollback: dry-run, force
323 rollback: dry-run, force
322 root:
324 root:
323 tag: force, local, rev, remove, edit, message, date, user
325 tag: force, local, rev, remove, edit, message, date, user
324 tags: template
326 tags: template
325 tip: patch, git, style, template
327 tip: patch, git, style, template
326 unbundle: update
328 unbundle: update
327 verify:
329 verify:
328 version: template
330 version: template
329
331
330 $ hg init a
332 $ hg init a
331 $ cd a
333 $ cd a
332 $ echo fee > fee
334 $ echo fee > fee
333 $ hg ci -q -Amfee
335 $ hg ci -q -Amfee
334 $ hg tag fee
336 $ hg tag fee
335 $ mkdir fie
337 $ mkdir fie
336 $ echo dead > fie/dead
338 $ echo dead > fie/dead
337 $ echo live > fie/live
339 $ echo live > fie/live
338 $ hg bookmark fo
340 $ hg bookmark fo
339 $ hg branch -q fie
341 $ hg branch -q fie
340 $ hg ci -q -Amfie
342 $ hg ci -q -Amfie
341 $ echo fo > fo
343 $ echo fo > fo
342 $ hg branch -qf default
344 $ hg branch -qf default
343 $ hg ci -q -Amfo
345 $ hg ci -q -Amfo
344 $ echo Fum > Fum
346 $ echo Fum > Fum
345 $ hg ci -q -AmFum
347 $ hg ci -q -AmFum
346 $ hg bookmark Fum
348 $ hg bookmark Fum
347
349
348 Test debugpathcomplete
350 Test debugpathcomplete
349
351
350 $ hg debugpathcomplete f
352 $ hg debugpathcomplete f
351 fee
353 fee
352 fie
354 fie
353 fo
355 fo
354 $ hg debugpathcomplete -f f
356 $ hg debugpathcomplete -f f
355 fee
357 fee
356 fie/dead
358 fie/dead
357 fie/live
359 fie/live
358 fo
360 fo
359
361
360 $ hg rm Fum
362 $ hg rm Fum
361 $ hg debugpathcomplete -r F
363 $ hg debugpathcomplete -r F
362 Fum
364 Fum
363
365
364 Test debugnamecomplete
366 Test debugnamecomplete
365
367
366 $ hg debugnamecomplete
368 $ hg debugnamecomplete
367 Fum
369 Fum
368 default
370 default
369 fee
371 fee
370 fie
372 fie
371 fo
373 fo
372 tip
374 tip
373 $ hg debugnamecomplete f
375 $ hg debugnamecomplete f
374 fee
376 fee
375 fie
377 fie
376 fo
378 fo
377
379
378 Test debuglabelcomplete, a deprecated name for debugnamecomplete that is still
380 Test debuglabelcomplete, a deprecated name for debugnamecomplete that is still
379 used for completions in some shells.
381 used for completions in some shells.
380
382
381 $ hg debuglabelcomplete
383 $ hg debuglabelcomplete
382 Fum
384 Fum
383 default
385 default
384 fee
386 fee
385 fie
387 fie
386 fo
388 fo
387 tip
389 tip
388 $ hg debuglabelcomplete f
390 $ hg debuglabelcomplete f
389 fee
391 fee
390 fie
392 fie
391 fo
393 fo
@@ -1,3473 +1,3474 b''
1 Short help:
1 Short help:
2
2
3 $ hg
3 $ hg
4 Mercurial Distributed SCM
4 Mercurial Distributed SCM
5
5
6 basic commands:
6 basic commands:
7
7
8 add add the specified files on the next commit
8 add add the specified files on the next commit
9 annotate show changeset information by line for each file
9 annotate show changeset information by line for each file
10 clone make a copy of an existing repository
10 clone make a copy of an existing repository
11 commit commit the specified files or all outstanding changes
11 commit commit the specified files or all outstanding changes
12 diff diff repository (or selected files)
12 diff diff repository (or selected files)
13 export dump the header and diffs for one or more changesets
13 export dump the header and diffs for one or more changesets
14 forget forget the specified files on the next commit
14 forget forget the specified files on the next commit
15 init create a new repository in the given directory
15 init create a new repository in the given directory
16 log show revision history of entire repository or files
16 log show revision history of entire repository or files
17 merge merge another revision into working directory
17 merge merge another revision into working directory
18 pull pull changes from the specified source
18 pull pull changes from the specified source
19 push push changes to the specified destination
19 push push changes to the specified destination
20 remove remove the specified files on the next commit
20 remove remove the specified files on the next commit
21 serve start stand-alone webserver
21 serve start stand-alone webserver
22 status show changed files in the working directory
22 status show changed files in the working directory
23 summary summarize working directory state
23 summary summarize working directory state
24 update update working directory (or switch revisions)
24 update update working directory (or switch revisions)
25
25
26 (use 'hg help' for the full list of commands or 'hg -v' for details)
26 (use 'hg help' for the full list of commands or 'hg -v' for details)
27
27
28 $ hg -q
28 $ hg -q
29 add add the specified files on the next commit
29 add add the specified files on the next commit
30 annotate show changeset information by line for each file
30 annotate show changeset information by line for each file
31 clone make a copy of an existing repository
31 clone make a copy of an existing repository
32 commit commit the specified files or all outstanding changes
32 commit commit the specified files or all outstanding changes
33 diff diff repository (or selected files)
33 diff diff repository (or selected files)
34 export dump the header and diffs for one or more changesets
34 export dump the header and diffs for one or more changesets
35 forget forget the specified files on the next commit
35 forget forget the specified files on the next commit
36 init create a new repository in the given directory
36 init create a new repository in the given directory
37 log show revision history of entire repository or files
37 log show revision history of entire repository or files
38 merge merge another revision into working directory
38 merge merge another revision into working directory
39 pull pull changes from the specified source
39 pull pull changes from the specified source
40 push push changes to the specified destination
40 push push changes to the specified destination
41 remove remove the specified files on the next commit
41 remove remove the specified files on the next commit
42 serve start stand-alone webserver
42 serve start stand-alone webserver
43 status show changed files in the working directory
43 status show changed files in the working directory
44 summary summarize working directory state
44 summary summarize working directory state
45 update update working directory (or switch revisions)
45 update update working directory (or switch revisions)
46
46
47 $ hg help
47 $ hg help
48 Mercurial Distributed SCM
48 Mercurial Distributed SCM
49
49
50 list of commands:
50 list of commands:
51
51
52 add add the specified files on the next commit
52 add add the specified files on the next commit
53 addremove add all new files, delete all missing files
53 addremove add all new files, delete all missing files
54 annotate show changeset information by line for each file
54 annotate show changeset information by line for each file
55 archive create an unversioned archive of a repository revision
55 archive create an unversioned archive of a repository revision
56 backout reverse effect of earlier changeset
56 backout reverse effect of earlier changeset
57 bisect subdivision search of changesets
57 bisect subdivision search of changesets
58 bookmarks create a new bookmark or list existing bookmarks
58 bookmarks create a new bookmark or list existing bookmarks
59 branch set or show the current branch name
59 branch set or show the current branch name
60 branches list repository named branches
60 branches list repository named branches
61 bundle create a bundle file
61 bundle create a bundle file
62 cat output the current or given revision of files
62 cat output the current or given revision of files
63 clone make a copy of an existing repository
63 clone make a copy of an existing repository
64 commit commit the specified files or all outstanding changes
64 commit commit the specified files or all outstanding changes
65 config show combined config settings from all hgrc files
65 config show combined config settings from all hgrc files
66 copy mark files as copied for the next commit
66 copy mark files as copied for the next commit
67 diff diff repository (or selected files)
67 diff diff repository (or selected files)
68 export dump the header and diffs for one or more changesets
68 export dump the header and diffs for one or more changesets
69 files list tracked files
69 files list tracked files
70 forget forget the specified files on the next commit
70 forget forget the specified files on the next commit
71 graft copy changes from other branches onto the current branch
71 graft copy changes from other branches onto the current branch
72 grep search revision history for a pattern in specified files
72 grep search revision history for a pattern in specified files
73 heads show branch heads
73 heads show branch heads
74 help show help for a given topic or a help overview
74 help show help for a given topic or a help overview
75 identify identify the working directory or specified revision
75 identify identify the working directory or specified revision
76 import import an ordered set of patches
76 import import an ordered set of patches
77 incoming show new changesets found in source
77 incoming show new changesets found in source
78 init create a new repository in the given directory
78 init create a new repository in the given directory
79 log show revision history of entire repository or files
79 log show revision history of entire repository or files
80 manifest output the current or given revision of the project manifest
80 manifest output the current or given revision of the project manifest
81 merge merge another revision into working directory
81 merge merge another revision into working directory
82 outgoing show changesets not found in the destination
82 outgoing show changesets not found in the destination
83 paths show aliases for remote repositories
83 paths show aliases for remote repositories
84 phase set or show the current phase name
84 phase set or show the current phase name
85 pull pull changes from the specified source
85 pull pull changes from the specified source
86 push push changes to the specified destination
86 push push changes to the specified destination
87 recover roll back an interrupted transaction
87 recover roll back an interrupted transaction
88 remove remove the specified files on the next commit
88 remove remove the specified files on the next commit
89 rename rename files; equivalent of copy + remove
89 rename rename files; equivalent of copy + remove
90 resolve redo merges or set/view the merge status of files
90 resolve redo merges or set/view the merge status of files
91 revert restore files to their checkout state
91 revert restore files to their checkout state
92 root print the root (top) of the current working directory
92 root print the root (top) of the current working directory
93 serve start stand-alone webserver
93 serve start stand-alone webserver
94 status show changed files in the working directory
94 status show changed files in the working directory
95 summary summarize working directory state
95 summary summarize working directory state
96 tag add one or more tags for the current or given revision
96 tag add one or more tags for the current or given revision
97 tags list repository tags
97 tags list repository tags
98 unbundle apply one or more bundle files
98 unbundle apply one or more bundle files
99 update update working directory (or switch revisions)
99 update update working directory (or switch revisions)
100 verify verify the integrity of the repository
100 verify verify the integrity of the repository
101 version output version and copyright information
101 version output version and copyright information
102
102
103 additional help topics:
103 additional help topics:
104
104
105 bundlespec Bundle File Formats
105 bundlespec Bundle File Formats
106 color Colorizing Outputs
106 color Colorizing Outputs
107 config Configuration Files
107 config Configuration Files
108 dates Date Formats
108 dates Date Formats
109 diffs Diff Formats
109 diffs Diff Formats
110 environment Environment Variables
110 environment Environment Variables
111 extensions Using Additional Features
111 extensions Using Additional Features
112 filesets Specifying File Sets
112 filesets Specifying File Sets
113 flags Command-line flags
113 flags Command-line flags
114 glossary Glossary
114 glossary Glossary
115 hgignore Syntax for Mercurial Ignore Files
115 hgignore Syntax for Mercurial Ignore Files
116 hgweb Configuring hgweb
116 hgweb Configuring hgweb
117 internals Technical implementation topics
117 internals Technical implementation topics
118 merge-tools Merge Tools
118 merge-tools Merge Tools
119 pager Pager Support
119 pager Pager Support
120 patterns File Name Patterns
120 patterns File Name Patterns
121 phases Working with Phases
121 phases Working with Phases
122 revisions Specifying Revisions
122 revisions Specifying Revisions
123 scripting Using Mercurial from scripts and automation
123 scripting Using Mercurial from scripts and automation
124 subrepos Subrepositories
124 subrepos Subrepositories
125 templating Template Usage
125 templating Template Usage
126 urls URL Paths
126 urls URL Paths
127
127
128 (use 'hg help -v' to show built-in aliases and global options)
128 (use 'hg help -v' to show built-in aliases and global options)
129
129
130 $ hg -q help
130 $ hg -q help
131 add add the specified files on the next commit
131 add add the specified files on the next commit
132 addremove add all new files, delete all missing files
132 addremove add all new files, delete all missing files
133 annotate show changeset information by line for each file
133 annotate show changeset information by line for each file
134 archive create an unversioned archive of a repository revision
134 archive create an unversioned archive of a repository revision
135 backout reverse effect of earlier changeset
135 backout reverse effect of earlier changeset
136 bisect subdivision search of changesets
136 bisect subdivision search of changesets
137 bookmarks create a new bookmark or list existing bookmarks
137 bookmarks create a new bookmark or list existing bookmarks
138 branch set or show the current branch name
138 branch set or show the current branch name
139 branches list repository named branches
139 branches list repository named branches
140 bundle create a bundle file
140 bundle create a bundle file
141 cat output the current or given revision of files
141 cat output the current or given revision of files
142 clone make a copy of an existing repository
142 clone make a copy of an existing repository
143 commit commit the specified files or all outstanding changes
143 commit commit the specified files or all outstanding changes
144 config show combined config settings from all hgrc files
144 config show combined config settings from all hgrc files
145 copy mark files as copied for the next commit
145 copy mark files as copied for the next commit
146 diff diff repository (or selected files)
146 diff diff repository (or selected files)
147 export dump the header and diffs for one or more changesets
147 export dump the header and diffs for one or more changesets
148 files list tracked files
148 files list tracked files
149 forget forget the specified files on the next commit
149 forget forget the specified files on the next commit
150 graft copy changes from other branches onto the current branch
150 graft copy changes from other branches onto the current branch
151 grep search revision history for a pattern in specified files
151 grep search revision history for a pattern in specified files
152 heads show branch heads
152 heads show branch heads
153 help show help for a given topic or a help overview
153 help show help for a given topic or a help overview
154 identify identify the working directory or specified revision
154 identify identify the working directory or specified revision
155 import import an ordered set of patches
155 import import an ordered set of patches
156 incoming show new changesets found in source
156 incoming show new changesets found in source
157 init create a new repository in the given directory
157 init create a new repository in the given directory
158 log show revision history of entire repository or files
158 log show revision history of entire repository or files
159 manifest output the current or given revision of the project manifest
159 manifest output the current or given revision of the project manifest
160 merge merge another revision into working directory
160 merge merge another revision into working directory
161 outgoing show changesets not found in the destination
161 outgoing show changesets not found in the destination
162 paths show aliases for remote repositories
162 paths show aliases for remote repositories
163 phase set or show the current phase name
163 phase set or show the current phase name
164 pull pull changes from the specified source
164 pull pull changes from the specified source
165 push push changes to the specified destination
165 push push changes to the specified destination
166 recover roll back an interrupted transaction
166 recover roll back an interrupted transaction
167 remove remove the specified files on the next commit
167 remove remove the specified files on the next commit
168 rename rename files; equivalent of copy + remove
168 rename rename files; equivalent of copy + remove
169 resolve redo merges or set/view the merge status of files
169 resolve redo merges or set/view the merge status of files
170 revert restore files to their checkout state
170 revert restore files to their checkout state
171 root print the root (top) of the current working directory
171 root print the root (top) of the current working directory
172 serve start stand-alone webserver
172 serve start stand-alone webserver
173 status show changed files in the working directory
173 status show changed files in the working directory
174 summary summarize working directory state
174 summary summarize working directory state
175 tag add one or more tags for the current or given revision
175 tag add one or more tags for the current or given revision
176 tags list repository tags
176 tags list repository tags
177 unbundle apply one or more bundle files
177 unbundle apply one or more bundle files
178 update update working directory (or switch revisions)
178 update update working directory (or switch revisions)
179 verify verify the integrity of the repository
179 verify verify the integrity of the repository
180 version output version and copyright information
180 version output version and copyright information
181
181
182 additional help topics:
182 additional help topics:
183
183
184 bundlespec Bundle File Formats
184 bundlespec Bundle File Formats
185 color Colorizing Outputs
185 color Colorizing Outputs
186 config Configuration Files
186 config Configuration Files
187 dates Date Formats
187 dates Date Formats
188 diffs Diff Formats
188 diffs Diff Formats
189 environment Environment Variables
189 environment Environment Variables
190 extensions Using Additional Features
190 extensions Using Additional Features
191 filesets Specifying File Sets
191 filesets Specifying File Sets
192 flags Command-line flags
192 flags Command-line flags
193 glossary Glossary
193 glossary Glossary
194 hgignore Syntax for Mercurial Ignore Files
194 hgignore Syntax for Mercurial Ignore Files
195 hgweb Configuring hgweb
195 hgweb Configuring hgweb
196 internals Technical implementation topics
196 internals Technical implementation topics
197 merge-tools Merge Tools
197 merge-tools Merge Tools
198 pager Pager Support
198 pager Pager Support
199 patterns File Name Patterns
199 patterns File Name Patterns
200 phases Working with Phases
200 phases Working with Phases
201 revisions Specifying Revisions
201 revisions Specifying Revisions
202 scripting Using Mercurial from scripts and automation
202 scripting Using Mercurial from scripts and automation
203 subrepos Subrepositories
203 subrepos Subrepositories
204 templating Template Usage
204 templating Template Usage
205 urls URL Paths
205 urls URL Paths
206
206
207 Test extension help:
207 Test extension help:
208 $ hg help extensions --config extensions.rebase= --config extensions.children=
208 $ hg help extensions --config extensions.rebase= --config extensions.children=
209 Using Additional Features
209 Using Additional Features
210 """""""""""""""""""""""""
210 """""""""""""""""""""""""
211
211
212 Mercurial has the ability to add new features through the use of
212 Mercurial has the ability to add new features through the use of
213 extensions. Extensions may add new commands, add options to existing
213 extensions. Extensions may add new commands, add options to existing
214 commands, change the default behavior of commands, or implement hooks.
214 commands, change the default behavior of commands, or implement hooks.
215
215
216 To enable the "foo" extension, either shipped with Mercurial or in the
216 To enable the "foo" extension, either shipped with Mercurial or in the
217 Python search path, create an entry for it in your configuration file,
217 Python search path, create an entry for it in your configuration file,
218 like this:
218 like this:
219
219
220 [extensions]
220 [extensions]
221 foo =
221 foo =
222
222
223 You may also specify the full path to an extension:
223 You may also specify the full path to an extension:
224
224
225 [extensions]
225 [extensions]
226 myfeature = ~/.hgext/myfeature.py
226 myfeature = ~/.hgext/myfeature.py
227
227
228 See 'hg help config' for more information on configuration files.
228 See 'hg help config' for more information on configuration files.
229
229
230 Extensions are not loaded by default for a variety of reasons: they can
230 Extensions are not loaded by default for a variety of reasons: they can
231 increase startup overhead; they may be meant for advanced usage only; they
231 increase startup overhead; they may be meant for advanced usage only; they
232 may provide potentially dangerous abilities (such as letting you destroy
232 may provide potentially dangerous abilities (such as letting you destroy
233 or modify history); they might not be ready for prime time; or they may
233 or modify history); they might not be ready for prime time; or they may
234 alter some usual behaviors of stock Mercurial. It is thus up to the user
234 alter some usual behaviors of stock Mercurial. It is thus up to the user
235 to activate extensions as needed.
235 to activate extensions as needed.
236
236
237 To explicitly disable an extension enabled in a configuration file of
237 To explicitly disable an extension enabled in a configuration file of
238 broader scope, prepend its path with !:
238 broader scope, prepend its path with !:
239
239
240 [extensions]
240 [extensions]
241 # disabling extension bar residing in /path/to/extension/bar.py
241 # disabling extension bar residing in /path/to/extension/bar.py
242 bar = !/path/to/extension/bar.py
242 bar = !/path/to/extension/bar.py
243 # ditto, but no path was supplied for extension baz
243 # ditto, but no path was supplied for extension baz
244 baz = !
244 baz = !
245
245
246 enabled extensions:
246 enabled extensions:
247
247
248 children command to display child changesets (DEPRECATED)
248 children command to display child changesets (DEPRECATED)
249 rebase command to move sets of revisions to a different ancestor
249 rebase command to move sets of revisions to a different ancestor
250
250
251 disabled extensions:
251 disabled extensions:
252
252
253 acl hooks for controlling repository access
253 acl hooks for controlling repository access
254 blackbox log repository events to a blackbox for debugging
254 blackbox log repository events to a blackbox for debugging
255 bugzilla hooks for integrating with the Bugzilla bug tracker
255 bugzilla hooks for integrating with the Bugzilla bug tracker
256 censor erase file content at a given revision
256 censor erase file content at a given revision
257 churn command to display statistics about repository history
257 churn command to display statistics about repository history
258 clonebundles advertise pre-generated bundles to seed clones
258 clonebundles advertise pre-generated bundles to seed clones
259 convert import revisions from foreign VCS repositories into
259 convert import revisions from foreign VCS repositories into
260 Mercurial
260 Mercurial
261 eol automatically manage newlines in repository files
261 eol automatically manage newlines in repository files
262 extdiff command to allow external programs to compare revisions
262 extdiff command to allow external programs to compare revisions
263 factotum http authentication with factotum
263 factotum http authentication with factotum
264 githelp try mapping git commands to Mercurial commands
264 githelp try mapping git commands to Mercurial commands
265 gpg commands to sign and verify changesets
265 gpg commands to sign and verify changesets
266 hgk browse the repository in a graphical way
266 hgk browse the repository in a graphical way
267 highlight syntax highlighting for hgweb (requires Pygments)
267 highlight syntax highlighting for hgweb (requires Pygments)
268 histedit interactive history editing
268 histedit interactive history editing
269 keyword expand keywords in tracked files
269 keyword expand keywords in tracked files
270 largefiles track large binary files
270 largefiles track large binary files
271 mq manage a stack of patches
271 mq manage a stack of patches
272 notify hooks for sending email push notifications
272 notify hooks for sending email push notifications
273 patchbomb command to send changesets as (a series of) patch emails
273 patchbomb command to send changesets as (a series of) patch emails
274 purge command to delete untracked files from the working
274 purge command to delete untracked files from the working
275 directory
275 directory
276 relink recreates hardlinks between repository clones
276 relink recreates hardlinks between repository clones
277 remotenames showing remotebookmarks and remotebranches in UI
277 remotenames showing remotebookmarks and remotebranches in UI
278 schemes extend schemes with shortcuts to repository swarms
278 schemes extend schemes with shortcuts to repository swarms
279 share share a common history between several working directories
279 share share a common history between several working directories
280 shelve save and restore changes to the working directory
280 shelve save and restore changes to the working directory
281 strip strip changesets and their descendants from history
281 strip strip changesets and their descendants from history
282 transplant command to transplant changesets from another branch
282 transplant command to transplant changesets from another branch
283 win32mbcs allow the use of MBCS paths with problematic encodings
283 win32mbcs allow the use of MBCS paths with problematic encodings
284 zeroconf discover and advertise repositories on the local network
284 zeroconf discover and advertise repositories on the local network
285
285
286 Verify that deprecated extensions are included if --verbose:
286 Verify that deprecated extensions are included if --verbose:
287
287
288 $ hg -v help extensions | grep children
288 $ hg -v help extensions | grep children
289 children command to display child changesets (DEPRECATED)
289 children command to display child changesets (DEPRECATED)
290
290
291 Verify that extension keywords appear in help templates
291 Verify that extension keywords appear in help templates
292
292
293 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
293 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
294
294
295 Test short command list with verbose option
295 Test short command list with verbose option
296
296
297 $ hg -v help shortlist
297 $ hg -v help shortlist
298 Mercurial Distributed SCM
298 Mercurial Distributed SCM
299
299
300 basic commands:
300 basic commands:
301
301
302 add add the specified files on the next commit
302 add add the specified files on the next commit
303 annotate, blame
303 annotate, blame
304 show changeset information by line for each file
304 show changeset information by line for each file
305 clone make a copy of an existing repository
305 clone make a copy of an existing repository
306 commit, ci commit the specified files or all outstanding changes
306 commit, ci commit the specified files or all outstanding changes
307 diff diff repository (or selected files)
307 diff diff repository (or selected files)
308 export dump the header and diffs for one or more changesets
308 export dump the header and diffs for one or more changesets
309 forget forget the specified files on the next commit
309 forget forget the specified files on the next commit
310 init create a new repository in the given directory
310 init create a new repository in the given directory
311 log, history show revision history of entire repository or files
311 log, history show revision history of entire repository or files
312 merge merge another revision into working directory
312 merge merge another revision into working directory
313 pull pull changes from the specified source
313 pull pull changes from the specified source
314 push push changes to the specified destination
314 push push changes to the specified destination
315 remove, rm remove the specified files on the next commit
315 remove, rm remove the specified files on the next commit
316 serve start stand-alone webserver
316 serve start stand-alone webserver
317 status, st show changed files in the working directory
317 status, st show changed files in the working directory
318 summary, sum summarize working directory state
318 summary, sum summarize working directory state
319 update, up, checkout, co
319 update, up, checkout, co
320 update working directory (or switch revisions)
320 update working directory (or switch revisions)
321
321
322 global options ([+] can be repeated):
322 global options ([+] can be repeated):
323
323
324 -R --repository REPO repository root directory or name of overlay bundle
324 -R --repository REPO repository root directory or name of overlay bundle
325 file
325 file
326 --cwd DIR change working directory
326 --cwd DIR change working directory
327 -y --noninteractive do not prompt, automatically pick the first choice for
327 -y --noninteractive do not prompt, automatically pick the first choice for
328 all prompts
328 all prompts
329 -q --quiet suppress output
329 -q --quiet suppress output
330 -v --verbose enable additional output
330 -v --verbose enable additional output
331 --color TYPE when to colorize (boolean, always, auto, never, or
331 --color TYPE when to colorize (boolean, always, auto, never, or
332 debug)
332 debug)
333 --config CONFIG [+] set/override config option (use 'section.name=value')
333 --config CONFIG [+] set/override config option (use 'section.name=value')
334 --debug enable debugging output
334 --debug enable debugging output
335 --debugger start debugger
335 --debugger start debugger
336 --encoding ENCODE set the charset encoding (default: ascii)
336 --encoding ENCODE set the charset encoding (default: ascii)
337 --encodingmode MODE set the charset encoding mode (default: strict)
337 --encodingmode MODE set the charset encoding mode (default: strict)
338 --traceback always print a traceback on exception
338 --traceback always print a traceback on exception
339 --time time how long the command takes
339 --time time how long the command takes
340 --profile print command execution profile
340 --profile print command execution profile
341 --version output version information and exit
341 --version output version information and exit
342 -h --help display help and exit
342 -h --help display help and exit
343 --hidden consider hidden changesets
343 --hidden consider hidden changesets
344 --pager TYPE when to paginate (boolean, always, auto, or never)
344 --pager TYPE when to paginate (boolean, always, auto, or never)
345 (default: auto)
345 (default: auto)
346
346
347 (use 'hg help' for the full list of commands)
347 (use 'hg help' for the full list of commands)
348
348
349 $ hg add -h
349 $ hg add -h
350 hg add [OPTION]... [FILE]...
350 hg add [OPTION]... [FILE]...
351
351
352 add the specified files on the next commit
352 add the specified files on the next commit
353
353
354 Schedule files to be version controlled and added to the repository.
354 Schedule files to be version controlled and added to the repository.
355
355
356 The files will be added to the repository at the next commit. To undo an
356 The files will be added to the repository at the next commit. To undo an
357 add before that, see 'hg forget'.
357 add before that, see 'hg forget'.
358
358
359 If no names are given, add all files to the repository (except files
359 If no names are given, add all files to the repository (except files
360 matching ".hgignore").
360 matching ".hgignore").
361
361
362 Returns 0 if all files are successfully added.
362 Returns 0 if all files are successfully added.
363
363
364 options ([+] can be repeated):
364 options ([+] can be repeated):
365
365
366 -I --include PATTERN [+] include names matching the given patterns
366 -I --include PATTERN [+] include names matching the given patterns
367 -X --exclude PATTERN [+] exclude names matching the given patterns
367 -X --exclude PATTERN [+] exclude names matching the given patterns
368 -S --subrepos recurse into subrepositories
368 -S --subrepos recurse into subrepositories
369 -n --dry-run do not perform actions, just print output
369 -n --dry-run do not perform actions, just print output
370
370
371 (some details hidden, use --verbose to show complete help)
371 (some details hidden, use --verbose to show complete help)
372
372
373 Verbose help for add
373 Verbose help for add
374
374
375 $ hg add -hv
375 $ hg add -hv
376 hg add [OPTION]... [FILE]...
376 hg add [OPTION]... [FILE]...
377
377
378 add the specified files on the next commit
378 add the specified files on the next commit
379
379
380 Schedule files to be version controlled and added to the repository.
380 Schedule files to be version controlled and added to the repository.
381
381
382 The files will be added to the repository at the next commit. To undo an
382 The files will be added to the repository at the next commit. To undo an
383 add before that, see 'hg forget'.
383 add before that, see 'hg forget'.
384
384
385 If no names are given, add all files to the repository (except files
385 If no names are given, add all files to the repository (except files
386 matching ".hgignore").
386 matching ".hgignore").
387
387
388 Examples:
388 Examples:
389
389
390 - New (unknown) files are added automatically by 'hg add':
390 - New (unknown) files are added automatically by 'hg add':
391
391
392 $ ls
392 $ ls
393 foo.c
393 foo.c
394 $ hg status
394 $ hg status
395 ? foo.c
395 ? foo.c
396 $ hg add
396 $ hg add
397 adding foo.c
397 adding foo.c
398 $ hg status
398 $ hg status
399 A foo.c
399 A foo.c
400
400
401 - Specific files to be added can be specified:
401 - Specific files to be added can be specified:
402
402
403 $ ls
403 $ ls
404 bar.c foo.c
404 bar.c foo.c
405 $ hg status
405 $ hg status
406 ? bar.c
406 ? bar.c
407 ? foo.c
407 ? foo.c
408 $ hg add bar.c
408 $ hg add bar.c
409 $ hg status
409 $ hg status
410 A bar.c
410 A bar.c
411 ? foo.c
411 ? foo.c
412
412
413 Returns 0 if all files are successfully added.
413 Returns 0 if all files are successfully added.
414
414
415 options ([+] can be repeated):
415 options ([+] can be repeated):
416
416
417 -I --include PATTERN [+] include names matching the given patterns
417 -I --include PATTERN [+] include names matching the given patterns
418 -X --exclude PATTERN [+] exclude names matching the given patterns
418 -X --exclude PATTERN [+] exclude names matching the given patterns
419 -S --subrepos recurse into subrepositories
419 -S --subrepos recurse into subrepositories
420 -n --dry-run do not perform actions, just print output
420 -n --dry-run do not perform actions, just print output
421
421
422 global options ([+] can be repeated):
422 global options ([+] can be repeated):
423
423
424 -R --repository REPO repository root directory or name of overlay bundle
424 -R --repository REPO repository root directory or name of overlay bundle
425 file
425 file
426 --cwd DIR change working directory
426 --cwd DIR change working directory
427 -y --noninteractive do not prompt, automatically pick the first choice for
427 -y --noninteractive do not prompt, automatically pick the first choice for
428 all prompts
428 all prompts
429 -q --quiet suppress output
429 -q --quiet suppress output
430 -v --verbose enable additional output
430 -v --verbose enable additional output
431 --color TYPE when to colorize (boolean, always, auto, never, or
431 --color TYPE when to colorize (boolean, always, auto, never, or
432 debug)
432 debug)
433 --config CONFIG [+] set/override config option (use 'section.name=value')
433 --config CONFIG [+] set/override config option (use 'section.name=value')
434 --debug enable debugging output
434 --debug enable debugging output
435 --debugger start debugger
435 --debugger start debugger
436 --encoding ENCODE set the charset encoding (default: ascii)
436 --encoding ENCODE set the charset encoding (default: ascii)
437 --encodingmode MODE set the charset encoding mode (default: strict)
437 --encodingmode MODE set the charset encoding mode (default: strict)
438 --traceback always print a traceback on exception
438 --traceback always print a traceback on exception
439 --time time how long the command takes
439 --time time how long the command takes
440 --profile print command execution profile
440 --profile print command execution profile
441 --version output version information and exit
441 --version output version information and exit
442 -h --help display help and exit
442 -h --help display help and exit
443 --hidden consider hidden changesets
443 --hidden consider hidden changesets
444 --pager TYPE when to paginate (boolean, always, auto, or never)
444 --pager TYPE when to paginate (boolean, always, auto, or never)
445 (default: auto)
445 (default: auto)
446
446
447 Test the textwidth config option
447 Test the textwidth config option
448
448
449 $ hg root -h --config ui.textwidth=50
449 $ hg root -h --config ui.textwidth=50
450 hg root
450 hg root
451
451
452 print the root (top) of the current working
452 print the root (top) of the current working
453 directory
453 directory
454
454
455 Print the root directory of the current
455 Print the root directory of the current
456 repository.
456 repository.
457
457
458 Returns 0 on success.
458 Returns 0 on success.
459
459
460 (some details hidden, use --verbose to show
460 (some details hidden, use --verbose to show
461 complete help)
461 complete help)
462
462
463 Test help option with version option
463 Test help option with version option
464
464
465 $ hg add -h --version
465 $ hg add -h --version
466 Mercurial Distributed SCM (version *) (glob)
466 Mercurial Distributed SCM (version *) (glob)
467 (see https://mercurial-scm.org for more information)
467 (see https://mercurial-scm.org for more information)
468
468
469 Copyright (C) 2005-* Matt Mackall and others (glob)
469 Copyright (C) 2005-* Matt Mackall and others (glob)
470 This is free software; see the source for copying conditions. There is NO
470 This is free software; see the source for copying conditions. There is NO
471 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
471 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
472
472
473 $ hg add --skjdfks
473 $ hg add --skjdfks
474 hg add: option --skjdfks not recognized
474 hg add: option --skjdfks not recognized
475 hg add [OPTION]... [FILE]...
475 hg add [OPTION]... [FILE]...
476
476
477 add the specified files on the next commit
477 add the specified files on the next commit
478
478
479 options ([+] can be repeated):
479 options ([+] can be repeated):
480
480
481 -I --include PATTERN [+] include names matching the given patterns
481 -I --include PATTERN [+] include names matching the given patterns
482 -X --exclude PATTERN [+] exclude names matching the given patterns
482 -X --exclude PATTERN [+] exclude names matching the given patterns
483 -S --subrepos recurse into subrepositories
483 -S --subrepos recurse into subrepositories
484 -n --dry-run do not perform actions, just print output
484 -n --dry-run do not perform actions, just print output
485
485
486 (use 'hg add -h' to show more help)
486 (use 'hg add -h' to show more help)
487 [255]
487 [255]
488
488
489 Test ambiguous command help
489 Test ambiguous command help
490
490
491 $ hg help ad
491 $ hg help ad
492 list of commands:
492 list of commands:
493
493
494 add add the specified files on the next commit
494 add add the specified files on the next commit
495 addremove add all new files, delete all missing files
495 addremove add all new files, delete all missing files
496
496
497 (use 'hg help -v ad' to show built-in aliases and global options)
497 (use 'hg help -v ad' to show built-in aliases and global options)
498
498
499 Test command without options
499 Test command without options
500
500
501 $ hg help verify
501 $ hg help verify
502 hg verify
502 hg verify
503
503
504 verify the integrity of the repository
504 verify the integrity of the repository
505
505
506 Verify the integrity of the current repository.
506 Verify the integrity of the current repository.
507
507
508 This will perform an extensive check of the repository's integrity,
508 This will perform an extensive check of the repository's integrity,
509 validating the hashes and checksums of each entry in the changelog,
509 validating the hashes and checksums of each entry in the changelog,
510 manifest, and tracked files, as well as the integrity of their crosslinks
510 manifest, and tracked files, as well as the integrity of their crosslinks
511 and indices.
511 and indices.
512
512
513 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
513 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
514 information about recovery from corruption of the repository.
514 information about recovery from corruption of the repository.
515
515
516 Returns 0 on success, 1 if errors are encountered.
516 Returns 0 on success, 1 if errors are encountered.
517
517
518 (some details hidden, use --verbose to show complete help)
518 (some details hidden, use --verbose to show complete help)
519
519
520 $ hg help diff
520 $ hg help diff
521 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
521 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
522
522
523 diff repository (or selected files)
523 diff repository (or selected files)
524
524
525 Show differences between revisions for the specified files.
525 Show differences between revisions for the specified files.
526
526
527 Differences between files are shown using the unified diff format.
527 Differences between files are shown using the unified diff format.
528
528
529 Note:
529 Note:
530 'hg diff' may generate unexpected results for merges, as it will
530 'hg diff' may generate unexpected results for merges, as it will
531 default to comparing against the working directory's first parent
531 default to comparing against the working directory's first parent
532 changeset if no revisions are specified.
532 changeset if no revisions are specified.
533
533
534 When two revision arguments are given, then changes are shown between
534 When two revision arguments are given, then changes are shown between
535 those revisions. If only one revision is specified then that revision is
535 those revisions. If only one revision is specified then that revision is
536 compared to the working directory, and, when no revisions are specified,
536 compared to the working directory, and, when no revisions are specified,
537 the working directory files are compared to its first parent.
537 the working directory files are compared to its first parent.
538
538
539 Alternatively you can specify -c/--change with a revision to see the
539 Alternatively you can specify -c/--change with a revision to see the
540 changes in that changeset relative to its first parent.
540 changes in that changeset relative to its first parent.
541
541
542 Without the -a/--text option, diff will avoid generating diffs of files it
542 Without the -a/--text option, diff will avoid generating diffs of files it
543 detects as binary. With -a, diff will generate a diff anyway, probably
543 detects as binary. With -a, diff will generate a diff anyway, probably
544 with undesirable results.
544 with undesirable results.
545
545
546 Use the -g/--git option to generate diffs in the git extended diff format.
546 Use the -g/--git option to generate diffs in the git extended diff format.
547 For more information, read 'hg help diffs'.
547 For more information, read 'hg help diffs'.
548
548
549 Returns 0 on success.
549 Returns 0 on success.
550
550
551 options ([+] can be repeated):
551 options ([+] can be repeated):
552
552
553 -r --rev REV [+] revision
553 -r --rev REV [+] revision
554 -c --change REV change made by revision
554 -c --change REV change made by revision
555 -a --text treat all files as text
555 -a --text treat all files as text
556 -g --git use git extended diff format
556 -g --git use git extended diff format
557 --binary generate binary diffs in git mode (default)
557 --binary generate binary diffs in git mode (default)
558 --nodates omit dates from diff headers
558 --nodates omit dates from diff headers
559 --noprefix omit a/ and b/ prefixes from filenames
559 --noprefix omit a/ and b/ prefixes from filenames
560 -p --show-function show which function each change is in
560 -p --show-function show which function each change is in
561 --reverse produce a diff that undoes the changes
561 --reverse produce a diff that undoes the changes
562 -w --ignore-all-space ignore white space when comparing lines
562 -w --ignore-all-space ignore white space when comparing lines
563 -b --ignore-space-change ignore changes in the amount of white space
563 -b --ignore-space-change ignore changes in the amount of white space
564 -B --ignore-blank-lines ignore changes whose lines are all blank
564 -B --ignore-blank-lines ignore changes whose lines are all blank
565 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
565 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
566 -U --unified NUM number of lines of context to show
566 -U --unified NUM number of lines of context to show
567 --stat output diffstat-style summary of changes
567 --stat output diffstat-style summary of changes
568 --root DIR produce diffs relative to subdirectory
568 --root DIR produce diffs relative to subdirectory
569 -I --include PATTERN [+] include names matching the given patterns
569 -I --include PATTERN [+] include names matching the given patterns
570 -X --exclude PATTERN [+] exclude names matching the given patterns
570 -X --exclude PATTERN [+] exclude names matching the given patterns
571 -S --subrepos recurse into subrepositories
571 -S --subrepos recurse into subrepositories
572
572
573 (some details hidden, use --verbose to show complete help)
573 (some details hidden, use --verbose to show complete help)
574
574
575 $ hg help status
575 $ hg help status
576 hg status [OPTION]... [FILE]...
576 hg status [OPTION]... [FILE]...
577
577
578 aliases: st
578 aliases: st
579
579
580 show changed files in the working directory
580 show changed files in the working directory
581
581
582 Show status of files in the repository. If names are given, only files
582 Show status of files in the repository. If names are given, only files
583 that match are shown. Files that are clean or ignored or the source of a
583 that match are shown. Files that are clean or ignored or the source of a
584 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
584 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
585 -C/--copies or -A/--all are given. Unless options described with "show
585 -C/--copies or -A/--all are given. Unless options described with "show
586 only ..." are given, the options -mardu are used.
586 only ..." are given, the options -mardu are used.
587
587
588 Option -q/--quiet hides untracked (unknown and ignored) files unless
588 Option -q/--quiet hides untracked (unknown and ignored) files unless
589 explicitly requested with -u/--unknown or -i/--ignored.
589 explicitly requested with -u/--unknown or -i/--ignored.
590
590
591 Note:
591 Note:
592 'hg status' may appear to disagree with diff if permissions have
592 'hg status' may appear to disagree with diff if permissions have
593 changed or a merge has occurred. The standard diff format does not
593 changed or a merge has occurred. The standard diff format does not
594 report permission changes and diff only reports changes relative to one
594 report permission changes and diff only reports changes relative to one
595 merge parent.
595 merge parent.
596
596
597 If one revision is given, it is used as the base revision. If two
597 If one revision is given, it is used as the base revision. If two
598 revisions are given, the differences between them are shown. The --change
598 revisions are given, the differences between them are shown. The --change
599 option can also be used as a shortcut to list the changed files of a
599 option can also be used as a shortcut to list the changed files of a
600 revision from its first parent.
600 revision from its first parent.
601
601
602 The codes used to show the status of files are:
602 The codes used to show the status of files are:
603
603
604 M = modified
604 M = modified
605 A = added
605 A = added
606 R = removed
606 R = removed
607 C = clean
607 C = clean
608 ! = missing (deleted by non-hg command, but still tracked)
608 ! = missing (deleted by non-hg command, but still tracked)
609 ? = not tracked
609 ? = not tracked
610 I = ignored
610 I = ignored
611 = origin of the previous file (with --copies)
611 = origin of the previous file (with --copies)
612
612
613 Returns 0 on success.
613 Returns 0 on success.
614
614
615 options ([+] can be repeated):
615 options ([+] can be repeated):
616
616
617 -A --all show status of all files
617 -A --all show status of all files
618 -m --modified show only modified files
618 -m --modified show only modified files
619 -a --added show only added files
619 -a --added show only added files
620 -r --removed show only removed files
620 -r --removed show only removed files
621 -d --deleted show only deleted (but tracked) files
621 -d --deleted show only deleted (but tracked) files
622 -c --clean show only files without changes
622 -c --clean show only files without changes
623 -u --unknown show only unknown (not tracked) files
623 -u --unknown show only unknown (not tracked) files
624 -i --ignored show only ignored files
624 -i --ignored show only ignored files
625 -n --no-status hide status prefix
625 -n --no-status hide status prefix
626 -C --copies show source of copied files
626 -C --copies show source of copied files
627 -0 --print0 end filenames with NUL, for use with xargs
627 -0 --print0 end filenames with NUL, for use with xargs
628 --rev REV [+] show difference from revision
628 --rev REV [+] show difference from revision
629 --change REV list the changed files of a revision
629 --change REV list the changed files of a revision
630 -I --include PATTERN [+] include names matching the given patterns
630 -I --include PATTERN [+] include names matching the given patterns
631 -X --exclude PATTERN [+] exclude names matching the given patterns
631 -X --exclude PATTERN [+] exclude names matching the given patterns
632 -S --subrepos recurse into subrepositories
632 -S --subrepos recurse into subrepositories
633
633
634 (some details hidden, use --verbose to show complete help)
634 (some details hidden, use --verbose to show complete help)
635
635
636 $ hg -q help status
636 $ hg -q help status
637 hg status [OPTION]... [FILE]...
637 hg status [OPTION]... [FILE]...
638
638
639 show changed files in the working directory
639 show changed files in the working directory
640
640
641 $ hg help foo
641 $ hg help foo
642 abort: no such help topic: foo
642 abort: no such help topic: foo
643 (try 'hg help --keyword foo')
643 (try 'hg help --keyword foo')
644 [255]
644 [255]
645
645
646 $ hg skjdfks
646 $ hg skjdfks
647 hg: unknown command 'skjdfks'
647 hg: unknown command 'skjdfks'
648 Mercurial Distributed SCM
648 Mercurial Distributed SCM
649
649
650 basic commands:
650 basic commands:
651
651
652 add add the specified files on the next commit
652 add add the specified files on the next commit
653 annotate show changeset information by line for each file
653 annotate show changeset information by line for each file
654 clone make a copy of an existing repository
654 clone make a copy of an existing repository
655 commit commit the specified files or all outstanding changes
655 commit commit the specified files or all outstanding changes
656 diff diff repository (or selected files)
656 diff diff repository (or selected files)
657 export dump the header and diffs for one or more changesets
657 export dump the header and diffs for one or more changesets
658 forget forget the specified files on the next commit
658 forget forget the specified files on the next commit
659 init create a new repository in the given directory
659 init create a new repository in the given directory
660 log show revision history of entire repository or files
660 log show revision history of entire repository or files
661 merge merge another revision into working directory
661 merge merge another revision into working directory
662 pull pull changes from the specified source
662 pull pull changes from the specified source
663 push push changes to the specified destination
663 push push changes to the specified destination
664 remove remove the specified files on the next commit
664 remove remove the specified files on the next commit
665 serve start stand-alone webserver
665 serve start stand-alone webserver
666 status show changed files in the working directory
666 status show changed files in the working directory
667 summary summarize working directory state
667 summary summarize working directory state
668 update update working directory (or switch revisions)
668 update update working directory (or switch revisions)
669
669
670 (use 'hg help' for the full list of commands or 'hg -v' for details)
670 (use 'hg help' for the full list of commands or 'hg -v' for details)
671 [255]
671 [255]
672
672
673 Typoed command gives suggestion
673 Typoed command gives suggestion
674 $ hg puls
674 $ hg puls
675 hg: unknown command 'puls'
675 hg: unknown command 'puls'
676 (did you mean one of pull, push?)
676 (did you mean one of pull, push?)
677 [255]
677 [255]
678
678
679 Not enabled extension gets suggested
679 Not enabled extension gets suggested
680
680
681 $ hg rebase
681 $ hg rebase
682 hg: unknown command 'rebase'
682 hg: unknown command 'rebase'
683 'rebase' is provided by the following extension:
683 'rebase' is provided by the following extension:
684
684
685 rebase command to move sets of revisions to a different ancestor
685 rebase command to move sets of revisions to a different ancestor
686
686
687 (use 'hg help extensions' for information on enabling extensions)
687 (use 'hg help extensions' for information on enabling extensions)
688 [255]
688 [255]
689
689
690 Disabled extension gets suggested
690 Disabled extension gets suggested
691 $ hg --config extensions.rebase=! rebase
691 $ hg --config extensions.rebase=! rebase
692 hg: unknown command 'rebase'
692 hg: unknown command 'rebase'
693 'rebase' is provided by the following extension:
693 'rebase' is provided by the following extension:
694
694
695 rebase command to move sets of revisions to a different ancestor
695 rebase command to move sets of revisions to a different ancestor
696
696
697 (use 'hg help extensions' for information on enabling extensions)
697 (use 'hg help extensions' for information on enabling extensions)
698 [255]
698 [255]
699
699
700 Make sure that we don't run afoul of the help system thinking that
700 Make sure that we don't run afoul of the help system thinking that
701 this is a section and erroring out weirdly.
701 this is a section and erroring out weirdly.
702
702
703 $ hg .log
703 $ hg .log
704 hg: unknown command '.log'
704 hg: unknown command '.log'
705 (did you mean log?)
705 (did you mean log?)
706 [255]
706 [255]
707
707
708 $ hg log.
708 $ hg log.
709 hg: unknown command 'log.'
709 hg: unknown command 'log.'
710 (did you mean log?)
710 (did you mean log?)
711 [255]
711 [255]
712 $ hg pu.lh
712 $ hg pu.lh
713 hg: unknown command 'pu.lh'
713 hg: unknown command 'pu.lh'
714 (did you mean one of pull, push?)
714 (did you mean one of pull, push?)
715 [255]
715 [255]
716
716
717 $ cat > helpext.py <<EOF
717 $ cat > helpext.py <<EOF
718 > import os
718 > import os
719 > from mercurial import commands, registrar
719 > from mercurial import commands, registrar
720 >
720 >
721 > cmdtable = {}
721 > cmdtable = {}
722 > command = registrar.command(cmdtable)
722 > command = registrar.command(cmdtable)
723 >
723 >
724 > @command(b'nohelp',
724 > @command(b'nohelp',
725 > [(b'', b'longdesc', 3, b'x'*90),
725 > [(b'', b'longdesc', 3, b'x'*90),
726 > (b'n', b'', None, b'normal desc'),
726 > (b'n', b'', None, b'normal desc'),
727 > (b'', b'newline', b'', b'line1\nline2')],
727 > (b'', b'newline', b'', b'line1\nline2')],
728 > b'hg nohelp',
728 > b'hg nohelp',
729 > norepo=True)
729 > norepo=True)
730 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
730 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
731 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
731 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
732 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
732 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
733 > def nohelp(ui, *args, **kwargs):
733 > def nohelp(ui, *args, **kwargs):
734 > pass
734 > pass
735 >
735 >
736 > def uisetup(ui):
736 > def uisetup(ui):
737 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
737 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
738 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
738 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
739 >
739 >
740 > EOF
740 > EOF
741 $ echo '[extensions]' >> $HGRCPATH
741 $ echo '[extensions]' >> $HGRCPATH
742 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
742 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
743
743
744 Test for aliases
744 Test for aliases
745
745
746 $ hg help hgalias
746 $ hg help hgalias
747 hg hgalias [--remote]
747 hg hgalias [--remote]
748
748
749 alias for: hg summary
749 alias for: hg summary
750
750
751 summarize working directory state
751 summarize working directory state
752
752
753 This generates a brief summary of the working directory state, including
753 This generates a brief summary of the working directory state, including
754 parents, branch, commit status, phase and available updates.
754 parents, branch, commit status, phase and available updates.
755
755
756 With the --remote option, this will check the default paths for incoming
756 With the --remote option, this will check the default paths for incoming
757 and outgoing changes. This can be time-consuming.
757 and outgoing changes. This can be time-consuming.
758
758
759 Returns 0 on success.
759 Returns 0 on success.
760
760
761 defined by: helpext
761 defined by: helpext
762
762
763 options:
763 options:
764
764
765 --remote check for push and pull
765 --remote check for push and pull
766
766
767 (some details hidden, use --verbose to show complete help)
767 (some details hidden, use --verbose to show complete help)
768
768
769 $ hg help shellalias
769 $ hg help shellalias
770 hg shellalias
770 hg shellalias
771
771
772 shell alias for:
772 shell alias for:
773
773
774 echo hi
774 echo hi
775
775
776 defined by: helpext
776 defined by: helpext
777
777
778 (some details hidden, use --verbose to show complete help)
778 (some details hidden, use --verbose to show complete help)
779
779
780 Test command with no help text
780 Test command with no help text
781
781
782 $ hg help nohelp
782 $ hg help nohelp
783 hg nohelp
783 hg nohelp
784
784
785 (no help text available)
785 (no help text available)
786
786
787 options:
787 options:
788
788
789 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
789 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
790 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
790 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
791 -n -- normal desc
791 -n -- normal desc
792 --newline VALUE line1 line2
792 --newline VALUE line1 line2
793
793
794 (some details hidden, use --verbose to show complete help)
794 (some details hidden, use --verbose to show complete help)
795
795
796 $ hg help -k nohelp
796 $ hg help -k nohelp
797 Commands:
797 Commands:
798
798
799 nohelp hg nohelp
799 nohelp hg nohelp
800
800
801 Extension Commands:
801 Extension Commands:
802
802
803 nohelp (no help text available)
803 nohelp (no help text available)
804
804
805 Test that default list of commands omits extension commands
805 Test that default list of commands omits extension commands
806
806
807 $ hg help
807 $ hg help
808 Mercurial Distributed SCM
808 Mercurial Distributed SCM
809
809
810 list of commands:
810 list of commands:
811
811
812 add add the specified files on the next commit
812 add add the specified files on the next commit
813 addremove add all new files, delete all missing files
813 addremove add all new files, delete all missing files
814 annotate show changeset information by line for each file
814 annotate show changeset information by line for each file
815 archive create an unversioned archive of a repository revision
815 archive create an unversioned archive of a repository revision
816 backout reverse effect of earlier changeset
816 backout reverse effect of earlier changeset
817 bisect subdivision search of changesets
817 bisect subdivision search of changesets
818 bookmarks create a new bookmark or list existing bookmarks
818 bookmarks create a new bookmark or list existing bookmarks
819 branch set or show the current branch name
819 branch set or show the current branch name
820 branches list repository named branches
820 branches list repository named branches
821 bundle create a bundle file
821 bundle create a bundle file
822 cat output the current or given revision of files
822 cat output the current or given revision of files
823 clone make a copy of an existing repository
823 clone make a copy of an existing repository
824 commit commit the specified files or all outstanding changes
824 commit commit the specified files or all outstanding changes
825 config show combined config settings from all hgrc files
825 config show combined config settings from all hgrc files
826 copy mark files as copied for the next commit
826 copy mark files as copied for the next commit
827 diff diff repository (or selected files)
827 diff diff repository (or selected files)
828 export dump the header and diffs for one or more changesets
828 export dump the header and diffs for one or more changesets
829 files list tracked files
829 files list tracked files
830 forget forget the specified files on the next commit
830 forget forget the specified files on the next commit
831 graft copy changes from other branches onto the current branch
831 graft copy changes from other branches onto the current branch
832 grep search revision history for a pattern in specified files
832 grep search revision history for a pattern in specified files
833 heads show branch heads
833 heads show branch heads
834 help show help for a given topic or a help overview
834 help show help for a given topic or a help overview
835 identify identify the working directory or specified revision
835 identify identify the working directory or specified revision
836 import import an ordered set of patches
836 import import an ordered set of patches
837 incoming show new changesets found in source
837 incoming show new changesets found in source
838 init create a new repository in the given directory
838 init create a new repository in the given directory
839 log show revision history of entire repository or files
839 log show revision history of entire repository or files
840 manifest output the current or given revision of the project manifest
840 manifest output the current or given revision of the project manifest
841 merge merge another revision into working directory
841 merge merge another revision into working directory
842 outgoing show changesets not found in the destination
842 outgoing show changesets not found in the destination
843 paths show aliases for remote repositories
843 paths show aliases for remote repositories
844 phase set or show the current phase name
844 phase set or show the current phase name
845 pull pull changes from the specified source
845 pull pull changes from the specified source
846 push push changes to the specified destination
846 push push changes to the specified destination
847 recover roll back an interrupted transaction
847 recover roll back an interrupted transaction
848 remove remove the specified files on the next commit
848 remove remove the specified files on the next commit
849 rename rename files; equivalent of copy + remove
849 rename rename files; equivalent of copy + remove
850 resolve redo merges or set/view the merge status of files
850 resolve redo merges or set/view the merge status of files
851 revert restore files to their checkout state
851 revert restore files to their checkout state
852 root print the root (top) of the current working directory
852 root print the root (top) of the current working directory
853 serve start stand-alone webserver
853 serve start stand-alone webserver
854 status show changed files in the working directory
854 status show changed files in the working directory
855 summary summarize working directory state
855 summary summarize working directory state
856 tag add one or more tags for the current or given revision
856 tag add one or more tags for the current or given revision
857 tags list repository tags
857 tags list repository tags
858 unbundle apply one or more bundle files
858 unbundle apply one or more bundle files
859 update update working directory (or switch revisions)
859 update update working directory (or switch revisions)
860 verify verify the integrity of the repository
860 verify verify the integrity of the repository
861 version output version and copyright information
861 version output version and copyright information
862
862
863 enabled extensions:
863 enabled extensions:
864
864
865 helpext (no help text available)
865 helpext (no help text available)
866
866
867 additional help topics:
867 additional help topics:
868
868
869 bundlespec Bundle File Formats
869 bundlespec Bundle File Formats
870 color Colorizing Outputs
870 color Colorizing Outputs
871 config Configuration Files
871 config Configuration Files
872 dates Date Formats
872 dates Date Formats
873 diffs Diff Formats
873 diffs Diff Formats
874 environment Environment Variables
874 environment Environment Variables
875 extensions Using Additional Features
875 extensions Using Additional Features
876 filesets Specifying File Sets
876 filesets Specifying File Sets
877 flags Command-line flags
877 flags Command-line flags
878 glossary Glossary
878 glossary Glossary
879 hgignore Syntax for Mercurial Ignore Files
879 hgignore Syntax for Mercurial Ignore Files
880 hgweb Configuring hgweb
880 hgweb Configuring hgweb
881 internals Technical implementation topics
881 internals Technical implementation topics
882 merge-tools Merge Tools
882 merge-tools Merge Tools
883 pager Pager Support
883 pager Pager Support
884 patterns File Name Patterns
884 patterns File Name Patterns
885 phases Working with Phases
885 phases Working with Phases
886 revisions Specifying Revisions
886 revisions Specifying Revisions
887 scripting Using Mercurial from scripts and automation
887 scripting Using Mercurial from scripts and automation
888 subrepos Subrepositories
888 subrepos Subrepositories
889 templating Template Usage
889 templating Template Usage
890 urls URL Paths
890 urls URL Paths
891
891
892 (use 'hg help -v' to show built-in aliases and global options)
892 (use 'hg help -v' to show built-in aliases and global options)
893
893
894
894
895 Test list of internal help commands
895 Test list of internal help commands
896
896
897 $ hg help debug
897 $ hg help debug
898 debug commands (internal and unsupported):
898 debug commands (internal and unsupported):
899
899
900 debugancestor
900 debugancestor
901 find the ancestor revision of two revisions in a given index
901 find the ancestor revision of two revisions in a given index
902 debugapplystreamclonebundle
902 debugapplystreamclonebundle
903 apply a stream clone bundle file
903 apply a stream clone bundle file
904 debugbuilddag
904 debugbuilddag
905 builds a repo with a given DAG from scratch in the current
905 builds a repo with a given DAG from scratch in the current
906 empty repo
906 empty repo
907 debugbundle lists the contents of a bundle
907 debugbundle lists the contents of a bundle
908 debugcapabilities
908 debugcapabilities
909 lists the capabilities of a remote peer
909 lists the capabilities of a remote peer
910 debugcheckstate
910 debugcheckstate
911 validate the correctness of the current dirstate
911 validate the correctness of the current dirstate
912 debugcolor show available color, effects or style
912 debugcolor show available color, effects or style
913 debugcommands
913 debugcommands
914 list all available commands and options
914 list all available commands and options
915 debugcomplete
915 debugcomplete
916 returns the completion list associated with the given command
916 returns the completion list associated with the given command
917 debugcreatestreamclonebundle
917 debugcreatestreamclonebundle
918 create a stream clone bundle file
918 create a stream clone bundle file
919 debugdag format the changelog or an index DAG as a concise textual
919 debugdag format the changelog or an index DAG as a concise textual
920 description
920 description
921 debugdata dump the contents of a data file revision
921 debugdata dump the contents of a data file revision
922 debugdate parse and display a date
922 debugdate parse and display a date
923 debugdeltachain
923 debugdeltachain
924 dump information about delta chains in a revlog
924 dump information about delta chains in a revlog
925 debugdirstate
925 debugdirstate
926 show the contents of the current dirstate
926 show the contents of the current dirstate
927 debugdiscovery
927 debugdiscovery
928 runs the changeset discovery protocol in isolation
928 runs the changeset discovery protocol in isolation
929 debugdownload
929 debugdownload
930 download a resource using Mercurial logic and config
930 download a resource using Mercurial logic and config
931 debugextensions
931 debugextensions
932 show information about active extensions
932 show information about active extensions
933 debugfileset parse and apply a fileset specification
933 debugfileset parse and apply a fileset specification
934 debugformat display format information about the current repository
934 debugformat display format information about the current repository
935 debugfsinfo show information detected about current filesystem
935 debugfsinfo show information detected about current filesystem
936 debuggetbundle
936 debuggetbundle
937 retrieves a bundle from a repo
937 retrieves a bundle from a repo
938 debugignore display the combined ignore pattern and information about
938 debugignore display the combined ignore pattern and information about
939 ignored files
939 ignored files
940 debugindex dump the contents of an index file
940 debugindex dump the contents of an index file
941 debugindexdot
941 debugindexdot
942 dump an index DAG as a graphviz dot file
942 dump an index DAG as a graphviz dot file
943 debuginstall test Mercurial installation
943 debuginstall test Mercurial installation
944 debugknown test whether node ids are known to a repo
944 debugknown test whether node ids are known to a repo
945 debuglocks show or modify state of locks
945 debuglocks show or modify state of locks
946 debugmergestate
946 debugmergestate
947 print merge state
947 print merge state
948 debugnamecomplete
948 debugnamecomplete
949 complete "names" - tags, open branch names, bookmark names
949 complete "names" - tags, open branch names, bookmark names
950 debugobsolete
950 debugobsolete
951 create arbitrary obsolete marker
951 create arbitrary obsolete marker
952 debugoptADV (no help text available)
952 debugoptADV (no help text available)
953 debugoptDEP (no help text available)
953 debugoptDEP (no help text available)
954 debugoptEXP (no help text available)
954 debugoptEXP (no help text available)
955 debugpathcomplete
955 debugpathcomplete
956 complete part or all of a tracked path
956 complete part or all of a tracked path
957 debugpeer establish a connection to a peer repository
957 debugpeer establish a connection to a peer repository
958 debugpickmergetool
958 debugpickmergetool
959 examine which merge tool is chosen for specified file
959 examine which merge tool is chosen for specified file
960 debugpushkey access the pushkey key/value protocol
960 debugpushkey access the pushkey key/value protocol
961 debugpvec (no help text available)
961 debugpvec (no help text available)
962 debugrebuilddirstate
962 debugrebuilddirstate
963 rebuild the dirstate as it would look like for the given
963 rebuild the dirstate as it would look like for the given
964 revision
964 revision
965 debugrebuildfncache
965 debugrebuildfncache
966 rebuild the fncache file
966 rebuild the fncache file
967 debugrename dump rename information
967 debugrename dump rename information
968 debugrevlog show data and statistics about a revlog
968 debugrevlog show data and statistics about a revlog
969 debugrevspec parse and apply a revision specification
969 debugrevspec parse and apply a revision specification
970 debugserve run a server with advanced settings
970 debugsetparents
971 debugsetparents
971 manually set the parents of the current working directory
972 manually set the parents of the current working directory
972 debugssl test a secure connection to a server
973 debugssl test a secure connection to a server
973 debugsub (no help text available)
974 debugsub (no help text available)
974 debugsuccessorssets
975 debugsuccessorssets
975 show set of successors for revision
976 show set of successors for revision
976 debugtemplate
977 debugtemplate
977 parse and apply a template
978 parse and apply a template
978 debugupdatecaches
979 debugupdatecaches
979 warm all known caches in the repository
980 warm all known caches in the repository
980 debugupgraderepo
981 debugupgraderepo
981 upgrade a repository to use different features
982 upgrade a repository to use different features
982 debugwalk show how files match on given patterns
983 debugwalk show how files match on given patterns
983 debugwireargs
984 debugwireargs
984 (no help text available)
985 (no help text available)
985
986
986 (use 'hg help -v debug' to show built-in aliases and global options)
987 (use 'hg help -v debug' to show built-in aliases and global options)
987
988
988 internals topic renders index of available sub-topics
989 internals topic renders index of available sub-topics
989
990
990 $ hg help internals
991 $ hg help internals
991 Technical implementation topics
992 Technical implementation topics
992 """""""""""""""""""""""""""""""
993 """""""""""""""""""""""""""""""
993
994
994 To access a subtopic, use "hg help internals.{subtopic-name}"
995 To access a subtopic, use "hg help internals.{subtopic-name}"
995
996
996 bundle2 Bundle2
997 bundle2 Bundle2
997 bundles Bundles
998 bundles Bundles
998 censor Censor
999 censor Censor
999 changegroups Changegroups
1000 changegroups Changegroups
1000 config Config Registrar
1001 config Config Registrar
1001 requirements Repository Requirements
1002 requirements Repository Requirements
1002 revlogs Revision Logs
1003 revlogs Revision Logs
1003 wireprotocol Wire Protocol
1004 wireprotocol Wire Protocol
1004
1005
1005 sub-topics can be accessed
1006 sub-topics can be accessed
1006
1007
1007 $ hg help internals.changegroups
1008 $ hg help internals.changegroups
1008 Changegroups
1009 Changegroups
1009 """"""""""""
1010 """"""""""""
1010
1011
1011 Changegroups are representations of repository revlog data, specifically
1012 Changegroups are representations of repository revlog data, specifically
1012 the changelog data, root/flat manifest data, treemanifest data, and
1013 the changelog data, root/flat manifest data, treemanifest data, and
1013 filelogs.
1014 filelogs.
1014
1015
1015 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1016 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1016 level, versions "1" and "2" are almost exactly the same, with the only
1017 level, versions "1" and "2" are almost exactly the same, with the only
1017 difference being an additional item in the *delta header*. Version "3"
1018 difference being an additional item in the *delta header*. Version "3"
1018 adds support for revlog flags in the *delta header* and optionally
1019 adds support for revlog flags in the *delta header* and optionally
1019 exchanging treemanifests (enabled by setting an option on the
1020 exchanging treemanifests (enabled by setting an option on the
1020 "changegroup" part in the bundle2).
1021 "changegroup" part in the bundle2).
1021
1022
1022 Changegroups when not exchanging treemanifests consist of 3 logical
1023 Changegroups when not exchanging treemanifests consist of 3 logical
1023 segments:
1024 segments:
1024
1025
1025 +---------------------------------+
1026 +---------------------------------+
1026 | | | |
1027 | | | |
1027 | changeset | manifest | filelogs |
1028 | changeset | manifest | filelogs |
1028 | | | |
1029 | | | |
1029 | | | |
1030 | | | |
1030 +---------------------------------+
1031 +---------------------------------+
1031
1032
1032 When exchanging treemanifests, there are 4 logical segments:
1033 When exchanging treemanifests, there are 4 logical segments:
1033
1034
1034 +-------------------------------------------------+
1035 +-------------------------------------------------+
1035 | | | | |
1036 | | | | |
1036 | changeset | root | treemanifests | filelogs |
1037 | changeset | root | treemanifests | filelogs |
1037 | | manifest | | |
1038 | | manifest | | |
1038 | | | | |
1039 | | | | |
1039 +-------------------------------------------------+
1040 +-------------------------------------------------+
1040
1041
1041 The principle building block of each segment is a *chunk*. A *chunk* is a
1042 The principle building block of each segment is a *chunk*. A *chunk* is a
1042 framed piece of data:
1043 framed piece of data:
1043
1044
1044 +---------------------------------------+
1045 +---------------------------------------+
1045 | | |
1046 | | |
1046 | length | data |
1047 | length | data |
1047 | (4 bytes) | (<length - 4> bytes) |
1048 | (4 bytes) | (<length - 4> bytes) |
1048 | | |
1049 | | |
1049 +---------------------------------------+
1050 +---------------------------------------+
1050
1051
1051 All integers are big-endian signed integers. Each chunk starts with a
1052 All integers are big-endian signed integers. Each chunk starts with a
1052 32-bit integer indicating the length of the entire chunk (including the
1053 32-bit integer indicating the length of the entire chunk (including the
1053 length field itself).
1054 length field itself).
1054
1055
1055 There is a special case chunk that has a value of 0 for the length
1056 There is a special case chunk that has a value of 0 for the length
1056 ("0x00000000"). We call this an *empty chunk*.
1057 ("0x00000000"). We call this an *empty chunk*.
1057
1058
1058 Delta Groups
1059 Delta Groups
1059 ============
1060 ============
1060
1061
1061 A *delta group* expresses the content of a revlog as a series of deltas,
1062 A *delta group* expresses the content of a revlog as a series of deltas,
1062 or patches against previous revisions.
1063 or patches against previous revisions.
1063
1064
1064 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1065 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1065 to signal the end of the delta group:
1066 to signal the end of the delta group:
1066
1067
1067 +------------------------------------------------------------------------+
1068 +------------------------------------------------------------------------+
1068 | | | | | |
1069 | | | | | |
1069 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1070 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1070 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1071 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1071 | | | | | |
1072 | | | | | |
1072 +------------------------------------------------------------------------+
1073 +------------------------------------------------------------------------+
1073
1074
1074 Each *chunk*'s data consists of the following:
1075 Each *chunk*'s data consists of the following:
1075
1076
1076 +---------------------------------------+
1077 +---------------------------------------+
1077 | | |
1078 | | |
1078 | delta header | delta data |
1079 | delta header | delta data |
1079 | (various by version) | (various) |
1080 | (various by version) | (various) |
1080 | | |
1081 | | |
1081 +---------------------------------------+
1082 +---------------------------------------+
1082
1083
1083 The *delta data* is a series of *delta*s that describe a diff from an
1084 The *delta data* is a series of *delta*s that describe a diff from an
1084 existing entry (either that the recipient already has, or previously
1085 existing entry (either that the recipient already has, or previously
1085 specified in the bundle/changegroup).
1086 specified in the bundle/changegroup).
1086
1087
1087 The *delta header* is different between versions "1", "2", and "3" of the
1088 The *delta header* is different between versions "1", "2", and "3" of the
1088 changegroup format.
1089 changegroup format.
1089
1090
1090 Version 1 (headerlen=80):
1091 Version 1 (headerlen=80):
1091
1092
1092 +------------------------------------------------------+
1093 +------------------------------------------------------+
1093 | | | | |
1094 | | | | |
1094 | node | p1 node | p2 node | link node |
1095 | node | p1 node | p2 node | link node |
1095 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1096 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1096 | | | | |
1097 | | | | |
1097 +------------------------------------------------------+
1098 +------------------------------------------------------+
1098
1099
1099 Version 2 (headerlen=100):
1100 Version 2 (headerlen=100):
1100
1101
1101 +------------------------------------------------------------------+
1102 +------------------------------------------------------------------+
1102 | | | | | |
1103 | | | | | |
1103 | node | p1 node | p2 node | base node | link node |
1104 | node | p1 node | p2 node | base node | link node |
1104 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1105 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1105 | | | | | |
1106 | | | | | |
1106 +------------------------------------------------------------------+
1107 +------------------------------------------------------------------+
1107
1108
1108 Version 3 (headerlen=102):
1109 Version 3 (headerlen=102):
1109
1110
1110 +------------------------------------------------------------------------------+
1111 +------------------------------------------------------------------------------+
1111 | | | | | | |
1112 | | | | | | |
1112 | node | p1 node | p2 node | base node | link node | flags |
1113 | node | p1 node | p2 node | base node | link node | flags |
1113 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1114 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1114 | | | | | | |
1115 | | | | | | |
1115 +------------------------------------------------------------------------------+
1116 +------------------------------------------------------------------------------+
1116
1117
1117 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1118 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1118 contain a series of *delta*s, densely packed (no separators). These deltas
1119 contain a series of *delta*s, densely packed (no separators). These deltas
1119 describe a diff from an existing entry (either that the recipient already
1120 describe a diff from an existing entry (either that the recipient already
1120 has, or previously specified in the bundle/changegroup). The format is
1121 has, or previously specified in the bundle/changegroup). The format is
1121 described more fully in "hg help internals.bdiff", but briefly:
1122 described more fully in "hg help internals.bdiff", but briefly:
1122
1123
1123 +---------------------------------------------------------------+
1124 +---------------------------------------------------------------+
1124 | | | | |
1125 | | | | |
1125 | start offset | end offset | new length | content |
1126 | start offset | end offset | new length | content |
1126 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1127 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1127 | | | | |
1128 | | | | |
1128 +---------------------------------------------------------------+
1129 +---------------------------------------------------------------+
1129
1130
1130 Please note that the length field in the delta data does *not* include
1131 Please note that the length field in the delta data does *not* include
1131 itself.
1132 itself.
1132
1133
1133 In version 1, the delta is always applied against the previous node from
1134 In version 1, the delta is always applied against the previous node from
1134 the changegroup or the first parent if this is the first entry in the
1135 the changegroup or the first parent if this is the first entry in the
1135 changegroup.
1136 changegroup.
1136
1137
1137 In version 2 and up, the delta base node is encoded in the entry in the
1138 In version 2 and up, the delta base node is encoded in the entry in the
1138 changegroup. This allows the delta to be expressed against any parent,
1139 changegroup. This allows the delta to be expressed against any parent,
1139 which can result in smaller deltas and more efficient encoding of data.
1140 which can result in smaller deltas and more efficient encoding of data.
1140
1141
1141 Changeset Segment
1142 Changeset Segment
1142 =================
1143 =================
1143
1144
1144 The *changeset segment* consists of a single *delta group* holding
1145 The *changeset segment* consists of a single *delta group* holding
1145 changelog data. The *empty chunk* at the end of the *delta group* denotes
1146 changelog data. The *empty chunk* at the end of the *delta group* denotes
1146 the boundary to the *manifest segment*.
1147 the boundary to the *manifest segment*.
1147
1148
1148 Manifest Segment
1149 Manifest Segment
1149 ================
1150 ================
1150
1151
1151 The *manifest segment* consists of a single *delta group* holding manifest
1152 The *manifest segment* consists of a single *delta group* holding manifest
1152 data. If treemanifests are in use, it contains only the manifest for the
1153 data. If treemanifests are in use, it contains only the manifest for the
1153 root directory of the repository. Otherwise, it contains the entire
1154 root directory of the repository. Otherwise, it contains the entire
1154 manifest data. The *empty chunk* at the end of the *delta group* denotes
1155 manifest data. The *empty chunk* at the end of the *delta group* denotes
1155 the boundary to the next segment (either the *treemanifests segment* or
1156 the boundary to the next segment (either the *treemanifests segment* or
1156 the *filelogs segment*, depending on version and the request options).
1157 the *filelogs segment*, depending on version and the request options).
1157
1158
1158 Treemanifests Segment
1159 Treemanifests Segment
1159 ---------------------
1160 ---------------------
1160
1161
1161 The *treemanifests segment* only exists in changegroup version "3", and
1162 The *treemanifests segment* only exists in changegroup version "3", and
1162 only if the 'treemanifest' param is part of the bundle2 changegroup part
1163 only if the 'treemanifest' param is part of the bundle2 changegroup part
1163 (it is not possible to use changegroup version 3 outside of bundle2).
1164 (it is not possible to use changegroup version 3 outside of bundle2).
1164 Aside from the filenames in the *treemanifests segment* containing a
1165 Aside from the filenames in the *treemanifests segment* containing a
1165 trailing "/" character, it behaves identically to the *filelogs segment*
1166 trailing "/" character, it behaves identically to the *filelogs segment*
1166 (see below). The final sub-segment is followed by an *empty chunk*
1167 (see below). The final sub-segment is followed by an *empty chunk*
1167 (logically, a sub-segment with filename size 0). This denotes the boundary
1168 (logically, a sub-segment with filename size 0). This denotes the boundary
1168 to the *filelogs segment*.
1169 to the *filelogs segment*.
1169
1170
1170 Filelogs Segment
1171 Filelogs Segment
1171 ================
1172 ================
1172
1173
1173 The *filelogs segment* consists of multiple sub-segments, each
1174 The *filelogs segment* consists of multiple sub-segments, each
1174 corresponding to an individual file whose data is being described:
1175 corresponding to an individual file whose data is being described:
1175
1176
1176 +--------------------------------------------------+
1177 +--------------------------------------------------+
1177 | | | | | |
1178 | | | | | |
1178 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1179 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1179 | | | | | (4 bytes) |
1180 | | | | | (4 bytes) |
1180 | | | | | |
1181 | | | | | |
1181 +--------------------------------------------------+
1182 +--------------------------------------------------+
1182
1183
1183 The final filelog sub-segment is followed by an *empty chunk* (logically,
1184 The final filelog sub-segment is followed by an *empty chunk* (logically,
1184 a sub-segment with filename size 0). This denotes the end of the segment
1185 a sub-segment with filename size 0). This denotes the end of the segment
1185 and of the overall changegroup.
1186 and of the overall changegroup.
1186
1187
1187 Each filelog sub-segment consists of the following:
1188 Each filelog sub-segment consists of the following:
1188
1189
1189 +------------------------------------------------------+
1190 +------------------------------------------------------+
1190 | | | |
1191 | | | |
1191 | filename length | filename | delta group |
1192 | filename length | filename | delta group |
1192 | (4 bytes) | (<length - 4> bytes) | (various) |
1193 | (4 bytes) | (<length - 4> bytes) | (various) |
1193 | | | |
1194 | | | |
1194 +------------------------------------------------------+
1195 +------------------------------------------------------+
1195
1196
1196 That is, a *chunk* consisting of the filename (not terminated or padded)
1197 That is, a *chunk* consisting of the filename (not terminated or padded)
1197 followed by N chunks constituting the *delta group* for this file. The
1198 followed by N chunks constituting the *delta group* for this file. The
1198 *empty chunk* at the end of each *delta group* denotes the boundary to the
1199 *empty chunk* at the end of each *delta group* denotes the boundary to the
1199 next filelog sub-segment.
1200 next filelog sub-segment.
1200
1201
1201 Test list of commands with command with no help text
1202 Test list of commands with command with no help text
1202
1203
1203 $ hg help helpext
1204 $ hg help helpext
1204 helpext extension - no help text available
1205 helpext extension - no help text available
1205
1206
1206 list of commands:
1207 list of commands:
1207
1208
1208 nohelp (no help text available)
1209 nohelp (no help text available)
1209
1210
1210 (use 'hg help -v helpext' to show built-in aliases and global options)
1211 (use 'hg help -v helpext' to show built-in aliases and global options)
1211
1212
1212
1213
1213 test advanced, deprecated and experimental options are hidden in command help
1214 test advanced, deprecated and experimental options are hidden in command help
1214 $ hg help debugoptADV
1215 $ hg help debugoptADV
1215 hg debugoptADV
1216 hg debugoptADV
1216
1217
1217 (no help text available)
1218 (no help text available)
1218
1219
1219 options:
1220 options:
1220
1221
1221 (some details hidden, use --verbose to show complete help)
1222 (some details hidden, use --verbose to show complete help)
1222 $ hg help debugoptDEP
1223 $ hg help debugoptDEP
1223 hg debugoptDEP
1224 hg debugoptDEP
1224
1225
1225 (no help text available)
1226 (no help text available)
1226
1227
1227 options:
1228 options:
1228
1229
1229 (some details hidden, use --verbose to show complete help)
1230 (some details hidden, use --verbose to show complete help)
1230
1231
1231 $ hg help debugoptEXP
1232 $ hg help debugoptEXP
1232 hg debugoptEXP
1233 hg debugoptEXP
1233
1234
1234 (no help text available)
1235 (no help text available)
1235
1236
1236 options:
1237 options:
1237
1238
1238 (some details hidden, use --verbose to show complete help)
1239 (some details hidden, use --verbose to show complete help)
1239
1240
1240 test advanced, deprecated and experimental options are shown with -v
1241 test advanced, deprecated and experimental options are shown with -v
1241 $ hg help -v debugoptADV | grep aopt
1242 $ hg help -v debugoptADV | grep aopt
1242 --aopt option is (ADVANCED)
1243 --aopt option is (ADVANCED)
1243 $ hg help -v debugoptDEP | grep dopt
1244 $ hg help -v debugoptDEP | grep dopt
1244 --dopt option is (DEPRECATED)
1245 --dopt option is (DEPRECATED)
1245 $ hg help -v debugoptEXP | grep eopt
1246 $ hg help -v debugoptEXP | grep eopt
1246 --eopt option is (EXPERIMENTAL)
1247 --eopt option is (EXPERIMENTAL)
1247
1248
1248 #if gettext
1249 #if gettext
1249 test deprecated option is hidden with translation with untranslated description
1250 test deprecated option is hidden with translation with untranslated description
1250 (use many globy for not failing on changed transaction)
1251 (use many globy for not failing on changed transaction)
1251 $ LANGUAGE=sv hg help debugoptDEP
1252 $ LANGUAGE=sv hg help debugoptDEP
1252 hg debugoptDEP
1253 hg debugoptDEP
1253
1254
1254 (*) (glob)
1255 (*) (glob)
1255
1256
1256 options:
1257 options:
1257
1258
1258 (some details hidden, use --verbose to show complete help)
1259 (some details hidden, use --verbose to show complete help)
1259 #endif
1260 #endif
1260
1261
1261 Test commands that collide with topics (issue4240)
1262 Test commands that collide with topics (issue4240)
1262
1263
1263 $ hg config -hq
1264 $ hg config -hq
1264 hg config [-u] [NAME]...
1265 hg config [-u] [NAME]...
1265
1266
1266 show combined config settings from all hgrc files
1267 show combined config settings from all hgrc files
1267 $ hg showconfig -hq
1268 $ hg showconfig -hq
1268 hg config [-u] [NAME]...
1269 hg config [-u] [NAME]...
1269
1270
1270 show combined config settings from all hgrc files
1271 show combined config settings from all hgrc files
1271
1272
1272 Test a help topic
1273 Test a help topic
1273
1274
1274 $ hg help dates
1275 $ hg help dates
1275 Date Formats
1276 Date Formats
1276 """"""""""""
1277 """"""""""""
1277
1278
1278 Some commands allow the user to specify a date, e.g.:
1279 Some commands allow the user to specify a date, e.g.:
1279
1280
1280 - backout, commit, import, tag: Specify the commit date.
1281 - backout, commit, import, tag: Specify the commit date.
1281 - log, revert, update: Select revision(s) by date.
1282 - log, revert, update: Select revision(s) by date.
1282
1283
1283 Many date formats are valid. Here are some examples:
1284 Many date formats are valid. Here are some examples:
1284
1285
1285 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1286 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1286 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1287 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1287 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1288 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1288 - "Dec 6" (midnight)
1289 - "Dec 6" (midnight)
1289 - "13:18" (today assumed)
1290 - "13:18" (today assumed)
1290 - "3:39" (3:39AM assumed)
1291 - "3:39" (3:39AM assumed)
1291 - "3:39pm" (15:39)
1292 - "3:39pm" (15:39)
1292 - "2006-12-06 13:18:29" (ISO 8601 format)
1293 - "2006-12-06 13:18:29" (ISO 8601 format)
1293 - "2006-12-6 13:18"
1294 - "2006-12-6 13:18"
1294 - "2006-12-6"
1295 - "2006-12-6"
1295 - "12-6"
1296 - "12-6"
1296 - "12/6"
1297 - "12/6"
1297 - "12/6/6" (Dec 6 2006)
1298 - "12/6/6" (Dec 6 2006)
1298 - "today" (midnight)
1299 - "today" (midnight)
1299 - "yesterday" (midnight)
1300 - "yesterday" (midnight)
1300 - "now" - right now
1301 - "now" - right now
1301
1302
1302 Lastly, there is Mercurial's internal format:
1303 Lastly, there is Mercurial's internal format:
1303
1304
1304 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1305 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1305
1306
1306 This is the internal representation format for dates. The first number is
1307 This is the internal representation format for dates. The first number is
1307 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1308 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1308 is the offset of the local timezone, in seconds west of UTC (negative if
1309 is the offset of the local timezone, in seconds west of UTC (negative if
1309 the timezone is east of UTC).
1310 the timezone is east of UTC).
1310
1311
1311 The log command also accepts date ranges:
1312 The log command also accepts date ranges:
1312
1313
1313 - "<DATE" - at or before a given date/time
1314 - "<DATE" - at or before a given date/time
1314 - ">DATE" - on or after a given date/time
1315 - ">DATE" - on or after a given date/time
1315 - "DATE to DATE" - a date range, inclusive
1316 - "DATE to DATE" - a date range, inclusive
1316 - "-DAYS" - within a given number of days of today
1317 - "-DAYS" - within a given number of days of today
1317
1318
1318 Test repeated config section name
1319 Test repeated config section name
1319
1320
1320 $ hg help config.host
1321 $ hg help config.host
1321 "http_proxy.host"
1322 "http_proxy.host"
1322 Host name and (optional) port of the proxy server, for example
1323 Host name and (optional) port of the proxy server, for example
1323 "myproxy:8000".
1324 "myproxy:8000".
1324
1325
1325 "smtp.host"
1326 "smtp.host"
1326 Host name of mail server, e.g. "mail.example.com".
1327 Host name of mail server, e.g. "mail.example.com".
1327
1328
1328 Unrelated trailing paragraphs shouldn't be included
1329 Unrelated trailing paragraphs shouldn't be included
1329
1330
1330 $ hg help config.extramsg | grep '^$'
1331 $ hg help config.extramsg | grep '^$'
1331
1332
1332
1333
1333 Test capitalized section name
1334 Test capitalized section name
1334
1335
1335 $ hg help scripting.HGPLAIN > /dev/null
1336 $ hg help scripting.HGPLAIN > /dev/null
1336
1337
1337 Help subsection:
1338 Help subsection:
1338
1339
1339 $ hg help config.charsets |grep "Email example:" > /dev/null
1340 $ hg help config.charsets |grep "Email example:" > /dev/null
1340 [1]
1341 [1]
1341
1342
1342 Show nested definitions
1343 Show nested definitions
1343 ("profiling.type"[break]"ls"[break]"stat"[break])
1344 ("profiling.type"[break]"ls"[break]"stat"[break])
1344
1345
1345 $ hg help config.type | egrep '^$'|wc -l
1346 $ hg help config.type | egrep '^$'|wc -l
1346 \s*3 (re)
1347 \s*3 (re)
1347
1348
1348 Separate sections from subsections
1349 Separate sections from subsections
1349
1350
1350 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1351 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1351 "format"
1352 "format"
1352 --------
1353 --------
1353
1354
1354 "usegeneraldelta"
1355 "usegeneraldelta"
1355
1356
1356 "dotencode"
1357 "dotencode"
1357
1358
1358 "usefncache"
1359 "usefncache"
1359
1360
1360 "usestore"
1361 "usestore"
1361
1362
1362 "profiling"
1363 "profiling"
1363 -----------
1364 -----------
1364
1365
1365 "format"
1366 "format"
1366
1367
1367 "progress"
1368 "progress"
1368 ----------
1369 ----------
1369
1370
1370 "format"
1371 "format"
1371
1372
1372
1373
1373 Last item in help config.*:
1374 Last item in help config.*:
1374
1375
1375 $ hg help config.`hg help config|grep '^ "'| \
1376 $ hg help config.`hg help config|grep '^ "'| \
1376 > tail -1|sed 's![ "]*!!g'`| \
1377 > tail -1|sed 's![ "]*!!g'`| \
1377 > grep 'hg help -c config' > /dev/null
1378 > grep 'hg help -c config' > /dev/null
1378 [1]
1379 [1]
1379
1380
1380 note to use help -c for general hg help config:
1381 note to use help -c for general hg help config:
1381
1382
1382 $ hg help config |grep 'hg help -c config' > /dev/null
1383 $ hg help config |grep 'hg help -c config' > /dev/null
1383
1384
1384 Test templating help
1385 Test templating help
1385
1386
1386 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1387 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1387 desc String. The text of the changeset description.
1388 desc String. The text of the changeset description.
1388 diffstat String. Statistics of changes with the following format:
1389 diffstat String. Statistics of changes with the following format:
1389 firstline Any text. Returns the first line of text.
1390 firstline Any text. Returns the first line of text.
1390 nonempty Any text. Returns '(none)' if the string is empty.
1391 nonempty Any text. Returns '(none)' if the string is empty.
1391
1392
1392 Test deprecated items
1393 Test deprecated items
1393
1394
1394 $ hg help -v templating | grep currentbookmark
1395 $ hg help -v templating | grep currentbookmark
1395 currentbookmark
1396 currentbookmark
1396 $ hg help templating | (grep currentbookmark || true)
1397 $ hg help templating | (grep currentbookmark || true)
1397
1398
1398 Test help hooks
1399 Test help hooks
1399
1400
1400 $ cat > helphook1.py <<EOF
1401 $ cat > helphook1.py <<EOF
1401 > from mercurial import help
1402 > from mercurial import help
1402 >
1403 >
1403 > def rewrite(ui, topic, doc):
1404 > def rewrite(ui, topic, doc):
1404 > return doc + '\nhelphook1\n'
1405 > return doc + '\nhelphook1\n'
1405 >
1406 >
1406 > def extsetup(ui):
1407 > def extsetup(ui):
1407 > help.addtopichook('revisions', rewrite)
1408 > help.addtopichook('revisions', rewrite)
1408 > EOF
1409 > EOF
1409 $ cat > helphook2.py <<EOF
1410 $ cat > helphook2.py <<EOF
1410 > from mercurial import help
1411 > from mercurial import help
1411 >
1412 >
1412 > def rewrite(ui, topic, doc):
1413 > def rewrite(ui, topic, doc):
1413 > return doc + '\nhelphook2\n'
1414 > return doc + '\nhelphook2\n'
1414 >
1415 >
1415 > def extsetup(ui):
1416 > def extsetup(ui):
1416 > help.addtopichook('revisions', rewrite)
1417 > help.addtopichook('revisions', rewrite)
1417 > EOF
1418 > EOF
1418 $ echo '[extensions]' >> $HGRCPATH
1419 $ echo '[extensions]' >> $HGRCPATH
1419 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1420 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1420 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1421 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1421 $ hg help revsets | grep helphook
1422 $ hg help revsets | grep helphook
1422 helphook1
1423 helphook1
1423 helphook2
1424 helphook2
1424
1425
1425 help -c should only show debug --debug
1426 help -c should only show debug --debug
1426
1427
1427 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1428 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1428 [1]
1429 [1]
1429
1430
1430 help -c should only show deprecated for -v
1431 help -c should only show deprecated for -v
1431
1432
1432 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1433 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1433 [1]
1434 [1]
1434
1435
1435 Test -s / --system
1436 Test -s / --system
1436
1437
1437 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1438 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1438 > wc -l | sed -e 's/ //g'
1439 > wc -l | sed -e 's/ //g'
1439 0
1440 0
1440 $ hg help config.files --system unix | grep 'USER' | \
1441 $ hg help config.files --system unix | grep 'USER' | \
1441 > wc -l | sed -e 's/ //g'
1442 > wc -l | sed -e 's/ //g'
1442 0
1443 0
1443
1444
1444 Test -e / -c / -k combinations
1445 Test -e / -c / -k combinations
1445
1446
1446 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1447 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1447 Commands:
1448 Commands:
1448 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1449 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1449 Extensions:
1450 Extensions:
1450 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1451 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1451 Topics:
1452 Topics:
1452 Commands:
1453 Commands:
1453 Extensions:
1454 Extensions:
1454 Extension Commands:
1455 Extension Commands:
1455 $ hg help -c schemes
1456 $ hg help -c schemes
1456 abort: no such help topic: schemes
1457 abort: no such help topic: schemes
1457 (try 'hg help --keyword schemes')
1458 (try 'hg help --keyword schemes')
1458 [255]
1459 [255]
1459 $ hg help -e schemes |head -1
1460 $ hg help -e schemes |head -1
1460 schemes extension - extend schemes with shortcuts to repository swarms
1461 schemes extension - extend schemes with shortcuts to repository swarms
1461 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1462 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1462 Commands:
1463 Commands:
1463 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1464 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1464 Extensions:
1465 Extensions:
1465 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1466 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1466 Extensions:
1467 Extensions:
1467 Commands:
1468 Commands:
1468 $ hg help -c commit > /dev/null
1469 $ hg help -c commit > /dev/null
1469 $ hg help -e -c commit > /dev/null
1470 $ hg help -e -c commit > /dev/null
1470 $ hg help -e commit > /dev/null
1471 $ hg help -e commit > /dev/null
1471 abort: no such help topic: commit
1472 abort: no such help topic: commit
1472 (try 'hg help --keyword commit')
1473 (try 'hg help --keyword commit')
1473 [255]
1474 [255]
1474
1475
1475 Test keyword search help
1476 Test keyword search help
1476
1477
1477 $ cat > prefixedname.py <<EOF
1478 $ cat > prefixedname.py <<EOF
1478 > '''matched against word "clone"
1479 > '''matched against word "clone"
1479 > '''
1480 > '''
1480 > EOF
1481 > EOF
1481 $ echo '[extensions]' >> $HGRCPATH
1482 $ echo '[extensions]' >> $HGRCPATH
1482 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1483 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1483 $ hg help -k clone
1484 $ hg help -k clone
1484 Topics:
1485 Topics:
1485
1486
1486 config Configuration Files
1487 config Configuration Files
1487 extensions Using Additional Features
1488 extensions Using Additional Features
1488 glossary Glossary
1489 glossary Glossary
1489 phases Working with Phases
1490 phases Working with Phases
1490 subrepos Subrepositories
1491 subrepos Subrepositories
1491 urls URL Paths
1492 urls URL Paths
1492
1493
1493 Commands:
1494 Commands:
1494
1495
1495 bookmarks create a new bookmark or list existing bookmarks
1496 bookmarks create a new bookmark or list existing bookmarks
1496 clone make a copy of an existing repository
1497 clone make a copy of an existing repository
1497 paths show aliases for remote repositories
1498 paths show aliases for remote repositories
1498 update update working directory (or switch revisions)
1499 update update working directory (or switch revisions)
1499
1500
1500 Extensions:
1501 Extensions:
1501
1502
1502 clonebundles advertise pre-generated bundles to seed clones
1503 clonebundles advertise pre-generated bundles to seed clones
1503 narrow create clones which fetch history data for subset of files
1504 narrow create clones which fetch history data for subset of files
1504 (EXPERIMENTAL)
1505 (EXPERIMENTAL)
1505 prefixedname matched against word "clone"
1506 prefixedname matched against word "clone"
1506 relink recreates hardlinks between repository clones
1507 relink recreates hardlinks between repository clones
1507
1508
1508 Extension Commands:
1509 Extension Commands:
1509
1510
1510 qclone clone main and patch repository at same time
1511 qclone clone main and patch repository at same time
1511
1512
1512 Test unfound topic
1513 Test unfound topic
1513
1514
1514 $ hg help nonexistingtopicthatwillneverexisteverever
1515 $ hg help nonexistingtopicthatwillneverexisteverever
1515 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1516 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1516 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1517 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1517 [255]
1518 [255]
1518
1519
1519 Test unfound keyword
1520 Test unfound keyword
1520
1521
1521 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1522 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1522 abort: no matches
1523 abort: no matches
1523 (try 'hg help' for a list of topics)
1524 (try 'hg help' for a list of topics)
1524 [255]
1525 [255]
1525
1526
1526 Test omit indicating for help
1527 Test omit indicating for help
1527
1528
1528 $ cat > addverboseitems.py <<EOF
1529 $ cat > addverboseitems.py <<EOF
1529 > '''extension to test omit indicating.
1530 > '''extension to test omit indicating.
1530 >
1531 >
1531 > This paragraph is never omitted (for extension)
1532 > This paragraph is never omitted (for extension)
1532 >
1533 >
1533 > .. container:: verbose
1534 > .. container:: verbose
1534 >
1535 >
1535 > This paragraph is omitted,
1536 > This paragraph is omitted,
1536 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1537 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1537 >
1538 >
1538 > This paragraph is never omitted, too (for extension)
1539 > This paragraph is never omitted, too (for extension)
1539 > '''
1540 > '''
1540 > from __future__ import absolute_import
1541 > from __future__ import absolute_import
1541 > from mercurial import commands, help
1542 > from mercurial import commands, help
1542 > testtopic = """This paragraph is never omitted (for topic).
1543 > testtopic = """This paragraph is never omitted (for topic).
1543 >
1544 >
1544 > .. container:: verbose
1545 > .. container:: verbose
1545 >
1546 >
1546 > This paragraph is omitted,
1547 > This paragraph is omitted,
1547 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1548 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1548 >
1549 >
1549 > This paragraph is never omitted, too (for topic)
1550 > This paragraph is never omitted, too (for topic)
1550 > """
1551 > """
1551 > def extsetup(ui):
1552 > def extsetup(ui):
1552 > help.helptable.append((["topic-containing-verbose"],
1553 > help.helptable.append((["topic-containing-verbose"],
1553 > "This is the topic to test omit indicating.",
1554 > "This is the topic to test omit indicating.",
1554 > lambda ui: testtopic))
1555 > lambda ui: testtopic))
1555 > EOF
1556 > EOF
1556 $ echo '[extensions]' >> $HGRCPATH
1557 $ echo '[extensions]' >> $HGRCPATH
1557 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1558 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1558 $ hg help addverboseitems
1559 $ hg help addverboseitems
1559 addverboseitems extension - extension to test omit indicating.
1560 addverboseitems extension - extension to test omit indicating.
1560
1561
1561 This paragraph is never omitted (for extension)
1562 This paragraph is never omitted (for extension)
1562
1563
1563 This paragraph is never omitted, too (for extension)
1564 This paragraph is never omitted, too (for extension)
1564
1565
1565 (some details hidden, use --verbose to show complete help)
1566 (some details hidden, use --verbose to show complete help)
1566
1567
1567 no commands defined
1568 no commands defined
1568 $ hg help -v addverboseitems
1569 $ hg help -v addverboseitems
1569 addverboseitems extension - extension to test omit indicating.
1570 addverboseitems extension - extension to test omit indicating.
1570
1571
1571 This paragraph is never omitted (for extension)
1572 This paragraph is never omitted (for extension)
1572
1573
1573 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1574 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1574 extension)
1575 extension)
1575
1576
1576 This paragraph is never omitted, too (for extension)
1577 This paragraph is never omitted, too (for extension)
1577
1578
1578 no commands defined
1579 no commands defined
1579 $ hg help topic-containing-verbose
1580 $ hg help topic-containing-verbose
1580 This is the topic to test omit indicating.
1581 This is the topic to test omit indicating.
1581 """"""""""""""""""""""""""""""""""""""""""
1582 """"""""""""""""""""""""""""""""""""""""""
1582
1583
1583 This paragraph is never omitted (for topic).
1584 This paragraph is never omitted (for topic).
1584
1585
1585 This paragraph is never omitted, too (for topic)
1586 This paragraph is never omitted, too (for topic)
1586
1587
1587 (some details hidden, use --verbose to show complete help)
1588 (some details hidden, use --verbose to show complete help)
1588 $ hg help -v topic-containing-verbose
1589 $ hg help -v topic-containing-verbose
1589 This is the topic to test omit indicating.
1590 This is the topic to test omit indicating.
1590 """"""""""""""""""""""""""""""""""""""""""
1591 """"""""""""""""""""""""""""""""""""""""""
1591
1592
1592 This paragraph is never omitted (for topic).
1593 This paragraph is never omitted (for topic).
1593
1594
1594 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1595 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1595 topic)
1596 topic)
1596
1597
1597 This paragraph is never omitted, too (for topic)
1598 This paragraph is never omitted, too (for topic)
1598
1599
1599 Test section lookup
1600 Test section lookup
1600
1601
1601 $ hg help revset.merge
1602 $ hg help revset.merge
1602 "merge()"
1603 "merge()"
1603 Changeset is a merge changeset.
1604 Changeset is a merge changeset.
1604
1605
1605 $ hg help glossary.dag
1606 $ hg help glossary.dag
1606 DAG
1607 DAG
1607 The repository of changesets of a distributed version control system
1608 The repository of changesets of a distributed version control system
1608 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1609 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1609 of nodes and edges, where nodes correspond to changesets and edges
1610 of nodes and edges, where nodes correspond to changesets and edges
1610 imply a parent -> child relation. This graph can be visualized by
1611 imply a parent -> child relation. This graph can be visualized by
1611 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1612 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1612 limited by the requirement for children to have at most two parents.
1613 limited by the requirement for children to have at most two parents.
1613
1614
1614
1615
1615 $ hg help hgrc.paths
1616 $ hg help hgrc.paths
1616 "paths"
1617 "paths"
1617 -------
1618 -------
1618
1619
1619 Assigns symbolic names and behavior to repositories.
1620 Assigns symbolic names and behavior to repositories.
1620
1621
1621 Options are symbolic names defining the URL or directory that is the
1622 Options are symbolic names defining the URL or directory that is the
1622 location of the repository. Example:
1623 location of the repository. Example:
1623
1624
1624 [paths]
1625 [paths]
1625 my_server = https://example.com/my_repo
1626 my_server = https://example.com/my_repo
1626 local_path = /home/me/repo
1627 local_path = /home/me/repo
1627
1628
1628 These symbolic names can be used from the command line. To pull from
1629 These symbolic names can be used from the command line. To pull from
1629 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1630 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1630 local_path'.
1631 local_path'.
1631
1632
1632 Options containing colons (":") denote sub-options that can influence
1633 Options containing colons (":") denote sub-options that can influence
1633 behavior for that specific path. Example:
1634 behavior for that specific path. Example:
1634
1635
1635 [paths]
1636 [paths]
1636 my_server = https://example.com/my_path
1637 my_server = https://example.com/my_path
1637 my_server:pushurl = ssh://example.com/my_path
1638 my_server:pushurl = ssh://example.com/my_path
1638
1639
1639 The following sub-options can be defined:
1640 The following sub-options can be defined:
1640
1641
1641 "pushurl"
1642 "pushurl"
1642 The URL to use for push operations. If not defined, the location
1643 The URL to use for push operations. If not defined, the location
1643 defined by the path's main entry is used.
1644 defined by the path's main entry is used.
1644
1645
1645 "pushrev"
1646 "pushrev"
1646 A revset defining which revisions to push by default.
1647 A revset defining which revisions to push by default.
1647
1648
1648 When 'hg push' is executed without a "-r" argument, the revset defined
1649 When 'hg push' is executed without a "-r" argument, the revset defined
1649 by this sub-option is evaluated to determine what to push.
1650 by this sub-option is evaluated to determine what to push.
1650
1651
1651 For example, a value of "." will push the working directory's revision
1652 For example, a value of "." will push the working directory's revision
1652 by default.
1653 by default.
1653
1654
1654 Revsets specifying bookmarks will not result in the bookmark being
1655 Revsets specifying bookmarks will not result in the bookmark being
1655 pushed.
1656 pushed.
1656
1657
1657 The following special named paths exist:
1658 The following special named paths exist:
1658
1659
1659 "default"
1660 "default"
1660 The URL or directory to use when no source or remote is specified.
1661 The URL or directory to use when no source or remote is specified.
1661
1662
1662 'hg clone' will automatically define this path to the location the
1663 'hg clone' will automatically define this path to the location the
1663 repository was cloned from.
1664 repository was cloned from.
1664
1665
1665 "default-push"
1666 "default-push"
1666 (deprecated) The URL or directory for the default 'hg push' location.
1667 (deprecated) The URL or directory for the default 'hg push' location.
1667 "default:pushurl" should be used instead.
1668 "default:pushurl" should be used instead.
1668
1669
1669 $ hg help glossary.mcguffin
1670 $ hg help glossary.mcguffin
1670 abort: help section not found: glossary.mcguffin
1671 abort: help section not found: glossary.mcguffin
1671 [255]
1672 [255]
1672
1673
1673 $ hg help glossary.mc.guffin
1674 $ hg help glossary.mc.guffin
1674 abort: help section not found: glossary.mc.guffin
1675 abort: help section not found: glossary.mc.guffin
1675 [255]
1676 [255]
1676
1677
1677 $ hg help template.files
1678 $ hg help template.files
1678 files List of strings. All files modified, added, or removed by
1679 files List of strings. All files modified, added, or removed by
1679 this changeset.
1680 this changeset.
1680 files(pattern)
1681 files(pattern)
1681 All files of the current changeset matching the pattern. See
1682 All files of the current changeset matching the pattern. See
1682 'hg help patterns'.
1683 'hg help patterns'.
1683
1684
1684 Test section lookup by translated message
1685 Test section lookup by translated message
1685
1686
1686 str.lower() instead of encoding.lower(str) on translated message might
1687 str.lower() instead of encoding.lower(str) on translated message might
1687 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1688 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1688 as the second or later byte of multi-byte character.
1689 as the second or later byte of multi-byte character.
1689
1690
1690 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1691 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1691 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1692 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1692 replacement makes message meaningless.
1693 replacement makes message meaningless.
1693
1694
1694 This tests that section lookup by translated string isn't broken by
1695 This tests that section lookup by translated string isn't broken by
1695 such str.lower().
1696 such str.lower().
1696
1697
1697 $ $PYTHON <<EOF
1698 $ $PYTHON <<EOF
1698 > def escape(s):
1699 > def escape(s):
1699 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1700 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1700 > # translation of "record" in ja_JP.cp932
1701 > # translation of "record" in ja_JP.cp932
1701 > upper = "\x8bL\x98^"
1702 > upper = "\x8bL\x98^"
1702 > # str.lower()-ed section name should be treated as different one
1703 > # str.lower()-ed section name should be treated as different one
1703 > lower = "\x8bl\x98^"
1704 > lower = "\x8bl\x98^"
1704 > with open('ambiguous.py', 'w') as fp:
1705 > with open('ambiguous.py', 'w') as fp:
1705 > fp.write("""# ambiguous section names in ja_JP.cp932
1706 > fp.write("""# ambiguous section names in ja_JP.cp932
1706 > u'''summary of extension
1707 > u'''summary of extension
1707 >
1708 >
1708 > %s
1709 > %s
1709 > ----
1710 > ----
1710 >
1711 >
1711 > Upper name should show only this message
1712 > Upper name should show only this message
1712 >
1713 >
1713 > %s
1714 > %s
1714 > ----
1715 > ----
1715 >
1716 >
1716 > Lower name should show only this message
1717 > Lower name should show only this message
1717 >
1718 >
1718 > subsequent section
1719 > subsequent section
1719 > ------------------
1720 > ------------------
1720 >
1721 >
1721 > This should be hidden at 'hg help ambiguous' with section name.
1722 > This should be hidden at 'hg help ambiguous' with section name.
1722 > '''
1723 > '''
1723 > """ % (escape(upper), escape(lower)))
1724 > """ % (escape(upper), escape(lower)))
1724 > EOF
1725 > EOF
1725
1726
1726 $ cat >> $HGRCPATH <<EOF
1727 $ cat >> $HGRCPATH <<EOF
1727 > [extensions]
1728 > [extensions]
1728 > ambiguous = ./ambiguous.py
1729 > ambiguous = ./ambiguous.py
1729 > EOF
1730 > EOF
1730
1731
1731 $ $PYTHON <<EOF | sh
1732 $ $PYTHON <<EOF | sh
1732 > upper = "\x8bL\x98^"
1733 > upper = "\x8bL\x98^"
1733 > print("hg --encoding cp932 help -e ambiguous.%s" % upper)
1734 > print("hg --encoding cp932 help -e ambiguous.%s" % upper)
1734 > EOF
1735 > EOF
1735 \x8bL\x98^ (esc)
1736 \x8bL\x98^ (esc)
1736 ----
1737 ----
1737
1738
1738 Upper name should show only this message
1739 Upper name should show only this message
1739
1740
1740
1741
1741 $ $PYTHON <<EOF | sh
1742 $ $PYTHON <<EOF | sh
1742 > lower = "\x8bl\x98^"
1743 > lower = "\x8bl\x98^"
1743 > print("hg --encoding cp932 help -e ambiguous.%s" % lower)
1744 > print("hg --encoding cp932 help -e ambiguous.%s" % lower)
1744 > EOF
1745 > EOF
1745 \x8bl\x98^ (esc)
1746 \x8bl\x98^ (esc)
1746 ----
1747 ----
1747
1748
1748 Lower name should show only this message
1749 Lower name should show only this message
1749
1750
1750
1751
1751 $ cat >> $HGRCPATH <<EOF
1752 $ cat >> $HGRCPATH <<EOF
1752 > [extensions]
1753 > [extensions]
1753 > ambiguous = !
1754 > ambiguous = !
1754 > EOF
1755 > EOF
1755
1756
1756 Show help content of disabled extensions
1757 Show help content of disabled extensions
1757
1758
1758 $ cat >> $HGRCPATH <<EOF
1759 $ cat >> $HGRCPATH <<EOF
1759 > [extensions]
1760 > [extensions]
1760 > ambiguous = !./ambiguous.py
1761 > ambiguous = !./ambiguous.py
1761 > EOF
1762 > EOF
1762 $ hg help -e ambiguous
1763 $ hg help -e ambiguous
1763 ambiguous extension - (no help text available)
1764 ambiguous extension - (no help text available)
1764
1765
1765 (use 'hg help extensions' for information on enabling extensions)
1766 (use 'hg help extensions' for information on enabling extensions)
1766
1767
1767 Test dynamic list of merge tools only shows up once
1768 Test dynamic list of merge tools only shows up once
1768 $ hg help merge-tools
1769 $ hg help merge-tools
1769 Merge Tools
1770 Merge Tools
1770 """""""""""
1771 """""""""""
1771
1772
1772 To merge files Mercurial uses merge tools.
1773 To merge files Mercurial uses merge tools.
1773
1774
1774 A merge tool combines two different versions of a file into a merged file.
1775 A merge tool combines two different versions of a file into a merged file.
1775 Merge tools are given the two files and the greatest common ancestor of
1776 Merge tools are given the two files and the greatest common ancestor of
1776 the two file versions, so they can determine the changes made on both
1777 the two file versions, so they can determine the changes made on both
1777 branches.
1778 branches.
1778
1779
1779 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1780 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1780 backout' and in several extensions.
1781 backout' and in several extensions.
1781
1782
1782 Usually, the merge tool tries to automatically reconcile the files by
1783 Usually, the merge tool tries to automatically reconcile the files by
1783 combining all non-overlapping changes that occurred separately in the two
1784 combining all non-overlapping changes that occurred separately in the two
1784 different evolutions of the same initial base file. Furthermore, some
1785 different evolutions of the same initial base file. Furthermore, some
1785 interactive merge programs make it easier to manually resolve conflicting
1786 interactive merge programs make it easier to manually resolve conflicting
1786 merges, either in a graphical way, or by inserting some conflict markers.
1787 merges, either in a graphical way, or by inserting some conflict markers.
1787 Mercurial does not include any interactive merge programs but relies on
1788 Mercurial does not include any interactive merge programs but relies on
1788 external tools for that.
1789 external tools for that.
1789
1790
1790 Available merge tools
1791 Available merge tools
1791 =====================
1792 =====================
1792
1793
1793 External merge tools and their properties are configured in the merge-
1794 External merge tools and their properties are configured in the merge-
1794 tools configuration section - see hgrc(5) - but they can often just be
1795 tools configuration section - see hgrc(5) - but they can often just be
1795 named by their executable.
1796 named by their executable.
1796
1797
1797 A merge tool is generally usable if its executable can be found on the
1798 A merge tool is generally usable if its executable can be found on the
1798 system and if it can handle the merge. The executable is found if it is an
1799 system and if it can handle the merge. The executable is found if it is an
1799 absolute or relative executable path or the name of an application in the
1800 absolute or relative executable path or the name of an application in the
1800 executable search path. The tool is assumed to be able to handle the merge
1801 executable search path. The tool is assumed to be able to handle the merge
1801 if it can handle symlinks if the file is a symlink, if it can handle
1802 if it can handle symlinks if the file is a symlink, if it can handle
1802 binary files if the file is binary, and if a GUI is available if the tool
1803 binary files if the file is binary, and if a GUI is available if the tool
1803 requires a GUI.
1804 requires a GUI.
1804
1805
1805 There are some internal merge tools which can be used. The internal merge
1806 There are some internal merge tools which can be used. The internal merge
1806 tools are:
1807 tools are:
1807
1808
1808 ":dump"
1809 ":dump"
1809 Creates three versions of the files to merge, containing the contents of
1810 Creates three versions of the files to merge, containing the contents of
1810 local, other and base. These files can then be used to perform a merge
1811 local, other and base. These files can then be used to perform a merge
1811 manually. If the file to be merged is named "a.txt", these files will
1812 manually. If the file to be merged is named "a.txt", these files will
1812 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1813 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1813 they will be placed in the same directory as "a.txt".
1814 they will be placed in the same directory as "a.txt".
1814
1815
1815 This implies premerge. Therefore, files aren't dumped, if premerge runs
1816 This implies premerge. Therefore, files aren't dumped, if premerge runs
1816 successfully. Use :forcedump to forcibly write files out.
1817 successfully. Use :forcedump to forcibly write files out.
1817
1818
1818 ":fail"
1819 ":fail"
1819 Rather than attempting to merge files that were modified on both
1820 Rather than attempting to merge files that were modified on both
1820 branches, it marks them as unresolved. The resolve command must be used
1821 branches, it marks them as unresolved. The resolve command must be used
1821 to resolve these conflicts.
1822 to resolve these conflicts.
1822
1823
1823 ":forcedump"
1824 ":forcedump"
1824 Creates three versions of the files as same as :dump, but omits
1825 Creates three versions of the files as same as :dump, but omits
1825 premerge.
1826 premerge.
1826
1827
1827 ":local"
1828 ":local"
1828 Uses the local 'p1()' version of files as the merged version.
1829 Uses the local 'p1()' version of files as the merged version.
1829
1830
1830 ":merge"
1831 ":merge"
1831 Uses the internal non-interactive simple merge algorithm for merging
1832 Uses the internal non-interactive simple merge algorithm for merging
1832 files. It will fail if there are any conflicts and leave markers in the
1833 files. It will fail if there are any conflicts and leave markers in the
1833 partially merged file. Markers will have two sections, one for each side
1834 partially merged file. Markers will have two sections, one for each side
1834 of merge.
1835 of merge.
1835
1836
1836 ":merge-local"
1837 ":merge-local"
1837 Like :merge, but resolve all conflicts non-interactively in favor of the
1838 Like :merge, but resolve all conflicts non-interactively in favor of the
1838 local 'p1()' changes.
1839 local 'p1()' changes.
1839
1840
1840 ":merge-other"
1841 ":merge-other"
1841 Like :merge, but resolve all conflicts non-interactively in favor of the
1842 Like :merge, but resolve all conflicts non-interactively in favor of the
1842 other 'p2()' changes.
1843 other 'p2()' changes.
1843
1844
1844 ":merge3"
1845 ":merge3"
1845 Uses the internal non-interactive simple merge algorithm for merging
1846 Uses the internal non-interactive simple merge algorithm for merging
1846 files. It will fail if there are any conflicts and leave markers in the
1847 files. It will fail if there are any conflicts and leave markers in the
1847 partially merged file. Marker will have three sections, one from each
1848 partially merged file. Marker will have three sections, one from each
1848 side of the merge and one for the base content.
1849 side of the merge and one for the base content.
1849
1850
1850 ":other"
1851 ":other"
1851 Uses the other 'p2()' version of files as the merged version.
1852 Uses the other 'p2()' version of files as the merged version.
1852
1853
1853 ":prompt"
1854 ":prompt"
1854 Asks the user which of the local 'p1()' or the other 'p2()' version to
1855 Asks the user which of the local 'p1()' or the other 'p2()' version to
1855 keep as the merged version.
1856 keep as the merged version.
1856
1857
1857 ":tagmerge"
1858 ":tagmerge"
1858 Uses the internal tag merge algorithm (experimental).
1859 Uses the internal tag merge algorithm (experimental).
1859
1860
1860 ":union"
1861 ":union"
1861 Uses the internal non-interactive simple merge algorithm for merging
1862 Uses the internal non-interactive simple merge algorithm for merging
1862 files. It will use both left and right sides for conflict regions. No
1863 files. It will use both left and right sides for conflict regions. No
1863 markers are inserted.
1864 markers are inserted.
1864
1865
1865 Internal tools are always available and do not require a GUI but will by
1866 Internal tools are always available and do not require a GUI but will by
1866 default not handle symlinks or binary files.
1867 default not handle symlinks or binary files.
1867
1868
1868 Choosing a merge tool
1869 Choosing a merge tool
1869 =====================
1870 =====================
1870
1871
1871 Mercurial uses these rules when deciding which merge tool to use:
1872 Mercurial uses these rules when deciding which merge tool to use:
1872
1873
1873 1. If a tool has been specified with the --tool option to merge or
1874 1. If a tool has been specified with the --tool option to merge or
1874 resolve, it is used. If it is the name of a tool in the merge-tools
1875 resolve, it is used. If it is the name of a tool in the merge-tools
1875 configuration, its configuration is used. Otherwise the specified tool
1876 configuration, its configuration is used. Otherwise the specified tool
1876 must be executable by the shell.
1877 must be executable by the shell.
1877 2. If the "HGMERGE" environment variable is present, its value is used and
1878 2. If the "HGMERGE" environment variable is present, its value is used and
1878 must be executable by the shell.
1879 must be executable by the shell.
1879 3. If the filename of the file to be merged matches any of the patterns in
1880 3. If the filename of the file to be merged matches any of the patterns in
1880 the merge-patterns configuration section, the first usable merge tool
1881 the merge-patterns configuration section, the first usable merge tool
1881 corresponding to a matching pattern is used. Here, binary capabilities
1882 corresponding to a matching pattern is used. Here, binary capabilities
1882 of the merge tool are not considered.
1883 of the merge tool are not considered.
1883 4. If ui.merge is set it will be considered next. If the value is not the
1884 4. If ui.merge is set it will be considered next. If the value is not the
1884 name of a configured tool, the specified value is used and must be
1885 name of a configured tool, the specified value is used and must be
1885 executable by the shell. Otherwise the named tool is used if it is
1886 executable by the shell. Otherwise the named tool is used if it is
1886 usable.
1887 usable.
1887 5. If any usable merge tools are present in the merge-tools configuration
1888 5. If any usable merge tools are present in the merge-tools configuration
1888 section, the one with the highest priority is used.
1889 section, the one with the highest priority is used.
1889 6. If a program named "hgmerge" can be found on the system, it is used -
1890 6. If a program named "hgmerge" can be found on the system, it is used -
1890 but it will by default not be used for symlinks and binary files.
1891 but it will by default not be used for symlinks and binary files.
1891 7. If the file to be merged is not binary and is not a symlink, then
1892 7. If the file to be merged is not binary and is not a symlink, then
1892 internal ":merge" is used.
1893 internal ":merge" is used.
1893 8. Otherwise, ":prompt" is used.
1894 8. Otherwise, ":prompt" is used.
1894
1895
1895 Note:
1896 Note:
1896 After selecting a merge program, Mercurial will by default attempt to
1897 After selecting a merge program, Mercurial will by default attempt to
1897 merge the files using a simple merge algorithm first. Only if it
1898 merge the files using a simple merge algorithm first. Only if it
1898 doesn't succeed because of conflicting changes will Mercurial actually
1899 doesn't succeed because of conflicting changes will Mercurial actually
1899 execute the merge program. Whether to use the simple merge algorithm
1900 execute the merge program. Whether to use the simple merge algorithm
1900 first can be controlled by the premerge setting of the merge tool.
1901 first can be controlled by the premerge setting of the merge tool.
1901 Premerge is enabled by default unless the file is binary or a symlink.
1902 Premerge is enabled by default unless the file is binary or a symlink.
1902
1903
1903 See the merge-tools and ui sections of hgrc(5) for details on the
1904 See the merge-tools and ui sections of hgrc(5) for details on the
1904 configuration of merge tools.
1905 configuration of merge tools.
1905
1906
1906 Compression engines listed in `hg help bundlespec`
1907 Compression engines listed in `hg help bundlespec`
1907
1908
1908 $ hg help bundlespec | grep gzip
1909 $ hg help bundlespec | grep gzip
1909 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1910 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1910 An algorithm that produces smaller bundles than "gzip".
1911 An algorithm that produces smaller bundles than "gzip".
1911 This engine will likely produce smaller bundles than "gzip" but will be
1912 This engine will likely produce smaller bundles than "gzip" but will be
1912 "gzip"
1913 "gzip"
1913 better compression than "gzip". It also frequently yields better (?)
1914 better compression than "gzip". It also frequently yields better (?)
1914
1915
1915 Test usage of section marks in help documents
1916 Test usage of section marks in help documents
1916
1917
1917 $ cd "$TESTDIR"/../doc
1918 $ cd "$TESTDIR"/../doc
1918 $ $PYTHON check-seclevel.py
1919 $ $PYTHON check-seclevel.py
1919 $ cd $TESTTMP
1920 $ cd $TESTTMP
1920
1921
1921 #if serve
1922 #if serve
1922
1923
1923 Test the help pages in hgweb.
1924 Test the help pages in hgweb.
1924
1925
1925 Dish up an empty repo; serve it cold.
1926 Dish up an empty repo; serve it cold.
1926
1927
1927 $ hg init "$TESTTMP/test"
1928 $ hg init "$TESTTMP/test"
1928 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1929 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1929 $ cat hg.pid >> $DAEMON_PIDS
1930 $ cat hg.pid >> $DAEMON_PIDS
1930
1931
1931 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1932 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1932 200 Script output follows
1933 200 Script output follows
1933
1934
1934 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1935 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1935 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1936 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1936 <head>
1937 <head>
1937 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1938 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1938 <meta name="robots" content="index, nofollow" />
1939 <meta name="robots" content="index, nofollow" />
1939 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1940 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1940 <script type="text/javascript" src="/static/mercurial.js"></script>
1941 <script type="text/javascript" src="/static/mercurial.js"></script>
1941
1942
1942 <title>Help: Index</title>
1943 <title>Help: Index</title>
1943 </head>
1944 </head>
1944 <body>
1945 <body>
1945
1946
1946 <div class="container">
1947 <div class="container">
1947 <div class="menu">
1948 <div class="menu">
1948 <div class="logo">
1949 <div class="logo">
1949 <a href="https://mercurial-scm.org/">
1950 <a href="https://mercurial-scm.org/">
1950 <img src="/static/hglogo.png" alt="mercurial" /></a>
1951 <img src="/static/hglogo.png" alt="mercurial" /></a>
1951 </div>
1952 </div>
1952 <ul>
1953 <ul>
1953 <li><a href="/shortlog">log</a></li>
1954 <li><a href="/shortlog">log</a></li>
1954 <li><a href="/graph">graph</a></li>
1955 <li><a href="/graph">graph</a></li>
1955 <li><a href="/tags">tags</a></li>
1956 <li><a href="/tags">tags</a></li>
1956 <li><a href="/bookmarks">bookmarks</a></li>
1957 <li><a href="/bookmarks">bookmarks</a></li>
1957 <li><a href="/branches">branches</a></li>
1958 <li><a href="/branches">branches</a></li>
1958 </ul>
1959 </ul>
1959 <ul>
1960 <ul>
1960 <li class="active">help</li>
1961 <li class="active">help</li>
1961 </ul>
1962 </ul>
1962 </div>
1963 </div>
1963
1964
1964 <div class="main">
1965 <div class="main">
1965 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1966 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1966
1967
1967 <form class="search" action="/log">
1968 <form class="search" action="/log">
1968
1969
1969 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1970 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1970 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1971 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1971 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1972 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1972 </form>
1973 </form>
1973 <table class="bigtable">
1974 <table class="bigtable">
1974 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1975 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1975
1976
1976 <tr><td>
1977 <tr><td>
1977 <a href="/help/bundlespec">
1978 <a href="/help/bundlespec">
1978 bundlespec
1979 bundlespec
1979 </a>
1980 </a>
1980 </td><td>
1981 </td><td>
1981 Bundle File Formats
1982 Bundle File Formats
1982 </td></tr>
1983 </td></tr>
1983 <tr><td>
1984 <tr><td>
1984 <a href="/help/color">
1985 <a href="/help/color">
1985 color
1986 color
1986 </a>
1987 </a>
1987 </td><td>
1988 </td><td>
1988 Colorizing Outputs
1989 Colorizing Outputs
1989 </td></tr>
1990 </td></tr>
1990 <tr><td>
1991 <tr><td>
1991 <a href="/help/config">
1992 <a href="/help/config">
1992 config
1993 config
1993 </a>
1994 </a>
1994 </td><td>
1995 </td><td>
1995 Configuration Files
1996 Configuration Files
1996 </td></tr>
1997 </td></tr>
1997 <tr><td>
1998 <tr><td>
1998 <a href="/help/dates">
1999 <a href="/help/dates">
1999 dates
2000 dates
2000 </a>
2001 </a>
2001 </td><td>
2002 </td><td>
2002 Date Formats
2003 Date Formats
2003 </td></tr>
2004 </td></tr>
2004 <tr><td>
2005 <tr><td>
2005 <a href="/help/diffs">
2006 <a href="/help/diffs">
2006 diffs
2007 diffs
2007 </a>
2008 </a>
2008 </td><td>
2009 </td><td>
2009 Diff Formats
2010 Diff Formats
2010 </td></tr>
2011 </td></tr>
2011 <tr><td>
2012 <tr><td>
2012 <a href="/help/environment">
2013 <a href="/help/environment">
2013 environment
2014 environment
2014 </a>
2015 </a>
2015 </td><td>
2016 </td><td>
2016 Environment Variables
2017 Environment Variables
2017 </td></tr>
2018 </td></tr>
2018 <tr><td>
2019 <tr><td>
2019 <a href="/help/extensions">
2020 <a href="/help/extensions">
2020 extensions
2021 extensions
2021 </a>
2022 </a>
2022 </td><td>
2023 </td><td>
2023 Using Additional Features
2024 Using Additional Features
2024 </td></tr>
2025 </td></tr>
2025 <tr><td>
2026 <tr><td>
2026 <a href="/help/filesets">
2027 <a href="/help/filesets">
2027 filesets
2028 filesets
2028 </a>
2029 </a>
2029 </td><td>
2030 </td><td>
2030 Specifying File Sets
2031 Specifying File Sets
2031 </td></tr>
2032 </td></tr>
2032 <tr><td>
2033 <tr><td>
2033 <a href="/help/flags">
2034 <a href="/help/flags">
2034 flags
2035 flags
2035 </a>
2036 </a>
2036 </td><td>
2037 </td><td>
2037 Command-line flags
2038 Command-line flags
2038 </td></tr>
2039 </td></tr>
2039 <tr><td>
2040 <tr><td>
2040 <a href="/help/glossary">
2041 <a href="/help/glossary">
2041 glossary
2042 glossary
2042 </a>
2043 </a>
2043 </td><td>
2044 </td><td>
2044 Glossary
2045 Glossary
2045 </td></tr>
2046 </td></tr>
2046 <tr><td>
2047 <tr><td>
2047 <a href="/help/hgignore">
2048 <a href="/help/hgignore">
2048 hgignore
2049 hgignore
2049 </a>
2050 </a>
2050 </td><td>
2051 </td><td>
2051 Syntax for Mercurial Ignore Files
2052 Syntax for Mercurial Ignore Files
2052 </td></tr>
2053 </td></tr>
2053 <tr><td>
2054 <tr><td>
2054 <a href="/help/hgweb">
2055 <a href="/help/hgweb">
2055 hgweb
2056 hgweb
2056 </a>
2057 </a>
2057 </td><td>
2058 </td><td>
2058 Configuring hgweb
2059 Configuring hgweb
2059 </td></tr>
2060 </td></tr>
2060 <tr><td>
2061 <tr><td>
2061 <a href="/help/internals">
2062 <a href="/help/internals">
2062 internals
2063 internals
2063 </a>
2064 </a>
2064 </td><td>
2065 </td><td>
2065 Technical implementation topics
2066 Technical implementation topics
2066 </td></tr>
2067 </td></tr>
2067 <tr><td>
2068 <tr><td>
2068 <a href="/help/merge-tools">
2069 <a href="/help/merge-tools">
2069 merge-tools
2070 merge-tools
2070 </a>
2071 </a>
2071 </td><td>
2072 </td><td>
2072 Merge Tools
2073 Merge Tools
2073 </td></tr>
2074 </td></tr>
2074 <tr><td>
2075 <tr><td>
2075 <a href="/help/pager">
2076 <a href="/help/pager">
2076 pager
2077 pager
2077 </a>
2078 </a>
2078 </td><td>
2079 </td><td>
2079 Pager Support
2080 Pager Support
2080 </td></tr>
2081 </td></tr>
2081 <tr><td>
2082 <tr><td>
2082 <a href="/help/patterns">
2083 <a href="/help/patterns">
2083 patterns
2084 patterns
2084 </a>
2085 </a>
2085 </td><td>
2086 </td><td>
2086 File Name Patterns
2087 File Name Patterns
2087 </td></tr>
2088 </td></tr>
2088 <tr><td>
2089 <tr><td>
2089 <a href="/help/phases">
2090 <a href="/help/phases">
2090 phases
2091 phases
2091 </a>
2092 </a>
2092 </td><td>
2093 </td><td>
2093 Working with Phases
2094 Working with Phases
2094 </td></tr>
2095 </td></tr>
2095 <tr><td>
2096 <tr><td>
2096 <a href="/help/revisions">
2097 <a href="/help/revisions">
2097 revisions
2098 revisions
2098 </a>
2099 </a>
2099 </td><td>
2100 </td><td>
2100 Specifying Revisions
2101 Specifying Revisions
2101 </td></tr>
2102 </td></tr>
2102 <tr><td>
2103 <tr><td>
2103 <a href="/help/scripting">
2104 <a href="/help/scripting">
2104 scripting
2105 scripting
2105 </a>
2106 </a>
2106 </td><td>
2107 </td><td>
2107 Using Mercurial from scripts and automation
2108 Using Mercurial from scripts and automation
2108 </td></tr>
2109 </td></tr>
2109 <tr><td>
2110 <tr><td>
2110 <a href="/help/subrepos">
2111 <a href="/help/subrepos">
2111 subrepos
2112 subrepos
2112 </a>
2113 </a>
2113 </td><td>
2114 </td><td>
2114 Subrepositories
2115 Subrepositories
2115 </td></tr>
2116 </td></tr>
2116 <tr><td>
2117 <tr><td>
2117 <a href="/help/templating">
2118 <a href="/help/templating">
2118 templating
2119 templating
2119 </a>
2120 </a>
2120 </td><td>
2121 </td><td>
2121 Template Usage
2122 Template Usage
2122 </td></tr>
2123 </td></tr>
2123 <tr><td>
2124 <tr><td>
2124 <a href="/help/urls">
2125 <a href="/help/urls">
2125 urls
2126 urls
2126 </a>
2127 </a>
2127 </td><td>
2128 </td><td>
2128 URL Paths
2129 URL Paths
2129 </td></tr>
2130 </td></tr>
2130 <tr><td>
2131 <tr><td>
2131 <a href="/help/topic-containing-verbose">
2132 <a href="/help/topic-containing-verbose">
2132 topic-containing-verbose
2133 topic-containing-verbose
2133 </a>
2134 </a>
2134 </td><td>
2135 </td><td>
2135 This is the topic to test omit indicating.
2136 This is the topic to test omit indicating.
2136 </td></tr>
2137 </td></tr>
2137
2138
2138
2139
2139 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2140 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2140
2141
2141 <tr><td>
2142 <tr><td>
2142 <a href="/help/add">
2143 <a href="/help/add">
2143 add
2144 add
2144 </a>
2145 </a>
2145 </td><td>
2146 </td><td>
2146 add the specified files on the next commit
2147 add the specified files on the next commit
2147 </td></tr>
2148 </td></tr>
2148 <tr><td>
2149 <tr><td>
2149 <a href="/help/annotate">
2150 <a href="/help/annotate">
2150 annotate
2151 annotate
2151 </a>
2152 </a>
2152 </td><td>
2153 </td><td>
2153 show changeset information by line for each file
2154 show changeset information by line for each file
2154 </td></tr>
2155 </td></tr>
2155 <tr><td>
2156 <tr><td>
2156 <a href="/help/clone">
2157 <a href="/help/clone">
2157 clone
2158 clone
2158 </a>
2159 </a>
2159 </td><td>
2160 </td><td>
2160 make a copy of an existing repository
2161 make a copy of an existing repository
2161 </td></tr>
2162 </td></tr>
2162 <tr><td>
2163 <tr><td>
2163 <a href="/help/commit">
2164 <a href="/help/commit">
2164 commit
2165 commit
2165 </a>
2166 </a>
2166 </td><td>
2167 </td><td>
2167 commit the specified files or all outstanding changes
2168 commit the specified files or all outstanding changes
2168 </td></tr>
2169 </td></tr>
2169 <tr><td>
2170 <tr><td>
2170 <a href="/help/diff">
2171 <a href="/help/diff">
2171 diff
2172 diff
2172 </a>
2173 </a>
2173 </td><td>
2174 </td><td>
2174 diff repository (or selected files)
2175 diff repository (or selected files)
2175 </td></tr>
2176 </td></tr>
2176 <tr><td>
2177 <tr><td>
2177 <a href="/help/export">
2178 <a href="/help/export">
2178 export
2179 export
2179 </a>
2180 </a>
2180 </td><td>
2181 </td><td>
2181 dump the header and diffs for one or more changesets
2182 dump the header and diffs for one or more changesets
2182 </td></tr>
2183 </td></tr>
2183 <tr><td>
2184 <tr><td>
2184 <a href="/help/forget">
2185 <a href="/help/forget">
2185 forget
2186 forget
2186 </a>
2187 </a>
2187 </td><td>
2188 </td><td>
2188 forget the specified files on the next commit
2189 forget the specified files on the next commit
2189 </td></tr>
2190 </td></tr>
2190 <tr><td>
2191 <tr><td>
2191 <a href="/help/init">
2192 <a href="/help/init">
2192 init
2193 init
2193 </a>
2194 </a>
2194 </td><td>
2195 </td><td>
2195 create a new repository in the given directory
2196 create a new repository in the given directory
2196 </td></tr>
2197 </td></tr>
2197 <tr><td>
2198 <tr><td>
2198 <a href="/help/log">
2199 <a href="/help/log">
2199 log
2200 log
2200 </a>
2201 </a>
2201 </td><td>
2202 </td><td>
2202 show revision history of entire repository or files
2203 show revision history of entire repository or files
2203 </td></tr>
2204 </td></tr>
2204 <tr><td>
2205 <tr><td>
2205 <a href="/help/merge">
2206 <a href="/help/merge">
2206 merge
2207 merge
2207 </a>
2208 </a>
2208 </td><td>
2209 </td><td>
2209 merge another revision into working directory
2210 merge another revision into working directory
2210 </td></tr>
2211 </td></tr>
2211 <tr><td>
2212 <tr><td>
2212 <a href="/help/pull">
2213 <a href="/help/pull">
2213 pull
2214 pull
2214 </a>
2215 </a>
2215 </td><td>
2216 </td><td>
2216 pull changes from the specified source
2217 pull changes from the specified source
2217 </td></tr>
2218 </td></tr>
2218 <tr><td>
2219 <tr><td>
2219 <a href="/help/push">
2220 <a href="/help/push">
2220 push
2221 push
2221 </a>
2222 </a>
2222 </td><td>
2223 </td><td>
2223 push changes to the specified destination
2224 push changes to the specified destination
2224 </td></tr>
2225 </td></tr>
2225 <tr><td>
2226 <tr><td>
2226 <a href="/help/remove">
2227 <a href="/help/remove">
2227 remove
2228 remove
2228 </a>
2229 </a>
2229 </td><td>
2230 </td><td>
2230 remove the specified files on the next commit
2231 remove the specified files on the next commit
2231 </td></tr>
2232 </td></tr>
2232 <tr><td>
2233 <tr><td>
2233 <a href="/help/serve">
2234 <a href="/help/serve">
2234 serve
2235 serve
2235 </a>
2236 </a>
2236 </td><td>
2237 </td><td>
2237 start stand-alone webserver
2238 start stand-alone webserver
2238 </td></tr>
2239 </td></tr>
2239 <tr><td>
2240 <tr><td>
2240 <a href="/help/status">
2241 <a href="/help/status">
2241 status
2242 status
2242 </a>
2243 </a>
2243 </td><td>
2244 </td><td>
2244 show changed files in the working directory
2245 show changed files in the working directory
2245 </td></tr>
2246 </td></tr>
2246 <tr><td>
2247 <tr><td>
2247 <a href="/help/summary">
2248 <a href="/help/summary">
2248 summary
2249 summary
2249 </a>
2250 </a>
2250 </td><td>
2251 </td><td>
2251 summarize working directory state
2252 summarize working directory state
2252 </td></tr>
2253 </td></tr>
2253 <tr><td>
2254 <tr><td>
2254 <a href="/help/update">
2255 <a href="/help/update">
2255 update
2256 update
2256 </a>
2257 </a>
2257 </td><td>
2258 </td><td>
2258 update working directory (or switch revisions)
2259 update working directory (or switch revisions)
2259 </td></tr>
2260 </td></tr>
2260
2261
2261
2262
2262
2263
2263 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2264 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2264
2265
2265 <tr><td>
2266 <tr><td>
2266 <a href="/help/addremove">
2267 <a href="/help/addremove">
2267 addremove
2268 addremove
2268 </a>
2269 </a>
2269 </td><td>
2270 </td><td>
2270 add all new files, delete all missing files
2271 add all new files, delete all missing files
2271 </td></tr>
2272 </td></tr>
2272 <tr><td>
2273 <tr><td>
2273 <a href="/help/archive">
2274 <a href="/help/archive">
2274 archive
2275 archive
2275 </a>
2276 </a>
2276 </td><td>
2277 </td><td>
2277 create an unversioned archive of a repository revision
2278 create an unversioned archive of a repository revision
2278 </td></tr>
2279 </td></tr>
2279 <tr><td>
2280 <tr><td>
2280 <a href="/help/backout">
2281 <a href="/help/backout">
2281 backout
2282 backout
2282 </a>
2283 </a>
2283 </td><td>
2284 </td><td>
2284 reverse effect of earlier changeset
2285 reverse effect of earlier changeset
2285 </td></tr>
2286 </td></tr>
2286 <tr><td>
2287 <tr><td>
2287 <a href="/help/bisect">
2288 <a href="/help/bisect">
2288 bisect
2289 bisect
2289 </a>
2290 </a>
2290 </td><td>
2291 </td><td>
2291 subdivision search of changesets
2292 subdivision search of changesets
2292 </td></tr>
2293 </td></tr>
2293 <tr><td>
2294 <tr><td>
2294 <a href="/help/bookmarks">
2295 <a href="/help/bookmarks">
2295 bookmarks
2296 bookmarks
2296 </a>
2297 </a>
2297 </td><td>
2298 </td><td>
2298 create a new bookmark or list existing bookmarks
2299 create a new bookmark or list existing bookmarks
2299 </td></tr>
2300 </td></tr>
2300 <tr><td>
2301 <tr><td>
2301 <a href="/help/branch">
2302 <a href="/help/branch">
2302 branch
2303 branch
2303 </a>
2304 </a>
2304 </td><td>
2305 </td><td>
2305 set or show the current branch name
2306 set or show the current branch name
2306 </td></tr>
2307 </td></tr>
2307 <tr><td>
2308 <tr><td>
2308 <a href="/help/branches">
2309 <a href="/help/branches">
2309 branches
2310 branches
2310 </a>
2311 </a>
2311 </td><td>
2312 </td><td>
2312 list repository named branches
2313 list repository named branches
2313 </td></tr>
2314 </td></tr>
2314 <tr><td>
2315 <tr><td>
2315 <a href="/help/bundle">
2316 <a href="/help/bundle">
2316 bundle
2317 bundle
2317 </a>
2318 </a>
2318 </td><td>
2319 </td><td>
2319 create a bundle file
2320 create a bundle file
2320 </td></tr>
2321 </td></tr>
2321 <tr><td>
2322 <tr><td>
2322 <a href="/help/cat">
2323 <a href="/help/cat">
2323 cat
2324 cat
2324 </a>
2325 </a>
2325 </td><td>
2326 </td><td>
2326 output the current or given revision of files
2327 output the current or given revision of files
2327 </td></tr>
2328 </td></tr>
2328 <tr><td>
2329 <tr><td>
2329 <a href="/help/config">
2330 <a href="/help/config">
2330 config
2331 config
2331 </a>
2332 </a>
2332 </td><td>
2333 </td><td>
2333 show combined config settings from all hgrc files
2334 show combined config settings from all hgrc files
2334 </td></tr>
2335 </td></tr>
2335 <tr><td>
2336 <tr><td>
2336 <a href="/help/copy">
2337 <a href="/help/copy">
2337 copy
2338 copy
2338 </a>
2339 </a>
2339 </td><td>
2340 </td><td>
2340 mark files as copied for the next commit
2341 mark files as copied for the next commit
2341 </td></tr>
2342 </td></tr>
2342 <tr><td>
2343 <tr><td>
2343 <a href="/help/files">
2344 <a href="/help/files">
2344 files
2345 files
2345 </a>
2346 </a>
2346 </td><td>
2347 </td><td>
2347 list tracked files
2348 list tracked files
2348 </td></tr>
2349 </td></tr>
2349 <tr><td>
2350 <tr><td>
2350 <a href="/help/graft">
2351 <a href="/help/graft">
2351 graft
2352 graft
2352 </a>
2353 </a>
2353 </td><td>
2354 </td><td>
2354 copy changes from other branches onto the current branch
2355 copy changes from other branches onto the current branch
2355 </td></tr>
2356 </td></tr>
2356 <tr><td>
2357 <tr><td>
2357 <a href="/help/grep">
2358 <a href="/help/grep">
2358 grep
2359 grep
2359 </a>
2360 </a>
2360 </td><td>
2361 </td><td>
2361 search revision history for a pattern in specified files
2362 search revision history for a pattern in specified files
2362 </td></tr>
2363 </td></tr>
2363 <tr><td>
2364 <tr><td>
2364 <a href="/help/heads">
2365 <a href="/help/heads">
2365 heads
2366 heads
2366 </a>
2367 </a>
2367 </td><td>
2368 </td><td>
2368 show branch heads
2369 show branch heads
2369 </td></tr>
2370 </td></tr>
2370 <tr><td>
2371 <tr><td>
2371 <a href="/help/help">
2372 <a href="/help/help">
2372 help
2373 help
2373 </a>
2374 </a>
2374 </td><td>
2375 </td><td>
2375 show help for a given topic or a help overview
2376 show help for a given topic or a help overview
2376 </td></tr>
2377 </td></tr>
2377 <tr><td>
2378 <tr><td>
2378 <a href="/help/hgalias">
2379 <a href="/help/hgalias">
2379 hgalias
2380 hgalias
2380 </a>
2381 </a>
2381 </td><td>
2382 </td><td>
2382 summarize working directory state
2383 summarize working directory state
2383 </td></tr>
2384 </td></tr>
2384 <tr><td>
2385 <tr><td>
2385 <a href="/help/identify">
2386 <a href="/help/identify">
2386 identify
2387 identify
2387 </a>
2388 </a>
2388 </td><td>
2389 </td><td>
2389 identify the working directory or specified revision
2390 identify the working directory or specified revision
2390 </td></tr>
2391 </td></tr>
2391 <tr><td>
2392 <tr><td>
2392 <a href="/help/import">
2393 <a href="/help/import">
2393 import
2394 import
2394 </a>
2395 </a>
2395 </td><td>
2396 </td><td>
2396 import an ordered set of patches
2397 import an ordered set of patches
2397 </td></tr>
2398 </td></tr>
2398 <tr><td>
2399 <tr><td>
2399 <a href="/help/incoming">
2400 <a href="/help/incoming">
2400 incoming
2401 incoming
2401 </a>
2402 </a>
2402 </td><td>
2403 </td><td>
2403 show new changesets found in source
2404 show new changesets found in source
2404 </td></tr>
2405 </td></tr>
2405 <tr><td>
2406 <tr><td>
2406 <a href="/help/manifest">
2407 <a href="/help/manifest">
2407 manifest
2408 manifest
2408 </a>
2409 </a>
2409 </td><td>
2410 </td><td>
2410 output the current or given revision of the project manifest
2411 output the current or given revision of the project manifest
2411 </td></tr>
2412 </td></tr>
2412 <tr><td>
2413 <tr><td>
2413 <a href="/help/nohelp">
2414 <a href="/help/nohelp">
2414 nohelp
2415 nohelp
2415 </a>
2416 </a>
2416 </td><td>
2417 </td><td>
2417 (no help text available)
2418 (no help text available)
2418 </td></tr>
2419 </td></tr>
2419 <tr><td>
2420 <tr><td>
2420 <a href="/help/outgoing">
2421 <a href="/help/outgoing">
2421 outgoing
2422 outgoing
2422 </a>
2423 </a>
2423 </td><td>
2424 </td><td>
2424 show changesets not found in the destination
2425 show changesets not found in the destination
2425 </td></tr>
2426 </td></tr>
2426 <tr><td>
2427 <tr><td>
2427 <a href="/help/paths">
2428 <a href="/help/paths">
2428 paths
2429 paths
2429 </a>
2430 </a>
2430 </td><td>
2431 </td><td>
2431 show aliases for remote repositories
2432 show aliases for remote repositories
2432 </td></tr>
2433 </td></tr>
2433 <tr><td>
2434 <tr><td>
2434 <a href="/help/phase">
2435 <a href="/help/phase">
2435 phase
2436 phase
2436 </a>
2437 </a>
2437 </td><td>
2438 </td><td>
2438 set or show the current phase name
2439 set or show the current phase name
2439 </td></tr>
2440 </td></tr>
2440 <tr><td>
2441 <tr><td>
2441 <a href="/help/recover">
2442 <a href="/help/recover">
2442 recover
2443 recover
2443 </a>
2444 </a>
2444 </td><td>
2445 </td><td>
2445 roll back an interrupted transaction
2446 roll back an interrupted transaction
2446 </td></tr>
2447 </td></tr>
2447 <tr><td>
2448 <tr><td>
2448 <a href="/help/rename">
2449 <a href="/help/rename">
2449 rename
2450 rename
2450 </a>
2451 </a>
2451 </td><td>
2452 </td><td>
2452 rename files; equivalent of copy + remove
2453 rename files; equivalent of copy + remove
2453 </td></tr>
2454 </td></tr>
2454 <tr><td>
2455 <tr><td>
2455 <a href="/help/resolve">
2456 <a href="/help/resolve">
2456 resolve
2457 resolve
2457 </a>
2458 </a>
2458 </td><td>
2459 </td><td>
2459 redo merges or set/view the merge status of files
2460 redo merges or set/view the merge status of files
2460 </td></tr>
2461 </td></tr>
2461 <tr><td>
2462 <tr><td>
2462 <a href="/help/revert">
2463 <a href="/help/revert">
2463 revert
2464 revert
2464 </a>
2465 </a>
2465 </td><td>
2466 </td><td>
2466 restore files to their checkout state
2467 restore files to their checkout state
2467 </td></tr>
2468 </td></tr>
2468 <tr><td>
2469 <tr><td>
2469 <a href="/help/root">
2470 <a href="/help/root">
2470 root
2471 root
2471 </a>
2472 </a>
2472 </td><td>
2473 </td><td>
2473 print the root (top) of the current working directory
2474 print the root (top) of the current working directory
2474 </td></tr>
2475 </td></tr>
2475 <tr><td>
2476 <tr><td>
2476 <a href="/help/shellalias">
2477 <a href="/help/shellalias">
2477 shellalias
2478 shellalias
2478 </a>
2479 </a>
2479 </td><td>
2480 </td><td>
2480 (no help text available)
2481 (no help text available)
2481 </td></tr>
2482 </td></tr>
2482 <tr><td>
2483 <tr><td>
2483 <a href="/help/tag">
2484 <a href="/help/tag">
2484 tag
2485 tag
2485 </a>
2486 </a>
2486 </td><td>
2487 </td><td>
2487 add one or more tags for the current or given revision
2488 add one or more tags for the current or given revision
2488 </td></tr>
2489 </td></tr>
2489 <tr><td>
2490 <tr><td>
2490 <a href="/help/tags">
2491 <a href="/help/tags">
2491 tags
2492 tags
2492 </a>
2493 </a>
2493 </td><td>
2494 </td><td>
2494 list repository tags
2495 list repository tags
2495 </td></tr>
2496 </td></tr>
2496 <tr><td>
2497 <tr><td>
2497 <a href="/help/unbundle">
2498 <a href="/help/unbundle">
2498 unbundle
2499 unbundle
2499 </a>
2500 </a>
2500 </td><td>
2501 </td><td>
2501 apply one or more bundle files
2502 apply one or more bundle files
2502 </td></tr>
2503 </td></tr>
2503 <tr><td>
2504 <tr><td>
2504 <a href="/help/verify">
2505 <a href="/help/verify">
2505 verify
2506 verify
2506 </a>
2507 </a>
2507 </td><td>
2508 </td><td>
2508 verify the integrity of the repository
2509 verify the integrity of the repository
2509 </td></tr>
2510 </td></tr>
2510 <tr><td>
2511 <tr><td>
2511 <a href="/help/version">
2512 <a href="/help/version">
2512 version
2513 version
2513 </a>
2514 </a>
2514 </td><td>
2515 </td><td>
2515 output version and copyright information
2516 output version and copyright information
2516 </td></tr>
2517 </td></tr>
2517
2518
2518
2519
2519 </table>
2520 </table>
2520 </div>
2521 </div>
2521 </div>
2522 </div>
2522
2523
2523
2524
2524
2525
2525 </body>
2526 </body>
2526 </html>
2527 </html>
2527
2528
2528
2529
2529 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2530 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2530 200 Script output follows
2531 200 Script output follows
2531
2532
2532 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2533 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2533 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2534 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2534 <head>
2535 <head>
2535 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2536 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2536 <meta name="robots" content="index, nofollow" />
2537 <meta name="robots" content="index, nofollow" />
2537 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2538 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2538 <script type="text/javascript" src="/static/mercurial.js"></script>
2539 <script type="text/javascript" src="/static/mercurial.js"></script>
2539
2540
2540 <title>Help: add</title>
2541 <title>Help: add</title>
2541 </head>
2542 </head>
2542 <body>
2543 <body>
2543
2544
2544 <div class="container">
2545 <div class="container">
2545 <div class="menu">
2546 <div class="menu">
2546 <div class="logo">
2547 <div class="logo">
2547 <a href="https://mercurial-scm.org/">
2548 <a href="https://mercurial-scm.org/">
2548 <img src="/static/hglogo.png" alt="mercurial" /></a>
2549 <img src="/static/hglogo.png" alt="mercurial" /></a>
2549 </div>
2550 </div>
2550 <ul>
2551 <ul>
2551 <li><a href="/shortlog">log</a></li>
2552 <li><a href="/shortlog">log</a></li>
2552 <li><a href="/graph">graph</a></li>
2553 <li><a href="/graph">graph</a></li>
2553 <li><a href="/tags">tags</a></li>
2554 <li><a href="/tags">tags</a></li>
2554 <li><a href="/bookmarks">bookmarks</a></li>
2555 <li><a href="/bookmarks">bookmarks</a></li>
2555 <li><a href="/branches">branches</a></li>
2556 <li><a href="/branches">branches</a></li>
2556 </ul>
2557 </ul>
2557 <ul>
2558 <ul>
2558 <li class="active"><a href="/help">help</a></li>
2559 <li class="active"><a href="/help">help</a></li>
2559 </ul>
2560 </ul>
2560 </div>
2561 </div>
2561
2562
2562 <div class="main">
2563 <div class="main">
2563 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2564 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2564 <h3>Help: add</h3>
2565 <h3>Help: add</h3>
2565
2566
2566 <form class="search" action="/log">
2567 <form class="search" action="/log">
2567
2568
2568 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2569 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2569 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2570 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2570 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2571 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2571 </form>
2572 </form>
2572 <div id="doc">
2573 <div id="doc">
2573 <p>
2574 <p>
2574 hg add [OPTION]... [FILE]...
2575 hg add [OPTION]... [FILE]...
2575 </p>
2576 </p>
2576 <p>
2577 <p>
2577 add the specified files on the next commit
2578 add the specified files on the next commit
2578 </p>
2579 </p>
2579 <p>
2580 <p>
2580 Schedule files to be version controlled and added to the
2581 Schedule files to be version controlled and added to the
2581 repository.
2582 repository.
2582 </p>
2583 </p>
2583 <p>
2584 <p>
2584 The files will be added to the repository at the next commit. To
2585 The files will be added to the repository at the next commit. To
2585 undo an add before that, see 'hg forget'.
2586 undo an add before that, see 'hg forget'.
2586 </p>
2587 </p>
2587 <p>
2588 <p>
2588 If no names are given, add all files to the repository (except
2589 If no names are given, add all files to the repository (except
2589 files matching &quot;.hgignore&quot;).
2590 files matching &quot;.hgignore&quot;).
2590 </p>
2591 </p>
2591 <p>
2592 <p>
2592 Examples:
2593 Examples:
2593 </p>
2594 </p>
2594 <ul>
2595 <ul>
2595 <li> New (unknown) files are added automatically by 'hg add':
2596 <li> New (unknown) files are added automatically by 'hg add':
2596 <pre>
2597 <pre>
2597 \$ ls (re)
2598 \$ ls (re)
2598 foo.c
2599 foo.c
2599 \$ hg status (re)
2600 \$ hg status (re)
2600 ? foo.c
2601 ? foo.c
2601 \$ hg add (re)
2602 \$ hg add (re)
2602 adding foo.c
2603 adding foo.c
2603 \$ hg status (re)
2604 \$ hg status (re)
2604 A foo.c
2605 A foo.c
2605 </pre>
2606 </pre>
2606 <li> Specific files to be added can be specified:
2607 <li> Specific files to be added can be specified:
2607 <pre>
2608 <pre>
2608 \$ ls (re)
2609 \$ ls (re)
2609 bar.c foo.c
2610 bar.c foo.c
2610 \$ hg status (re)
2611 \$ hg status (re)
2611 ? bar.c
2612 ? bar.c
2612 ? foo.c
2613 ? foo.c
2613 \$ hg add bar.c (re)
2614 \$ hg add bar.c (re)
2614 \$ hg status (re)
2615 \$ hg status (re)
2615 A bar.c
2616 A bar.c
2616 ? foo.c
2617 ? foo.c
2617 </pre>
2618 </pre>
2618 </ul>
2619 </ul>
2619 <p>
2620 <p>
2620 Returns 0 if all files are successfully added.
2621 Returns 0 if all files are successfully added.
2621 </p>
2622 </p>
2622 <p>
2623 <p>
2623 options ([+] can be repeated):
2624 options ([+] can be repeated):
2624 </p>
2625 </p>
2625 <table>
2626 <table>
2626 <tr><td>-I</td>
2627 <tr><td>-I</td>
2627 <td>--include PATTERN [+]</td>
2628 <td>--include PATTERN [+]</td>
2628 <td>include names matching the given patterns</td></tr>
2629 <td>include names matching the given patterns</td></tr>
2629 <tr><td>-X</td>
2630 <tr><td>-X</td>
2630 <td>--exclude PATTERN [+]</td>
2631 <td>--exclude PATTERN [+]</td>
2631 <td>exclude names matching the given patterns</td></tr>
2632 <td>exclude names matching the given patterns</td></tr>
2632 <tr><td>-S</td>
2633 <tr><td>-S</td>
2633 <td>--subrepos</td>
2634 <td>--subrepos</td>
2634 <td>recurse into subrepositories</td></tr>
2635 <td>recurse into subrepositories</td></tr>
2635 <tr><td>-n</td>
2636 <tr><td>-n</td>
2636 <td>--dry-run</td>
2637 <td>--dry-run</td>
2637 <td>do not perform actions, just print output</td></tr>
2638 <td>do not perform actions, just print output</td></tr>
2638 </table>
2639 </table>
2639 <p>
2640 <p>
2640 global options ([+] can be repeated):
2641 global options ([+] can be repeated):
2641 </p>
2642 </p>
2642 <table>
2643 <table>
2643 <tr><td>-R</td>
2644 <tr><td>-R</td>
2644 <td>--repository REPO</td>
2645 <td>--repository REPO</td>
2645 <td>repository root directory or name of overlay bundle file</td></tr>
2646 <td>repository root directory or name of overlay bundle file</td></tr>
2646 <tr><td></td>
2647 <tr><td></td>
2647 <td>--cwd DIR</td>
2648 <td>--cwd DIR</td>
2648 <td>change working directory</td></tr>
2649 <td>change working directory</td></tr>
2649 <tr><td>-y</td>
2650 <tr><td>-y</td>
2650 <td>--noninteractive</td>
2651 <td>--noninteractive</td>
2651 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2652 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2652 <tr><td>-q</td>
2653 <tr><td>-q</td>
2653 <td>--quiet</td>
2654 <td>--quiet</td>
2654 <td>suppress output</td></tr>
2655 <td>suppress output</td></tr>
2655 <tr><td>-v</td>
2656 <tr><td>-v</td>
2656 <td>--verbose</td>
2657 <td>--verbose</td>
2657 <td>enable additional output</td></tr>
2658 <td>enable additional output</td></tr>
2658 <tr><td></td>
2659 <tr><td></td>
2659 <td>--color TYPE</td>
2660 <td>--color TYPE</td>
2660 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2661 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2661 <tr><td></td>
2662 <tr><td></td>
2662 <td>--config CONFIG [+]</td>
2663 <td>--config CONFIG [+]</td>
2663 <td>set/override config option (use 'section.name=value')</td></tr>
2664 <td>set/override config option (use 'section.name=value')</td></tr>
2664 <tr><td></td>
2665 <tr><td></td>
2665 <td>--debug</td>
2666 <td>--debug</td>
2666 <td>enable debugging output</td></tr>
2667 <td>enable debugging output</td></tr>
2667 <tr><td></td>
2668 <tr><td></td>
2668 <td>--debugger</td>
2669 <td>--debugger</td>
2669 <td>start debugger</td></tr>
2670 <td>start debugger</td></tr>
2670 <tr><td></td>
2671 <tr><td></td>
2671 <td>--encoding ENCODE</td>
2672 <td>--encoding ENCODE</td>
2672 <td>set the charset encoding (default: ascii)</td></tr>
2673 <td>set the charset encoding (default: ascii)</td></tr>
2673 <tr><td></td>
2674 <tr><td></td>
2674 <td>--encodingmode MODE</td>
2675 <td>--encodingmode MODE</td>
2675 <td>set the charset encoding mode (default: strict)</td></tr>
2676 <td>set the charset encoding mode (default: strict)</td></tr>
2676 <tr><td></td>
2677 <tr><td></td>
2677 <td>--traceback</td>
2678 <td>--traceback</td>
2678 <td>always print a traceback on exception</td></tr>
2679 <td>always print a traceback on exception</td></tr>
2679 <tr><td></td>
2680 <tr><td></td>
2680 <td>--time</td>
2681 <td>--time</td>
2681 <td>time how long the command takes</td></tr>
2682 <td>time how long the command takes</td></tr>
2682 <tr><td></td>
2683 <tr><td></td>
2683 <td>--profile</td>
2684 <td>--profile</td>
2684 <td>print command execution profile</td></tr>
2685 <td>print command execution profile</td></tr>
2685 <tr><td></td>
2686 <tr><td></td>
2686 <td>--version</td>
2687 <td>--version</td>
2687 <td>output version information and exit</td></tr>
2688 <td>output version information and exit</td></tr>
2688 <tr><td>-h</td>
2689 <tr><td>-h</td>
2689 <td>--help</td>
2690 <td>--help</td>
2690 <td>display help and exit</td></tr>
2691 <td>display help and exit</td></tr>
2691 <tr><td></td>
2692 <tr><td></td>
2692 <td>--hidden</td>
2693 <td>--hidden</td>
2693 <td>consider hidden changesets</td></tr>
2694 <td>consider hidden changesets</td></tr>
2694 <tr><td></td>
2695 <tr><td></td>
2695 <td>--pager TYPE</td>
2696 <td>--pager TYPE</td>
2696 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2697 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2697 </table>
2698 </table>
2698
2699
2699 </div>
2700 </div>
2700 </div>
2701 </div>
2701 </div>
2702 </div>
2702
2703
2703
2704
2704
2705
2705 </body>
2706 </body>
2706 </html>
2707 </html>
2707
2708
2708
2709
2709 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2710 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2710 200 Script output follows
2711 200 Script output follows
2711
2712
2712 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2713 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2713 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2714 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2714 <head>
2715 <head>
2715 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2716 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2716 <meta name="robots" content="index, nofollow" />
2717 <meta name="robots" content="index, nofollow" />
2717 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2718 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2718 <script type="text/javascript" src="/static/mercurial.js"></script>
2719 <script type="text/javascript" src="/static/mercurial.js"></script>
2719
2720
2720 <title>Help: remove</title>
2721 <title>Help: remove</title>
2721 </head>
2722 </head>
2722 <body>
2723 <body>
2723
2724
2724 <div class="container">
2725 <div class="container">
2725 <div class="menu">
2726 <div class="menu">
2726 <div class="logo">
2727 <div class="logo">
2727 <a href="https://mercurial-scm.org/">
2728 <a href="https://mercurial-scm.org/">
2728 <img src="/static/hglogo.png" alt="mercurial" /></a>
2729 <img src="/static/hglogo.png" alt="mercurial" /></a>
2729 </div>
2730 </div>
2730 <ul>
2731 <ul>
2731 <li><a href="/shortlog">log</a></li>
2732 <li><a href="/shortlog">log</a></li>
2732 <li><a href="/graph">graph</a></li>
2733 <li><a href="/graph">graph</a></li>
2733 <li><a href="/tags">tags</a></li>
2734 <li><a href="/tags">tags</a></li>
2734 <li><a href="/bookmarks">bookmarks</a></li>
2735 <li><a href="/bookmarks">bookmarks</a></li>
2735 <li><a href="/branches">branches</a></li>
2736 <li><a href="/branches">branches</a></li>
2736 </ul>
2737 </ul>
2737 <ul>
2738 <ul>
2738 <li class="active"><a href="/help">help</a></li>
2739 <li class="active"><a href="/help">help</a></li>
2739 </ul>
2740 </ul>
2740 </div>
2741 </div>
2741
2742
2742 <div class="main">
2743 <div class="main">
2743 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2744 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2744 <h3>Help: remove</h3>
2745 <h3>Help: remove</h3>
2745
2746
2746 <form class="search" action="/log">
2747 <form class="search" action="/log">
2747
2748
2748 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2749 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2749 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2750 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2750 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2751 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2751 </form>
2752 </form>
2752 <div id="doc">
2753 <div id="doc">
2753 <p>
2754 <p>
2754 hg remove [OPTION]... FILE...
2755 hg remove [OPTION]... FILE...
2755 </p>
2756 </p>
2756 <p>
2757 <p>
2757 aliases: rm
2758 aliases: rm
2758 </p>
2759 </p>
2759 <p>
2760 <p>
2760 remove the specified files on the next commit
2761 remove the specified files on the next commit
2761 </p>
2762 </p>
2762 <p>
2763 <p>
2763 Schedule the indicated files for removal from the current branch.
2764 Schedule the indicated files for removal from the current branch.
2764 </p>
2765 </p>
2765 <p>
2766 <p>
2766 This command schedules the files to be removed at the next commit.
2767 This command schedules the files to be removed at the next commit.
2767 To undo a remove before that, see 'hg revert'. To undo added
2768 To undo a remove before that, see 'hg revert'. To undo added
2768 files, see 'hg forget'.
2769 files, see 'hg forget'.
2769 </p>
2770 </p>
2770 <p>
2771 <p>
2771 -A/--after can be used to remove only files that have already
2772 -A/--after can be used to remove only files that have already
2772 been deleted, -f/--force can be used to force deletion, and -Af
2773 been deleted, -f/--force can be used to force deletion, and -Af
2773 can be used to remove files from the next revision without
2774 can be used to remove files from the next revision without
2774 deleting them from the working directory.
2775 deleting them from the working directory.
2775 </p>
2776 </p>
2776 <p>
2777 <p>
2777 The following table details the behavior of remove for different
2778 The following table details the behavior of remove for different
2778 file states (columns) and option combinations (rows). The file
2779 file states (columns) and option combinations (rows). The file
2779 states are Added [A], Clean [C], Modified [M] and Missing [!]
2780 states are Added [A], Clean [C], Modified [M] and Missing [!]
2780 (as reported by 'hg status'). The actions are Warn, Remove
2781 (as reported by 'hg status'). The actions are Warn, Remove
2781 (from branch) and Delete (from disk):
2782 (from branch) and Delete (from disk):
2782 </p>
2783 </p>
2783 <table>
2784 <table>
2784 <tr><td>opt/state</td>
2785 <tr><td>opt/state</td>
2785 <td>A</td>
2786 <td>A</td>
2786 <td>C</td>
2787 <td>C</td>
2787 <td>M</td>
2788 <td>M</td>
2788 <td>!</td></tr>
2789 <td>!</td></tr>
2789 <tr><td>none</td>
2790 <tr><td>none</td>
2790 <td>W</td>
2791 <td>W</td>
2791 <td>RD</td>
2792 <td>RD</td>
2792 <td>W</td>
2793 <td>W</td>
2793 <td>R</td></tr>
2794 <td>R</td></tr>
2794 <tr><td>-f</td>
2795 <tr><td>-f</td>
2795 <td>R</td>
2796 <td>R</td>
2796 <td>RD</td>
2797 <td>RD</td>
2797 <td>RD</td>
2798 <td>RD</td>
2798 <td>R</td></tr>
2799 <td>R</td></tr>
2799 <tr><td>-A</td>
2800 <tr><td>-A</td>
2800 <td>W</td>
2801 <td>W</td>
2801 <td>W</td>
2802 <td>W</td>
2802 <td>W</td>
2803 <td>W</td>
2803 <td>R</td></tr>
2804 <td>R</td></tr>
2804 <tr><td>-Af</td>
2805 <tr><td>-Af</td>
2805 <td>R</td>
2806 <td>R</td>
2806 <td>R</td>
2807 <td>R</td>
2807 <td>R</td>
2808 <td>R</td>
2808 <td>R</td></tr>
2809 <td>R</td></tr>
2809 </table>
2810 </table>
2810 <p>
2811 <p>
2811 <b>Note:</b>
2812 <b>Note:</b>
2812 </p>
2813 </p>
2813 <p>
2814 <p>
2814 'hg remove' never deletes files in Added [A] state from the
2815 'hg remove' never deletes files in Added [A] state from the
2815 working directory, not even if &quot;--force&quot; is specified.
2816 working directory, not even if &quot;--force&quot; is specified.
2816 </p>
2817 </p>
2817 <p>
2818 <p>
2818 Returns 0 on success, 1 if any warnings encountered.
2819 Returns 0 on success, 1 if any warnings encountered.
2819 </p>
2820 </p>
2820 <p>
2821 <p>
2821 options ([+] can be repeated):
2822 options ([+] can be repeated):
2822 </p>
2823 </p>
2823 <table>
2824 <table>
2824 <tr><td>-A</td>
2825 <tr><td>-A</td>
2825 <td>--after</td>
2826 <td>--after</td>
2826 <td>record delete for missing files</td></tr>
2827 <td>record delete for missing files</td></tr>
2827 <tr><td>-f</td>
2828 <tr><td>-f</td>
2828 <td>--force</td>
2829 <td>--force</td>
2829 <td>forget added files, delete modified files</td></tr>
2830 <td>forget added files, delete modified files</td></tr>
2830 <tr><td>-S</td>
2831 <tr><td>-S</td>
2831 <td>--subrepos</td>
2832 <td>--subrepos</td>
2832 <td>recurse into subrepositories</td></tr>
2833 <td>recurse into subrepositories</td></tr>
2833 <tr><td>-I</td>
2834 <tr><td>-I</td>
2834 <td>--include PATTERN [+]</td>
2835 <td>--include PATTERN [+]</td>
2835 <td>include names matching the given patterns</td></tr>
2836 <td>include names matching the given patterns</td></tr>
2836 <tr><td>-X</td>
2837 <tr><td>-X</td>
2837 <td>--exclude PATTERN [+]</td>
2838 <td>--exclude PATTERN [+]</td>
2838 <td>exclude names matching the given patterns</td></tr>
2839 <td>exclude names matching the given patterns</td></tr>
2839 </table>
2840 </table>
2840 <p>
2841 <p>
2841 global options ([+] can be repeated):
2842 global options ([+] can be repeated):
2842 </p>
2843 </p>
2843 <table>
2844 <table>
2844 <tr><td>-R</td>
2845 <tr><td>-R</td>
2845 <td>--repository REPO</td>
2846 <td>--repository REPO</td>
2846 <td>repository root directory or name of overlay bundle file</td></tr>
2847 <td>repository root directory or name of overlay bundle file</td></tr>
2847 <tr><td></td>
2848 <tr><td></td>
2848 <td>--cwd DIR</td>
2849 <td>--cwd DIR</td>
2849 <td>change working directory</td></tr>
2850 <td>change working directory</td></tr>
2850 <tr><td>-y</td>
2851 <tr><td>-y</td>
2851 <td>--noninteractive</td>
2852 <td>--noninteractive</td>
2852 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2853 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2853 <tr><td>-q</td>
2854 <tr><td>-q</td>
2854 <td>--quiet</td>
2855 <td>--quiet</td>
2855 <td>suppress output</td></tr>
2856 <td>suppress output</td></tr>
2856 <tr><td>-v</td>
2857 <tr><td>-v</td>
2857 <td>--verbose</td>
2858 <td>--verbose</td>
2858 <td>enable additional output</td></tr>
2859 <td>enable additional output</td></tr>
2859 <tr><td></td>
2860 <tr><td></td>
2860 <td>--color TYPE</td>
2861 <td>--color TYPE</td>
2861 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2862 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2862 <tr><td></td>
2863 <tr><td></td>
2863 <td>--config CONFIG [+]</td>
2864 <td>--config CONFIG [+]</td>
2864 <td>set/override config option (use 'section.name=value')</td></tr>
2865 <td>set/override config option (use 'section.name=value')</td></tr>
2865 <tr><td></td>
2866 <tr><td></td>
2866 <td>--debug</td>
2867 <td>--debug</td>
2867 <td>enable debugging output</td></tr>
2868 <td>enable debugging output</td></tr>
2868 <tr><td></td>
2869 <tr><td></td>
2869 <td>--debugger</td>
2870 <td>--debugger</td>
2870 <td>start debugger</td></tr>
2871 <td>start debugger</td></tr>
2871 <tr><td></td>
2872 <tr><td></td>
2872 <td>--encoding ENCODE</td>
2873 <td>--encoding ENCODE</td>
2873 <td>set the charset encoding (default: ascii)</td></tr>
2874 <td>set the charset encoding (default: ascii)</td></tr>
2874 <tr><td></td>
2875 <tr><td></td>
2875 <td>--encodingmode MODE</td>
2876 <td>--encodingmode MODE</td>
2876 <td>set the charset encoding mode (default: strict)</td></tr>
2877 <td>set the charset encoding mode (default: strict)</td></tr>
2877 <tr><td></td>
2878 <tr><td></td>
2878 <td>--traceback</td>
2879 <td>--traceback</td>
2879 <td>always print a traceback on exception</td></tr>
2880 <td>always print a traceback on exception</td></tr>
2880 <tr><td></td>
2881 <tr><td></td>
2881 <td>--time</td>
2882 <td>--time</td>
2882 <td>time how long the command takes</td></tr>
2883 <td>time how long the command takes</td></tr>
2883 <tr><td></td>
2884 <tr><td></td>
2884 <td>--profile</td>
2885 <td>--profile</td>
2885 <td>print command execution profile</td></tr>
2886 <td>print command execution profile</td></tr>
2886 <tr><td></td>
2887 <tr><td></td>
2887 <td>--version</td>
2888 <td>--version</td>
2888 <td>output version information and exit</td></tr>
2889 <td>output version information and exit</td></tr>
2889 <tr><td>-h</td>
2890 <tr><td>-h</td>
2890 <td>--help</td>
2891 <td>--help</td>
2891 <td>display help and exit</td></tr>
2892 <td>display help and exit</td></tr>
2892 <tr><td></td>
2893 <tr><td></td>
2893 <td>--hidden</td>
2894 <td>--hidden</td>
2894 <td>consider hidden changesets</td></tr>
2895 <td>consider hidden changesets</td></tr>
2895 <tr><td></td>
2896 <tr><td></td>
2896 <td>--pager TYPE</td>
2897 <td>--pager TYPE</td>
2897 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2898 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2898 </table>
2899 </table>
2899
2900
2900 </div>
2901 </div>
2901 </div>
2902 </div>
2902 </div>
2903 </div>
2903
2904
2904
2905
2905
2906
2906 </body>
2907 </body>
2907 </html>
2908 </html>
2908
2909
2909
2910
2910 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2911 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2911 200 Script output follows
2912 200 Script output follows
2912
2913
2913 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2914 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2914 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2915 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2915 <head>
2916 <head>
2916 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2917 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2917 <meta name="robots" content="index, nofollow" />
2918 <meta name="robots" content="index, nofollow" />
2918 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2919 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2919 <script type="text/javascript" src="/static/mercurial.js"></script>
2920 <script type="text/javascript" src="/static/mercurial.js"></script>
2920
2921
2921 <title>Help: dates</title>
2922 <title>Help: dates</title>
2922 </head>
2923 </head>
2923 <body>
2924 <body>
2924
2925
2925 <div class="container">
2926 <div class="container">
2926 <div class="menu">
2927 <div class="menu">
2927 <div class="logo">
2928 <div class="logo">
2928 <a href="https://mercurial-scm.org/">
2929 <a href="https://mercurial-scm.org/">
2929 <img src="/static/hglogo.png" alt="mercurial" /></a>
2930 <img src="/static/hglogo.png" alt="mercurial" /></a>
2930 </div>
2931 </div>
2931 <ul>
2932 <ul>
2932 <li><a href="/shortlog">log</a></li>
2933 <li><a href="/shortlog">log</a></li>
2933 <li><a href="/graph">graph</a></li>
2934 <li><a href="/graph">graph</a></li>
2934 <li><a href="/tags">tags</a></li>
2935 <li><a href="/tags">tags</a></li>
2935 <li><a href="/bookmarks">bookmarks</a></li>
2936 <li><a href="/bookmarks">bookmarks</a></li>
2936 <li><a href="/branches">branches</a></li>
2937 <li><a href="/branches">branches</a></li>
2937 </ul>
2938 </ul>
2938 <ul>
2939 <ul>
2939 <li class="active"><a href="/help">help</a></li>
2940 <li class="active"><a href="/help">help</a></li>
2940 </ul>
2941 </ul>
2941 </div>
2942 </div>
2942
2943
2943 <div class="main">
2944 <div class="main">
2944 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2945 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2945 <h3>Help: dates</h3>
2946 <h3>Help: dates</h3>
2946
2947
2947 <form class="search" action="/log">
2948 <form class="search" action="/log">
2948
2949
2949 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2950 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2950 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2951 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2951 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2952 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2952 </form>
2953 </form>
2953 <div id="doc">
2954 <div id="doc">
2954 <h1>Date Formats</h1>
2955 <h1>Date Formats</h1>
2955 <p>
2956 <p>
2956 Some commands allow the user to specify a date, e.g.:
2957 Some commands allow the user to specify a date, e.g.:
2957 </p>
2958 </p>
2958 <ul>
2959 <ul>
2959 <li> backout, commit, import, tag: Specify the commit date.
2960 <li> backout, commit, import, tag: Specify the commit date.
2960 <li> log, revert, update: Select revision(s) by date.
2961 <li> log, revert, update: Select revision(s) by date.
2961 </ul>
2962 </ul>
2962 <p>
2963 <p>
2963 Many date formats are valid. Here are some examples:
2964 Many date formats are valid. Here are some examples:
2964 </p>
2965 </p>
2965 <ul>
2966 <ul>
2966 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2967 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2967 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2968 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2968 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2969 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2969 <li> &quot;Dec 6&quot; (midnight)
2970 <li> &quot;Dec 6&quot; (midnight)
2970 <li> &quot;13:18&quot; (today assumed)
2971 <li> &quot;13:18&quot; (today assumed)
2971 <li> &quot;3:39&quot; (3:39AM assumed)
2972 <li> &quot;3:39&quot; (3:39AM assumed)
2972 <li> &quot;3:39pm&quot; (15:39)
2973 <li> &quot;3:39pm&quot; (15:39)
2973 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2974 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2974 <li> &quot;2006-12-6 13:18&quot;
2975 <li> &quot;2006-12-6 13:18&quot;
2975 <li> &quot;2006-12-6&quot;
2976 <li> &quot;2006-12-6&quot;
2976 <li> &quot;12-6&quot;
2977 <li> &quot;12-6&quot;
2977 <li> &quot;12/6&quot;
2978 <li> &quot;12/6&quot;
2978 <li> &quot;12/6/6&quot; (Dec 6 2006)
2979 <li> &quot;12/6/6&quot; (Dec 6 2006)
2979 <li> &quot;today&quot; (midnight)
2980 <li> &quot;today&quot; (midnight)
2980 <li> &quot;yesterday&quot; (midnight)
2981 <li> &quot;yesterday&quot; (midnight)
2981 <li> &quot;now&quot; - right now
2982 <li> &quot;now&quot; - right now
2982 </ul>
2983 </ul>
2983 <p>
2984 <p>
2984 Lastly, there is Mercurial's internal format:
2985 Lastly, there is Mercurial's internal format:
2985 </p>
2986 </p>
2986 <ul>
2987 <ul>
2987 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
2988 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
2988 </ul>
2989 </ul>
2989 <p>
2990 <p>
2990 This is the internal representation format for dates. The first number
2991 This is the internal representation format for dates. The first number
2991 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2992 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2992 second is the offset of the local timezone, in seconds west of UTC
2993 second is the offset of the local timezone, in seconds west of UTC
2993 (negative if the timezone is east of UTC).
2994 (negative if the timezone is east of UTC).
2994 </p>
2995 </p>
2995 <p>
2996 <p>
2996 The log command also accepts date ranges:
2997 The log command also accepts date ranges:
2997 </p>
2998 </p>
2998 <ul>
2999 <ul>
2999 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3000 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3000 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3001 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3001 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3002 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3002 <li> &quot;-DAYS&quot; - within a given number of days of today
3003 <li> &quot;-DAYS&quot; - within a given number of days of today
3003 </ul>
3004 </ul>
3004
3005
3005 </div>
3006 </div>
3006 </div>
3007 </div>
3007 </div>
3008 </div>
3008
3009
3009
3010
3010
3011
3011 </body>
3012 </body>
3012 </html>
3013 </html>
3013
3014
3014
3015
3015 Sub-topic indexes rendered properly
3016 Sub-topic indexes rendered properly
3016
3017
3017 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3018 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3018 200 Script output follows
3019 200 Script output follows
3019
3020
3020 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3021 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3021 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3022 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3022 <head>
3023 <head>
3023 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3024 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3024 <meta name="robots" content="index, nofollow" />
3025 <meta name="robots" content="index, nofollow" />
3025 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3026 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3026 <script type="text/javascript" src="/static/mercurial.js"></script>
3027 <script type="text/javascript" src="/static/mercurial.js"></script>
3027
3028
3028 <title>Help: internals</title>
3029 <title>Help: internals</title>
3029 </head>
3030 </head>
3030 <body>
3031 <body>
3031
3032
3032 <div class="container">
3033 <div class="container">
3033 <div class="menu">
3034 <div class="menu">
3034 <div class="logo">
3035 <div class="logo">
3035 <a href="https://mercurial-scm.org/">
3036 <a href="https://mercurial-scm.org/">
3036 <img src="/static/hglogo.png" alt="mercurial" /></a>
3037 <img src="/static/hglogo.png" alt="mercurial" /></a>
3037 </div>
3038 </div>
3038 <ul>
3039 <ul>
3039 <li><a href="/shortlog">log</a></li>
3040 <li><a href="/shortlog">log</a></li>
3040 <li><a href="/graph">graph</a></li>
3041 <li><a href="/graph">graph</a></li>
3041 <li><a href="/tags">tags</a></li>
3042 <li><a href="/tags">tags</a></li>
3042 <li><a href="/bookmarks">bookmarks</a></li>
3043 <li><a href="/bookmarks">bookmarks</a></li>
3043 <li><a href="/branches">branches</a></li>
3044 <li><a href="/branches">branches</a></li>
3044 </ul>
3045 </ul>
3045 <ul>
3046 <ul>
3046 <li><a href="/help">help</a></li>
3047 <li><a href="/help">help</a></li>
3047 </ul>
3048 </ul>
3048 </div>
3049 </div>
3049
3050
3050 <div class="main">
3051 <div class="main">
3051 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3052 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3052
3053
3053 <form class="search" action="/log">
3054 <form class="search" action="/log">
3054
3055
3055 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3056 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3056 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3057 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3057 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3058 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3058 </form>
3059 </form>
3059 <table class="bigtable">
3060 <table class="bigtable">
3060 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3061 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3061
3062
3062 <tr><td>
3063 <tr><td>
3063 <a href="/help/internals.bundle2">
3064 <a href="/help/internals.bundle2">
3064 bundle2
3065 bundle2
3065 </a>
3066 </a>
3066 </td><td>
3067 </td><td>
3067 Bundle2
3068 Bundle2
3068 </td></tr>
3069 </td></tr>
3069 <tr><td>
3070 <tr><td>
3070 <a href="/help/internals.bundles">
3071 <a href="/help/internals.bundles">
3071 bundles
3072 bundles
3072 </a>
3073 </a>
3073 </td><td>
3074 </td><td>
3074 Bundles
3075 Bundles
3075 </td></tr>
3076 </td></tr>
3076 <tr><td>
3077 <tr><td>
3077 <a href="/help/internals.censor">
3078 <a href="/help/internals.censor">
3078 censor
3079 censor
3079 </a>
3080 </a>
3080 </td><td>
3081 </td><td>
3081 Censor
3082 Censor
3082 </td></tr>
3083 </td></tr>
3083 <tr><td>
3084 <tr><td>
3084 <a href="/help/internals.changegroups">
3085 <a href="/help/internals.changegroups">
3085 changegroups
3086 changegroups
3086 </a>
3087 </a>
3087 </td><td>
3088 </td><td>
3088 Changegroups
3089 Changegroups
3089 </td></tr>
3090 </td></tr>
3090 <tr><td>
3091 <tr><td>
3091 <a href="/help/internals.config">
3092 <a href="/help/internals.config">
3092 config
3093 config
3093 </a>
3094 </a>
3094 </td><td>
3095 </td><td>
3095 Config Registrar
3096 Config Registrar
3096 </td></tr>
3097 </td></tr>
3097 <tr><td>
3098 <tr><td>
3098 <a href="/help/internals.requirements">
3099 <a href="/help/internals.requirements">
3099 requirements
3100 requirements
3100 </a>
3101 </a>
3101 </td><td>
3102 </td><td>
3102 Repository Requirements
3103 Repository Requirements
3103 </td></tr>
3104 </td></tr>
3104 <tr><td>
3105 <tr><td>
3105 <a href="/help/internals.revlogs">
3106 <a href="/help/internals.revlogs">
3106 revlogs
3107 revlogs
3107 </a>
3108 </a>
3108 </td><td>
3109 </td><td>
3109 Revision Logs
3110 Revision Logs
3110 </td></tr>
3111 </td></tr>
3111 <tr><td>
3112 <tr><td>
3112 <a href="/help/internals.wireprotocol">
3113 <a href="/help/internals.wireprotocol">
3113 wireprotocol
3114 wireprotocol
3114 </a>
3115 </a>
3115 </td><td>
3116 </td><td>
3116 Wire Protocol
3117 Wire Protocol
3117 </td></tr>
3118 </td></tr>
3118
3119
3119
3120
3120
3121
3121
3122
3122
3123
3123 </table>
3124 </table>
3124 </div>
3125 </div>
3125 </div>
3126 </div>
3126
3127
3127
3128
3128
3129
3129 </body>
3130 </body>
3130 </html>
3131 </html>
3131
3132
3132
3133
3133 Sub-topic topics rendered properly
3134 Sub-topic topics rendered properly
3134
3135
3135 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3136 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3136 200 Script output follows
3137 200 Script output follows
3137
3138
3138 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3139 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3139 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3140 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3140 <head>
3141 <head>
3141 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3142 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3142 <meta name="robots" content="index, nofollow" />
3143 <meta name="robots" content="index, nofollow" />
3143 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3144 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3144 <script type="text/javascript" src="/static/mercurial.js"></script>
3145 <script type="text/javascript" src="/static/mercurial.js"></script>
3145
3146
3146 <title>Help: internals.changegroups</title>
3147 <title>Help: internals.changegroups</title>
3147 </head>
3148 </head>
3148 <body>
3149 <body>
3149
3150
3150 <div class="container">
3151 <div class="container">
3151 <div class="menu">
3152 <div class="menu">
3152 <div class="logo">
3153 <div class="logo">
3153 <a href="https://mercurial-scm.org/">
3154 <a href="https://mercurial-scm.org/">
3154 <img src="/static/hglogo.png" alt="mercurial" /></a>
3155 <img src="/static/hglogo.png" alt="mercurial" /></a>
3155 </div>
3156 </div>
3156 <ul>
3157 <ul>
3157 <li><a href="/shortlog">log</a></li>
3158 <li><a href="/shortlog">log</a></li>
3158 <li><a href="/graph">graph</a></li>
3159 <li><a href="/graph">graph</a></li>
3159 <li><a href="/tags">tags</a></li>
3160 <li><a href="/tags">tags</a></li>
3160 <li><a href="/bookmarks">bookmarks</a></li>
3161 <li><a href="/bookmarks">bookmarks</a></li>
3161 <li><a href="/branches">branches</a></li>
3162 <li><a href="/branches">branches</a></li>
3162 </ul>
3163 </ul>
3163 <ul>
3164 <ul>
3164 <li class="active"><a href="/help">help</a></li>
3165 <li class="active"><a href="/help">help</a></li>
3165 </ul>
3166 </ul>
3166 </div>
3167 </div>
3167
3168
3168 <div class="main">
3169 <div class="main">
3169 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3170 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3170 <h3>Help: internals.changegroups</h3>
3171 <h3>Help: internals.changegroups</h3>
3171
3172
3172 <form class="search" action="/log">
3173 <form class="search" action="/log">
3173
3174
3174 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3175 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3175 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3176 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3176 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3177 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3177 </form>
3178 </form>
3178 <div id="doc">
3179 <div id="doc">
3179 <h1>Changegroups</h1>
3180 <h1>Changegroups</h1>
3180 <p>
3181 <p>
3181 Changegroups are representations of repository revlog data, specifically
3182 Changegroups are representations of repository revlog data, specifically
3182 the changelog data, root/flat manifest data, treemanifest data, and
3183 the changelog data, root/flat manifest data, treemanifest data, and
3183 filelogs.
3184 filelogs.
3184 </p>
3185 </p>
3185 <p>
3186 <p>
3186 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3187 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3187 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3188 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3188 only difference being an additional item in the *delta header*. Version
3189 only difference being an additional item in the *delta header*. Version
3189 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3190 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3190 exchanging treemanifests (enabled by setting an option on the
3191 exchanging treemanifests (enabled by setting an option on the
3191 &quot;changegroup&quot; part in the bundle2).
3192 &quot;changegroup&quot; part in the bundle2).
3192 </p>
3193 </p>
3193 <p>
3194 <p>
3194 Changegroups when not exchanging treemanifests consist of 3 logical
3195 Changegroups when not exchanging treemanifests consist of 3 logical
3195 segments:
3196 segments:
3196 </p>
3197 </p>
3197 <pre>
3198 <pre>
3198 +---------------------------------+
3199 +---------------------------------+
3199 | | | |
3200 | | | |
3200 | changeset | manifest | filelogs |
3201 | changeset | manifest | filelogs |
3201 | | | |
3202 | | | |
3202 | | | |
3203 | | | |
3203 +---------------------------------+
3204 +---------------------------------+
3204 </pre>
3205 </pre>
3205 <p>
3206 <p>
3206 When exchanging treemanifests, there are 4 logical segments:
3207 When exchanging treemanifests, there are 4 logical segments:
3207 </p>
3208 </p>
3208 <pre>
3209 <pre>
3209 +-------------------------------------------------+
3210 +-------------------------------------------------+
3210 | | | | |
3211 | | | | |
3211 | changeset | root | treemanifests | filelogs |
3212 | changeset | root | treemanifests | filelogs |
3212 | | manifest | | |
3213 | | manifest | | |
3213 | | | | |
3214 | | | | |
3214 +-------------------------------------------------+
3215 +-------------------------------------------------+
3215 </pre>
3216 </pre>
3216 <p>
3217 <p>
3217 The principle building block of each segment is a *chunk*. A *chunk*
3218 The principle building block of each segment is a *chunk*. A *chunk*
3218 is a framed piece of data:
3219 is a framed piece of data:
3219 </p>
3220 </p>
3220 <pre>
3221 <pre>
3221 +---------------------------------------+
3222 +---------------------------------------+
3222 | | |
3223 | | |
3223 | length | data |
3224 | length | data |
3224 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3225 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3225 | | |
3226 | | |
3226 +---------------------------------------+
3227 +---------------------------------------+
3227 </pre>
3228 </pre>
3228 <p>
3229 <p>
3229 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3230 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3230 integer indicating the length of the entire chunk (including the length field
3231 integer indicating the length of the entire chunk (including the length field
3231 itself).
3232 itself).
3232 </p>
3233 </p>
3233 <p>
3234 <p>
3234 There is a special case chunk that has a value of 0 for the length
3235 There is a special case chunk that has a value of 0 for the length
3235 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3236 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3236 </p>
3237 </p>
3237 <h2>Delta Groups</h2>
3238 <h2>Delta Groups</h2>
3238 <p>
3239 <p>
3239 A *delta group* expresses the content of a revlog as a series of deltas,
3240 A *delta group* expresses the content of a revlog as a series of deltas,
3240 or patches against previous revisions.
3241 or patches against previous revisions.
3241 </p>
3242 </p>
3242 <p>
3243 <p>
3243 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3244 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3244 to signal the end of the delta group:
3245 to signal the end of the delta group:
3245 </p>
3246 </p>
3246 <pre>
3247 <pre>
3247 +------------------------------------------------------------------------+
3248 +------------------------------------------------------------------------+
3248 | | | | | |
3249 | | | | | |
3249 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3250 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3250 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3251 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3251 | | | | | |
3252 | | | | | |
3252 +------------------------------------------------------------------------+
3253 +------------------------------------------------------------------------+
3253 </pre>
3254 </pre>
3254 <p>
3255 <p>
3255 Each *chunk*'s data consists of the following:
3256 Each *chunk*'s data consists of the following:
3256 </p>
3257 </p>
3257 <pre>
3258 <pre>
3258 +---------------------------------------+
3259 +---------------------------------------+
3259 | | |
3260 | | |
3260 | delta header | delta data |
3261 | delta header | delta data |
3261 | (various by version) | (various) |
3262 | (various by version) | (various) |
3262 | | |
3263 | | |
3263 +---------------------------------------+
3264 +---------------------------------------+
3264 </pre>
3265 </pre>
3265 <p>
3266 <p>
3266 The *delta data* is a series of *delta*s that describe a diff from an existing
3267 The *delta data* is a series of *delta*s that describe a diff from an existing
3267 entry (either that the recipient already has, or previously specified in the
3268 entry (either that the recipient already has, or previously specified in the
3268 bundle/changegroup).
3269 bundle/changegroup).
3269 </p>
3270 </p>
3270 <p>
3271 <p>
3271 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3272 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3272 &quot;3&quot; of the changegroup format.
3273 &quot;3&quot; of the changegroup format.
3273 </p>
3274 </p>
3274 <p>
3275 <p>
3275 Version 1 (headerlen=80):
3276 Version 1 (headerlen=80):
3276 </p>
3277 </p>
3277 <pre>
3278 <pre>
3278 +------------------------------------------------------+
3279 +------------------------------------------------------+
3279 | | | | |
3280 | | | | |
3280 | node | p1 node | p2 node | link node |
3281 | node | p1 node | p2 node | link node |
3281 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3282 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3282 | | | | |
3283 | | | | |
3283 +------------------------------------------------------+
3284 +------------------------------------------------------+
3284 </pre>
3285 </pre>
3285 <p>
3286 <p>
3286 Version 2 (headerlen=100):
3287 Version 2 (headerlen=100):
3287 </p>
3288 </p>
3288 <pre>
3289 <pre>
3289 +------------------------------------------------------------------+
3290 +------------------------------------------------------------------+
3290 | | | | | |
3291 | | | | | |
3291 | node | p1 node | p2 node | base node | link node |
3292 | node | p1 node | p2 node | base node | link node |
3292 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3293 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3293 | | | | | |
3294 | | | | | |
3294 +------------------------------------------------------------------+
3295 +------------------------------------------------------------------+
3295 </pre>
3296 </pre>
3296 <p>
3297 <p>
3297 Version 3 (headerlen=102):
3298 Version 3 (headerlen=102):
3298 </p>
3299 </p>
3299 <pre>
3300 <pre>
3300 +------------------------------------------------------------------------------+
3301 +------------------------------------------------------------------------------+
3301 | | | | | | |
3302 | | | | | | |
3302 | node | p1 node | p2 node | base node | link node | flags |
3303 | node | p1 node | p2 node | base node | link node | flags |
3303 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3304 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3304 | | | | | | |
3305 | | | | | | |
3305 +------------------------------------------------------------------------------+
3306 +------------------------------------------------------------------------------+
3306 </pre>
3307 </pre>
3307 <p>
3308 <p>
3308 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3309 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3309 series of *delta*s, densely packed (no separators). These deltas describe a diff
3310 series of *delta*s, densely packed (no separators). These deltas describe a diff
3310 from an existing entry (either that the recipient already has, or previously
3311 from an existing entry (either that the recipient already has, or previously
3311 specified in the bundle/changegroup). The format is described more fully in
3312 specified in the bundle/changegroup). The format is described more fully in
3312 &quot;hg help internals.bdiff&quot;, but briefly:
3313 &quot;hg help internals.bdiff&quot;, but briefly:
3313 </p>
3314 </p>
3314 <pre>
3315 <pre>
3315 +---------------------------------------------------------------+
3316 +---------------------------------------------------------------+
3316 | | | | |
3317 | | | | |
3317 | start offset | end offset | new length | content |
3318 | start offset | end offset | new length | content |
3318 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3319 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3319 | | | | |
3320 | | | | |
3320 +---------------------------------------------------------------+
3321 +---------------------------------------------------------------+
3321 </pre>
3322 </pre>
3322 <p>
3323 <p>
3323 Please note that the length field in the delta data does *not* include itself.
3324 Please note that the length field in the delta data does *not* include itself.
3324 </p>
3325 </p>
3325 <p>
3326 <p>
3326 In version 1, the delta is always applied against the previous node from
3327 In version 1, the delta is always applied against the previous node from
3327 the changegroup or the first parent if this is the first entry in the
3328 the changegroup or the first parent if this is the first entry in the
3328 changegroup.
3329 changegroup.
3329 </p>
3330 </p>
3330 <p>
3331 <p>
3331 In version 2 and up, the delta base node is encoded in the entry in the
3332 In version 2 and up, the delta base node is encoded in the entry in the
3332 changegroup. This allows the delta to be expressed against any parent,
3333 changegroup. This allows the delta to be expressed against any parent,
3333 which can result in smaller deltas and more efficient encoding of data.
3334 which can result in smaller deltas and more efficient encoding of data.
3334 </p>
3335 </p>
3335 <h2>Changeset Segment</h2>
3336 <h2>Changeset Segment</h2>
3336 <p>
3337 <p>
3337 The *changeset segment* consists of a single *delta group* holding
3338 The *changeset segment* consists of a single *delta group* holding
3338 changelog data. The *empty chunk* at the end of the *delta group* denotes
3339 changelog data. The *empty chunk* at the end of the *delta group* denotes
3339 the boundary to the *manifest segment*.
3340 the boundary to the *manifest segment*.
3340 </p>
3341 </p>
3341 <h2>Manifest Segment</h2>
3342 <h2>Manifest Segment</h2>
3342 <p>
3343 <p>
3343 The *manifest segment* consists of a single *delta group* holding manifest
3344 The *manifest segment* consists of a single *delta group* holding manifest
3344 data. If treemanifests are in use, it contains only the manifest for the
3345 data. If treemanifests are in use, it contains only the manifest for the
3345 root directory of the repository. Otherwise, it contains the entire
3346 root directory of the repository. Otherwise, it contains the entire
3346 manifest data. The *empty chunk* at the end of the *delta group* denotes
3347 manifest data. The *empty chunk* at the end of the *delta group* denotes
3347 the boundary to the next segment (either the *treemanifests segment* or the
3348 the boundary to the next segment (either the *treemanifests segment* or the
3348 *filelogs segment*, depending on version and the request options).
3349 *filelogs segment*, depending on version and the request options).
3349 </p>
3350 </p>
3350 <h3>Treemanifests Segment</h3>
3351 <h3>Treemanifests Segment</h3>
3351 <p>
3352 <p>
3352 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3353 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3353 only if the 'treemanifest' param is part of the bundle2 changegroup part
3354 only if the 'treemanifest' param is part of the bundle2 changegroup part
3354 (it is not possible to use changegroup version 3 outside of bundle2).
3355 (it is not possible to use changegroup version 3 outside of bundle2).
3355 Aside from the filenames in the *treemanifests segment* containing a
3356 Aside from the filenames in the *treemanifests segment* containing a
3356 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3357 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3357 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3358 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3358 a sub-segment with filename size 0). This denotes the boundary to the
3359 a sub-segment with filename size 0). This denotes the boundary to the
3359 *filelogs segment*.
3360 *filelogs segment*.
3360 </p>
3361 </p>
3361 <h2>Filelogs Segment</h2>
3362 <h2>Filelogs Segment</h2>
3362 <p>
3363 <p>
3363 The *filelogs segment* consists of multiple sub-segments, each
3364 The *filelogs segment* consists of multiple sub-segments, each
3364 corresponding to an individual file whose data is being described:
3365 corresponding to an individual file whose data is being described:
3365 </p>
3366 </p>
3366 <pre>
3367 <pre>
3367 +--------------------------------------------------+
3368 +--------------------------------------------------+
3368 | | | | | |
3369 | | | | | |
3369 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3370 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3370 | | | | | (4 bytes) |
3371 | | | | | (4 bytes) |
3371 | | | | | |
3372 | | | | | |
3372 +--------------------------------------------------+
3373 +--------------------------------------------------+
3373 </pre>
3374 </pre>
3374 <p>
3375 <p>
3375 The final filelog sub-segment is followed by an *empty chunk* (logically,
3376 The final filelog sub-segment is followed by an *empty chunk* (logically,
3376 a sub-segment with filename size 0). This denotes the end of the segment
3377 a sub-segment with filename size 0). This denotes the end of the segment
3377 and of the overall changegroup.
3378 and of the overall changegroup.
3378 </p>
3379 </p>
3379 <p>
3380 <p>
3380 Each filelog sub-segment consists of the following:
3381 Each filelog sub-segment consists of the following:
3381 </p>
3382 </p>
3382 <pre>
3383 <pre>
3383 +------------------------------------------------------+
3384 +------------------------------------------------------+
3384 | | | |
3385 | | | |
3385 | filename length | filename | delta group |
3386 | filename length | filename | delta group |
3386 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3387 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3387 | | | |
3388 | | | |
3388 +------------------------------------------------------+
3389 +------------------------------------------------------+
3389 </pre>
3390 </pre>
3390 <p>
3391 <p>
3391 That is, a *chunk* consisting of the filename (not terminated or padded)
3392 That is, a *chunk* consisting of the filename (not terminated or padded)
3392 followed by N chunks constituting the *delta group* for this file. The
3393 followed by N chunks constituting the *delta group* for this file. The
3393 *empty chunk* at the end of each *delta group* denotes the boundary to the
3394 *empty chunk* at the end of each *delta group* denotes the boundary to the
3394 next filelog sub-segment.
3395 next filelog sub-segment.
3395 </p>
3396 </p>
3396
3397
3397 </div>
3398 </div>
3398 </div>
3399 </div>
3399 </div>
3400 </div>
3400
3401
3401
3402
3402
3403
3403 </body>
3404 </body>
3404 </html>
3405 </html>
3405
3406
3406
3407
3407 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
3408 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
3408 404 Not Found
3409 404 Not Found
3409
3410
3410 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3411 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3411 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3412 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3412 <head>
3413 <head>
3413 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3414 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3414 <meta name="robots" content="index, nofollow" />
3415 <meta name="robots" content="index, nofollow" />
3415 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3416 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3416 <script type="text/javascript" src="/static/mercurial.js"></script>
3417 <script type="text/javascript" src="/static/mercurial.js"></script>
3417
3418
3418 <title>test: error</title>
3419 <title>test: error</title>
3419 </head>
3420 </head>
3420 <body>
3421 <body>
3421
3422
3422 <div class="container">
3423 <div class="container">
3423 <div class="menu">
3424 <div class="menu">
3424 <div class="logo">
3425 <div class="logo">
3425 <a href="https://mercurial-scm.org/">
3426 <a href="https://mercurial-scm.org/">
3426 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
3427 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
3427 </div>
3428 </div>
3428 <ul>
3429 <ul>
3429 <li><a href="/shortlog">log</a></li>
3430 <li><a href="/shortlog">log</a></li>
3430 <li><a href="/graph">graph</a></li>
3431 <li><a href="/graph">graph</a></li>
3431 <li><a href="/tags">tags</a></li>
3432 <li><a href="/tags">tags</a></li>
3432 <li><a href="/bookmarks">bookmarks</a></li>
3433 <li><a href="/bookmarks">bookmarks</a></li>
3433 <li><a href="/branches">branches</a></li>
3434 <li><a href="/branches">branches</a></li>
3434 </ul>
3435 </ul>
3435 <ul>
3436 <ul>
3436 <li><a href="/help">help</a></li>
3437 <li><a href="/help">help</a></li>
3437 </ul>
3438 </ul>
3438 </div>
3439 </div>
3439
3440
3440 <div class="main">
3441 <div class="main">
3441
3442
3442 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3443 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3443 <h3>error</h3>
3444 <h3>error</h3>
3444
3445
3445
3446
3446 <form class="search" action="/log">
3447 <form class="search" action="/log">
3447
3448
3448 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3449 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3449 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3450 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3450 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3451 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3451 </form>
3452 </form>
3452
3453
3453 <div class="description">
3454 <div class="description">
3454 <p>
3455 <p>
3455 An error occurred while processing your request:
3456 An error occurred while processing your request:
3456 </p>
3457 </p>
3457 <p>
3458 <p>
3458 Not Found
3459 Not Found
3459 </p>
3460 </p>
3460 </div>
3461 </div>
3461 </div>
3462 </div>
3462 </div>
3463 </div>
3463
3464
3464
3465
3465
3466
3466 </body>
3467 </body>
3467 </html>
3468 </html>
3468
3469
3469 [1]
3470 [1]
3470
3471
3471 $ killdaemons.py
3472 $ killdaemons.py
3472
3473
3473 #endif
3474 #endif
@@ -1,635 +1,672 b''
1 $ cat >> $HGRCPATH << EOF
1 $ cat >> $HGRCPATH << EOF
2 > [ui]
2 > [ui]
3 > ssh = $PYTHON "$TESTDIR/dummyssh"
3 > ssh = $PYTHON "$TESTDIR/dummyssh"
4 > [devel]
4 > [devel]
5 > debug.peer-request = true
5 > debug.peer-request = true
6 > [extensions]
6 > [extensions]
7 > sshprotoext = $TESTDIR/sshprotoext.py
7 > sshprotoext = $TESTDIR/sshprotoext.py
8 > EOF
8 > EOF
9
9
10 $ hg init server
10 $ hg init server
11 $ cd server
11 $ cd server
12 $ echo 0 > foo
12 $ echo 0 > foo
13 $ hg -q add foo
13 $ hg -q add foo
14 $ hg commit -m initial
14 $ hg commit -m initial
15 $ cd ..
15 $ cd ..
16
16
17 Test a normal behaving server, for sanity
17 Test a normal behaving server, for sanity
18
18
19 $ hg --debug debugpeer ssh://user@dummy/server
19 $ hg --debug debugpeer ssh://user@dummy/server
20 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
20 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
21 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
21 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
22 devel-peer-request: hello
22 devel-peer-request: hello
23 sending hello command
23 sending hello command
24 devel-peer-request: between
24 devel-peer-request: between
25 devel-peer-request: pairs: 81 bytes
25 devel-peer-request: pairs: 81 bytes
26 sending between command
26 sending between command
27 remote: 384
27 remote: 384
28 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
28 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
29 remote: 1
29 remote: 1
30 url: ssh://user@dummy/server
30 url: ssh://user@dummy/server
31 local: no
31 local: no
32 pushable: yes
32 pushable: yes
33
33
34 Server should answer the "hello" command in isolation
34 Server should answer the "hello" command in isolation
35
35
36 $ hg -R server serve --stdio << EOF
36 $ hg -R server serve --stdio << EOF
37 > hello
37 > hello
38 > EOF
38 > EOF
39 384
39 384
40 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
40 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
41
41
42 `hg debugserve --sshstdio` works
43
44 $ cd server
45 $ hg debugserve --sshstdio << EOF
46 > hello
47 > EOF
48 384
49 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
50
51 I/O logging works
52
53 $ hg debugserve --sshstdio --logiofd 1 << EOF
54 > hello
55 > EOF
56 o> write(4) -> None:
57 o> 384\n
58 o> write(384) -> None:
59 o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n
60 384
61 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
62 o> flush() -> None
63
64 $ hg debugserve --sshstdio --logiofile $TESTTMP/io << EOF
65 > hello
66 > EOF
67 384
68 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
69
70 $ cat $TESTTMP/io
71 o> write(4) -> None:
72 o> 384\n
73 o> write(384) -> None:
74 o> capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN\n
75 o> flush() -> None
76
77 $ cd ..
78
42 >=0.9.1 clients send a "hello" + "between" for the null range as part of handshake.
79 >=0.9.1 clients send a "hello" + "between" for the null range as part of handshake.
43 Server should reply with capabilities and should send "1\n\n" as a successful
80 Server should reply with capabilities and should send "1\n\n" as a successful
44 reply with empty response to the "between".
81 reply with empty response to the "between".
45
82
46 $ hg -R server serve --stdio << EOF
83 $ hg -R server serve --stdio << EOF
47 > hello
84 > hello
48 > between
85 > between
49 > pairs 81
86 > pairs 81
50 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
87 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
51 > EOF
88 > EOF
52 384
89 384
53 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
90 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
54 1
91 1
55
92
56
93
57 SSH banner is not printed by default, ignored by clients
94 SSH banner is not printed by default, ignored by clients
58
95
59 $ SSHSERVERMODE=banner hg debugpeer ssh://user@dummy/server
96 $ SSHSERVERMODE=banner hg debugpeer ssh://user@dummy/server
60 url: ssh://user@dummy/server
97 url: ssh://user@dummy/server
61 local: no
98 local: no
62 pushable: yes
99 pushable: yes
63
100
64 --debug will print the banner
101 --debug will print the banner
65
102
66 $ SSHSERVERMODE=banner hg --debug debugpeer ssh://user@dummy/server
103 $ SSHSERVERMODE=banner hg --debug debugpeer ssh://user@dummy/server
67 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
104 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
68 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
105 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
69 devel-peer-request: hello
106 devel-peer-request: hello
70 sending hello command
107 sending hello command
71 devel-peer-request: between
108 devel-peer-request: between
72 devel-peer-request: pairs: 81 bytes
109 devel-peer-request: pairs: 81 bytes
73 sending between command
110 sending between command
74 remote: banner: line 0
111 remote: banner: line 0
75 remote: banner: line 1
112 remote: banner: line 1
76 remote: banner: line 2
113 remote: banner: line 2
77 remote: banner: line 3
114 remote: banner: line 3
78 remote: banner: line 4
115 remote: banner: line 4
79 remote: banner: line 5
116 remote: banner: line 5
80 remote: banner: line 6
117 remote: banner: line 6
81 remote: banner: line 7
118 remote: banner: line 7
82 remote: banner: line 8
119 remote: banner: line 8
83 remote: banner: line 9
120 remote: banner: line 9
84 remote: 384
121 remote: 384
85 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
122 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
86 remote: 1
123 remote: 1
87 url: ssh://user@dummy/server
124 url: ssh://user@dummy/server
88 local: no
125 local: no
89 pushable: yes
126 pushable: yes
90
127
91 And test the banner with the raw protocol
128 And test the banner with the raw protocol
92
129
93 $ SSHSERVERMODE=banner hg -R server serve --stdio << EOF
130 $ SSHSERVERMODE=banner hg -R server serve --stdio << EOF
94 > hello
131 > hello
95 > between
132 > between
96 > pairs 81
133 > pairs 81
97 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
134 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
98 > EOF
135 > EOF
99 banner: line 0
136 banner: line 0
100 banner: line 1
137 banner: line 1
101 banner: line 2
138 banner: line 2
102 banner: line 3
139 banner: line 3
103 banner: line 4
140 banner: line 4
104 banner: line 5
141 banner: line 5
105 banner: line 6
142 banner: line 6
106 banner: line 7
143 banner: line 7
107 banner: line 8
144 banner: line 8
108 banner: line 9
145 banner: line 9
109 384
146 384
110 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
147 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
111 1
148 1
112
149
113
150
114 Connecting to a <0.9.1 server that doesn't support the hello command.
151 Connecting to a <0.9.1 server that doesn't support the hello command.
115 The client should refuse, as we dropped support for connecting to such
152 The client should refuse, as we dropped support for connecting to such
116 servers.
153 servers.
117
154
118 $ SSHSERVERMODE=no-hello hg --debug debugpeer ssh://user@dummy/server
155 $ SSHSERVERMODE=no-hello hg --debug debugpeer ssh://user@dummy/server
119 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
156 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
120 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
157 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
121 devel-peer-request: hello
158 devel-peer-request: hello
122 sending hello command
159 sending hello command
123 devel-peer-request: between
160 devel-peer-request: between
124 devel-peer-request: pairs: 81 bytes
161 devel-peer-request: pairs: 81 bytes
125 sending between command
162 sending between command
126 remote: 0
163 remote: 0
127 remote: 1
164 remote: 1
128 abort: no suitable response from remote hg!
165 abort: no suitable response from remote hg!
129 [255]
166 [255]
130
167
131 Sending an unknown command to the server results in an empty response to that command
168 Sending an unknown command to the server results in an empty response to that command
132
169
133 $ hg -R server serve --stdio << EOF
170 $ hg -R server serve --stdio << EOF
134 > pre-hello
171 > pre-hello
135 > hello
172 > hello
136 > between
173 > between
137 > pairs 81
174 > pairs 81
138 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
175 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
139 > EOF
176 > EOF
140 0
177 0
141 384
178 384
142 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
179 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
143 1
180 1
144
181
145
182
146 $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-no-args --debug debugpeer ssh://user@dummy/server
183 $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-no-args --debug debugpeer ssh://user@dummy/server
147 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
184 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
148 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
185 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
149 sending no-args command
186 sending no-args command
150 devel-peer-request: hello
187 devel-peer-request: hello
151 sending hello command
188 sending hello command
152 devel-peer-request: between
189 devel-peer-request: between
153 devel-peer-request: pairs: 81 bytes
190 devel-peer-request: pairs: 81 bytes
154 sending between command
191 sending between command
155 remote: 0
192 remote: 0
156 remote: 384
193 remote: 384
157 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
194 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
158 remote: 1
195 remote: 1
159 url: ssh://user@dummy/server
196 url: ssh://user@dummy/server
160 local: no
197 local: no
161 pushable: yes
198 pushable: yes
162
199
163 Send multiple unknown commands before hello
200 Send multiple unknown commands before hello
164
201
165 $ hg -R server serve --stdio << EOF
202 $ hg -R server serve --stdio << EOF
166 > unknown1
203 > unknown1
167 > unknown2
204 > unknown2
168 > unknown3
205 > unknown3
169 > hello
206 > hello
170 > between
207 > between
171 > pairs 81
208 > pairs 81
172 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
209 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
173 > EOF
210 > EOF
174 0
211 0
175 0
212 0
176 0
213 0
177 384
214 384
178 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
215 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
179 1
216 1
180
217
181
218
182 $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-multiple-no-args --debug debugpeer ssh://user@dummy/server
219 $ hg --config sshpeer.mode=extra-handshake-commands --config sshpeer.handshake-mode=pre-multiple-no-args --debug debugpeer ssh://user@dummy/server
183 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
220 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
184 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
221 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
185 sending unknown1 command
222 sending unknown1 command
186 sending unknown2 command
223 sending unknown2 command
187 sending unknown3 command
224 sending unknown3 command
188 devel-peer-request: hello
225 devel-peer-request: hello
189 sending hello command
226 sending hello command
190 devel-peer-request: between
227 devel-peer-request: between
191 devel-peer-request: pairs: 81 bytes
228 devel-peer-request: pairs: 81 bytes
192 sending between command
229 sending between command
193 remote: 0
230 remote: 0
194 remote: 0
231 remote: 0
195 remote: 0
232 remote: 0
196 remote: 384
233 remote: 384
197 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
234 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
198 remote: 1
235 remote: 1
199 url: ssh://user@dummy/server
236 url: ssh://user@dummy/server
200 local: no
237 local: no
201 pushable: yes
238 pushable: yes
202
239
203 Send an unknown command before hello that has arguments
240 Send an unknown command before hello that has arguments
204
241
205 $ hg -R server serve --stdio << EOF
242 $ hg -R server serve --stdio << EOF
206 > with-args
243 > with-args
207 > foo 13
244 > foo 13
208 > value for foo
245 > value for foo
209 > bar 13
246 > bar 13
210 > value for bar
247 > value for bar
211 > hello
248 > hello
212 > between
249 > between
213 > pairs 81
250 > pairs 81
214 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
251 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
215 > EOF
252 > EOF
216 0
253 0
217 0
254 0
218 0
255 0
219 0
256 0
220 0
257 0
221 384
258 384
222 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
259 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
223 1
260 1
224
261
225
262
226 Send an unknown command having an argument that looks numeric
263 Send an unknown command having an argument that looks numeric
227
264
228 $ hg -R server serve --stdio << EOF
265 $ hg -R server serve --stdio << EOF
229 > unknown
266 > unknown
230 > foo 1
267 > foo 1
231 > 0
268 > 0
232 > hello
269 > hello
233 > between
270 > between
234 > pairs 81
271 > pairs 81
235 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
272 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
236 > EOF
273 > EOF
237 0
274 0
238 0
275 0
239 0
276 0
240 384
277 384
241 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
278 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
242 1
279 1
243
280
244
281
245 $ hg -R server serve --stdio << EOF
282 $ hg -R server serve --stdio << EOF
246 > unknown
283 > unknown
247 > foo 1
284 > foo 1
248 > 1
285 > 1
249 > hello
286 > hello
250 > between
287 > between
251 > pairs 81
288 > pairs 81
252 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
289 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
253 > EOF
290 > EOF
254 0
291 0
255 0
292 0
256 0
293 0
257 384
294 384
258 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
295 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
259 1
296 1
260
297
261
298
262 When sending a dict argument value, it is serialized to
299 When sending a dict argument value, it is serialized to
263 "<arg> <item count>" followed by "<key> <len>\n<value>" for each item
300 "<arg> <item count>" followed by "<key> <len>\n<value>" for each item
264 in the dict.
301 in the dict.
265
302
266 Dictionary value for unknown command
303 Dictionary value for unknown command
267
304
268 $ hg -R server serve --stdio << EOF
305 $ hg -R server serve --stdio << EOF
269 > unknown
306 > unknown
270 > dict 3
307 > dict 3
271 > key1 3
308 > key1 3
272 > foo
309 > foo
273 > key2 3
310 > key2 3
274 > bar
311 > bar
275 > key3 3
312 > key3 3
276 > baz
313 > baz
277 > hello
314 > hello
278 > EOF
315 > EOF
279 0
316 0
280 0
317 0
281 0
318 0
282 0
319 0
283 0
320 0
284 0
321 0
285 0
322 0
286 0
323 0
287 384
324 384
288 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
325 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
289
326
290 Incomplete dictionary send
327 Incomplete dictionary send
291
328
292 $ hg -R server serve --stdio << EOF
329 $ hg -R server serve --stdio << EOF
293 > unknown
330 > unknown
294 > dict 3
331 > dict 3
295 > key1 3
332 > key1 3
296 > foo
333 > foo
297 > EOF
334 > EOF
298 0
335 0
299 0
336 0
300 0
337 0
301 0
338 0
302
339
303 Incomplete value send
340 Incomplete value send
304
341
305 $ hg -R server serve --stdio << EOF
342 $ hg -R server serve --stdio << EOF
306 > unknown
343 > unknown
307 > dict 3
344 > dict 3
308 > key1 3
345 > key1 3
309 > fo
346 > fo
310 > EOF
347 > EOF
311 0
348 0
312 0
349 0
313 0
350 0
314 0
351 0
315
352
316 Send a command line with spaces
353 Send a command line with spaces
317
354
318 $ hg -R server serve --stdio << EOF
355 $ hg -R server serve --stdio << EOF
319 > unknown withspace
356 > unknown withspace
320 > hello
357 > hello
321 > between
358 > between
322 > pairs 81
359 > pairs 81
323 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
360 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
324 > EOF
361 > EOF
325 0
362 0
326 384
363 384
327 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
364 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
328 1
365 1
329
366
330
367
331 $ hg -R server serve --stdio << EOF
368 $ hg -R server serve --stdio << EOF
332 > unknown with multiple spaces
369 > unknown with multiple spaces
333 > hello
370 > hello
334 > between
371 > between
335 > pairs 81
372 > pairs 81
336 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
373 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
337 > EOF
374 > EOF
338 0
375 0
339 384
376 384
340 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
377 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
341 1
378 1
342
379
343
380
344 $ hg -R server serve --stdio << EOF
381 $ hg -R server serve --stdio << EOF
345 > unknown with spaces
382 > unknown with spaces
346 > key 10
383 > key 10
347 > some value
384 > some value
348 > hello
385 > hello
349 > between
386 > between
350 > pairs 81
387 > pairs 81
351 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
388 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
352 > EOF
389 > EOF
353 0
390 0
354 0
391 0
355 0
392 0
356 384
393 384
357 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
394 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
358 1
395 1
359
396
360
397
361 Send an unknown command after the "between"
398 Send an unknown command after the "between"
362
399
363 $ hg -R server serve --stdio << EOF
400 $ hg -R server serve --stdio << EOF
364 > hello
401 > hello
365 > between
402 > between
366 > pairs 81
403 > pairs 81
367 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
404 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
368 > EOF
405 > EOF
369 384
406 384
370 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
407 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
371 1
408 1
372
409
373 0
410 0
374
411
375 And one with arguments
412 And one with arguments
376
413
377 $ hg -R server serve --stdio << EOF
414 $ hg -R server serve --stdio << EOF
378 > hello
415 > hello
379 > between
416 > between
380 > pairs 81
417 > pairs 81
381 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
418 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000unknown
382 > foo 5
419 > foo 5
383 > value
420 > value
384 > bar 3
421 > bar 3
385 > baz
422 > baz
386 > EOF
423 > EOF
387 384
424 384
388 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
425 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
389 1
426 1
390
427
391 0
428 0
392 0
429 0
393 0
430 0
394 0
431 0
395 0
432 0
396
433
397 Send a valid command before the handshake
434 Send a valid command before the handshake
398
435
399 $ hg -R server serve --stdio << EOF
436 $ hg -R server serve --stdio << EOF
400 > heads
437 > heads
401 > hello
438 > hello
402 > between
439 > between
403 > pairs 81
440 > pairs 81
404 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
441 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
405 > EOF
442 > EOF
406 41
443 41
407 68986213bd4485ea51533535e3fc9e78007a711f
444 68986213bd4485ea51533535e3fc9e78007a711f
408 384
445 384
409 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
446 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
410 1
447 1
411
448
412
449
413 And a variation that doesn't send the between command
450 And a variation that doesn't send the between command
414
451
415 $ hg -R server serve --stdio << EOF
452 $ hg -R server serve --stdio << EOF
416 > heads
453 > heads
417 > hello
454 > hello
418 > EOF
455 > EOF
419 41
456 41
420 68986213bd4485ea51533535e3fc9e78007a711f
457 68986213bd4485ea51533535e3fc9e78007a711f
421 384
458 384
422 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
459 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
423
460
424 Send an upgrade request to a server that doesn't support that command
461 Send an upgrade request to a server that doesn't support that command
425
462
426 $ hg -R server serve --stdio << EOF
463 $ hg -R server serve --stdio << EOF
427 > upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=irrelevant1%2Cirrelevant2
464 > upgrade 2e82ab3f-9ce3-4b4e-8f8c-6fd1c0e9e23a proto=irrelevant1%2Cirrelevant2
428 > hello
465 > hello
429 > between
466 > between
430 > pairs 81
467 > pairs 81
431 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
468 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
432 > EOF
469 > EOF
433 0
470 0
434 384
471 384
435 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
472 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
436 1
473 1
437
474
438
475
439 $ hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server
476 $ hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server
440 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
477 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
441 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
478 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
442 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
479 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
443 devel-peer-request: hello
480 devel-peer-request: hello
444 sending hello command
481 sending hello command
445 devel-peer-request: between
482 devel-peer-request: between
446 devel-peer-request: pairs: 81 bytes
483 devel-peer-request: pairs: 81 bytes
447 sending between command
484 sending between command
448 remote: 0
485 remote: 0
449 remote: 384
486 remote: 384
450 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
487 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
451 remote: 1
488 remote: 1
452 url: ssh://user@dummy/server
489 url: ssh://user@dummy/server
453 local: no
490 local: no
454 pushable: yes
491 pushable: yes
455
492
456 Enable version 2 support on server. We need to do this in hgrc because we can't
493 Enable version 2 support on server. We need to do this in hgrc because we can't
457 use --config with `hg serve --stdio`.
494 use --config with `hg serve --stdio`.
458
495
459 $ cat >> server/.hg/hgrc << EOF
496 $ cat >> server/.hg/hgrc << EOF
460 > [experimental]
497 > [experimental]
461 > sshserver.support-v2 = true
498 > sshserver.support-v2 = true
462 > EOF
499 > EOF
463
500
464 Send an upgrade request to a server that supports upgrade
501 Send an upgrade request to a server that supports upgrade
465
502
466 >>> with open('payload', 'wb') as fh:
503 >>> with open('payload', 'wb') as fh:
467 ... fh.write(b'upgrade this-is-some-token proto=exp-ssh-v2-0001\n')
504 ... fh.write(b'upgrade this-is-some-token proto=exp-ssh-v2-0001\n')
468 ... fh.write(b'hello\n')
505 ... fh.write(b'hello\n')
469 ... fh.write(b'between\n')
506 ... fh.write(b'between\n')
470 ... fh.write(b'pairs 81\n')
507 ... fh.write(b'pairs 81\n')
471 ... fh.write(b'0000000000000000000000000000000000000000-0000000000000000000000000000000000000000')
508 ... fh.write(b'0000000000000000000000000000000000000000-0000000000000000000000000000000000000000')
472
509
473 $ hg -R server serve --stdio < payload
510 $ hg -R server serve --stdio < payload
474 upgraded this-is-some-token exp-ssh-v2-0001
511 upgraded this-is-some-token exp-ssh-v2-0001
475 383
512 383
476 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
513 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
477
514
478 $ hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server
515 $ hg --config experimental.sshpeer.advertise-v2=true --debug debugpeer ssh://user@dummy/server
479 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
516 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
480 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
517 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
481 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
518 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
482 devel-peer-request: hello
519 devel-peer-request: hello
483 sending hello command
520 sending hello command
484 devel-peer-request: between
521 devel-peer-request: between
485 devel-peer-request: pairs: 81 bytes
522 devel-peer-request: pairs: 81 bytes
486 sending between command
523 sending between command
487 protocol upgraded to exp-ssh-v2-0001
524 protocol upgraded to exp-ssh-v2-0001
488 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
525 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
489 url: ssh://user@dummy/server
526 url: ssh://user@dummy/server
490 local: no
527 local: no
491 pushable: yes
528 pushable: yes
492
529
493 Verify the peer has capabilities
530 Verify the peer has capabilities
494
531
495 $ hg --config experimental.sshpeer.advertise-v2=true --debug debugcapabilities ssh://user@dummy/server
532 $ hg --config experimental.sshpeer.advertise-v2=true --debug debugcapabilities ssh://user@dummy/server
496 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
533 running * "*/tests/dummyssh" 'user@dummy' 'hg -R server serve --stdio' (glob) (no-windows !)
497 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
534 running * "*\tests/dummyssh" "user@dummy" "hg -R server serve --stdio" (glob) (windows !)
498 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
535 sending upgrade request: * proto=exp-ssh-v2-0001 (glob)
499 devel-peer-request: hello
536 devel-peer-request: hello
500 sending hello command
537 sending hello command
501 devel-peer-request: between
538 devel-peer-request: between
502 devel-peer-request: pairs: 81 bytes
539 devel-peer-request: pairs: 81 bytes
503 sending between command
540 sending between command
504 protocol upgraded to exp-ssh-v2-0001
541 protocol upgraded to exp-ssh-v2-0001
505 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
542 remote: capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
506 Main capabilities:
543 Main capabilities:
507 batch
544 batch
508 branchmap
545 branchmap
509 $USUAL_BUNDLE2_CAPS_SERVER$
546 $USUAL_BUNDLE2_CAPS_SERVER$
510 changegroupsubset
547 changegroupsubset
511 getbundle
548 getbundle
512 known
549 known
513 lookup
550 lookup
514 pushkey
551 pushkey
515 streamreqs=generaldelta,revlogv1
552 streamreqs=generaldelta,revlogv1
516 unbundle=HG10GZ,HG10BZ,HG10UN
553 unbundle=HG10GZ,HG10BZ,HG10UN
517 unbundlehash
554 unbundlehash
518 Bundle2 capabilities:
555 Bundle2 capabilities:
519 HG20
556 HG20
520 bookmarks
557 bookmarks
521 changegroup
558 changegroup
522 01
559 01
523 02
560 02
524 digests
561 digests
525 md5
562 md5
526 sha1
563 sha1
527 sha512
564 sha512
528 error
565 error
529 abort
566 abort
530 unsupportedcontent
567 unsupportedcontent
531 pushraced
568 pushraced
532 pushkey
569 pushkey
533 hgtagsfnodes
570 hgtagsfnodes
534 listkeys
571 listkeys
535 phases
572 phases
536 heads
573 heads
537 pushkey
574 pushkey
538 remote-changegroup
575 remote-changegroup
539 http
576 http
540 https
577 https
541
578
542 Command after upgrade to version 2 is processed
579 Command after upgrade to version 2 is processed
543
580
544 >>> with open('payload', 'wb') as fh:
581 >>> with open('payload', 'wb') as fh:
545 ... fh.write(b'upgrade this-is-some-token proto=exp-ssh-v2-0001\n')
582 ... fh.write(b'upgrade this-is-some-token proto=exp-ssh-v2-0001\n')
546 ... fh.write(b'hello\n')
583 ... fh.write(b'hello\n')
547 ... fh.write(b'between\n')
584 ... fh.write(b'between\n')
548 ... fh.write(b'pairs 81\n')
585 ... fh.write(b'pairs 81\n')
549 ... fh.write(b'0000000000000000000000000000000000000000-0000000000000000000000000000000000000000')
586 ... fh.write(b'0000000000000000000000000000000000000000-0000000000000000000000000000000000000000')
550 ... fh.write(b'hello\n')
587 ... fh.write(b'hello\n')
551 $ hg -R server serve --stdio < payload
588 $ hg -R server serve --stdio < payload
552 upgraded this-is-some-token exp-ssh-v2-0001
589 upgraded this-is-some-token exp-ssh-v2-0001
553 383
590 383
554 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
591 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
555 384
592 384
556 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
593 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
557
594
558 Multiple upgrades is not allowed
595 Multiple upgrades is not allowed
559
596
560 >>> with open('payload', 'wb') as fh:
597 >>> with open('payload', 'wb') as fh:
561 ... fh.write(b'upgrade this-is-some-token proto=exp-ssh-v2-0001\n')
598 ... fh.write(b'upgrade this-is-some-token proto=exp-ssh-v2-0001\n')
562 ... fh.write(b'hello\n')
599 ... fh.write(b'hello\n')
563 ... fh.write(b'between\n')
600 ... fh.write(b'between\n')
564 ... fh.write(b'pairs 81\n')
601 ... fh.write(b'pairs 81\n')
565 ... fh.write(b'0000000000000000000000000000000000000000-0000000000000000000000000000000000000000')
602 ... fh.write(b'0000000000000000000000000000000000000000-0000000000000000000000000000000000000000')
566 ... fh.write(b'upgrade another-token proto=irrelevant\n')
603 ... fh.write(b'upgrade another-token proto=irrelevant\n')
567 ... fh.write(b'hello\n')
604 ... fh.write(b'hello\n')
568 $ hg -R server serve --stdio < payload
605 $ hg -R server serve --stdio < payload
569 upgraded this-is-some-token exp-ssh-v2-0001
606 upgraded this-is-some-token exp-ssh-v2-0001
570 383
607 383
571 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
608 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
572 cannot upgrade protocols multiple times
609 cannot upgrade protocols multiple times
573 -
610 -
574
611
575
612
576 Malformed upgrade request line (not exactly 3 space delimited tokens)
613 Malformed upgrade request line (not exactly 3 space delimited tokens)
577
614
578 $ hg -R server serve --stdio << EOF
615 $ hg -R server serve --stdio << EOF
579 > upgrade
616 > upgrade
580 > EOF
617 > EOF
581 0
618 0
582
619
583 $ hg -R server serve --stdio << EOF
620 $ hg -R server serve --stdio << EOF
584 > upgrade token
621 > upgrade token
585 > EOF
622 > EOF
586 0
623 0
587
624
588 $ hg -R server serve --stdio << EOF
625 $ hg -R server serve --stdio << EOF
589 > upgrade token foo=bar extra-token
626 > upgrade token foo=bar extra-token
590 > EOF
627 > EOF
591 0
628 0
592
629
593 Upgrade request to unsupported protocol is ignored
630 Upgrade request to unsupported protocol is ignored
594
631
595 $ hg -R server serve --stdio << EOF
632 $ hg -R server serve --stdio << EOF
596 > upgrade this-is-some-token proto=unknown1,unknown2
633 > upgrade this-is-some-token proto=unknown1,unknown2
597 > hello
634 > hello
598 > between
635 > between
599 > pairs 81
636 > pairs 81
600 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
637 > 0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
601 > EOF
638 > EOF
602 0
639 0
603 384
640 384
604 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
641 capabilities: lookup changegroupsubset branchmap pushkey known getbundle unbundlehash batch streamreqs=generaldelta,revlogv1 $USUAL_BUNDLE2_CAPS_SERVER$ unbundle=HG10GZ,HG10BZ,HG10UN
605 1
642 1
606
643
607
644
608 Upgrade request must be followed by hello + between
645 Upgrade request must be followed by hello + between
609
646
610 $ hg -R server serve --stdio << EOF
647 $ hg -R server serve --stdio << EOF
611 > upgrade token proto=exp-ssh-v2-0001
648 > upgrade token proto=exp-ssh-v2-0001
612 > invalid
649 > invalid
613 > EOF
650 > EOF
614 malformed handshake protocol: missing hello
651 malformed handshake protocol: missing hello
615 -
652 -
616
653
617
654
618 $ hg -R server serve --stdio << EOF
655 $ hg -R server serve --stdio << EOF
619 > upgrade token proto=exp-ssh-v2-0001
656 > upgrade token proto=exp-ssh-v2-0001
620 > hello
657 > hello
621 > invalid
658 > invalid
622 > EOF
659 > EOF
623 malformed handshake protocol: missing between
660 malformed handshake protocol: missing between
624 -
661 -
625
662
626
663
627 $ hg -R server serve --stdio << EOF
664 $ hg -R server serve --stdio << EOF
628 > upgrade token proto=exp-ssh-v2-0001
665 > upgrade token proto=exp-ssh-v2-0001
629 > hello
666 > hello
630 > between
667 > between
631 > invalid
668 > invalid
632 > EOF
669 > EOF
633 malformed handshake protocol: missing pairs 81
670 malformed handshake protocol: missing pairs 81
634 -
671 -
635
672
General Comments 0
You need to be logged in to leave comments. Login now