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