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