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