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