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