##// END OF EJS Templates
hgweb: support rendering sub-topic indexes...
Gregory Szorc -
r27581:3aa6a813 default
parent child Browse files
Show More
@@ -1,1268 +1,1281 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 cgi
10 import cgi
11 import copy
11 import copy
12 import mimetypes
12 import mimetypes
13 import os
13 import os
14 import re
14 import re
15
15
16 from ..i18n import _
16 from ..i18n import _
17 from ..node import hex, short
17 from ..node import hex, short
18
18
19 from .common import (
19 from .common import (
20 ErrorResponse,
20 ErrorResponse,
21 HTTP_FORBIDDEN,
21 HTTP_FORBIDDEN,
22 HTTP_NOT_FOUND,
22 HTTP_NOT_FOUND,
23 HTTP_OK,
23 HTTP_OK,
24 get_contact,
24 get_contact,
25 paritygen,
25 paritygen,
26 staticfile,
26 staticfile,
27 )
27 )
28
28
29 from .. import (
29 from .. import (
30 archival,
30 archival,
31 encoding,
31 encoding,
32 error,
32 error,
33 graphmod,
33 graphmod,
34 patch,
34 patch,
35 revset,
35 revset,
36 scmutil,
36 scmutil,
37 templatefilters,
37 templatefilters,
38 templater,
38 templater,
39 util,
39 util,
40 )
40 )
41
41
42 from . import (
42 from . import (
43 webutil,
43 webutil,
44 )
44 )
45
45
46 __all__ = []
46 __all__ = []
47 commands = {}
47 commands = {}
48
48
49 class webcommand(object):
49 class webcommand(object):
50 """Decorator used to register a web command handler.
50 """Decorator used to register a web command handler.
51
51
52 The decorator takes as its positional arguments the name/path the
52 The decorator takes as its positional arguments the name/path the
53 command should be accessible under.
53 command should be accessible under.
54
54
55 Usage:
55 Usage:
56
56
57 @webcommand('mycommand')
57 @webcommand('mycommand')
58 def mycommand(web, req, tmpl):
58 def mycommand(web, req, tmpl):
59 pass
59 pass
60 """
60 """
61
61
62 def __init__(self, name):
62 def __init__(self, name):
63 self.name = name
63 self.name = name
64
64
65 def __call__(self, func):
65 def __call__(self, func):
66 __all__.append(self.name)
66 __all__.append(self.name)
67 commands[self.name] = func
67 commands[self.name] = func
68 return func
68 return func
69
69
70 @webcommand('log')
70 @webcommand('log')
71 def log(web, req, tmpl):
71 def log(web, req, tmpl):
72 """
72 """
73 /log[/{revision}[/{path}]]
73 /log[/{revision}[/{path}]]
74 --------------------------
74 --------------------------
75
75
76 Show repository or file history.
76 Show repository or file history.
77
77
78 For URLs of the form ``/log/{revision}``, a list of changesets starting at
78 For URLs of the form ``/log/{revision}``, a list of changesets starting at
79 the specified changeset identifier is shown. If ``{revision}`` is not
79 the specified changeset identifier is shown. If ``{revision}`` is not
80 defined, the default is ``tip``. This form is equivalent to the
80 defined, the default is ``tip``. This form is equivalent to the
81 ``changelog`` handler.
81 ``changelog`` handler.
82
82
83 For URLs of the form ``/log/{revision}/{file}``, the history for a specific
83 For URLs of the form ``/log/{revision}/{file}``, the history for a specific
84 file will be shown. This form is equivalent to the ``filelog`` handler.
84 file will be shown. This form is equivalent to the ``filelog`` handler.
85 """
85 """
86
86
87 if 'file' in req.form and req.form['file'][0]:
87 if 'file' in req.form and req.form['file'][0]:
88 return filelog(web, req, tmpl)
88 return filelog(web, req, tmpl)
89 else:
89 else:
90 return changelog(web, req, tmpl)
90 return changelog(web, req, tmpl)
91
91
92 @webcommand('rawfile')
92 @webcommand('rawfile')
93 def rawfile(web, req, tmpl):
93 def rawfile(web, req, tmpl):
94 guessmime = web.configbool('web', 'guessmime', False)
94 guessmime = web.configbool('web', 'guessmime', False)
95
95
96 path = webutil.cleanpath(web.repo, req.form.get('file', [''])[0])
96 path = webutil.cleanpath(web.repo, req.form.get('file', [''])[0])
97 if not path:
97 if not path:
98 content = manifest(web, req, tmpl)
98 content = manifest(web, req, tmpl)
99 req.respond(HTTP_OK, web.ctype)
99 req.respond(HTTP_OK, web.ctype)
100 return content
100 return content
101
101
102 try:
102 try:
103 fctx = webutil.filectx(web.repo, req)
103 fctx = webutil.filectx(web.repo, req)
104 except error.LookupError as inst:
104 except error.LookupError as inst:
105 try:
105 try:
106 content = manifest(web, req, tmpl)
106 content = manifest(web, req, tmpl)
107 req.respond(HTTP_OK, web.ctype)
107 req.respond(HTTP_OK, web.ctype)
108 return content
108 return content
109 except ErrorResponse:
109 except ErrorResponse:
110 raise inst
110 raise inst
111
111
112 path = fctx.path()
112 path = fctx.path()
113 text = fctx.data()
113 text = fctx.data()
114 mt = 'application/binary'
114 mt = 'application/binary'
115 if guessmime:
115 if guessmime:
116 mt = mimetypes.guess_type(path)[0]
116 mt = mimetypes.guess_type(path)[0]
117 if mt is None:
117 if mt is None:
118 if util.binary(text):
118 if util.binary(text):
119 mt = 'application/binary'
119 mt = 'application/binary'
120 else:
120 else:
121 mt = 'text/plain'
121 mt = 'text/plain'
122 if mt.startswith('text/'):
122 if mt.startswith('text/'):
123 mt += '; charset="%s"' % encoding.encoding
123 mt += '; charset="%s"' % encoding.encoding
124
124
125 req.respond(HTTP_OK, mt, path, body=text)
125 req.respond(HTTP_OK, mt, path, body=text)
126 return []
126 return []
127
127
128 def _filerevision(web, req, tmpl, fctx):
128 def _filerevision(web, req, tmpl, fctx):
129 f = fctx.path()
129 f = fctx.path()
130 text = fctx.data()
130 text = fctx.data()
131 parity = paritygen(web.stripecount)
131 parity = paritygen(web.stripecount)
132
132
133 if util.binary(text):
133 if util.binary(text):
134 mt = mimetypes.guess_type(f)[0] or 'application/octet-stream'
134 mt = mimetypes.guess_type(f)[0] or 'application/octet-stream'
135 text = '(binary:%s)' % mt
135 text = '(binary:%s)' % mt
136
136
137 def lines():
137 def lines():
138 for lineno, t in enumerate(text.splitlines(True)):
138 for lineno, t in enumerate(text.splitlines(True)):
139 yield {"line": t,
139 yield {"line": t,
140 "lineid": "l%d" % (lineno + 1),
140 "lineid": "l%d" % (lineno + 1),
141 "linenumber": "% 6d" % (lineno + 1),
141 "linenumber": "% 6d" % (lineno + 1),
142 "parity": parity.next()}
142 "parity": parity.next()}
143
143
144 return tmpl("filerevision",
144 return tmpl("filerevision",
145 file=f,
145 file=f,
146 path=webutil.up(f),
146 path=webutil.up(f),
147 text=lines(),
147 text=lines(),
148 symrev=webutil.symrevorshortnode(req, fctx),
148 symrev=webutil.symrevorshortnode(req, fctx),
149 rename=webutil.renamelink(fctx),
149 rename=webutil.renamelink(fctx),
150 permissions=fctx.manifest().flags(f),
150 permissions=fctx.manifest().flags(f),
151 **webutil.commonentry(web.repo, fctx))
151 **webutil.commonentry(web.repo, fctx))
152
152
153 @webcommand('file')
153 @webcommand('file')
154 def file(web, req, tmpl):
154 def file(web, req, tmpl):
155 """
155 """
156 /file/{revision}[/{path}]
156 /file/{revision}[/{path}]
157 -------------------------
157 -------------------------
158
158
159 Show information about a directory or file in the repository.
159 Show information about a directory or file in the repository.
160
160
161 Info about the ``path`` given as a URL parameter will be rendered.
161 Info about the ``path`` given as a URL parameter will be rendered.
162
162
163 If ``path`` is a directory, information about the entries in that
163 If ``path`` is a directory, information about the entries in that
164 directory will be rendered. This form is equivalent to the ``manifest``
164 directory will be rendered. This form is equivalent to the ``manifest``
165 handler.
165 handler.
166
166
167 If ``path`` is a file, information about that file will be shown via
167 If ``path`` is a file, information about that file will be shown via
168 the ``filerevision`` template.
168 the ``filerevision`` template.
169
169
170 If ``path`` is not defined, information about the root directory will
170 If ``path`` is not defined, information about the root directory will
171 be rendered.
171 be rendered.
172 """
172 """
173 path = webutil.cleanpath(web.repo, req.form.get('file', [''])[0])
173 path = webutil.cleanpath(web.repo, req.form.get('file', [''])[0])
174 if not path:
174 if not path:
175 return manifest(web, req, tmpl)
175 return manifest(web, req, tmpl)
176 try:
176 try:
177 return _filerevision(web, req, tmpl, webutil.filectx(web.repo, req))
177 return _filerevision(web, req, tmpl, webutil.filectx(web.repo, req))
178 except error.LookupError as inst:
178 except error.LookupError as inst:
179 try:
179 try:
180 return manifest(web, req, tmpl)
180 return manifest(web, req, tmpl)
181 except ErrorResponse:
181 except ErrorResponse:
182 raise inst
182 raise inst
183
183
184 def _search(web, req, tmpl):
184 def _search(web, req, tmpl):
185 MODE_REVISION = 'rev'
185 MODE_REVISION = 'rev'
186 MODE_KEYWORD = 'keyword'
186 MODE_KEYWORD = 'keyword'
187 MODE_REVSET = 'revset'
187 MODE_REVSET = 'revset'
188
188
189 def revsearch(ctx):
189 def revsearch(ctx):
190 yield ctx
190 yield ctx
191
191
192 def keywordsearch(query):
192 def keywordsearch(query):
193 lower = encoding.lower
193 lower = encoding.lower
194 qw = lower(query).split()
194 qw = lower(query).split()
195
195
196 def revgen():
196 def revgen():
197 cl = web.repo.changelog
197 cl = web.repo.changelog
198 for i in xrange(len(web.repo) - 1, 0, -100):
198 for i in xrange(len(web.repo) - 1, 0, -100):
199 l = []
199 l = []
200 for j in cl.revs(max(0, i - 99), i):
200 for j in cl.revs(max(0, i - 99), i):
201 ctx = web.repo[j]
201 ctx = web.repo[j]
202 l.append(ctx)
202 l.append(ctx)
203 l.reverse()
203 l.reverse()
204 for e in l:
204 for e in l:
205 yield e
205 yield e
206
206
207 for ctx in revgen():
207 for ctx in revgen():
208 miss = 0
208 miss = 0
209 for q in qw:
209 for q in qw:
210 if not (q in lower(ctx.user()) or
210 if not (q in lower(ctx.user()) or
211 q in lower(ctx.description()) or
211 q in lower(ctx.description()) or
212 q in lower(" ".join(ctx.files()))):
212 q in lower(" ".join(ctx.files()))):
213 miss = 1
213 miss = 1
214 break
214 break
215 if miss:
215 if miss:
216 continue
216 continue
217
217
218 yield ctx
218 yield ctx
219
219
220 def revsetsearch(revs):
220 def revsetsearch(revs):
221 for r in revs:
221 for r in revs:
222 yield web.repo[r]
222 yield web.repo[r]
223
223
224 searchfuncs = {
224 searchfuncs = {
225 MODE_REVISION: (revsearch, 'exact revision search'),
225 MODE_REVISION: (revsearch, 'exact revision search'),
226 MODE_KEYWORD: (keywordsearch, 'literal keyword search'),
226 MODE_KEYWORD: (keywordsearch, 'literal keyword search'),
227 MODE_REVSET: (revsetsearch, 'revset expression search'),
227 MODE_REVSET: (revsetsearch, 'revset expression search'),
228 }
228 }
229
229
230 def getsearchmode(query):
230 def getsearchmode(query):
231 try:
231 try:
232 ctx = web.repo[query]
232 ctx = web.repo[query]
233 except (error.RepoError, error.LookupError):
233 except (error.RepoError, error.LookupError):
234 # query is not an exact revision pointer, need to
234 # query is not an exact revision pointer, need to
235 # decide if it's a revset expression or keywords
235 # decide if it's a revset expression or keywords
236 pass
236 pass
237 else:
237 else:
238 return MODE_REVISION, ctx
238 return MODE_REVISION, ctx
239
239
240 revdef = 'reverse(%s)' % query
240 revdef = 'reverse(%s)' % query
241 try:
241 try:
242 tree = revset.parse(revdef)
242 tree = revset.parse(revdef)
243 except error.ParseError:
243 except error.ParseError:
244 # can't parse to a revset tree
244 # can't parse to a revset tree
245 return MODE_KEYWORD, query
245 return MODE_KEYWORD, query
246
246
247 if revset.depth(tree) <= 2:
247 if revset.depth(tree) <= 2:
248 # no revset syntax used
248 # no revset syntax used
249 return MODE_KEYWORD, query
249 return MODE_KEYWORD, query
250
250
251 if any((token, (value or '')[:3]) == ('string', 're:')
251 if any((token, (value or '')[:3]) == ('string', 're:')
252 for token, value, pos in revset.tokenize(revdef)):
252 for token, value, pos in revset.tokenize(revdef)):
253 return MODE_KEYWORD, query
253 return MODE_KEYWORD, query
254
254
255 funcsused = revset.funcsused(tree)
255 funcsused = revset.funcsused(tree)
256 if not funcsused.issubset(revset.safesymbols):
256 if not funcsused.issubset(revset.safesymbols):
257 return MODE_KEYWORD, query
257 return MODE_KEYWORD, query
258
258
259 mfunc = revset.match(web.repo.ui, revdef)
259 mfunc = revset.match(web.repo.ui, revdef)
260 try:
260 try:
261 revs = mfunc(web.repo)
261 revs = mfunc(web.repo)
262 return MODE_REVSET, revs
262 return MODE_REVSET, revs
263 # ParseError: wrongly placed tokens, wrongs arguments, etc
263 # ParseError: wrongly placed tokens, wrongs arguments, etc
264 # RepoLookupError: no such revision, e.g. in 'revision:'
264 # RepoLookupError: no such revision, e.g. in 'revision:'
265 # Abort: bookmark/tag not exists
265 # Abort: bookmark/tag not exists
266 # LookupError: ambiguous identifier, e.g. in '(bc)' on a large repo
266 # LookupError: ambiguous identifier, e.g. in '(bc)' on a large repo
267 except (error.ParseError, error.RepoLookupError, error.Abort,
267 except (error.ParseError, error.RepoLookupError, error.Abort,
268 LookupError):
268 LookupError):
269 return MODE_KEYWORD, query
269 return MODE_KEYWORD, query
270
270
271 def changelist(**map):
271 def changelist(**map):
272 count = 0
272 count = 0
273
273
274 for ctx in searchfunc[0](funcarg):
274 for ctx in searchfunc[0](funcarg):
275 count += 1
275 count += 1
276 n = ctx.node()
276 n = ctx.node()
277 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
277 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n)
278 files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)
278 files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles)
279
279
280 yield tmpl('searchentry',
280 yield tmpl('searchentry',
281 parity=parity.next(),
281 parity=parity.next(),
282 changelogtag=showtags,
282 changelogtag=showtags,
283 files=files,
283 files=files,
284 **webutil.commonentry(web.repo, ctx))
284 **webutil.commonentry(web.repo, ctx))
285
285
286 if count >= revcount:
286 if count >= revcount:
287 break
287 break
288
288
289 query = req.form['rev'][0]
289 query = req.form['rev'][0]
290 revcount = web.maxchanges
290 revcount = web.maxchanges
291 if 'revcount' in req.form:
291 if 'revcount' in req.form:
292 try:
292 try:
293 revcount = int(req.form.get('revcount', [revcount])[0])
293 revcount = int(req.form.get('revcount', [revcount])[0])
294 revcount = max(revcount, 1)
294 revcount = max(revcount, 1)
295 tmpl.defaults['sessionvars']['revcount'] = revcount
295 tmpl.defaults['sessionvars']['revcount'] = revcount
296 except ValueError:
296 except ValueError:
297 pass
297 pass
298
298
299 lessvars = copy.copy(tmpl.defaults['sessionvars'])
299 lessvars = copy.copy(tmpl.defaults['sessionvars'])
300 lessvars['revcount'] = max(revcount / 2, 1)
300 lessvars['revcount'] = max(revcount / 2, 1)
301 lessvars['rev'] = query
301 lessvars['rev'] = query
302 morevars = copy.copy(tmpl.defaults['sessionvars'])
302 morevars = copy.copy(tmpl.defaults['sessionvars'])
303 morevars['revcount'] = revcount * 2
303 morevars['revcount'] = revcount * 2
304 morevars['rev'] = query
304 morevars['rev'] = query
305
305
306 mode, funcarg = getsearchmode(query)
306 mode, funcarg = getsearchmode(query)
307
307
308 if 'forcekw' in req.form:
308 if 'forcekw' in req.form:
309 showforcekw = ''
309 showforcekw = ''
310 showunforcekw = searchfuncs[mode][1]
310 showunforcekw = searchfuncs[mode][1]
311 mode = MODE_KEYWORD
311 mode = MODE_KEYWORD
312 funcarg = query
312 funcarg = query
313 else:
313 else:
314 if mode != MODE_KEYWORD:
314 if mode != MODE_KEYWORD:
315 showforcekw = searchfuncs[MODE_KEYWORD][1]
315 showforcekw = searchfuncs[MODE_KEYWORD][1]
316 else:
316 else:
317 showforcekw = ''
317 showforcekw = ''
318 showunforcekw = ''
318 showunforcekw = ''
319
319
320 searchfunc = searchfuncs[mode]
320 searchfunc = searchfuncs[mode]
321
321
322 tip = web.repo['tip']
322 tip = web.repo['tip']
323 parity = paritygen(web.stripecount)
323 parity = paritygen(web.stripecount)
324
324
325 return tmpl('search', query=query, node=tip.hex(), symrev='tip',
325 return tmpl('search', query=query, node=tip.hex(), symrev='tip',
326 entries=changelist, archives=web.archivelist("tip"),
326 entries=changelist, archives=web.archivelist("tip"),
327 morevars=morevars, lessvars=lessvars,
327 morevars=morevars, lessvars=lessvars,
328 modedesc=searchfunc[1],
328 modedesc=searchfunc[1],
329 showforcekw=showforcekw, showunforcekw=showunforcekw)
329 showforcekw=showforcekw, showunforcekw=showunforcekw)
330
330
331 @webcommand('changelog')
331 @webcommand('changelog')
332 def changelog(web, req, tmpl, shortlog=False):
332 def changelog(web, req, tmpl, shortlog=False):
333 """
333 """
334 /changelog[/{revision}]
334 /changelog[/{revision}]
335 -----------------------
335 -----------------------
336
336
337 Show information about multiple changesets.
337 Show information about multiple changesets.
338
338
339 If the optional ``revision`` URL argument is absent, information about
339 If the optional ``revision`` URL argument is absent, information about
340 all changesets starting at ``tip`` will be rendered. If the ``revision``
340 all changesets starting at ``tip`` will be rendered. If the ``revision``
341 argument is present, changesets will be shown starting from the specified
341 argument is present, changesets will be shown starting from the specified
342 revision.
342 revision.
343
343
344 If ``revision`` is absent, the ``rev`` query string argument may be
344 If ``revision`` is absent, the ``rev`` query string argument may be
345 defined. This will perform a search for changesets.
345 defined. This will perform a search for changesets.
346
346
347 The argument for ``rev`` can be a single revision, a revision set,
347 The argument for ``rev`` can be a single revision, a revision set,
348 or a literal keyword to search for in changeset data (equivalent to
348 or a literal keyword to search for in changeset data (equivalent to
349 :hg:`log -k`).
349 :hg:`log -k`).
350
350
351 The ``revcount`` query string argument defines the maximum numbers of
351 The ``revcount`` query string argument defines the maximum numbers of
352 changesets to render.
352 changesets to render.
353
353
354 For non-searches, the ``changelog`` template will be rendered.
354 For non-searches, the ``changelog`` template will be rendered.
355 """
355 """
356
356
357 query = ''
357 query = ''
358 if 'node' in req.form:
358 if 'node' in req.form:
359 ctx = webutil.changectx(web.repo, req)
359 ctx = webutil.changectx(web.repo, req)
360 symrev = webutil.symrevorshortnode(req, ctx)
360 symrev = webutil.symrevorshortnode(req, ctx)
361 elif 'rev' in req.form:
361 elif 'rev' in req.form:
362 return _search(web, req, tmpl)
362 return _search(web, req, tmpl)
363 else:
363 else:
364 ctx = web.repo['tip']
364 ctx = web.repo['tip']
365 symrev = 'tip'
365 symrev = 'tip'
366
366
367 def changelist():
367 def changelist():
368 revs = []
368 revs = []
369 if pos != -1:
369 if pos != -1:
370 revs = web.repo.changelog.revs(pos, 0)
370 revs = web.repo.changelog.revs(pos, 0)
371 curcount = 0
371 curcount = 0
372 for rev in revs:
372 for rev in revs:
373 curcount += 1
373 curcount += 1
374 if curcount > revcount + 1:
374 if curcount > revcount + 1:
375 break
375 break
376
376
377 entry = webutil.changelistentry(web, web.repo[rev], tmpl)
377 entry = webutil.changelistentry(web, web.repo[rev], tmpl)
378 entry['parity'] = parity.next()
378 entry['parity'] = parity.next()
379 yield entry
379 yield entry
380
380
381 if shortlog:
381 if shortlog:
382 revcount = web.maxshortchanges
382 revcount = web.maxshortchanges
383 else:
383 else:
384 revcount = web.maxchanges
384 revcount = web.maxchanges
385
385
386 if 'revcount' in req.form:
386 if 'revcount' in req.form:
387 try:
387 try:
388 revcount = int(req.form.get('revcount', [revcount])[0])
388 revcount = int(req.form.get('revcount', [revcount])[0])
389 revcount = max(revcount, 1)
389 revcount = max(revcount, 1)
390 tmpl.defaults['sessionvars']['revcount'] = revcount
390 tmpl.defaults['sessionvars']['revcount'] = revcount
391 except ValueError:
391 except ValueError:
392 pass
392 pass
393
393
394 lessvars = copy.copy(tmpl.defaults['sessionvars'])
394 lessvars = copy.copy(tmpl.defaults['sessionvars'])
395 lessvars['revcount'] = max(revcount / 2, 1)
395 lessvars['revcount'] = max(revcount / 2, 1)
396 morevars = copy.copy(tmpl.defaults['sessionvars'])
396 morevars = copy.copy(tmpl.defaults['sessionvars'])
397 morevars['revcount'] = revcount * 2
397 morevars['revcount'] = revcount * 2
398
398
399 count = len(web.repo)
399 count = len(web.repo)
400 pos = ctx.rev()
400 pos = ctx.rev()
401 parity = paritygen(web.stripecount)
401 parity = paritygen(web.stripecount)
402
402
403 changenav = webutil.revnav(web.repo).gen(pos, revcount, count)
403 changenav = webutil.revnav(web.repo).gen(pos, revcount, count)
404
404
405 entries = list(changelist())
405 entries = list(changelist())
406 latestentry = entries[:1]
406 latestentry = entries[:1]
407 if len(entries) > revcount:
407 if len(entries) > revcount:
408 nextentry = entries[-1:]
408 nextentry = entries[-1:]
409 entries = entries[:-1]
409 entries = entries[:-1]
410 else:
410 else:
411 nextentry = []
411 nextentry = []
412
412
413 return tmpl(shortlog and 'shortlog' or 'changelog', changenav=changenav,
413 return tmpl(shortlog and 'shortlog' or 'changelog', changenav=changenav,
414 node=ctx.hex(), rev=pos, symrev=symrev, changesets=count,
414 node=ctx.hex(), rev=pos, symrev=symrev, changesets=count,
415 entries=entries,
415 entries=entries,
416 latestentry=latestentry, nextentry=nextentry,
416 latestentry=latestentry, nextentry=nextentry,
417 archives=web.archivelist("tip"), revcount=revcount,
417 archives=web.archivelist("tip"), revcount=revcount,
418 morevars=morevars, lessvars=lessvars, query=query)
418 morevars=morevars, lessvars=lessvars, query=query)
419
419
420 @webcommand('shortlog')
420 @webcommand('shortlog')
421 def shortlog(web, req, tmpl):
421 def shortlog(web, req, tmpl):
422 """
422 """
423 /shortlog
423 /shortlog
424 ---------
424 ---------
425
425
426 Show basic information about a set of changesets.
426 Show basic information about a set of changesets.
427
427
428 This accepts the same parameters as the ``changelog`` handler. The only
428 This accepts the same parameters as the ``changelog`` handler. The only
429 difference is the ``shortlog`` template will be rendered instead of the
429 difference is the ``shortlog`` template will be rendered instead of the
430 ``changelog`` template.
430 ``changelog`` template.
431 """
431 """
432 return changelog(web, req, tmpl, shortlog=True)
432 return changelog(web, req, tmpl, shortlog=True)
433
433
434 @webcommand('changeset')
434 @webcommand('changeset')
435 def changeset(web, req, tmpl):
435 def changeset(web, req, tmpl):
436 """
436 """
437 /changeset[/{revision}]
437 /changeset[/{revision}]
438 -----------------------
438 -----------------------
439
439
440 Show information about a single changeset.
440 Show information about a single changeset.
441
441
442 A URL path argument is the changeset identifier to show. See ``hg help
442 A URL path argument is the changeset identifier to show. See ``hg help
443 revisions`` for possible values. If not defined, the ``tip`` changeset
443 revisions`` for possible values. If not defined, the ``tip`` changeset
444 will be shown.
444 will be shown.
445
445
446 The ``changeset`` template is rendered. Contents of the ``changesettag``,
446 The ``changeset`` template is rendered. Contents of the ``changesettag``,
447 ``changesetbookmark``, ``filenodelink``, ``filenolink``, and the many
447 ``changesetbookmark``, ``filenodelink``, ``filenolink``, and the many
448 templates related to diffs may all be used to produce the output.
448 templates related to diffs may all be used to produce the output.
449 """
449 """
450 ctx = webutil.changectx(web.repo, req)
450 ctx = webutil.changectx(web.repo, req)
451
451
452 return tmpl('changeset', **webutil.changesetentry(web, req, tmpl, ctx))
452 return tmpl('changeset', **webutil.changesetentry(web, req, tmpl, ctx))
453
453
454 rev = webcommand('rev')(changeset)
454 rev = webcommand('rev')(changeset)
455
455
456 def decodepath(path):
456 def decodepath(path):
457 """Hook for mapping a path in the repository to a path in the
457 """Hook for mapping a path in the repository to a path in the
458 working copy.
458 working copy.
459
459
460 Extensions (e.g., largefiles) can override this to remap files in
460 Extensions (e.g., largefiles) can override this to remap files in
461 the virtual file system presented by the manifest command below."""
461 the virtual file system presented by the manifest command below."""
462 return path
462 return path
463
463
464 @webcommand('manifest')
464 @webcommand('manifest')
465 def manifest(web, req, tmpl):
465 def manifest(web, req, tmpl):
466 """
466 """
467 /manifest[/{revision}[/{path}]]
467 /manifest[/{revision}[/{path}]]
468 -------------------------------
468 -------------------------------
469
469
470 Show information about a directory.
470 Show information about a directory.
471
471
472 If the URL path arguments are omitted, information about the root
472 If the URL path arguments are omitted, information about the root
473 directory for the ``tip`` changeset will be shown.
473 directory for the ``tip`` changeset will be shown.
474
474
475 Because this handler can only show information for directories, it
475 Because this handler can only show information for directories, it
476 is recommended to use the ``file`` handler instead, as it can handle both
476 is recommended to use the ``file`` handler instead, as it can handle both
477 directories and files.
477 directories and files.
478
478
479 The ``manifest`` template will be rendered for this handler.
479 The ``manifest`` template will be rendered for this handler.
480 """
480 """
481 if 'node' in req.form:
481 if 'node' in req.form:
482 ctx = webutil.changectx(web.repo, req)
482 ctx = webutil.changectx(web.repo, req)
483 symrev = webutil.symrevorshortnode(req, ctx)
483 symrev = webutil.symrevorshortnode(req, ctx)
484 else:
484 else:
485 ctx = web.repo['tip']
485 ctx = web.repo['tip']
486 symrev = 'tip'
486 symrev = 'tip'
487 path = webutil.cleanpath(web.repo, req.form.get('file', [''])[0])
487 path = webutil.cleanpath(web.repo, req.form.get('file', [''])[0])
488 mf = ctx.manifest()
488 mf = ctx.manifest()
489 node = ctx.node()
489 node = ctx.node()
490
490
491 files = {}
491 files = {}
492 dirs = {}
492 dirs = {}
493 parity = paritygen(web.stripecount)
493 parity = paritygen(web.stripecount)
494
494
495 if path and path[-1] != "/":
495 if path and path[-1] != "/":
496 path += "/"
496 path += "/"
497 l = len(path)
497 l = len(path)
498 abspath = "/" + path
498 abspath = "/" + path
499
499
500 for full, n in mf.iteritems():
500 for full, n in mf.iteritems():
501 # the virtual path (working copy path) used for the full
501 # the virtual path (working copy path) used for the full
502 # (repository) path
502 # (repository) path
503 f = decodepath(full)
503 f = decodepath(full)
504
504
505 if f[:l] != path:
505 if f[:l] != path:
506 continue
506 continue
507 remain = f[l:]
507 remain = f[l:]
508 elements = remain.split('/')
508 elements = remain.split('/')
509 if len(elements) == 1:
509 if len(elements) == 1:
510 files[remain] = full
510 files[remain] = full
511 else:
511 else:
512 h = dirs # need to retain ref to dirs (root)
512 h = dirs # need to retain ref to dirs (root)
513 for elem in elements[0:-1]:
513 for elem in elements[0:-1]:
514 if elem not in h:
514 if elem not in h:
515 h[elem] = {}
515 h[elem] = {}
516 h = h[elem]
516 h = h[elem]
517 if len(h) > 1:
517 if len(h) > 1:
518 break
518 break
519 h[None] = None # denotes files present
519 h[None] = None # denotes files present
520
520
521 if mf and not files and not dirs:
521 if mf and not files and not dirs:
522 raise ErrorResponse(HTTP_NOT_FOUND, 'path not found: ' + path)
522 raise ErrorResponse(HTTP_NOT_FOUND, 'path not found: ' + path)
523
523
524 def filelist(**map):
524 def filelist(**map):
525 for f in sorted(files):
525 for f in sorted(files):
526 full = files[f]
526 full = files[f]
527
527
528 fctx = ctx.filectx(full)
528 fctx = ctx.filectx(full)
529 yield {"file": full,
529 yield {"file": full,
530 "parity": parity.next(),
530 "parity": parity.next(),
531 "basename": f,
531 "basename": f,
532 "date": fctx.date(),
532 "date": fctx.date(),
533 "size": fctx.size(),
533 "size": fctx.size(),
534 "permissions": mf.flags(full)}
534 "permissions": mf.flags(full)}
535
535
536 def dirlist(**map):
536 def dirlist(**map):
537 for d in sorted(dirs):
537 for d in sorted(dirs):
538
538
539 emptydirs = []
539 emptydirs = []
540 h = dirs[d]
540 h = dirs[d]
541 while isinstance(h, dict) and len(h) == 1:
541 while isinstance(h, dict) and len(h) == 1:
542 k, v = h.items()[0]
542 k, v = h.items()[0]
543 if v:
543 if v:
544 emptydirs.append(k)
544 emptydirs.append(k)
545 h = v
545 h = v
546
546
547 path = "%s%s" % (abspath, d)
547 path = "%s%s" % (abspath, d)
548 yield {"parity": parity.next(),
548 yield {"parity": parity.next(),
549 "path": path,
549 "path": path,
550 "emptydirs": "/".join(emptydirs),
550 "emptydirs": "/".join(emptydirs),
551 "basename": d}
551 "basename": d}
552
552
553 return tmpl("manifest",
553 return tmpl("manifest",
554 symrev=symrev,
554 symrev=symrev,
555 path=abspath,
555 path=abspath,
556 up=webutil.up(abspath),
556 up=webutil.up(abspath),
557 upparity=parity.next(),
557 upparity=parity.next(),
558 fentries=filelist,
558 fentries=filelist,
559 dentries=dirlist,
559 dentries=dirlist,
560 archives=web.archivelist(hex(node)),
560 archives=web.archivelist(hex(node)),
561 **webutil.commonentry(web.repo, ctx))
561 **webutil.commonentry(web.repo, ctx))
562
562
563 @webcommand('tags')
563 @webcommand('tags')
564 def tags(web, req, tmpl):
564 def tags(web, req, tmpl):
565 """
565 """
566 /tags
566 /tags
567 -----
567 -----
568
568
569 Show information about tags.
569 Show information about tags.
570
570
571 No arguments are accepted.
571 No arguments are accepted.
572
572
573 The ``tags`` template is rendered.
573 The ``tags`` template is rendered.
574 """
574 """
575 i = list(reversed(web.repo.tagslist()))
575 i = list(reversed(web.repo.tagslist()))
576 parity = paritygen(web.stripecount)
576 parity = paritygen(web.stripecount)
577
577
578 def entries(notip, latestonly, **map):
578 def entries(notip, latestonly, **map):
579 t = i
579 t = i
580 if notip:
580 if notip:
581 t = [(k, n) for k, n in i if k != "tip"]
581 t = [(k, n) for k, n in i if k != "tip"]
582 if latestonly:
582 if latestonly:
583 t = t[:1]
583 t = t[:1]
584 for k, n in t:
584 for k, n in t:
585 yield {"parity": parity.next(),
585 yield {"parity": parity.next(),
586 "tag": k,
586 "tag": k,
587 "date": web.repo[n].date(),
587 "date": web.repo[n].date(),
588 "node": hex(n)}
588 "node": hex(n)}
589
589
590 return tmpl("tags",
590 return tmpl("tags",
591 node=hex(web.repo.changelog.tip()),
591 node=hex(web.repo.changelog.tip()),
592 entries=lambda **x: entries(False, False, **x),
592 entries=lambda **x: entries(False, False, **x),
593 entriesnotip=lambda **x: entries(True, False, **x),
593 entriesnotip=lambda **x: entries(True, False, **x),
594 latestentry=lambda **x: entries(True, True, **x))
594 latestentry=lambda **x: entries(True, True, **x))
595
595
596 @webcommand('bookmarks')
596 @webcommand('bookmarks')
597 def bookmarks(web, req, tmpl):
597 def bookmarks(web, req, tmpl):
598 """
598 """
599 /bookmarks
599 /bookmarks
600 ----------
600 ----------
601
601
602 Show information about bookmarks.
602 Show information about bookmarks.
603
603
604 No arguments are accepted.
604 No arguments are accepted.
605
605
606 The ``bookmarks`` template is rendered.
606 The ``bookmarks`` template is rendered.
607 """
607 """
608 i = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
608 i = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
609 parity = paritygen(web.stripecount)
609 parity = paritygen(web.stripecount)
610
610
611 def entries(latestonly, **map):
611 def entries(latestonly, **map):
612 if latestonly:
612 if latestonly:
613 t = [min(i)]
613 t = [min(i)]
614 else:
614 else:
615 t = sorted(i)
615 t = sorted(i)
616 for k, n in t:
616 for k, n in t:
617 yield {"parity": parity.next(),
617 yield {"parity": parity.next(),
618 "bookmark": k,
618 "bookmark": k,
619 "date": web.repo[n].date(),
619 "date": web.repo[n].date(),
620 "node": hex(n)}
620 "node": hex(n)}
621
621
622 return tmpl("bookmarks",
622 return tmpl("bookmarks",
623 node=hex(web.repo.changelog.tip()),
623 node=hex(web.repo.changelog.tip()),
624 entries=lambda **x: entries(latestonly=False, **x),
624 entries=lambda **x: entries(latestonly=False, **x),
625 latestentry=lambda **x: entries(latestonly=True, **x))
625 latestentry=lambda **x: entries(latestonly=True, **x))
626
626
627 @webcommand('branches')
627 @webcommand('branches')
628 def branches(web, req, tmpl):
628 def branches(web, req, tmpl):
629 """
629 """
630 /branches
630 /branches
631 ---------
631 ---------
632
632
633 Show information about branches.
633 Show information about branches.
634
634
635 All known branches are contained in the output, even closed branches.
635 All known branches are contained in the output, even closed branches.
636
636
637 No arguments are accepted.
637 No arguments are accepted.
638
638
639 The ``branches`` template is rendered.
639 The ``branches`` template is rendered.
640 """
640 """
641 entries = webutil.branchentries(web.repo, web.stripecount)
641 entries = webutil.branchentries(web.repo, web.stripecount)
642 latestentry = webutil.branchentries(web.repo, web.stripecount, 1)
642 latestentry = webutil.branchentries(web.repo, web.stripecount, 1)
643 return tmpl('branches', node=hex(web.repo.changelog.tip()),
643 return tmpl('branches', node=hex(web.repo.changelog.tip()),
644 entries=entries, latestentry=latestentry)
644 entries=entries, latestentry=latestentry)
645
645
646 @webcommand('summary')
646 @webcommand('summary')
647 def summary(web, req, tmpl):
647 def summary(web, req, tmpl):
648 """
648 """
649 /summary
649 /summary
650 --------
650 --------
651
651
652 Show a summary of repository state.
652 Show a summary of repository state.
653
653
654 Information about the latest changesets, bookmarks, tags, and branches
654 Information about the latest changesets, bookmarks, tags, and branches
655 is captured by this handler.
655 is captured by this handler.
656
656
657 The ``summary`` template is rendered.
657 The ``summary`` template is rendered.
658 """
658 """
659 i = reversed(web.repo.tagslist())
659 i = reversed(web.repo.tagslist())
660
660
661 def tagentries(**map):
661 def tagentries(**map):
662 parity = paritygen(web.stripecount)
662 parity = paritygen(web.stripecount)
663 count = 0
663 count = 0
664 for k, n in i:
664 for k, n in i:
665 if k == "tip": # skip tip
665 if k == "tip": # skip tip
666 continue
666 continue
667
667
668 count += 1
668 count += 1
669 if count > 10: # limit to 10 tags
669 if count > 10: # limit to 10 tags
670 break
670 break
671
671
672 yield tmpl("tagentry",
672 yield tmpl("tagentry",
673 parity=parity.next(),
673 parity=parity.next(),
674 tag=k,
674 tag=k,
675 node=hex(n),
675 node=hex(n),
676 date=web.repo[n].date())
676 date=web.repo[n].date())
677
677
678 def bookmarks(**map):
678 def bookmarks(**map):
679 parity = paritygen(web.stripecount)
679 parity = paritygen(web.stripecount)
680 marks = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
680 marks = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
681 for k, n in sorted(marks)[:10]: # limit to 10 bookmarks
681 for k, n in sorted(marks)[:10]: # limit to 10 bookmarks
682 yield {'parity': parity.next(),
682 yield {'parity': parity.next(),
683 'bookmark': k,
683 'bookmark': k,
684 'date': web.repo[n].date(),
684 'date': web.repo[n].date(),
685 'node': hex(n)}
685 'node': hex(n)}
686
686
687 def changelist(**map):
687 def changelist(**map):
688 parity = paritygen(web.stripecount, offset=start - end)
688 parity = paritygen(web.stripecount, offset=start - end)
689 l = [] # build a list in forward order for efficiency
689 l = [] # build a list in forward order for efficiency
690 revs = []
690 revs = []
691 if start < end:
691 if start < end:
692 revs = web.repo.changelog.revs(start, end - 1)
692 revs = web.repo.changelog.revs(start, end - 1)
693 for i in revs:
693 for i in revs:
694 ctx = web.repo[i]
694 ctx = web.repo[i]
695
695
696 l.append(tmpl(
696 l.append(tmpl(
697 'shortlogentry',
697 'shortlogentry',
698 parity=parity.next(),
698 parity=parity.next(),
699 **webutil.commonentry(web.repo, ctx)))
699 **webutil.commonentry(web.repo, ctx)))
700
700
701 l.reverse()
701 l.reverse()
702 yield l
702 yield l
703
703
704 tip = web.repo['tip']
704 tip = web.repo['tip']
705 count = len(web.repo)
705 count = len(web.repo)
706 start = max(0, count - web.maxchanges)
706 start = max(0, count - web.maxchanges)
707 end = min(count, start + web.maxchanges)
707 end = min(count, start + web.maxchanges)
708
708
709 return tmpl("summary",
709 return tmpl("summary",
710 desc=web.config("web", "description", "unknown"),
710 desc=web.config("web", "description", "unknown"),
711 owner=get_contact(web.config) or "unknown",
711 owner=get_contact(web.config) or "unknown",
712 lastchange=tip.date(),
712 lastchange=tip.date(),
713 tags=tagentries,
713 tags=tagentries,
714 bookmarks=bookmarks,
714 bookmarks=bookmarks,
715 branches=webutil.branchentries(web.repo, web.stripecount, 10),
715 branches=webutil.branchentries(web.repo, web.stripecount, 10),
716 shortlog=changelist,
716 shortlog=changelist,
717 node=tip.hex(),
717 node=tip.hex(),
718 symrev='tip',
718 symrev='tip',
719 archives=web.archivelist("tip"))
719 archives=web.archivelist("tip"))
720
720
721 @webcommand('filediff')
721 @webcommand('filediff')
722 def filediff(web, req, tmpl):
722 def filediff(web, req, tmpl):
723 """
723 """
724 /diff/{revision}/{path}
724 /diff/{revision}/{path}
725 -----------------------
725 -----------------------
726
726
727 Show how a file changed in a particular commit.
727 Show how a file changed in a particular commit.
728
728
729 The ``filediff`` template is rendered.
729 The ``filediff`` template is rendered.
730
730
731 This handler is registered under both the ``/diff`` and ``/filediff``
731 This handler is registered under both the ``/diff`` and ``/filediff``
732 paths. ``/diff`` is used in modern code.
732 paths. ``/diff`` is used in modern code.
733 """
733 """
734 fctx, ctx = None, None
734 fctx, ctx = None, None
735 try:
735 try:
736 fctx = webutil.filectx(web.repo, req)
736 fctx = webutil.filectx(web.repo, req)
737 except LookupError:
737 except LookupError:
738 ctx = webutil.changectx(web.repo, req)
738 ctx = webutil.changectx(web.repo, req)
739 path = webutil.cleanpath(web.repo, req.form['file'][0])
739 path = webutil.cleanpath(web.repo, req.form['file'][0])
740 if path not in ctx.files():
740 if path not in ctx.files():
741 raise
741 raise
742
742
743 if fctx is not None:
743 if fctx is not None:
744 path = fctx.path()
744 path = fctx.path()
745 ctx = fctx.changectx()
745 ctx = fctx.changectx()
746
746
747 parity = paritygen(web.stripecount)
747 parity = paritygen(web.stripecount)
748 style = web.config('web', 'style', 'paper')
748 style = web.config('web', 'style', 'paper')
749 if 'style' in req.form:
749 if 'style' in req.form:
750 style = req.form['style'][0]
750 style = req.form['style'][0]
751
751
752 diffs = webutil.diffs(web.repo, tmpl, ctx, None, [path], parity, style)
752 diffs = webutil.diffs(web.repo, tmpl, ctx, None, [path], parity, style)
753 if fctx is not None:
753 if fctx is not None:
754 rename = webutil.renamelink(fctx)
754 rename = webutil.renamelink(fctx)
755 ctx = fctx
755 ctx = fctx
756 else:
756 else:
757 rename = []
757 rename = []
758 ctx = ctx
758 ctx = ctx
759 return tmpl("filediff",
759 return tmpl("filediff",
760 file=path,
760 file=path,
761 symrev=webutil.symrevorshortnode(req, ctx),
761 symrev=webutil.symrevorshortnode(req, ctx),
762 rename=rename,
762 rename=rename,
763 diff=diffs,
763 diff=diffs,
764 **webutil.commonentry(web.repo, ctx))
764 **webutil.commonentry(web.repo, ctx))
765
765
766 diff = webcommand('diff')(filediff)
766 diff = webcommand('diff')(filediff)
767
767
768 @webcommand('comparison')
768 @webcommand('comparison')
769 def comparison(web, req, tmpl):
769 def comparison(web, req, tmpl):
770 """
770 """
771 /comparison/{revision}/{path}
771 /comparison/{revision}/{path}
772 -----------------------------
772 -----------------------------
773
773
774 Show a comparison between the old and new versions of a file from changes
774 Show a comparison between the old and new versions of a file from changes
775 made on a particular revision.
775 made on a particular revision.
776
776
777 This is similar to the ``diff`` handler. However, this form features
777 This is similar to the ``diff`` handler. However, this form features
778 a split or side-by-side diff rather than a unified diff.
778 a split or side-by-side diff rather than a unified diff.
779
779
780 The ``context`` query string argument can be used to control the lines of
780 The ``context`` query string argument can be used to control the lines of
781 context in the diff.
781 context in the diff.
782
782
783 The ``filecomparison`` template is rendered.
783 The ``filecomparison`` template is rendered.
784 """
784 """
785 ctx = webutil.changectx(web.repo, req)
785 ctx = webutil.changectx(web.repo, req)
786 if 'file' not in req.form:
786 if 'file' not in req.form:
787 raise ErrorResponse(HTTP_NOT_FOUND, 'file not given')
787 raise ErrorResponse(HTTP_NOT_FOUND, 'file not given')
788 path = webutil.cleanpath(web.repo, req.form['file'][0])
788 path = webutil.cleanpath(web.repo, req.form['file'][0])
789
789
790 parsecontext = lambda v: v == 'full' and -1 or int(v)
790 parsecontext = lambda v: v == 'full' and -1 or int(v)
791 if 'context' in req.form:
791 if 'context' in req.form:
792 context = parsecontext(req.form['context'][0])
792 context = parsecontext(req.form['context'][0])
793 else:
793 else:
794 context = parsecontext(web.config('web', 'comparisoncontext', '5'))
794 context = parsecontext(web.config('web', 'comparisoncontext', '5'))
795
795
796 def filelines(f):
796 def filelines(f):
797 if util.binary(f.data()):
797 if util.binary(f.data()):
798 mt = mimetypes.guess_type(f.path())[0]
798 mt = mimetypes.guess_type(f.path())[0]
799 if not mt:
799 if not mt:
800 mt = 'application/octet-stream'
800 mt = 'application/octet-stream'
801 return [_('(binary file %s, hash: %s)') % (mt, hex(f.filenode()))]
801 return [_('(binary file %s, hash: %s)') % (mt, hex(f.filenode()))]
802 return f.data().splitlines()
802 return f.data().splitlines()
803
803
804 fctx = None
804 fctx = None
805 parent = ctx.p1()
805 parent = ctx.p1()
806 leftrev = parent.rev()
806 leftrev = parent.rev()
807 leftnode = parent.node()
807 leftnode = parent.node()
808 rightrev = ctx.rev()
808 rightrev = ctx.rev()
809 rightnode = ctx.node()
809 rightnode = ctx.node()
810 if path in ctx:
810 if path in ctx:
811 fctx = ctx[path]
811 fctx = ctx[path]
812 rightlines = filelines(fctx)
812 rightlines = filelines(fctx)
813 if path not in parent:
813 if path not in parent:
814 leftlines = ()
814 leftlines = ()
815 else:
815 else:
816 pfctx = parent[path]
816 pfctx = parent[path]
817 leftlines = filelines(pfctx)
817 leftlines = filelines(pfctx)
818 else:
818 else:
819 rightlines = ()
819 rightlines = ()
820 pfctx = ctx.parents()[0][path]
820 pfctx = ctx.parents()[0][path]
821 leftlines = filelines(pfctx)
821 leftlines = filelines(pfctx)
822
822
823 comparison = webutil.compare(tmpl, context, leftlines, rightlines)
823 comparison = webutil.compare(tmpl, context, leftlines, rightlines)
824 if fctx is not None:
824 if fctx is not None:
825 rename = webutil.renamelink(fctx)
825 rename = webutil.renamelink(fctx)
826 ctx = fctx
826 ctx = fctx
827 else:
827 else:
828 rename = []
828 rename = []
829 ctx = ctx
829 ctx = ctx
830 return tmpl('filecomparison',
830 return tmpl('filecomparison',
831 file=path,
831 file=path,
832 symrev=webutil.symrevorshortnode(req, ctx),
832 symrev=webutil.symrevorshortnode(req, ctx),
833 rename=rename,
833 rename=rename,
834 leftrev=leftrev,
834 leftrev=leftrev,
835 leftnode=hex(leftnode),
835 leftnode=hex(leftnode),
836 rightrev=rightrev,
836 rightrev=rightrev,
837 rightnode=hex(rightnode),
837 rightnode=hex(rightnode),
838 comparison=comparison,
838 comparison=comparison,
839 **webutil.commonentry(web.repo, ctx))
839 **webutil.commonentry(web.repo, ctx))
840
840
841 @webcommand('annotate')
841 @webcommand('annotate')
842 def annotate(web, req, tmpl):
842 def annotate(web, req, tmpl):
843 """
843 """
844 /annotate/{revision}/{path}
844 /annotate/{revision}/{path}
845 ---------------------------
845 ---------------------------
846
846
847 Show changeset information for each line in a file.
847 Show changeset information for each line in a file.
848
848
849 The ``fileannotate`` template is rendered.
849 The ``fileannotate`` template is rendered.
850 """
850 """
851 fctx = webutil.filectx(web.repo, req)
851 fctx = webutil.filectx(web.repo, req)
852 f = fctx.path()
852 f = fctx.path()
853 parity = paritygen(web.stripecount)
853 parity = paritygen(web.stripecount)
854 diffopts = patch.difffeatureopts(web.repo.ui, untrusted=True,
854 diffopts = patch.difffeatureopts(web.repo.ui, untrusted=True,
855 section='annotate', whitespace=True)
855 section='annotate', whitespace=True)
856
856
857 def annotate(**map):
857 def annotate(**map):
858 last = None
858 last = None
859 if util.binary(fctx.data()):
859 if util.binary(fctx.data()):
860 mt = (mimetypes.guess_type(fctx.path())[0]
860 mt = (mimetypes.guess_type(fctx.path())[0]
861 or 'application/octet-stream')
861 or 'application/octet-stream')
862 lines = enumerate([((fctx.filectx(fctx.filerev()), 1),
862 lines = enumerate([((fctx.filectx(fctx.filerev()), 1),
863 '(binary:%s)' % mt)])
863 '(binary:%s)' % mt)])
864 else:
864 else:
865 lines = enumerate(fctx.annotate(follow=True, linenumber=True,
865 lines = enumerate(fctx.annotate(follow=True, linenumber=True,
866 diffopts=diffopts))
866 diffopts=diffopts))
867 for lineno, ((f, targetline), l) in lines:
867 for lineno, ((f, targetline), l) in lines:
868 fnode = f.filenode()
868 fnode = f.filenode()
869
869
870 if last != fnode:
870 if last != fnode:
871 last = fnode
871 last = fnode
872
872
873 yield {"parity": parity.next(),
873 yield {"parity": parity.next(),
874 "node": f.hex(),
874 "node": f.hex(),
875 "rev": f.rev(),
875 "rev": f.rev(),
876 "author": f.user(),
876 "author": f.user(),
877 "desc": f.description(),
877 "desc": f.description(),
878 "extra": f.extra(),
878 "extra": f.extra(),
879 "file": f.path(),
879 "file": f.path(),
880 "targetline": targetline,
880 "targetline": targetline,
881 "line": l,
881 "line": l,
882 "lineno": lineno + 1,
882 "lineno": lineno + 1,
883 "lineid": "l%d" % (lineno + 1),
883 "lineid": "l%d" % (lineno + 1),
884 "linenumber": "% 6d" % (lineno + 1),
884 "linenumber": "% 6d" % (lineno + 1),
885 "revdate": f.date()}
885 "revdate": f.date()}
886
886
887 return tmpl("fileannotate",
887 return tmpl("fileannotate",
888 file=f,
888 file=f,
889 annotate=annotate,
889 annotate=annotate,
890 path=webutil.up(f),
890 path=webutil.up(f),
891 symrev=webutil.symrevorshortnode(req, fctx),
891 symrev=webutil.symrevorshortnode(req, fctx),
892 rename=webutil.renamelink(fctx),
892 rename=webutil.renamelink(fctx),
893 permissions=fctx.manifest().flags(f),
893 permissions=fctx.manifest().flags(f),
894 **webutil.commonentry(web.repo, fctx))
894 **webutil.commonentry(web.repo, fctx))
895
895
896 @webcommand('filelog')
896 @webcommand('filelog')
897 def filelog(web, req, tmpl):
897 def filelog(web, req, tmpl):
898 """
898 """
899 /filelog/{revision}/{path}
899 /filelog/{revision}/{path}
900 --------------------------
900 --------------------------
901
901
902 Show information about the history of a file in the repository.
902 Show information about the history of a file in the repository.
903
903
904 The ``revcount`` query string argument can be defined to control the
904 The ``revcount`` query string argument can be defined to control the
905 maximum number of entries to show.
905 maximum number of entries to show.
906
906
907 The ``filelog`` template will be rendered.
907 The ``filelog`` template will be rendered.
908 """
908 """
909
909
910 try:
910 try:
911 fctx = webutil.filectx(web.repo, req)
911 fctx = webutil.filectx(web.repo, req)
912 f = fctx.path()
912 f = fctx.path()
913 fl = fctx.filelog()
913 fl = fctx.filelog()
914 except error.LookupError:
914 except error.LookupError:
915 f = webutil.cleanpath(web.repo, req.form['file'][0])
915 f = webutil.cleanpath(web.repo, req.form['file'][0])
916 fl = web.repo.file(f)
916 fl = web.repo.file(f)
917 numrevs = len(fl)
917 numrevs = len(fl)
918 if not numrevs: # file doesn't exist at all
918 if not numrevs: # file doesn't exist at all
919 raise
919 raise
920 rev = webutil.changectx(web.repo, req).rev()
920 rev = webutil.changectx(web.repo, req).rev()
921 first = fl.linkrev(0)
921 first = fl.linkrev(0)
922 if rev < first: # current rev is from before file existed
922 if rev < first: # current rev is from before file existed
923 raise
923 raise
924 frev = numrevs - 1
924 frev = numrevs - 1
925 while fl.linkrev(frev) > rev:
925 while fl.linkrev(frev) > rev:
926 frev -= 1
926 frev -= 1
927 fctx = web.repo.filectx(f, fl.linkrev(frev))
927 fctx = web.repo.filectx(f, fl.linkrev(frev))
928
928
929 revcount = web.maxshortchanges
929 revcount = web.maxshortchanges
930 if 'revcount' in req.form:
930 if 'revcount' in req.form:
931 try:
931 try:
932 revcount = int(req.form.get('revcount', [revcount])[0])
932 revcount = int(req.form.get('revcount', [revcount])[0])
933 revcount = max(revcount, 1)
933 revcount = max(revcount, 1)
934 tmpl.defaults['sessionvars']['revcount'] = revcount
934 tmpl.defaults['sessionvars']['revcount'] = revcount
935 except ValueError:
935 except ValueError:
936 pass
936 pass
937
937
938 lessvars = copy.copy(tmpl.defaults['sessionvars'])
938 lessvars = copy.copy(tmpl.defaults['sessionvars'])
939 lessvars['revcount'] = max(revcount / 2, 1)
939 lessvars['revcount'] = max(revcount / 2, 1)
940 morevars = copy.copy(tmpl.defaults['sessionvars'])
940 morevars = copy.copy(tmpl.defaults['sessionvars'])
941 morevars['revcount'] = revcount * 2
941 morevars['revcount'] = revcount * 2
942
942
943 count = fctx.filerev() + 1
943 count = fctx.filerev() + 1
944 start = max(0, fctx.filerev() - revcount + 1) # first rev on this page
944 start = max(0, fctx.filerev() - revcount + 1) # first rev on this page
945 end = min(count, start + revcount) # last rev on this page
945 end = min(count, start + revcount) # last rev on this page
946 parity = paritygen(web.stripecount, offset=start - end)
946 parity = paritygen(web.stripecount, offset=start - end)
947
947
948 def entries():
948 def entries():
949 l = []
949 l = []
950
950
951 repo = web.repo
951 repo = web.repo
952 revs = fctx.filelog().revs(start, end - 1)
952 revs = fctx.filelog().revs(start, end - 1)
953 for i in revs:
953 for i in revs:
954 iterfctx = fctx.filectx(i)
954 iterfctx = fctx.filectx(i)
955
955
956 l.append(dict(
956 l.append(dict(
957 parity=parity.next(),
957 parity=parity.next(),
958 filerev=i,
958 filerev=i,
959 file=f,
959 file=f,
960 rename=webutil.renamelink(iterfctx),
960 rename=webutil.renamelink(iterfctx),
961 **webutil.commonentry(repo, iterfctx)))
961 **webutil.commonentry(repo, iterfctx)))
962 for e in reversed(l):
962 for e in reversed(l):
963 yield e
963 yield e
964
964
965 entries = list(entries())
965 entries = list(entries())
966 latestentry = entries[:1]
966 latestentry = entries[:1]
967
967
968 revnav = webutil.filerevnav(web.repo, fctx.path())
968 revnav = webutil.filerevnav(web.repo, fctx.path())
969 nav = revnav.gen(end - 1, revcount, count)
969 nav = revnav.gen(end - 1, revcount, count)
970 return tmpl("filelog",
970 return tmpl("filelog",
971 file=f,
971 file=f,
972 nav=nav,
972 nav=nav,
973 symrev=webutil.symrevorshortnode(req, fctx),
973 symrev=webutil.symrevorshortnode(req, fctx),
974 entries=entries,
974 entries=entries,
975 latestentry=latestentry,
975 latestentry=latestentry,
976 revcount=revcount,
976 revcount=revcount,
977 morevars=morevars,
977 morevars=morevars,
978 lessvars=lessvars,
978 lessvars=lessvars,
979 **webutil.commonentry(web.repo, fctx))
979 **webutil.commonentry(web.repo, fctx))
980
980
981 @webcommand('archive')
981 @webcommand('archive')
982 def archive(web, req, tmpl):
982 def archive(web, req, tmpl):
983 """
983 """
984 /archive/{revision}.{format}[/{path}]
984 /archive/{revision}.{format}[/{path}]
985 -------------------------------------
985 -------------------------------------
986
986
987 Obtain an archive of repository content.
987 Obtain an archive of repository content.
988
988
989 The content and type of the archive is defined by a URL path parameter.
989 The content and type of the archive is defined by a URL path parameter.
990 ``format`` is the file extension of the archive type to be generated. e.g.
990 ``format`` is the file extension of the archive type to be generated. e.g.
991 ``zip`` or ``tar.bz2``. Not all archive types may be allowed by your
991 ``zip`` or ``tar.bz2``. Not all archive types may be allowed by your
992 server configuration.
992 server configuration.
993
993
994 The optional ``path`` URL parameter controls content to include in the
994 The optional ``path`` URL parameter controls content to include in the
995 archive. If omitted, every file in the specified revision is present in the
995 archive. If omitted, every file in the specified revision is present in the
996 archive. If included, only the specified file or contents of the specified
996 archive. If included, only the specified file or contents of the specified
997 directory will be included in the archive.
997 directory will be included in the archive.
998
998
999 No template is used for this handler. Raw, binary content is generated.
999 No template is used for this handler. Raw, binary content is generated.
1000 """
1000 """
1001
1001
1002 type_ = req.form.get('type', [None])[0]
1002 type_ = req.form.get('type', [None])[0]
1003 allowed = web.configlist("web", "allow_archive")
1003 allowed = web.configlist("web", "allow_archive")
1004 key = req.form['node'][0]
1004 key = req.form['node'][0]
1005
1005
1006 if type_ not in web.archives:
1006 if type_ not in web.archives:
1007 msg = 'Unsupported archive type: %s' % type_
1007 msg = 'Unsupported archive type: %s' % type_
1008 raise ErrorResponse(HTTP_NOT_FOUND, msg)
1008 raise ErrorResponse(HTTP_NOT_FOUND, msg)
1009
1009
1010 if not ((type_ in allowed or
1010 if not ((type_ in allowed or
1011 web.configbool("web", "allow" + type_, False))):
1011 web.configbool("web", "allow" + type_, False))):
1012 msg = 'Archive type not allowed: %s' % type_
1012 msg = 'Archive type not allowed: %s' % type_
1013 raise ErrorResponse(HTTP_FORBIDDEN, msg)
1013 raise ErrorResponse(HTTP_FORBIDDEN, msg)
1014
1014
1015 reponame = re.sub(r"\W+", "-", os.path.basename(web.reponame))
1015 reponame = re.sub(r"\W+", "-", os.path.basename(web.reponame))
1016 cnode = web.repo.lookup(key)
1016 cnode = web.repo.lookup(key)
1017 arch_version = key
1017 arch_version = key
1018 if cnode == key or key == 'tip':
1018 if cnode == key or key == 'tip':
1019 arch_version = short(cnode)
1019 arch_version = short(cnode)
1020 name = "%s-%s" % (reponame, arch_version)
1020 name = "%s-%s" % (reponame, arch_version)
1021
1021
1022 ctx = webutil.changectx(web.repo, req)
1022 ctx = webutil.changectx(web.repo, req)
1023 pats = []
1023 pats = []
1024 matchfn = scmutil.match(ctx, [])
1024 matchfn = scmutil.match(ctx, [])
1025 file = req.form.get('file', None)
1025 file = req.form.get('file', None)
1026 if file:
1026 if file:
1027 pats = ['path:' + file[0]]
1027 pats = ['path:' + file[0]]
1028 matchfn = scmutil.match(ctx, pats, default='path')
1028 matchfn = scmutil.match(ctx, pats, default='path')
1029 if pats:
1029 if pats:
1030 files = [f for f in ctx.manifest().keys() if matchfn(f)]
1030 files = [f for f in ctx.manifest().keys() if matchfn(f)]
1031 if not files:
1031 if not files:
1032 raise ErrorResponse(HTTP_NOT_FOUND,
1032 raise ErrorResponse(HTTP_NOT_FOUND,
1033 'file(s) not found: %s' % file[0])
1033 'file(s) not found: %s' % file[0])
1034
1034
1035 mimetype, artype, extension, encoding = web.archivespecs[type_]
1035 mimetype, artype, extension, encoding = web.archivespecs[type_]
1036 headers = [
1036 headers = [
1037 ('Content-Disposition', 'attachment; filename=%s%s' % (name, extension))
1037 ('Content-Disposition', 'attachment; filename=%s%s' % (name, extension))
1038 ]
1038 ]
1039 if encoding:
1039 if encoding:
1040 headers.append(('Content-Encoding', encoding))
1040 headers.append(('Content-Encoding', encoding))
1041 req.headers.extend(headers)
1041 req.headers.extend(headers)
1042 req.respond(HTTP_OK, mimetype)
1042 req.respond(HTTP_OK, mimetype)
1043
1043
1044 archival.archive(web.repo, req, cnode, artype, prefix=name,
1044 archival.archive(web.repo, req, cnode, artype, prefix=name,
1045 matchfn=matchfn,
1045 matchfn=matchfn,
1046 subrepos=web.configbool("web", "archivesubrepos"))
1046 subrepos=web.configbool("web", "archivesubrepos"))
1047 return []
1047 return []
1048
1048
1049
1049
1050 @webcommand('static')
1050 @webcommand('static')
1051 def static(web, req, tmpl):
1051 def static(web, req, tmpl):
1052 fname = req.form['file'][0]
1052 fname = req.form['file'][0]
1053 # a repo owner may set web.static in .hg/hgrc to get any file
1053 # a repo owner may set web.static in .hg/hgrc to get any file
1054 # readable by the user running the CGI script
1054 # readable by the user running the CGI script
1055 static = web.config("web", "static", None, untrusted=False)
1055 static = web.config("web", "static", None, untrusted=False)
1056 if not static:
1056 if not static:
1057 tp = web.templatepath or templater.templatepaths()
1057 tp = web.templatepath or templater.templatepaths()
1058 if isinstance(tp, str):
1058 if isinstance(tp, str):
1059 tp = [tp]
1059 tp = [tp]
1060 static = [os.path.join(p, 'static') for p in tp]
1060 static = [os.path.join(p, 'static') for p in tp]
1061 staticfile(static, fname, req)
1061 staticfile(static, fname, req)
1062 return []
1062 return []
1063
1063
1064 @webcommand('graph')
1064 @webcommand('graph')
1065 def graph(web, req, tmpl):
1065 def graph(web, req, tmpl):
1066 """
1066 """
1067 /graph[/{revision}]
1067 /graph[/{revision}]
1068 -------------------
1068 -------------------
1069
1069
1070 Show information about the graphical topology of the repository.
1070 Show information about the graphical topology of the repository.
1071
1071
1072 Information rendered by this handler can be used to create visual
1072 Information rendered by this handler can be used to create visual
1073 representations of repository topology.
1073 representations of repository topology.
1074
1074
1075 The ``revision`` URL parameter controls the starting changeset.
1075 The ``revision`` URL parameter controls the starting changeset.
1076
1076
1077 The ``revcount`` query string argument can define the number of changesets
1077 The ``revcount`` query string argument can define the number of changesets
1078 to show information for.
1078 to show information for.
1079
1079
1080 This handler will render the ``graph`` template.
1080 This handler will render the ``graph`` template.
1081 """
1081 """
1082
1082
1083 if 'node' in req.form:
1083 if 'node' in req.form:
1084 ctx = webutil.changectx(web.repo, req)
1084 ctx = webutil.changectx(web.repo, req)
1085 symrev = webutil.symrevorshortnode(req, ctx)
1085 symrev = webutil.symrevorshortnode(req, ctx)
1086 else:
1086 else:
1087 ctx = web.repo['tip']
1087 ctx = web.repo['tip']
1088 symrev = 'tip'
1088 symrev = 'tip'
1089 rev = ctx.rev()
1089 rev = ctx.rev()
1090
1090
1091 bg_height = 39
1091 bg_height = 39
1092 revcount = web.maxshortchanges
1092 revcount = web.maxshortchanges
1093 if 'revcount' in req.form:
1093 if 'revcount' in req.form:
1094 try:
1094 try:
1095 revcount = int(req.form.get('revcount', [revcount])[0])
1095 revcount = int(req.form.get('revcount', [revcount])[0])
1096 revcount = max(revcount, 1)
1096 revcount = max(revcount, 1)
1097 tmpl.defaults['sessionvars']['revcount'] = revcount
1097 tmpl.defaults['sessionvars']['revcount'] = revcount
1098 except ValueError:
1098 except ValueError:
1099 pass
1099 pass
1100
1100
1101 lessvars = copy.copy(tmpl.defaults['sessionvars'])
1101 lessvars = copy.copy(tmpl.defaults['sessionvars'])
1102 lessvars['revcount'] = max(revcount / 2, 1)
1102 lessvars['revcount'] = max(revcount / 2, 1)
1103 morevars = copy.copy(tmpl.defaults['sessionvars'])
1103 morevars = copy.copy(tmpl.defaults['sessionvars'])
1104 morevars['revcount'] = revcount * 2
1104 morevars['revcount'] = revcount * 2
1105
1105
1106 count = len(web.repo)
1106 count = len(web.repo)
1107 pos = rev
1107 pos = rev
1108
1108
1109 uprev = min(max(0, count - 1), rev + revcount)
1109 uprev = min(max(0, count - 1), rev + revcount)
1110 downrev = max(0, rev - revcount)
1110 downrev = max(0, rev - revcount)
1111 changenav = webutil.revnav(web.repo).gen(pos, revcount, count)
1111 changenav = webutil.revnav(web.repo).gen(pos, revcount, count)
1112
1112
1113 tree = []
1113 tree = []
1114 if pos != -1:
1114 if pos != -1:
1115 allrevs = web.repo.changelog.revs(pos, 0)
1115 allrevs = web.repo.changelog.revs(pos, 0)
1116 revs = []
1116 revs = []
1117 for i in allrevs:
1117 for i in allrevs:
1118 revs.append(i)
1118 revs.append(i)
1119 if len(revs) >= revcount:
1119 if len(revs) >= revcount:
1120 break
1120 break
1121
1121
1122 # We have to feed a baseset to dagwalker as it is expecting smartset
1122 # We have to feed a baseset to dagwalker as it is expecting smartset
1123 # object. This does not have a big impact on hgweb performance itself
1123 # object. This does not have a big impact on hgweb performance itself
1124 # since hgweb graphing code is not itself lazy yet.
1124 # since hgweb graphing code is not itself lazy yet.
1125 dag = graphmod.dagwalker(web.repo, revset.baseset(revs))
1125 dag = graphmod.dagwalker(web.repo, revset.baseset(revs))
1126 # As we said one line above... not lazy.
1126 # As we said one line above... not lazy.
1127 tree = list(graphmod.colored(dag, web.repo))
1127 tree = list(graphmod.colored(dag, web.repo))
1128
1128
1129 def getcolumns(tree):
1129 def getcolumns(tree):
1130 cols = 0
1130 cols = 0
1131 for (id, type, ctx, vtx, edges) in tree:
1131 for (id, type, ctx, vtx, edges) in tree:
1132 if type != graphmod.CHANGESET:
1132 if type != graphmod.CHANGESET:
1133 continue
1133 continue
1134 cols = max(cols, max([edge[0] for edge in edges] or [0]),
1134 cols = max(cols, max([edge[0] for edge in edges] or [0]),
1135 max([edge[1] for edge in edges] or [0]))
1135 max([edge[1] for edge in edges] or [0]))
1136 return cols
1136 return cols
1137
1137
1138 def graphdata(usetuples, **map):
1138 def graphdata(usetuples, **map):
1139 data = []
1139 data = []
1140
1140
1141 row = 0
1141 row = 0
1142 for (id, type, ctx, vtx, edges) in tree:
1142 for (id, type, ctx, vtx, edges) in tree:
1143 if type != graphmod.CHANGESET:
1143 if type != graphmod.CHANGESET:
1144 continue
1144 continue
1145 node = str(ctx)
1145 node = str(ctx)
1146 age = templatefilters.age(ctx.date())
1146 age = templatefilters.age(ctx.date())
1147 desc = templatefilters.firstline(ctx.description())
1147 desc = templatefilters.firstline(ctx.description())
1148 desc = cgi.escape(templatefilters.nonempty(desc))
1148 desc = cgi.escape(templatefilters.nonempty(desc))
1149 user = cgi.escape(templatefilters.person(ctx.user()))
1149 user = cgi.escape(templatefilters.person(ctx.user()))
1150 branch = cgi.escape(ctx.branch())
1150 branch = cgi.escape(ctx.branch())
1151 try:
1151 try:
1152 branchnode = web.repo.branchtip(branch)
1152 branchnode = web.repo.branchtip(branch)
1153 except error.RepoLookupError:
1153 except error.RepoLookupError:
1154 branchnode = None
1154 branchnode = None
1155 branch = branch, branchnode == ctx.node()
1155 branch = branch, branchnode == ctx.node()
1156
1156
1157 if usetuples:
1157 if usetuples:
1158 data.append((node, vtx, edges, desc, user, age, branch,
1158 data.append((node, vtx, edges, desc, user, age, branch,
1159 [cgi.escape(x) for x in ctx.tags()],
1159 [cgi.escape(x) for x in ctx.tags()],
1160 [cgi.escape(x) for x in ctx.bookmarks()]))
1160 [cgi.escape(x) for x in ctx.bookmarks()]))
1161 else:
1161 else:
1162 edgedata = [{'col': edge[0], 'nextcol': edge[1],
1162 edgedata = [{'col': edge[0], 'nextcol': edge[1],
1163 'color': (edge[2] - 1) % 6 + 1,
1163 'color': (edge[2] - 1) % 6 + 1,
1164 'width': edge[3], 'bcolor': edge[4]}
1164 'width': edge[3], 'bcolor': edge[4]}
1165 for edge in edges]
1165 for edge in edges]
1166
1166
1167 data.append(
1167 data.append(
1168 {'node': node,
1168 {'node': node,
1169 'col': vtx[0],
1169 'col': vtx[0],
1170 'color': (vtx[1] - 1) % 6 + 1,
1170 'color': (vtx[1] - 1) % 6 + 1,
1171 'edges': edgedata,
1171 'edges': edgedata,
1172 'row': row,
1172 'row': row,
1173 'nextrow': row + 1,
1173 'nextrow': row + 1,
1174 'desc': desc,
1174 'desc': desc,
1175 'user': user,
1175 'user': user,
1176 'age': age,
1176 'age': age,
1177 'bookmarks': webutil.nodebookmarksdict(
1177 'bookmarks': webutil.nodebookmarksdict(
1178 web.repo, ctx.node()),
1178 web.repo, ctx.node()),
1179 'branches': webutil.nodebranchdict(web.repo, ctx),
1179 'branches': webutil.nodebranchdict(web.repo, ctx),
1180 'inbranch': webutil.nodeinbranch(web.repo, ctx),
1180 'inbranch': webutil.nodeinbranch(web.repo, ctx),
1181 'tags': webutil.nodetagsdict(web.repo, ctx.node())})
1181 'tags': webutil.nodetagsdict(web.repo, ctx.node())})
1182
1182
1183 row += 1
1183 row += 1
1184
1184
1185 return data
1185 return data
1186
1186
1187 cols = getcolumns(tree)
1187 cols = getcolumns(tree)
1188 rows = len(tree)
1188 rows = len(tree)
1189 canvasheight = (rows + 1) * bg_height - 27
1189 canvasheight = (rows + 1) * bg_height - 27
1190
1190
1191 return tmpl('graph', rev=rev, symrev=symrev, revcount=revcount,
1191 return tmpl('graph', rev=rev, symrev=symrev, revcount=revcount,
1192 uprev=uprev,
1192 uprev=uprev,
1193 lessvars=lessvars, morevars=morevars, downrev=downrev,
1193 lessvars=lessvars, morevars=morevars, downrev=downrev,
1194 cols=cols, rows=rows,
1194 cols=cols, rows=rows,
1195 canvaswidth=(cols + 1) * bg_height,
1195 canvaswidth=(cols + 1) * bg_height,
1196 truecanvasheight=rows * bg_height,
1196 truecanvasheight=rows * bg_height,
1197 canvasheight=canvasheight, bg_height=bg_height,
1197 canvasheight=canvasheight, bg_height=bg_height,
1198 jsdata=lambda **x: graphdata(True, **x),
1198 jsdata=lambda **x: graphdata(True, **x),
1199 nodes=lambda **x: graphdata(False, **x),
1199 nodes=lambda **x: graphdata(False, **x),
1200 node=ctx.hex(), changenav=changenav)
1200 node=ctx.hex(), changenav=changenav)
1201
1201
1202 def _getdoc(e):
1202 def _getdoc(e):
1203 doc = e[0].__doc__
1203 doc = e[0].__doc__
1204 if doc:
1204 if doc:
1205 doc = _(doc).partition('\n')[0]
1205 doc = _(doc).partition('\n')[0]
1206 else:
1206 else:
1207 doc = _('(no help text available)')
1207 doc = _('(no help text available)')
1208 return doc
1208 return doc
1209
1209
1210 @webcommand('help')
1210 @webcommand('help')
1211 def help(web, req, tmpl):
1211 def help(web, req, tmpl):
1212 """
1212 """
1213 /help[/{topic}]
1213 /help[/{topic}]
1214 ---------------
1214 ---------------
1215
1215
1216 Render help documentation.
1216 Render help documentation.
1217
1217
1218 This web command is roughly equivalent to :hg:`help`. If a ``topic``
1218 This web command is roughly equivalent to :hg:`help`. If a ``topic``
1219 is defined, that help topic will be rendered. If not, an index of
1219 is defined, that help topic will be rendered. If not, an index of
1220 available help topics will be rendered.
1220 available help topics will be rendered.
1221
1221
1222 The ``help`` template will be rendered when requesting help for a topic.
1222 The ``help`` template will be rendered when requesting help for a topic.
1223 ``helptopics`` will be rendered for the index of help topics.
1223 ``helptopics`` will be rendered for the index of help topics.
1224 """
1224 """
1225 from .. import commands, help as helpmod # avoid cycle
1225 from .. import commands, help as helpmod # avoid cycle
1226
1226
1227 topicname = req.form.get('node', [None])[0]
1227 topicname = req.form.get('node', [None])[0]
1228 if not topicname:
1228 if not topicname:
1229 def topics(**map):
1229 def topics(**map):
1230 for entries, summary, _doc in helpmod.helptable:
1230 for entries, summary, _doc in helpmod.helptable:
1231 yield {'topic': entries[0], 'summary': summary}
1231 yield {'topic': entries[0], 'summary': summary}
1232
1232
1233 early, other = [], []
1233 early, other = [], []
1234 primary = lambda s: s.partition('|')[0]
1234 primary = lambda s: s.partition('|')[0]
1235 for c, e in commands.table.iteritems():
1235 for c, e in commands.table.iteritems():
1236 doc = _getdoc(e)
1236 doc = _getdoc(e)
1237 if 'DEPRECATED' in doc or c.startswith('debug'):
1237 if 'DEPRECATED' in doc or c.startswith('debug'):
1238 continue
1238 continue
1239 cmd = primary(c)
1239 cmd = primary(c)
1240 if cmd.startswith('^'):
1240 if cmd.startswith('^'):
1241 early.append((cmd[1:], doc))
1241 early.append((cmd[1:], doc))
1242 else:
1242 else:
1243 other.append((cmd, doc))
1243 other.append((cmd, doc))
1244
1244
1245 early.sort()
1245 early.sort()
1246 other.sort()
1246 other.sort()
1247
1247
1248 def earlycommands(**map):
1248 def earlycommands(**map):
1249 for c, doc in early:
1249 for c, doc in early:
1250 yield {'topic': c, 'summary': doc}
1250 yield {'topic': c, 'summary': doc}
1251
1251
1252 def othercommands(**map):
1252 def othercommands(**map):
1253 for c, doc in other:
1253 for c, doc in other:
1254 yield {'topic': c, 'summary': doc}
1254 yield {'topic': c, 'summary': doc}
1255
1255
1256 return tmpl('helptopics', topics=topics, earlycommands=earlycommands,
1256 return tmpl('helptopics', topics=topics, earlycommands=earlycommands,
1257 othercommands=othercommands, title='Index')
1257 othercommands=othercommands, title='Index')
1258
1258
1259 # Render an index of sub-topics.
1260 if topicname in helpmod.subtopics:
1261 topics = []
1262 for entries, summary, _doc in helpmod.subtopics[topicname]:
1263 topics.append({
1264 'topic': '%s.%s' % (topicname, entries[0]),
1265 'basename': entries[0],
1266 'summary': summary,
1267 })
1268
1269 return tmpl('helptopics', topics=topics, title=topicname,
1270 subindex=True)
1271
1259 u = webutil.wsgiui()
1272 u = webutil.wsgiui()
1260 u.verbose = True
1273 u.verbose = True
1261 try:
1274 try:
1262 doc = helpmod.help_(u, topicname)
1275 doc = helpmod.help_(u, topicname)
1263 except error.UnknownCommand:
1276 except error.UnknownCommand:
1264 raise ErrorResponse(HTTP_NOT_FOUND)
1277 raise ErrorResponse(HTTP_NOT_FOUND)
1265 return tmpl('help', topic=topicname, doc=doc)
1278 return tmpl('help', topic=topicname, doc=doc)
1266
1279
1267 # tell hggettext to extract docstrings from these functions:
1280 # tell hggettext to extract docstrings from these functions:
1268 i18nfunctions = commands.values()
1281 i18nfunctions = commands.values()
@@ -1,2636 +1,2712 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 changegroup file
61 bundle create a changegroup 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 for a pattern in specified files and revisions
72 grep search for a pattern in specified files and revisions
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 changegroup files
98 unbundle apply one or more changegroup 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 config Configuration Files
105 config Configuration Files
106 dates Date Formats
106 dates Date Formats
107 diffs Diff Formats
107 diffs Diff Formats
108 environment Environment Variables
108 environment Environment Variables
109 extensions Using Additional Features
109 extensions Using Additional Features
110 filesets Specifying File Sets
110 filesets Specifying File Sets
111 glossary Glossary
111 glossary Glossary
112 hgignore Syntax for Mercurial Ignore Files
112 hgignore Syntax for Mercurial Ignore Files
113 hgweb Configuring hgweb
113 hgweb Configuring hgweb
114 internals Technical implementation topics
114 internals Technical implementation topics
115 merge-tools Merge Tools
115 merge-tools Merge Tools
116 multirevs Specifying Multiple Revisions
116 multirevs Specifying Multiple Revisions
117 patterns File Name Patterns
117 patterns File Name Patterns
118 phases Working with Phases
118 phases Working with Phases
119 revisions Specifying Single Revisions
119 revisions Specifying Single Revisions
120 revsets Specifying Revision Sets
120 revsets Specifying Revision Sets
121 scripting Using Mercurial from scripts and automation
121 scripting Using Mercurial from scripts and automation
122 subrepos Subrepositories
122 subrepos Subrepositories
123 templating Template Usage
123 templating Template Usage
124 urls URL Paths
124 urls URL Paths
125
125
126 (use "hg help -v" to show built-in aliases and global options)
126 (use "hg help -v" to show built-in aliases and global options)
127
127
128 $ hg -q help
128 $ hg -q help
129 add add the specified files on the next commit
129 add add the specified files on the next commit
130 addremove add all new files, delete all missing files
130 addremove add all new files, delete all missing files
131 annotate show changeset information by line for each file
131 annotate show changeset information by line for each file
132 archive create an unversioned archive of a repository revision
132 archive create an unversioned archive of a repository revision
133 backout reverse effect of earlier changeset
133 backout reverse effect of earlier changeset
134 bisect subdivision search of changesets
134 bisect subdivision search of changesets
135 bookmarks create a new bookmark or list existing bookmarks
135 bookmarks create a new bookmark or list existing bookmarks
136 branch set or show the current branch name
136 branch set or show the current branch name
137 branches list repository named branches
137 branches list repository named branches
138 bundle create a changegroup file
138 bundle create a changegroup file
139 cat output the current or given revision of files
139 cat output the current or given revision of files
140 clone make a copy of an existing repository
140 clone make a copy of an existing repository
141 commit commit the specified files or all outstanding changes
141 commit commit the specified files or all outstanding changes
142 config show combined config settings from all hgrc files
142 config show combined config settings from all hgrc files
143 copy mark files as copied for the next commit
143 copy mark files as copied for the next commit
144 diff diff repository (or selected files)
144 diff diff repository (or selected files)
145 export dump the header and diffs for one or more changesets
145 export dump the header and diffs for one or more changesets
146 files list tracked files
146 files list tracked files
147 forget forget the specified files on the next commit
147 forget forget the specified files on the next commit
148 graft copy changes from other branches onto the current branch
148 graft copy changes from other branches onto the current branch
149 grep search for a pattern in specified files and revisions
149 grep search for a pattern in specified files and revisions
150 heads show branch heads
150 heads show branch heads
151 help show help for a given topic or a help overview
151 help show help for a given topic or a help overview
152 identify identify the working directory or specified revision
152 identify identify the working directory or specified revision
153 import import an ordered set of patches
153 import import an ordered set of patches
154 incoming show new changesets found in source
154 incoming show new changesets found in source
155 init create a new repository in the given directory
155 init create a new repository in the given directory
156 log show revision history of entire repository or files
156 log show revision history of entire repository or files
157 manifest output the current or given revision of the project manifest
157 manifest output the current or given revision of the project manifest
158 merge merge another revision into working directory
158 merge merge another revision into working directory
159 outgoing show changesets not found in the destination
159 outgoing show changesets not found in the destination
160 paths show aliases for remote repositories
160 paths show aliases for remote repositories
161 phase set or show the current phase name
161 phase set or show the current phase name
162 pull pull changes from the specified source
162 pull pull changes from the specified source
163 push push changes to the specified destination
163 push push changes to the specified destination
164 recover roll back an interrupted transaction
164 recover roll back an interrupted transaction
165 remove remove the specified files on the next commit
165 remove remove the specified files on the next commit
166 rename rename files; equivalent of copy + remove
166 rename rename files; equivalent of copy + remove
167 resolve redo merges or set/view the merge status of files
167 resolve redo merges or set/view the merge status of files
168 revert restore files to their checkout state
168 revert restore files to their checkout state
169 root print the root (top) of the current working directory
169 root print the root (top) of the current working directory
170 serve start stand-alone webserver
170 serve start stand-alone webserver
171 status show changed files in the working directory
171 status show changed files in the working directory
172 summary summarize working directory state
172 summary summarize working directory state
173 tag add one or more tags for the current or given revision
173 tag add one or more tags for the current or given revision
174 tags list repository tags
174 tags list repository tags
175 unbundle apply one or more changegroup files
175 unbundle apply one or more changegroup files
176 update update working directory (or switch revisions)
176 update update working directory (or switch revisions)
177 verify verify the integrity of the repository
177 verify verify the integrity of the repository
178 version output version and copyright information
178 version output version and copyright information
179
179
180 additional help topics:
180 additional help topics:
181
181
182 config Configuration Files
182 config Configuration Files
183 dates Date Formats
183 dates Date Formats
184 diffs Diff Formats
184 diffs Diff Formats
185 environment Environment Variables
185 environment Environment Variables
186 extensions Using Additional Features
186 extensions Using Additional Features
187 filesets Specifying File Sets
187 filesets Specifying File Sets
188 glossary Glossary
188 glossary Glossary
189 hgignore Syntax for Mercurial Ignore Files
189 hgignore Syntax for Mercurial Ignore Files
190 hgweb Configuring hgweb
190 hgweb Configuring hgweb
191 internals Technical implementation topics
191 internals Technical implementation topics
192 merge-tools Merge Tools
192 merge-tools Merge Tools
193 multirevs Specifying Multiple Revisions
193 multirevs Specifying Multiple Revisions
194 patterns File Name Patterns
194 patterns File Name Patterns
195 phases Working with Phases
195 phases Working with Phases
196 revisions Specifying Single Revisions
196 revisions Specifying Single Revisions
197 revsets Specifying Revision Sets
197 revsets Specifying Revision Sets
198 scripting Using Mercurial from scripts and automation
198 scripting Using Mercurial from scripts and automation
199 subrepos Subrepositories
199 subrepos Subrepositories
200 templating Template Usage
200 templating Template Usage
201 urls URL Paths
201 urls URL Paths
202
202
203 Test extension help:
203 Test extension help:
204 $ hg help extensions --config extensions.rebase= --config extensions.children=
204 $ hg help extensions --config extensions.rebase= --config extensions.children=
205 Using Additional Features
205 Using Additional Features
206 """""""""""""""""""""""""
206 """""""""""""""""""""""""
207
207
208 Mercurial has the ability to add new features through the use of
208 Mercurial has the ability to add new features through the use of
209 extensions. Extensions may add new commands, add options to existing
209 extensions. Extensions may add new commands, add options to existing
210 commands, change the default behavior of commands, or implement hooks.
210 commands, change the default behavior of commands, or implement hooks.
211
211
212 To enable the "foo" extension, either shipped with Mercurial or in the
212 To enable the "foo" extension, either shipped with Mercurial or in the
213 Python search path, create an entry for it in your configuration file,
213 Python search path, create an entry for it in your configuration file,
214 like this:
214 like this:
215
215
216 [extensions]
216 [extensions]
217 foo =
217 foo =
218
218
219 You may also specify the full path to an extension:
219 You may also specify the full path to an extension:
220
220
221 [extensions]
221 [extensions]
222 myfeature = ~/.hgext/myfeature.py
222 myfeature = ~/.hgext/myfeature.py
223
223
224 See "hg help config" for more information on configuration files.
224 See "hg help config" for more information on configuration files.
225
225
226 Extensions are not loaded by default for a variety of reasons: they can
226 Extensions are not loaded by default for a variety of reasons: they can
227 increase startup overhead; they may be meant for advanced usage only; they
227 increase startup overhead; they may be meant for advanced usage only; they
228 may provide potentially dangerous abilities (such as letting you destroy
228 may provide potentially dangerous abilities (such as letting you destroy
229 or modify history); they might not be ready for prime time; or they may
229 or modify history); they might not be ready for prime time; or they may
230 alter some usual behaviors of stock Mercurial. It is thus up to the user
230 alter some usual behaviors of stock Mercurial. It is thus up to the user
231 to activate extensions as needed.
231 to activate extensions as needed.
232
232
233 To explicitly disable an extension enabled in a configuration file of
233 To explicitly disable an extension enabled in a configuration file of
234 broader scope, prepend its path with !:
234 broader scope, prepend its path with !:
235
235
236 [extensions]
236 [extensions]
237 # disabling extension bar residing in /path/to/extension/bar.py
237 # disabling extension bar residing in /path/to/extension/bar.py
238 bar = !/path/to/extension/bar.py
238 bar = !/path/to/extension/bar.py
239 # ditto, but no path was supplied for extension baz
239 # ditto, but no path was supplied for extension baz
240 baz = !
240 baz = !
241
241
242 enabled extensions:
242 enabled extensions:
243
243
244 children command to display child changesets (DEPRECATED)
244 children command to display child changesets (DEPRECATED)
245 rebase command to move sets of revisions to a different ancestor
245 rebase command to move sets of revisions to a different ancestor
246
246
247 disabled extensions:
247 disabled extensions:
248
248
249 acl hooks for controlling repository access
249 acl hooks for controlling repository access
250 blackbox log repository events to a blackbox for debugging
250 blackbox log repository events to a blackbox for debugging
251 bugzilla hooks for integrating with the Bugzilla bug tracker
251 bugzilla hooks for integrating with the Bugzilla bug tracker
252 censor erase file content at a given revision
252 censor erase file content at a given revision
253 churn command to display statistics about repository history
253 churn command to display statistics about repository history
254 clonebundles advertise pre-generated bundles to seed clones
254 clonebundles advertise pre-generated bundles to seed clones
255 (experimental)
255 (experimental)
256 color colorize output from some commands
256 color colorize output from some commands
257 convert import revisions from foreign VCS repositories into
257 convert import revisions from foreign VCS repositories into
258 Mercurial
258 Mercurial
259 eol automatically manage newlines in repository files
259 eol automatically manage newlines in repository files
260 extdiff command to allow external programs to compare revisions
260 extdiff command to allow external programs to compare revisions
261 factotum http authentication with factotum
261 factotum http authentication with factotum
262 gpg commands to sign and verify changesets
262 gpg commands to sign and verify changesets
263 hgcia hooks for integrating with the CIA.vc notification service
263 hgcia hooks for integrating with the CIA.vc notification service
264 hgk browse the repository in a graphical way
264 hgk browse the repository in a graphical way
265 highlight syntax highlighting for hgweb (requires Pygments)
265 highlight syntax highlighting for hgweb (requires Pygments)
266 histedit interactive history editing
266 histedit interactive history editing
267 keyword expand keywords in tracked files
267 keyword expand keywords in tracked files
268 largefiles track large binary files
268 largefiles track large binary files
269 mq manage a stack of patches
269 mq manage a stack of patches
270 notify hooks for sending email push notifications
270 notify hooks for sending email push notifications
271 pager browse command output with an external pager
271 pager browse command output with an external pager
272 patchbomb command to send changesets as (a series of) patch emails
272 patchbomb command to send changesets as (a series of) patch emails
273 purge command to delete untracked files from the working
273 purge command to delete untracked files from the working
274 directory
274 directory
275 record commands to interactively select changes for
275 record commands to interactively select changes for
276 commit/qrefresh
276 commit/qrefresh
277 relink recreates hardlinks between repository clones
277 relink recreates hardlinks between repository clones
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 --config CONFIG [+] set/override config option (use 'section.name=value')
326 --config CONFIG [+] set/override config option (use 'section.name=value')
327 --debug enable debugging output
327 --debug enable debugging output
328 --debugger start debugger
328 --debugger start debugger
329 --encoding ENCODE set the charset encoding (default: ascii)
329 --encoding ENCODE set the charset encoding (default: ascii)
330 --encodingmode MODE set the charset encoding mode (default: strict)
330 --encodingmode MODE set the charset encoding mode (default: strict)
331 --traceback always print a traceback on exception
331 --traceback always print a traceback on exception
332 --time time how long the command takes
332 --time time how long the command takes
333 --profile print command execution profile
333 --profile print command execution profile
334 --version output version information and exit
334 --version output version information and exit
335 -h --help display help and exit
335 -h --help display help and exit
336 --hidden consider hidden changesets
336 --hidden consider hidden changesets
337
337
338 (use "hg help" for the full list of commands)
338 (use "hg help" for the full list of commands)
339
339
340 $ hg add -h
340 $ hg add -h
341 hg add [OPTION]... [FILE]...
341 hg add [OPTION]... [FILE]...
342
342
343 add the specified files on the next commit
343 add the specified files on the next commit
344
344
345 Schedule files to be version controlled and added to the repository.
345 Schedule files to be version controlled and added to the repository.
346
346
347 The files will be added to the repository at the next commit. To undo an
347 The files will be added to the repository at the next commit. To undo an
348 add before that, see "hg forget".
348 add before that, see "hg forget".
349
349
350 If no names are given, add all files to the repository (except files
350 If no names are given, add all files to the repository (except files
351 matching ".hgignore").
351 matching ".hgignore").
352
352
353 Returns 0 if all files are successfully added.
353 Returns 0 if all files are successfully added.
354
354
355 options ([+] can be repeated):
355 options ([+] can be repeated):
356
356
357 -I --include PATTERN [+] include names matching the given patterns
357 -I --include PATTERN [+] include names matching the given patterns
358 -X --exclude PATTERN [+] exclude names matching the given patterns
358 -X --exclude PATTERN [+] exclude names matching the given patterns
359 -S --subrepos recurse into subrepositories
359 -S --subrepos recurse into subrepositories
360 -n --dry-run do not perform actions, just print output
360 -n --dry-run do not perform actions, just print output
361
361
362 (some details hidden, use --verbose to show complete help)
362 (some details hidden, use --verbose to show complete help)
363
363
364 Verbose help for add
364 Verbose help for add
365
365
366 $ hg add -hv
366 $ hg add -hv
367 hg add [OPTION]... [FILE]...
367 hg add [OPTION]... [FILE]...
368
368
369 add the specified files on the next commit
369 add the specified files on the next commit
370
370
371 Schedule files to be version controlled and added to the repository.
371 Schedule files to be version controlled and added to the repository.
372
372
373 The files will be added to the repository at the next commit. To undo an
373 The files will be added to the repository at the next commit. To undo an
374 add before that, see "hg forget".
374 add before that, see "hg forget".
375
375
376 If no names are given, add all files to the repository (except files
376 If no names are given, add all files to the repository (except files
377 matching ".hgignore").
377 matching ".hgignore").
378
378
379 Examples:
379 Examples:
380
380
381 - New (unknown) files are added automatically by "hg add":
381 - New (unknown) files are added automatically by "hg add":
382
382
383 $ ls
383 $ ls
384 foo.c
384 foo.c
385 $ hg status
385 $ hg status
386 ? foo.c
386 ? foo.c
387 $ hg add
387 $ hg add
388 adding foo.c
388 adding foo.c
389 $ hg status
389 $ hg status
390 A foo.c
390 A foo.c
391
391
392 - Specific files to be added can be specified:
392 - Specific files to be added can be specified:
393
393
394 $ ls
394 $ ls
395 bar.c foo.c
395 bar.c foo.c
396 $ hg status
396 $ hg status
397 ? bar.c
397 ? bar.c
398 ? foo.c
398 ? foo.c
399 $ hg add bar.c
399 $ hg add bar.c
400 $ hg status
400 $ hg status
401 A bar.c
401 A bar.c
402 ? foo.c
402 ? foo.c
403
403
404 Returns 0 if all files are successfully added.
404 Returns 0 if all files are successfully added.
405
405
406 options ([+] can be repeated):
406 options ([+] can be repeated):
407
407
408 -I --include PATTERN [+] include names matching the given patterns
408 -I --include PATTERN [+] include names matching the given patterns
409 -X --exclude PATTERN [+] exclude names matching the given patterns
409 -X --exclude PATTERN [+] exclude names matching the given patterns
410 -S --subrepos recurse into subrepositories
410 -S --subrepos recurse into subrepositories
411 -n --dry-run do not perform actions, just print output
411 -n --dry-run do not perform actions, just print output
412
412
413 global options ([+] can be repeated):
413 global options ([+] can be repeated):
414
414
415 -R --repository REPO repository root directory or name of overlay bundle
415 -R --repository REPO repository root directory or name of overlay bundle
416 file
416 file
417 --cwd DIR change working directory
417 --cwd DIR change working directory
418 -y --noninteractive do not prompt, automatically pick the first choice for
418 -y --noninteractive do not prompt, automatically pick the first choice for
419 all prompts
419 all prompts
420 -q --quiet suppress output
420 -q --quiet suppress output
421 -v --verbose enable additional output
421 -v --verbose enable additional output
422 --config CONFIG [+] set/override config option (use 'section.name=value')
422 --config CONFIG [+] set/override config option (use 'section.name=value')
423 --debug enable debugging output
423 --debug enable debugging output
424 --debugger start debugger
424 --debugger start debugger
425 --encoding ENCODE set the charset encoding (default: ascii)
425 --encoding ENCODE set the charset encoding (default: ascii)
426 --encodingmode MODE set the charset encoding mode (default: strict)
426 --encodingmode MODE set the charset encoding mode (default: strict)
427 --traceback always print a traceback on exception
427 --traceback always print a traceback on exception
428 --time time how long the command takes
428 --time time how long the command takes
429 --profile print command execution profile
429 --profile print command execution profile
430 --version output version information and exit
430 --version output version information and exit
431 -h --help display help and exit
431 -h --help display help and exit
432 --hidden consider hidden changesets
432 --hidden consider hidden changesets
433
433
434 Test help option with version option
434 Test help option with version option
435
435
436 $ hg add -h --version
436 $ hg add -h --version
437 Mercurial Distributed SCM (version *) (glob)
437 Mercurial Distributed SCM (version *) (glob)
438 (see https://mercurial-scm.org for more information)
438 (see https://mercurial-scm.org for more information)
439
439
440 Copyright (C) 2005-2015 Matt Mackall and others
440 Copyright (C) 2005-2015 Matt Mackall and others
441 This is free software; see the source for copying conditions. There is NO
441 This is free software; see the source for copying conditions. There is NO
442 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
442 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
443
443
444 $ hg add --skjdfks
444 $ hg add --skjdfks
445 hg add: option --skjdfks not recognized
445 hg add: option --skjdfks not recognized
446 hg add [OPTION]... [FILE]...
446 hg add [OPTION]... [FILE]...
447
447
448 add the specified files on the next commit
448 add the specified files on the next commit
449
449
450 options ([+] can be repeated):
450 options ([+] can be repeated):
451
451
452 -I --include PATTERN [+] include names matching the given patterns
452 -I --include PATTERN [+] include names matching the given patterns
453 -X --exclude PATTERN [+] exclude names matching the given patterns
453 -X --exclude PATTERN [+] exclude names matching the given patterns
454 -S --subrepos recurse into subrepositories
454 -S --subrepos recurse into subrepositories
455 -n --dry-run do not perform actions, just print output
455 -n --dry-run do not perform actions, just print output
456
456
457 (use "hg add -h" to show more help)
457 (use "hg add -h" to show more help)
458 [255]
458 [255]
459
459
460 Test ambiguous command help
460 Test ambiguous command help
461
461
462 $ hg help ad
462 $ hg help ad
463 list of commands:
463 list of commands:
464
464
465 add add the specified files on the next commit
465 add add the specified files on the next commit
466 addremove add all new files, delete all missing files
466 addremove add all new files, delete all missing files
467
467
468 (use "hg help -v ad" to show built-in aliases and global options)
468 (use "hg help -v ad" to show built-in aliases and global options)
469
469
470 Test command without options
470 Test command without options
471
471
472 $ hg help verify
472 $ hg help verify
473 hg verify
473 hg verify
474
474
475 verify the integrity of the repository
475 verify the integrity of the repository
476
476
477 Verify the integrity of the current repository.
477 Verify the integrity of the current repository.
478
478
479 This will perform an extensive check of the repository's integrity,
479 This will perform an extensive check of the repository's integrity,
480 validating the hashes and checksums of each entry in the changelog,
480 validating the hashes and checksums of each entry in the changelog,
481 manifest, and tracked files, as well as the integrity of their crosslinks
481 manifest, and tracked files, as well as the integrity of their crosslinks
482 and indices.
482 and indices.
483
483
484 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
484 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
485 information about recovery from corruption of the repository.
485 information about recovery from corruption of the repository.
486
486
487 Returns 0 on success, 1 if errors are encountered.
487 Returns 0 on success, 1 if errors are encountered.
488
488
489 (some details hidden, use --verbose to show complete help)
489 (some details hidden, use --verbose to show complete help)
490
490
491 $ hg help diff
491 $ hg help diff
492 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
492 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
493
493
494 diff repository (or selected files)
494 diff repository (or selected files)
495
495
496 Show differences between revisions for the specified files.
496 Show differences between revisions for the specified files.
497
497
498 Differences between files are shown using the unified diff format.
498 Differences between files are shown using the unified diff format.
499
499
500 Note:
500 Note:
501 "hg diff" may generate unexpected results for merges, as it will
501 "hg diff" may generate unexpected results for merges, as it will
502 default to comparing against the working directory's first parent
502 default to comparing against the working directory's first parent
503 changeset if no revisions are specified.
503 changeset if no revisions are specified.
504
504
505 When two revision arguments are given, then changes are shown between
505 When two revision arguments are given, then changes are shown between
506 those revisions. If only one revision is specified then that revision is
506 those revisions. If only one revision is specified then that revision is
507 compared to the working directory, and, when no revisions are specified,
507 compared to the working directory, and, when no revisions are specified,
508 the working directory files are compared to its first parent.
508 the working directory files are compared to its first parent.
509
509
510 Alternatively you can specify -c/--change with a revision to see the
510 Alternatively you can specify -c/--change with a revision to see the
511 changes in that changeset relative to its first parent.
511 changes in that changeset relative to its first parent.
512
512
513 Without the -a/--text option, diff will avoid generating diffs of files it
513 Without the -a/--text option, diff will avoid generating diffs of files it
514 detects as binary. With -a, diff will generate a diff anyway, probably
514 detects as binary. With -a, diff will generate a diff anyway, probably
515 with undesirable results.
515 with undesirable results.
516
516
517 Use the -g/--git option to generate diffs in the git extended diff format.
517 Use the -g/--git option to generate diffs in the git extended diff format.
518 For more information, read "hg help diffs".
518 For more information, read "hg help diffs".
519
519
520 Returns 0 on success.
520 Returns 0 on success.
521
521
522 options ([+] can be repeated):
522 options ([+] can be repeated):
523
523
524 -r --rev REV [+] revision
524 -r --rev REV [+] revision
525 -c --change REV change made by revision
525 -c --change REV change made by revision
526 -a --text treat all files as text
526 -a --text treat all files as text
527 -g --git use git extended diff format
527 -g --git use git extended diff format
528 --nodates omit dates from diff headers
528 --nodates omit dates from diff headers
529 --noprefix omit a/ and b/ prefixes from filenames
529 --noprefix omit a/ and b/ prefixes from filenames
530 -p --show-function show which function each change is in
530 -p --show-function show which function each change is in
531 --reverse produce a diff that undoes the changes
531 --reverse produce a diff that undoes the changes
532 -w --ignore-all-space ignore white space when comparing lines
532 -w --ignore-all-space ignore white space when comparing lines
533 -b --ignore-space-change ignore changes in the amount of white space
533 -b --ignore-space-change ignore changes in the amount of white space
534 -B --ignore-blank-lines ignore changes whose lines are all blank
534 -B --ignore-blank-lines ignore changes whose lines are all blank
535 -U --unified NUM number of lines of context to show
535 -U --unified NUM number of lines of context to show
536 --stat output diffstat-style summary of changes
536 --stat output diffstat-style summary of changes
537 --root DIR produce diffs relative to subdirectory
537 --root DIR produce diffs relative to subdirectory
538 -I --include PATTERN [+] include names matching the given patterns
538 -I --include PATTERN [+] include names matching the given patterns
539 -X --exclude PATTERN [+] exclude names matching the given patterns
539 -X --exclude PATTERN [+] exclude names matching the given patterns
540 -S --subrepos recurse into subrepositories
540 -S --subrepos recurse into subrepositories
541
541
542 (some details hidden, use --verbose to show complete help)
542 (some details hidden, use --verbose to show complete help)
543
543
544 $ hg help status
544 $ hg help status
545 hg status [OPTION]... [FILE]...
545 hg status [OPTION]... [FILE]...
546
546
547 aliases: st
547 aliases: st
548
548
549 show changed files in the working directory
549 show changed files in the working directory
550
550
551 Show status of files in the repository. If names are given, only files
551 Show status of files in the repository. If names are given, only files
552 that match are shown. Files that are clean or ignored or the source of a
552 that match are shown. Files that are clean or ignored or the source of a
553 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
553 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
554 -C/--copies or -A/--all are given. Unless options described with "show
554 -C/--copies or -A/--all are given. Unless options described with "show
555 only ..." are given, the options -mardu are used.
555 only ..." are given, the options -mardu are used.
556
556
557 Option -q/--quiet hides untracked (unknown and ignored) files unless
557 Option -q/--quiet hides untracked (unknown and ignored) files unless
558 explicitly requested with -u/--unknown or -i/--ignored.
558 explicitly requested with -u/--unknown or -i/--ignored.
559
559
560 Note:
560 Note:
561 "hg status" may appear to disagree with diff if permissions have
561 "hg status" may appear to disagree with diff if permissions have
562 changed or a merge has occurred. The standard diff format does not
562 changed or a merge has occurred. The standard diff format does not
563 report permission changes and diff only reports changes relative to one
563 report permission changes and diff only reports changes relative to one
564 merge parent.
564 merge parent.
565
565
566 If one revision is given, it is used as the base revision. If two
566 If one revision is given, it is used as the base revision. If two
567 revisions are given, the differences between them are shown. The --change
567 revisions are given, the differences between them are shown. The --change
568 option can also be used as a shortcut to list the changed files of a
568 option can also be used as a shortcut to list the changed files of a
569 revision from its first parent.
569 revision from its first parent.
570
570
571 The codes used to show the status of files are:
571 The codes used to show the status of files are:
572
572
573 M = modified
573 M = modified
574 A = added
574 A = added
575 R = removed
575 R = removed
576 C = clean
576 C = clean
577 ! = missing (deleted by non-hg command, but still tracked)
577 ! = missing (deleted by non-hg command, but still tracked)
578 ? = not tracked
578 ? = not tracked
579 I = ignored
579 I = ignored
580 = origin of the previous file (with --copies)
580 = origin of the previous file (with --copies)
581
581
582 Returns 0 on success.
582 Returns 0 on success.
583
583
584 options ([+] can be repeated):
584 options ([+] can be repeated):
585
585
586 -A --all show status of all files
586 -A --all show status of all files
587 -m --modified show only modified files
587 -m --modified show only modified files
588 -a --added show only added files
588 -a --added show only added files
589 -r --removed show only removed files
589 -r --removed show only removed files
590 -d --deleted show only deleted (but tracked) files
590 -d --deleted show only deleted (but tracked) files
591 -c --clean show only files without changes
591 -c --clean show only files without changes
592 -u --unknown show only unknown (not tracked) files
592 -u --unknown show only unknown (not tracked) files
593 -i --ignored show only ignored files
593 -i --ignored show only ignored files
594 -n --no-status hide status prefix
594 -n --no-status hide status prefix
595 -C --copies show source of copied files
595 -C --copies show source of copied files
596 -0 --print0 end filenames with NUL, for use with xargs
596 -0 --print0 end filenames with NUL, for use with xargs
597 --rev REV [+] show difference from revision
597 --rev REV [+] show difference from revision
598 --change REV list the changed files of a revision
598 --change REV list the changed files of a revision
599 -I --include PATTERN [+] include names matching the given patterns
599 -I --include PATTERN [+] include names matching the given patterns
600 -X --exclude PATTERN [+] exclude names matching the given patterns
600 -X --exclude PATTERN [+] exclude names matching the given patterns
601 -S --subrepos recurse into subrepositories
601 -S --subrepos recurse into subrepositories
602
602
603 (some details hidden, use --verbose to show complete help)
603 (some details hidden, use --verbose to show complete help)
604
604
605 $ hg -q help status
605 $ hg -q help status
606 hg status [OPTION]... [FILE]...
606 hg status [OPTION]... [FILE]...
607
607
608 show changed files in the working directory
608 show changed files in the working directory
609
609
610 $ hg help foo
610 $ hg help foo
611 abort: no such help topic: foo
611 abort: no such help topic: foo
612 (try "hg help --keyword foo")
612 (try "hg help --keyword foo")
613 [255]
613 [255]
614
614
615 $ hg skjdfks
615 $ hg skjdfks
616 hg: unknown command 'skjdfks'
616 hg: unknown command 'skjdfks'
617 Mercurial Distributed SCM
617 Mercurial Distributed SCM
618
618
619 basic commands:
619 basic commands:
620
620
621 add add the specified files on the next commit
621 add add the specified files on the next commit
622 annotate show changeset information by line for each file
622 annotate show changeset information by line for each file
623 clone make a copy of an existing repository
623 clone make a copy of an existing repository
624 commit commit the specified files or all outstanding changes
624 commit commit the specified files or all outstanding changes
625 diff diff repository (or selected files)
625 diff diff repository (or selected files)
626 export dump the header and diffs for one or more changesets
626 export dump the header and diffs for one or more changesets
627 forget forget the specified files on the next commit
627 forget forget the specified files on the next commit
628 init create a new repository in the given directory
628 init create a new repository in the given directory
629 log show revision history of entire repository or files
629 log show revision history of entire repository or files
630 merge merge another revision into working directory
630 merge merge another revision into working directory
631 pull pull changes from the specified source
631 pull pull changes from the specified source
632 push push changes to the specified destination
632 push push changes to the specified destination
633 remove remove the specified files on the next commit
633 remove remove the specified files on the next commit
634 serve start stand-alone webserver
634 serve start stand-alone webserver
635 status show changed files in the working directory
635 status show changed files in the working directory
636 summary summarize working directory state
636 summary summarize working directory state
637 update update working directory (or switch revisions)
637 update update working directory (or switch revisions)
638
638
639 (use "hg help" for the full list of commands or "hg -v" for details)
639 (use "hg help" for the full list of commands or "hg -v" for details)
640 [255]
640 [255]
641
641
642
642
643 Make sure that we don't run afoul of the help system thinking that
643 Make sure that we don't run afoul of the help system thinking that
644 this is a section and erroring out weirdly.
644 this is a section and erroring out weirdly.
645
645
646 $ hg .log
646 $ hg .log
647 hg: unknown command '.log'
647 hg: unknown command '.log'
648 (did you mean one of log?)
648 (did you mean one of log?)
649 [255]
649 [255]
650
650
651 $ hg log.
651 $ hg log.
652 hg: unknown command 'log.'
652 hg: unknown command 'log.'
653 (did you mean one of log?)
653 (did you mean one of log?)
654 [255]
654 [255]
655 $ hg pu.lh
655 $ hg pu.lh
656 hg: unknown command 'pu.lh'
656 hg: unknown command 'pu.lh'
657 (did you mean one of pull, push?)
657 (did you mean one of pull, push?)
658 [255]
658 [255]
659
659
660 $ cat > helpext.py <<EOF
660 $ cat > helpext.py <<EOF
661 > import os
661 > import os
662 > from mercurial import cmdutil, commands
662 > from mercurial import cmdutil, commands
663 >
663 >
664 > cmdtable = {}
664 > cmdtable = {}
665 > command = cmdutil.command(cmdtable)
665 > command = cmdutil.command(cmdtable)
666 >
666 >
667 > @command('nohelp',
667 > @command('nohelp',
668 > [('', 'longdesc', 3, 'x'*90),
668 > [('', 'longdesc', 3, 'x'*90),
669 > ('n', '', None, 'normal desc'),
669 > ('n', '', None, 'normal desc'),
670 > ('', 'newline', '', 'line1\nline2')],
670 > ('', 'newline', '', 'line1\nline2')],
671 > 'hg nohelp',
671 > 'hg nohelp',
672 > norepo=True)
672 > norepo=True)
673 > @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')])
673 > @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')])
674 > @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')])
674 > @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')])
675 > def nohelp(ui, *args, **kwargs):
675 > def nohelp(ui, *args, **kwargs):
676 > pass
676 > pass
677 >
677 >
678 > EOF
678 > EOF
679 $ echo '[extensions]' >> $HGRCPATH
679 $ echo '[extensions]' >> $HGRCPATH
680 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
680 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
681
681
682 Test command with no help text
682 Test command with no help text
683
683
684 $ hg help nohelp
684 $ hg help nohelp
685 hg nohelp
685 hg nohelp
686
686
687 (no help text available)
687 (no help text available)
688
688
689 options:
689 options:
690
690
691 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
691 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
692 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
692 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
693 -n -- normal desc
693 -n -- normal desc
694 --newline VALUE line1 line2
694 --newline VALUE line1 line2
695
695
696 (some details hidden, use --verbose to show complete help)
696 (some details hidden, use --verbose to show complete help)
697
697
698 $ hg help -k nohelp
698 $ hg help -k nohelp
699 Commands:
699 Commands:
700
700
701 nohelp hg nohelp
701 nohelp hg nohelp
702
702
703 Extension Commands:
703 Extension Commands:
704
704
705 nohelp (no help text available)
705 nohelp (no help text available)
706
706
707 Test that default list of commands omits extension commands
707 Test that default list of commands omits extension commands
708
708
709 $ hg help
709 $ hg help
710 Mercurial Distributed SCM
710 Mercurial Distributed SCM
711
711
712 list of commands:
712 list of commands:
713
713
714 add add the specified files on the next commit
714 add add the specified files on the next commit
715 addremove add all new files, delete all missing files
715 addremove add all new files, delete all missing files
716 annotate show changeset information by line for each file
716 annotate show changeset information by line for each file
717 archive create an unversioned archive of a repository revision
717 archive create an unversioned archive of a repository revision
718 backout reverse effect of earlier changeset
718 backout reverse effect of earlier changeset
719 bisect subdivision search of changesets
719 bisect subdivision search of changesets
720 bookmarks create a new bookmark or list existing bookmarks
720 bookmarks create a new bookmark or list existing bookmarks
721 branch set or show the current branch name
721 branch set or show the current branch name
722 branches list repository named branches
722 branches list repository named branches
723 bundle create a changegroup file
723 bundle create a changegroup file
724 cat output the current or given revision of files
724 cat output the current or given revision of files
725 clone make a copy of an existing repository
725 clone make a copy of an existing repository
726 commit commit the specified files or all outstanding changes
726 commit commit the specified files or all outstanding changes
727 config show combined config settings from all hgrc files
727 config show combined config settings from all hgrc files
728 copy mark files as copied for the next commit
728 copy mark files as copied for the next commit
729 diff diff repository (or selected files)
729 diff diff repository (or selected files)
730 export dump the header and diffs for one or more changesets
730 export dump the header and diffs for one or more changesets
731 files list tracked files
731 files list tracked files
732 forget forget the specified files on the next commit
732 forget forget the specified files on the next commit
733 graft copy changes from other branches onto the current branch
733 graft copy changes from other branches onto the current branch
734 grep search for a pattern in specified files and revisions
734 grep search for a pattern in specified files and revisions
735 heads show branch heads
735 heads show branch heads
736 help show help for a given topic or a help overview
736 help show help for a given topic or a help overview
737 identify identify the working directory or specified revision
737 identify identify the working directory or specified revision
738 import import an ordered set of patches
738 import import an ordered set of patches
739 incoming show new changesets found in source
739 incoming show new changesets found in source
740 init create a new repository in the given directory
740 init create a new repository in the given directory
741 log show revision history of entire repository or files
741 log show revision history of entire repository or files
742 manifest output the current or given revision of the project manifest
742 manifest output the current or given revision of the project manifest
743 merge merge another revision into working directory
743 merge merge another revision into working directory
744 outgoing show changesets not found in the destination
744 outgoing show changesets not found in the destination
745 paths show aliases for remote repositories
745 paths show aliases for remote repositories
746 phase set or show the current phase name
746 phase set or show the current phase name
747 pull pull changes from the specified source
747 pull pull changes from the specified source
748 push push changes to the specified destination
748 push push changes to the specified destination
749 recover roll back an interrupted transaction
749 recover roll back an interrupted transaction
750 remove remove the specified files on the next commit
750 remove remove the specified files on the next commit
751 rename rename files; equivalent of copy + remove
751 rename rename files; equivalent of copy + remove
752 resolve redo merges or set/view the merge status of files
752 resolve redo merges or set/view the merge status of files
753 revert restore files to their checkout state
753 revert restore files to their checkout state
754 root print the root (top) of the current working directory
754 root print the root (top) of the current working directory
755 serve start stand-alone webserver
755 serve start stand-alone webserver
756 status show changed files in the working directory
756 status show changed files in the working directory
757 summary summarize working directory state
757 summary summarize working directory state
758 tag add one or more tags for the current or given revision
758 tag add one or more tags for the current or given revision
759 tags list repository tags
759 tags list repository tags
760 unbundle apply one or more changegroup files
760 unbundle apply one or more changegroup files
761 update update working directory (or switch revisions)
761 update update working directory (or switch revisions)
762 verify verify the integrity of the repository
762 verify verify the integrity of the repository
763 version output version and copyright information
763 version output version and copyright information
764
764
765 enabled extensions:
765 enabled extensions:
766
766
767 helpext (no help text available)
767 helpext (no help text available)
768
768
769 additional help topics:
769 additional help topics:
770
770
771 config Configuration Files
771 config Configuration Files
772 dates Date Formats
772 dates Date Formats
773 diffs Diff Formats
773 diffs Diff Formats
774 environment Environment Variables
774 environment Environment Variables
775 extensions Using Additional Features
775 extensions Using Additional Features
776 filesets Specifying File Sets
776 filesets Specifying File Sets
777 glossary Glossary
777 glossary Glossary
778 hgignore Syntax for Mercurial Ignore Files
778 hgignore Syntax for Mercurial Ignore Files
779 hgweb Configuring hgweb
779 hgweb Configuring hgweb
780 internals Technical implementation topics
780 internals Technical implementation topics
781 merge-tools Merge Tools
781 merge-tools Merge Tools
782 multirevs Specifying Multiple Revisions
782 multirevs Specifying Multiple Revisions
783 patterns File Name Patterns
783 patterns File Name Patterns
784 phases Working with Phases
784 phases Working with Phases
785 revisions Specifying Single Revisions
785 revisions Specifying Single Revisions
786 revsets Specifying Revision Sets
786 revsets Specifying Revision Sets
787 scripting Using Mercurial from scripts and automation
787 scripting Using Mercurial from scripts and automation
788 subrepos Subrepositories
788 subrepos Subrepositories
789 templating Template Usage
789 templating Template Usage
790 urls URL Paths
790 urls URL Paths
791
791
792 (use "hg help -v" to show built-in aliases and global options)
792 (use "hg help -v" to show built-in aliases and global options)
793
793
794
794
795 Test list of internal help commands
795 Test list of internal help commands
796
796
797 $ hg help debug
797 $ hg help debug
798 debug commands (internal and unsupported):
798 debug commands (internal and unsupported):
799
799
800 debugancestor
800 debugancestor
801 find the ancestor revision of two revisions in a given index
801 find the ancestor revision of two revisions in a given index
802 debugapplystreamclonebundle
802 debugapplystreamclonebundle
803 apply a stream clone bundle file
803 apply a stream clone bundle file
804 debugbuilddag
804 debugbuilddag
805 builds a repo with a given DAG from scratch in the current
805 builds a repo with a given DAG from scratch in the current
806 empty repo
806 empty repo
807 debugbundle lists the contents of a bundle
807 debugbundle lists the contents of a bundle
808 debugcheckstate
808 debugcheckstate
809 validate the correctness of the current dirstate
809 validate the correctness of the current dirstate
810 debugcommands
810 debugcommands
811 list all available commands and options
811 list all available commands and options
812 debugcomplete
812 debugcomplete
813 returns the completion list associated with the given command
813 returns the completion list associated with the given command
814 debugcreatestreamclonebundle
814 debugcreatestreamclonebundle
815 create a stream clone bundle file
815 create a stream clone bundle file
816 debugdag format the changelog or an index DAG as a concise textual
816 debugdag format the changelog or an index DAG as a concise textual
817 description
817 description
818 debugdata dump the contents of a data file revision
818 debugdata dump the contents of a data file revision
819 debugdate parse and display a date
819 debugdate parse and display a date
820 debugdeltachain
820 debugdeltachain
821 dump information about delta chains in a revlog
821 dump information about delta chains in a revlog
822 debugdirstate
822 debugdirstate
823 show the contents of the current dirstate
823 show the contents of the current dirstate
824 debugdiscovery
824 debugdiscovery
825 runs the changeset discovery protocol in isolation
825 runs the changeset discovery protocol in isolation
826 debugextensions
826 debugextensions
827 show information about active extensions
827 show information about active extensions
828 debugfileset parse and apply a fileset specification
828 debugfileset parse and apply a fileset specification
829 debugfsinfo show information detected about current filesystem
829 debugfsinfo show information detected about current filesystem
830 debuggetbundle
830 debuggetbundle
831 retrieves a bundle from a repo
831 retrieves a bundle from a repo
832 debugignore display the combined ignore pattern
832 debugignore display the combined ignore pattern
833 debugindex dump the contents of an index file
833 debugindex dump the contents of an index file
834 debugindexdot
834 debugindexdot
835 dump an index DAG as a graphviz dot file
835 dump an index DAG as a graphviz dot file
836 debuginstall test Mercurial installation
836 debuginstall test Mercurial installation
837 debugknown test whether node ids are known to a repo
837 debugknown test whether node ids are known to a repo
838 debuglocks show or modify state of locks
838 debuglocks show or modify state of locks
839 debugmergestate
839 debugmergestate
840 print merge state
840 print merge state
841 debugnamecomplete
841 debugnamecomplete
842 complete "names" - tags, open branch names, bookmark names
842 complete "names" - tags, open branch names, bookmark names
843 debugobsolete
843 debugobsolete
844 create arbitrary obsolete marker
844 create arbitrary obsolete marker
845 debugoptDEP (no help text available)
845 debugoptDEP (no help text available)
846 debugoptEXP (no help text available)
846 debugoptEXP (no help text available)
847 debugpathcomplete
847 debugpathcomplete
848 complete part or all of a tracked path
848 complete part or all of a tracked path
849 debugpushkey access the pushkey key/value protocol
849 debugpushkey access the pushkey key/value protocol
850 debugpvec (no help text available)
850 debugpvec (no help text available)
851 debugrebuilddirstate
851 debugrebuilddirstate
852 rebuild the dirstate as it would look like for the given
852 rebuild the dirstate as it would look like for the given
853 revision
853 revision
854 debugrebuildfncache
854 debugrebuildfncache
855 rebuild the fncache file
855 rebuild the fncache file
856 debugrename dump rename information
856 debugrename dump rename information
857 debugrevlog show data and statistics about a revlog
857 debugrevlog show data and statistics about a revlog
858 debugrevspec parse and apply a revision specification
858 debugrevspec parse and apply a revision specification
859 debugsetparents
859 debugsetparents
860 manually set the parents of the current working directory
860 manually set the parents of the current working directory
861 debugsub (no help text available)
861 debugsub (no help text available)
862 debugsuccessorssets
862 debugsuccessorssets
863 show set of successors for revision
863 show set of successors for revision
864 debugwalk show how files match on given patterns
864 debugwalk show how files match on given patterns
865 debugwireargs
865 debugwireargs
866 (no help text available)
866 (no help text available)
867
867
868 (use "hg help -v debug" to show built-in aliases and global options)
868 (use "hg help -v debug" to show built-in aliases and global options)
869
869
870 internals topic renders index of available sub-topics
870 internals topic renders index of available sub-topics
871
871
872 $ hg help internals
872 $ hg help internals
873 Technical implementation topics
873 Technical implementation topics
874 """""""""""""""""""""""""""""""
874 """""""""""""""""""""""""""""""
875
875
876 bundles container for exchange of repository data
876 bundles container for exchange of repository data
877 changegroups representation of revlog data
877 changegroups representation of revlog data
878
878
879 sub-topics can be accessed
879 sub-topics can be accessed
880
880
881 $ hg help internals.changegroups
881 $ hg help internals.changegroups
882 Changegroups
882 Changegroups
883 ============
883 ============
884
884
885 Changegroups are representations of repository revlog data, specifically
885 Changegroups are representations of repository revlog data, specifically
886 the changelog, manifest, and filelogs.
886 the changelog, manifest, and filelogs.
887
887
888 There are 3 versions of changegroups: "1", "2", and "3". From a high-
888 There are 3 versions of changegroups: "1", "2", and "3". From a high-
889 level, versions "1" and "2" are almost exactly the same, with the only
889 level, versions "1" and "2" are almost exactly the same, with the only
890 difference being a header on entries in the changeset segment. Version "3"
890 difference being a header on entries in the changeset segment. Version "3"
891 adds support for exchanging treemanifests and includes revlog flags in the
891 adds support for exchanging treemanifests and includes revlog flags in the
892 delta header.
892 delta header.
893
893
894 Changegroups consists of 3 logical segments:
894 Changegroups consists of 3 logical segments:
895
895
896 +---------------------------------+
896 +---------------------------------+
897 | | | |
897 | | | |
898 | changeset | manifest | filelogs |
898 | changeset | manifest | filelogs |
899 | | | |
899 | | | |
900 +---------------------------------+
900 +---------------------------------+
901
901
902 The principle building block of each segment is a *chunk*. A *chunk* is a
902 The principle building block of each segment is a *chunk*. A *chunk* is a
903 framed piece of data:
903 framed piece of data:
904
904
905 +---------------------------------------+
905 +---------------------------------------+
906 | | |
906 | | |
907 | length | data |
907 | length | data |
908 | (32 bits) | <length> bytes |
908 | (32 bits) | <length> bytes |
909 | | |
909 | | |
910 +---------------------------------------+
910 +---------------------------------------+
911
911
912 Each chunk starts with a 32-bit big-endian signed integer indicating the
912 Each chunk starts with a 32-bit big-endian signed integer indicating the
913 length of the raw data that follows.
913 length of the raw data that follows.
914
914
915 There is a special case chunk that has 0 length ("0x00000000"). We call
915 There is a special case chunk that has 0 length ("0x00000000"). We call
916 this an *empty chunk*.
916 this an *empty chunk*.
917
917
918 Delta Groups
918 Delta Groups
919 ------------
919 ------------
920
920
921 A *delta group* expresses the content of a revlog as a series of deltas,
921 A *delta group* expresses the content of a revlog as a series of deltas,
922 or patches against previous revisions.
922 or patches against previous revisions.
923
923
924 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
924 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
925 to signal the end of the delta group:
925 to signal the end of the delta group:
926
926
927 +------------------------------------------------------------------------+
927 +------------------------------------------------------------------------+
928 | | | | | |
928 | | | | | |
929 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
929 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
930 | (32 bits) | (various) | (32 bits) | (various) | (32 bits) |
930 | (32 bits) | (various) | (32 bits) | (various) | (32 bits) |
931 | | | | | |
931 | | | | | |
932 +------------------------------------------------------------+-----------+
932 +------------------------------------------------------------+-----------+
933
933
934 Each *chunk*'s data consists of the following:
934 Each *chunk*'s data consists of the following:
935
935
936 +-----------------------------------------+
936 +-----------------------------------------+
937 | | | |
937 | | | |
938 | delta header | mdiff header | delta |
938 | delta header | mdiff header | delta |
939 | (various) | (12 bytes) | (various) |
939 | (various) | (12 bytes) | (various) |
940 | | | |
940 | | | |
941 +-----------------------------------------+
941 +-----------------------------------------+
942
942
943 The *length* field is the byte length of the remaining 3 logical pieces of
943 The *length* field is the byte length of the remaining 3 logical pieces of
944 data. The *delta* is a diff from an existing entry in the changelog.
944 data. The *delta* is a diff from an existing entry in the changelog.
945
945
946 The *delta header* is different between versions "1", "2", and "3" of the
946 The *delta header* is different between versions "1", "2", and "3" of the
947 changegroup format.
947 changegroup format.
948
948
949 Version 1:
949 Version 1:
950
950
951 +------------------------------------------------------+
951 +------------------------------------------------------+
952 | | | | |
952 | | | | |
953 | node | p1 node | p2 node | link node |
953 | node | p1 node | p2 node | link node |
954 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
954 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
955 | | | | |
955 | | | | |
956 +------------------------------------------------------+
956 +------------------------------------------------------+
957
957
958 Version 2:
958 Version 2:
959
959
960 +------------------------------------------------------------------+
960 +------------------------------------------------------------------+
961 | | | | | |
961 | | | | | |
962 | node | p1 node | p2 node | base node | link node |
962 | node | p1 node | p2 node | base node | link node |
963 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
963 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
964 | | | | | |
964 | | | | | |
965 +------------------------------------------------------------------+
965 +------------------------------------------------------------------+
966
966
967 Version 3:
967 Version 3:
968
968
969 +------------------------------------------------------------------------------+
969 +------------------------------------------------------------------------------+
970 | | | | | | |
970 | | | | | | |
971 | node | p1 node | p2 node | base node | link node | flags |
971 | node | p1 node | p2 node | base node | link node | flags |
972 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
972 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
973 | | | | | | |
973 | | | | | | |
974 +------------------------------------------------------------------------------+
974 +------------------------------------------------------------------------------+
975
975
976 The *mdiff header* consists of 3 32-bit big-endian signed integers
976 The *mdiff header* consists of 3 32-bit big-endian signed integers
977 describing offsets at which to apply the following delta content:
977 describing offsets at which to apply the following delta content:
978
978
979 +-------------------------------------+
979 +-------------------------------------+
980 | | | |
980 | | | |
981 | offset | old length | new length |
981 | offset | old length | new length |
982 | (32 bits) | (32 bits) | (32 bits) |
982 | (32 bits) | (32 bits) | (32 bits) |
983 | | | |
983 | | | |
984 +-------------------------------------+
984 +-------------------------------------+
985
985
986 In version 1, the delta is always applied against the previous node from
986 In version 1, the delta is always applied against the previous node from
987 the changegroup or the first parent if this is the first entry in the
987 the changegroup or the first parent if this is the first entry in the
988 changegroup.
988 changegroup.
989
989
990 In version 2, the delta base node is encoded in the entry in the
990 In version 2, the delta base node is encoded in the entry in the
991 changegroup. This allows the delta to be expressed against any parent,
991 changegroup. This allows the delta to be expressed against any parent,
992 which can result in smaller deltas and more efficient encoding of data.
992 which can result in smaller deltas and more efficient encoding of data.
993
993
994 Changeset Segment
994 Changeset Segment
995 -----------------
995 -----------------
996
996
997 The *changeset segment* consists of a single *delta group* holding
997 The *changeset segment* consists of a single *delta group* holding
998 changelog data. It is followed by an *empty chunk* to denote the boundary
998 changelog data. It is followed by an *empty chunk* to denote the boundary
999 to the *manifests segment*.
999 to the *manifests segment*.
1000
1000
1001 Manifest Segment
1001 Manifest Segment
1002 ----------------
1002 ----------------
1003
1003
1004 The *manifest segment* consists of a single *delta group* holding manifest
1004 The *manifest segment* consists of a single *delta group* holding manifest
1005 data. It is followed by an *empty chunk* to denote the boundary to the
1005 data. It is followed by an *empty chunk* to denote the boundary to the
1006 *filelogs segment*.
1006 *filelogs segment*.
1007
1007
1008 Filelogs Segment
1008 Filelogs Segment
1009 ----------------
1009 ----------------
1010
1010
1011 The *filelogs* segment consists of multiple sub-segments, each
1011 The *filelogs* segment consists of multiple sub-segments, each
1012 corresponding to an individual file whose data is being described:
1012 corresponding to an individual file whose data is being described:
1013
1013
1014 +--------------------------------------+
1014 +--------------------------------------+
1015 | | | | |
1015 | | | | |
1016 | filelog0 | filelog1 | filelog2 | ... |
1016 | filelog0 | filelog1 | filelog2 | ... |
1017 | | | | |
1017 | | | | |
1018 +--------------------------------------+
1018 +--------------------------------------+
1019
1019
1020 In version "3" of the changegroup format, filelogs may include directory
1020 In version "3" of the changegroup format, filelogs may include directory
1021 logs when treemanifests are in use. directory logs are identified by
1021 logs when treemanifests are in use. directory logs are identified by
1022 having a trailing '/' on their filename (see below).
1022 having a trailing '/' on their filename (see below).
1023
1023
1024 The final filelog sub-segment is followed by an *empty chunk* to denote
1024 The final filelog sub-segment is followed by an *empty chunk* to denote
1025 the end of the segment and the overall changegroup.
1025 the end of the segment and the overall changegroup.
1026
1026
1027 Each filelog sub-segment consists of the following:
1027 Each filelog sub-segment consists of the following:
1028
1028
1029 +------------------------------------------+
1029 +------------------------------------------+
1030 | | | |
1030 | | | |
1031 | filename size | filename | delta group |
1031 | filename size | filename | delta group |
1032 | (32 bits) | (various) | (various) |
1032 | (32 bits) | (various) | (various) |
1033 | | | |
1033 | | | |
1034 +------------------------------------------+
1034 +------------------------------------------+
1035
1035
1036 That is, a *chunk* consisting of the filename (not terminated or padded)
1036 That is, a *chunk* consisting of the filename (not terminated or padded)
1037 followed by N chunks constituting the *delta group* for this file.
1037 followed by N chunks constituting the *delta group* for this file.
1038
1038
1039 Test list of commands with command with no help text
1039 Test list of commands with command with no help text
1040
1040
1041 $ hg help helpext
1041 $ hg help helpext
1042 helpext extension - no help text available
1042 helpext extension - no help text available
1043
1043
1044 list of commands:
1044 list of commands:
1045
1045
1046 nohelp (no help text available)
1046 nohelp (no help text available)
1047
1047
1048 (use "hg help -v helpext" to show built-in aliases and global options)
1048 (use "hg help -v helpext" to show built-in aliases and global options)
1049
1049
1050
1050
1051 test deprecated and experimental options are hidden in command help
1051 test deprecated and experimental options are hidden in command help
1052 $ hg help debugoptDEP
1052 $ hg help debugoptDEP
1053 hg debugoptDEP
1053 hg debugoptDEP
1054
1054
1055 (no help text available)
1055 (no help text available)
1056
1056
1057 options:
1057 options:
1058
1058
1059 (some details hidden, use --verbose to show complete help)
1059 (some details hidden, use --verbose to show complete help)
1060
1060
1061 $ hg help debugoptEXP
1061 $ hg help debugoptEXP
1062 hg debugoptEXP
1062 hg debugoptEXP
1063
1063
1064 (no help text available)
1064 (no help text available)
1065
1065
1066 options:
1066 options:
1067
1067
1068 (some details hidden, use --verbose to show complete help)
1068 (some details hidden, use --verbose to show complete help)
1069
1069
1070 test deprecated and experimental options is shown with -v
1070 test deprecated and experimental options is shown with -v
1071 $ hg help -v debugoptDEP | grep dopt
1071 $ hg help -v debugoptDEP | grep dopt
1072 --dopt option is (DEPRECATED)
1072 --dopt option is (DEPRECATED)
1073 $ hg help -v debugoptEXP | grep eopt
1073 $ hg help -v debugoptEXP | grep eopt
1074 --eopt option is (EXPERIMENTAL)
1074 --eopt option is (EXPERIMENTAL)
1075
1075
1076 #if gettext
1076 #if gettext
1077 test deprecated option is hidden with translation with untranslated description
1077 test deprecated option is hidden with translation with untranslated description
1078 (use many globy for not failing on changed transaction)
1078 (use many globy for not failing on changed transaction)
1079 $ LANGUAGE=sv hg help debugoptDEP
1079 $ LANGUAGE=sv hg help debugoptDEP
1080 hg debugoptDEP
1080 hg debugoptDEP
1081
1081
1082 (*) (glob)
1082 (*) (glob)
1083
1083
1084 options:
1084 options:
1085
1085
1086 (some details hidden, use --verbose to show complete help)
1086 (some details hidden, use --verbose to show complete help)
1087 #endif
1087 #endif
1088
1088
1089 Test commands that collide with topics (issue4240)
1089 Test commands that collide with topics (issue4240)
1090
1090
1091 $ hg config -hq
1091 $ hg config -hq
1092 hg config [-u] [NAME]...
1092 hg config [-u] [NAME]...
1093
1093
1094 show combined config settings from all hgrc files
1094 show combined config settings from all hgrc files
1095 $ hg showconfig -hq
1095 $ hg showconfig -hq
1096 hg config [-u] [NAME]...
1096 hg config [-u] [NAME]...
1097
1097
1098 show combined config settings from all hgrc files
1098 show combined config settings from all hgrc files
1099
1099
1100 Test a help topic
1100 Test a help topic
1101
1101
1102 $ hg help revs
1102 $ hg help revs
1103 Specifying Single Revisions
1103 Specifying Single Revisions
1104 """""""""""""""""""""""""""
1104 """""""""""""""""""""""""""
1105
1105
1106 Mercurial supports several ways to specify individual revisions.
1106 Mercurial supports several ways to specify individual revisions.
1107
1107
1108 A plain integer is treated as a revision number. Negative integers are
1108 A plain integer is treated as a revision number. Negative integers are
1109 treated as sequential offsets from the tip, with -1 denoting the tip, -2
1109 treated as sequential offsets from the tip, with -1 denoting the tip, -2
1110 denoting the revision prior to the tip, and so forth.
1110 denoting the revision prior to the tip, and so forth.
1111
1111
1112 A 40-digit hexadecimal string is treated as a unique revision identifier.
1112 A 40-digit hexadecimal string is treated as a unique revision identifier.
1113
1113
1114 A hexadecimal string less than 40 characters long is treated as a unique
1114 A hexadecimal string less than 40 characters long is treated as a unique
1115 revision identifier and is referred to as a short-form identifier. A
1115 revision identifier and is referred to as a short-form identifier. A
1116 short-form identifier is only valid if it is the prefix of exactly one
1116 short-form identifier is only valid if it is the prefix of exactly one
1117 full-length identifier.
1117 full-length identifier.
1118
1118
1119 Any other string is treated as a bookmark, tag, or branch name. A bookmark
1119 Any other string is treated as a bookmark, tag, or branch name. A bookmark
1120 is a movable pointer to a revision. A tag is a permanent name associated
1120 is a movable pointer to a revision. A tag is a permanent name associated
1121 with a revision. A branch name denotes the tipmost open branch head of
1121 with a revision. A branch name denotes the tipmost open branch head of
1122 that branch - or if they are all closed, the tipmost closed head of the
1122 that branch - or if they are all closed, the tipmost closed head of the
1123 branch. Bookmark, tag, and branch names must not contain the ":"
1123 branch. Bookmark, tag, and branch names must not contain the ":"
1124 character.
1124 character.
1125
1125
1126 The reserved name "tip" always identifies the most recent revision.
1126 The reserved name "tip" always identifies the most recent revision.
1127
1127
1128 The reserved name "null" indicates the null revision. This is the revision
1128 The reserved name "null" indicates the null revision. This is the revision
1129 of an empty repository, and the parent of revision 0.
1129 of an empty repository, and the parent of revision 0.
1130
1130
1131 The reserved name "." indicates the working directory parent. If no
1131 The reserved name "." indicates the working directory parent. If no
1132 working directory is checked out, it is equivalent to null. If an
1132 working directory is checked out, it is equivalent to null. If an
1133 uncommitted merge is in progress, "." is the revision of the first parent.
1133 uncommitted merge is in progress, "." is the revision of the first parent.
1134
1134
1135 Test repeated config section name
1135 Test repeated config section name
1136
1136
1137 $ hg help config.host
1137 $ hg help config.host
1138 "http_proxy.host"
1138 "http_proxy.host"
1139 Host name and (optional) port of the proxy server, for example
1139 Host name and (optional) port of the proxy server, for example
1140 "myproxy:8000".
1140 "myproxy:8000".
1141
1141
1142 "smtp.host"
1142 "smtp.host"
1143 Host name of mail server, e.g. "mail.example.com".
1143 Host name of mail server, e.g. "mail.example.com".
1144
1144
1145 Unrelated trailing paragraphs shouldn't be included
1145 Unrelated trailing paragraphs shouldn't be included
1146
1146
1147 $ hg help config.extramsg | grep '^$'
1147 $ hg help config.extramsg | grep '^$'
1148
1148
1149
1149
1150 Test capitalized section name
1150 Test capitalized section name
1151
1151
1152 $ hg help scripting.HGPLAIN > /dev/null
1152 $ hg help scripting.HGPLAIN > /dev/null
1153
1153
1154 Help subsection:
1154 Help subsection:
1155
1155
1156 $ hg help config.charsets |grep "Email example:" > /dev/null
1156 $ hg help config.charsets |grep "Email example:" > /dev/null
1157 [1]
1157 [1]
1158
1158
1159 Show nested definitions
1159 Show nested definitions
1160 ("profiling.type"[break]"ls"[break]"stat"[break])
1160 ("profiling.type"[break]"ls"[break]"stat"[break])
1161
1161
1162 $ hg help config.type | egrep '^$'|wc -l
1162 $ hg help config.type | egrep '^$'|wc -l
1163 \s*3 (re)
1163 \s*3 (re)
1164
1164
1165 Last item in help config.*:
1165 Last item in help config.*:
1166
1166
1167 $ hg help config.`hg help config|grep '^ "'| \
1167 $ hg help config.`hg help config|grep '^ "'| \
1168 > tail -1|sed 's![ "]*!!g'`| \
1168 > tail -1|sed 's![ "]*!!g'`| \
1169 > grep "hg help -c config" > /dev/null
1169 > grep "hg help -c config" > /dev/null
1170 [1]
1170 [1]
1171
1171
1172 note to use help -c for general hg help config:
1172 note to use help -c for general hg help config:
1173
1173
1174 $ hg help config |grep "hg help -c config" > /dev/null
1174 $ hg help config |grep "hg help -c config" > /dev/null
1175
1175
1176 Test templating help
1176 Test templating help
1177
1177
1178 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1178 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1179 desc String. The text of the changeset description.
1179 desc String. The text of the changeset description.
1180 diffstat String. Statistics of changes with the following format:
1180 diffstat String. Statistics of changes with the following format:
1181 firstline Any text. Returns the first line of text.
1181 firstline Any text. Returns the first line of text.
1182 nonempty Any text. Returns '(none)' if the string is empty.
1182 nonempty Any text. Returns '(none)' if the string is empty.
1183
1183
1184 Test deprecated items
1184 Test deprecated items
1185
1185
1186 $ hg help -v templating | grep currentbookmark
1186 $ hg help -v templating | grep currentbookmark
1187 currentbookmark
1187 currentbookmark
1188 $ hg help templating | (grep currentbookmark || true)
1188 $ hg help templating | (grep currentbookmark || true)
1189
1189
1190 Test help hooks
1190 Test help hooks
1191
1191
1192 $ cat > helphook1.py <<EOF
1192 $ cat > helphook1.py <<EOF
1193 > from mercurial import help
1193 > from mercurial import help
1194 >
1194 >
1195 > def rewrite(ui, topic, doc):
1195 > def rewrite(ui, topic, doc):
1196 > return doc + '\nhelphook1\n'
1196 > return doc + '\nhelphook1\n'
1197 >
1197 >
1198 > def extsetup(ui):
1198 > def extsetup(ui):
1199 > help.addtopichook('revsets', rewrite)
1199 > help.addtopichook('revsets', rewrite)
1200 > EOF
1200 > EOF
1201 $ cat > helphook2.py <<EOF
1201 $ cat > helphook2.py <<EOF
1202 > from mercurial import help
1202 > from mercurial import help
1203 >
1203 >
1204 > def rewrite(ui, topic, doc):
1204 > def rewrite(ui, topic, doc):
1205 > return doc + '\nhelphook2\n'
1205 > return doc + '\nhelphook2\n'
1206 >
1206 >
1207 > def extsetup(ui):
1207 > def extsetup(ui):
1208 > help.addtopichook('revsets', rewrite)
1208 > help.addtopichook('revsets', rewrite)
1209 > EOF
1209 > EOF
1210 $ echo '[extensions]' >> $HGRCPATH
1210 $ echo '[extensions]' >> $HGRCPATH
1211 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1211 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1212 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1212 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1213 $ hg help revsets | grep helphook
1213 $ hg help revsets | grep helphook
1214 helphook1
1214 helphook1
1215 helphook2
1215 helphook2
1216
1216
1217 help -c should only show debug --debug
1217 help -c should only show debug --debug
1218
1218
1219 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1219 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1220 [1]
1220 [1]
1221
1221
1222 help -c should only show deprecated for -v
1222 help -c should only show deprecated for -v
1223
1223
1224 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1224 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1225 [1]
1225 [1]
1226
1226
1227 Test -e / -c / -k combinations
1227 Test -e / -c / -k combinations
1228
1228
1229 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1229 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1230 Commands:
1230 Commands:
1231 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1231 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1232 Extensions:
1232 Extensions:
1233 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1233 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1234 Topics:
1234 Topics:
1235 Commands:
1235 Commands:
1236 Extensions:
1236 Extensions:
1237 Extension Commands:
1237 Extension Commands:
1238 $ hg help -c schemes
1238 $ hg help -c schemes
1239 abort: no such help topic: schemes
1239 abort: no such help topic: schemes
1240 (try "hg help --keyword schemes")
1240 (try "hg help --keyword schemes")
1241 [255]
1241 [255]
1242 $ hg help -e schemes |head -1
1242 $ hg help -e schemes |head -1
1243 schemes extension - extend schemes with shortcuts to repository swarms
1243 schemes extension - extend schemes with shortcuts to repository swarms
1244 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1244 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1245 Commands:
1245 Commands:
1246 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1246 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1247 Extensions:
1247 Extensions:
1248 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1248 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1249 Extensions:
1249 Extensions:
1250 Commands:
1250 Commands:
1251 $ hg help -c commit > /dev/null
1251 $ hg help -c commit > /dev/null
1252 $ hg help -e -c commit > /dev/null
1252 $ hg help -e -c commit > /dev/null
1253 $ hg help -e commit > /dev/null
1253 $ hg help -e commit > /dev/null
1254 abort: no such help topic: commit
1254 abort: no such help topic: commit
1255 (try "hg help --keyword commit")
1255 (try "hg help --keyword commit")
1256 [255]
1256 [255]
1257
1257
1258 Test keyword search help
1258 Test keyword search help
1259
1259
1260 $ cat > prefixedname.py <<EOF
1260 $ cat > prefixedname.py <<EOF
1261 > '''matched against word "clone"
1261 > '''matched against word "clone"
1262 > '''
1262 > '''
1263 > EOF
1263 > EOF
1264 $ echo '[extensions]' >> $HGRCPATH
1264 $ echo '[extensions]' >> $HGRCPATH
1265 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1265 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1266 $ hg help -k clone
1266 $ hg help -k clone
1267 Topics:
1267 Topics:
1268
1268
1269 config Configuration Files
1269 config Configuration Files
1270 extensions Using Additional Features
1270 extensions Using Additional Features
1271 glossary Glossary
1271 glossary Glossary
1272 phases Working with Phases
1272 phases Working with Phases
1273 subrepos Subrepositories
1273 subrepos Subrepositories
1274 urls URL Paths
1274 urls URL Paths
1275
1275
1276 Commands:
1276 Commands:
1277
1277
1278 bookmarks create a new bookmark or list existing bookmarks
1278 bookmarks create a new bookmark or list existing bookmarks
1279 clone make a copy of an existing repository
1279 clone make a copy of an existing repository
1280 paths show aliases for remote repositories
1280 paths show aliases for remote repositories
1281 update update working directory (or switch revisions)
1281 update update working directory (or switch revisions)
1282
1282
1283 Extensions:
1283 Extensions:
1284
1284
1285 clonebundles advertise pre-generated bundles to seed clones (experimental)
1285 clonebundles advertise pre-generated bundles to seed clones (experimental)
1286 prefixedname matched against word "clone"
1286 prefixedname matched against word "clone"
1287 relink recreates hardlinks between repository clones
1287 relink recreates hardlinks between repository clones
1288
1288
1289 Extension Commands:
1289 Extension Commands:
1290
1290
1291 qclone clone main and patch repository at same time
1291 qclone clone main and patch repository at same time
1292
1292
1293 Test unfound topic
1293 Test unfound topic
1294
1294
1295 $ hg help nonexistingtopicthatwillneverexisteverever
1295 $ hg help nonexistingtopicthatwillneverexisteverever
1296 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1296 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1297 (try "hg help --keyword nonexistingtopicthatwillneverexisteverever")
1297 (try "hg help --keyword nonexistingtopicthatwillneverexisteverever")
1298 [255]
1298 [255]
1299
1299
1300 Test unfound keyword
1300 Test unfound keyword
1301
1301
1302 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1302 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1303 abort: no matches
1303 abort: no matches
1304 (try "hg help" for a list of topics)
1304 (try "hg help" for a list of topics)
1305 [255]
1305 [255]
1306
1306
1307 Test omit indicating for help
1307 Test omit indicating for help
1308
1308
1309 $ cat > addverboseitems.py <<EOF
1309 $ cat > addverboseitems.py <<EOF
1310 > '''extension to test omit indicating.
1310 > '''extension to test omit indicating.
1311 >
1311 >
1312 > This paragraph is never omitted (for extension)
1312 > This paragraph is never omitted (for extension)
1313 >
1313 >
1314 > .. container:: verbose
1314 > .. container:: verbose
1315 >
1315 >
1316 > This paragraph is omitted,
1316 > This paragraph is omitted,
1317 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1317 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1318 >
1318 >
1319 > This paragraph is never omitted, too (for extension)
1319 > This paragraph is never omitted, too (for extension)
1320 > '''
1320 > '''
1321 >
1321 >
1322 > from mercurial import help, commands
1322 > from mercurial import help, commands
1323 > testtopic = """This paragraph is never omitted (for topic).
1323 > testtopic = """This paragraph is never omitted (for topic).
1324 >
1324 >
1325 > .. container:: verbose
1325 > .. container:: verbose
1326 >
1326 >
1327 > This paragraph is omitted,
1327 > This paragraph is omitted,
1328 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1328 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1329 >
1329 >
1330 > This paragraph is never omitted, too (for topic)
1330 > This paragraph is never omitted, too (for topic)
1331 > """
1331 > """
1332 > def extsetup(ui):
1332 > def extsetup(ui):
1333 > help.helptable.append((["topic-containing-verbose"],
1333 > help.helptable.append((["topic-containing-verbose"],
1334 > "This is the topic to test omit indicating.",
1334 > "This is the topic to test omit indicating.",
1335 > lambda ui: testtopic))
1335 > lambda ui: testtopic))
1336 > EOF
1336 > EOF
1337 $ echo '[extensions]' >> $HGRCPATH
1337 $ echo '[extensions]' >> $HGRCPATH
1338 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1338 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1339 $ hg help addverboseitems
1339 $ hg help addverboseitems
1340 addverboseitems extension - extension to test omit indicating.
1340 addverboseitems extension - extension to test omit indicating.
1341
1341
1342 This paragraph is never omitted (for extension)
1342 This paragraph is never omitted (for extension)
1343
1343
1344 This paragraph is never omitted, too (for extension)
1344 This paragraph is never omitted, too (for extension)
1345
1345
1346 (some details hidden, use --verbose to show complete help)
1346 (some details hidden, use --verbose to show complete help)
1347
1347
1348 no commands defined
1348 no commands defined
1349 $ hg help -v addverboseitems
1349 $ hg help -v addverboseitems
1350 addverboseitems extension - extension to test omit indicating.
1350 addverboseitems extension - extension to test omit indicating.
1351
1351
1352 This paragraph is never omitted (for extension)
1352 This paragraph is never omitted (for extension)
1353
1353
1354 This paragraph is omitted, if "hg help" is invoked without "-v" (for
1354 This paragraph is omitted, if "hg help" is invoked without "-v" (for
1355 extension)
1355 extension)
1356
1356
1357 This paragraph is never omitted, too (for extension)
1357 This paragraph is never omitted, too (for extension)
1358
1358
1359 no commands defined
1359 no commands defined
1360 $ hg help topic-containing-verbose
1360 $ hg help topic-containing-verbose
1361 This is the topic to test omit indicating.
1361 This is the topic to test omit indicating.
1362 """"""""""""""""""""""""""""""""""""""""""
1362 """"""""""""""""""""""""""""""""""""""""""
1363
1363
1364 This paragraph is never omitted (for topic).
1364 This paragraph is never omitted (for topic).
1365
1365
1366 This paragraph is never omitted, too (for topic)
1366 This paragraph is never omitted, too (for topic)
1367
1367
1368 (some details hidden, use --verbose to show complete help)
1368 (some details hidden, use --verbose to show complete help)
1369 $ hg help -v topic-containing-verbose
1369 $ hg help -v topic-containing-verbose
1370 This is the topic to test omit indicating.
1370 This is the topic to test omit indicating.
1371 """"""""""""""""""""""""""""""""""""""""""
1371 """"""""""""""""""""""""""""""""""""""""""
1372
1372
1373 This paragraph is never omitted (for topic).
1373 This paragraph is never omitted (for topic).
1374
1374
1375 This paragraph is omitted, if "hg help" is invoked without "-v" (for
1375 This paragraph is omitted, if "hg help" is invoked without "-v" (for
1376 topic)
1376 topic)
1377
1377
1378 This paragraph is never omitted, too (for topic)
1378 This paragraph is never omitted, too (for topic)
1379
1379
1380 Test section lookup
1380 Test section lookup
1381
1381
1382 $ hg help revset.merge
1382 $ hg help revset.merge
1383 "merge()"
1383 "merge()"
1384 Changeset is a merge changeset.
1384 Changeset is a merge changeset.
1385
1385
1386 $ hg help glossary.dag
1386 $ hg help glossary.dag
1387 DAG
1387 DAG
1388 The repository of changesets of a distributed version control system
1388 The repository of changesets of a distributed version control system
1389 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1389 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1390 of nodes and edges, where nodes correspond to changesets and edges
1390 of nodes and edges, where nodes correspond to changesets and edges
1391 imply a parent -> child relation. This graph can be visualized by
1391 imply a parent -> child relation. This graph can be visualized by
1392 graphical tools such as "hg log --graph". In Mercurial, the DAG is
1392 graphical tools such as "hg log --graph". In Mercurial, the DAG is
1393 limited by the requirement for children to have at most two parents.
1393 limited by the requirement for children to have at most two parents.
1394
1394
1395
1395
1396 $ hg help hgrc.paths
1396 $ hg help hgrc.paths
1397 "paths"
1397 "paths"
1398 -------
1398 -------
1399
1399
1400 Assigns symbolic names and behavior to repositories.
1400 Assigns symbolic names and behavior to repositories.
1401
1401
1402 Options are symbolic names defining the URL or directory that is the
1402 Options are symbolic names defining the URL or directory that is the
1403 location of the repository. Example:
1403 location of the repository. Example:
1404
1404
1405 [paths]
1405 [paths]
1406 my_server = https://example.com/my_repo
1406 my_server = https://example.com/my_repo
1407 local_path = /home/me/repo
1407 local_path = /home/me/repo
1408
1408
1409 These symbolic names can be used from the command line. To pull from
1409 These symbolic names can be used from the command line. To pull from
1410 "my_server": "hg pull my_server". To push to "local_path": "hg push
1410 "my_server": "hg pull my_server". To push to "local_path": "hg push
1411 local_path".
1411 local_path".
1412
1412
1413 Options containing colons (":") denote sub-options that can influence
1413 Options containing colons (":") denote sub-options that can influence
1414 behavior for that specific path. Example:
1414 behavior for that specific path. Example:
1415
1415
1416 [paths]
1416 [paths]
1417 my_server = https://example.com/my_path
1417 my_server = https://example.com/my_path
1418 my_server:pushurl = ssh://example.com/my_path
1418 my_server:pushurl = ssh://example.com/my_path
1419
1419
1420 The following sub-options can be defined:
1420 The following sub-options can be defined:
1421
1421
1422 "pushurl"
1422 "pushurl"
1423 The URL to use for push operations. If not defined, the location
1423 The URL to use for push operations. If not defined, the location
1424 defined by the path's main entry is used.
1424 defined by the path's main entry is used.
1425
1425
1426 The following special named paths exist:
1426 The following special named paths exist:
1427
1427
1428 "default"
1428 "default"
1429 The URL or directory to use when no source or remote is specified.
1429 The URL or directory to use when no source or remote is specified.
1430
1430
1431 "hg clone" will automatically define this path to the location the
1431 "hg clone" will automatically define this path to the location the
1432 repository was cloned from.
1432 repository was cloned from.
1433
1433
1434 "default-push"
1434 "default-push"
1435 (deprecated) The URL or directory for the default "hg push" location.
1435 (deprecated) The URL or directory for the default "hg push" location.
1436 "default:pushurl" should be used instead.
1436 "default:pushurl" should be used instead.
1437
1437
1438 $ hg help glossary.mcguffin
1438 $ hg help glossary.mcguffin
1439 abort: help section not found
1439 abort: help section not found
1440 [255]
1440 [255]
1441
1441
1442 $ hg help glossary.mc.guffin
1442 $ hg help glossary.mc.guffin
1443 abort: help section not found
1443 abort: help section not found
1444 [255]
1444 [255]
1445
1445
1446 $ hg help template.files
1446 $ hg help template.files
1447 files List of strings. All files modified, added, or removed by
1447 files List of strings. All files modified, added, or removed by
1448 this changeset.
1448 this changeset.
1449
1449
1450 Test dynamic list of merge tools only shows up once
1450 Test dynamic list of merge tools only shows up once
1451 $ hg help merge-tools
1451 $ hg help merge-tools
1452 Merge Tools
1452 Merge Tools
1453 """""""""""
1453 """""""""""
1454
1454
1455 To merge files Mercurial uses merge tools.
1455 To merge files Mercurial uses merge tools.
1456
1456
1457 A merge tool combines two different versions of a file into a merged file.
1457 A merge tool combines two different versions of a file into a merged file.
1458 Merge tools are given the two files and the greatest common ancestor of
1458 Merge tools are given the two files and the greatest common ancestor of
1459 the two file versions, so they can determine the changes made on both
1459 the two file versions, so they can determine the changes made on both
1460 branches.
1460 branches.
1461
1461
1462 Merge tools are used both for "hg resolve", "hg merge", "hg update", "hg
1462 Merge tools are used both for "hg resolve", "hg merge", "hg update", "hg
1463 backout" and in several extensions.
1463 backout" and in several extensions.
1464
1464
1465 Usually, the merge tool tries to automatically reconcile the files by
1465 Usually, the merge tool tries to automatically reconcile the files by
1466 combining all non-overlapping changes that occurred separately in the two
1466 combining all non-overlapping changes that occurred separately in the two
1467 different evolutions of the same initial base file. Furthermore, some
1467 different evolutions of the same initial base file. Furthermore, some
1468 interactive merge programs make it easier to manually resolve conflicting
1468 interactive merge programs make it easier to manually resolve conflicting
1469 merges, either in a graphical way, or by inserting some conflict markers.
1469 merges, either in a graphical way, or by inserting some conflict markers.
1470 Mercurial does not include any interactive merge programs but relies on
1470 Mercurial does not include any interactive merge programs but relies on
1471 external tools for that.
1471 external tools for that.
1472
1472
1473 Available merge tools
1473 Available merge tools
1474 =====================
1474 =====================
1475
1475
1476 External merge tools and their properties are configured in the merge-
1476 External merge tools and their properties are configured in the merge-
1477 tools configuration section - see hgrc(5) - but they can often just be
1477 tools configuration section - see hgrc(5) - but they can often just be
1478 named by their executable.
1478 named by their executable.
1479
1479
1480 A merge tool is generally usable if its executable can be found on the
1480 A merge tool is generally usable if its executable can be found on the
1481 system and if it can handle the merge. The executable is found if it is an
1481 system and if it can handle the merge. The executable is found if it is an
1482 absolute or relative executable path or the name of an application in the
1482 absolute or relative executable path or the name of an application in the
1483 executable search path. The tool is assumed to be able to handle the merge
1483 executable search path. The tool is assumed to be able to handle the merge
1484 if it can handle symlinks if the file is a symlink, if it can handle
1484 if it can handle symlinks if the file is a symlink, if it can handle
1485 binary files if the file is binary, and if a GUI is available if the tool
1485 binary files if the file is binary, and if a GUI is available if the tool
1486 requires a GUI.
1486 requires a GUI.
1487
1487
1488 There are some internal merge tools which can be used. The internal merge
1488 There are some internal merge tools which can be used. The internal merge
1489 tools are:
1489 tools are:
1490
1490
1491 ":dump"
1491 ":dump"
1492 Creates three versions of the files to merge, containing the contents of
1492 Creates three versions of the files to merge, containing the contents of
1493 local, other and base. These files can then be used to perform a merge
1493 local, other and base. These files can then be used to perform a merge
1494 manually. If the file to be merged is named "a.txt", these files will
1494 manually. If the file to be merged is named "a.txt", these files will
1495 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1495 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1496 they will be placed in the same directory as "a.txt".
1496 they will be placed in the same directory as "a.txt".
1497
1497
1498 ":fail"
1498 ":fail"
1499 Rather than attempting to merge files that were modified on both
1499 Rather than attempting to merge files that were modified on both
1500 branches, it marks them as unresolved. The resolve command must be used
1500 branches, it marks them as unresolved. The resolve command must be used
1501 to resolve these conflicts.
1501 to resolve these conflicts.
1502
1502
1503 ":local"
1503 ":local"
1504 Uses the local version of files as the merged version.
1504 Uses the local version of files as the merged version.
1505
1505
1506 ":merge"
1506 ":merge"
1507 Uses the internal non-interactive simple merge algorithm for merging
1507 Uses the internal non-interactive simple merge algorithm for merging
1508 files. It will fail if there are any conflicts and leave markers in the
1508 files. It will fail if there are any conflicts and leave markers in the
1509 partially merged file. Markers will have two sections, one for each side
1509 partially merged file. Markers will have two sections, one for each side
1510 of merge.
1510 of merge.
1511
1511
1512 ":merge-local"
1512 ":merge-local"
1513 Like :merge, but resolve all conflicts non-interactively in favor of the
1513 Like :merge, but resolve all conflicts non-interactively in favor of the
1514 local changes.
1514 local changes.
1515
1515
1516 ":merge-other"
1516 ":merge-other"
1517 Like :merge, but resolve all conflicts non-interactively in favor of the
1517 Like :merge, but resolve all conflicts non-interactively in favor of the
1518 other changes.
1518 other changes.
1519
1519
1520 ":merge3"
1520 ":merge3"
1521 Uses the internal non-interactive simple merge algorithm for merging
1521 Uses the internal non-interactive simple merge algorithm for merging
1522 files. It will fail if there are any conflicts and leave markers in the
1522 files. It will fail if there are any conflicts and leave markers in the
1523 partially merged file. Marker will have three sections, one from each
1523 partially merged file. Marker will have three sections, one from each
1524 side of the merge and one for the base content.
1524 side of the merge and one for the base content.
1525
1525
1526 ":other"
1526 ":other"
1527 Uses the other version of files as the merged version.
1527 Uses the other version of files as the merged version.
1528
1528
1529 ":prompt"
1529 ":prompt"
1530 Asks the user which of the local or the other version to keep as the
1530 Asks the user which of the local or the other version to keep as the
1531 merged version.
1531 merged version.
1532
1532
1533 ":tagmerge"
1533 ":tagmerge"
1534 Uses the internal tag merge algorithm (experimental).
1534 Uses the internal tag merge algorithm (experimental).
1535
1535
1536 ":union"
1536 ":union"
1537 Uses the internal non-interactive simple merge algorithm for merging
1537 Uses the internal non-interactive simple merge algorithm for merging
1538 files. It will use both left and right sides for conflict regions. No
1538 files. It will use both left and right sides for conflict regions. No
1539 markers are inserted.
1539 markers are inserted.
1540
1540
1541 Internal tools are always available and do not require a GUI but will by
1541 Internal tools are always available and do not require a GUI but will by
1542 default not handle symlinks or binary files.
1542 default not handle symlinks or binary files.
1543
1543
1544 Choosing a merge tool
1544 Choosing a merge tool
1545 =====================
1545 =====================
1546
1546
1547 Mercurial uses these rules when deciding which merge tool to use:
1547 Mercurial uses these rules when deciding which merge tool to use:
1548
1548
1549 1. If a tool has been specified with the --tool option to merge or
1549 1. If a tool has been specified with the --tool option to merge or
1550 resolve, it is used. If it is the name of a tool in the merge-tools
1550 resolve, it is used. If it is the name of a tool in the merge-tools
1551 configuration, its configuration is used. Otherwise the specified tool
1551 configuration, its configuration is used. Otherwise the specified tool
1552 must be executable by the shell.
1552 must be executable by the shell.
1553 2. If the "HGMERGE" environment variable is present, its value is used and
1553 2. If the "HGMERGE" environment variable is present, its value is used and
1554 must be executable by the shell.
1554 must be executable by the shell.
1555 3. If the filename of the file to be merged matches any of the patterns in
1555 3. If the filename of the file to be merged matches any of the patterns in
1556 the merge-patterns configuration section, the first usable merge tool
1556 the merge-patterns configuration section, the first usable merge tool
1557 corresponding to a matching pattern is used. Here, binary capabilities
1557 corresponding to a matching pattern is used. Here, binary capabilities
1558 of the merge tool are not considered.
1558 of the merge tool are not considered.
1559 4. If ui.merge is set it will be considered next. If the value is not the
1559 4. If ui.merge is set it will be considered next. If the value is not the
1560 name of a configured tool, the specified value is used and must be
1560 name of a configured tool, the specified value is used and must be
1561 executable by the shell. Otherwise the named tool is used if it is
1561 executable by the shell. Otherwise the named tool is used if it is
1562 usable.
1562 usable.
1563 5. If any usable merge tools are present in the merge-tools configuration
1563 5. If any usable merge tools are present in the merge-tools configuration
1564 section, the one with the highest priority is used.
1564 section, the one with the highest priority is used.
1565 6. If a program named "hgmerge" can be found on the system, it is used -
1565 6. If a program named "hgmerge" can be found on the system, it is used -
1566 but it will by default not be used for symlinks and binary files.
1566 but it will by default not be used for symlinks and binary files.
1567 7. If the file to be merged is not binary and is not a symlink, then
1567 7. If the file to be merged is not binary and is not a symlink, then
1568 internal ":merge" is used.
1568 internal ":merge" is used.
1569 8. The merge of the file fails and must be resolved before commit.
1569 8. The merge of the file fails and must be resolved before commit.
1570
1570
1571 Note:
1571 Note:
1572 After selecting a merge program, Mercurial will by default attempt to
1572 After selecting a merge program, Mercurial will by default attempt to
1573 merge the files using a simple merge algorithm first. Only if it
1573 merge the files using a simple merge algorithm first. Only if it
1574 doesn't succeed because of conflicting changes Mercurial will actually
1574 doesn't succeed because of conflicting changes Mercurial will actually
1575 execute the merge program. Whether to use the simple merge algorithm
1575 execute the merge program. Whether to use the simple merge algorithm
1576 first can be controlled by the premerge setting of the merge tool.
1576 first can be controlled by the premerge setting of the merge tool.
1577 Premerge is enabled by default unless the file is binary or a symlink.
1577 Premerge is enabled by default unless the file is binary or a symlink.
1578
1578
1579 See the merge-tools and ui sections of hgrc(5) for details on the
1579 See the merge-tools and ui sections of hgrc(5) for details on the
1580 configuration of merge tools.
1580 configuration of merge tools.
1581
1581
1582 Test usage of section marks in help documents
1582 Test usage of section marks in help documents
1583
1583
1584 $ cd "$TESTDIR"/../doc
1584 $ cd "$TESTDIR"/../doc
1585 $ python check-seclevel.py
1585 $ python check-seclevel.py
1586 $ cd $TESTTMP
1586 $ cd $TESTTMP
1587
1587
1588 #if serve
1588 #if serve
1589
1589
1590 Test the help pages in hgweb.
1590 Test the help pages in hgweb.
1591
1591
1592 Dish up an empty repo; serve it cold.
1592 Dish up an empty repo; serve it cold.
1593
1593
1594 $ hg init "$TESTTMP/test"
1594 $ hg init "$TESTTMP/test"
1595 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1595 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1596 $ cat hg.pid >> $DAEMON_PIDS
1596 $ cat hg.pid >> $DAEMON_PIDS
1597
1597
1598 $ get-with-headers.py 127.0.0.1:$HGPORT "help"
1598 $ get-with-headers.py 127.0.0.1:$HGPORT "help"
1599 200 Script output follows
1599 200 Script output follows
1600
1600
1601 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1601 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1602 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1602 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1603 <head>
1603 <head>
1604 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1604 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1605 <meta name="robots" content="index, nofollow" />
1605 <meta name="robots" content="index, nofollow" />
1606 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1606 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1607 <script type="text/javascript" src="/static/mercurial.js"></script>
1607 <script type="text/javascript" src="/static/mercurial.js"></script>
1608
1608
1609 <title>Help: Index</title>
1609 <title>Help: Index</title>
1610 </head>
1610 </head>
1611 <body>
1611 <body>
1612
1612
1613 <div class="container">
1613 <div class="container">
1614 <div class="menu">
1614 <div class="menu">
1615 <div class="logo">
1615 <div class="logo">
1616 <a href="https://mercurial-scm.org/">
1616 <a href="https://mercurial-scm.org/">
1617 <img src="/static/hglogo.png" alt="mercurial" /></a>
1617 <img src="/static/hglogo.png" alt="mercurial" /></a>
1618 </div>
1618 </div>
1619 <ul>
1619 <ul>
1620 <li><a href="/shortlog">log</a></li>
1620 <li><a href="/shortlog">log</a></li>
1621 <li><a href="/graph">graph</a></li>
1621 <li><a href="/graph">graph</a></li>
1622 <li><a href="/tags">tags</a></li>
1622 <li><a href="/tags">tags</a></li>
1623 <li><a href="/bookmarks">bookmarks</a></li>
1623 <li><a href="/bookmarks">bookmarks</a></li>
1624 <li><a href="/branches">branches</a></li>
1624 <li><a href="/branches">branches</a></li>
1625 </ul>
1625 </ul>
1626 <ul>
1626 <ul>
1627 <li class="active">help</li>
1627 <li class="active">help</li>
1628 </ul>
1628 </ul>
1629 </div>
1629 </div>
1630
1630
1631 <div class="main">
1631 <div class="main">
1632 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1632 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1633 <form class="search" action="/log">
1633 <form class="search" action="/log">
1634
1634
1635 <p><input name="rev" id="search1" type="text" size="30" /></p>
1635 <p><input name="rev" id="search1" type="text" size="30" /></p>
1636 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1636 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1637 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1637 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1638 </form>
1638 </form>
1639 <table class="bigtable">
1639 <table class="bigtable">
1640 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
1640 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
1641
1641
1642 <tr><td>
1642 <tr><td>
1643 <a href="/help/config">
1643 <a href="/help/config">
1644 config
1644 config
1645 </a>
1645 </a>
1646 </td><td>
1646 </td><td>
1647 Configuration Files
1647 Configuration Files
1648 </td></tr>
1648 </td></tr>
1649 <tr><td>
1649 <tr><td>
1650 <a href="/help/dates">
1650 <a href="/help/dates">
1651 dates
1651 dates
1652 </a>
1652 </a>
1653 </td><td>
1653 </td><td>
1654 Date Formats
1654 Date Formats
1655 </td></tr>
1655 </td></tr>
1656 <tr><td>
1656 <tr><td>
1657 <a href="/help/diffs">
1657 <a href="/help/diffs">
1658 diffs
1658 diffs
1659 </a>
1659 </a>
1660 </td><td>
1660 </td><td>
1661 Diff Formats
1661 Diff Formats
1662 </td></tr>
1662 </td></tr>
1663 <tr><td>
1663 <tr><td>
1664 <a href="/help/environment">
1664 <a href="/help/environment">
1665 environment
1665 environment
1666 </a>
1666 </a>
1667 </td><td>
1667 </td><td>
1668 Environment Variables
1668 Environment Variables
1669 </td></tr>
1669 </td></tr>
1670 <tr><td>
1670 <tr><td>
1671 <a href="/help/extensions">
1671 <a href="/help/extensions">
1672 extensions
1672 extensions
1673 </a>
1673 </a>
1674 </td><td>
1674 </td><td>
1675 Using Additional Features
1675 Using Additional Features
1676 </td></tr>
1676 </td></tr>
1677 <tr><td>
1677 <tr><td>
1678 <a href="/help/filesets">
1678 <a href="/help/filesets">
1679 filesets
1679 filesets
1680 </a>
1680 </a>
1681 </td><td>
1681 </td><td>
1682 Specifying File Sets
1682 Specifying File Sets
1683 </td></tr>
1683 </td></tr>
1684 <tr><td>
1684 <tr><td>
1685 <a href="/help/glossary">
1685 <a href="/help/glossary">
1686 glossary
1686 glossary
1687 </a>
1687 </a>
1688 </td><td>
1688 </td><td>
1689 Glossary
1689 Glossary
1690 </td></tr>
1690 </td></tr>
1691 <tr><td>
1691 <tr><td>
1692 <a href="/help/hgignore">
1692 <a href="/help/hgignore">
1693 hgignore
1693 hgignore
1694 </a>
1694 </a>
1695 </td><td>
1695 </td><td>
1696 Syntax for Mercurial Ignore Files
1696 Syntax for Mercurial Ignore Files
1697 </td></tr>
1697 </td></tr>
1698 <tr><td>
1698 <tr><td>
1699 <a href="/help/hgweb">
1699 <a href="/help/hgweb">
1700 hgweb
1700 hgweb
1701 </a>
1701 </a>
1702 </td><td>
1702 </td><td>
1703 Configuring hgweb
1703 Configuring hgweb
1704 </td></tr>
1704 </td></tr>
1705 <tr><td>
1705 <tr><td>
1706 <a href="/help/internals">
1706 <a href="/help/internals">
1707 internals
1707 internals
1708 </a>
1708 </a>
1709 </td><td>
1709 </td><td>
1710 Technical implementation topics
1710 Technical implementation topics
1711 </td></tr>
1711 </td></tr>
1712 <tr><td>
1712 <tr><td>
1713 <a href="/help/merge-tools">
1713 <a href="/help/merge-tools">
1714 merge-tools
1714 merge-tools
1715 </a>
1715 </a>
1716 </td><td>
1716 </td><td>
1717 Merge Tools
1717 Merge Tools
1718 </td></tr>
1718 </td></tr>
1719 <tr><td>
1719 <tr><td>
1720 <a href="/help/multirevs">
1720 <a href="/help/multirevs">
1721 multirevs
1721 multirevs
1722 </a>
1722 </a>
1723 </td><td>
1723 </td><td>
1724 Specifying Multiple Revisions
1724 Specifying Multiple Revisions
1725 </td></tr>
1725 </td></tr>
1726 <tr><td>
1726 <tr><td>
1727 <a href="/help/patterns">
1727 <a href="/help/patterns">
1728 patterns
1728 patterns
1729 </a>
1729 </a>
1730 </td><td>
1730 </td><td>
1731 File Name Patterns
1731 File Name Patterns
1732 </td></tr>
1732 </td></tr>
1733 <tr><td>
1733 <tr><td>
1734 <a href="/help/phases">
1734 <a href="/help/phases">
1735 phases
1735 phases
1736 </a>
1736 </a>
1737 </td><td>
1737 </td><td>
1738 Working with Phases
1738 Working with Phases
1739 </td></tr>
1739 </td></tr>
1740 <tr><td>
1740 <tr><td>
1741 <a href="/help/revisions">
1741 <a href="/help/revisions">
1742 revisions
1742 revisions
1743 </a>
1743 </a>
1744 </td><td>
1744 </td><td>
1745 Specifying Single Revisions
1745 Specifying Single Revisions
1746 </td></tr>
1746 </td></tr>
1747 <tr><td>
1747 <tr><td>
1748 <a href="/help/revsets">
1748 <a href="/help/revsets">
1749 revsets
1749 revsets
1750 </a>
1750 </a>
1751 </td><td>
1751 </td><td>
1752 Specifying Revision Sets
1752 Specifying Revision Sets
1753 </td></tr>
1753 </td></tr>
1754 <tr><td>
1754 <tr><td>
1755 <a href="/help/scripting">
1755 <a href="/help/scripting">
1756 scripting
1756 scripting
1757 </a>
1757 </a>
1758 </td><td>
1758 </td><td>
1759 Using Mercurial from scripts and automation
1759 Using Mercurial from scripts and automation
1760 </td></tr>
1760 </td></tr>
1761 <tr><td>
1761 <tr><td>
1762 <a href="/help/subrepos">
1762 <a href="/help/subrepos">
1763 subrepos
1763 subrepos
1764 </a>
1764 </a>
1765 </td><td>
1765 </td><td>
1766 Subrepositories
1766 Subrepositories
1767 </td></tr>
1767 </td></tr>
1768 <tr><td>
1768 <tr><td>
1769 <a href="/help/templating">
1769 <a href="/help/templating">
1770 templating
1770 templating
1771 </a>
1771 </a>
1772 </td><td>
1772 </td><td>
1773 Template Usage
1773 Template Usage
1774 </td></tr>
1774 </td></tr>
1775 <tr><td>
1775 <tr><td>
1776 <a href="/help/urls">
1776 <a href="/help/urls">
1777 urls
1777 urls
1778 </a>
1778 </a>
1779 </td><td>
1779 </td><td>
1780 URL Paths
1780 URL Paths
1781 </td></tr>
1781 </td></tr>
1782 <tr><td>
1782 <tr><td>
1783 <a href="/help/topic-containing-verbose">
1783 <a href="/help/topic-containing-verbose">
1784 topic-containing-verbose
1784 topic-containing-verbose
1785 </a>
1785 </a>
1786 </td><td>
1786 </td><td>
1787 This is the topic to test omit indicating.
1787 This is the topic to test omit indicating.
1788 </td></tr>
1788 </td></tr>
1789
1789
1790
1790
1791 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1791 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1792
1792
1793 <tr><td>
1793 <tr><td>
1794 <a href="/help/add">
1794 <a href="/help/add">
1795 add
1795 add
1796 </a>
1796 </a>
1797 </td><td>
1797 </td><td>
1798 add the specified files on the next commit
1798 add the specified files on the next commit
1799 </td></tr>
1799 </td></tr>
1800 <tr><td>
1800 <tr><td>
1801 <a href="/help/annotate">
1801 <a href="/help/annotate">
1802 annotate
1802 annotate
1803 </a>
1803 </a>
1804 </td><td>
1804 </td><td>
1805 show changeset information by line for each file
1805 show changeset information by line for each file
1806 </td></tr>
1806 </td></tr>
1807 <tr><td>
1807 <tr><td>
1808 <a href="/help/clone">
1808 <a href="/help/clone">
1809 clone
1809 clone
1810 </a>
1810 </a>
1811 </td><td>
1811 </td><td>
1812 make a copy of an existing repository
1812 make a copy of an existing repository
1813 </td></tr>
1813 </td></tr>
1814 <tr><td>
1814 <tr><td>
1815 <a href="/help/commit">
1815 <a href="/help/commit">
1816 commit
1816 commit
1817 </a>
1817 </a>
1818 </td><td>
1818 </td><td>
1819 commit the specified files or all outstanding changes
1819 commit the specified files or all outstanding changes
1820 </td></tr>
1820 </td></tr>
1821 <tr><td>
1821 <tr><td>
1822 <a href="/help/diff">
1822 <a href="/help/diff">
1823 diff
1823 diff
1824 </a>
1824 </a>
1825 </td><td>
1825 </td><td>
1826 diff repository (or selected files)
1826 diff repository (or selected files)
1827 </td></tr>
1827 </td></tr>
1828 <tr><td>
1828 <tr><td>
1829 <a href="/help/export">
1829 <a href="/help/export">
1830 export
1830 export
1831 </a>
1831 </a>
1832 </td><td>
1832 </td><td>
1833 dump the header and diffs for one or more changesets
1833 dump the header and diffs for one or more changesets
1834 </td></tr>
1834 </td></tr>
1835 <tr><td>
1835 <tr><td>
1836 <a href="/help/forget">
1836 <a href="/help/forget">
1837 forget
1837 forget
1838 </a>
1838 </a>
1839 </td><td>
1839 </td><td>
1840 forget the specified files on the next commit
1840 forget the specified files on the next commit
1841 </td></tr>
1841 </td></tr>
1842 <tr><td>
1842 <tr><td>
1843 <a href="/help/init">
1843 <a href="/help/init">
1844 init
1844 init
1845 </a>
1845 </a>
1846 </td><td>
1846 </td><td>
1847 create a new repository in the given directory
1847 create a new repository in the given directory
1848 </td></tr>
1848 </td></tr>
1849 <tr><td>
1849 <tr><td>
1850 <a href="/help/log">
1850 <a href="/help/log">
1851 log
1851 log
1852 </a>
1852 </a>
1853 </td><td>
1853 </td><td>
1854 show revision history of entire repository or files
1854 show revision history of entire repository or files
1855 </td></tr>
1855 </td></tr>
1856 <tr><td>
1856 <tr><td>
1857 <a href="/help/merge">
1857 <a href="/help/merge">
1858 merge
1858 merge
1859 </a>
1859 </a>
1860 </td><td>
1860 </td><td>
1861 merge another revision into working directory
1861 merge another revision into working directory
1862 </td></tr>
1862 </td></tr>
1863 <tr><td>
1863 <tr><td>
1864 <a href="/help/pull">
1864 <a href="/help/pull">
1865 pull
1865 pull
1866 </a>
1866 </a>
1867 </td><td>
1867 </td><td>
1868 pull changes from the specified source
1868 pull changes from the specified source
1869 </td></tr>
1869 </td></tr>
1870 <tr><td>
1870 <tr><td>
1871 <a href="/help/push">
1871 <a href="/help/push">
1872 push
1872 push
1873 </a>
1873 </a>
1874 </td><td>
1874 </td><td>
1875 push changes to the specified destination
1875 push changes to the specified destination
1876 </td></tr>
1876 </td></tr>
1877 <tr><td>
1877 <tr><td>
1878 <a href="/help/remove">
1878 <a href="/help/remove">
1879 remove
1879 remove
1880 </a>
1880 </a>
1881 </td><td>
1881 </td><td>
1882 remove the specified files on the next commit
1882 remove the specified files on the next commit
1883 </td></tr>
1883 </td></tr>
1884 <tr><td>
1884 <tr><td>
1885 <a href="/help/serve">
1885 <a href="/help/serve">
1886 serve
1886 serve
1887 </a>
1887 </a>
1888 </td><td>
1888 </td><td>
1889 start stand-alone webserver
1889 start stand-alone webserver
1890 </td></tr>
1890 </td></tr>
1891 <tr><td>
1891 <tr><td>
1892 <a href="/help/status">
1892 <a href="/help/status">
1893 status
1893 status
1894 </a>
1894 </a>
1895 </td><td>
1895 </td><td>
1896 show changed files in the working directory
1896 show changed files in the working directory
1897 </td></tr>
1897 </td></tr>
1898 <tr><td>
1898 <tr><td>
1899 <a href="/help/summary">
1899 <a href="/help/summary">
1900 summary
1900 summary
1901 </a>
1901 </a>
1902 </td><td>
1902 </td><td>
1903 summarize working directory state
1903 summarize working directory state
1904 </td></tr>
1904 </td></tr>
1905 <tr><td>
1905 <tr><td>
1906 <a href="/help/update">
1906 <a href="/help/update">
1907 update
1907 update
1908 </a>
1908 </a>
1909 </td><td>
1909 </td><td>
1910 update working directory (or switch revisions)
1910 update working directory (or switch revisions)
1911 </td></tr>
1911 </td></tr>
1912
1912
1913
1913
1914
1914
1915 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
1915 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
1916
1916
1917 <tr><td>
1917 <tr><td>
1918 <a href="/help/addremove">
1918 <a href="/help/addremove">
1919 addremove
1919 addremove
1920 </a>
1920 </a>
1921 </td><td>
1921 </td><td>
1922 add all new files, delete all missing files
1922 add all new files, delete all missing files
1923 </td></tr>
1923 </td></tr>
1924 <tr><td>
1924 <tr><td>
1925 <a href="/help/archive">
1925 <a href="/help/archive">
1926 archive
1926 archive
1927 </a>
1927 </a>
1928 </td><td>
1928 </td><td>
1929 create an unversioned archive of a repository revision
1929 create an unversioned archive of a repository revision
1930 </td></tr>
1930 </td></tr>
1931 <tr><td>
1931 <tr><td>
1932 <a href="/help/backout">
1932 <a href="/help/backout">
1933 backout
1933 backout
1934 </a>
1934 </a>
1935 </td><td>
1935 </td><td>
1936 reverse effect of earlier changeset
1936 reverse effect of earlier changeset
1937 </td></tr>
1937 </td></tr>
1938 <tr><td>
1938 <tr><td>
1939 <a href="/help/bisect">
1939 <a href="/help/bisect">
1940 bisect
1940 bisect
1941 </a>
1941 </a>
1942 </td><td>
1942 </td><td>
1943 subdivision search of changesets
1943 subdivision search of changesets
1944 </td></tr>
1944 </td></tr>
1945 <tr><td>
1945 <tr><td>
1946 <a href="/help/bookmarks">
1946 <a href="/help/bookmarks">
1947 bookmarks
1947 bookmarks
1948 </a>
1948 </a>
1949 </td><td>
1949 </td><td>
1950 create a new bookmark or list existing bookmarks
1950 create a new bookmark or list existing bookmarks
1951 </td></tr>
1951 </td></tr>
1952 <tr><td>
1952 <tr><td>
1953 <a href="/help/branch">
1953 <a href="/help/branch">
1954 branch
1954 branch
1955 </a>
1955 </a>
1956 </td><td>
1956 </td><td>
1957 set or show the current branch name
1957 set or show the current branch name
1958 </td></tr>
1958 </td></tr>
1959 <tr><td>
1959 <tr><td>
1960 <a href="/help/branches">
1960 <a href="/help/branches">
1961 branches
1961 branches
1962 </a>
1962 </a>
1963 </td><td>
1963 </td><td>
1964 list repository named branches
1964 list repository named branches
1965 </td></tr>
1965 </td></tr>
1966 <tr><td>
1966 <tr><td>
1967 <a href="/help/bundle">
1967 <a href="/help/bundle">
1968 bundle
1968 bundle
1969 </a>
1969 </a>
1970 </td><td>
1970 </td><td>
1971 create a changegroup file
1971 create a changegroup file
1972 </td></tr>
1972 </td></tr>
1973 <tr><td>
1973 <tr><td>
1974 <a href="/help/cat">
1974 <a href="/help/cat">
1975 cat
1975 cat
1976 </a>
1976 </a>
1977 </td><td>
1977 </td><td>
1978 output the current or given revision of files
1978 output the current or given revision of files
1979 </td></tr>
1979 </td></tr>
1980 <tr><td>
1980 <tr><td>
1981 <a href="/help/config">
1981 <a href="/help/config">
1982 config
1982 config
1983 </a>
1983 </a>
1984 </td><td>
1984 </td><td>
1985 show combined config settings from all hgrc files
1985 show combined config settings from all hgrc files
1986 </td></tr>
1986 </td></tr>
1987 <tr><td>
1987 <tr><td>
1988 <a href="/help/copy">
1988 <a href="/help/copy">
1989 copy
1989 copy
1990 </a>
1990 </a>
1991 </td><td>
1991 </td><td>
1992 mark files as copied for the next commit
1992 mark files as copied for the next commit
1993 </td></tr>
1993 </td></tr>
1994 <tr><td>
1994 <tr><td>
1995 <a href="/help/files">
1995 <a href="/help/files">
1996 files
1996 files
1997 </a>
1997 </a>
1998 </td><td>
1998 </td><td>
1999 list tracked files
1999 list tracked files
2000 </td></tr>
2000 </td></tr>
2001 <tr><td>
2001 <tr><td>
2002 <a href="/help/graft">
2002 <a href="/help/graft">
2003 graft
2003 graft
2004 </a>
2004 </a>
2005 </td><td>
2005 </td><td>
2006 copy changes from other branches onto the current branch
2006 copy changes from other branches onto the current branch
2007 </td></tr>
2007 </td></tr>
2008 <tr><td>
2008 <tr><td>
2009 <a href="/help/grep">
2009 <a href="/help/grep">
2010 grep
2010 grep
2011 </a>
2011 </a>
2012 </td><td>
2012 </td><td>
2013 search for a pattern in specified files and revisions
2013 search for a pattern in specified files and revisions
2014 </td></tr>
2014 </td></tr>
2015 <tr><td>
2015 <tr><td>
2016 <a href="/help/heads">
2016 <a href="/help/heads">
2017 heads
2017 heads
2018 </a>
2018 </a>
2019 </td><td>
2019 </td><td>
2020 show branch heads
2020 show branch heads
2021 </td></tr>
2021 </td></tr>
2022 <tr><td>
2022 <tr><td>
2023 <a href="/help/help">
2023 <a href="/help/help">
2024 help
2024 help
2025 </a>
2025 </a>
2026 </td><td>
2026 </td><td>
2027 show help for a given topic or a help overview
2027 show help for a given topic or a help overview
2028 </td></tr>
2028 </td></tr>
2029 <tr><td>
2029 <tr><td>
2030 <a href="/help/identify">
2030 <a href="/help/identify">
2031 identify
2031 identify
2032 </a>
2032 </a>
2033 </td><td>
2033 </td><td>
2034 identify the working directory or specified revision
2034 identify the working directory or specified revision
2035 </td></tr>
2035 </td></tr>
2036 <tr><td>
2036 <tr><td>
2037 <a href="/help/import">
2037 <a href="/help/import">
2038 import
2038 import
2039 </a>
2039 </a>
2040 </td><td>
2040 </td><td>
2041 import an ordered set of patches
2041 import an ordered set of patches
2042 </td></tr>
2042 </td></tr>
2043 <tr><td>
2043 <tr><td>
2044 <a href="/help/incoming">
2044 <a href="/help/incoming">
2045 incoming
2045 incoming
2046 </a>
2046 </a>
2047 </td><td>
2047 </td><td>
2048 show new changesets found in source
2048 show new changesets found in source
2049 </td></tr>
2049 </td></tr>
2050 <tr><td>
2050 <tr><td>
2051 <a href="/help/manifest">
2051 <a href="/help/manifest">
2052 manifest
2052 manifest
2053 </a>
2053 </a>
2054 </td><td>
2054 </td><td>
2055 output the current or given revision of the project manifest
2055 output the current or given revision of the project manifest
2056 </td></tr>
2056 </td></tr>
2057 <tr><td>
2057 <tr><td>
2058 <a href="/help/nohelp">
2058 <a href="/help/nohelp">
2059 nohelp
2059 nohelp
2060 </a>
2060 </a>
2061 </td><td>
2061 </td><td>
2062 (no help text available)
2062 (no help text available)
2063 </td></tr>
2063 </td></tr>
2064 <tr><td>
2064 <tr><td>
2065 <a href="/help/outgoing">
2065 <a href="/help/outgoing">
2066 outgoing
2066 outgoing
2067 </a>
2067 </a>
2068 </td><td>
2068 </td><td>
2069 show changesets not found in the destination
2069 show changesets not found in the destination
2070 </td></tr>
2070 </td></tr>
2071 <tr><td>
2071 <tr><td>
2072 <a href="/help/paths">
2072 <a href="/help/paths">
2073 paths
2073 paths
2074 </a>
2074 </a>
2075 </td><td>
2075 </td><td>
2076 show aliases for remote repositories
2076 show aliases for remote repositories
2077 </td></tr>
2077 </td></tr>
2078 <tr><td>
2078 <tr><td>
2079 <a href="/help/phase">
2079 <a href="/help/phase">
2080 phase
2080 phase
2081 </a>
2081 </a>
2082 </td><td>
2082 </td><td>
2083 set or show the current phase name
2083 set or show the current phase name
2084 </td></tr>
2084 </td></tr>
2085 <tr><td>
2085 <tr><td>
2086 <a href="/help/recover">
2086 <a href="/help/recover">
2087 recover
2087 recover
2088 </a>
2088 </a>
2089 </td><td>
2089 </td><td>
2090 roll back an interrupted transaction
2090 roll back an interrupted transaction
2091 </td></tr>
2091 </td></tr>
2092 <tr><td>
2092 <tr><td>
2093 <a href="/help/rename">
2093 <a href="/help/rename">
2094 rename
2094 rename
2095 </a>
2095 </a>
2096 </td><td>
2096 </td><td>
2097 rename files; equivalent of copy + remove
2097 rename files; equivalent of copy + remove
2098 </td></tr>
2098 </td></tr>
2099 <tr><td>
2099 <tr><td>
2100 <a href="/help/resolve">
2100 <a href="/help/resolve">
2101 resolve
2101 resolve
2102 </a>
2102 </a>
2103 </td><td>
2103 </td><td>
2104 redo merges or set/view the merge status of files
2104 redo merges or set/view the merge status of files
2105 </td></tr>
2105 </td></tr>
2106 <tr><td>
2106 <tr><td>
2107 <a href="/help/revert">
2107 <a href="/help/revert">
2108 revert
2108 revert
2109 </a>
2109 </a>
2110 </td><td>
2110 </td><td>
2111 restore files to their checkout state
2111 restore files to their checkout state
2112 </td></tr>
2112 </td></tr>
2113 <tr><td>
2113 <tr><td>
2114 <a href="/help/root">
2114 <a href="/help/root">
2115 root
2115 root
2116 </a>
2116 </a>
2117 </td><td>
2117 </td><td>
2118 print the root (top) of the current working directory
2118 print the root (top) of the current working directory
2119 </td></tr>
2119 </td></tr>
2120 <tr><td>
2120 <tr><td>
2121 <a href="/help/tag">
2121 <a href="/help/tag">
2122 tag
2122 tag
2123 </a>
2123 </a>
2124 </td><td>
2124 </td><td>
2125 add one or more tags for the current or given revision
2125 add one or more tags for the current or given revision
2126 </td></tr>
2126 </td></tr>
2127 <tr><td>
2127 <tr><td>
2128 <a href="/help/tags">
2128 <a href="/help/tags">
2129 tags
2129 tags
2130 </a>
2130 </a>
2131 </td><td>
2131 </td><td>
2132 list repository tags
2132 list repository tags
2133 </td></tr>
2133 </td></tr>
2134 <tr><td>
2134 <tr><td>
2135 <a href="/help/unbundle">
2135 <a href="/help/unbundle">
2136 unbundle
2136 unbundle
2137 </a>
2137 </a>
2138 </td><td>
2138 </td><td>
2139 apply one or more changegroup files
2139 apply one or more changegroup files
2140 </td></tr>
2140 </td></tr>
2141 <tr><td>
2141 <tr><td>
2142 <a href="/help/verify">
2142 <a href="/help/verify">
2143 verify
2143 verify
2144 </a>
2144 </a>
2145 </td><td>
2145 </td><td>
2146 verify the integrity of the repository
2146 verify the integrity of the repository
2147 </td></tr>
2147 </td></tr>
2148 <tr><td>
2148 <tr><td>
2149 <a href="/help/version">
2149 <a href="/help/version">
2150 version
2150 version
2151 </a>
2151 </a>
2152 </td><td>
2152 </td><td>
2153 output version and copyright information
2153 output version and copyright information
2154 </td></tr>
2154 </td></tr>
2155
2155
2156
2156
2157 </table>
2157 </table>
2158 </div>
2158 </div>
2159 </div>
2159 </div>
2160
2160
2161 <script type="text/javascript">process_dates()</script>
2161 <script type="text/javascript">process_dates()</script>
2162
2162
2163
2163
2164 </body>
2164 </body>
2165 </html>
2165 </html>
2166
2166
2167
2167
2168 $ get-with-headers.py 127.0.0.1:$HGPORT "help/add"
2168 $ get-with-headers.py 127.0.0.1:$HGPORT "help/add"
2169 200 Script output follows
2169 200 Script output follows
2170
2170
2171 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2171 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2172 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2172 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2173 <head>
2173 <head>
2174 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2174 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2175 <meta name="robots" content="index, nofollow" />
2175 <meta name="robots" content="index, nofollow" />
2176 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2176 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2177 <script type="text/javascript" src="/static/mercurial.js"></script>
2177 <script type="text/javascript" src="/static/mercurial.js"></script>
2178
2178
2179 <title>Help: add</title>
2179 <title>Help: add</title>
2180 </head>
2180 </head>
2181 <body>
2181 <body>
2182
2182
2183 <div class="container">
2183 <div class="container">
2184 <div class="menu">
2184 <div class="menu">
2185 <div class="logo">
2185 <div class="logo">
2186 <a href="https://mercurial-scm.org/">
2186 <a href="https://mercurial-scm.org/">
2187 <img src="/static/hglogo.png" alt="mercurial" /></a>
2187 <img src="/static/hglogo.png" alt="mercurial" /></a>
2188 </div>
2188 </div>
2189 <ul>
2189 <ul>
2190 <li><a href="/shortlog">log</a></li>
2190 <li><a href="/shortlog">log</a></li>
2191 <li><a href="/graph">graph</a></li>
2191 <li><a href="/graph">graph</a></li>
2192 <li><a href="/tags">tags</a></li>
2192 <li><a href="/tags">tags</a></li>
2193 <li><a href="/bookmarks">bookmarks</a></li>
2193 <li><a href="/bookmarks">bookmarks</a></li>
2194 <li><a href="/branches">branches</a></li>
2194 <li><a href="/branches">branches</a></li>
2195 </ul>
2195 </ul>
2196 <ul>
2196 <ul>
2197 <li class="active"><a href="/help">help</a></li>
2197 <li class="active"><a href="/help">help</a></li>
2198 </ul>
2198 </ul>
2199 </div>
2199 </div>
2200
2200
2201 <div class="main">
2201 <div class="main">
2202 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2202 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2203 <h3>Help: add</h3>
2203 <h3>Help: add</h3>
2204
2204
2205 <form class="search" action="/log">
2205 <form class="search" action="/log">
2206
2206
2207 <p><input name="rev" id="search1" type="text" size="30" /></p>
2207 <p><input name="rev" id="search1" type="text" size="30" /></p>
2208 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2208 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2209 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2209 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2210 </form>
2210 </form>
2211 <div id="doc">
2211 <div id="doc">
2212 <p>
2212 <p>
2213 hg add [OPTION]... [FILE]...
2213 hg add [OPTION]... [FILE]...
2214 </p>
2214 </p>
2215 <p>
2215 <p>
2216 add the specified files on the next commit
2216 add the specified files on the next commit
2217 </p>
2217 </p>
2218 <p>
2218 <p>
2219 Schedule files to be version controlled and added to the
2219 Schedule files to be version controlled and added to the
2220 repository.
2220 repository.
2221 </p>
2221 </p>
2222 <p>
2222 <p>
2223 The files will be added to the repository at the next commit. To
2223 The files will be added to the repository at the next commit. To
2224 undo an add before that, see &quot;hg forget&quot;.
2224 undo an add before that, see &quot;hg forget&quot;.
2225 </p>
2225 </p>
2226 <p>
2226 <p>
2227 If no names are given, add all files to the repository (except
2227 If no names are given, add all files to the repository (except
2228 files matching &quot;.hgignore&quot;).
2228 files matching &quot;.hgignore&quot;).
2229 </p>
2229 </p>
2230 <p>
2230 <p>
2231 Examples:
2231 Examples:
2232 </p>
2232 </p>
2233 <ul>
2233 <ul>
2234 <li> New (unknown) files are added automatically by &quot;hg add&quot;:
2234 <li> New (unknown) files are added automatically by &quot;hg add&quot;:
2235 <pre>
2235 <pre>
2236 \$ ls (re)
2236 \$ ls (re)
2237 foo.c
2237 foo.c
2238 \$ hg status (re)
2238 \$ hg status (re)
2239 ? foo.c
2239 ? foo.c
2240 \$ hg add (re)
2240 \$ hg add (re)
2241 adding foo.c
2241 adding foo.c
2242 \$ hg status (re)
2242 \$ hg status (re)
2243 A foo.c
2243 A foo.c
2244 </pre>
2244 </pre>
2245 <li> Specific files to be added can be specified:
2245 <li> Specific files to be added can be specified:
2246 <pre>
2246 <pre>
2247 \$ ls (re)
2247 \$ ls (re)
2248 bar.c foo.c
2248 bar.c foo.c
2249 \$ hg status (re)
2249 \$ hg status (re)
2250 ? bar.c
2250 ? bar.c
2251 ? foo.c
2251 ? foo.c
2252 \$ hg add bar.c (re)
2252 \$ hg add bar.c (re)
2253 \$ hg status (re)
2253 \$ hg status (re)
2254 A bar.c
2254 A bar.c
2255 ? foo.c
2255 ? foo.c
2256 </pre>
2256 </pre>
2257 </ul>
2257 </ul>
2258 <p>
2258 <p>
2259 Returns 0 if all files are successfully added.
2259 Returns 0 if all files are successfully added.
2260 </p>
2260 </p>
2261 <p>
2261 <p>
2262 options ([+] can be repeated):
2262 options ([+] can be repeated):
2263 </p>
2263 </p>
2264 <table>
2264 <table>
2265 <tr><td>-I</td>
2265 <tr><td>-I</td>
2266 <td>--include PATTERN [+]</td>
2266 <td>--include PATTERN [+]</td>
2267 <td>include names matching the given patterns</td></tr>
2267 <td>include names matching the given patterns</td></tr>
2268 <tr><td>-X</td>
2268 <tr><td>-X</td>
2269 <td>--exclude PATTERN [+]</td>
2269 <td>--exclude PATTERN [+]</td>
2270 <td>exclude names matching the given patterns</td></tr>
2270 <td>exclude names matching the given patterns</td></tr>
2271 <tr><td>-S</td>
2271 <tr><td>-S</td>
2272 <td>--subrepos</td>
2272 <td>--subrepos</td>
2273 <td>recurse into subrepositories</td></tr>
2273 <td>recurse into subrepositories</td></tr>
2274 <tr><td>-n</td>
2274 <tr><td>-n</td>
2275 <td>--dry-run</td>
2275 <td>--dry-run</td>
2276 <td>do not perform actions, just print output</td></tr>
2276 <td>do not perform actions, just print output</td></tr>
2277 </table>
2277 </table>
2278 <p>
2278 <p>
2279 global options ([+] can be repeated):
2279 global options ([+] can be repeated):
2280 </p>
2280 </p>
2281 <table>
2281 <table>
2282 <tr><td>-R</td>
2282 <tr><td>-R</td>
2283 <td>--repository REPO</td>
2283 <td>--repository REPO</td>
2284 <td>repository root directory or name of overlay bundle file</td></tr>
2284 <td>repository root directory or name of overlay bundle file</td></tr>
2285 <tr><td></td>
2285 <tr><td></td>
2286 <td>--cwd DIR</td>
2286 <td>--cwd DIR</td>
2287 <td>change working directory</td></tr>
2287 <td>change working directory</td></tr>
2288 <tr><td>-y</td>
2288 <tr><td>-y</td>
2289 <td>--noninteractive</td>
2289 <td>--noninteractive</td>
2290 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2290 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2291 <tr><td>-q</td>
2291 <tr><td>-q</td>
2292 <td>--quiet</td>
2292 <td>--quiet</td>
2293 <td>suppress output</td></tr>
2293 <td>suppress output</td></tr>
2294 <tr><td>-v</td>
2294 <tr><td>-v</td>
2295 <td>--verbose</td>
2295 <td>--verbose</td>
2296 <td>enable additional output</td></tr>
2296 <td>enable additional output</td></tr>
2297 <tr><td></td>
2297 <tr><td></td>
2298 <td>--config CONFIG [+]</td>
2298 <td>--config CONFIG [+]</td>
2299 <td>set/override config option (use 'section.name=value')</td></tr>
2299 <td>set/override config option (use 'section.name=value')</td></tr>
2300 <tr><td></td>
2300 <tr><td></td>
2301 <td>--debug</td>
2301 <td>--debug</td>
2302 <td>enable debugging output</td></tr>
2302 <td>enable debugging output</td></tr>
2303 <tr><td></td>
2303 <tr><td></td>
2304 <td>--debugger</td>
2304 <td>--debugger</td>
2305 <td>start debugger</td></tr>
2305 <td>start debugger</td></tr>
2306 <tr><td></td>
2306 <tr><td></td>
2307 <td>--encoding ENCODE</td>
2307 <td>--encoding ENCODE</td>
2308 <td>set the charset encoding (default: ascii)</td></tr>
2308 <td>set the charset encoding (default: ascii)</td></tr>
2309 <tr><td></td>
2309 <tr><td></td>
2310 <td>--encodingmode MODE</td>
2310 <td>--encodingmode MODE</td>
2311 <td>set the charset encoding mode (default: strict)</td></tr>
2311 <td>set the charset encoding mode (default: strict)</td></tr>
2312 <tr><td></td>
2312 <tr><td></td>
2313 <td>--traceback</td>
2313 <td>--traceback</td>
2314 <td>always print a traceback on exception</td></tr>
2314 <td>always print a traceback on exception</td></tr>
2315 <tr><td></td>
2315 <tr><td></td>
2316 <td>--time</td>
2316 <td>--time</td>
2317 <td>time how long the command takes</td></tr>
2317 <td>time how long the command takes</td></tr>
2318 <tr><td></td>
2318 <tr><td></td>
2319 <td>--profile</td>
2319 <td>--profile</td>
2320 <td>print command execution profile</td></tr>
2320 <td>print command execution profile</td></tr>
2321 <tr><td></td>
2321 <tr><td></td>
2322 <td>--version</td>
2322 <td>--version</td>
2323 <td>output version information and exit</td></tr>
2323 <td>output version information and exit</td></tr>
2324 <tr><td>-h</td>
2324 <tr><td>-h</td>
2325 <td>--help</td>
2325 <td>--help</td>
2326 <td>display help and exit</td></tr>
2326 <td>display help and exit</td></tr>
2327 <tr><td></td>
2327 <tr><td></td>
2328 <td>--hidden</td>
2328 <td>--hidden</td>
2329 <td>consider hidden changesets</td></tr>
2329 <td>consider hidden changesets</td></tr>
2330 </table>
2330 </table>
2331
2331
2332 </div>
2332 </div>
2333 </div>
2333 </div>
2334 </div>
2334 </div>
2335
2335
2336 <script type="text/javascript">process_dates()</script>
2336 <script type="text/javascript">process_dates()</script>
2337
2337
2338
2338
2339 </body>
2339 </body>
2340 </html>
2340 </html>
2341
2341
2342
2342
2343 $ get-with-headers.py 127.0.0.1:$HGPORT "help/remove"
2343 $ get-with-headers.py 127.0.0.1:$HGPORT "help/remove"
2344 200 Script output follows
2344 200 Script output follows
2345
2345
2346 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2346 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2347 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2347 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2348 <head>
2348 <head>
2349 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2349 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2350 <meta name="robots" content="index, nofollow" />
2350 <meta name="robots" content="index, nofollow" />
2351 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2351 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2352 <script type="text/javascript" src="/static/mercurial.js"></script>
2352 <script type="text/javascript" src="/static/mercurial.js"></script>
2353
2353
2354 <title>Help: remove</title>
2354 <title>Help: remove</title>
2355 </head>
2355 </head>
2356 <body>
2356 <body>
2357
2357
2358 <div class="container">
2358 <div class="container">
2359 <div class="menu">
2359 <div class="menu">
2360 <div class="logo">
2360 <div class="logo">
2361 <a href="https://mercurial-scm.org/">
2361 <a href="https://mercurial-scm.org/">
2362 <img src="/static/hglogo.png" alt="mercurial" /></a>
2362 <img src="/static/hglogo.png" alt="mercurial" /></a>
2363 </div>
2363 </div>
2364 <ul>
2364 <ul>
2365 <li><a href="/shortlog">log</a></li>
2365 <li><a href="/shortlog">log</a></li>
2366 <li><a href="/graph">graph</a></li>
2366 <li><a href="/graph">graph</a></li>
2367 <li><a href="/tags">tags</a></li>
2367 <li><a href="/tags">tags</a></li>
2368 <li><a href="/bookmarks">bookmarks</a></li>
2368 <li><a href="/bookmarks">bookmarks</a></li>
2369 <li><a href="/branches">branches</a></li>
2369 <li><a href="/branches">branches</a></li>
2370 </ul>
2370 </ul>
2371 <ul>
2371 <ul>
2372 <li class="active"><a href="/help">help</a></li>
2372 <li class="active"><a href="/help">help</a></li>
2373 </ul>
2373 </ul>
2374 </div>
2374 </div>
2375
2375
2376 <div class="main">
2376 <div class="main">
2377 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2377 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2378 <h3>Help: remove</h3>
2378 <h3>Help: remove</h3>
2379
2379
2380 <form class="search" action="/log">
2380 <form class="search" action="/log">
2381
2381
2382 <p><input name="rev" id="search1" type="text" size="30" /></p>
2382 <p><input name="rev" id="search1" type="text" size="30" /></p>
2383 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2383 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2384 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2384 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2385 </form>
2385 </form>
2386 <div id="doc">
2386 <div id="doc">
2387 <p>
2387 <p>
2388 hg remove [OPTION]... FILE...
2388 hg remove [OPTION]... FILE...
2389 </p>
2389 </p>
2390 <p>
2390 <p>
2391 aliases: rm
2391 aliases: rm
2392 </p>
2392 </p>
2393 <p>
2393 <p>
2394 remove the specified files on the next commit
2394 remove the specified files on the next commit
2395 </p>
2395 </p>
2396 <p>
2396 <p>
2397 Schedule the indicated files for removal from the current branch.
2397 Schedule the indicated files for removal from the current branch.
2398 </p>
2398 </p>
2399 <p>
2399 <p>
2400 This command schedules the files to be removed at the next commit.
2400 This command schedules the files to be removed at the next commit.
2401 To undo a remove before that, see &quot;hg revert&quot;. To undo added
2401 To undo a remove before that, see &quot;hg revert&quot;. To undo added
2402 files, see &quot;hg forget&quot;.
2402 files, see &quot;hg forget&quot;.
2403 </p>
2403 </p>
2404 <p>
2404 <p>
2405 -A/--after can be used to remove only files that have already
2405 -A/--after can be used to remove only files that have already
2406 been deleted, -f/--force can be used to force deletion, and -Af
2406 been deleted, -f/--force can be used to force deletion, and -Af
2407 can be used to remove files from the next revision without
2407 can be used to remove files from the next revision without
2408 deleting them from the working directory.
2408 deleting them from the working directory.
2409 </p>
2409 </p>
2410 <p>
2410 <p>
2411 The following table details the behavior of remove for different
2411 The following table details the behavior of remove for different
2412 file states (columns) and option combinations (rows). The file
2412 file states (columns) and option combinations (rows). The file
2413 states are Added [A], Clean [C], Modified [M] and Missing [!]
2413 states are Added [A], Clean [C], Modified [M] and Missing [!]
2414 (as reported by &quot;hg status&quot;). The actions are Warn, Remove
2414 (as reported by &quot;hg status&quot;). The actions are Warn, Remove
2415 (from branch) and Delete (from disk):
2415 (from branch) and Delete (from disk):
2416 </p>
2416 </p>
2417 <table>
2417 <table>
2418 <tr><td>opt/state</td>
2418 <tr><td>opt/state</td>
2419 <td>A</td>
2419 <td>A</td>
2420 <td>C</td>
2420 <td>C</td>
2421 <td>M</td>
2421 <td>M</td>
2422 <td>!</td></tr>
2422 <td>!</td></tr>
2423 <tr><td>none</td>
2423 <tr><td>none</td>
2424 <td>W</td>
2424 <td>W</td>
2425 <td>RD</td>
2425 <td>RD</td>
2426 <td>W</td>
2426 <td>W</td>
2427 <td>R</td></tr>
2427 <td>R</td></tr>
2428 <tr><td>-f</td>
2428 <tr><td>-f</td>
2429 <td>R</td>
2429 <td>R</td>
2430 <td>RD</td>
2430 <td>RD</td>
2431 <td>RD</td>
2431 <td>RD</td>
2432 <td>R</td></tr>
2432 <td>R</td></tr>
2433 <tr><td>-A</td>
2433 <tr><td>-A</td>
2434 <td>W</td>
2434 <td>W</td>
2435 <td>W</td>
2435 <td>W</td>
2436 <td>W</td>
2436 <td>W</td>
2437 <td>R</td></tr>
2437 <td>R</td></tr>
2438 <tr><td>-Af</td>
2438 <tr><td>-Af</td>
2439 <td>R</td>
2439 <td>R</td>
2440 <td>R</td>
2440 <td>R</td>
2441 <td>R</td>
2441 <td>R</td>
2442 <td>R</td></tr>
2442 <td>R</td></tr>
2443 </table>
2443 </table>
2444 <p>
2444 <p>
2445 <b>Note:</b>
2445 <b>Note:</b>
2446 </p>
2446 </p>
2447 <p>
2447 <p>
2448 &quot;hg remove&quot; never deletes files in Added [A] state from the
2448 &quot;hg remove&quot; never deletes files in Added [A] state from the
2449 working directory, not even if &quot;--force&quot; is specified.
2449 working directory, not even if &quot;--force&quot; is specified.
2450 </p>
2450 </p>
2451 <p>
2451 <p>
2452 Returns 0 on success, 1 if any warnings encountered.
2452 Returns 0 on success, 1 if any warnings encountered.
2453 </p>
2453 </p>
2454 <p>
2454 <p>
2455 options ([+] can be repeated):
2455 options ([+] can be repeated):
2456 </p>
2456 </p>
2457 <table>
2457 <table>
2458 <tr><td>-A</td>
2458 <tr><td>-A</td>
2459 <td>--after</td>
2459 <td>--after</td>
2460 <td>record delete for missing files</td></tr>
2460 <td>record delete for missing files</td></tr>
2461 <tr><td>-f</td>
2461 <tr><td>-f</td>
2462 <td>--force</td>
2462 <td>--force</td>
2463 <td>remove (and delete) file even if added or modified</td></tr>
2463 <td>remove (and delete) file even if added or modified</td></tr>
2464 <tr><td>-S</td>
2464 <tr><td>-S</td>
2465 <td>--subrepos</td>
2465 <td>--subrepos</td>
2466 <td>recurse into subrepositories</td></tr>
2466 <td>recurse into subrepositories</td></tr>
2467 <tr><td>-I</td>
2467 <tr><td>-I</td>
2468 <td>--include PATTERN [+]</td>
2468 <td>--include PATTERN [+]</td>
2469 <td>include names matching the given patterns</td></tr>
2469 <td>include names matching the given patterns</td></tr>
2470 <tr><td>-X</td>
2470 <tr><td>-X</td>
2471 <td>--exclude PATTERN [+]</td>
2471 <td>--exclude PATTERN [+]</td>
2472 <td>exclude names matching the given patterns</td></tr>
2472 <td>exclude names matching the given patterns</td></tr>
2473 </table>
2473 </table>
2474 <p>
2474 <p>
2475 global options ([+] can be repeated):
2475 global options ([+] can be repeated):
2476 </p>
2476 </p>
2477 <table>
2477 <table>
2478 <tr><td>-R</td>
2478 <tr><td>-R</td>
2479 <td>--repository REPO</td>
2479 <td>--repository REPO</td>
2480 <td>repository root directory or name of overlay bundle file</td></tr>
2480 <td>repository root directory or name of overlay bundle file</td></tr>
2481 <tr><td></td>
2481 <tr><td></td>
2482 <td>--cwd DIR</td>
2482 <td>--cwd DIR</td>
2483 <td>change working directory</td></tr>
2483 <td>change working directory</td></tr>
2484 <tr><td>-y</td>
2484 <tr><td>-y</td>
2485 <td>--noninteractive</td>
2485 <td>--noninteractive</td>
2486 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2486 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2487 <tr><td>-q</td>
2487 <tr><td>-q</td>
2488 <td>--quiet</td>
2488 <td>--quiet</td>
2489 <td>suppress output</td></tr>
2489 <td>suppress output</td></tr>
2490 <tr><td>-v</td>
2490 <tr><td>-v</td>
2491 <td>--verbose</td>
2491 <td>--verbose</td>
2492 <td>enable additional output</td></tr>
2492 <td>enable additional output</td></tr>
2493 <tr><td></td>
2493 <tr><td></td>
2494 <td>--config CONFIG [+]</td>
2494 <td>--config CONFIG [+]</td>
2495 <td>set/override config option (use 'section.name=value')</td></tr>
2495 <td>set/override config option (use 'section.name=value')</td></tr>
2496 <tr><td></td>
2496 <tr><td></td>
2497 <td>--debug</td>
2497 <td>--debug</td>
2498 <td>enable debugging output</td></tr>
2498 <td>enable debugging output</td></tr>
2499 <tr><td></td>
2499 <tr><td></td>
2500 <td>--debugger</td>
2500 <td>--debugger</td>
2501 <td>start debugger</td></tr>
2501 <td>start debugger</td></tr>
2502 <tr><td></td>
2502 <tr><td></td>
2503 <td>--encoding ENCODE</td>
2503 <td>--encoding ENCODE</td>
2504 <td>set the charset encoding (default: ascii)</td></tr>
2504 <td>set the charset encoding (default: ascii)</td></tr>
2505 <tr><td></td>
2505 <tr><td></td>
2506 <td>--encodingmode MODE</td>
2506 <td>--encodingmode MODE</td>
2507 <td>set the charset encoding mode (default: strict)</td></tr>
2507 <td>set the charset encoding mode (default: strict)</td></tr>
2508 <tr><td></td>
2508 <tr><td></td>
2509 <td>--traceback</td>
2509 <td>--traceback</td>
2510 <td>always print a traceback on exception</td></tr>
2510 <td>always print a traceback on exception</td></tr>
2511 <tr><td></td>
2511 <tr><td></td>
2512 <td>--time</td>
2512 <td>--time</td>
2513 <td>time how long the command takes</td></tr>
2513 <td>time how long the command takes</td></tr>
2514 <tr><td></td>
2514 <tr><td></td>
2515 <td>--profile</td>
2515 <td>--profile</td>
2516 <td>print command execution profile</td></tr>
2516 <td>print command execution profile</td></tr>
2517 <tr><td></td>
2517 <tr><td></td>
2518 <td>--version</td>
2518 <td>--version</td>
2519 <td>output version information and exit</td></tr>
2519 <td>output version information and exit</td></tr>
2520 <tr><td>-h</td>
2520 <tr><td>-h</td>
2521 <td>--help</td>
2521 <td>--help</td>
2522 <td>display help and exit</td></tr>
2522 <td>display help and exit</td></tr>
2523 <tr><td></td>
2523 <tr><td></td>
2524 <td>--hidden</td>
2524 <td>--hidden</td>
2525 <td>consider hidden changesets</td></tr>
2525 <td>consider hidden changesets</td></tr>
2526 </table>
2526 </table>
2527
2527
2528 </div>
2528 </div>
2529 </div>
2529 </div>
2530 </div>
2530 </div>
2531
2531
2532 <script type="text/javascript">process_dates()</script>
2532 <script type="text/javascript">process_dates()</script>
2533
2533
2534
2534
2535 </body>
2535 </body>
2536 </html>
2536 </html>
2537
2537
2538
2538
2539 $ get-with-headers.py 127.0.0.1:$HGPORT "help/revisions"
2539 $ get-with-headers.py 127.0.0.1:$HGPORT "help/revisions"
2540 200 Script output follows
2540 200 Script output follows
2541
2541
2542 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2542 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2543 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2543 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2544 <head>
2544 <head>
2545 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2545 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2546 <meta name="robots" content="index, nofollow" />
2546 <meta name="robots" content="index, nofollow" />
2547 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2547 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2548 <script type="text/javascript" src="/static/mercurial.js"></script>
2548 <script type="text/javascript" src="/static/mercurial.js"></script>
2549
2549
2550 <title>Help: revisions</title>
2550 <title>Help: revisions</title>
2551 </head>
2551 </head>
2552 <body>
2552 <body>
2553
2553
2554 <div class="container">
2554 <div class="container">
2555 <div class="menu">
2555 <div class="menu">
2556 <div class="logo">
2556 <div class="logo">
2557 <a href="https://mercurial-scm.org/">
2557 <a href="https://mercurial-scm.org/">
2558 <img src="/static/hglogo.png" alt="mercurial" /></a>
2558 <img src="/static/hglogo.png" alt="mercurial" /></a>
2559 </div>
2559 </div>
2560 <ul>
2560 <ul>
2561 <li><a href="/shortlog">log</a></li>
2561 <li><a href="/shortlog">log</a></li>
2562 <li><a href="/graph">graph</a></li>
2562 <li><a href="/graph">graph</a></li>
2563 <li><a href="/tags">tags</a></li>
2563 <li><a href="/tags">tags</a></li>
2564 <li><a href="/bookmarks">bookmarks</a></li>
2564 <li><a href="/bookmarks">bookmarks</a></li>
2565 <li><a href="/branches">branches</a></li>
2565 <li><a href="/branches">branches</a></li>
2566 </ul>
2566 </ul>
2567 <ul>
2567 <ul>
2568 <li class="active"><a href="/help">help</a></li>
2568 <li class="active"><a href="/help">help</a></li>
2569 </ul>
2569 </ul>
2570 </div>
2570 </div>
2571
2571
2572 <div class="main">
2572 <div class="main">
2573 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2573 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2574 <h3>Help: revisions</h3>
2574 <h3>Help: revisions</h3>
2575
2575
2576 <form class="search" action="/log">
2576 <form class="search" action="/log">
2577
2577
2578 <p><input name="rev" id="search1" type="text" size="30" /></p>
2578 <p><input name="rev" id="search1" type="text" size="30" /></p>
2579 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2579 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2580 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2580 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2581 </form>
2581 </form>
2582 <div id="doc">
2582 <div id="doc">
2583 <h1>Specifying Single Revisions</h1>
2583 <h1>Specifying Single Revisions</h1>
2584 <p>
2584 <p>
2585 Mercurial supports several ways to specify individual revisions.
2585 Mercurial supports several ways to specify individual revisions.
2586 </p>
2586 </p>
2587 <p>
2587 <p>
2588 A plain integer is treated as a revision number. Negative integers are
2588 A plain integer is treated as a revision number. Negative integers are
2589 treated as sequential offsets from the tip, with -1 denoting the tip,
2589 treated as sequential offsets from the tip, with -1 denoting the tip,
2590 -2 denoting the revision prior to the tip, and so forth.
2590 -2 denoting the revision prior to the tip, and so forth.
2591 </p>
2591 </p>
2592 <p>
2592 <p>
2593 A 40-digit hexadecimal string is treated as a unique revision
2593 A 40-digit hexadecimal string is treated as a unique revision
2594 identifier.
2594 identifier.
2595 </p>
2595 </p>
2596 <p>
2596 <p>
2597 A hexadecimal string less than 40 characters long is treated as a
2597 A hexadecimal string less than 40 characters long is treated as a
2598 unique revision identifier and is referred to as a short-form
2598 unique revision identifier and is referred to as a short-form
2599 identifier. A short-form identifier is only valid if it is the prefix
2599 identifier. A short-form identifier is only valid if it is the prefix
2600 of exactly one full-length identifier.
2600 of exactly one full-length identifier.
2601 </p>
2601 </p>
2602 <p>
2602 <p>
2603 Any other string is treated as a bookmark, tag, or branch name. A
2603 Any other string is treated as a bookmark, tag, or branch name. A
2604 bookmark is a movable pointer to a revision. A tag is a permanent name
2604 bookmark is a movable pointer to a revision. A tag is a permanent name
2605 associated with a revision. A branch name denotes the tipmost open branch head
2605 associated with a revision. A branch name denotes the tipmost open branch head
2606 of that branch - or if they are all closed, the tipmost closed head of the
2606 of that branch - or if they are all closed, the tipmost closed head of the
2607 branch. Bookmark, tag, and branch names must not contain the &quot;:&quot; character.
2607 branch. Bookmark, tag, and branch names must not contain the &quot;:&quot; character.
2608 </p>
2608 </p>
2609 <p>
2609 <p>
2610 The reserved name &quot;tip&quot; always identifies the most recent revision.
2610 The reserved name &quot;tip&quot; always identifies the most recent revision.
2611 </p>
2611 </p>
2612 <p>
2612 <p>
2613 The reserved name &quot;null&quot; indicates the null revision. This is the
2613 The reserved name &quot;null&quot; indicates the null revision. This is the
2614 revision of an empty repository, and the parent of revision 0.
2614 revision of an empty repository, and the parent of revision 0.
2615 </p>
2615 </p>
2616 <p>
2616 <p>
2617 The reserved name &quot;.&quot; indicates the working directory parent. If no
2617 The reserved name &quot;.&quot; indicates the working directory parent. If no
2618 working directory is checked out, it is equivalent to null. If an
2618 working directory is checked out, it is equivalent to null. If an
2619 uncommitted merge is in progress, &quot;.&quot; is the revision of the first
2619 uncommitted merge is in progress, &quot;.&quot; is the revision of the first
2620 parent.
2620 parent.
2621 </p>
2621 </p>
2622
2622
2623 </div>
2623 </div>
2624 </div>
2624 </div>
2625 </div>
2625 </div>
2626
2626
2627 <script type="text/javascript">process_dates()</script>
2627 <script type="text/javascript">process_dates()</script>
2628
2628
2629
2629
2630 </body>
2630 </body>
2631 </html>
2631 </html>
2632
2632
2633
2633
2634 Sub-topic indexes rendered properly
2635
2636 $ get-with-headers.py 127.0.0.1:$HGPORT "help/internals"
2637 200 Script output follows
2638
2639 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2640 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2641 <head>
2642 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2643 <meta name="robots" content="index, nofollow" />
2644 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2645 <script type="text/javascript" src="/static/mercurial.js"></script>
2646
2647 <title>Help: internals</title>
2648 </head>
2649 <body>
2650
2651 <div class="container">
2652 <div class="menu">
2653 <div class="logo">
2654 <a href="https://mercurial-scm.org/">
2655 <img src="/static/hglogo.png" alt="mercurial" /></a>
2656 </div>
2657 <ul>
2658 <li><a href="/shortlog">log</a></li>
2659 <li><a href="/graph">graph</a></li>
2660 <li><a href="/tags">tags</a></li>
2661 <li><a href="/bookmarks">bookmarks</a></li>
2662 <li><a href="/branches">branches</a></li>
2663 </ul>
2664 <ul>
2665 <li><a href="/help">help</a></li>
2666 </ul>
2667 </div>
2668
2669 <div class="main">
2670 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2671 <form class="search" action="/log">
2672
2673 <p><input name="rev" id="search1" type="text" size="30" /></p>
2674 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2675 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2676 </form>
2677 <table class="bigtable">
2678 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
2679
2680 <tr><td>
2681 <a href="/help/internals.bundles">
2682 bundles
2683 </a>
2684 </td><td>
2685 container for exchange of repository data
2686 </td></tr>
2687 <tr><td>
2688 <a href="/help/internals.changegroups">
2689 changegroups
2690 </a>
2691 </td><td>
2692 representation of revlog data
2693 </td></tr>
2694
2695
2696
2697
2698
2699 </table>
2700 </div>
2701 </div>
2702
2703 <script type="text/javascript">process_dates()</script>
2704
2705
2706 </body>
2707 </html>
2708
2709
2634 $ killdaemons.py
2710 $ killdaemons.py
2635
2711
2636 #endif
2712 #endif
General Comments 0
You need to be logged in to leave comments. Login now