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