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