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