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