##// END OF EJS Templates
help: adding a topic on flags...
Rodrigo Damazio Bovendorp -
r35036:b0262b25 default
parent child Browse files
Show More
@@ -0,0 +1,104 b''
1 Most Mercurial commands accept various flags.
2
3 Flag names
4 ==========
5
6 Flags for each command are listed in :hg:`help` for that command.
7 Additionally, some flags, such as --repository, are global and can be used with
8 any command - those are seen in :hg:`help -v`, and can be specified before or
9 after the command.
10
11 Every flag has at least a long name, such as --repository. Some flags may also
12 have a short one-letter name, such as the equivalent -R. Using the short or long
13 name is equivalent and has the same effect.
14
15 Flags that have a short name can also be bundled together - for instance, to
16 specify both --edit (short -e) and --interactive (short -i), one could use::
17
18 hg commit -ei
19
20 If any of the bundled flags takes a value (i.e. is not a boolean), it must be
21 last, followed by the value::
22
23 hg commit -im 'Message'
24
25 Flag types
26 ==========
27
28 Mercurial command-line flags can be strings, numbers, booleans, or lists of
29 strings.
30
31 Specifying flag values
32 ======================
33
34 The following syntaxes are allowed, assuming a flag 'flagname' with short name
35 'f'::
36
37 --flagname=foo
38 --flagname foo
39 -f foo
40 -ffoo
41
42 This syntax applies to all non-boolean flags (strings, numbers or lists).
43
44 Specifying boolean flags
45 ========================
46
47 Boolean flags do not take a value parameter. To specify a boolean, use the flag
48 name to set it to true, or the same name prefixed with 'no-' to set it to
49 false::
50
51 hg commit --interactive
52 hg commit --no-interactive
53
54 Specifying list flags
55 =====================
56
57 List flags take multiple values. To specify them, pass the flag multiple times::
58
59 hg files --include mercurial --include tests
60
61 Setting flag defaults
62 =====================
63
64 In order to set a default value for a flag in an hgrc file, it is recommended to
65 use aliases::
66
67 [alias]
68 commit = commit --interactive
69
70 For more information on hgrc files, see :hg:`help config`.
71
72 Overriding flags on the command line
73 ====================================
74
75 If the same non-list flag is specified multiple times on the command line, the
76 latest specification is used::
77
78 hg commit -m "Ignored value" -m "Used value"
79
80 This includes the use of aliases - e.g., if one has::
81
82 [alias]
83 committemp = commit -m "Ignored value"
84
85 then the following command will override that -m::
86
87 hg committemp -m "Used value"
88
89 Overriding flag defaults
90 ========================
91
92 Every flag has a default value, and you may also set your own defaults in hgrc
93 as described above.
94 Except for list flags, defaults can be overridden on the command line simply by
95 specifying the flag in that location.
96
97 Hidden flags
98 ============
99
100 Some flags are not shown in a command's help by default - specifically, those
101 that are deemed to be experimental, deprecated or advanced. To show all flags,
102 add the --verbose flag for the help command::
103
104 hg help --verbose commit
@@ -1,56 +1,57 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="bundlespec.txt" />
18 <File Name="bundlespec.txt" />
19 <File Name="color.txt" />
19 <File Name="color.txt" />
20 <File Name="config.txt" KeyPath="yes" />
20 <File Name="config.txt" KeyPath="yes" />
21 <File Name="dates.txt" />
21 <File Name="dates.txt" />
22 <File Name="diffs.txt" />
22 <File Name="diffs.txt" />
23 <File Name="environment.txt" />
23 <File Name="environment.txt" />
24 <File Name="extensions.txt" />
24 <File Name="extensions.txt" />
25 <File Name="filesets.txt" />
25 <File Name="filesets.txt" />
26 <File Name="flags.txt" />
26 <File Name="glossary.txt" />
27 <File Name="glossary.txt" />
27 <File Name="hgignore.txt" />
28 <File Name="hgignore.txt" />
28 <File Name="hgweb.txt" />
29 <File Name="hgweb.txt" />
29 <File Name="merge-tools.txt" />
30 <File Name="merge-tools.txt" />
30 <File Name="pager.txt" />
31 <File Name="pager.txt" />
31 <File Name="patterns.txt" />
32 <File Name="patterns.txt" />
32 <File Name="phases.txt" />
33 <File Name="phases.txt" />
33 <File Name="revisions.txt" />
34 <File Name="revisions.txt" />
34 <File Name="scripting.txt" />
35 <File Name="scripting.txt" />
35 <File Name="subrepos.txt" />
36 <File Name="subrepos.txt" />
36 <File Name="templates.txt" />
37 <File Name="templates.txt" />
37 <File Name="urls.txt" />
38 <File Name="urls.txt" />
38 </Component>
39 </Component>
39
40
40 <Directory Id="help.internaldir" Name="internals">
41 <Directory Id="help.internaldir" Name="internals">
41 <Component Id="help.internals" Guid="$(var.help.internals.guid)" Win64='$(var.IsX64)'>
42 <Component Id="help.internals" Guid="$(var.help.internals.guid)" Win64='$(var.IsX64)'>
42 <File Id="internals.bundles.txt" Name="bundles.txt" KeyPath="yes" />
43 <File Id="internals.bundles.txt" Name="bundles.txt" KeyPath="yes" />
43 <File Id="internals.censor.txt" Name="censor.txt" />
44 <File Id="internals.censor.txt" Name="censor.txt" />
44 <File Id="internals.changegroups.txt" Name="changegroups.txt" />
45 <File Id="internals.changegroups.txt" Name="changegroups.txt" />
45 <File Id="internals.config.txt" Name="config.txt" />
46 <File Id="internals.config.txt" Name="config.txt" />
46 <File Id="internals.requirements.txt" Name="requirements.txt" />
47 <File Id="internals.requirements.txt" Name="requirements.txt" />
47 <File Id="internals.revlogs.txt" Name="revlogs.txt" />
48 <File Id="internals.revlogs.txt" Name="revlogs.txt" />
48 <File Id="internals.wireprotocol.txt" Name="wireprotocol.txt" />
49 <File Id="internals.wireprotocol.txt" Name="wireprotocol.txt" />
49 </Component>
50 </Component>
50 </Directory>
51 </Directory>
51
52
52 </Directory>
53 </Directory>
53 </DirectoryRef>
54 </DirectoryRef>
54 </Fragment>
55 </Fragment>
55
56
56 </Wix>
57 </Wix>
@@ -1,678 +1,679 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 pycompat,
26 pycompat,
27 revset,
27 revset,
28 templatefilters,
28 templatefilters,
29 templatekw,
29 templatekw,
30 templater,
30 templater,
31 util,
31 util,
32 )
32 )
33 from .hgweb import (
33 from .hgweb import (
34 webcommands,
34 webcommands,
35 )
35 )
36
36
37 _exclkeywords = {
37 _exclkeywords = {
38 "(ADVANCED)",
38 "(ADVANCED)",
39 "(DEPRECATED)",
39 "(DEPRECATED)",
40 "(EXPERIMENTAL)",
40 "(EXPERIMENTAL)",
41 # i18n: "(ADVANCED)" is a keyword, must be translated consistently
41 # i18n: "(ADVANCED)" is a keyword, must be translated consistently
42 _("(ADVANCED)"),
42 _("(ADVANCED)"),
43 # i18n: "(DEPRECATED)" is a keyword, must be translated consistently
43 # i18n: "(DEPRECATED)" is a keyword, must be translated consistently
44 _("(DEPRECATED)"),
44 _("(DEPRECATED)"),
45 # i18n: "(EXPERIMENTAL)" is a keyword, must be translated consistently
45 # i18n: "(EXPERIMENTAL)" is a keyword, must be translated consistently
46 _("(EXPERIMENTAL)"),
46 _("(EXPERIMENTAL)"),
47 }
47 }
48
48
49 def listexts(header, exts, indent=1, showdeprecated=False):
49 def listexts(header, exts, indent=1, showdeprecated=False):
50 '''return a text listing of the given extensions'''
50 '''return a text listing of the given extensions'''
51 rst = []
51 rst = []
52 if exts:
52 if exts:
53 for name, desc in sorted(exts.iteritems()):
53 for name, desc in sorted(exts.iteritems()):
54 if not showdeprecated and any(w in desc for w in _exclkeywords):
54 if not showdeprecated and any(w in desc for w in _exclkeywords):
55 continue
55 continue
56 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
56 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
57 if rst:
57 if rst:
58 rst.insert(0, '\n%s\n\n' % header)
58 rst.insert(0, '\n%s\n\n' % header)
59 return rst
59 return rst
60
60
61 def extshelp(ui):
61 def extshelp(ui):
62 rst = loaddoc('extensions')(ui).splitlines(True)
62 rst = loaddoc('extensions')(ui).splitlines(True)
63 rst.extend(listexts(
63 rst.extend(listexts(
64 _('enabled extensions:'), extensions.enabled(), showdeprecated=True))
64 _('enabled extensions:'), extensions.enabled(), showdeprecated=True))
65 rst.extend(listexts(_('disabled extensions:'), extensions.disabled()))
65 rst.extend(listexts(_('disabled extensions:'), extensions.disabled()))
66 doc = ''.join(rst)
66 doc = ''.join(rst)
67 return doc
67 return doc
68
68
69 def optrst(header, options, verbose):
69 def optrst(header, options, verbose):
70 data = []
70 data = []
71 multioccur = False
71 multioccur = False
72 for option in options:
72 for option in options:
73 if len(option) == 5:
73 if len(option) == 5:
74 shortopt, longopt, default, desc, optlabel = option
74 shortopt, longopt, default, desc, optlabel = option
75 else:
75 else:
76 shortopt, longopt, default, desc = option
76 shortopt, longopt, default, desc = option
77 optlabel = _("VALUE") # default label
77 optlabel = _("VALUE") # default label
78
78
79 if not verbose and any(w in desc for w in _exclkeywords):
79 if not verbose and any(w in desc for w in _exclkeywords):
80 continue
80 continue
81
81
82 so = ''
82 so = ''
83 if shortopt:
83 if shortopt:
84 so = '-' + shortopt
84 so = '-' + shortopt
85 lo = '--' + longopt
85 lo = '--' + longopt
86 if default:
86 if default:
87 # default is of unknown type, and in Python 2 we abused
87 # default is of unknown type, and in Python 2 we abused
88 # the %s-shows-repr property to handle integers etc. To
88 # the %s-shows-repr property to handle integers etc. To
89 # match that behavior on Python 3, we do str(default) and
89 # match that behavior on Python 3, we do str(default) and
90 # then convert it to bytes.
90 # then convert it to bytes.
91 desc += _(" (default: %s)") % pycompat.bytestr(default)
91 desc += _(" (default: %s)") % pycompat.bytestr(default)
92
92
93 if isinstance(default, list):
93 if isinstance(default, list):
94 lo += " %s [+]" % optlabel
94 lo += " %s [+]" % optlabel
95 multioccur = True
95 multioccur = True
96 elif (default is not None) and not isinstance(default, bool):
96 elif (default is not None) and not isinstance(default, bool):
97 lo += " %s" % optlabel
97 lo += " %s" % optlabel
98
98
99 data.append((so, lo, desc))
99 data.append((so, lo, desc))
100
100
101 if multioccur:
101 if multioccur:
102 header += (_(" ([+] can be repeated)"))
102 header += (_(" ([+] can be repeated)"))
103
103
104 rst = ['\n%s:\n\n' % header]
104 rst = ['\n%s:\n\n' % header]
105 rst.extend(minirst.maketable(data, 1))
105 rst.extend(minirst.maketable(data, 1))
106
106
107 return ''.join(rst)
107 return ''.join(rst)
108
108
109 def indicateomitted(rst, omitted, notomitted=None):
109 def indicateomitted(rst, omitted, notomitted=None):
110 rst.append('\n\n.. container:: omitted\n\n %s\n\n' % omitted)
110 rst.append('\n\n.. container:: omitted\n\n %s\n\n' % omitted)
111 if notomitted:
111 if notomitted:
112 rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted)
112 rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted)
113
113
114 def filtercmd(ui, cmd, kw, doc):
114 def filtercmd(ui, cmd, kw, doc):
115 if not ui.debugflag and cmd.startswith("debug") and kw != "debug":
115 if not ui.debugflag and cmd.startswith("debug") and kw != "debug":
116 return True
116 return True
117 if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
117 if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
118 return True
118 return True
119 return False
119 return False
120
120
121 def topicmatch(ui, commands, kw):
121 def topicmatch(ui, commands, kw):
122 """Return help topics matching kw.
122 """Return help topics matching kw.
123
123
124 Returns {'section': [(name, summary), ...], ...} where section is
124 Returns {'section': [(name, summary), ...], ...} where section is
125 one of topics, commands, extensions, or extensioncommands.
125 one of topics, commands, extensions, or extensioncommands.
126 """
126 """
127 kw = encoding.lower(kw)
127 kw = encoding.lower(kw)
128 def lowercontains(container):
128 def lowercontains(container):
129 return kw in encoding.lower(container) # translated in helptable
129 return kw in encoding.lower(container) # translated in helptable
130 results = {'topics': [],
130 results = {'topics': [],
131 'commands': [],
131 'commands': [],
132 'extensions': [],
132 'extensions': [],
133 'extensioncommands': [],
133 'extensioncommands': [],
134 }
134 }
135 for names, header, doc in helptable:
135 for names, header, doc in helptable:
136 # Old extensions may use a str as doc.
136 # Old extensions may use a str as doc.
137 if (sum(map(lowercontains, names))
137 if (sum(map(lowercontains, names))
138 or lowercontains(header)
138 or lowercontains(header)
139 or (callable(doc) and lowercontains(doc(ui)))):
139 or (callable(doc) and lowercontains(doc(ui)))):
140 results['topics'].append((names[0], header))
140 results['topics'].append((names[0], header))
141 for cmd, entry in commands.table.iteritems():
141 for cmd, entry in commands.table.iteritems():
142 if len(entry) == 3:
142 if len(entry) == 3:
143 summary = entry[2]
143 summary = entry[2]
144 else:
144 else:
145 summary = ''
145 summary = ''
146 # translate docs *before* searching there
146 # translate docs *before* searching there
147 docs = _(pycompat.getdoc(entry[0])) or ''
147 docs = _(pycompat.getdoc(entry[0])) or ''
148 if kw in cmd or lowercontains(summary) or lowercontains(docs):
148 if kw in cmd or lowercontains(summary) or lowercontains(docs):
149 doclines = docs.splitlines()
149 doclines = docs.splitlines()
150 if doclines:
150 if doclines:
151 summary = doclines[0]
151 summary = doclines[0]
152 cmdname = cmd.partition('|')[0].lstrip('^')
152 cmdname = cmd.partition('|')[0].lstrip('^')
153 if filtercmd(ui, cmdname, kw, docs):
153 if filtercmd(ui, cmdname, kw, docs):
154 continue
154 continue
155 results['commands'].append((cmdname, summary))
155 results['commands'].append((cmdname, summary))
156 for name, docs in itertools.chain(
156 for name, docs in itertools.chain(
157 extensions.enabled(False).iteritems(),
157 extensions.enabled(False).iteritems(),
158 extensions.disabled().iteritems()):
158 extensions.disabled().iteritems()):
159 if not docs:
159 if not docs:
160 continue
160 continue
161 name = name.rpartition('.')[-1]
161 name = name.rpartition('.')[-1]
162 if lowercontains(name) or lowercontains(docs):
162 if lowercontains(name) or lowercontains(docs):
163 # extension docs are already translated
163 # extension docs are already translated
164 results['extensions'].append((name, docs.splitlines()[0]))
164 results['extensions'].append((name, docs.splitlines()[0]))
165 try:
165 try:
166 mod = extensions.load(ui, name, '')
166 mod = extensions.load(ui, name, '')
167 except ImportError:
167 except ImportError:
168 # debug message would be printed in extensions.load()
168 # debug message would be printed in extensions.load()
169 continue
169 continue
170 for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems():
170 for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems():
171 if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])):
171 if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])):
172 cmdname = cmd.partition('|')[0].lstrip('^')
172 cmdname = cmd.partition('|')[0].lstrip('^')
173 cmddoc = pycompat.getdoc(entry[0])
173 cmddoc = pycompat.getdoc(entry[0])
174 if cmddoc:
174 if cmddoc:
175 cmddoc = gettext(cmddoc).splitlines()[0]
175 cmddoc = gettext(cmddoc).splitlines()[0]
176 else:
176 else:
177 cmddoc = _('(no help text available)')
177 cmddoc = _('(no help text available)')
178 if filtercmd(ui, cmdname, kw, cmddoc):
178 if filtercmd(ui, cmdname, kw, cmddoc):
179 continue
179 continue
180 results['extensioncommands'].append((cmdname, cmddoc))
180 results['extensioncommands'].append((cmdname, cmddoc))
181 return results
181 return results
182
182
183 def loaddoc(topic, subdir=None):
183 def loaddoc(topic, subdir=None):
184 """Return a delayed loader for help/topic.txt."""
184 """Return a delayed loader for help/topic.txt."""
185
185
186 def loader(ui):
186 def loader(ui):
187 docdir = os.path.join(util.datapath, 'help')
187 docdir = os.path.join(util.datapath, 'help')
188 if subdir:
188 if subdir:
189 docdir = os.path.join(docdir, subdir)
189 docdir = os.path.join(docdir, subdir)
190 path = os.path.join(docdir, topic + ".txt")
190 path = os.path.join(docdir, topic + ".txt")
191 doc = gettext(util.readfile(path))
191 doc = gettext(util.readfile(path))
192 for rewriter in helphooks.get(topic, []):
192 for rewriter in helphooks.get(topic, []):
193 doc = rewriter(ui, topic, doc)
193 doc = rewriter(ui, topic, doc)
194 return doc
194 return doc
195
195
196 return loader
196 return loader
197
197
198 internalstable = sorted([
198 internalstable = sorted([
199 (['bundles'], _('Bundles'),
199 (['bundles'], _('Bundles'),
200 loaddoc('bundles', subdir='internals')),
200 loaddoc('bundles', subdir='internals')),
201 (['censor'], _('Censor'),
201 (['censor'], _('Censor'),
202 loaddoc('censor', subdir='internals')),
202 loaddoc('censor', subdir='internals')),
203 (['changegroups'], _('Changegroups'),
203 (['changegroups'], _('Changegroups'),
204 loaddoc('changegroups', subdir='internals')),
204 loaddoc('changegroups', subdir='internals')),
205 (['config'], _('Config Registrar'),
205 (['config'], _('Config Registrar'),
206 loaddoc('config', subdir='internals')),
206 loaddoc('config', subdir='internals')),
207 (['requirements'], _('Repository Requirements'),
207 (['requirements'], _('Repository Requirements'),
208 loaddoc('requirements', subdir='internals')),
208 loaddoc('requirements', subdir='internals')),
209 (['revlogs'], _('Revision Logs'),
209 (['revlogs'], _('Revision Logs'),
210 loaddoc('revlogs', subdir='internals')),
210 loaddoc('revlogs', subdir='internals')),
211 (['wireprotocol'], _('Wire Protocol'),
211 (['wireprotocol'], _('Wire Protocol'),
212 loaddoc('wireprotocol', subdir='internals')),
212 loaddoc('wireprotocol', subdir='internals')),
213 ])
213 ])
214
214
215 def internalshelp(ui):
215 def internalshelp(ui):
216 """Generate the index for the "internals" topic."""
216 """Generate the index for the "internals" topic."""
217 lines = ['To access a subtopic, use "hg help internals.{subtopic-name}"\n',
217 lines = ['To access a subtopic, use "hg help internals.{subtopic-name}"\n',
218 '\n']
218 '\n']
219 for names, header, doc in internalstable:
219 for names, header, doc in internalstable:
220 lines.append(' :%s: %s\n' % (names[0], header))
220 lines.append(' :%s: %s\n' % (names[0], header))
221
221
222 return ''.join(lines)
222 return ''.join(lines)
223
223
224 helptable = sorted([
224 helptable = sorted([
225 (['bundlespec'], _("Bundle File Formats"), loaddoc('bundlespec')),
225 (['bundlespec'], _("Bundle File Formats"), loaddoc('bundlespec')),
226 (['color'], _("Colorizing Outputs"), loaddoc('color')),
226 (['color'], _("Colorizing Outputs"), loaddoc('color')),
227 (["config", "hgrc"], _("Configuration Files"), loaddoc('config')),
227 (["config", "hgrc"], _("Configuration Files"), loaddoc('config')),
228 (["dates"], _("Date Formats"), loaddoc('dates')),
228 (["dates"], _("Date Formats"), loaddoc('dates')),
229 (["flags"], _("Command-line flags"), loaddoc('flags')),
229 (["patterns"], _("File Name Patterns"), loaddoc('patterns')),
230 (["patterns"], _("File Name Patterns"), loaddoc('patterns')),
230 (['environment', 'env'], _('Environment Variables'),
231 (['environment', 'env'], _('Environment Variables'),
231 loaddoc('environment')),
232 loaddoc('environment')),
232 (['revisions', 'revs', 'revsets', 'revset', 'multirevs', 'mrevs'],
233 (['revisions', 'revs', 'revsets', 'revset', 'multirevs', 'mrevs'],
233 _('Specifying Revisions'), loaddoc('revisions')),
234 _('Specifying Revisions'), loaddoc('revisions')),
234 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets')),
235 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets')),
235 (['diffs'], _('Diff Formats'), loaddoc('diffs')),
236 (['diffs'], _('Diff Formats'), loaddoc('diffs')),
236 (['merge-tools', 'mergetools', 'mergetool'], _('Merge Tools'),
237 (['merge-tools', 'mergetools', 'mergetool'], _('Merge Tools'),
237 loaddoc('merge-tools')),
238 loaddoc('merge-tools')),
238 (['templating', 'templates', 'template', 'style'], _('Template Usage'),
239 (['templating', 'templates', 'template', 'style'], _('Template Usage'),
239 loaddoc('templates')),
240 loaddoc('templates')),
240 (['urls'], _('URL Paths'), loaddoc('urls')),
241 (['urls'], _('URL Paths'), loaddoc('urls')),
241 (["extensions"], _("Using Additional Features"), extshelp),
242 (["extensions"], _("Using Additional Features"), extshelp),
242 (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos')),
243 (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos')),
243 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')),
244 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')),
244 (["glossary"], _("Glossary"), loaddoc('glossary')),
245 (["glossary"], _("Glossary"), loaddoc('glossary')),
245 (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"),
246 (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"),
246 loaddoc('hgignore')),
247 loaddoc('hgignore')),
247 (["phases"], _("Working with Phases"), loaddoc('phases')),
248 (["phases"], _("Working with Phases"), loaddoc('phases')),
248 (['scripting'], _('Using Mercurial from scripts and automation'),
249 (['scripting'], _('Using Mercurial from scripts and automation'),
249 loaddoc('scripting')),
250 loaddoc('scripting')),
250 (['internals'], _("Technical implementation topics"),
251 (['internals'], _("Technical implementation topics"),
251 internalshelp),
252 internalshelp),
252 (['pager'], _("Pager Support"), loaddoc('pager')),
253 (['pager'], _("Pager Support"), loaddoc('pager')),
253 ])
254 ])
254
255
255 # Maps topics with sub-topics to a list of their sub-topics.
256 # Maps topics with sub-topics to a list of their sub-topics.
256 subtopics = {
257 subtopics = {
257 'internals': internalstable,
258 'internals': internalstable,
258 }
259 }
259
260
260 # Map topics to lists of callable taking the current topic help and
261 # Map topics to lists of callable taking the current topic help and
261 # returning the updated version
262 # returning the updated version
262 helphooks = {}
263 helphooks = {}
263
264
264 def addtopichook(topic, rewriter):
265 def addtopichook(topic, rewriter):
265 helphooks.setdefault(topic, []).append(rewriter)
266 helphooks.setdefault(topic, []).append(rewriter)
266
267
267 def makeitemsdoc(ui, topic, doc, marker, items, dedent=False):
268 def makeitemsdoc(ui, topic, doc, marker, items, dedent=False):
268 """Extract docstring from the items key to function mapping, build a
269 """Extract docstring from the items key to function mapping, build a
269 single documentation block and use it to overwrite the marker in doc.
270 single documentation block and use it to overwrite the marker in doc.
270 """
271 """
271 entries = []
272 entries = []
272 for name in sorted(items):
273 for name in sorted(items):
273 text = (pycompat.getdoc(items[name]) or '').rstrip()
274 text = (pycompat.getdoc(items[name]) or '').rstrip()
274 if (not text
275 if (not text
275 or not ui.verbose and any(w in text for w in _exclkeywords)):
276 or not ui.verbose and any(w in text for w in _exclkeywords)):
276 continue
277 continue
277 text = gettext(text)
278 text = gettext(text)
278 if dedent:
279 if dedent:
279 # Abuse latin1 to use textwrap.dedent() on bytes.
280 # Abuse latin1 to use textwrap.dedent() on bytes.
280 text = textwrap.dedent(text.decode('latin1')).encode('latin1')
281 text = textwrap.dedent(text.decode('latin1')).encode('latin1')
281 lines = text.splitlines()
282 lines = text.splitlines()
282 doclines = [(lines[0])]
283 doclines = [(lines[0])]
283 for l in lines[1:]:
284 for l in lines[1:]:
284 # Stop once we find some Python doctest
285 # Stop once we find some Python doctest
285 if l.strip().startswith('>>>'):
286 if l.strip().startswith('>>>'):
286 break
287 break
287 if dedent:
288 if dedent:
288 doclines.append(l.rstrip())
289 doclines.append(l.rstrip())
289 else:
290 else:
290 doclines.append(' ' + l.strip())
291 doclines.append(' ' + l.strip())
291 entries.append('\n'.join(doclines))
292 entries.append('\n'.join(doclines))
292 entries = '\n\n'.join(entries)
293 entries = '\n\n'.join(entries)
293 return doc.replace(marker, entries)
294 return doc.replace(marker, entries)
294
295
295 def addtopicsymbols(topic, marker, symbols, dedent=False):
296 def addtopicsymbols(topic, marker, symbols, dedent=False):
296 def add(ui, topic, doc):
297 def add(ui, topic, doc):
297 return makeitemsdoc(ui, topic, doc, marker, symbols, dedent=dedent)
298 return makeitemsdoc(ui, topic, doc, marker, symbols, dedent=dedent)
298 addtopichook(topic, add)
299 addtopichook(topic, add)
299
300
300 addtopicsymbols('bundlespec', '.. bundlecompressionmarker',
301 addtopicsymbols('bundlespec', '.. bundlecompressionmarker',
301 util.bundlecompressiontopics())
302 util.bundlecompressiontopics())
302 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
303 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
303 addtopicsymbols('merge-tools', '.. internaltoolsmarker',
304 addtopicsymbols('merge-tools', '.. internaltoolsmarker',
304 filemerge.internalsdoc)
305 filemerge.internalsdoc)
305 addtopicsymbols('revisions', '.. predicatesmarker', revset.symbols)
306 addtopicsymbols('revisions', '.. predicatesmarker', revset.symbols)
306 addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords)
307 addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords)
307 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
308 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
308 addtopicsymbols('templates', '.. functionsmarker', templater.funcs)
309 addtopicsymbols('templates', '.. functionsmarker', templater.funcs)
309 addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands,
310 addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands,
310 dedent=True)
311 dedent=True)
311
312
312 def help_(ui, commands, name, unknowncmd=False, full=True, subtopic=None,
313 def help_(ui, commands, name, unknowncmd=False, full=True, subtopic=None,
313 **opts):
314 **opts):
314 '''
315 '''
315 Generate the help for 'name' as unformatted restructured text. If
316 Generate the help for 'name' as unformatted restructured text. If
316 'name' is None, describe the commands available.
317 'name' is None, describe the commands available.
317 '''
318 '''
318
319
319 opts = pycompat.byteskwargs(opts)
320 opts = pycompat.byteskwargs(opts)
320
321
321 def helpcmd(name, subtopic=None):
322 def helpcmd(name, subtopic=None):
322 try:
323 try:
323 aliases, entry = cmdutil.findcmd(name, commands.table,
324 aliases, entry = cmdutil.findcmd(name, commands.table,
324 strict=unknowncmd)
325 strict=unknowncmd)
325 except error.AmbiguousCommand as inst:
326 except error.AmbiguousCommand as inst:
326 # py3k fix: except vars can't be used outside the scope of the
327 # py3k fix: except vars can't be used outside the scope of the
327 # except block, nor can be used inside a lambda. python issue4617
328 # except block, nor can be used inside a lambda. python issue4617
328 prefix = inst.args[0]
329 prefix = inst.args[0]
329 select = lambda c: c.lstrip('^').startswith(prefix)
330 select = lambda c: c.lstrip('^').startswith(prefix)
330 rst = helplist(select)
331 rst = helplist(select)
331 return rst
332 return rst
332
333
333 rst = []
334 rst = []
334
335
335 # check if it's an invalid alias and display its error if it is
336 # check if it's an invalid alias and display its error if it is
336 if getattr(entry[0], 'badalias', None):
337 if getattr(entry[0], 'badalias', None):
337 rst.append(entry[0].badalias + '\n')
338 rst.append(entry[0].badalias + '\n')
338 if entry[0].unknowncmd:
339 if entry[0].unknowncmd:
339 try:
340 try:
340 rst.extend(helpextcmd(entry[0].cmdname))
341 rst.extend(helpextcmd(entry[0].cmdname))
341 except error.UnknownCommand:
342 except error.UnknownCommand:
342 pass
343 pass
343 return rst
344 return rst
344
345
345 # synopsis
346 # synopsis
346 if len(entry) > 2:
347 if len(entry) > 2:
347 if entry[2].startswith('hg'):
348 if entry[2].startswith('hg'):
348 rst.append("%s\n" % entry[2])
349 rst.append("%s\n" % entry[2])
349 else:
350 else:
350 rst.append('hg %s %s\n' % (aliases[0], entry[2]))
351 rst.append('hg %s %s\n' % (aliases[0], entry[2]))
351 else:
352 else:
352 rst.append('hg %s\n' % aliases[0])
353 rst.append('hg %s\n' % aliases[0])
353 # aliases
354 # aliases
354 if full and not ui.quiet and len(aliases) > 1:
355 if full and not ui.quiet and len(aliases) > 1:
355 rst.append(_("\naliases: %s\n") % ', '.join(aliases[1:]))
356 rst.append(_("\naliases: %s\n") % ', '.join(aliases[1:]))
356 rst.append('\n')
357 rst.append('\n')
357
358
358 # description
359 # description
359 doc = gettext(pycompat.getdoc(entry[0]))
360 doc = gettext(pycompat.getdoc(entry[0]))
360 if not doc:
361 if not doc:
361 doc = _("(no help text available)")
362 doc = _("(no help text available)")
362 if util.safehasattr(entry[0], 'definition'): # aliased command
363 if util.safehasattr(entry[0], 'definition'): # aliased command
363 source = entry[0].source
364 source = entry[0].source
364 if entry[0].definition.startswith('!'): # shell alias
365 if entry[0].definition.startswith('!'): # shell alias
365 doc = (_('shell alias for::\n\n %s\n\ndefined by: %s\n') %
366 doc = (_('shell alias for::\n\n %s\n\ndefined by: %s\n') %
366 (entry[0].definition[1:], source))
367 (entry[0].definition[1:], source))
367 else:
368 else:
368 doc = (_('alias for: hg %s\n\n%s\n\ndefined by: %s\n') %
369 doc = (_('alias for: hg %s\n\n%s\n\ndefined by: %s\n') %
369 (entry[0].definition, doc, source))
370 (entry[0].definition, doc, source))
370 doc = doc.splitlines(True)
371 doc = doc.splitlines(True)
371 if ui.quiet or not full:
372 if ui.quiet or not full:
372 rst.append(doc[0])
373 rst.append(doc[0])
373 else:
374 else:
374 rst.extend(doc)
375 rst.extend(doc)
375 rst.append('\n')
376 rst.append('\n')
376
377
377 # check if this command shadows a non-trivial (multi-line)
378 # check if this command shadows a non-trivial (multi-line)
378 # extension help text
379 # extension help text
379 try:
380 try:
380 mod = extensions.find(name)
381 mod = extensions.find(name)
381 doc = gettext(pycompat.getdoc(mod)) or ''
382 doc = gettext(pycompat.getdoc(mod)) or ''
382 if '\n' in doc.strip():
383 if '\n' in doc.strip():
383 msg = _("(use 'hg help -e %s' to show help for "
384 msg = _("(use 'hg help -e %s' to show help for "
384 "the %s extension)") % (name, name)
385 "the %s extension)") % (name, name)
385 rst.append('\n%s\n' % msg)
386 rst.append('\n%s\n' % msg)
386 except KeyError:
387 except KeyError:
387 pass
388 pass
388
389
389 # options
390 # options
390 if not ui.quiet and entry[1]:
391 if not ui.quiet and entry[1]:
391 rst.append(optrst(_("options"), entry[1], ui.verbose))
392 rst.append(optrst(_("options"), entry[1], ui.verbose))
392
393
393 if ui.verbose:
394 if ui.verbose:
394 rst.append(optrst(_("global options"),
395 rst.append(optrst(_("global options"),
395 commands.globalopts, ui.verbose))
396 commands.globalopts, ui.verbose))
396
397
397 if not ui.verbose:
398 if not ui.verbose:
398 if not full:
399 if not full:
399 rst.append(_("\n(use 'hg %s -h' to show more help)\n")
400 rst.append(_("\n(use 'hg %s -h' to show more help)\n")
400 % name)
401 % name)
401 elif not ui.quiet:
402 elif not ui.quiet:
402 rst.append(_('\n(some details hidden, use --verbose '
403 rst.append(_('\n(some details hidden, use --verbose '
403 'to show complete help)'))
404 'to show complete help)'))
404
405
405 return rst
406 return rst
406
407
407
408
408 def helplist(select=None, **opts):
409 def helplist(select=None, **opts):
409 # list of commands
410 # list of commands
410 if name == "shortlist":
411 if name == "shortlist":
411 header = _('basic commands:\n\n')
412 header = _('basic commands:\n\n')
412 elif name == "debug":
413 elif name == "debug":
413 header = _('debug commands (internal and unsupported):\n\n')
414 header = _('debug commands (internal and unsupported):\n\n')
414 else:
415 else:
415 header = _('list of commands:\n\n')
416 header = _('list of commands:\n\n')
416
417
417 h = {}
418 h = {}
418 cmds = {}
419 cmds = {}
419 for c, e in commands.table.iteritems():
420 for c, e in commands.table.iteritems():
420 f = c.partition("|")[0]
421 f = c.partition("|")[0]
421 if select and not select(f):
422 if select and not select(f):
422 continue
423 continue
423 if (not select and name != 'shortlist' and
424 if (not select and name != 'shortlist' and
424 e[0].__module__ != commands.__name__):
425 e[0].__module__ != commands.__name__):
425 continue
426 continue
426 if name == "shortlist" and not f.startswith("^"):
427 if name == "shortlist" and not f.startswith("^"):
427 continue
428 continue
428 f = f.lstrip("^")
429 f = f.lstrip("^")
429 doc = pycompat.getdoc(e[0])
430 doc = pycompat.getdoc(e[0])
430 if filtercmd(ui, f, name, doc):
431 if filtercmd(ui, f, name, doc):
431 continue
432 continue
432 doc = gettext(doc)
433 doc = gettext(doc)
433 if not doc:
434 if not doc:
434 doc = _("(no help text available)")
435 doc = _("(no help text available)")
435 h[f] = doc.splitlines()[0].rstrip()
436 h[f] = doc.splitlines()[0].rstrip()
436 cmds[f] = c.lstrip("^")
437 cmds[f] = c.lstrip("^")
437
438
438 rst = []
439 rst = []
439 if not h:
440 if not h:
440 if not ui.quiet:
441 if not ui.quiet:
441 rst.append(_('no commands defined\n'))
442 rst.append(_('no commands defined\n'))
442 return rst
443 return rst
443
444
444 if not ui.quiet:
445 if not ui.quiet:
445 rst.append(header)
446 rst.append(header)
446 fns = sorted(h)
447 fns = sorted(h)
447 for f in fns:
448 for f in fns:
448 if ui.verbose:
449 if ui.verbose:
449 commacmds = cmds[f].replace("|",", ")
450 commacmds = cmds[f].replace("|",", ")
450 rst.append(" :%s: %s\n" % (commacmds, h[f]))
451 rst.append(" :%s: %s\n" % (commacmds, h[f]))
451 else:
452 else:
452 rst.append(' :%s: %s\n' % (f, h[f]))
453 rst.append(' :%s: %s\n' % (f, h[f]))
453
454
454 ex = opts.get
455 ex = opts.get
455 anyopts = (ex('keyword') or not (ex('command') or ex('extension')))
456 anyopts = (ex('keyword') or not (ex('command') or ex('extension')))
456 if not name and anyopts:
457 if not name and anyopts:
457 exts = listexts(_('enabled extensions:'), extensions.enabled())
458 exts = listexts(_('enabled extensions:'), extensions.enabled())
458 if exts:
459 if exts:
459 rst.append('\n')
460 rst.append('\n')
460 rst.extend(exts)
461 rst.extend(exts)
461
462
462 rst.append(_("\nadditional help topics:\n\n"))
463 rst.append(_("\nadditional help topics:\n\n"))
463 topics = []
464 topics = []
464 for names, header, doc in helptable:
465 for names, header, doc in helptable:
465 topics.append((names[0], header))
466 topics.append((names[0], header))
466 for t, desc in topics:
467 for t, desc in topics:
467 rst.append(" :%s: %s\n" % (t, desc))
468 rst.append(" :%s: %s\n" % (t, desc))
468
469
469 if ui.quiet:
470 if ui.quiet:
470 pass
471 pass
471 elif ui.verbose:
472 elif ui.verbose:
472 rst.append('\n%s\n' % optrst(_("global options"),
473 rst.append('\n%s\n' % optrst(_("global options"),
473 commands.globalopts, ui.verbose))
474 commands.globalopts, ui.verbose))
474 if name == 'shortlist':
475 if name == 'shortlist':
475 rst.append(_("\n(use 'hg help' for the full list "
476 rst.append(_("\n(use 'hg help' for the full list "
476 "of commands)\n"))
477 "of commands)\n"))
477 else:
478 else:
478 if name == 'shortlist':
479 if name == 'shortlist':
479 rst.append(_("\n(use 'hg help' for the full list of commands "
480 rst.append(_("\n(use 'hg help' for the full list of commands "
480 "or 'hg -v' for details)\n"))
481 "or 'hg -v' for details)\n"))
481 elif name and not full:
482 elif name and not full:
482 rst.append(_("\n(use 'hg help %s' to show the full help "
483 rst.append(_("\n(use 'hg help %s' to show the full help "
483 "text)\n") % name)
484 "text)\n") % name)
484 elif name and cmds and name in cmds.keys():
485 elif name and cmds and name in cmds.keys():
485 rst.append(_("\n(use 'hg help -v -e %s' to show built-in "
486 rst.append(_("\n(use 'hg help -v -e %s' to show built-in "
486 "aliases and global options)\n") % name)
487 "aliases and global options)\n") % name)
487 else:
488 else:
488 rst.append(_("\n(use 'hg help -v%s' to show built-in aliases "
489 rst.append(_("\n(use 'hg help -v%s' to show built-in aliases "
489 "and global options)\n")
490 "and global options)\n")
490 % (name and " " + name or ""))
491 % (name and " " + name or ""))
491 return rst
492 return rst
492
493
493 def helptopic(name, subtopic=None):
494 def helptopic(name, subtopic=None):
494 # Look for sub-topic entry first.
495 # Look for sub-topic entry first.
495 header, doc = None, None
496 header, doc = None, None
496 if subtopic and name in subtopics:
497 if subtopic and name in subtopics:
497 for names, header, doc in subtopics[name]:
498 for names, header, doc in subtopics[name]:
498 if subtopic in names:
499 if subtopic in names:
499 break
500 break
500
501
501 if not header:
502 if not header:
502 for names, header, doc in helptable:
503 for names, header, doc in helptable:
503 if name in names:
504 if name in names:
504 break
505 break
505 else:
506 else:
506 raise error.UnknownCommand(name)
507 raise error.UnknownCommand(name)
507
508
508 rst = [minirst.section(header)]
509 rst = [minirst.section(header)]
509
510
510 # description
511 # description
511 if not doc:
512 if not doc:
512 rst.append(" %s\n" % _("(no help text available)"))
513 rst.append(" %s\n" % _("(no help text available)"))
513 if callable(doc):
514 if callable(doc):
514 rst += [" %s\n" % l for l in doc(ui).splitlines()]
515 rst += [" %s\n" % l for l in doc(ui).splitlines()]
515
516
516 if not ui.verbose:
517 if not ui.verbose:
517 omitted = _('(some details hidden, use --verbose'
518 omitted = _('(some details hidden, use --verbose'
518 ' to show complete help)')
519 ' to show complete help)')
519 indicateomitted(rst, omitted)
520 indicateomitted(rst, omitted)
520
521
521 try:
522 try:
522 cmdutil.findcmd(name, commands.table)
523 cmdutil.findcmd(name, commands.table)
523 rst.append(_("\nuse 'hg help -c %s' to see help for "
524 rst.append(_("\nuse 'hg help -c %s' to see help for "
524 "the %s command\n") % (name, name))
525 "the %s command\n") % (name, name))
525 except error.UnknownCommand:
526 except error.UnknownCommand:
526 pass
527 pass
527 return rst
528 return rst
528
529
529 def helpext(name, subtopic=None):
530 def helpext(name, subtopic=None):
530 try:
531 try:
531 mod = extensions.find(name)
532 mod = extensions.find(name)
532 doc = gettext(pycompat.getdoc(mod)) or _('no help text available')
533 doc = gettext(pycompat.getdoc(mod)) or _('no help text available')
533 except KeyError:
534 except KeyError:
534 mod = None
535 mod = None
535 doc = extensions.disabledext(name)
536 doc = extensions.disabledext(name)
536 if not doc:
537 if not doc:
537 raise error.UnknownCommand(name)
538 raise error.UnknownCommand(name)
538
539
539 if '\n' not in doc:
540 if '\n' not in doc:
540 head, tail = doc, ""
541 head, tail = doc, ""
541 else:
542 else:
542 head, tail = doc.split('\n', 1)
543 head, tail = doc.split('\n', 1)
543 rst = [_('%s extension - %s\n\n') % (name.rpartition('.')[-1], head)]
544 rst = [_('%s extension - %s\n\n') % (name.rpartition('.')[-1], head)]
544 if tail:
545 if tail:
545 rst.extend(tail.splitlines(True))
546 rst.extend(tail.splitlines(True))
546 rst.append('\n')
547 rst.append('\n')
547
548
548 if not ui.verbose:
549 if not ui.verbose:
549 omitted = _('(some details hidden, use --verbose'
550 omitted = _('(some details hidden, use --verbose'
550 ' to show complete help)')
551 ' to show complete help)')
551 indicateomitted(rst, omitted)
552 indicateomitted(rst, omitted)
552
553
553 if mod:
554 if mod:
554 try:
555 try:
555 ct = mod.cmdtable
556 ct = mod.cmdtable
556 except AttributeError:
557 except AttributeError:
557 ct = {}
558 ct = {}
558 modcmds = set([c.partition('|')[0] for c in ct])
559 modcmds = set([c.partition('|')[0] for c in ct])
559 rst.extend(helplist(modcmds.__contains__))
560 rst.extend(helplist(modcmds.__contains__))
560 else:
561 else:
561 rst.append(_("(use 'hg help extensions' for information on enabling"
562 rst.append(_("(use 'hg help extensions' for information on enabling"
562 " extensions)\n"))
563 " extensions)\n"))
563 return rst
564 return rst
564
565
565 def helpextcmd(name, subtopic=None):
566 def helpextcmd(name, subtopic=None):
566 cmd, ext, mod = extensions.disabledcmd(ui, name,
567 cmd, ext, mod = extensions.disabledcmd(ui, name,
567 ui.configbool('ui', 'strict'))
568 ui.configbool('ui', 'strict'))
568 doc = gettext(pycompat.getdoc(mod)).splitlines()[0]
569 doc = gettext(pycompat.getdoc(mod)).splitlines()[0]
569
570
570 rst = listexts(_("'%s' is provided by the following "
571 rst = listexts(_("'%s' is provided by the following "
571 "extension:") % cmd, {ext: doc}, indent=4,
572 "extension:") % cmd, {ext: doc}, indent=4,
572 showdeprecated=True)
573 showdeprecated=True)
573 rst.append('\n')
574 rst.append('\n')
574 rst.append(_("(use 'hg help extensions' for information on enabling "
575 rst.append(_("(use 'hg help extensions' for information on enabling "
575 "extensions)\n"))
576 "extensions)\n"))
576 return rst
577 return rst
577
578
578
579
579 rst = []
580 rst = []
580 kw = opts.get('keyword')
581 kw = opts.get('keyword')
581 if kw or name is None and any(opts[o] for o in opts):
582 if kw or name is None and any(opts[o] for o in opts):
582 matches = topicmatch(ui, commands, name or '')
583 matches = topicmatch(ui, commands, name or '')
583 helpareas = []
584 helpareas = []
584 if opts.get('extension'):
585 if opts.get('extension'):
585 helpareas += [('extensions', _('Extensions'))]
586 helpareas += [('extensions', _('Extensions'))]
586 if opts.get('command'):
587 if opts.get('command'):
587 helpareas += [('commands', _('Commands'))]
588 helpareas += [('commands', _('Commands'))]
588 if not helpareas:
589 if not helpareas:
589 helpareas = [('topics', _('Topics')),
590 helpareas = [('topics', _('Topics')),
590 ('commands', _('Commands')),
591 ('commands', _('Commands')),
591 ('extensions', _('Extensions')),
592 ('extensions', _('Extensions')),
592 ('extensioncommands', _('Extension Commands'))]
593 ('extensioncommands', _('Extension Commands'))]
593 for t, title in helpareas:
594 for t, title in helpareas:
594 if matches[t]:
595 if matches[t]:
595 rst.append('%s:\n\n' % title)
596 rst.append('%s:\n\n' % title)
596 rst.extend(minirst.maketable(sorted(matches[t]), 1))
597 rst.extend(minirst.maketable(sorted(matches[t]), 1))
597 rst.append('\n')
598 rst.append('\n')
598 if not rst:
599 if not rst:
599 msg = _('no matches')
600 msg = _('no matches')
600 hint = _("try 'hg help' for a list of topics")
601 hint = _("try 'hg help' for a list of topics")
601 raise error.Abort(msg, hint=hint)
602 raise error.Abort(msg, hint=hint)
602 elif name and name != 'shortlist':
603 elif name and name != 'shortlist':
603 queries = []
604 queries = []
604 if unknowncmd:
605 if unknowncmd:
605 queries += [helpextcmd]
606 queries += [helpextcmd]
606 if opts.get('extension'):
607 if opts.get('extension'):
607 queries += [helpext]
608 queries += [helpext]
608 if opts.get('command'):
609 if opts.get('command'):
609 queries += [helpcmd]
610 queries += [helpcmd]
610 if not queries:
611 if not queries:
611 queries = (helptopic, helpcmd, helpext, helpextcmd)
612 queries = (helptopic, helpcmd, helpext, helpextcmd)
612 for f in queries:
613 for f in queries:
613 try:
614 try:
614 rst = f(name, subtopic)
615 rst = f(name, subtopic)
615 break
616 break
616 except error.UnknownCommand:
617 except error.UnknownCommand:
617 pass
618 pass
618 else:
619 else:
619 if unknowncmd:
620 if unknowncmd:
620 raise error.UnknownCommand(name)
621 raise error.UnknownCommand(name)
621 else:
622 else:
622 msg = _('no such help topic: %s') % name
623 msg = _('no such help topic: %s') % name
623 hint = _("try 'hg help --keyword %s'") % name
624 hint = _("try 'hg help --keyword %s'") % name
624 raise error.Abort(msg, hint=hint)
625 raise error.Abort(msg, hint=hint)
625 else:
626 else:
626 # program name
627 # program name
627 if not ui.quiet:
628 if not ui.quiet:
628 rst = [_("Mercurial Distributed SCM\n"), '\n']
629 rst = [_("Mercurial Distributed SCM\n"), '\n']
629 rst.extend(helplist(None, **pycompat.strkwargs(opts)))
630 rst.extend(helplist(None, **pycompat.strkwargs(opts)))
630
631
631 return ''.join(rst)
632 return ''.join(rst)
632
633
633 def formattedhelp(ui, commands, name, keep=None, unknowncmd=False, full=True,
634 def formattedhelp(ui, commands, name, keep=None, unknowncmd=False, full=True,
634 **opts):
635 **opts):
635 """get help for a given topic (as a dotted name) as rendered rst
636 """get help for a given topic (as a dotted name) as rendered rst
636
637
637 Either returns the rendered help text or raises an exception.
638 Either returns the rendered help text or raises an exception.
638 """
639 """
639 if keep is None:
640 if keep is None:
640 keep = []
641 keep = []
641 else:
642 else:
642 keep = list(keep) # make a copy so we can mutate this later
643 keep = list(keep) # make a copy so we can mutate this later
643 fullname = name
644 fullname = name
644 section = None
645 section = None
645 subtopic = None
646 subtopic = None
646 if name and '.' in name:
647 if name and '.' in name:
647 name, remaining = name.split('.', 1)
648 name, remaining = name.split('.', 1)
648 remaining = encoding.lower(remaining)
649 remaining = encoding.lower(remaining)
649 if '.' in remaining:
650 if '.' in remaining:
650 subtopic, section = remaining.split('.', 1)
651 subtopic, section = remaining.split('.', 1)
651 else:
652 else:
652 if name in subtopics:
653 if name in subtopics:
653 subtopic = remaining
654 subtopic = remaining
654 else:
655 else:
655 section = remaining
656 section = remaining
656 textwidth = ui.configint('ui', 'textwidth')
657 textwidth = ui.configint('ui', 'textwidth')
657 termwidth = ui.termwidth() - 2
658 termwidth = ui.termwidth() - 2
658 if textwidth <= 0 or termwidth < textwidth:
659 if textwidth <= 0 or termwidth < textwidth:
659 textwidth = termwidth
660 textwidth = termwidth
660 text = help_(ui, commands, name,
661 text = help_(ui, commands, name,
661 subtopic=subtopic, unknowncmd=unknowncmd, full=full, **opts)
662 subtopic=subtopic, unknowncmd=unknowncmd, full=full, **opts)
662
663
663 formatted, pruned = minirst.format(text, textwidth, keep=keep,
664 formatted, pruned = minirst.format(text, textwidth, keep=keep,
664 section=section)
665 section=section)
665
666
666 # We could have been given a weird ".foo" section without a name
667 # We could have been given a weird ".foo" section without a name
667 # to look for, or we could have simply failed to found "foo.bar"
668 # to look for, or we could have simply failed to found "foo.bar"
668 # because bar isn't a section of foo
669 # because bar isn't a section of foo
669 if section and not (formatted and name):
670 if section and not (formatted and name):
670 raise error.Abort(_("help section not found: %s") % fullname)
671 raise error.Abort(_("help section not found: %s") % fullname)
671
672
672 if 'verbose' in pruned:
673 if 'verbose' in pruned:
673 keep.append('omitted')
674 keep.append('omitted')
674 else:
675 else:
675 keep.append('notomitted')
676 keep.append('notomitted')
676 formatted, pruned = minirst.format(text, textwidth, keep=keep,
677 formatted, pruned = minirst.format(text, textwidth, keep=keep,
677 section=section)
678 section=section)
678 return formatted
679 return formatted
@@ -1,459 +1,461 b''
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ echo a > a
3 $ echo a > a
4 $ hg ci -A -d'1 0' -m a
4 $ hg ci -A -d'1 0' -m a
5 adding a
5 adding a
6
6
7 $ cd ..
7 $ cd ..
8
8
9 $ hg init b
9 $ hg init b
10 $ cd b
10 $ cd b
11 $ echo b > b
11 $ echo b > b
12 $ hg ci -A -d'1 0' -m b
12 $ hg ci -A -d'1 0' -m b
13 adding b
13 adding b
14
14
15 $ cd ..
15 $ cd ..
16
16
17 $ hg clone a c
17 $ hg clone a c
18 updating to branch default
18 updating to branch default
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 $ cd c
20 $ cd c
21 $ cat >> .hg/hgrc <<EOF
21 $ cat >> .hg/hgrc <<EOF
22 > [paths]
22 > [paths]
23 > relative = ../a
23 > relative = ../a
24 > EOF
24 > EOF
25 $ hg pull -f ../b
25 $ hg pull -f ../b
26 pulling from ../b
26 pulling from ../b
27 searching for changes
27 searching for changes
28 warning: repository is unrelated
28 warning: repository is unrelated
29 requesting all changes
29 requesting all changes
30 adding changesets
30 adding changesets
31 adding manifests
31 adding manifests
32 adding file changes
32 adding file changes
33 added 1 changesets with 1 changes to 1 files (+1 heads)
33 added 1 changesets with 1 changes to 1 files (+1 heads)
34 new changesets b6c483daf290
34 new changesets b6c483daf290
35 (run 'hg heads' to see heads, 'hg merge' to merge)
35 (run 'hg heads' to see heads, 'hg merge' to merge)
36 $ hg merge
36 $ hg merge
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 (branch merge, don't forget to commit)
38 (branch merge, don't forget to commit)
39
39
40 $ cd ..
40 $ cd ..
41
41
42 Testing -R/--repository:
42 Testing -R/--repository:
43
43
44 $ hg -R a tip
44 $ hg -R a tip
45 changeset: 0:8580ff50825a
45 changeset: 0:8580ff50825a
46 tag: tip
46 tag: tip
47 user: test
47 user: test
48 date: Thu Jan 01 00:00:01 1970 +0000
48 date: Thu Jan 01 00:00:01 1970 +0000
49 summary: a
49 summary: a
50
50
51 $ hg --repository b tip
51 $ hg --repository b tip
52 changeset: 0:b6c483daf290
52 changeset: 0:b6c483daf290
53 tag: tip
53 tag: tip
54 user: test
54 user: test
55 date: Thu Jan 01 00:00:01 1970 +0000
55 date: Thu Jan 01 00:00:01 1970 +0000
56 summary: b
56 summary: b
57
57
58
58
59 -R with a URL:
59 -R with a URL:
60
60
61 $ hg -R file:a identify
61 $ hg -R file:a identify
62 8580ff50825a tip
62 8580ff50825a tip
63 $ hg -R file://localhost/`pwd`/a/ identify
63 $ hg -R file://localhost/`pwd`/a/ identify
64 8580ff50825a tip
64 8580ff50825a tip
65
65
66 -R with path aliases:
66 -R with path aliases:
67
67
68 $ cd c
68 $ cd c
69 $ hg -R default identify
69 $ hg -R default identify
70 8580ff50825a tip
70 8580ff50825a tip
71 $ hg -R relative identify
71 $ hg -R relative identify
72 8580ff50825a tip
72 8580ff50825a tip
73 $ echo '[paths]' >> $HGRCPATH
73 $ echo '[paths]' >> $HGRCPATH
74 $ echo 'relativetohome = a' >> $HGRCPATH
74 $ echo 'relativetohome = a' >> $HGRCPATH
75 $ HOME=`pwd`/../ hg -R relativetohome identify
75 $ HOME=`pwd`/../ hg -R relativetohome identify
76 8580ff50825a tip
76 8580ff50825a tip
77 $ cd ..
77 $ cd ..
78
78
79 #if no-outer-repo
79 #if no-outer-repo
80
80
81 Implicit -R:
81 Implicit -R:
82
82
83 $ hg ann a/a
83 $ hg ann a/a
84 0: a
84 0: a
85 $ hg ann a/a a/a
85 $ hg ann a/a a/a
86 0: a
86 0: a
87 $ hg ann a/a b/b
87 $ hg ann a/a b/b
88 abort: no repository found in '$TESTTMP' (.hg not found)!
88 abort: no repository found in '$TESTTMP' (.hg not found)!
89 [255]
89 [255]
90 $ hg -R b ann a/a
90 $ hg -R b ann a/a
91 abort: a/a not under root '$TESTTMP/b' (glob)
91 abort: a/a not under root '$TESTTMP/b' (glob)
92 (consider using '--cwd b')
92 (consider using '--cwd b')
93 [255]
93 [255]
94 $ hg log
94 $ hg log
95 abort: no repository found in '$TESTTMP' (.hg not found)!
95 abort: no repository found in '$TESTTMP' (.hg not found)!
96 [255]
96 [255]
97
97
98 #endif
98 #endif
99
99
100 Abbreviation of long option:
100 Abbreviation of long option:
101
101
102 $ hg --repo c tip
102 $ hg --repo c tip
103 changeset: 1:b6c483daf290
103 changeset: 1:b6c483daf290
104 tag: tip
104 tag: tip
105 parent: -1:000000000000
105 parent: -1:000000000000
106 user: test
106 user: test
107 date: Thu Jan 01 00:00:01 1970 +0000
107 date: Thu Jan 01 00:00:01 1970 +0000
108 summary: b
108 summary: b
109
109
110
110
111 earlygetopt with duplicate options (36d23de02da1):
111 earlygetopt with duplicate options (36d23de02da1):
112
112
113 $ hg --cwd a --cwd b --cwd c tip
113 $ hg --cwd a --cwd b --cwd c tip
114 changeset: 1:b6c483daf290
114 changeset: 1:b6c483daf290
115 tag: tip
115 tag: tip
116 parent: -1:000000000000
116 parent: -1:000000000000
117 user: test
117 user: test
118 date: Thu Jan 01 00:00:01 1970 +0000
118 date: Thu Jan 01 00:00:01 1970 +0000
119 summary: b
119 summary: b
120
120
121 $ hg --repo c --repository b -R a tip
121 $ hg --repo c --repository b -R a tip
122 changeset: 0:8580ff50825a
122 changeset: 0:8580ff50825a
123 tag: tip
123 tag: tip
124 user: test
124 user: test
125 date: Thu Jan 01 00:00:01 1970 +0000
125 date: Thu Jan 01 00:00:01 1970 +0000
126 summary: a
126 summary: a
127
127
128
128
129 earlygetopt short option without following space:
129 earlygetopt short option without following space:
130
130
131 $ hg -q -Rb tip
131 $ hg -q -Rb tip
132 0:b6c483daf290
132 0:b6c483daf290
133
133
134 earlygetopt with illegal abbreviations:
134 earlygetopt with illegal abbreviations:
135
135
136 $ hg --confi "foo.bar=baz"
136 $ hg --confi "foo.bar=baz"
137 abort: option --config may not be abbreviated!
137 abort: option --config may not be abbreviated!
138 [255]
138 [255]
139 $ hg --cw a tip
139 $ hg --cw a tip
140 abort: option --cwd may not be abbreviated!
140 abort: option --cwd may not be abbreviated!
141 [255]
141 [255]
142 $ hg --rep a tip
142 $ hg --rep a tip
143 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
143 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
144 [255]
144 [255]
145 $ hg --repositor a tip
145 $ hg --repositor a tip
146 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
146 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
147 [255]
147 [255]
148 $ hg -qR a tip
148 $ hg -qR a tip
149 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
149 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
150 [255]
150 [255]
151 $ hg -qRa tip
151 $ hg -qRa tip
152 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
152 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
153 [255]
153 [255]
154
154
155 Testing --cwd:
155 Testing --cwd:
156
156
157 $ hg --cwd a parents
157 $ hg --cwd a parents
158 changeset: 0:8580ff50825a
158 changeset: 0:8580ff50825a
159 tag: tip
159 tag: tip
160 user: test
160 user: test
161 date: Thu Jan 01 00:00:01 1970 +0000
161 date: Thu Jan 01 00:00:01 1970 +0000
162 summary: a
162 summary: a
163
163
164
164
165 Testing -y/--noninteractive - just be sure it is parsed:
165 Testing -y/--noninteractive - just be sure it is parsed:
166
166
167 $ hg --cwd a tip -q --noninteractive
167 $ hg --cwd a tip -q --noninteractive
168 0:8580ff50825a
168 0:8580ff50825a
169 $ hg --cwd a tip -q -y
169 $ hg --cwd a tip -q -y
170 0:8580ff50825a
170 0:8580ff50825a
171
171
172 Testing -q/--quiet:
172 Testing -q/--quiet:
173
173
174 $ hg -R a -q tip
174 $ hg -R a -q tip
175 0:8580ff50825a
175 0:8580ff50825a
176 $ hg -R b -q tip
176 $ hg -R b -q tip
177 0:b6c483daf290
177 0:b6c483daf290
178 $ hg -R c --quiet parents
178 $ hg -R c --quiet parents
179 0:8580ff50825a
179 0:8580ff50825a
180 1:b6c483daf290
180 1:b6c483daf290
181
181
182 Testing -v/--verbose:
182 Testing -v/--verbose:
183
183
184 $ hg --cwd c head -v
184 $ hg --cwd c head -v
185 changeset: 1:b6c483daf290
185 changeset: 1:b6c483daf290
186 tag: tip
186 tag: tip
187 parent: -1:000000000000
187 parent: -1:000000000000
188 user: test
188 user: test
189 date: Thu Jan 01 00:00:01 1970 +0000
189 date: Thu Jan 01 00:00:01 1970 +0000
190 files: b
190 files: b
191 description:
191 description:
192 b
192 b
193
193
194
194
195 changeset: 0:8580ff50825a
195 changeset: 0:8580ff50825a
196 user: test
196 user: test
197 date: Thu Jan 01 00:00:01 1970 +0000
197 date: Thu Jan 01 00:00:01 1970 +0000
198 files: a
198 files: a
199 description:
199 description:
200 a
200 a
201
201
202
202
203 $ hg --cwd b tip --verbose
203 $ hg --cwd b tip --verbose
204 changeset: 0:b6c483daf290
204 changeset: 0:b6c483daf290
205 tag: tip
205 tag: tip
206 user: test
206 user: test
207 date: Thu Jan 01 00:00:01 1970 +0000
207 date: Thu Jan 01 00:00:01 1970 +0000
208 files: b
208 files: b
209 description:
209 description:
210 b
210 b
211
211
212
212
213
213
214 Testing --config:
214 Testing --config:
215
215
216 $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
216 $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
217 quuxfoo
217 quuxfoo
218 $ hg --cwd c --config '' tip -q
218 $ hg --cwd c --config '' tip -q
219 abort: malformed --config option: '' (use --config section.name=value)
219 abort: malformed --config option: '' (use --config section.name=value)
220 [255]
220 [255]
221 $ hg --cwd c --config a.b tip -q
221 $ hg --cwd c --config a.b tip -q
222 abort: malformed --config option: 'a.b' (use --config section.name=value)
222 abort: malformed --config option: 'a.b' (use --config section.name=value)
223 [255]
223 [255]
224 $ hg --cwd c --config a tip -q
224 $ hg --cwd c --config a tip -q
225 abort: malformed --config option: 'a' (use --config section.name=value)
225 abort: malformed --config option: 'a' (use --config section.name=value)
226 [255]
226 [255]
227 $ hg --cwd c --config a.= tip -q
227 $ hg --cwd c --config a.= tip -q
228 abort: malformed --config option: 'a.=' (use --config section.name=value)
228 abort: malformed --config option: 'a.=' (use --config section.name=value)
229 [255]
229 [255]
230 $ hg --cwd c --config .b= tip -q
230 $ hg --cwd c --config .b= tip -q
231 abort: malformed --config option: '.b=' (use --config section.name=value)
231 abort: malformed --config option: '.b=' (use --config section.name=value)
232 [255]
232 [255]
233
233
234 Testing --debug:
234 Testing --debug:
235
235
236 $ hg --cwd c log --debug
236 $ hg --cwd c log --debug
237 changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
237 changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
238 tag: tip
238 tag: tip
239 phase: public
239 phase: public
240 parent: -1:0000000000000000000000000000000000000000
240 parent: -1:0000000000000000000000000000000000000000
241 parent: -1:0000000000000000000000000000000000000000
241 parent: -1:0000000000000000000000000000000000000000
242 manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
242 manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
243 user: test
243 user: test
244 date: Thu Jan 01 00:00:01 1970 +0000
244 date: Thu Jan 01 00:00:01 1970 +0000
245 files+: b
245 files+: b
246 extra: branch=default
246 extra: branch=default
247 description:
247 description:
248 b
248 b
249
249
250
250
251 changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
251 changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
252 phase: public
252 phase: public
253 parent: -1:0000000000000000000000000000000000000000
253 parent: -1:0000000000000000000000000000000000000000
254 parent: -1:0000000000000000000000000000000000000000
254 parent: -1:0000000000000000000000000000000000000000
255 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
255 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
256 user: test
256 user: test
257 date: Thu Jan 01 00:00:01 1970 +0000
257 date: Thu Jan 01 00:00:01 1970 +0000
258 files+: a
258 files+: a
259 extra: branch=default
259 extra: branch=default
260 description:
260 description:
261 a
261 a
262
262
263
263
264
264
265 Testing --traceback:
265 Testing --traceback:
266
266
267 #if no-chg
267 #if no-chg
268 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
268 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
269 Traceback (most recent call last):
269 Traceback (most recent call last):
270 #else
270 #else
271 Traceback for '--config' errors not supported with chg.
271 Traceback for '--config' errors not supported with chg.
272 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
272 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
273 [1]
273 [1]
274 #endif
274 #endif
275
275
276 Testing --time:
276 Testing --time:
277
277
278 $ hg --cwd a --time id
278 $ hg --cwd a --time id
279 8580ff50825a tip
279 8580ff50825a tip
280 time: real * (glob)
280 time: real * (glob)
281
281
282 Testing --version:
282 Testing --version:
283
283
284 $ hg --version -q
284 $ hg --version -q
285 Mercurial Distributed SCM * (glob)
285 Mercurial Distributed SCM * (glob)
286
286
287 hide outer repo
287 hide outer repo
288 $ hg init
288 $ hg init
289
289
290 Testing -h/--help:
290 Testing -h/--help:
291
291
292 $ hg -h
292 $ hg -h
293 Mercurial Distributed SCM
293 Mercurial Distributed SCM
294
294
295 list of commands:
295 list of commands:
296
296
297 add add the specified files on the next commit
297 add add the specified files on the next commit
298 addremove add all new files, delete all missing files
298 addremove add all new files, delete all missing files
299 annotate show changeset information by line for each file
299 annotate show changeset information by line for each file
300 archive create an unversioned archive of a repository revision
300 archive create an unversioned archive of a repository revision
301 backout reverse effect of earlier changeset
301 backout reverse effect of earlier changeset
302 bisect subdivision search of changesets
302 bisect subdivision search of changesets
303 bookmarks create a new bookmark or list existing bookmarks
303 bookmarks create a new bookmark or list existing bookmarks
304 branch set or show the current branch name
304 branch set or show the current branch name
305 branches list repository named branches
305 branches list repository named branches
306 bundle create a bundle file
306 bundle create a bundle file
307 cat output the current or given revision of files
307 cat output the current or given revision of files
308 clone make a copy of an existing repository
308 clone make a copy of an existing repository
309 commit commit the specified files or all outstanding changes
309 commit commit the specified files or all outstanding changes
310 config show combined config settings from all hgrc files
310 config show combined config settings from all hgrc files
311 copy mark files as copied for the next commit
311 copy mark files as copied for the next commit
312 diff diff repository (or selected files)
312 diff diff repository (or selected files)
313 export dump the header and diffs for one or more changesets
313 export dump the header and diffs for one or more changesets
314 files list tracked files
314 files list tracked files
315 forget forget the specified files on the next commit
315 forget forget the specified files on the next commit
316 graft copy changes from other branches onto the current branch
316 graft copy changes from other branches onto the current branch
317 grep search revision history for a pattern in specified files
317 grep search revision history for a pattern in specified files
318 heads show branch heads
318 heads show branch heads
319 help show help for a given topic or a help overview
319 help show help for a given topic or a help overview
320 identify identify the working directory or specified revision
320 identify identify the working directory or specified revision
321 import import an ordered set of patches
321 import import an ordered set of patches
322 incoming show new changesets found in source
322 incoming show new changesets found in source
323 init create a new repository in the given directory
323 init create a new repository in the given directory
324 log show revision history of entire repository or files
324 log show revision history of entire repository or files
325 manifest output the current or given revision of the project manifest
325 manifest output the current or given revision of the project manifest
326 merge merge another revision into working directory
326 merge merge another revision into working directory
327 outgoing show changesets not found in the destination
327 outgoing show changesets not found in the destination
328 paths show aliases for remote repositories
328 paths show aliases for remote repositories
329 phase set or show the current phase name
329 phase set or show the current phase name
330 pull pull changes from the specified source
330 pull pull changes from the specified source
331 push push changes to the specified destination
331 push push changes to the specified destination
332 recover roll back an interrupted transaction
332 recover roll back an interrupted transaction
333 remove remove the specified files on the next commit
333 remove remove the specified files on the next commit
334 rename rename files; equivalent of copy + remove
334 rename rename files; equivalent of copy + remove
335 resolve redo merges or set/view the merge status of files
335 resolve redo merges or set/view the merge status of files
336 revert restore files to their checkout state
336 revert restore files to their checkout state
337 root print the root (top) of the current working directory
337 root print the root (top) of the current working directory
338 serve start stand-alone webserver
338 serve start stand-alone webserver
339 status show changed files in the working directory
339 status show changed files in the working directory
340 summary summarize working directory state
340 summary summarize working directory state
341 tag add one or more tags for the current or given revision
341 tag add one or more tags for the current or given revision
342 tags list repository tags
342 tags list repository tags
343 unbundle apply one or more bundle files
343 unbundle apply one or more bundle files
344 update update working directory (or switch revisions)
344 update update working directory (or switch revisions)
345 verify verify the integrity of the repository
345 verify verify the integrity of the repository
346 version output version and copyright information
346 version output version and copyright information
347
347
348 additional help topics:
348 additional help topics:
349
349
350 bundlespec Bundle File Formats
350 bundlespec Bundle File Formats
351 color Colorizing Outputs
351 color Colorizing Outputs
352 config Configuration Files
352 config Configuration Files
353 dates Date Formats
353 dates Date Formats
354 diffs Diff Formats
354 diffs Diff Formats
355 environment Environment Variables
355 environment Environment Variables
356 extensions Using Additional Features
356 extensions Using Additional Features
357 filesets Specifying File Sets
357 filesets Specifying File Sets
358 flags Command-line flags
358 glossary Glossary
359 glossary Glossary
359 hgignore Syntax for Mercurial Ignore Files
360 hgignore Syntax for Mercurial Ignore Files
360 hgweb Configuring hgweb
361 hgweb Configuring hgweb
361 internals Technical implementation topics
362 internals Technical implementation topics
362 merge-tools Merge Tools
363 merge-tools Merge Tools
363 pager Pager Support
364 pager Pager Support
364 patterns File Name Patterns
365 patterns File Name Patterns
365 phases Working with Phases
366 phases Working with Phases
366 revisions Specifying Revisions
367 revisions Specifying Revisions
367 scripting Using Mercurial from scripts and automation
368 scripting Using Mercurial from scripts and automation
368 subrepos Subrepositories
369 subrepos Subrepositories
369 templating Template Usage
370 templating Template Usage
370 urls URL Paths
371 urls URL Paths
371
372
372 (use 'hg help -v' to show built-in aliases and global options)
373 (use 'hg help -v' to show built-in aliases and global options)
373
374
374
375
375
376
376 $ hg --help
377 $ hg --help
377 Mercurial Distributed SCM
378 Mercurial Distributed SCM
378
379
379 list of commands:
380 list of commands:
380
381
381 add add the specified files on the next commit
382 add add the specified files on the next commit
382 addremove add all new files, delete all missing files
383 addremove add all new files, delete all missing files
383 annotate show changeset information by line for each file
384 annotate show changeset information by line for each file
384 archive create an unversioned archive of a repository revision
385 archive create an unversioned archive of a repository revision
385 backout reverse effect of earlier changeset
386 backout reverse effect of earlier changeset
386 bisect subdivision search of changesets
387 bisect subdivision search of changesets
387 bookmarks create a new bookmark or list existing bookmarks
388 bookmarks create a new bookmark or list existing bookmarks
388 branch set or show the current branch name
389 branch set or show the current branch name
389 branches list repository named branches
390 branches list repository named branches
390 bundle create a bundle file
391 bundle create a bundle file
391 cat output the current or given revision of files
392 cat output the current or given revision of files
392 clone make a copy of an existing repository
393 clone make a copy of an existing repository
393 commit commit the specified files or all outstanding changes
394 commit commit the specified files or all outstanding changes
394 config show combined config settings from all hgrc files
395 config show combined config settings from all hgrc files
395 copy mark files as copied for the next commit
396 copy mark files as copied for the next commit
396 diff diff repository (or selected files)
397 diff diff repository (or selected files)
397 export dump the header and diffs for one or more changesets
398 export dump the header and diffs for one or more changesets
398 files list tracked files
399 files list tracked files
399 forget forget the specified files on the next commit
400 forget forget the specified files on the next commit
400 graft copy changes from other branches onto the current branch
401 graft copy changes from other branches onto the current branch
401 grep search revision history for a pattern in specified files
402 grep search revision history for a pattern in specified files
402 heads show branch heads
403 heads show branch heads
403 help show help for a given topic or a help overview
404 help show help for a given topic or a help overview
404 identify identify the working directory or specified revision
405 identify identify the working directory or specified revision
405 import import an ordered set of patches
406 import import an ordered set of patches
406 incoming show new changesets found in source
407 incoming show new changesets found in source
407 init create a new repository in the given directory
408 init create a new repository in the given directory
408 log show revision history of entire repository or files
409 log show revision history of entire repository or files
409 manifest output the current or given revision of the project manifest
410 manifest output the current or given revision of the project manifest
410 merge merge another revision into working directory
411 merge merge another revision into working directory
411 outgoing show changesets not found in the destination
412 outgoing show changesets not found in the destination
412 paths show aliases for remote repositories
413 paths show aliases for remote repositories
413 phase set or show the current phase name
414 phase set or show the current phase name
414 pull pull changes from the specified source
415 pull pull changes from the specified source
415 push push changes to the specified destination
416 push push changes to the specified destination
416 recover roll back an interrupted transaction
417 recover roll back an interrupted transaction
417 remove remove the specified files on the next commit
418 remove remove the specified files on the next commit
418 rename rename files; equivalent of copy + remove
419 rename rename files; equivalent of copy + remove
419 resolve redo merges or set/view the merge status of files
420 resolve redo merges or set/view the merge status of files
420 revert restore files to their checkout state
421 revert restore files to their checkout state
421 root print the root (top) of the current working directory
422 root print the root (top) of the current working directory
422 serve start stand-alone webserver
423 serve start stand-alone webserver
423 status show changed files in the working directory
424 status show changed files in the working directory
424 summary summarize working directory state
425 summary summarize working directory state
425 tag add one or more tags for the current or given revision
426 tag add one or more tags for the current or given revision
426 tags list repository tags
427 tags list repository tags
427 unbundle apply one or more bundle files
428 unbundle apply one or more bundle files
428 update update working directory (or switch revisions)
429 update update working directory (or switch revisions)
429 verify verify the integrity of the repository
430 verify verify the integrity of the repository
430 version output version and copyright information
431 version output version and copyright information
431
432
432 additional help topics:
433 additional help topics:
433
434
434 bundlespec Bundle File Formats
435 bundlespec Bundle File Formats
435 color Colorizing Outputs
436 color Colorizing Outputs
436 config Configuration Files
437 config Configuration Files
437 dates Date Formats
438 dates Date Formats
438 diffs Diff Formats
439 diffs Diff Formats
439 environment Environment Variables
440 environment Environment Variables
440 extensions Using Additional Features
441 extensions Using Additional Features
441 filesets Specifying File Sets
442 filesets Specifying File Sets
443 flags Command-line flags
442 glossary Glossary
444 glossary Glossary
443 hgignore Syntax for Mercurial Ignore Files
445 hgignore Syntax for Mercurial Ignore Files
444 hgweb Configuring hgweb
446 hgweb Configuring hgweb
445 internals Technical implementation topics
447 internals Technical implementation topics
446 merge-tools Merge Tools
448 merge-tools Merge Tools
447 pager Pager Support
449 pager Pager Support
448 patterns File Name Patterns
450 patterns File Name Patterns
449 phases Working with Phases
451 phases Working with Phases
450 revisions Specifying Revisions
452 revisions Specifying Revisions
451 scripting Using Mercurial from scripts and automation
453 scripting Using Mercurial from scripts and automation
452 subrepos Subrepositories
454 subrepos Subrepositories
453 templating Template Usage
455 templating Template Usage
454 urls URL Paths
456 urls URL Paths
455
457
456 (use 'hg help -v' to show built-in aliases and global options)
458 (use 'hg help -v' to show built-in aliases and global options)
457
459
458 Not tested: --debugger
460 Not tested: --debugger
459
461
@@ -1,3378 +1,3388 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 bundle file
61 bundle create a bundle 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 revision history for a pattern in specified files
72 grep search revision history for a pattern in specified files
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 bundle files
98 unbundle apply one or more bundle 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 bundlespec Bundle File Formats
105 bundlespec Bundle File Formats
106 color Colorizing Outputs
106 color Colorizing Outputs
107 config Configuration Files
107 config Configuration Files
108 dates Date Formats
108 dates Date Formats
109 diffs Diff Formats
109 diffs Diff Formats
110 environment Environment Variables
110 environment Environment Variables
111 extensions Using Additional Features
111 extensions Using Additional Features
112 filesets Specifying File Sets
112 filesets Specifying File Sets
113 flags Command-line flags
113 glossary Glossary
114 glossary Glossary
114 hgignore Syntax for Mercurial Ignore Files
115 hgignore Syntax for Mercurial Ignore Files
115 hgweb Configuring hgweb
116 hgweb Configuring hgweb
116 internals Technical implementation topics
117 internals Technical implementation topics
117 merge-tools Merge Tools
118 merge-tools Merge Tools
118 pager Pager Support
119 pager Pager Support
119 patterns File Name Patterns
120 patterns File Name Patterns
120 phases Working with Phases
121 phases Working with Phases
121 revisions Specifying Revisions
122 revisions Specifying Revisions
122 scripting Using Mercurial from scripts and automation
123 scripting Using Mercurial from scripts and automation
123 subrepos Subrepositories
124 subrepos Subrepositories
124 templating Template Usage
125 templating Template Usage
125 urls URL Paths
126 urls URL Paths
126
127
127 (use 'hg help -v' to show built-in aliases and global options)
128 (use 'hg help -v' to show built-in aliases and global options)
128
129
129 $ hg -q help
130 $ hg -q help
130 add add the specified files on the next commit
131 add add the specified files on the next commit
131 addremove add all new files, delete all missing files
132 addremove add all new files, delete all missing files
132 annotate show changeset information by line for each file
133 annotate show changeset information by line for each file
133 archive create an unversioned archive of a repository revision
134 archive create an unversioned archive of a repository revision
134 backout reverse effect of earlier changeset
135 backout reverse effect of earlier changeset
135 bisect subdivision search of changesets
136 bisect subdivision search of changesets
136 bookmarks create a new bookmark or list existing bookmarks
137 bookmarks create a new bookmark or list existing bookmarks
137 branch set or show the current branch name
138 branch set or show the current branch name
138 branches list repository named branches
139 branches list repository named branches
139 bundle create a bundle file
140 bundle create a bundle file
140 cat output the current or given revision of files
141 cat output the current or given revision of files
141 clone make a copy of an existing repository
142 clone make a copy of an existing repository
142 commit commit the specified files or all outstanding changes
143 commit commit the specified files or all outstanding changes
143 config show combined config settings from all hgrc files
144 config show combined config settings from all hgrc files
144 copy mark files as copied for the next commit
145 copy mark files as copied for the next commit
145 diff diff repository (or selected files)
146 diff diff repository (or selected files)
146 export dump the header and diffs for one or more changesets
147 export dump the header and diffs for one or more changesets
147 files list tracked files
148 files list tracked files
148 forget forget the specified files on the next commit
149 forget forget the specified files on the next commit
149 graft copy changes from other branches onto the current branch
150 graft copy changes from other branches onto the current branch
150 grep search revision history for a pattern in specified files
151 grep search revision history for a pattern in specified files
151 heads show branch heads
152 heads show branch heads
152 help show help for a given topic or a help overview
153 help show help for a given topic or a help overview
153 identify identify the working directory or specified revision
154 identify identify the working directory or specified revision
154 import import an ordered set of patches
155 import import an ordered set of patches
155 incoming show new changesets found in source
156 incoming show new changesets found in source
156 init create a new repository in the given directory
157 init create a new repository in the given directory
157 log show revision history of entire repository or files
158 log show revision history of entire repository or files
158 manifest output the current or given revision of the project manifest
159 manifest output the current or given revision of the project manifest
159 merge merge another revision into working directory
160 merge merge another revision into working directory
160 outgoing show changesets not found in the destination
161 outgoing show changesets not found in the destination
161 paths show aliases for remote repositories
162 paths show aliases for remote repositories
162 phase set or show the current phase name
163 phase set or show the current phase name
163 pull pull changes from the specified source
164 pull pull changes from the specified source
164 push push changes to the specified destination
165 push push changes to the specified destination
165 recover roll back an interrupted transaction
166 recover roll back an interrupted transaction
166 remove remove the specified files on the next commit
167 remove remove the specified files on the next commit
167 rename rename files; equivalent of copy + remove
168 rename rename files; equivalent of copy + remove
168 resolve redo merges or set/view the merge status of files
169 resolve redo merges or set/view the merge status of files
169 revert restore files to their checkout state
170 revert restore files to their checkout state
170 root print the root (top) of the current working directory
171 root print the root (top) of the current working directory
171 serve start stand-alone webserver
172 serve start stand-alone webserver
172 status show changed files in the working directory
173 status show changed files in the working directory
173 summary summarize working directory state
174 summary summarize working directory state
174 tag add one or more tags for the current or given revision
175 tag add one or more tags for the current or given revision
175 tags list repository tags
176 tags list repository tags
176 unbundle apply one or more bundle files
177 unbundle apply one or more bundle files
177 update update working directory (or switch revisions)
178 update update working directory (or switch revisions)
178 verify verify the integrity of the repository
179 verify verify the integrity of the repository
179 version output version and copyright information
180 version output version and copyright information
180
181
181 additional help topics:
182 additional help topics:
182
183
183 bundlespec Bundle File Formats
184 bundlespec Bundle File Formats
184 color Colorizing Outputs
185 color Colorizing Outputs
185 config Configuration Files
186 config Configuration Files
186 dates Date Formats
187 dates Date Formats
187 diffs Diff Formats
188 diffs Diff Formats
188 environment Environment Variables
189 environment Environment Variables
189 extensions Using Additional Features
190 extensions Using Additional Features
190 filesets Specifying File Sets
191 filesets Specifying File Sets
192 flags Command-line flags
191 glossary Glossary
193 glossary Glossary
192 hgignore Syntax for Mercurial Ignore Files
194 hgignore Syntax for Mercurial Ignore Files
193 hgweb Configuring hgweb
195 hgweb Configuring hgweb
194 internals Technical implementation topics
196 internals Technical implementation topics
195 merge-tools Merge Tools
197 merge-tools Merge Tools
196 pager Pager Support
198 pager Pager Support
197 patterns File Name Patterns
199 patterns File Name Patterns
198 phases Working with Phases
200 phases Working with Phases
199 revisions Specifying Revisions
201 revisions Specifying Revisions
200 scripting Using Mercurial from scripts and automation
202 scripting Using Mercurial from scripts and automation
201 subrepos Subrepositories
203 subrepos Subrepositories
202 templating Template Usage
204 templating Template Usage
203 urls URL Paths
205 urls URL Paths
204
206
205 Test extension help:
207 Test extension help:
206 $ hg help extensions --config extensions.rebase= --config extensions.children=
208 $ hg help extensions --config extensions.rebase= --config extensions.children=
207 Using Additional Features
209 Using Additional Features
208 """""""""""""""""""""""""
210 """""""""""""""""""""""""
209
211
210 Mercurial has the ability to add new features through the use of
212 Mercurial has the ability to add new features through the use of
211 extensions. Extensions may add new commands, add options to existing
213 extensions. Extensions may add new commands, add options to existing
212 commands, change the default behavior of commands, or implement hooks.
214 commands, change the default behavior of commands, or implement hooks.
213
215
214 To enable the "foo" extension, either shipped with Mercurial or in the
216 To enable the "foo" extension, either shipped with Mercurial or in the
215 Python search path, create an entry for it in your configuration file,
217 Python search path, create an entry for it in your configuration file,
216 like this:
218 like this:
217
219
218 [extensions]
220 [extensions]
219 foo =
221 foo =
220
222
221 You may also specify the full path to an extension:
223 You may also specify the full path to an extension:
222
224
223 [extensions]
225 [extensions]
224 myfeature = ~/.hgext/myfeature.py
226 myfeature = ~/.hgext/myfeature.py
225
227
226 See 'hg help config' for more information on configuration files.
228 See 'hg help config' for more information on configuration files.
227
229
228 Extensions are not loaded by default for a variety of reasons: they can
230 Extensions are not loaded by default for a variety of reasons: they can
229 increase startup overhead; they may be meant for advanced usage only; they
231 increase startup overhead; they may be meant for advanced usage only; they
230 may provide potentially dangerous abilities (such as letting you destroy
232 may provide potentially dangerous abilities (such as letting you destroy
231 or modify history); they might not be ready for prime time; or they may
233 or modify history); they might not be ready for prime time; or they may
232 alter some usual behaviors of stock Mercurial. It is thus up to the user
234 alter some usual behaviors of stock Mercurial. It is thus up to the user
233 to activate extensions as needed.
235 to activate extensions as needed.
234
236
235 To explicitly disable an extension enabled in a configuration file of
237 To explicitly disable an extension enabled in a configuration file of
236 broader scope, prepend its path with !:
238 broader scope, prepend its path with !:
237
239
238 [extensions]
240 [extensions]
239 # disabling extension bar residing in /path/to/extension/bar.py
241 # disabling extension bar residing in /path/to/extension/bar.py
240 bar = !/path/to/extension/bar.py
242 bar = !/path/to/extension/bar.py
241 # ditto, but no path was supplied for extension baz
243 # ditto, but no path was supplied for extension baz
242 baz = !
244 baz = !
243
245
244 enabled extensions:
246 enabled extensions:
245
247
246 children command to display child changesets (DEPRECATED)
248 children command to display child changesets (DEPRECATED)
247 rebase command to move sets of revisions to a different ancestor
249 rebase command to move sets of revisions to a different ancestor
248
250
249 disabled extensions:
251 disabled extensions:
250
252
251 acl hooks for controlling repository access
253 acl hooks for controlling repository access
252 blackbox log repository events to a blackbox for debugging
254 blackbox log repository events to a blackbox for debugging
253 bugzilla hooks for integrating with the Bugzilla bug tracker
255 bugzilla hooks for integrating with the Bugzilla bug tracker
254 censor erase file content at a given revision
256 censor erase file content at a given revision
255 churn command to display statistics about repository history
257 churn command to display statistics about repository history
256 clonebundles advertise pre-generated bundles to seed clones
258 clonebundles advertise pre-generated bundles to seed clones
257 convert import revisions from foreign VCS repositories into
259 convert import revisions from foreign VCS repositories into
258 Mercurial
260 Mercurial
259 eol automatically manage newlines in repository files
261 eol automatically manage newlines in repository files
260 extdiff command to allow external programs to compare revisions
262 extdiff command to allow external programs to compare revisions
261 factotum http authentication with factotum
263 factotum http authentication with factotum
262 gpg commands to sign and verify changesets
264 gpg commands to sign and verify changesets
263 hgk browse the repository in a graphical way
265 hgk browse the repository in a graphical way
264 highlight syntax highlighting for hgweb (requires Pygments)
266 highlight syntax highlighting for hgweb (requires Pygments)
265 histedit interactive history editing
267 histedit interactive history editing
266 keyword expand keywords in tracked files
268 keyword expand keywords in tracked files
267 largefiles track large binary files
269 largefiles track large binary files
268 mq manage a stack of patches
270 mq manage a stack of patches
269 notify hooks for sending email push notifications
271 notify hooks for sending email push notifications
270 patchbomb command to send changesets as (a series of) patch emails
272 patchbomb command to send changesets as (a series of) patch emails
271 purge command to delete untracked files from the working
273 purge command to delete untracked files from the working
272 directory
274 directory
273 relink recreates hardlinks between repository clones
275 relink recreates hardlinks between repository clones
274 schemes extend schemes with shortcuts to repository swarms
276 schemes extend schemes with shortcuts to repository swarms
275 share share a common history between several working directories
277 share share a common history between several working directories
276 shelve save and restore changes to the working directory
278 shelve save and restore changes to the working directory
277 strip strip changesets and their descendants from history
279 strip strip changesets and their descendants from history
278 transplant command to transplant changesets from another branch
280 transplant command to transplant changesets from another branch
279 win32mbcs allow the use of MBCS paths with problematic encodings
281 win32mbcs allow the use of MBCS paths with problematic encodings
280 zeroconf discover and advertise repositories on the local network
282 zeroconf discover and advertise repositories on the local network
281
283
282 Verify that extension keywords appear in help templates
284 Verify that extension keywords appear in help templates
283
285
284 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
286 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
285
287
286 Test short command list with verbose option
288 Test short command list with verbose option
287
289
288 $ hg -v help shortlist
290 $ hg -v help shortlist
289 Mercurial Distributed SCM
291 Mercurial Distributed SCM
290
292
291 basic commands:
293 basic commands:
292
294
293 add add the specified files on the next commit
295 add add the specified files on the next commit
294 annotate, blame
296 annotate, blame
295 show changeset information by line for each file
297 show changeset information by line for each file
296 clone make a copy of an existing repository
298 clone make a copy of an existing repository
297 commit, ci commit the specified files or all outstanding changes
299 commit, ci commit the specified files or all outstanding changes
298 diff diff repository (or selected files)
300 diff diff repository (or selected files)
299 export dump the header and diffs for one or more changesets
301 export dump the header and diffs for one or more changesets
300 forget forget the specified files on the next commit
302 forget forget the specified files on the next commit
301 init create a new repository in the given directory
303 init create a new repository in the given directory
302 log, history show revision history of entire repository or files
304 log, history show revision history of entire repository or files
303 merge merge another revision into working directory
305 merge merge another revision into working directory
304 pull pull changes from the specified source
306 pull pull changes from the specified source
305 push push changes to the specified destination
307 push push changes to the specified destination
306 remove, rm remove the specified files on the next commit
308 remove, rm remove the specified files on the next commit
307 serve start stand-alone webserver
309 serve start stand-alone webserver
308 status, st show changed files in the working directory
310 status, st show changed files in the working directory
309 summary, sum summarize working directory state
311 summary, sum summarize working directory state
310 update, up, checkout, co
312 update, up, checkout, co
311 update working directory (or switch revisions)
313 update working directory (or switch revisions)
312
314
313 global options ([+] can be repeated):
315 global options ([+] can be repeated):
314
316
315 -R --repository REPO repository root directory or name of overlay bundle
317 -R --repository REPO repository root directory or name of overlay bundle
316 file
318 file
317 --cwd DIR change working directory
319 --cwd DIR change working directory
318 -y --noninteractive do not prompt, automatically pick the first choice for
320 -y --noninteractive do not prompt, automatically pick the first choice for
319 all prompts
321 all prompts
320 -q --quiet suppress output
322 -q --quiet suppress output
321 -v --verbose enable additional output
323 -v --verbose enable additional output
322 --color TYPE when to colorize (boolean, always, auto, never, or
324 --color TYPE when to colorize (boolean, always, auto, never, or
323 debug)
325 debug)
324 --config CONFIG [+] set/override config option (use 'section.name=value')
326 --config CONFIG [+] set/override config option (use 'section.name=value')
325 --debug enable debugging output
327 --debug enable debugging output
326 --debugger start debugger
328 --debugger start debugger
327 --encoding ENCODE set the charset encoding (default: ascii)
329 --encoding ENCODE set the charset encoding (default: ascii)
328 --encodingmode MODE set the charset encoding mode (default: strict)
330 --encodingmode MODE set the charset encoding mode (default: strict)
329 --traceback always print a traceback on exception
331 --traceback always print a traceback on exception
330 --time time how long the command takes
332 --time time how long the command takes
331 --profile print command execution profile
333 --profile print command execution profile
332 --version output version information and exit
334 --version output version information and exit
333 -h --help display help and exit
335 -h --help display help and exit
334 --hidden consider hidden changesets
336 --hidden consider hidden changesets
335 --pager TYPE when to paginate (boolean, always, auto, or never)
337 --pager TYPE when to paginate (boolean, always, auto, or never)
336 (default: auto)
338 (default: auto)
337
339
338 (use 'hg help' for the full list of commands)
340 (use 'hg help' for the full list of commands)
339
341
340 $ hg add -h
342 $ hg add -h
341 hg add [OPTION]... [FILE]...
343 hg add [OPTION]... [FILE]...
342
344
343 add the specified files on the next commit
345 add the specified files on the next commit
344
346
345 Schedule files to be version controlled and added to the repository.
347 Schedule files to be version controlled and added to the repository.
346
348
347 The files will be added to the repository at the next commit. To undo an
349 The files will be added to the repository at the next commit. To undo an
348 add before that, see 'hg forget'.
350 add before that, see 'hg forget'.
349
351
350 If no names are given, add all files to the repository (except files
352 If no names are given, add all files to the repository (except files
351 matching ".hgignore").
353 matching ".hgignore").
352
354
353 Returns 0 if all files are successfully added.
355 Returns 0 if all files are successfully added.
354
356
355 options ([+] can be repeated):
357 options ([+] can be repeated):
356
358
357 -I --include PATTERN [+] include names matching the given patterns
359 -I --include PATTERN [+] include names matching the given patterns
358 -X --exclude PATTERN [+] exclude names matching the given patterns
360 -X --exclude PATTERN [+] exclude names matching the given patterns
359 -S --subrepos recurse into subrepositories
361 -S --subrepos recurse into subrepositories
360 -n --dry-run do not perform actions, just print output
362 -n --dry-run do not perform actions, just print output
361
363
362 (some details hidden, use --verbose to show complete help)
364 (some details hidden, use --verbose to show complete help)
363
365
364 Verbose help for add
366 Verbose help for add
365
367
366 $ hg add -hv
368 $ hg add -hv
367 hg add [OPTION]... [FILE]...
369 hg add [OPTION]... [FILE]...
368
370
369 add the specified files on the next commit
371 add the specified files on the next commit
370
372
371 Schedule files to be version controlled and added to the repository.
373 Schedule files to be version controlled and added to the repository.
372
374
373 The files will be added to the repository at the next commit. To undo an
375 The files will be added to the repository at the next commit. To undo an
374 add before that, see 'hg forget'.
376 add before that, see 'hg forget'.
375
377
376 If no names are given, add all files to the repository (except files
378 If no names are given, add all files to the repository (except files
377 matching ".hgignore").
379 matching ".hgignore").
378
380
379 Examples:
381 Examples:
380
382
381 - New (unknown) files are added automatically by 'hg add':
383 - New (unknown) files are added automatically by 'hg add':
382
384
383 $ ls
385 $ ls
384 foo.c
386 foo.c
385 $ hg status
387 $ hg status
386 ? foo.c
388 ? foo.c
387 $ hg add
389 $ hg add
388 adding foo.c
390 adding foo.c
389 $ hg status
391 $ hg status
390 A foo.c
392 A foo.c
391
393
392 - Specific files to be added can be specified:
394 - Specific files to be added can be specified:
393
395
394 $ ls
396 $ ls
395 bar.c foo.c
397 bar.c foo.c
396 $ hg status
398 $ hg status
397 ? bar.c
399 ? bar.c
398 ? foo.c
400 ? foo.c
399 $ hg add bar.c
401 $ hg add bar.c
400 $ hg status
402 $ hg status
401 A bar.c
403 A bar.c
402 ? foo.c
404 ? foo.c
403
405
404 Returns 0 if all files are successfully added.
406 Returns 0 if all files are successfully added.
405
407
406 options ([+] can be repeated):
408 options ([+] can be repeated):
407
409
408 -I --include PATTERN [+] include names matching the given patterns
410 -I --include PATTERN [+] include names matching the given patterns
409 -X --exclude PATTERN [+] exclude names matching the given patterns
411 -X --exclude PATTERN [+] exclude names matching the given patterns
410 -S --subrepos recurse into subrepositories
412 -S --subrepos recurse into subrepositories
411 -n --dry-run do not perform actions, just print output
413 -n --dry-run do not perform actions, just print output
412
414
413 global options ([+] can be repeated):
415 global options ([+] can be repeated):
414
416
415 -R --repository REPO repository root directory or name of overlay bundle
417 -R --repository REPO repository root directory or name of overlay bundle
416 file
418 file
417 --cwd DIR change working directory
419 --cwd DIR change working directory
418 -y --noninteractive do not prompt, automatically pick the first choice for
420 -y --noninteractive do not prompt, automatically pick the first choice for
419 all prompts
421 all prompts
420 -q --quiet suppress output
422 -q --quiet suppress output
421 -v --verbose enable additional output
423 -v --verbose enable additional output
422 --color TYPE when to colorize (boolean, always, auto, never, or
424 --color TYPE when to colorize (boolean, always, auto, never, or
423 debug)
425 debug)
424 --config CONFIG [+] set/override config option (use 'section.name=value')
426 --config CONFIG [+] set/override config option (use 'section.name=value')
425 --debug enable debugging output
427 --debug enable debugging output
426 --debugger start debugger
428 --debugger start debugger
427 --encoding ENCODE set the charset encoding (default: ascii)
429 --encoding ENCODE set the charset encoding (default: ascii)
428 --encodingmode MODE set the charset encoding mode (default: strict)
430 --encodingmode MODE set the charset encoding mode (default: strict)
429 --traceback always print a traceback on exception
431 --traceback always print a traceback on exception
430 --time time how long the command takes
432 --time time how long the command takes
431 --profile print command execution profile
433 --profile print command execution profile
432 --version output version information and exit
434 --version output version information and exit
433 -h --help display help and exit
435 -h --help display help and exit
434 --hidden consider hidden changesets
436 --hidden consider hidden changesets
435 --pager TYPE when to paginate (boolean, always, auto, or never)
437 --pager TYPE when to paginate (boolean, always, auto, or never)
436 (default: auto)
438 (default: auto)
437
439
438 Test the textwidth config option
440 Test the textwidth config option
439
441
440 $ hg root -h --config ui.textwidth=50
442 $ hg root -h --config ui.textwidth=50
441 hg root
443 hg root
442
444
443 print the root (top) of the current working
445 print the root (top) of the current working
444 directory
446 directory
445
447
446 Print the root directory of the current
448 Print the root directory of the current
447 repository.
449 repository.
448
450
449 Returns 0 on success.
451 Returns 0 on success.
450
452
451 (some details hidden, use --verbose to show
453 (some details hidden, use --verbose to show
452 complete help)
454 complete help)
453
455
454 Test help option with version option
456 Test help option with version option
455
457
456 $ hg add -h --version
458 $ hg add -h --version
457 Mercurial Distributed SCM (version *) (glob)
459 Mercurial Distributed SCM (version *) (glob)
458 (see https://mercurial-scm.org for more information)
460 (see https://mercurial-scm.org for more information)
459
461
460 Copyright (C) 2005-* Matt Mackall and others (glob)
462 Copyright (C) 2005-* Matt Mackall and others (glob)
461 This is free software; see the source for copying conditions. There is NO
463 This is free software; see the source for copying conditions. There is NO
462 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
464 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
463
465
464 $ hg add --skjdfks
466 $ hg add --skjdfks
465 hg add: option --skjdfks not recognized
467 hg add: option --skjdfks not recognized
466 hg add [OPTION]... [FILE]...
468 hg add [OPTION]... [FILE]...
467
469
468 add the specified files on the next commit
470 add the specified files on the next commit
469
471
470 options ([+] can be repeated):
472 options ([+] can be repeated):
471
473
472 -I --include PATTERN [+] include names matching the given patterns
474 -I --include PATTERN [+] include names matching the given patterns
473 -X --exclude PATTERN [+] exclude names matching the given patterns
475 -X --exclude PATTERN [+] exclude names matching the given patterns
474 -S --subrepos recurse into subrepositories
476 -S --subrepos recurse into subrepositories
475 -n --dry-run do not perform actions, just print output
477 -n --dry-run do not perform actions, just print output
476
478
477 (use 'hg add -h' to show more help)
479 (use 'hg add -h' to show more help)
478 [255]
480 [255]
479
481
480 Test ambiguous command help
482 Test ambiguous command help
481
483
482 $ hg help ad
484 $ hg help ad
483 list of commands:
485 list of commands:
484
486
485 add add the specified files on the next commit
487 add add the specified files on the next commit
486 addremove add all new files, delete all missing files
488 addremove add all new files, delete all missing files
487
489
488 (use 'hg help -v ad' to show built-in aliases and global options)
490 (use 'hg help -v ad' to show built-in aliases and global options)
489
491
490 Test command without options
492 Test command without options
491
493
492 $ hg help verify
494 $ hg help verify
493 hg verify
495 hg verify
494
496
495 verify the integrity of the repository
497 verify the integrity of the repository
496
498
497 Verify the integrity of the current repository.
499 Verify the integrity of the current repository.
498
500
499 This will perform an extensive check of the repository's integrity,
501 This will perform an extensive check of the repository's integrity,
500 validating the hashes and checksums of each entry in the changelog,
502 validating the hashes and checksums of each entry in the changelog,
501 manifest, and tracked files, as well as the integrity of their crosslinks
503 manifest, and tracked files, as well as the integrity of their crosslinks
502 and indices.
504 and indices.
503
505
504 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
506 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
505 information about recovery from corruption of the repository.
507 information about recovery from corruption of the repository.
506
508
507 Returns 0 on success, 1 if errors are encountered.
509 Returns 0 on success, 1 if errors are encountered.
508
510
509 (some details hidden, use --verbose to show complete help)
511 (some details hidden, use --verbose to show complete help)
510
512
511 $ hg help diff
513 $ hg help diff
512 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
514 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
513
515
514 diff repository (or selected files)
516 diff repository (or selected files)
515
517
516 Show differences between revisions for the specified files.
518 Show differences between revisions for the specified files.
517
519
518 Differences between files are shown using the unified diff format.
520 Differences between files are shown using the unified diff format.
519
521
520 Note:
522 Note:
521 'hg diff' may generate unexpected results for merges, as it will
523 'hg diff' may generate unexpected results for merges, as it will
522 default to comparing against the working directory's first parent
524 default to comparing against the working directory's first parent
523 changeset if no revisions are specified.
525 changeset if no revisions are specified.
524
526
525 When two revision arguments are given, then changes are shown between
527 When two revision arguments are given, then changes are shown between
526 those revisions. If only one revision is specified then that revision is
528 those revisions. If only one revision is specified then that revision is
527 compared to the working directory, and, when no revisions are specified,
529 compared to the working directory, and, when no revisions are specified,
528 the working directory files are compared to its first parent.
530 the working directory files are compared to its first parent.
529
531
530 Alternatively you can specify -c/--change with a revision to see the
532 Alternatively you can specify -c/--change with a revision to see the
531 changes in that changeset relative to its first parent.
533 changes in that changeset relative to its first parent.
532
534
533 Without the -a/--text option, diff will avoid generating diffs of files it
535 Without the -a/--text option, diff will avoid generating diffs of files it
534 detects as binary. With -a, diff will generate a diff anyway, probably
536 detects as binary. With -a, diff will generate a diff anyway, probably
535 with undesirable results.
537 with undesirable results.
536
538
537 Use the -g/--git option to generate diffs in the git extended diff format.
539 Use the -g/--git option to generate diffs in the git extended diff format.
538 For more information, read 'hg help diffs'.
540 For more information, read 'hg help diffs'.
539
541
540 Returns 0 on success.
542 Returns 0 on success.
541
543
542 options ([+] can be repeated):
544 options ([+] can be repeated):
543
545
544 -r --rev REV [+] revision
546 -r --rev REV [+] revision
545 -c --change REV change made by revision
547 -c --change REV change made by revision
546 -a --text treat all files as text
548 -a --text treat all files as text
547 -g --git use git extended diff format
549 -g --git use git extended diff format
548 --binary generate binary diffs in git mode (default)
550 --binary generate binary diffs in git mode (default)
549 --nodates omit dates from diff headers
551 --nodates omit dates from diff headers
550 --noprefix omit a/ and b/ prefixes from filenames
552 --noprefix omit a/ and b/ prefixes from filenames
551 -p --show-function show which function each change is in
553 -p --show-function show which function each change is in
552 --reverse produce a diff that undoes the changes
554 --reverse produce a diff that undoes the changes
553 -w --ignore-all-space ignore white space when comparing lines
555 -w --ignore-all-space ignore white space when comparing lines
554 -b --ignore-space-change ignore changes in the amount of white space
556 -b --ignore-space-change ignore changes in the amount of white space
555 -B --ignore-blank-lines ignore changes whose lines are all blank
557 -B --ignore-blank-lines ignore changes whose lines are all blank
556 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
558 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
557 -U --unified NUM number of lines of context to show
559 -U --unified NUM number of lines of context to show
558 --stat output diffstat-style summary of changes
560 --stat output diffstat-style summary of changes
559 --root DIR produce diffs relative to subdirectory
561 --root DIR produce diffs relative to subdirectory
560 -I --include PATTERN [+] include names matching the given patterns
562 -I --include PATTERN [+] include names matching the given patterns
561 -X --exclude PATTERN [+] exclude names matching the given patterns
563 -X --exclude PATTERN [+] exclude names matching the given patterns
562 -S --subrepos recurse into subrepositories
564 -S --subrepos recurse into subrepositories
563
565
564 (some details hidden, use --verbose to show complete help)
566 (some details hidden, use --verbose to show complete help)
565
567
566 $ hg help status
568 $ hg help status
567 hg status [OPTION]... [FILE]...
569 hg status [OPTION]... [FILE]...
568
570
569 aliases: st
571 aliases: st
570
572
571 show changed files in the working directory
573 show changed files in the working directory
572
574
573 Show status of files in the repository. If names are given, only files
575 Show status of files in the repository. If names are given, only files
574 that match are shown. Files that are clean or ignored or the source of a
576 that match are shown. Files that are clean or ignored or the source of a
575 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
577 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
576 -C/--copies or -A/--all are given. Unless options described with "show
578 -C/--copies or -A/--all are given. Unless options described with "show
577 only ..." are given, the options -mardu are used.
579 only ..." are given, the options -mardu are used.
578
580
579 Option -q/--quiet hides untracked (unknown and ignored) files unless
581 Option -q/--quiet hides untracked (unknown and ignored) files unless
580 explicitly requested with -u/--unknown or -i/--ignored.
582 explicitly requested with -u/--unknown or -i/--ignored.
581
583
582 Note:
584 Note:
583 'hg status' may appear to disagree with diff if permissions have
585 'hg status' may appear to disagree with diff if permissions have
584 changed or a merge has occurred. The standard diff format does not
586 changed or a merge has occurred. The standard diff format does not
585 report permission changes and diff only reports changes relative to one
587 report permission changes and diff only reports changes relative to one
586 merge parent.
588 merge parent.
587
589
588 If one revision is given, it is used as the base revision. If two
590 If one revision is given, it is used as the base revision. If two
589 revisions are given, the differences between them are shown. The --change
591 revisions are given, the differences between them are shown. The --change
590 option can also be used as a shortcut to list the changed files of a
592 option can also be used as a shortcut to list the changed files of a
591 revision from its first parent.
593 revision from its first parent.
592
594
593 The codes used to show the status of files are:
595 The codes used to show the status of files are:
594
596
595 M = modified
597 M = modified
596 A = added
598 A = added
597 R = removed
599 R = removed
598 C = clean
600 C = clean
599 ! = missing (deleted by non-hg command, but still tracked)
601 ! = missing (deleted by non-hg command, but still tracked)
600 ? = not tracked
602 ? = not tracked
601 I = ignored
603 I = ignored
602 = origin of the previous file (with --copies)
604 = origin of the previous file (with --copies)
603
605
604 Returns 0 on success.
606 Returns 0 on success.
605
607
606 options ([+] can be repeated):
608 options ([+] can be repeated):
607
609
608 -A --all show status of all files
610 -A --all show status of all files
609 -m --modified show only modified files
611 -m --modified show only modified files
610 -a --added show only added files
612 -a --added show only added files
611 -r --removed show only removed files
613 -r --removed show only removed files
612 -d --deleted show only deleted (but tracked) files
614 -d --deleted show only deleted (but tracked) files
613 -c --clean show only files without changes
615 -c --clean show only files without changes
614 -u --unknown show only unknown (not tracked) files
616 -u --unknown show only unknown (not tracked) files
615 -i --ignored show only ignored files
617 -i --ignored show only ignored files
616 -n --no-status hide status prefix
618 -n --no-status hide status prefix
617 -C --copies show source of copied files
619 -C --copies show source of copied files
618 -0 --print0 end filenames with NUL, for use with xargs
620 -0 --print0 end filenames with NUL, for use with xargs
619 --rev REV [+] show difference from revision
621 --rev REV [+] show difference from revision
620 --change REV list the changed files of a revision
622 --change REV list the changed files of a revision
621 -I --include PATTERN [+] include names matching the given patterns
623 -I --include PATTERN [+] include names matching the given patterns
622 -X --exclude PATTERN [+] exclude names matching the given patterns
624 -X --exclude PATTERN [+] exclude names matching the given patterns
623 -S --subrepos recurse into subrepositories
625 -S --subrepos recurse into subrepositories
624
626
625 (some details hidden, use --verbose to show complete help)
627 (some details hidden, use --verbose to show complete help)
626
628
627 $ hg -q help status
629 $ hg -q help status
628 hg status [OPTION]... [FILE]...
630 hg status [OPTION]... [FILE]...
629
631
630 show changed files in the working directory
632 show changed files in the working directory
631
633
632 $ hg help foo
634 $ hg help foo
633 abort: no such help topic: foo
635 abort: no such help topic: foo
634 (try 'hg help --keyword foo')
636 (try 'hg help --keyword foo')
635 [255]
637 [255]
636
638
637 $ hg skjdfks
639 $ hg skjdfks
638 hg: unknown command 'skjdfks'
640 hg: unknown command 'skjdfks'
639 Mercurial Distributed SCM
641 Mercurial Distributed SCM
640
642
641 basic commands:
643 basic commands:
642
644
643 add add the specified files on the next commit
645 add add the specified files on the next commit
644 annotate show changeset information by line for each file
646 annotate show changeset information by line for each file
645 clone make a copy of an existing repository
647 clone make a copy of an existing repository
646 commit commit the specified files or all outstanding changes
648 commit commit the specified files or all outstanding changes
647 diff diff repository (or selected files)
649 diff diff repository (or selected files)
648 export dump the header and diffs for one or more changesets
650 export dump the header and diffs for one or more changesets
649 forget forget the specified files on the next commit
651 forget forget the specified files on the next commit
650 init create a new repository in the given directory
652 init create a new repository in the given directory
651 log show revision history of entire repository or files
653 log show revision history of entire repository or files
652 merge merge another revision into working directory
654 merge merge another revision into working directory
653 pull pull changes from the specified source
655 pull pull changes from the specified source
654 push push changes to the specified destination
656 push push changes to the specified destination
655 remove remove the specified files on the next commit
657 remove remove the specified files on the next commit
656 serve start stand-alone webserver
658 serve start stand-alone webserver
657 status show changed files in the working directory
659 status show changed files in the working directory
658 summary summarize working directory state
660 summary summarize working directory state
659 update update working directory (or switch revisions)
661 update update working directory (or switch revisions)
660
662
661 (use 'hg help' for the full list of commands or 'hg -v' for details)
663 (use 'hg help' for the full list of commands or 'hg -v' for details)
662 [255]
664 [255]
663
665
664 Typoed command gives suggestion
666 Typoed command gives suggestion
665 $ hg puls
667 $ hg puls
666 hg: unknown command 'puls'
668 hg: unknown command 'puls'
667 (did you mean one of pull, push?)
669 (did you mean one of pull, push?)
668 [255]
670 [255]
669
671
670 Not enabled extension gets suggested
672 Not enabled extension gets suggested
671
673
672 $ hg rebase
674 $ hg rebase
673 hg: unknown command 'rebase'
675 hg: unknown command 'rebase'
674 'rebase' is provided by the following extension:
676 'rebase' is provided by the following extension:
675
677
676 rebase command to move sets of revisions to a different ancestor
678 rebase command to move sets of revisions to a different ancestor
677
679
678 (use 'hg help extensions' for information on enabling extensions)
680 (use 'hg help extensions' for information on enabling extensions)
679 [255]
681 [255]
680
682
681 Disabled extension gets suggested
683 Disabled extension gets suggested
682 $ hg --config extensions.rebase=! rebase
684 $ hg --config extensions.rebase=! rebase
683 hg: unknown command 'rebase'
685 hg: unknown command 'rebase'
684 'rebase' is provided by the following extension:
686 'rebase' is provided by the following extension:
685
687
686 rebase command to move sets of revisions to a different ancestor
688 rebase command to move sets of revisions to a different ancestor
687
689
688 (use 'hg help extensions' for information on enabling extensions)
690 (use 'hg help extensions' for information on enabling extensions)
689 [255]
691 [255]
690
692
691 Make sure that we don't run afoul of the help system thinking that
693 Make sure that we don't run afoul of the help system thinking that
692 this is a section and erroring out weirdly.
694 this is a section and erroring out weirdly.
693
695
694 $ hg .log
696 $ hg .log
695 hg: unknown command '.log'
697 hg: unknown command '.log'
696 (did you mean log?)
698 (did you mean log?)
697 [255]
699 [255]
698
700
699 $ hg log.
701 $ hg log.
700 hg: unknown command 'log.'
702 hg: unknown command 'log.'
701 (did you mean log?)
703 (did you mean log?)
702 [255]
704 [255]
703 $ hg pu.lh
705 $ hg pu.lh
704 hg: unknown command 'pu.lh'
706 hg: unknown command 'pu.lh'
705 (did you mean one of pull, push?)
707 (did you mean one of pull, push?)
706 [255]
708 [255]
707
709
708 $ cat > helpext.py <<EOF
710 $ cat > helpext.py <<EOF
709 > import os
711 > import os
710 > from mercurial import commands, registrar
712 > from mercurial import commands, registrar
711 >
713 >
712 > cmdtable = {}
714 > cmdtable = {}
713 > command = registrar.command(cmdtable)
715 > command = registrar.command(cmdtable)
714 >
716 >
715 > @command(b'nohelp',
717 > @command(b'nohelp',
716 > [(b'', b'longdesc', 3, b'x'*90),
718 > [(b'', b'longdesc', 3, b'x'*90),
717 > (b'n', b'', None, b'normal desc'),
719 > (b'n', b'', None, b'normal desc'),
718 > (b'', b'newline', b'', b'line1\nline2')],
720 > (b'', b'newline', b'', b'line1\nline2')],
719 > b'hg nohelp',
721 > b'hg nohelp',
720 > norepo=True)
722 > norepo=True)
721 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
723 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
722 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
724 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
723 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
725 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
724 > def nohelp(ui, *args, **kwargs):
726 > def nohelp(ui, *args, **kwargs):
725 > pass
727 > pass
726 >
728 >
727 > def uisetup(ui):
729 > def uisetup(ui):
728 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
730 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
729 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
731 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
730 >
732 >
731 > EOF
733 > EOF
732 $ echo '[extensions]' >> $HGRCPATH
734 $ echo '[extensions]' >> $HGRCPATH
733 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
735 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
734
736
735 Test for aliases
737 Test for aliases
736
738
737 $ hg help hgalias
739 $ hg help hgalias
738 hg hgalias [--remote]
740 hg hgalias [--remote]
739
741
740 alias for: hg summary
742 alias for: hg summary
741
743
742 summarize working directory state
744 summarize working directory state
743
745
744 This generates a brief summary of the working directory state, including
746 This generates a brief summary of the working directory state, including
745 parents, branch, commit status, phase and available updates.
747 parents, branch, commit status, phase and available updates.
746
748
747 With the --remote option, this will check the default paths for incoming
749 With the --remote option, this will check the default paths for incoming
748 and outgoing changes. This can be time-consuming.
750 and outgoing changes. This can be time-consuming.
749
751
750 Returns 0 on success.
752 Returns 0 on success.
751
753
752 defined by: helpext
754 defined by: helpext
753
755
754 options:
756 options:
755
757
756 --remote check for push and pull
758 --remote check for push and pull
757
759
758 (some details hidden, use --verbose to show complete help)
760 (some details hidden, use --verbose to show complete help)
759
761
760 $ hg help shellalias
762 $ hg help shellalias
761 hg shellalias
763 hg shellalias
762
764
763 shell alias for:
765 shell alias for:
764
766
765 echo hi
767 echo hi
766
768
767 defined by: helpext
769 defined by: helpext
768
770
769 (some details hidden, use --verbose to show complete help)
771 (some details hidden, use --verbose to show complete help)
770
772
771 Test command with no help text
773 Test command with no help text
772
774
773 $ hg help nohelp
775 $ hg help nohelp
774 hg nohelp
776 hg nohelp
775
777
776 (no help text available)
778 (no help text available)
777
779
778 options:
780 options:
779
781
780 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
782 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
781 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
783 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
782 -n -- normal desc
784 -n -- normal desc
783 --newline VALUE line1 line2
785 --newline VALUE line1 line2
784
786
785 (some details hidden, use --verbose to show complete help)
787 (some details hidden, use --verbose to show complete help)
786
788
787 $ hg help -k nohelp
789 $ hg help -k nohelp
788 Commands:
790 Commands:
789
791
790 nohelp hg nohelp
792 nohelp hg nohelp
791
793
792 Extension Commands:
794 Extension Commands:
793
795
794 nohelp (no help text available)
796 nohelp (no help text available)
795
797
796 Test that default list of commands omits extension commands
798 Test that default list of commands omits extension commands
797
799
798 $ hg help
800 $ hg help
799 Mercurial Distributed SCM
801 Mercurial Distributed SCM
800
802
801 list of commands:
803 list of commands:
802
804
803 add add the specified files on the next commit
805 add add the specified files on the next commit
804 addremove add all new files, delete all missing files
806 addremove add all new files, delete all missing files
805 annotate show changeset information by line for each file
807 annotate show changeset information by line for each file
806 archive create an unversioned archive of a repository revision
808 archive create an unversioned archive of a repository revision
807 backout reverse effect of earlier changeset
809 backout reverse effect of earlier changeset
808 bisect subdivision search of changesets
810 bisect subdivision search of changesets
809 bookmarks create a new bookmark or list existing bookmarks
811 bookmarks create a new bookmark or list existing bookmarks
810 branch set or show the current branch name
812 branch set or show the current branch name
811 branches list repository named branches
813 branches list repository named branches
812 bundle create a bundle file
814 bundle create a bundle file
813 cat output the current or given revision of files
815 cat output the current or given revision of files
814 clone make a copy of an existing repository
816 clone make a copy of an existing repository
815 commit commit the specified files or all outstanding changes
817 commit commit the specified files or all outstanding changes
816 config show combined config settings from all hgrc files
818 config show combined config settings from all hgrc files
817 copy mark files as copied for the next commit
819 copy mark files as copied for the next commit
818 diff diff repository (or selected files)
820 diff diff repository (or selected files)
819 export dump the header and diffs for one or more changesets
821 export dump the header and diffs for one or more changesets
820 files list tracked files
822 files list tracked files
821 forget forget the specified files on the next commit
823 forget forget the specified files on the next commit
822 graft copy changes from other branches onto the current branch
824 graft copy changes from other branches onto the current branch
823 grep search revision history for a pattern in specified files
825 grep search revision history for a pattern in specified files
824 heads show branch heads
826 heads show branch heads
825 help show help for a given topic or a help overview
827 help show help for a given topic or a help overview
826 identify identify the working directory or specified revision
828 identify identify the working directory or specified revision
827 import import an ordered set of patches
829 import import an ordered set of patches
828 incoming show new changesets found in source
830 incoming show new changesets found in source
829 init create a new repository in the given directory
831 init create a new repository in the given directory
830 log show revision history of entire repository or files
832 log show revision history of entire repository or files
831 manifest output the current or given revision of the project manifest
833 manifest output the current or given revision of the project manifest
832 merge merge another revision into working directory
834 merge merge another revision into working directory
833 outgoing show changesets not found in the destination
835 outgoing show changesets not found in the destination
834 paths show aliases for remote repositories
836 paths show aliases for remote repositories
835 phase set or show the current phase name
837 phase set or show the current phase name
836 pull pull changes from the specified source
838 pull pull changes from the specified source
837 push push changes to the specified destination
839 push push changes to the specified destination
838 recover roll back an interrupted transaction
840 recover roll back an interrupted transaction
839 remove remove the specified files on the next commit
841 remove remove the specified files on the next commit
840 rename rename files; equivalent of copy + remove
842 rename rename files; equivalent of copy + remove
841 resolve redo merges or set/view the merge status of files
843 resolve redo merges or set/view the merge status of files
842 revert restore files to their checkout state
844 revert restore files to their checkout state
843 root print the root (top) of the current working directory
845 root print the root (top) of the current working directory
844 serve start stand-alone webserver
846 serve start stand-alone webserver
845 status show changed files in the working directory
847 status show changed files in the working directory
846 summary summarize working directory state
848 summary summarize working directory state
847 tag add one or more tags for the current or given revision
849 tag add one or more tags for the current or given revision
848 tags list repository tags
850 tags list repository tags
849 unbundle apply one or more bundle files
851 unbundle apply one or more bundle files
850 update update working directory (or switch revisions)
852 update update working directory (or switch revisions)
851 verify verify the integrity of the repository
853 verify verify the integrity of the repository
852 version output version and copyright information
854 version output version and copyright information
853
855
854 enabled extensions:
856 enabled extensions:
855
857
856 helpext (no help text available)
858 helpext (no help text available)
857
859
858 additional help topics:
860 additional help topics:
859
861
860 bundlespec Bundle File Formats
862 bundlespec Bundle File Formats
861 color Colorizing Outputs
863 color Colorizing Outputs
862 config Configuration Files
864 config Configuration Files
863 dates Date Formats
865 dates Date Formats
864 diffs Diff Formats
866 diffs Diff Formats
865 environment Environment Variables
867 environment Environment Variables
866 extensions Using Additional Features
868 extensions Using Additional Features
867 filesets Specifying File Sets
869 filesets Specifying File Sets
870 flags Command-line flags
868 glossary Glossary
871 glossary Glossary
869 hgignore Syntax for Mercurial Ignore Files
872 hgignore Syntax for Mercurial Ignore Files
870 hgweb Configuring hgweb
873 hgweb Configuring hgweb
871 internals Technical implementation topics
874 internals Technical implementation topics
872 merge-tools Merge Tools
875 merge-tools Merge Tools
873 pager Pager Support
876 pager Pager Support
874 patterns File Name Patterns
877 patterns File Name Patterns
875 phases Working with Phases
878 phases Working with Phases
876 revisions Specifying Revisions
879 revisions Specifying Revisions
877 scripting Using Mercurial from scripts and automation
880 scripting Using Mercurial from scripts and automation
878 subrepos Subrepositories
881 subrepos Subrepositories
879 templating Template Usage
882 templating Template Usage
880 urls URL Paths
883 urls URL Paths
881
884
882 (use 'hg help -v' to show built-in aliases and global options)
885 (use 'hg help -v' to show built-in aliases and global options)
883
886
884
887
885 Test list of internal help commands
888 Test list of internal help commands
886
889
887 $ hg help debug
890 $ hg help debug
888 debug commands (internal and unsupported):
891 debug commands (internal and unsupported):
889
892
890 debugancestor
893 debugancestor
891 find the ancestor revision of two revisions in a given index
894 find the ancestor revision of two revisions in a given index
892 debugapplystreamclonebundle
895 debugapplystreamclonebundle
893 apply a stream clone bundle file
896 apply a stream clone bundle file
894 debugbuilddag
897 debugbuilddag
895 builds a repo with a given DAG from scratch in the current
898 builds a repo with a given DAG from scratch in the current
896 empty repo
899 empty repo
897 debugbundle lists the contents of a bundle
900 debugbundle lists the contents of a bundle
898 debugcapabilities
901 debugcapabilities
899 lists the capabilities of a remote peer
902 lists the capabilities of a remote peer
900 debugcheckstate
903 debugcheckstate
901 validate the correctness of the current dirstate
904 validate the correctness of the current dirstate
902 debugcolor show available color, effects or style
905 debugcolor show available color, effects or style
903 debugcommands
906 debugcommands
904 list all available commands and options
907 list all available commands and options
905 debugcomplete
908 debugcomplete
906 returns the completion list associated with the given command
909 returns the completion list associated with the given command
907 debugcreatestreamclonebundle
910 debugcreatestreamclonebundle
908 create a stream clone bundle file
911 create a stream clone bundle file
909 debugdag format the changelog or an index DAG as a concise textual
912 debugdag format the changelog or an index DAG as a concise textual
910 description
913 description
911 debugdata dump the contents of a data file revision
914 debugdata dump the contents of a data file revision
912 debugdate parse and display a date
915 debugdate parse and display a date
913 debugdeltachain
916 debugdeltachain
914 dump information about delta chains in a revlog
917 dump information about delta chains in a revlog
915 debugdirstate
918 debugdirstate
916 show the contents of the current dirstate
919 show the contents of the current dirstate
917 debugdiscovery
920 debugdiscovery
918 runs the changeset discovery protocol in isolation
921 runs the changeset discovery protocol in isolation
919 debugextensions
922 debugextensions
920 show information about active extensions
923 show information about active extensions
921 debugfileset parse and apply a fileset specification
924 debugfileset parse and apply a fileset specification
922 debugfsinfo show information detected about current filesystem
925 debugfsinfo show information detected about current filesystem
923 debuggetbundle
926 debuggetbundle
924 retrieves a bundle from a repo
927 retrieves a bundle from a repo
925 debugignore display the combined ignore pattern and information about
928 debugignore display the combined ignore pattern and information about
926 ignored files
929 ignored files
927 debugindex dump the contents of an index file
930 debugindex dump the contents of an index file
928 debugindexdot
931 debugindexdot
929 dump an index DAG as a graphviz dot file
932 dump an index DAG as a graphviz dot file
930 debuginstall test Mercurial installation
933 debuginstall test Mercurial installation
931 debugknown test whether node ids are known to a repo
934 debugknown test whether node ids are known to a repo
932 debuglocks show or modify state of locks
935 debuglocks show or modify state of locks
933 debugmergestate
936 debugmergestate
934 print merge state
937 print merge state
935 debugnamecomplete
938 debugnamecomplete
936 complete "names" - tags, open branch names, bookmark names
939 complete "names" - tags, open branch names, bookmark names
937 debugobsolete
940 debugobsolete
938 create arbitrary obsolete marker
941 create arbitrary obsolete marker
939 debugoptADV (no help text available)
942 debugoptADV (no help text available)
940 debugoptDEP (no help text available)
943 debugoptDEP (no help text available)
941 debugoptEXP (no help text available)
944 debugoptEXP (no help text available)
942 debugpathcomplete
945 debugpathcomplete
943 complete part or all of a tracked path
946 complete part or all of a tracked path
944 debugpickmergetool
947 debugpickmergetool
945 examine which merge tool is chosen for specified file
948 examine which merge tool is chosen for specified file
946 debugpushkey access the pushkey key/value protocol
949 debugpushkey access the pushkey key/value protocol
947 debugpvec (no help text available)
950 debugpvec (no help text available)
948 debugrebuilddirstate
951 debugrebuilddirstate
949 rebuild the dirstate as it would look like for the given
952 rebuild the dirstate as it would look like for the given
950 revision
953 revision
951 debugrebuildfncache
954 debugrebuildfncache
952 rebuild the fncache file
955 rebuild the fncache file
953 debugrename dump rename information
956 debugrename dump rename information
954 debugrevlog show data and statistics about a revlog
957 debugrevlog show data and statistics about a revlog
955 debugrevspec parse and apply a revision specification
958 debugrevspec parse and apply a revision specification
956 debugsetparents
959 debugsetparents
957 manually set the parents of the current working directory
960 manually set the parents of the current working directory
958 debugssl test a secure connection to a server
961 debugssl test a secure connection to a server
959 debugsub (no help text available)
962 debugsub (no help text available)
960 debugsuccessorssets
963 debugsuccessorssets
961 show set of successors for revision
964 show set of successors for revision
962 debugtemplate
965 debugtemplate
963 parse and apply a template
966 parse and apply a template
964 debugupdatecaches
967 debugupdatecaches
965 warm all known caches in the repository
968 warm all known caches in the repository
966 debugupgraderepo
969 debugupgraderepo
967 upgrade a repository to use different features
970 upgrade a repository to use different features
968 debugwalk show how files match on given patterns
971 debugwalk show how files match on given patterns
969 debugwireargs
972 debugwireargs
970 (no help text available)
973 (no help text available)
971
974
972 (use 'hg help -v debug' to show built-in aliases and global options)
975 (use 'hg help -v debug' to show built-in aliases and global options)
973
976
974 internals topic renders index of available sub-topics
977 internals topic renders index of available sub-topics
975
978
976 $ hg help internals
979 $ hg help internals
977 Technical implementation topics
980 Technical implementation topics
978 """""""""""""""""""""""""""""""
981 """""""""""""""""""""""""""""""
979
982
980 To access a subtopic, use "hg help internals.{subtopic-name}"
983 To access a subtopic, use "hg help internals.{subtopic-name}"
981
984
982 bundles Bundles
985 bundles Bundles
983 censor Censor
986 censor Censor
984 changegroups Changegroups
987 changegroups Changegroups
985 config Config Registrar
988 config Config Registrar
986 requirements Repository Requirements
989 requirements Repository Requirements
987 revlogs Revision Logs
990 revlogs Revision Logs
988 wireprotocol Wire Protocol
991 wireprotocol Wire Protocol
989
992
990 sub-topics can be accessed
993 sub-topics can be accessed
991
994
992 $ hg help internals.changegroups
995 $ hg help internals.changegroups
993 Changegroups
996 Changegroups
994 """"""""""""
997 """"""""""""
995
998
996 Changegroups are representations of repository revlog data, specifically
999 Changegroups are representations of repository revlog data, specifically
997 the changelog data, root/flat manifest data, treemanifest data, and
1000 the changelog data, root/flat manifest data, treemanifest data, and
998 filelogs.
1001 filelogs.
999
1002
1000 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1003 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1001 level, versions "1" and "2" are almost exactly the same, with the only
1004 level, versions "1" and "2" are almost exactly the same, with the only
1002 difference being an additional item in the *delta header*. Version "3"
1005 difference being an additional item in the *delta header*. Version "3"
1003 adds support for revlog flags in the *delta header* and optionally
1006 adds support for revlog flags in the *delta header* and optionally
1004 exchanging treemanifests (enabled by setting an option on the
1007 exchanging treemanifests (enabled by setting an option on the
1005 "changegroup" part in the bundle2).
1008 "changegroup" part in the bundle2).
1006
1009
1007 Changegroups when not exchanging treemanifests consist of 3 logical
1010 Changegroups when not exchanging treemanifests consist of 3 logical
1008 segments:
1011 segments:
1009
1012
1010 +---------------------------------+
1013 +---------------------------------+
1011 | | | |
1014 | | | |
1012 | changeset | manifest | filelogs |
1015 | changeset | manifest | filelogs |
1013 | | | |
1016 | | | |
1014 | | | |
1017 | | | |
1015 +---------------------------------+
1018 +---------------------------------+
1016
1019
1017 When exchanging treemanifests, there are 4 logical segments:
1020 When exchanging treemanifests, there are 4 logical segments:
1018
1021
1019 +-------------------------------------------------+
1022 +-------------------------------------------------+
1020 | | | | |
1023 | | | | |
1021 | changeset | root | treemanifests | filelogs |
1024 | changeset | root | treemanifests | filelogs |
1022 | | manifest | | |
1025 | | manifest | | |
1023 | | | | |
1026 | | | | |
1024 +-------------------------------------------------+
1027 +-------------------------------------------------+
1025
1028
1026 The principle building block of each segment is a *chunk*. A *chunk* is a
1029 The principle building block of each segment is a *chunk*. A *chunk* is a
1027 framed piece of data:
1030 framed piece of data:
1028
1031
1029 +---------------------------------------+
1032 +---------------------------------------+
1030 | | |
1033 | | |
1031 | length | data |
1034 | length | data |
1032 | (4 bytes) | (<length - 4> bytes) |
1035 | (4 bytes) | (<length - 4> bytes) |
1033 | | |
1036 | | |
1034 +---------------------------------------+
1037 +---------------------------------------+
1035
1038
1036 All integers are big-endian signed integers. Each chunk starts with a
1039 All integers are big-endian signed integers. Each chunk starts with a
1037 32-bit integer indicating the length of the entire chunk (including the
1040 32-bit integer indicating the length of the entire chunk (including the
1038 length field itself).
1041 length field itself).
1039
1042
1040 There is a special case chunk that has a value of 0 for the length
1043 There is a special case chunk that has a value of 0 for the length
1041 ("0x00000000"). We call this an *empty chunk*.
1044 ("0x00000000"). We call this an *empty chunk*.
1042
1045
1043 Delta Groups
1046 Delta Groups
1044 ============
1047 ============
1045
1048
1046 A *delta group* expresses the content of a revlog as a series of deltas,
1049 A *delta group* expresses the content of a revlog as a series of deltas,
1047 or patches against previous revisions.
1050 or patches against previous revisions.
1048
1051
1049 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1052 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1050 to signal the end of the delta group:
1053 to signal the end of the delta group:
1051
1054
1052 +------------------------------------------------------------------------+
1055 +------------------------------------------------------------------------+
1053 | | | | | |
1056 | | | | | |
1054 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1057 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1055 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1058 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1056 | | | | | |
1059 | | | | | |
1057 +------------------------------------------------------------------------+
1060 +------------------------------------------------------------------------+
1058
1061
1059 Each *chunk*'s data consists of the following:
1062 Each *chunk*'s data consists of the following:
1060
1063
1061 +---------------------------------------+
1064 +---------------------------------------+
1062 | | |
1065 | | |
1063 | delta header | delta data |
1066 | delta header | delta data |
1064 | (various by version) | (various) |
1067 | (various by version) | (various) |
1065 | | |
1068 | | |
1066 +---------------------------------------+
1069 +---------------------------------------+
1067
1070
1068 The *delta data* is a series of *delta*s that describe a diff from an
1071 The *delta data* is a series of *delta*s that describe a diff from an
1069 existing entry (either that the recipient already has, or previously
1072 existing entry (either that the recipient already has, or previously
1070 specified in the bundle/changegroup).
1073 specified in the bundle/changegroup).
1071
1074
1072 The *delta header* is different between versions "1", "2", and "3" of the
1075 The *delta header* is different between versions "1", "2", and "3" of the
1073 changegroup format.
1076 changegroup format.
1074
1077
1075 Version 1 (headerlen=80):
1078 Version 1 (headerlen=80):
1076
1079
1077 +------------------------------------------------------+
1080 +------------------------------------------------------+
1078 | | | | |
1081 | | | | |
1079 | node | p1 node | p2 node | link node |
1082 | node | p1 node | p2 node | link node |
1080 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1083 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1081 | | | | |
1084 | | | | |
1082 +------------------------------------------------------+
1085 +------------------------------------------------------+
1083
1086
1084 Version 2 (headerlen=100):
1087 Version 2 (headerlen=100):
1085
1088
1086 +------------------------------------------------------------------+
1089 +------------------------------------------------------------------+
1087 | | | | | |
1090 | | | | | |
1088 | node | p1 node | p2 node | base node | link node |
1091 | node | p1 node | p2 node | base node | link node |
1089 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1092 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1090 | | | | | |
1093 | | | | | |
1091 +------------------------------------------------------------------+
1094 +------------------------------------------------------------------+
1092
1095
1093 Version 3 (headerlen=102):
1096 Version 3 (headerlen=102):
1094
1097
1095 +------------------------------------------------------------------------------+
1098 +------------------------------------------------------------------------------+
1096 | | | | | | |
1099 | | | | | | |
1097 | node | p1 node | p2 node | base node | link node | flags |
1100 | node | p1 node | p2 node | base node | link node | flags |
1098 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1101 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1099 | | | | | | |
1102 | | | | | | |
1100 +------------------------------------------------------------------------------+
1103 +------------------------------------------------------------------------------+
1101
1104
1102 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1105 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1103 contain a series of *delta*s, densely packed (no separators). These deltas
1106 contain a series of *delta*s, densely packed (no separators). These deltas
1104 describe a diff from an existing entry (either that the recipient already
1107 describe a diff from an existing entry (either that the recipient already
1105 has, or previously specified in the bundle/changegroup). The format is
1108 has, or previously specified in the bundle/changegroup). The format is
1106 described more fully in "hg help internals.bdiff", but briefly:
1109 described more fully in "hg help internals.bdiff", but briefly:
1107
1110
1108 +---------------------------------------------------------------+
1111 +---------------------------------------------------------------+
1109 | | | | |
1112 | | | | |
1110 | start offset | end offset | new length | content |
1113 | start offset | end offset | new length | content |
1111 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1114 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1112 | | | | |
1115 | | | | |
1113 +---------------------------------------------------------------+
1116 +---------------------------------------------------------------+
1114
1117
1115 Please note that the length field in the delta data does *not* include
1118 Please note that the length field in the delta data does *not* include
1116 itself.
1119 itself.
1117
1120
1118 In version 1, the delta is always applied against the previous node from
1121 In version 1, the delta is always applied against the previous node from
1119 the changegroup or the first parent if this is the first entry in the
1122 the changegroup or the first parent if this is the first entry in the
1120 changegroup.
1123 changegroup.
1121
1124
1122 In version 2 and up, the delta base node is encoded in the entry in the
1125 In version 2 and up, the delta base node is encoded in the entry in the
1123 changegroup. This allows the delta to be expressed against any parent,
1126 changegroup. This allows the delta to be expressed against any parent,
1124 which can result in smaller deltas and more efficient encoding of data.
1127 which can result in smaller deltas and more efficient encoding of data.
1125
1128
1126 Changeset Segment
1129 Changeset Segment
1127 =================
1130 =================
1128
1131
1129 The *changeset segment* consists of a single *delta group* holding
1132 The *changeset segment* consists of a single *delta group* holding
1130 changelog data. The *empty chunk* at the end of the *delta group* denotes
1133 changelog data. The *empty chunk* at the end of the *delta group* denotes
1131 the boundary to the *manifest segment*.
1134 the boundary to the *manifest segment*.
1132
1135
1133 Manifest Segment
1136 Manifest Segment
1134 ================
1137 ================
1135
1138
1136 The *manifest segment* consists of a single *delta group* holding manifest
1139 The *manifest segment* consists of a single *delta group* holding manifest
1137 data. If treemanifests are in use, it contains only the manifest for the
1140 data. If treemanifests are in use, it contains only the manifest for the
1138 root directory of the repository. Otherwise, it contains the entire
1141 root directory of the repository. Otherwise, it contains the entire
1139 manifest data. The *empty chunk* at the end of the *delta group* denotes
1142 manifest data. The *empty chunk* at the end of the *delta group* denotes
1140 the boundary to the next segment (either the *treemanifests segment* or
1143 the boundary to the next segment (either the *treemanifests segment* or
1141 the *filelogs segment*, depending on version and the request options).
1144 the *filelogs segment*, depending on version and the request options).
1142
1145
1143 Treemanifests Segment
1146 Treemanifests Segment
1144 ---------------------
1147 ---------------------
1145
1148
1146 The *treemanifests segment* only exists in changegroup version "3", and
1149 The *treemanifests segment* only exists in changegroup version "3", and
1147 only if the 'treemanifest' param is part of the bundle2 changegroup part
1150 only if the 'treemanifest' param is part of the bundle2 changegroup part
1148 (it is not possible to use changegroup version 3 outside of bundle2).
1151 (it is not possible to use changegroup version 3 outside of bundle2).
1149 Aside from the filenames in the *treemanifests segment* containing a
1152 Aside from the filenames in the *treemanifests segment* containing a
1150 trailing "/" character, it behaves identically to the *filelogs segment*
1153 trailing "/" character, it behaves identically to the *filelogs segment*
1151 (see below). The final sub-segment is followed by an *empty chunk*
1154 (see below). The final sub-segment is followed by an *empty chunk*
1152 (logically, a sub-segment with filename size 0). This denotes the boundary
1155 (logically, a sub-segment with filename size 0). This denotes the boundary
1153 to the *filelogs segment*.
1156 to the *filelogs segment*.
1154
1157
1155 Filelogs Segment
1158 Filelogs Segment
1156 ================
1159 ================
1157
1160
1158 The *filelogs segment* consists of multiple sub-segments, each
1161 The *filelogs segment* consists of multiple sub-segments, each
1159 corresponding to an individual file whose data is being described:
1162 corresponding to an individual file whose data is being described:
1160
1163
1161 +--------------------------------------------------+
1164 +--------------------------------------------------+
1162 | | | | | |
1165 | | | | | |
1163 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1166 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1164 | | | | | (4 bytes) |
1167 | | | | | (4 bytes) |
1165 | | | | | |
1168 | | | | | |
1166 +--------------------------------------------------+
1169 +--------------------------------------------------+
1167
1170
1168 The final filelog sub-segment is followed by an *empty chunk* (logically,
1171 The final filelog sub-segment is followed by an *empty chunk* (logically,
1169 a sub-segment with filename size 0). This denotes the end of the segment
1172 a sub-segment with filename size 0). This denotes the end of the segment
1170 and of the overall changegroup.
1173 and of the overall changegroup.
1171
1174
1172 Each filelog sub-segment consists of the following:
1175 Each filelog sub-segment consists of the following:
1173
1176
1174 +------------------------------------------------------+
1177 +------------------------------------------------------+
1175 | | | |
1178 | | | |
1176 | filename length | filename | delta group |
1179 | filename length | filename | delta group |
1177 | (4 bytes) | (<length - 4> bytes) | (various) |
1180 | (4 bytes) | (<length - 4> bytes) | (various) |
1178 | | | |
1181 | | | |
1179 +------------------------------------------------------+
1182 +------------------------------------------------------+
1180
1183
1181 That is, a *chunk* consisting of the filename (not terminated or padded)
1184 That is, a *chunk* consisting of the filename (not terminated or padded)
1182 followed by N chunks constituting the *delta group* for this file. The
1185 followed by N chunks constituting the *delta group* for this file. The
1183 *empty chunk* at the end of each *delta group* denotes the boundary to the
1186 *empty chunk* at the end of each *delta group* denotes the boundary to the
1184 next filelog sub-segment.
1187 next filelog sub-segment.
1185
1188
1186 Test list of commands with command with no help text
1189 Test list of commands with command with no help text
1187
1190
1188 $ hg help helpext
1191 $ hg help helpext
1189 helpext extension - no help text available
1192 helpext extension - no help text available
1190
1193
1191 list of commands:
1194 list of commands:
1192
1195
1193 nohelp (no help text available)
1196 nohelp (no help text available)
1194
1197
1195 (use 'hg help -v helpext' to show built-in aliases and global options)
1198 (use 'hg help -v helpext' to show built-in aliases and global options)
1196
1199
1197
1200
1198 test advanced, deprecated and experimental options are hidden in command help
1201 test advanced, deprecated and experimental options are hidden in command help
1199 $ hg help debugoptADV
1202 $ hg help debugoptADV
1200 hg debugoptADV
1203 hg debugoptADV
1201
1204
1202 (no help text available)
1205 (no help text available)
1203
1206
1204 options:
1207 options:
1205
1208
1206 (some details hidden, use --verbose to show complete help)
1209 (some details hidden, use --verbose to show complete help)
1207 $ hg help debugoptDEP
1210 $ hg help debugoptDEP
1208 hg debugoptDEP
1211 hg debugoptDEP
1209
1212
1210 (no help text available)
1213 (no help text available)
1211
1214
1212 options:
1215 options:
1213
1216
1214 (some details hidden, use --verbose to show complete help)
1217 (some details hidden, use --verbose to show complete help)
1215
1218
1216 $ hg help debugoptEXP
1219 $ hg help debugoptEXP
1217 hg debugoptEXP
1220 hg debugoptEXP
1218
1221
1219 (no help text available)
1222 (no help text available)
1220
1223
1221 options:
1224 options:
1222
1225
1223 (some details hidden, use --verbose to show complete help)
1226 (some details hidden, use --verbose to show complete help)
1224
1227
1225 test advanced, deprecated and experimental options are shown with -v
1228 test advanced, deprecated and experimental options are shown with -v
1226 $ hg help -v debugoptADV | grep aopt
1229 $ hg help -v debugoptADV | grep aopt
1227 --aopt option is (ADVANCED)
1230 --aopt option is (ADVANCED)
1228 $ hg help -v debugoptDEP | grep dopt
1231 $ hg help -v debugoptDEP | grep dopt
1229 --dopt option is (DEPRECATED)
1232 --dopt option is (DEPRECATED)
1230 $ hg help -v debugoptEXP | grep eopt
1233 $ hg help -v debugoptEXP | grep eopt
1231 --eopt option is (EXPERIMENTAL)
1234 --eopt option is (EXPERIMENTAL)
1232
1235
1233 #if gettext
1236 #if gettext
1234 test deprecated option is hidden with translation with untranslated description
1237 test deprecated option is hidden with translation with untranslated description
1235 (use many globy for not failing on changed transaction)
1238 (use many globy for not failing on changed transaction)
1236 $ LANGUAGE=sv hg help debugoptDEP
1239 $ LANGUAGE=sv hg help debugoptDEP
1237 hg debugoptDEP
1240 hg debugoptDEP
1238
1241
1239 (*) (glob)
1242 (*) (glob)
1240
1243
1241 options:
1244 options:
1242
1245
1243 (some details hidden, use --verbose to show complete help)
1246 (some details hidden, use --verbose to show complete help)
1244 #endif
1247 #endif
1245
1248
1246 Test commands that collide with topics (issue4240)
1249 Test commands that collide with topics (issue4240)
1247
1250
1248 $ hg config -hq
1251 $ hg config -hq
1249 hg config [-u] [NAME]...
1252 hg config [-u] [NAME]...
1250
1253
1251 show combined config settings from all hgrc files
1254 show combined config settings from all hgrc files
1252 $ hg showconfig -hq
1255 $ hg showconfig -hq
1253 hg config [-u] [NAME]...
1256 hg config [-u] [NAME]...
1254
1257
1255 show combined config settings from all hgrc files
1258 show combined config settings from all hgrc files
1256
1259
1257 Test a help topic
1260 Test a help topic
1258
1261
1259 $ hg help dates
1262 $ hg help dates
1260 Date Formats
1263 Date Formats
1261 """"""""""""
1264 """"""""""""
1262
1265
1263 Some commands allow the user to specify a date, e.g.:
1266 Some commands allow the user to specify a date, e.g.:
1264
1267
1265 - backout, commit, import, tag: Specify the commit date.
1268 - backout, commit, import, tag: Specify the commit date.
1266 - log, revert, update: Select revision(s) by date.
1269 - log, revert, update: Select revision(s) by date.
1267
1270
1268 Many date formats are valid. Here are some examples:
1271 Many date formats are valid. Here are some examples:
1269
1272
1270 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1273 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1271 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1274 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1272 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1275 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1273 - "Dec 6" (midnight)
1276 - "Dec 6" (midnight)
1274 - "13:18" (today assumed)
1277 - "13:18" (today assumed)
1275 - "3:39" (3:39AM assumed)
1278 - "3:39" (3:39AM assumed)
1276 - "3:39pm" (15:39)
1279 - "3:39pm" (15:39)
1277 - "2006-12-06 13:18:29" (ISO 8601 format)
1280 - "2006-12-06 13:18:29" (ISO 8601 format)
1278 - "2006-12-6 13:18"
1281 - "2006-12-6 13:18"
1279 - "2006-12-6"
1282 - "2006-12-6"
1280 - "12-6"
1283 - "12-6"
1281 - "12/6"
1284 - "12/6"
1282 - "12/6/6" (Dec 6 2006)
1285 - "12/6/6" (Dec 6 2006)
1283 - "today" (midnight)
1286 - "today" (midnight)
1284 - "yesterday" (midnight)
1287 - "yesterday" (midnight)
1285 - "now" - right now
1288 - "now" - right now
1286
1289
1287 Lastly, there is Mercurial's internal format:
1290 Lastly, there is Mercurial's internal format:
1288
1291
1289 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1292 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1290
1293
1291 This is the internal representation format for dates. The first number is
1294 This is the internal representation format for dates. The first number is
1292 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1295 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1293 is the offset of the local timezone, in seconds west of UTC (negative if
1296 is the offset of the local timezone, in seconds west of UTC (negative if
1294 the timezone is east of UTC).
1297 the timezone is east of UTC).
1295
1298
1296 The log command also accepts date ranges:
1299 The log command also accepts date ranges:
1297
1300
1298 - "<DATE" - at or before a given date/time
1301 - "<DATE" - at or before a given date/time
1299 - ">DATE" - on or after a given date/time
1302 - ">DATE" - on or after a given date/time
1300 - "DATE to DATE" - a date range, inclusive
1303 - "DATE to DATE" - a date range, inclusive
1301 - "-DAYS" - within a given number of days of today
1304 - "-DAYS" - within a given number of days of today
1302
1305
1303 Test repeated config section name
1306 Test repeated config section name
1304
1307
1305 $ hg help config.host
1308 $ hg help config.host
1306 "http_proxy.host"
1309 "http_proxy.host"
1307 Host name and (optional) port of the proxy server, for example
1310 Host name and (optional) port of the proxy server, for example
1308 "myproxy:8000".
1311 "myproxy:8000".
1309
1312
1310 "smtp.host"
1313 "smtp.host"
1311 Host name of mail server, e.g. "mail.example.com".
1314 Host name of mail server, e.g. "mail.example.com".
1312
1315
1313 Unrelated trailing paragraphs shouldn't be included
1316 Unrelated trailing paragraphs shouldn't be included
1314
1317
1315 $ hg help config.extramsg | grep '^$'
1318 $ hg help config.extramsg | grep '^$'
1316
1319
1317
1320
1318 Test capitalized section name
1321 Test capitalized section name
1319
1322
1320 $ hg help scripting.HGPLAIN > /dev/null
1323 $ hg help scripting.HGPLAIN > /dev/null
1321
1324
1322 Help subsection:
1325 Help subsection:
1323
1326
1324 $ hg help config.charsets |grep "Email example:" > /dev/null
1327 $ hg help config.charsets |grep "Email example:" > /dev/null
1325 [1]
1328 [1]
1326
1329
1327 Show nested definitions
1330 Show nested definitions
1328 ("profiling.type"[break]"ls"[break]"stat"[break])
1331 ("profiling.type"[break]"ls"[break]"stat"[break])
1329
1332
1330 $ hg help config.type | egrep '^$'|wc -l
1333 $ hg help config.type | egrep '^$'|wc -l
1331 \s*3 (re)
1334 \s*3 (re)
1332
1335
1333 Separate sections from subsections
1336 Separate sections from subsections
1334
1337
1335 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1338 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1336 "format"
1339 "format"
1337 --------
1340 --------
1338
1341
1339 "usegeneraldelta"
1342 "usegeneraldelta"
1340
1343
1341 "dotencode"
1344 "dotencode"
1342
1345
1343 "usefncache"
1346 "usefncache"
1344
1347
1345 "usestore"
1348 "usestore"
1346
1349
1347 "profiling"
1350 "profiling"
1348 -----------
1351 -----------
1349
1352
1350 "format"
1353 "format"
1351
1354
1352 "progress"
1355 "progress"
1353 ----------
1356 ----------
1354
1357
1355 "format"
1358 "format"
1356
1359
1357
1360
1358 Last item in help config.*:
1361 Last item in help config.*:
1359
1362
1360 $ hg help config.`hg help config|grep '^ "'| \
1363 $ hg help config.`hg help config|grep '^ "'| \
1361 > tail -1|sed 's![ "]*!!g'`| \
1364 > tail -1|sed 's![ "]*!!g'`| \
1362 > grep 'hg help -c config' > /dev/null
1365 > grep 'hg help -c config' > /dev/null
1363 [1]
1366 [1]
1364
1367
1365 note to use help -c for general hg help config:
1368 note to use help -c for general hg help config:
1366
1369
1367 $ hg help config |grep 'hg help -c config' > /dev/null
1370 $ hg help config |grep 'hg help -c config' > /dev/null
1368
1371
1369 Test templating help
1372 Test templating help
1370
1373
1371 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1374 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1372 desc String. The text of the changeset description.
1375 desc String. The text of the changeset description.
1373 diffstat String. Statistics of changes with the following format:
1376 diffstat String. Statistics of changes with the following format:
1374 firstline Any text. Returns the first line of text.
1377 firstline Any text. Returns the first line of text.
1375 nonempty Any text. Returns '(none)' if the string is empty.
1378 nonempty Any text. Returns '(none)' if the string is empty.
1376
1379
1377 Test deprecated items
1380 Test deprecated items
1378
1381
1379 $ hg help -v templating | grep currentbookmark
1382 $ hg help -v templating | grep currentbookmark
1380 currentbookmark
1383 currentbookmark
1381 $ hg help templating | (grep currentbookmark || true)
1384 $ hg help templating | (grep currentbookmark || true)
1382
1385
1383 Test help hooks
1386 Test help hooks
1384
1387
1385 $ cat > helphook1.py <<EOF
1388 $ cat > helphook1.py <<EOF
1386 > from mercurial import help
1389 > from mercurial import help
1387 >
1390 >
1388 > def rewrite(ui, topic, doc):
1391 > def rewrite(ui, topic, doc):
1389 > return doc + '\nhelphook1\n'
1392 > return doc + '\nhelphook1\n'
1390 >
1393 >
1391 > def extsetup(ui):
1394 > def extsetup(ui):
1392 > help.addtopichook('revisions', rewrite)
1395 > help.addtopichook('revisions', rewrite)
1393 > EOF
1396 > EOF
1394 $ cat > helphook2.py <<EOF
1397 $ cat > helphook2.py <<EOF
1395 > from mercurial import help
1398 > from mercurial import help
1396 >
1399 >
1397 > def rewrite(ui, topic, doc):
1400 > def rewrite(ui, topic, doc):
1398 > return doc + '\nhelphook2\n'
1401 > return doc + '\nhelphook2\n'
1399 >
1402 >
1400 > def extsetup(ui):
1403 > def extsetup(ui):
1401 > help.addtopichook('revisions', rewrite)
1404 > help.addtopichook('revisions', rewrite)
1402 > EOF
1405 > EOF
1403 $ echo '[extensions]' >> $HGRCPATH
1406 $ echo '[extensions]' >> $HGRCPATH
1404 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1407 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1405 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1408 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1406 $ hg help revsets | grep helphook
1409 $ hg help revsets | grep helphook
1407 helphook1
1410 helphook1
1408 helphook2
1411 helphook2
1409
1412
1410 help -c should only show debug --debug
1413 help -c should only show debug --debug
1411
1414
1412 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1415 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1413 [1]
1416 [1]
1414
1417
1415 help -c should only show deprecated for -v
1418 help -c should only show deprecated for -v
1416
1419
1417 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1420 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1418 [1]
1421 [1]
1419
1422
1420 Test -s / --system
1423 Test -s / --system
1421
1424
1422 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1425 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1423 > wc -l | sed -e 's/ //g'
1426 > wc -l | sed -e 's/ //g'
1424 0
1427 0
1425 $ hg help config.files --system unix | grep 'USER' | \
1428 $ hg help config.files --system unix | grep 'USER' | \
1426 > wc -l | sed -e 's/ //g'
1429 > wc -l | sed -e 's/ //g'
1427 0
1430 0
1428
1431
1429 Test -e / -c / -k combinations
1432 Test -e / -c / -k combinations
1430
1433
1431 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1434 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1432 Commands:
1435 Commands:
1433 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1436 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1434 Extensions:
1437 Extensions:
1435 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1438 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1436 Topics:
1439 Topics:
1437 Commands:
1440 Commands:
1438 Extensions:
1441 Extensions:
1439 Extension Commands:
1442 Extension Commands:
1440 $ hg help -c schemes
1443 $ hg help -c schemes
1441 abort: no such help topic: schemes
1444 abort: no such help topic: schemes
1442 (try 'hg help --keyword schemes')
1445 (try 'hg help --keyword schemes')
1443 [255]
1446 [255]
1444 $ hg help -e schemes |head -1
1447 $ hg help -e schemes |head -1
1445 schemes extension - extend schemes with shortcuts to repository swarms
1448 schemes extension - extend schemes with shortcuts to repository swarms
1446 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1449 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1447 Commands:
1450 Commands:
1448 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1451 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1449 Extensions:
1452 Extensions:
1450 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1453 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1451 Extensions:
1454 Extensions:
1452 Commands:
1455 Commands:
1453 $ hg help -c commit > /dev/null
1456 $ hg help -c commit > /dev/null
1454 $ hg help -e -c commit > /dev/null
1457 $ hg help -e -c commit > /dev/null
1455 $ hg help -e commit > /dev/null
1458 $ hg help -e commit > /dev/null
1456 abort: no such help topic: commit
1459 abort: no such help topic: commit
1457 (try 'hg help --keyword commit')
1460 (try 'hg help --keyword commit')
1458 [255]
1461 [255]
1459
1462
1460 Test keyword search help
1463 Test keyword search help
1461
1464
1462 $ cat > prefixedname.py <<EOF
1465 $ cat > prefixedname.py <<EOF
1463 > '''matched against word "clone"
1466 > '''matched against word "clone"
1464 > '''
1467 > '''
1465 > EOF
1468 > EOF
1466 $ echo '[extensions]' >> $HGRCPATH
1469 $ echo '[extensions]' >> $HGRCPATH
1467 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1470 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1468 $ hg help -k clone
1471 $ hg help -k clone
1469 Topics:
1472 Topics:
1470
1473
1471 config Configuration Files
1474 config Configuration Files
1472 extensions Using Additional Features
1475 extensions Using Additional Features
1473 glossary Glossary
1476 glossary Glossary
1474 phases Working with Phases
1477 phases Working with Phases
1475 subrepos Subrepositories
1478 subrepos Subrepositories
1476 urls URL Paths
1479 urls URL Paths
1477
1480
1478 Commands:
1481 Commands:
1479
1482
1480 bookmarks create a new bookmark or list existing bookmarks
1483 bookmarks create a new bookmark or list existing bookmarks
1481 clone make a copy of an existing repository
1484 clone make a copy of an existing repository
1482 paths show aliases for remote repositories
1485 paths show aliases for remote repositories
1483 update update working directory (or switch revisions)
1486 update update working directory (or switch revisions)
1484
1487
1485 Extensions:
1488 Extensions:
1486
1489
1487 clonebundles advertise pre-generated bundles to seed clones
1490 clonebundles advertise pre-generated bundles to seed clones
1488 prefixedname matched against word "clone"
1491 prefixedname matched against word "clone"
1489 relink recreates hardlinks between repository clones
1492 relink recreates hardlinks between repository clones
1490
1493
1491 Extension Commands:
1494 Extension Commands:
1492
1495
1493 qclone clone main and patch repository at same time
1496 qclone clone main and patch repository at same time
1494
1497
1495 Test unfound topic
1498 Test unfound topic
1496
1499
1497 $ hg help nonexistingtopicthatwillneverexisteverever
1500 $ hg help nonexistingtopicthatwillneverexisteverever
1498 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1501 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1499 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1502 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1500 [255]
1503 [255]
1501
1504
1502 Test unfound keyword
1505 Test unfound keyword
1503
1506
1504 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1507 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1505 abort: no matches
1508 abort: no matches
1506 (try 'hg help' for a list of topics)
1509 (try 'hg help' for a list of topics)
1507 [255]
1510 [255]
1508
1511
1509 Test omit indicating for help
1512 Test omit indicating for help
1510
1513
1511 $ cat > addverboseitems.py <<EOF
1514 $ cat > addverboseitems.py <<EOF
1512 > '''extension to test omit indicating.
1515 > '''extension to test omit indicating.
1513 >
1516 >
1514 > This paragraph is never omitted (for extension)
1517 > This paragraph is never omitted (for extension)
1515 >
1518 >
1516 > .. container:: verbose
1519 > .. container:: verbose
1517 >
1520 >
1518 > This paragraph is omitted,
1521 > This paragraph is omitted,
1519 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1522 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1520 >
1523 >
1521 > This paragraph is never omitted, too (for extension)
1524 > This paragraph is never omitted, too (for extension)
1522 > '''
1525 > '''
1523 > from __future__ import absolute_import
1526 > from __future__ import absolute_import
1524 > from mercurial import commands, help
1527 > from mercurial import commands, help
1525 > testtopic = """This paragraph is never omitted (for topic).
1528 > testtopic = """This paragraph is never omitted (for topic).
1526 >
1529 >
1527 > .. container:: verbose
1530 > .. container:: verbose
1528 >
1531 >
1529 > This paragraph is omitted,
1532 > This paragraph is omitted,
1530 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1533 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1531 >
1534 >
1532 > This paragraph is never omitted, too (for topic)
1535 > This paragraph is never omitted, too (for topic)
1533 > """
1536 > """
1534 > def extsetup(ui):
1537 > def extsetup(ui):
1535 > help.helptable.append((["topic-containing-verbose"],
1538 > help.helptable.append((["topic-containing-verbose"],
1536 > "This is the topic to test omit indicating.",
1539 > "This is the topic to test omit indicating.",
1537 > lambda ui: testtopic))
1540 > lambda ui: testtopic))
1538 > EOF
1541 > EOF
1539 $ echo '[extensions]' >> $HGRCPATH
1542 $ echo '[extensions]' >> $HGRCPATH
1540 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1543 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1541 $ hg help addverboseitems
1544 $ hg help addverboseitems
1542 addverboseitems extension - extension to test omit indicating.
1545 addverboseitems extension - extension to test omit indicating.
1543
1546
1544 This paragraph is never omitted (for extension)
1547 This paragraph is never omitted (for extension)
1545
1548
1546 This paragraph is never omitted, too (for extension)
1549 This paragraph is never omitted, too (for extension)
1547
1550
1548 (some details hidden, use --verbose to show complete help)
1551 (some details hidden, use --verbose to show complete help)
1549
1552
1550 no commands defined
1553 no commands defined
1551 $ hg help -v addverboseitems
1554 $ hg help -v addverboseitems
1552 addverboseitems extension - extension to test omit indicating.
1555 addverboseitems extension - extension to test omit indicating.
1553
1556
1554 This paragraph is never omitted (for extension)
1557 This paragraph is never omitted (for extension)
1555
1558
1556 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1559 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1557 extension)
1560 extension)
1558
1561
1559 This paragraph is never omitted, too (for extension)
1562 This paragraph is never omitted, too (for extension)
1560
1563
1561 no commands defined
1564 no commands defined
1562 $ hg help topic-containing-verbose
1565 $ hg help topic-containing-verbose
1563 This is the topic to test omit indicating.
1566 This is the topic to test omit indicating.
1564 """"""""""""""""""""""""""""""""""""""""""
1567 """"""""""""""""""""""""""""""""""""""""""
1565
1568
1566 This paragraph is never omitted (for topic).
1569 This paragraph is never omitted (for topic).
1567
1570
1568 This paragraph is never omitted, too (for topic)
1571 This paragraph is never omitted, too (for topic)
1569
1572
1570 (some details hidden, use --verbose to show complete help)
1573 (some details hidden, use --verbose to show complete help)
1571 $ hg help -v topic-containing-verbose
1574 $ hg help -v topic-containing-verbose
1572 This is the topic to test omit indicating.
1575 This is the topic to test omit indicating.
1573 """"""""""""""""""""""""""""""""""""""""""
1576 """"""""""""""""""""""""""""""""""""""""""
1574
1577
1575 This paragraph is never omitted (for topic).
1578 This paragraph is never omitted (for topic).
1576
1579
1577 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1580 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1578 topic)
1581 topic)
1579
1582
1580 This paragraph is never omitted, too (for topic)
1583 This paragraph is never omitted, too (for topic)
1581
1584
1582 Test section lookup
1585 Test section lookup
1583
1586
1584 $ hg help revset.merge
1587 $ hg help revset.merge
1585 "merge()"
1588 "merge()"
1586 Changeset is a merge changeset.
1589 Changeset is a merge changeset.
1587
1590
1588 $ hg help glossary.dag
1591 $ hg help glossary.dag
1589 DAG
1592 DAG
1590 The repository of changesets of a distributed version control system
1593 The repository of changesets of a distributed version control system
1591 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1594 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1592 of nodes and edges, where nodes correspond to changesets and edges
1595 of nodes and edges, where nodes correspond to changesets and edges
1593 imply a parent -> child relation. This graph can be visualized by
1596 imply a parent -> child relation. This graph can be visualized by
1594 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1597 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1595 limited by the requirement for children to have at most two parents.
1598 limited by the requirement for children to have at most two parents.
1596
1599
1597
1600
1598 $ hg help hgrc.paths
1601 $ hg help hgrc.paths
1599 "paths"
1602 "paths"
1600 -------
1603 -------
1601
1604
1602 Assigns symbolic names and behavior to repositories.
1605 Assigns symbolic names and behavior to repositories.
1603
1606
1604 Options are symbolic names defining the URL or directory that is the
1607 Options are symbolic names defining the URL or directory that is the
1605 location of the repository. Example:
1608 location of the repository. Example:
1606
1609
1607 [paths]
1610 [paths]
1608 my_server = https://example.com/my_repo
1611 my_server = https://example.com/my_repo
1609 local_path = /home/me/repo
1612 local_path = /home/me/repo
1610
1613
1611 These symbolic names can be used from the command line. To pull from
1614 These symbolic names can be used from the command line. To pull from
1612 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1615 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1613 local_path'.
1616 local_path'.
1614
1617
1615 Options containing colons (":") denote sub-options that can influence
1618 Options containing colons (":") denote sub-options that can influence
1616 behavior for that specific path. Example:
1619 behavior for that specific path. Example:
1617
1620
1618 [paths]
1621 [paths]
1619 my_server = https://example.com/my_path
1622 my_server = https://example.com/my_path
1620 my_server:pushurl = ssh://example.com/my_path
1623 my_server:pushurl = ssh://example.com/my_path
1621
1624
1622 The following sub-options can be defined:
1625 The following sub-options can be defined:
1623
1626
1624 "pushurl"
1627 "pushurl"
1625 The URL to use for push operations. If not defined, the location
1628 The URL to use for push operations. If not defined, the location
1626 defined by the path's main entry is used.
1629 defined by the path's main entry is used.
1627
1630
1628 "pushrev"
1631 "pushrev"
1629 A revset defining which revisions to push by default.
1632 A revset defining which revisions to push by default.
1630
1633
1631 When 'hg push' is executed without a "-r" argument, the revset defined
1634 When 'hg push' is executed without a "-r" argument, the revset defined
1632 by this sub-option is evaluated to determine what to push.
1635 by this sub-option is evaluated to determine what to push.
1633
1636
1634 For example, a value of "." will push the working directory's revision
1637 For example, a value of "." will push the working directory's revision
1635 by default.
1638 by default.
1636
1639
1637 Revsets specifying bookmarks will not result in the bookmark being
1640 Revsets specifying bookmarks will not result in the bookmark being
1638 pushed.
1641 pushed.
1639
1642
1640 The following special named paths exist:
1643 The following special named paths exist:
1641
1644
1642 "default"
1645 "default"
1643 The URL or directory to use when no source or remote is specified.
1646 The URL or directory to use when no source or remote is specified.
1644
1647
1645 'hg clone' will automatically define this path to the location the
1648 'hg clone' will automatically define this path to the location the
1646 repository was cloned from.
1649 repository was cloned from.
1647
1650
1648 "default-push"
1651 "default-push"
1649 (deprecated) The URL or directory for the default 'hg push' location.
1652 (deprecated) The URL or directory for the default 'hg push' location.
1650 "default:pushurl" should be used instead.
1653 "default:pushurl" should be used instead.
1651
1654
1652 $ hg help glossary.mcguffin
1655 $ hg help glossary.mcguffin
1653 abort: help section not found: glossary.mcguffin
1656 abort: help section not found: glossary.mcguffin
1654 [255]
1657 [255]
1655
1658
1656 $ hg help glossary.mc.guffin
1659 $ hg help glossary.mc.guffin
1657 abort: help section not found: glossary.mc.guffin
1660 abort: help section not found: glossary.mc.guffin
1658 [255]
1661 [255]
1659
1662
1660 $ hg help template.files
1663 $ hg help template.files
1661 files List of strings. All files modified, added, or removed by
1664 files List of strings. All files modified, added, or removed by
1662 this changeset.
1665 this changeset.
1663 files(pattern)
1666 files(pattern)
1664 All files of the current changeset matching the pattern. See
1667 All files of the current changeset matching the pattern. See
1665 'hg help patterns'.
1668 'hg help patterns'.
1666
1669
1667 Test section lookup by translated message
1670 Test section lookup by translated message
1668
1671
1669 str.lower() instead of encoding.lower(str) on translated message might
1672 str.lower() instead of encoding.lower(str) on translated message might
1670 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1673 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1671 as the second or later byte of multi-byte character.
1674 as the second or later byte of multi-byte character.
1672
1675
1673 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1676 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1674 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1677 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1675 replacement makes message meaningless.
1678 replacement makes message meaningless.
1676
1679
1677 This tests that section lookup by translated string isn't broken by
1680 This tests that section lookup by translated string isn't broken by
1678 such str.lower().
1681 such str.lower().
1679
1682
1680 $ $PYTHON <<EOF
1683 $ $PYTHON <<EOF
1681 > def escape(s):
1684 > def escape(s):
1682 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1685 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1683 > # translation of "record" in ja_JP.cp932
1686 > # translation of "record" in ja_JP.cp932
1684 > upper = "\x8bL\x98^"
1687 > upper = "\x8bL\x98^"
1685 > # str.lower()-ed section name should be treated as different one
1688 > # str.lower()-ed section name should be treated as different one
1686 > lower = "\x8bl\x98^"
1689 > lower = "\x8bl\x98^"
1687 > with open('ambiguous.py', 'w') as fp:
1690 > with open('ambiguous.py', 'w') as fp:
1688 > fp.write("""# ambiguous section names in ja_JP.cp932
1691 > fp.write("""# ambiguous section names in ja_JP.cp932
1689 > u'''summary of extension
1692 > u'''summary of extension
1690 >
1693 >
1691 > %s
1694 > %s
1692 > ----
1695 > ----
1693 >
1696 >
1694 > Upper name should show only this message
1697 > Upper name should show only this message
1695 >
1698 >
1696 > %s
1699 > %s
1697 > ----
1700 > ----
1698 >
1701 >
1699 > Lower name should show only this message
1702 > Lower name should show only this message
1700 >
1703 >
1701 > subsequent section
1704 > subsequent section
1702 > ------------------
1705 > ------------------
1703 >
1706 >
1704 > This should be hidden at 'hg help ambiguous' with section name.
1707 > This should be hidden at 'hg help ambiguous' with section name.
1705 > '''
1708 > '''
1706 > """ % (escape(upper), escape(lower)))
1709 > """ % (escape(upper), escape(lower)))
1707 > EOF
1710 > EOF
1708
1711
1709 $ cat >> $HGRCPATH <<EOF
1712 $ cat >> $HGRCPATH <<EOF
1710 > [extensions]
1713 > [extensions]
1711 > ambiguous = ./ambiguous.py
1714 > ambiguous = ./ambiguous.py
1712 > EOF
1715 > EOF
1713
1716
1714 $ $PYTHON <<EOF | sh
1717 $ $PYTHON <<EOF | sh
1715 > upper = "\x8bL\x98^"
1718 > upper = "\x8bL\x98^"
1716 > print("hg --encoding cp932 help -e ambiguous.%s" % upper)
1719 > print("hg --encoding cp932 help -e ambiguous.%s" % upper)
1717 > EOF
1720 > EOF
1718 \x8bL\x98^ (esc)
1721 \x8bL\x98^ (esc)
1719 ----
1722 ----
1720
1723
1721 Upper name should show only this message
1724 Upper name should show only this message
1722
1725
1723
1726
1724 $ $PYTHON <<EOF | sh
1727 $ $PYTHON <<EOF | sh
1725 > lower = "\x8bl\x98^"
1728 > lower = "\x8bl\x98^"
1726 > print("hg --encoding cp932 help -e ambiguous.%s" % lower)
1729 > print("hg --encoding cp932 help -e ambiguous.%s" % lower)
1727 > EOF
1730 > EOF
1728 \x8bl\x98^ (esc)
1731 \x8bl\x98^ (esc)
1729 ----
1732 ----
1730
1733
1731 Lower name should show only this message
1734 Lower name should show only this message
1732
1735
1733
1736
1734 $ cat >> $HGRCPATH <<EOF
1737 $ cat >> $HGRCPATH <<EOF
1735 > [extensions]
1738 > [extensions]
1736 > ambiguous = !
1739 > ambiguous = !
1737 > EOF
1740 > EOF
1738
1741
1739 Show help content of disabled extensions
1742 Show help content of disabled extensions
1740
1743
1741 $ cat >> $HGRCPATH <<EOF
1744 $ cat >> $HGRCPATH <<EOF
1742 > [extensions]
1745 > [extensions]
1743 > ambiguous = !./ambiguous.py
1746 > ambiguous = !./ambiguous.py
1744 > EOF
1747 > EOF
1745 $ hg help -e ambiguous
1748 $ hg help -e ambiguous
1746 ambiguous extension - (no help text available)
1749 ambiguous extension - (no help text available)
1747
1750
1748 (use 'hg help extensions' for information on enabling extensions)
1751 (use 'hg help extensions' for information on enabling extensions)
1749
1752
1750 Test dynamic list of merge tools only shows up once
1753 Test dynamic list of merge tools only shows up once
1751 $ hg help merge-tools
1754 $ hg help merge-tools
1752 Merge Tools
1755 Merge Tools
1753 """""""""""
1756 """""""""""
1754
1757
1755 To merge files Mercurial uses merge tools.
1758 To merge files Mercurial uses merge tools.
1756
1759
1757 A merge tool combines two different versions of a file into a merged file.
1760 A merge tool combines two different versions of a file into a merged file.
1758 Merge tools are given the two files and the greatest common ancestor of
1761 Merge tools are given the two files and the greatest common ancestor of
1759 the two file versions, so they can determine the changes made on both
1762 the two file versions, so they can determine the changes made on both
1760 branches.
1763 branches.
1761
1764
1762 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1765 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1763 backout' and in several extensions.
1766 backout' and in several extensions.
1764
1767
1765 Usually, the merge tool tries to automatically reconcile the files by
1768 Usually, the merge tool tries to automatically reconcile the files by
1766 combining all non-overlapping changes that occurred separately in the two
1769 combining all non-overlapping changes that occurred separately in the two
1767 different evolutions of the same initial base file. Furthermore, some
1770 different evolutions of the same initial base file. Furthermore, some
1768 interactive merge programs make it easier to manually resolve conflicting
1771 interactive merge programs make it easier to manually resolve conflicting
1769 merges, either in a graphical way, or by inserting some conflict markers.
1772 merges, either in a graphical way, or by inserting some conflict markers.
1770 Mercurial does not include any interactive merge programs but relies on
1773 Mercurial does not include any interactive merge programs but relies on
1771 external tools for that.
1774 external tools for that.
1772
1775
1773 Available merge tools
1776 Available merge tools
1774 =====================
1777 =====================
1775
1778
1776 External merge tools and their properties are configured in the merge-
1779 External merge tools and their properties are configured in the merge-
1777 tools configuration section - see hgrc(5) - but they can often just be
1780 tools configuration section - see hgrc(5) - but they can often just be
1778 named by their executable.
1781 named by their executable.
1779
1782
1780 A merge tool is generally usable if its executable can be found on the
1783 A merge tool is generally usable if its executable can be found on the
1781 system and if it can handle the merge. The executable is found if it is an
1784 system and if it can handle the merge. The executable is found if it is an
1782 absolute or relative executable path or the name of an application in the
1785 absolute or relative executable path or the name of an application in the
1783 executable search path. The tool is assumed to be able to handle the merge
1786 executable search path. The tool is assumed to be able to handle the merge
1784 if it can handle symlinks if the file is a symlink, if it can handle
1787 if it can handle symlinks if the file is a symlink, if it can handle
1785 binary files if the file is binary, and if a GUI is available if the tool
1788 binary files if the file is binary, and if a GUI is available if the tool
1786 requires a GUI.
1789 requires a GUI.
1787
1790
1788 There are some internal merge tools which can be used. The internal merge
1791 There are some internal merge tools which can be used. The internal merge
1789 tools are:
1792 tools are:
1790
1793
1791 ":dump"
1794 ":dump"
1792 Creates three versions of the files to merge, containing the contents of
1795 Creates three versions of the files to merge, containing the contents of
1793 local, other and base. These files can then be used to perform a merge
1796 local, other and base. These files can then be used to perform a merge
1794 manually. If the file to be merged is named "a.txt", these files will
1797 manually. If the file to be merged is named "a.txt", these files will
1795 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1798 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1796 they will be placed in the same directory as "a.txt".
1799 they will be placed in the same directory as "a.txt".
1797
1800
1798 This implies premerge. Therefore, files aren't dumped, if premerge runs
1801 This implies premerge. Therefore, files aren't dumped, if premerge runs
1799 successfully. Use :forcedump to forcibly write files out.
1802 successfully. Use :forcedump to forcibly write files out.
1800
1803
1801 ":fail"
1804 ":fail"
1802 Rather than attempting to merge files that were modified on both
1805 Rather than attempting to merge files that were modified on both
1803 branches, it marks them as unresolved. The resolve command must be used
1806 branches, it marks them as unresolved. The resolve command must be used
1804 to resolve these conflicts.
1807 to resolve these conflicts.
1805
1808
1806 ":forcedump"
1809 ":forcedump"
1807 Creates three versions of the files as same as :dump, but omits
1810 Creates three versions of the files as same as :dump, but omits
1808 premerge.
1811 premerge.
1809
1812
1810 ":local"
1813 ":local"
1811 Uses the local 'p1()' version of files as the merged version.
1814 Uses the local 'p1()' version of files as the merged version.
1812
1815
1813 ":merge"
1816 ":merge"
1814 Uses the internal non-interactive simple merge algorithm for merging
1817 Uses the internal non-interactive simple merge algorithm for merging
1815 files. It will fail if there are any conflicts and leave markers in the
1818 files. It will fail if there are any conflicts and leave markers in the
1816 partially merged file. Markers will have two sections, one for each side
1819 partially merged file. Markers will have two sections, one for each side
1817 of merge.
1820 of merge.
1818
1821
1819 ":merge-local"
1822 ":merge-local"
1820 Like :merge, but resolve all conflicts non-interactively in favor of the
1823 Like :merge, but resolve all conflicts non-interactively in favor of the
1821 local 'p1()' changes.
1824 local 'p1()' changes.
1822
1825
1823 ":merge-other"
1826 ":merge-other"
1824 Like :merge, but resolve all conflicts non-interactively in favor of the
1827 Like :merge, but resolve all conflicts non-interactively in favor of the
1825 other 'p2()' changes.
1828 other 'p2()' changes.
1826
1829
1827 ":merge3"
1830 ":merge3"
1828 Uses the internal non-interactive simple merge algorithm for merging
1831 Uses the internal non-interactive simple merge algorithm for merging
1829 files. It will fail if there are any conflicts and leave markers in the
1832 files. It will fail if there are any conflicts and leave markers in the
1830 partially merged file. Marker will have three sections, one from each
1833 partially merged file. Marker will have three sections, one from each
1831 side of the merge and one for the base content.
1834 side of the merge and one for the base content.
1832
1835
1833 ":other"
1836 ":other"
1834 Uses the other 'p2()' version of files as the merged version.
1837 Uses the other 'p2()' version of files as the merged version.
1835
1838
1836 ":prompt"
1839 ":prompt"
1837 Asks the user which of the local 'p1()' or the other 'p2()' version to
1840 Asks the user which of the local 'p1()' or the other 'p2()' version to
1838 keep as the merged version.
1841 keep as the merged version.
1839
1842
1840 ":tagmerge"
1843 ":tagmerge"
1841 Uses the internal tag merge algorithm (experimental).
1844 Uses the internal tag merge algorithm (experimental).
1842
1845
1843 ":union"
1846 ":union"
1844 Uses the internal non-interactive simple merge algorithm for merging
1847 Uses the internal non-interactive simple merge algorithm for merging
1845 files. It will use both left and right sides for conflict regions. No
1848 files. It will use both left and right sides for conflict regions. No
1846 markers are inserted.
1849 markers are inserted.
1847
1850
1848 Internal tools are always available and do not require a GUI but will by
1851 Internal tools are always available and do not require a GUI but will by
1849 default not handle symlinks or binary files.
1852 default not handle symlinks or binary files.
1850
1853
1851 Choosing a merge tool
1854 Choosing a merge tool
1852 =====================
1855 =====================
1853
1856
1854 Mercurial uses these rules when deciding which merge tool to use:
1857 Mercurial uses these rules when deciding which merge tool to use:
1855
1858
1856 1. If a tool has been specified with the --tool option to merge or
1859 1. If a tool has been specified with the --tool option to merge or
1857 resolve, it is used. If it is the name of a tool in the merge-tools
1860 resolve, it is used. If it is the name of a tool in the merge-tools
1858 configuration, its configuration is used. Otherwise the specified tool
1861 configuration, its configuration is used. Otherwise the specified tool
1859 must be executable by the shell.
1862 must be executable by the shell.
1860 2. If the "HGMERGE" environment variable is present, its value is used and
1863 2. If the "HGMERGE" environment variable is present, its value is used and
1861 must be executable by the shell.
1864 must be executable by the shell.
1862 3. If the filename of the file to be merged matches any of the patterns in
1865 3. If the filename of the file to be merged matches any of the patterns in
1863 the merge-patterns configuration section, the first usable merge tool
1866 the merge-patterns configuration section, the first usable merge tool
1864 corresponding to a matching pattern is used. Here, binary capabilities
1867 corresponding to a matching pattern is used. Here, binary capabilities
1865 of the merge tool are not considered.
1868 of the merge tool are not considered.
1866 4. If ui.merge is set it will be considered next. If the value is not the
1869 4. If ui.merge is set it will be considered next. If the value is not the
1867 name of a configured tool, the specified value is used and must be
1870 name of a configured tool, the specified value is used and must be
1868 executable by the shell. Otherwise the named tool is used if it is
1871 executable by the shell. Otherwise the named tool is used if it is
1869 usable.
1872 usable.
1870 5. If any usable merge tools are present in the merge-tools configuration
1873 5. If any usable merge tools are present in the merge-tools configuration
1871 section, the one with the highest priority is used.
1874 section, the one with the highest priority is used.
1872 6. If a program named "hgmerge" can be found on the system, it is used -
1875 6. If a program named "hgmerge" can be found on the system, it is used -
1873 but it will by default not be used for symlinks and binary files.
1876 but it will by default not be used for symlinks and binary files.
1874 7. If the file to be merged is not binary and is not a symlink, then
1877 7. If the file to be merged is not binary and is not a symlink, then
1875 internal ":merge" is used.
1878 internal ":merge" is used.
1876 8. Otherwise, ":prompt" is used.
1879 8. Otherwise, ":prompt" is used.
1877
1880
1878 Note:
1881 Note:
1879 After selecting a merge program, Mercurial will by default attempt to
1882 After selecting a merge program, Mercurial will by default attempt to
1880 merge the files using a simple merge algorithm first. Only if it
1883 merge the files using a simple merge algorithm first. Only if it
1881 doesn't succeed because of conflicting changes will Mercurial actually
1884 doesn't succeed because of conflicting changes will Mercurial actually
1882 execute the merge program. Whether to use the simple merge algorithm
1885 execute the merge program. Whether to use the simple merge algorithm
1883 first can be controlled by the premerge setting of the merge tool.
1886 first can be controlled by the premerge setting of the merge tool.
1884 Premerge is enabled by default unless the file is binary or a symlink.
1887 Premerge is enabled by default unless the file is binary or a symlink.
1885
1888
1886 See the merge-tools and ui sections of hgrc(5) for details on the
1889 See the merge-tools and ui sections of hgrc(5) for details on the
1887 configuration of merge tools.
1890 configuration of merge tools.
1888
1891
1889 Compression engines listed in `hg help bundlespec`
1892 Compression engines listed in `hg help bundlespec`
1890
1893
1891 $ hg help bundlespec | grep gzip
1894 $ hg help bundlespec | grep gzip
1892 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1895 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1893 An algorithm that produces smaller bundles than "gzip".
1896 An algorithm that produces smaller bundles than "gzip".
1894 This engine will likely produce smaller bundles than "gzip" but will be
1897 This engine will likely produce smaller bundles than "gzip" but will be
1895 "gzip"
1898 "gzip"
1896 better compression than "gzip". It also frequently yields better (?)
1899 better compression than "gzip". It also frequently yields better (?)
1897
1900
1898 Test usage of section marks in help documents
1901 Test usage of section marks in help documents
1899
1902
1900 $ cd "$TESTDIR"/../doc
1903 $ cd "$TESTDIR"/../doc
1901 $ $PYTHON check-seclevel.py
1904 $ $PYTHON check-seclevel.py
1902 $ cd $TESTTMP
1905 $ cd $TESTTMP
1903
1906
1904 #if serve
1907 #if serve
1905
1908
1906 Test the help pages in hgweb.
1909 Test the help pages in hgweb.
1907
1910
1908 Dish up an empty repo; serve it cold.
1911 Dish up an empty repo; serve it cold.
1909
1912
1910 $ hg init "$TESTTMP/test"
1913 $ hg init "$TESTTMP/test"
1911 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1914 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1912 $ cat hg.pid >> $DAEMON_PIDS
1915 $ cat hg.pid >> $DAEMON_PIDS
1913
1916
1914 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1917 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1915 200 Script output follows
1918 200 Script output follows
1916
1919
1917 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1920 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1918 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1921 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1919 <head>
1922 <head>
1920 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1923 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1921 <meta name="robots" content="index, nofollow" />
1924 <meta name="robots" content="index, nofollow" />
1922 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1925 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1923 <script type="text/javascript" src="/static/mercurial.js"></script>
1926 <script type="text/javascript" src="/static/mercurial.js"></script>
1924
1927
1925 <title>Help: Index</title>
1928 <title>Help: Index</title>
1926 </head>
1929 </head>
1927 <body>
1930 <body>
1928
1931
1929 <div class="container">
1932 <div class="container">
1930 <div class="menu">
1933 <div class="menu">
1931 <div class="logo">
1934 <div class="logo">
1932 <a href="https://mercurial-scm.org/">
1935 <a href="https://mercurial-scm.org/">
1933 <img src="/static/hglogo.png" alt="mercurial" /></a>
1936 <img src="/static/hglogo.png" alt="mercurial" /></a>
1934 </div>
1937 </div>
1935 <ul>
1938 <ul>
1936 <li><a href="/shortlog">log</a></li>
1939 <li><a href="/shortlog">log</a></li>
1937 <li><a href="/graph">graph</a></li>
1940 <li><a href="/graph">graph</a></li>
1938 <li><a href="/tags">tags</a></li>
1941 <li><a href="/tags">tags</a></li>
1939 <li><a href="/bookmarks">bookmarks</a></li>
1942 <li><a href="/bookmarks">bookmarks</a></li>
1940 <li><a href="/branches">branches</a></li>
1943 <li><a href="/branches">branches</a></li>
1941 </ul>
1944 </ul>
1942 <ul>
1945 <ul>
1943 <li class="active">help</li>
1946 <li class="active">help</li>
1944 </ul>
1947 </ul>
1945 </div>
1948 </div>
1946
1949
1947 <div class="main">
1950 <div class="main">
1948 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1951 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1949
1952
1950 <form class="search" action="/log">
1953 <form class="search" action="/log">
1951
1954
1952 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1955 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1953 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1956 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1954 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1957 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1955 </form>
1958 </form>
1956 <table class="bigtable">
1959 <table class="bigtable">
1957 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1960 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1958
1961
1959 <tr><td>
1962 <tr><td>
1960 <a href="/help/bundlespec">
1963 <a href="/help/bundlespec">
1961 bundlespec
1964 bundlespec
1962 </a>
1965 </a>
1963 </td><td>
1966 </td><td>
1964 Bundle File Formats
1967 Bundle File Formats
1965 </td></tr>
1968 </td></tr>
1966 <tr><td>
1969 <tr><td>
1967 <a href="/help/color">
1970 <a href="/help/color">
1968 color
1971 color
1969 </a>
1972 </a>
1970 </td><td>
1973 </td><td>
1971 Colorizing Outputs
1974 Colorizing Outputs
1972 </td></tr>
1975 </td></tr>
1973 <tr><td>
1976 <tr><td>
1974 <a href="/help/config">
1977 <a href="/help/config">
1975 config
1978 config
1976 </a>
1979 </a>
1977 </td><td>
1980 </td><td>
1978 Configuration Files
1981 Configuration Files
1979 </td></tr>
1982 </td></tr>
1980 <tr><td>
1983 <tr><td>
1981 <a href="/help/dates">
1984 <a href="/help/dates">
1982 dates
1985 dates
1983 </a>
1986 </a>
1984 </td><td>
1987 </td><td>
1985 Date Formats
1988 Date Formats
1986 </td></tr>
1989 </td></tr>
1987 <tr><td>
1990 <tr><td>
1988 <a href="/help/diffs">
1991 <a href="/help/diffs">
1989 diffs
1992 diffs
1990 </a>
1993 </a>
1991 </td><td>
1994 </td><td>
1992 Diff Formats
1995 Diff Formats
1993 </td></tr>
1996 </td></tr>
1994 <tr><td>
1997 <tr><td>
1995 <a href="/help/environment">
1998 <a href="/help/environment">
1996 environment
1999 environment
1997 </a>
2000 </a>
1998 </td><td>
2001 </td><td>
1999 Environment Variables
2002 Environment Variables
2000 </td></tr>
2003 </td></tr>
2001 <tr><td>
2004 <tr><td>
2002 <a href="/help/extensions">
2005 <a href="/help/extensions">
2003 extensions
2006 extensions
2004 </a>
2007 </a>
2005 </td><td>
2008 </td><td>
2006 Using Additional Features
2009 Using Additional Features
2007 </td></tr>
2010 </td></tr>
2008 <tr><td>
2011 <tr><td>
2009 <a href="/help/filesets">
2012 <a href="/help/filesets">
2010 filesets
2013 filesets
2011 </a>
2014 </a>
2012 </td><td>
2015 </td><td>
2013 Specifying File Sets
2016 Specifying File Sets
2014 </td></tr>
2017 </td></tr>
2015 <tr><td>
2018 <tr><td>
2019 <a href="/help/flags">
2020 flags
2021 </a>
2022 </td><td>
2023 Command-line flags
2024 </td></tr>
2025 <tr><td>
2016 <a href="/help/glossary">
2026 <a href="/help/glossary">
2017 glossary
2027 glossary
2018 </a>
2028 </a>
2019 </td><td>
2029 </td><td>
2020 Glossary
2030 Glossary
2021 </td></tr>
2031 </td></tr>
2022 <tr><td>
2032 <tr><td>
2023 <a href="/help/hgignore">
2033 <a href="/help/hgignore">
2024 hgignore
2034 hgignore
2025 </a>
2035 </a>
2026 </td><td>
2036 </td><td>
2027 Syntax for Mercurial Ignore Files
2037 Syntax for Mercurial Ignore Files
2028 </td></tr>
2038 </td></tr>
2029 <tr><td>
2039 <tr><td>
2030 <a href="/help/hgweb">
2040 <a href="/help/hgweb">
2031 hgweb
2041 hgweb
2032 </a>
2042 </a>
2033 </td><td>
2043 </td><td>
2034 Configuring hgweb
2044 Configuring hgweb
2035 </td></tr>
2045 </td></tr>
2036 <tr><td>
2046 <tr><td>
2037 <a href="/help/internals">
2047 <a href="/help/internals">
2038 internals
2048 internals
2039 </a>
2049 </a>
2040 </td><td>
2050 </td><td>
2041 Technical implementation topics
2051 Technical implementation topics
2042 </td></tr>
2052 </td></tr>
2043 <tr><td>
2053 <tr><td>
2044 <a href="/help/merge-tools">
2054 <a href="/help/merge-tools">
2045 merge-tools
2055 merge-tools
2046 </a>
2056 </a>
2047 </td><td>
2057 </td><td>
2048 Merge Tools
2058 Merge Tools
2049 </td></tr>
2059 </td></tr>
2050 <tr><td>
2060 <tr><td>
2051 <a href="/help/pager">
2061 <a href="/help/pager">
2052 pager
2062 pager
2053 </a>
2063 </a>
2054 </td><td>
2064 </td><td>
2055 Pager Support
2065 Pager Support
2056 </td></tr>
2066 </td></tr>
2057 <tr><td>
2067 <tr><td>
2058 <a href="/help/patterns">
2068 <a href="/help/patterns">
2059 patterns
2069 patterns
2060 </a>
2070 </a>
2061 </td><td>
2071 </td><td>
2062 File Name Patterns
2072 File Name Patterns
2063 </td></tr>
2073 </td></tr>
2064 <tr><td>
2074 <tr><td>
2065 <a href="/help/phases">
2075 <a href="/help/phases">
2066 phases
2076 phases
2067 </a>
2077 </a>
2068 </td><td>
2078 </td><td>
2069 Working with Phases
2079 Working with Phases
2070 </td></tr>
2080 </td></tr>
2071 <tr><td>
2081 <tr><td>
2072 <a href="/help/revisions">
2082 <a href="/help/revisions">
2073 revisions
2083 revisions
2074 </a>
2084 </a>
2075 </td><td>
2085 </td><td>
2076 Specifying Revisions
2086 Specifying Revisions
2077 </td></tr>
2087 </td></tr>
2078 <tr><td>
2088 <tr><td>
2079 <a href="/help/scripting">
2089 <a href="/help/scripting">
2080 scripting
2090 scripting
2081 </a>
2091 </a>
2082 </td><td>
2092 </td><td>
2083 Using Mercurial from scripts and automation
2093 Using Mercurial from scripts and automation
2084 </td></tr>
2094 </td></tr>
2085 <tr><td>
2095 <tr><td>
2086 <a href="/help/subrepos">
2096 <a href="/help/subrepos">
2087 subrepos
2097 subrepos
2088 </a>
2098 </a>
2089 </td><td>
2099 </td><td>
2090 Subrepositories
2100 Subrepositories
2091 </td></tr>
2101 </td></tr>
2092 <tr><td>
2102 <tr><td>
2093 <a href="/help/templating">
2103 <a href="/help/templating">
2094 templating
2104 templating
2095 </a>
2105 </a>
2096 </td><td>
2106 </td><td>
2097 Template Usage
2107 Template Usage
2098 </td></tr>
2108 </td></tr>
2099 <tr><td>
2109 <tr><td>
2100 <a href="/help/urls">
2110 <a href="/help/urls">
2101 urls
2111 urls
2102 </a>
2112 </a>
2103 </td><td>
2113 </td><td>
2104 URL Paths
2114 URL Paths
2105 </td></tr>
2115 </td></tr>
2106 <tr><td>
2116 <tr><td>
2107 <a href="/help/topic-containing-verbose">
2117 <a href="/help/topic-containing-verbose">
2108 topic-containing-verbose
2118 topic-containing-verbose
2109 </a>
2119 </a>
2110 </td><td>
2120 </td><td>
2111 This is the topic to test omit indicating.
2121 This is the topic to test omit indicating.
2112 </td></tr>
2122 </td></tr>
2113
2123
2114
2124
2115 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2125 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2116
2126
2117 <tr><td>
2127 <tr><td>
2118 <a href="/help/add">
2128 <a href="/help/add">
2119 add
2129 add
2120 </a>
2130 </a>
2121 </td><td>
2131 </td><td>
2122 add the specified files on the next commit
2132 add the specified files on the next commit
2123 </td></tr>
2133 </td></tr>
2124 <tr><td>
2134 <tr><td>
2125 <a href="/help/annotate">
2135 <a href="/help/annotate">
2126 annotate
2136 annotate
2127 </a>
2137 </a>
2128 </td><td>
2138 </td><td>
2129 show changeset information by line for each file
2139 show changeset information by line for each file
2130 </td></tr>
2140 </td></tr>
2131 <tr><td>
2141 <tr><td>
2132 <a href="/help/clone">
2142 <a href="/help/clone">
2133 clone
2143 clone
2134 </a>
2144 </a>
2135 </td><td>
2145 </td><td>
2136 make a copy of an existing repository
2146 make a copy of an existing repository
2137 </td></tr>
2147 </td></tr>
2138 <tr><td>
2148 <tr><td>
2139 <a href="/help/commit">
2149 <a href="/help/commit">
2140 commit
2150 commit
2141 </a>
2151 </a>
2142 </td><td>
2152 </td><td>
2143 commit the specified files or all outstanding changes
2153 commit the specified files or all outstanding changes
2144 </td></tr>
2154 </td></tr>
2145 <tr><td>
2155 <tr><td>
2146 <a href="/help/diff">
2156 <a href="/help/diff">
2147 diff
2157 diff
2148 </a>
2158 </a>
2149 </td><td>
2159 </td><td>
2150 diff repository (or selected files)
2160 diff repository (or selected files)
2151 </td></tr>
2161 </td></tr>
2152 <tr><td>
2162 <tr><td>
2153 <a href="/help/export">
2163 <a href="/help/export">
2154 export
2164 export
2155 </a>
2165 </a>
2156 </td><td>
2166 </td><td>
2157 dump the header and diffs for one or more changesets
2167 dump the header and diffs for one or more changesets
2158 </td></tr>
2168 </td></tr>
2159 <tr><td>
2169 <tr><td>
2160 <a href="/help/forget">
2170 <a href="/help/forget">
2161 forget
2171 forget
2162 </a>
2172 </a>
2163 </td><td>
2173 </td><td>
2164 forget the specified files on the next commit
2174 forget the specified files on the next commit
2165 </td></tr>
2175 </td></tr>
2166 <tr><td>
2176 <tr><td>
2167 <a href="/help/init">
2177 <a href="/help/init">
2168 init
2178 init
2169 </a>
2179 </a>
2170 </td><td>
2180 </td><td>
2171 create a new repository in the given directory
2181 create a new repository in the given directory
2172 </td></tr>
2182 </td></tr>
2173 <tr><td>
2183 <tr><td>
2174 <a href="/help/log">
2184 <a href="/help/log">
2175 log
2185 log
2176 </a>
2186 </a>
2177 </td><td>
2187 </td><td>
2178 show revision history of entire repository or files
2188 show revision history of entire repository or files
2179 </td></tr>
2189 </td></tr>
2180 <tr><td>
2190 <tr><td>
2181 <a href="/help/merge">
2191 <a href="/help/merge">
2182 merge
2192 merge
2183 </a>
2193 </a>
2184 </td><td>
2194 </td><td>
2185 merge another revision into working directory
2195 merge another revision into working directory
2186 </td></tr>
2196 </td></tr>
2187 <tr><td>
2197 <tr><td>
2188 <a href="/help/pull">
2198 <a href="/help/pull">
2189 pull
2199 pull
2190 </a>
2200 </a>
2191 </td><td>
2201 </td><td>
2192 pull changes from the specified source
2202 pull changes from the specified source
2193 </td></tr>
2203 </td></tr>
2194 <tr><td>
2204 <tr><td>
2195 <a href="/help/push">
2205 <a href="/help/push">
2196 push
2206 push
2197 </a>
2207 </a>
2198 </td><td>
2208 </td><td>
2199 push changes to the specified destination
2209 push changes to the specified destination
2200 </td></tr>
2210 </td></tr>
2201 <tr><td>
2211 <tr><td>
2202 <a href="/help/remove">
2212 <a href="/help/remove">
2203 remove
2213 remove
2204 </a>
2214 </a>
2205 </td><td>
2215 </td><td>
2206 remove the specified files on the next commit
2216 remove the specified files on the next commit
2207 </td></tr>
2217 </td></tr>
2208 <tr><td>
2218 <tr><td>
2209 <a href="/help/serve">
2219 <a href="/help/serve">
2210 serve
2220 serve
2211 </a>
2221 </a>
2212 </td><td>
2222 </td><td>
2213 start stand-alone webserver
2223 start stand-alone webserver
2214 </td></tr>
2224 </td></tr>
2215 <tr><td>
2225 <tr><td>
2216 <a href="/help/status">
2226 <a href="/help/status">
2217 status
2227 status
2218 </a>
2228 </a>
2219 </td><td>
2229 </td><td>
2220 show changed files in the working directory
2230 show changed files in the working directory
2221 </td></tr>
2231 </td></tr>
2222 <tr><td>
2232 <tr><td>
2223 <a href="/help/summary">
2233 <a href="/help/summary">
2224 summary
2234 summary
2225 </a>
2235 </a>
2226 </td><td>
2236 </td><td>
2227 summarize working directory state
2237 summarize working directory state
2228 </td></tr>
2238 </td></tr>
2229 <tr><td>
2239 <tr><td>
2230 <a href="/help/update">
2240 <a href="/help/update">
2231 update
2241 update
2232 </a>
2242 </a>
2233 </td><td>
2243 </td><td>
2234 update working directory (or switch revisions)
2244 update working directory (or switch revisions)
2235 </td></tr>
2245 </td></tr>
2236
2246
2237
2247
2238
2248
2239 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2249 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2240
2250
2241 <tr><td>
2251 <tr><td>
2242 <a href="/help/addremove">
2252 <a href="/help/addremove">
2243 addremove
2253 addremove
2244 </a>
2254 </a>
2245 </td><td>
2255 </td><td>
2246 add all new files, delete all missing files
2256 add all new files, delete all missing files
2247 </td></tr>
2257 </td></tr>
2248 <tr><td>
2258 <tr><td>
2249 <a href="/help/archive">
2259 <a href="/help/archive">
2250 archive
2260 archive
2251 </a>
2261 </a>
2252 </td><td>
2262 </td><td>
2253 create an unversioned archive of a repository revision
2263 create an unversioned archive of a repository revision
2254 </td></tr>
2264 </td></tr>
2255 <tr><td>
2265 <tr><td>
2256 <a href="/help/backout">
2266 <a href="/help/backout">
2257 backout
2267 backout
2258 </a>
2268 </a>
2259 </td><td>
2269 </td><td>
2260 reverse effect of earlier changeset
2270 reverse effect of earlier changeset
2261 </td></tr>
2271 </td></tr>
2262 <tr><td>
2272 <tr><td>
2263 <a href="/help/bisect">
2273 <a href="/help/bisect">
2264 bisect
2274 bisect
2265 </a>
2275 </a>
2266 </td><td>
2276 </td><td>
2267 subdivision search of changesets
2277 subdivision search of changesets
2268 </td></tr>
2278 </td></tr>
2269 <tr><td>
2279 <tr><td>
2270 <a href="/help/bookmarks">
2280 <a href="/help/bookmarks">
2271 bookmarks
2281 bookmarks
2272 </a>
2282 </a>
2273 </td><td>
2283 </td><td>
2274 create a new bookmark or list existing bookmarks
2284 create a new bookmark or list existing bookmarks
2275 </td></tr>
2285 </td></tr>
2276 <tr><td>
2286 <tr><td>
2277 <a href="/help/branch">
2287 <a href="/help/branch">
2278 branch
2288 branch
2279 </a>
2289 </a>
2280 </td><td>
2290 </td><td>
2281 set or show the current branch name
2291 set or show the current branch name
2282 </td></tr>
2292 </td></tr>
2283 <tr><td>
2293 <tr><td>
2284 <a href="/help/branches">
2294 <a href="/help/branches">
2285 branches
2295 branches
2286 </a>
2296 </a>
2287 </td><td>
2297 </td><td>
2288 list repository named branches
2298 list repository named branches
2289 </td></tr>
2299 </td></tr>
2290 <tr><td>
2300 <tr><td>
2291 <a href="/help/bundle">
2301 <a href="/help/bundle">
2292 bundle
2302 bundle
2293 </a>
2303 </a>
2294 </td><td>
2304 </td><td>
2295 create a bundle file
2305 create a bundle file
2296 </td></tr>
2306 </td></tr>
2297 <tr><td>
2307 <tr><td>
2298 <a href="/help/cat">
2308 <a href="/help/cat">
2299 cat
2309 cat
2300 </a>
2310 </a>
2301 </td><td>
2311 </td><td>
2302 output the current or given revision of files
2312 output the current or given revision of files
2303 </td></tr>
2313 </td></tr>
2304 <tr><td>
2314 <tr><td>
2305 <a href="/help/config">
2315 <a href="/help/config">
2306 config
2316 config
2307 </a>
2317 </a>
2308 </td><td>
2318 </td><td>
2309 show combined config settings from all hgrc files
2319 show combined config settings from all hgrc files
2310 </td></tr>
2320 </td></tr>
2311 <tr><td>
2321 <tr><td>
2312 <a href="/help/copy">
2322 <a href="/help/copy">
2313 copy
2323 copy
2314 </a>
2324 </a>
2315 </td><td>
2325 </td><td>
2316 mark files as copied for the next commit
2326 mark files as copied for the next commit
2317 </td></tr>
2327 </td></tr>
2318 <tr><td>
2328 <tr><td>
2319 <a href="/help/files">
2329 <a href="/help/files">
2320 files
2330 files
2321 </a>
2331 </a>
2322 </td><td>
2332 </td><td>
2323 list tracked files
2333 list tracked files
2324 </td></tr>
2334 </td></tr>
2325 <tr><td>
2335 <tr><td>
2326 <a href="/help/graft">
2336 <a href="/help/graft">
2327 graft
2337 graft
2328 </a>
2338 </a>
2329 </td><td>
2339 </td><td>
2330 copy changes from other branches onto the current branch
2340 copy changes from other branches onto the current branch
2331 </td></tr>
2341 </td></tr>
2332 <tr><td>
2342 <tr><td>
2333 <a href="/help/grep">
2343 <a href="/help/grep">
2334 grep
2344 grep
2335 </a>
2345 </a>
2336 </td><td>
2346 </td><td>
2337 search revision history for a pattern in specified files
2347 search revision history for a pattern in specified files
2338 </td></tr>
2348 </td></tr>
2339 <tr><td>
2349 <tr><td>
2340 <a href="/help/heads">
2350 <a href="/help/heads">
2341 heads
2351 heads
2342 </a>
2352 </a>
2343 </td><td>
2353 </td><td>
2344 show branch heads
2354 show branch heads
2345 </td></tr>
2355 </td></tr>
2346 <tr><td>
2356 <tr><td>
2347 <a href="/help/help">
2357 <a href="/help/help">
2348 help
2358 help
2349 </a>
2359 </a>
2350 </td><td>
2360 </td><td>
2351 show help for a given topic or a help overview
2361 show help for a given topic or a help overview
2352 </td></tr>
2362 </td></tr>
2353 <tr><td>
2363 <tr><td>
2354 <a href="/help/hgalias">
2364 <a href="/help/hgalias">
2355 hgalias
2365 hgalias
2356 </a>
2366 </a>
2357 </td><td>
2367 </td><td>
2358 summarize working directory state
2368 summarize working directory state
2359 </td></tr>
2369 </td></tr>
2360 <tr><td>
2370 <tr><td>
2361 <a href="/help/identify">
2371 <a href="/help/identify">
2362 identify
2372 identify
2363 </a>
2373 </a>
2364 </td><td>
2374 </td><td>
2365 identify the working directory or specified revision
2375 identify the working directory or specified revision
2366 </td></tr>
2376 </td></tr>
2367 <tr><td>
2377 <tr><td>
2368 <a href="/help/import">
2378 <a href="/help/import">
2369 import
2379 import
2370 </a>
2380 </a>
2371 </td><td>
2381 </td><td>
2372 import an ordered set of patches
2382 import an ordered set of patches
2373 </td></tr>
2383 </td></tr>
2374 <tr><td>
2384 <tr><td>
2375 <a href="/help/incoming">
2385 <a href="/help/incoming">
2376 incoming
2386 incoming
2377 </a>
2387 </a>
2378 </td><td>
2388 </td><td>
2379 show new changesets found in source
2389 show new changesets found in source
2380 </td></tr>
2390 </td></tr>
2381 <tr><td>
2391 <tr><td>
2382 <a href="/help/manifest">
2392 <a href="/help/manifest">
2383 manifest
2393 manifest
2384 </a>
2394 </a>
2385 </td><td>
2395 </td><td>
2386 output the current or given revision of the project manifest
2396 output the current or given revision of the project manifest
2387 </td></tr>
2397 </td></tr>
2388 <tr><td>
2398 <tr><td>
2389 <a href="/help/nohelp">
2399 <a href="/help/nohelp">
2390 nohelp
2400 nohelp
2391 </a>
2401 </a>
2392 </td><td>
2402 </td><td>
2393 (no help text available)
2403 (no help text available)
2394 </td></tr>
2404 </td></tr>
2395 <tr><td>
2405 <tr><td>
2396 <a href="/help/outgoing">
2406 <a href="/help/outgoing">
2397 outgoing
2407 outgoing
2398 </a>
2408 </a>
2399 </td><td>
2409 </td><td>
2400 show changesets not found in the destination
2410 show changesets not found in the destination
2401 </td></tr>
2411 </td></tr>
2402 <tr><td>
2412 <tr><td>
2403 <a href="/help/paths">
2413 <a href="/help/paths">
2404 paths
2414 paths
2405 </a>
2415 </a>
2406 </td><td>
2416 </td><td>
2407 show aliases for remote repositories
2417 show aliases for remote repositories
2408 </td></tr>
2418 </td></tr>
2409 <tr><td>
2419 <tr><td>
2410 <a href="/help/phase">
2420 <a href="/help/phase">
2411 phase
2421 phase
2412 </a>
2422 </a>
2413 </td><td>
2423 </td><td>
2414 set or show the current phase name
2424 set or show the current phase name
2415 </td></tr>
2425 </td></tr>
2416 <tr><td>
2426 <tr><td>
2417 <a href="/help/recover">
2427 <a href="/help/recover">
2418 recover
2428 recover
2419 </a>
2429 </a>
2420 </td><td>
2430 </td><td>
2421 roll back an interrupted transaction
2431 roll back an interrupted transaction
2422 </td></tr>
2432 </td></tr>
2423 <tr><td>
2433 <tr><td>
2424 <a href="/help/rename">
2434 <a href="/help/rename">
2425 rename
2435 rename
2426 </a>
2436 </a>
2427 </td><td>
2437 </td><td>
2428 rename files; equivalent of copy + remove
2438 rename files; equivalent of copy + remove
2429 </td></tr>
2439 </td></tr>
2430 <tr><td>
2440 <tr><td>
2431 <a href="/help/resolve">
2441 <a href="/help/resolve">
2432 resolve
2442 resolve
2433 </a>
2443 </a>
2434 </td><td>
2444 </td><td>
2435 redo merges or set/view the merge status of files
2445 redo merges or set/view the merge status of files
2436 </td></tr>
2446 </td></tr>
2437 <tr><td>
2447 <tr><td>
2438 <a href="/help/revert">
2448 <a href="/help/revert">
2439 revert
2449 revert
2440 </a>
2450 </a>
2441 </td><td>
2451 </td><td>
2442 restore files to their checkout state
2452 restore files to their checkout state
2443 </td></tr>
2453 </td></tr>
2444 <tr><td>
2454 <tr><td>
2445 <a href="/help/root">
2455 <a href="/help/root">
2446 root
2456 root
2447 </a>
2457 </a>
2448 </td><td>
2458 </td><td>
2449 print the root (top) of the current working directory
2459 print the root (top) of the current working directory
2450 </td></tr>
2460 </td></tr>
2451 <tr><td>
2461 <tr><td>
2452 <a href="/help/shellalias">
2462 <a href="/help/shellalias">
2453 shellalias
2463 shellalias
2454 </a>
2464 </a>
2455 </td><td>
2465 </td><td>
2456 (no help text available)
2466 (no help text available)
2457 </td></tr>
2467 </td></tr>
2458 <tr><td>
2468 <tr><td>
2459 <a href="/help/tag">
2469 <a href="/help/tag">
2460 tag
2470 tag
2461 </a>
2471 </a>
2462 </td><td>
2472 </td><td>
2463 add one or more tags for the current or given revision
2473 add one or more tags for the current or given revision
2464 </td></tr>
2474 </td></tr>
2465 <tr><td>
2475 <tr><td>
2466 <a href="/help/tags">
2476 <a href="/help/tags">
2467 tags
2477 tags
2468 </a>
2478 </a>
2469 </td><td>
2479 </td><td>
2470 list repository tags
2480 list repository tags
2471 </td></tr>
2481 </td></tr>
2472 <tr><td>
2482 <tr><td>
2473 <a href="/help/unbundle">
2483 <a href="/help/unbundle">
2474 unbundle
2484 unbundle
2475 </a>
2485 </a>
2476 </td><td>
2486 </td><td>
2477 apply one or more bundle files
2487 apply one or more bundle files
2478 </td></tr>
2488 </td></tr>
2479 <tr><td>
2489 <tr><td>
2480 <a href="/help/verify">
2490 <a href="/help/verify">
2481 verify
2491 verify
2482 </a>
2492 </a>
2483 </td><td>
2493 </td><td>
2484 verify the integrity of the repository
2494 verify the integrity of the repository
2485 </td></tr>
2495 </td></tr>
2486 <tr><td>
2496 <tr><td>
2487 <a href="/help/version">
2497 <a href="/help/version">
2488 version
2498 version
2489 </a>
2499 </a>
2490 </td><td>
2500 </td><td>
2491 output version and copyright information
2501 output version and copyright information
2492 </td></tr>
2502 </td></tr>
2493
2503
2494
2504
2495 </table>
2505 </table>
2496 </div>
2506 </div>
2497 </div>
2507 </div>
2498
2508
2499
2509
2500
2510
2501 </body>
2511 </body>
2502 </html>
2512 </html>
2503
2513
2504
2514
2505 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2515 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2506 200 Script output follows
2516 200 Script output follows
2507
2517
2508 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2518 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2509 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2519 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2510 <head>
2520 <head>
2511 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2521 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2512 <meta name="robots" content="index, nofollow" />
2522 <meta name="robots" content="index, nofollow" />
2513 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2523 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2514 <script type="text/javascript" src="/static/mercurial.js"></script>
2524 <script type="text/javascript" src="/static/mercurial.js"></script>
2515
2525
2516 <title>Help: add</title>
2526 <title>Help: add</title>
2517 </head>
2527 </head>
2518 <body>
2528 <body>
2519
2529
2520 <div class="container">
2530 <div class="container">
2521 <div class="menu">
2531 <div class="menu">
2522 <div class="logo">
2532 <div class="logo">
2523 <a href="https://mercurial-scm.org/">
2533 <a href="https://mercurial-scm.org/">
2524 <img src="/static/hglogo.png" alt="mercurial" /></a>
2534 <img src="/static/hglogo.png" alt="mercurial" /></a>
2525 </div>
2535 </div>
2526 <ul>
2536 <ul>
2527 <li><a href="/shortlog">log</a></li>
2537 <li><a href="/shortlog">log</a></li>
2528 <li><a href="/graph">graph</a></li>
2538 <li><a href="/graph">graph</a></li>
2529 <li><a href="/tags">tags</a></li>
2539 <li><a href="/tags">tags</a></li>
2530 <li><a href="/bookmarks">bookmarks</a></li>
2540 <li><a href="/bookmarks">bookmarks</a></li>
2531 <li><a href="/branches">branches</a></li>
2541 <li><a href="/branches">branches</a></li>
2532 </ul>
2542 </ul>
2533 <ul>
2543 <ul>
2534 <li class="active"><a href="/help">help</a></li>
2544 <li class="active"><a href="/help">help</a></li>
2535 </ul>
2545 </ul>
2536 </div>
2546 </div>
2537
2547
2538 <div class="main">
2548 <div class="main">
2539 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2549 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2540 <h3>Help: add</h3>
2550 <h3>Help: add</h3>
2541
2551
2542 <form class="search" action="/log">
2552 <form class="search" action="/log">
2543
2553
2544 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2554 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2545 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2555 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2546 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2556 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2547 </form>
2557 </form>
2548 <div id="doc">
2558 <div id="doc">
2549 <p>
2559 <p>
2550 hg add [OPTION]... [FILE]...
2560 hg add [OPTION]... [FILE]...
2551 </p>
2561 </p>
2552 <p>
2562 <p>
2553 add the specified files on the next commit
2563 add the specified files on the next commit
2554 </p>
2564 </p>
2555 <p>
2565 <p>
2556 Schedule files to be version controlled and added to the
2566 Schedule files to be version controlled and added to the
2557 repository.
2567 repository.
2558 </p>
2568 </p>
2559 <p>
2569 <p>
2560 The files will be added to the repository at the next commit. To
2570 The files will be added to the repository at the next commit. To
2561 undo an add before that, see 'hg forget'.
2571 undo an add before that, see 'hg forget'.
2562 </p>
2572 </p>
2563 <p>
2573 <p>
2564 If no names are given, add all files to the repository (except
2574 If no names are given, add all files to the repository (except
2565 files matching &quot;.hgignore&quot;).
2575 files matching &quot;.hgignore&quot;).
2566 </p>
2576 </p>
2567 <p>
2577 <p>
2568 Examples:
2578 Examples:
2569 </p>
2579 </p>
2570 <ul>
2580 <ul>
2571 <li> New (unknown) files are added automatically by 'hg add':
2581 <li> New (unknown) files are added automatically by 'hg add':
2572 <pre>
2582 <pre>
2573 \$ ls (re)
2583 \$ ls (re)
2574 foo.c
2584 foo.c
2575 \$ hg status (re)
2585 \$ hg status (re)
2576 ? foo.c
2586 ? foo.c
2577 \$ hg add (re)
2587 \$ hg add (re)
2578 adding foo.c
2588 adding foo.c
2579 \$ hg status (re)
2589 \$ hg status (re)
2580 A foo.c
2590 A foo.c
2581 </pre>
2591 </pre>
2582 <li> Specific files to be added can be specified:
2592 <li> Specific files to be added can be specified:
2583 <pre>
2593 <pre>
2584 \$ ls (re)
2594 \$ ls (re)
2585 bar.c foo.c
2595 bar.c foo.c
2586 \$ hg status (re)
2596 \$ hg status (re)
2587 ? bar.c
2597 ? bar.c
2588 ? foo.c
2598 ? foo.c
2589 \$ hg add bar.c (re)
2599 \$ hg add bar.c (re)
2590 \$ hg status (re)
2600 \$ hg status (re)
2591 A bar.c
2601 A bar.c
2592 ? foo.c
2602 ? foo.c
2593 </pre>
2603 </pre>
2594 </ul>
2604 </ul>
2595 <p>
2605 <p>
2596 Returns 0 if all files are successfully added.
2606 Returns 0 if all files are successfully added.
2597 </p>
2607 </p>
2598 <p>
2608 <p>
2599 options ([+] can be repeated):
2609 options ([+] can be repeated):
2600 </p>
2610 </p>
2601 <table>
2611 <table>
2602 <tr><td>-I</td>
2612 <tr><td>-I</td>
2603 <td>--include PATTERN [+]</td>
2613 <td>--include PATTERN [+]</td>
2604 <td>include names matching the given patterns</td></tr>
2614 <td>include names matching the given patterns</td></tr>
2605 <tr><td>-X</td>
2615 <tr><td>-X</td>
2606 <td>--exclude PATTERN [+]</td>
2616 <td>--exclude PATTERN [+]</td>
2607 <td>exclude names matching the given patterns</td></tr>
2617 <td>exclude names matching the given patterns</td></tr>
2608 <tr><td>-S</td>
2618 <tr><td>-S</td>
2609 <td>--subrepos</td>
2619 <td>--subrepos</td>
2610 <td>recurse into subrepositories</td></tr>
2620 <td>recurse into subrepositories</td></tr>
2611 <tr><td>-n</td>
2621 <tr><td>-n</td>
2612 <td>--dry-run</td>
2622 <td>--dry-run</td>
2613 <td>do not perform actions, just print output</td></tr>
2623 <td>do not perform actions, just print output</td></tr>
2614 </table>
2624 </table>
2615 <p>
2625 <p>
2616 global options ([+] can be repeated):
2626 global options ([+] can be repeated):
2617 </p>
2627 </p>
2618 <table>
2628 <table>
2619 <tr><td>-R</td>
2629 <tr><td>-R</td>
2620 <td>--repository REPO</td>
2630 <td>--repository REPO</td>
2621 <td>repository root directory or name of overlay bundle file</td></tr>
2631 <td>repository root directory or name of overlay bundle file</td></tr>
2622 <tr><td></td>
2632 <tr><td></td>
2623 <td>--cwd DIR</td>
2633 <td>--cwd DIR</td>
2624 <td>change working directory</td></tr>
2634 <td>change working directory</td></tr>
2625 <tr><td>-y</td>
2635 <tr><td>-y</td>
2626 <td>--noninteractive</td>
2636 <td>--noninteractive</td>
2627 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2637 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2628 <tr><td>-q</td>
2638 <tr><td>-q</td>
2629 <td>--quiet</td>
2639 <td>--quiet</td>
2630 <td>suppress output</td></tr>
2640 <td>suppress output</td></tr>
2631 <tr><td>-v</td>
2641 <tr><td>-v</td>
2632 <td>--verbose</td>
2642 <td>--verbose</td>
2633 <td>enable additional output</td></tr>
2643 <td>enable additional output</td></tr>
2634 <tr><td></td>
2644 <tr><td></td>
2635 <td>--color TYPE</td>
2645 <td>--color TYPE</td>
2636 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2646 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2637 <tr><td></td>
2647 <tr><td></td>
2638 <td>--config CONFIG [+]</td>
2648 <td>--config CONFIG [+]</td>
2639 <td>set/override config option (use 'section.name=value')</td></tr>
2649 <td>set/override config option (use 'section.name=value')</td></tr>
2640 <tr><td></td>
2650 <tr><td></td>
2641 <td>--debug</td>
2651 <td>--debug</td>
2642 <td>enable debugging output</td></tr>
2652 <td>enable debugging output</td></tr>
2643 <tr><td></td>
2653 <tr><td></td>
2644 <td>--debugger</td>
2654 <td>--debugger</td>
2645 <td>start debugger</td></tr>
2655 <td>start debugger</td></tr>
2646 <tr><td></td>
2656 <tr><td></td>
2647 <td>--encoding ENCODE</td>
2657 <td>--encoding ENCODE</td>
2648 <td>set the charset encoding (default: ascii)</td></tr>
2658 <td>set the charset encoding (default: ascii)</td></tr>
2649 <tr><td></td>
2659 <tr><td></td>
2650 <td>--encodingmode MODE</td>
2660 <td>--encodingmode MODE</td>
2651 <td>set the charset encoding mode (default: strict)</td></tr>
2661 <td>set the charset encoding mode (default: strict)</td></tr>
2652 <tr><td></td>
2662 <tr><td></td>
2653 <td>--traceback</td>
2663 <td>--traceback</td>
2654 <td>always print a traceback on exception</td></tr>
2664 <td>always print a traceback on exception</td></tr>
2655 <tr><td></td>
2665 <tr><td></td>
2656 <td>--time</td>
2666 <td>--time</td>
2657 <td>time how long the command takes</td></tr>
2667 <td>time how long the command takes</td></tr>
2658 <tr><td></td>
2668 <tr><td></td>
2659 <td>--profile</td>
2669 <td>--profile</td>
2660 <td>print command execution profile</td></tr>
2670 <td>print command execution profile</td></tr>
2661 <tr><td></td>
2671 <tr><td></td>
2662 <td>--version</td>
2672 <td>--version</td>
2663 <td>output version information and exit</td></tr>
2673 <td>output version information and exit</td></tr>
2664 <tr><td>-h</td>
2674 <tr><td>-h</td>
2665 <td>--help</td>
2675 <td>--help</td>
2666 <td>display help and exit</td></tr>
2676 <td>display help and exit</td></tr>
2667 <tr><td></td>
2677 <tr><td></td>
2668 <td>--hidden</td>
2678 <td>--hidden</td>
2669 <td>consider hidden changesets</td></tr>
2679 <td>consider hidden changesets</td></tr>
2670 <tr><td></td>
2680 <tr><td></td>
2671 <td>--pager TYPE</td>
2681 <td>--pager TYPE</td>
2672 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2682 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2673 </table>
2683 </table>
2674
2684
2675 </div>
2685 </div>
2676 </div>
2686 </div>
2677 </div>
2687 </div>
2678
2688
2679
2689
2680
2690
2681 </body>
2691 </body>
2682 </html>
2692 </html>
2683
2693
2684
2694
2685 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2695 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2686 200 Script output follows
2696 200 Script output follows
2687
2697
2688 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2698 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2689 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2699 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2690 <head>
2700 <head>
2691 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2701 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2692 <meta name="robots" content="index, nofollow" />
2702 <meta name="robots" content="index, nofollow" />
2693 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2703 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2694 <script type="text/javascript" src="/static/mercurial.js"></script>
2704 <script type="text/javascript" src="/static/mercurial.js"></script>
2695
2705
2696 <title>Help: remove</title>
2706 <title>Help: remove</title>
2697 </head>
2707 </head>
2698 <body>
2708 <body>
2699
2709
2700 <div class="container">
2710 <div class="container">
2701 <div class="menu">
2711 <div class="menu">
2702 <div class="logo">
2712 <div class="logo">
2703 <a href="https://mercurial-scm.org/">
2713 <a href="https://mercurial-scm.org/">
2704 <img src="/static/hglogo.png" alt="mercurial" /></a>
2714 <img src="/static/hglogo.png" alt="mercurial" /></a>
2705 </div>
2715 </div>
2706 <ul>
2716 <ul>
2707 <li><a href="/shortlog">log</a></li>
2717 <li><a href="/shortlog">log</a></li>
2708 <li><a href="/graph">graph</a></li>
2718 <li><a href="/graph">graph</a></li>
2709 <li><a href="/tags">tags</a></li>
2719 <li><a href="/tags">tags</a></li>
2710 <li><a href="/bookmarks">bookmarks</a></li>
2720 <li><a href="/bookmarks">bookmarks</a></li>
2711 <li><a href="/branches">branches</a></li>
2721 <li><a href="/branches">branches</a></li>
2712 </ul>
2722 </ul>
2713 <ul>
2723 <ul>
2714 <li class="active"><a href="/help">help</a></li>
2724 <li class="active"><a href="/help">help</a></li>
2715 </ul>
2725 </ul>
2716 </div>
2726 </div>
2717
2727
2718 <div class="main">
2728 <div class="main">
2719 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2729 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2720 <h3>Help: remove</h3>
2730 <h3>Help: remove</h3>
2721
2731
2722 <form class="search" action="/log">
2732 <form class="search" action="/log">
2723
2733
2724 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2734 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2725 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2735 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2726 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2736 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2727 </form>
2737 </form>
2728 <div id="doc">
2738 <div id="doc">
2729 <p>
2739 <p>
2730 hg remove [OPTION]... FILE...
2740 hg remove [OPTION]... FILE...
2731 </p>
2741 </p>
2732 <p>
2742 <p>
2733 aliases: rm
2743 aliases: rm
2734 </p>
2744 </p>
2735 <p>
2745 <p>
2736 remove the specified files on the next commit
2746 remove the specified files on the next commit
2737 </p>
2747 </p>
2738 <p>
2748 <p>
2739 Schedule the indicated files for removal from the current branch.
2749 Schedule the indicated files for removal from the current branch.
2740 </p>
2750 </p>
2741 <p>
2751 <p>
2742 This command schedules the files to be removed at the next commit.
2752 This command schedules the files to be removed at the next commit.
2743 To undo a remove before that, see 'hg revert'. To undo added
2753 To undo a remove before that, see 'hg revert'. To undo added
2744 files, see 'hg forget'.
2754 files, see 'hg forget'.
2745 </p>
2755 </p>
2746 <p>
2756 <p>
2747 -A/--after can be used to remove only files that have already
2757 -A/--after can be used to remove only files that have already
2748 been deleted, -f/--force can be used to force deletion, and -Af
2758 been deleted, -f/--force can be used to force deletion, and -Af
2749 can be used to remove files from the next revision without
2759 can be used to remove files from the next revision without
2750 deleting them from the working directory.
2760 deleting them from the working directory.
2751 </p>
2761 </p>
2752 <p>
2762 <p>
2753 The following table details the behavior of remove for different
2763 The following table details the behavior of remove for different
2754 file states (columns) and option combinations (rows). The file
2764 file states (columns) and option combinations (rows). The file
2755 states are Added [A], Clean [C], Modified [M] and Missing [!]
2765 states are Added [A], Clean [C], Modified [M] and Missing [!]
2756 (as reported by 'hg status'). The actions are Warn, Remove
2766 (as reported by 'hg status'). The actions are Warn, Remove
2757 (from branch) and Delete (from disk):
2767 (from branch) and Delete (from disk):
2758 </p>
2768 </p>
2759 <table>
2769 <table>
2760 <tr><td>opt/state</td>
2770 <tr><td>opt/state</td>
2761 <td>A</td>
2771 <td>A</td>
2762 <td>C</td>
2772 <td>C</td>
2763 <td>M</td>
2773 <td>M</td>
2764 <td>!</td></tr>
2774 <td>!</td></tr>
2765 <tr><td>none</td>
2775 <tr><td>none</td>
2766 <td>W</td>
2776 <td>W</td>
2767 <td>RD</td>
2777 <td>RD</td>
2768 <td>W</td>
2778 <td>W</td>
2769 <td>R</td></tr>
2779 <td>R</td></tr>
2770 <tr><td>-f</td>
2780 <tr><td>-f</td>
2771 <td>R</td>
2781 <td>R</td>
2772 <td>RD</td>
2782 <td>RD</td>
2773 <td>RD</td>
2783 <td>RD</td>
2774 <td>R</td></tr>
2784 <td>R</td></tr>
2775 <tr><td>-A</td>
2785 <tr><td>-A</td>
2776 <td>W</td>
2786 <td>W</td>
2777 <td>W</td>
2787 <td>W</td>
2778 <td>W</td>
2788 <td>W</td>
2779 <td>R</td></tr>
2789 <td>R</td></tr>
2780 <tr><td>-Af</td>
2790 <tr><td>-Af</td>
2781 <td>R</td>
2791 <td>R</td>
2782 <td>R</td>
2792 <td>R</td>
2783 <td>R</td>
2793 <td>R</td>
2784 <td>R</td></tr>
2794 <td>R</td></tr>
2785 </table>
2795 </table>
2786 <p>
2796 <p>
2787 <b>Note:</b>
2797 <b>Note:</b>
2788 </p>
2798 </p>
2789 <p>
2799 <p>
2790 'hg remove' never deletes files in Added [A] state from the
2800 'hg remove' never deletes files in Added [A] state from the
2791 working directory, not even if &quot;--force&quot; is specified.
2801 working directory, not even if &quot;--force&quot; is specified.
2792 </p>
2802 </p>
2793 <p>
2803 <p>
2794 Returns 0 on success, 1 if any warnings encountered.
2804 Returns 0 on success, 1 if any warnings encountered.
2795 </p>
2805 </p>
2796 <p>
2806 <p>
2797 options ([+] can be repeated):
2807 options ([+] can be repeated):
2798 </p>
2808 </p>
2799 <table>
2809 <table>
2800 <tr><td>-A</td>
2810 <tr><td>-A</td>
2801 <td>--after</td>
2811 <td>--after</td>
2802 <td>record delete for missing files</td></tr>
2812 <td>record delete for missing files</td></tr>
2803 <tr><td>-f</td>
2813 <tr><td>-f</td>
2804 <td>--force</td>
2814 <td>--force</td>
2805 <td>forget added files, delete modified files</td></tr>
2815 <td>forget added files, delete modified files</td></tr>
2806 <tr><td>-S</td>
2816 <tr><td>-S</td>
2807 <td>--subrepos</td>
2817 <td>--subrepos</td>
2808 <td>recurse into subrepositories</td></tr>
2818 <td>recurse into subrepositories</td></tr>
2809 <tr><td>-I</td>
2819 <tr><td>-I</td>
2810 <td>--include PATTERN [+]</td>
2820 <td>--include PATTERN [+]</td>
2811 <td>include names matching the given patterns</td></tr>
2821 <td>include names matching the given patterns</td></tr>
2812 <tr><td>-X</td>
2822 <tr><td>-X</td>
2813 <td>--exclude PATTERN [+]</td>
2823 <td>--exclude PATTERN [+]</td>
2814 <td>exclude names matching the given patterns</td></tr>
2824 <td>exclude names matching the given patterns</td></tr>
2815 </table>
2825 </table>
2816 <p>
2826 <p>
2817 global options ([+] can be repeated):
2827 global options ([+] can be repeated):
2818 </p>
2828 </p>
2819 <table>
2829 <table>
2820 <tr><td>-R</td>
2830 <tr><td>-R</td>
2821 <td>--repository REPO</td>
2831 <td>--repository REPO</td>
2822 <td>repository root directory or name of overlay bundle file</td></tr>
2832 <td>repository root directory or name of overlay bundle file</td></tr>
2823 <tr><td></td>
2833 <tr><td></td>
2824 <td>--cwd DIR</td>
2834 <td>--cwd DIR</td>
2825 <td>change working directory</td></tr>
2835 <td>change working directory</td></tr>
2826 <tr><td>-y</td>
2836 <tr><td>-y</td>
2827 <td>--noninteractive</td>
2837 <td>--noninteractive</td>
2828 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2838 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2829 <tr><td>-q</td>
2839 <tr><td>-q</td>
2830 <td>--quiet</td>
2840 <td>--quiet</td>
2831 <td>suppress output</td></tr>
2841 <td>suppress output</td></tr>
2832 <tr><td>-v</td>
2842 <tr><td>-v</td>
2833 <td>--verbose</td>
2843 <td>--verbose</td>
2834 <td>enable additional output</td></tr>
2844 <td>enable additional output</td></tr>
2835 <tr><td></td>
2845 <tr><td></td>
2836 <td>--color TYPE</td>
2846 <td>--color TYPE</td>
2837 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2847 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2838 <tr><td></td>
2848 <tr><td></td>
2839 <td>--config CONFIG [+]</td>
2849 <td>--config CONFIG [+]</td>
2840 <td>set/override config option (use 'section.name=value')</td></tr>
2850 <td>set/override config option (use 'section.name=value')</td></tr>
2841 <tr><td></td>
2851 <tr><td></td>
2842 <td>--debug</td>
2852 <td>--debug</td>
2843 <td>enable debugging output</td></tr>
2853 <td>enable debugging output</td></tr>
2844 <tr><td></td>
2854 <tr><td></td>
2845 <td>--debugger</td>
2855 <td>--debugger</td>
2846 <td>start debugger</td></tr>
2856 <td>start debugger</td></tr>
2847 <tr><td></td>
2857 <tr><td></td>
2848 <td>--encoding ENCODE</td>
2858 <td>--encoding ENCODE</td>
2849 <td>set the charset encoding (default: ascii)</td></tr>
2859 <td>set the charset encoding (default: ascii)</td></tr>
2850 <tr><td></td>
2860 <tr><td></td>
2851 <td>--encodingmode MODE</td>
2861 <td>--encodingmode MODE</td>
2852 <td>set the charset encoding mode (default: strict)</td></tr>
2862 <td>set the charset encoding mode (default: strict)</td></tr>
2853 <tr><td></td>
2863 <tr><td></td>
2854 <td>--traceback</td>
2864 <td>--traceback</td>
2855 <td>always print a traceback on exception</td></tr>
2865 <td>always print a traceback on exception</td></tr>
2856 <tr><td></td>
2866 <tr><td></td>
2857 <td>--time</td>
2867 <td>--time</td>
2858 <td>time how long the command takes</td></tr>
2868 <td>time how long the command takes</td></tr>
2859 <tr><td></td>
2869 <tr><td></td>
2860 <td>--profile</td>
2870 <td>--profile</td>
2861 <td>print command execution profile</td></tr>
2871 <td>print command execution profile</td></tr>
2862 <tr><td></td>
2872 <tr><td></td>
2863 <td>--version</td>
2873 <td>--version</td>
2864 <td>output version information and exit</td></tr>
2874 <td>output version information and exit</td></tr>
2865 <tr><td>-h</td>
2875 <tr><td>-h</td>
2866 <td>--help</td>
2876 <td>--help</td>
2867 <td>display help and exit</td></tr>
2877 <td>display help and exit</td></tr>
2868 <tr><td></td>
2878 <tr><td></td>
2869 <td>--hidden</td>
2879 <td>--hidden</td>
2870 <td>consider hidden changesets</td></tr>
2880 <td>consider hidden changesets</td></tr>
2871 <tr><td></td>
2881 <tr><td></td>
2872 <td>--pager TYPE</td>
2882 <td>--pager TYPE</td>
2873 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2883 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2874 </table>
2884 </table>
2875
2885
2876 </div>
2886 </div>
2877 </div>
2887 </div>
2878 </div>
2888 </div>
2879
2889
2880
2890
2881
2891
2882 </body>
2892 </body>
2883 </html>
2893 </html>
2884
2894
2885
2895
2886 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2896 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2887 200 Script output follows
2897 200 Script output follows
2888
2898
2889 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2899 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2890 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2900 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2891 <head>
2901 <head>
2892 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2902 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2893 <meta name="robots" content="index, nofollow" />
2903 <meta name="robots" content="index, nofollow" />
2894 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2904 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2895 <script type="text/javascript" src="/static/mercurial.js"></script>
2905 <script type="text/javascript" src="/static/mercurial.js"></script>
2896
2906
2897 <title>Help: dates</title>
2907 <title>Help: dates</title>
2898 </head>
2908 </head>
2899 <body>
2909 <body>
2900
2910
2901 <div class="container">
2911 <div class="container">
2902 <div class="menu">
2912 <div class="menu">
2903 <div class="logo">
2913 <div class="logo">
2904 <a href="https://mercurial-scm.org/">
2914 <a href="https://mercurial-scm.org/">
2905 <img src="/static/hglogo.png" alt="mercurial" /></a>
2915 <img src="/static/hglogo.png" alt="mercurial" /></a>
2906 </div>
2916 </div>
2907 <ul>
2917 <ul>
2908 <li><a href="/shortlog">log</a></li>
2918 <li><a href="/shortlog">log</a></li>
2909 <li><a href="/graph">graph</a></li>
2919 <li><a href="/graph">graph</a></li>
2910 <li><a href="/tags">tags</a></li>
2920 <li><a href="/tags">tags</a></li>
2911 <li><a href="/bookmarks">bookmarks</a></li>
2921 <li><a href="/bookmarks">bookmarks</a></li>
2912 <li><a href="/branches">branches</a></li>
2922 <li><a href="/branches">branches</a></li>
2913 </ul>
2923 </ul>
2914 <ul>
2924 <ul>
2915 <li class="active"><a href="/help">help</a></li>
2925 <li class="active"><a href="/help">help</a></li>
2916 </ul>
2926 </ul>
2917 </div>
2927 </div>
2918
2928
2919 <div class="main">
2929 <div class="main">
2920 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2930 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2921 <h3>Help: dates</h3>
2931 <h3>Help: dates</h3>
2922
2932
2923 <form class="search" action="/log">
2933 <form class="search" action="/log">
2924
2934
2925 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2935 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2926 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2936 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2927 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2937 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2928 </form>
2938 </form>
2929 <div id="doc">
2939 <div id="doc">
2930 <h1>Date Formats</h1>
2940 <h1>Date Formats</h1>
2931 <p>
2941 <p>
2932 Some commands allow the user to specify a date, e.g.:
2942 Some commands allow the user to specify a date, e.g.:
2933 </p>
2943 </p>
2934 <ul>
2944 <ul>
2935 <li> backout, commit, import, tag: Specify the commit date.
2945 <li> backout, commit, import, tag: Specify the commit date.
2936 <li> log, revert, update: Select revision(s) by date.
2946 <li> log, revert, update: Select revision(s) by date.
2937 </ul>
2947 </ul>
2938 <p>
2948 <p>
2939 Many date formats are valid. Here are some examples:
2949 Many date formats are valid. Here are some examples:
2940 </p>
2950 </p>
2941 <ul>
2951 <ul>
2942 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2952 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2943 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2953 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2944 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2954 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2945 <li> &quot;Dec 6&quot; (midnight)
2955 <li> &quot;Dec 6&quot; (midnight)
2946 <li> &quot;13:18&quot; (today assumed)
2956 <li> &quot;13:18&quot; (today assumed)
2947 <li> &quot;3:39&quot; (3:39AM assumed)
2957 <li> &quot;3:39&quot; (3:39AM assumed)
2948 <li> &quot;3:39pm&quot; (15:39)
2958 <li> &quot;3:39pm&quot; (15:39)
2949 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2959 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2950 <li> &quot;2006-12-6 13:18&quot;
2960 <li> &quot;2006-12-6 13:18&quot;
2951 <li> &quot;2006-12-6&quot;
2961 <li> &quot;2006-12-6&quot;
2952 <li> &quot;12-6&quot;
2962 <li> &quot;12-6&quot;
2953 <li> &quot;12/6&quot;
2963 <li> &quot;12/6&quot;
2954 <li> &quot;12/6/6&quot; (Dec 6 2006)
2964 <li> &quot;12/6/6&quot; (Dec 6 2006)
2955 <li> &quot;today&quot; (midnight)
2965 <li> &quot;today&quot; (midnight)
2956 <li> &quot;yesterday&quot; (midnight)
2966 <li> &quot;yesterday&quot; (midnight)
2957 <li> &quot;now&quot; - right now
2967 <li> &quot;now&quot; - right now
2958 </ul>
2968 </ul>
2959 <p>
2969 <p>
2960 Lastly, there is Mercurial's internal format:
2970 Lastly, there is Mercurial's internal format:
2961 </p>
2971 </p>
2962 <ul>
2972 <ul>
2963 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
2973 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
2964 </ul>
2974 </ul>
2965 <p>
2975 <p>
2966 This is the internal representation format for dates. The first number
2976 This is the internal representation format for dates. The first number
2967 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2977 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2968 second is the offset of the local timezone, in seconds west of UTC
2978 second is the offset of the local timezone, in seconds west of UTC
2969 (negative if the timezone is east of UTC).
2979 (negative if the timezone is east of UTC).
2970 </p>
2980 </p>
2971 <p>
2981 <p>
2972 The log command also accepts date ranges:
2982 The log command also accepts date ranges:
2973 </p>
2983 </p>
2974 <ul>
2984 <ul>
2975 <li> &quot;&lt;DATE&quot; - at or before a given date/time
2985 <li> &quot;&lt;DATE&quot; - at or before a given date/time
2976 <li> &quot;&gt;DATE&quot; - on or after a given date/time
2986 <li> &quot;&gt;DATE&quot; - on or after a given date/time
2977 <li> &quot;DATE to DATE&quot; - a date range, inclusive
2987 <li> &quot;DATE to DATE&quot; - a date range, inclusive
2978 <li> &quot;-DAYS&quot; - within a given number of days of today
2988 <li> &quot;-DAYS&quot; - within a given number of days of today
2979 </ul>
2989 </ul>
2980
2990
2981 </div>
2991 </div>
2982 </div>
2992 </div>
2983 </div>
2993 </div>
2984
2994
2985
2995
2986
2996
2987 </body>
2997 </body>
2988 </html>
2998 </html>
2989
2999
2990
3000
2991 Sub-topic indexes rendered properly
3001 Sub-topic indexes rendered properly
2992
3002
2993 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3003 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
2994 200 Script output follows
3004 200 Script output follows
2995
3005
2996 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3006 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2997 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3007 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2998 <head>
3008 <head>
2999 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3009 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3000 <meta name="robots" content="index, nofollow" />
3010 <meta name="robots" content="index, nofollow" />
3001 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3011 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3002 <script type="text/javascript" src="/static/mercurial.js"></script>
3012 <script type="text/javascript" src="/static/mercurial.js"></script>
3003
3013
3004 <title>Help: internals</title>
3014 <title>Help: internals</title>
3005 </head>
3015 </head>
3006 <body>
3016 <body>
3007
3017
3008 <div class="container">
3018 <div class="container">
3009 <div class="menu">
3019 <div class="menu">
3010 <div class="logo">
3020 <div class="logo">
3011 <a href="https://mercurial-scm.org/">
3021 <a href="https://mercurial-scm.org/">
3012 <img src="/static/hglogo.png" alt="mercurial" /></a>
3022 <img src="/static/hglogo.png" alt="mercurial" /></a>
3013 </div>
3023 </div>
3014 <ul>
3024 <ul>
3015 <li><a href="/shortlog">log</a></li>
3025 <li><a href="/shortlog">log</a></li>
3016 <li><a href="/graph">graph</a></li>
3026 <li><a href="/graph">graph</a></li>
3017 <li><a href="/tags">tags</a></li>
3027 <li><a href="/tags">tags</a></li>
3018 <li><a href="/bookmarks">bookmarks</a></li>
3028 <li><a href="/bookmarks">bookmarks</a></li>
3019 <li><a href="/branches">branches</a></li>
3029 <li><a href="/branches">branches</a></li>
3020 </ul>
3030 </ul>
3021 <ul>
3031 <ul>
3022 <li><a href="/help">help</a></li>
3032 <li><a href="/help">help</a></li>
3023 </ul>
3033 </ul>
3024 </div>
3034 </div>
3025
3035
3026 <div class="main">
3036 <div class="main">
3027 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3037 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3028
3038
3029 <form class="search" action="/log">
3039 <form class="search" action="/log">
3030
3040
3031 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3041 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3032 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3042 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3033 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3043 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3034 </form>
3044 </form>
3035 <table class="bigtable">
3045 <table class="bigtable">
3036 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3046 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3037
3047
3038 <tr><td>
3048 <tr><td>
3039 <a href="/help/internals.bundles">
3049 <a href="/help/internals.bundles">
3040 bundles
3050 bundles
3041 </a>
3051 </a>
3042 </td><td>
3052 </td><td>
3043 Bundles
3053 Bundles
3044 </td></tr>
3054 </td></tr>
3045 <tr><td>
3055 <tr><td>
3046 <a href="/help/internals.censor">
3056 <a href="/help/internals.censor">
3047 censor
3057 censor
3048 </a>
3058 </a>
3049 </td><td>
3059 </td><td>
3050 Censor
3060 Censor
3051 </td></tr>
3061 </td></tr>
3052 <tr><td>
3062 <tr><td>
3053 <a href="/help/internals.changegroups">
3063 <a href="/help/internals.changegroups">
3054 changegroups
3064 changegroups
3055 </a>
3065 </a>
3056 </td><td>
3066 </td><td>
3057 Changegroups
3067 Changegroups
3058 </td></tr>
3068 </td></tr>
3059 <tr><td>
3069 <tr><td>
3060 <a href="/help/internals.config">
3070 <a href="/help/internals.config">
3061 config
3071 config
3062 </a>
3072 </a>
3063 </td><td>
3073 </td><td>
3064 Config Registrar
3074 Config Registrar
3065 </td></tr>
3075 </td></tr>
3066 <tr><td>
3076 <tr><td>
3067 <a href="/help/internals.requirements">
3077 <a href="/help/internals.requirements">
3068 requirements
3078 requirements
3069 </a>
3079 </a>
3070 </td><td>
3080 </td><td>
3071 Repository Requirements
3081 Repository Requirements
3072 </td></tr>
3082 </td></tr>
3073 <tr><td>
3083 <tr><td>
3074 <a href="/help/internals.revlogs">
3084 <a href="/help/internals.revlogs">
3075 revlogs
3085 revlogs
3076 </a>
3086 </a>
3077 </td><td>
3087 </td><td>
3078 Revision Logs
3088 Revision Logs
3079 </td></tr>
3089 </td></tr>
3080 <tr><td>
3090 <tr><td>
3081 <a href="/help/internals.wireprotocol">
3091 <a href="/help/internals.wireprotocol">
3082 wireprotocol
3092 wireprotocol
3083 </a>
3093 </a>
3084 </td><td>
3094 </td><td>
3085 Wire Protocol
3095 Wire Protocol
3086 </td></tr>
3096 </td></tr>
3087
3097
3088
3098
3089
3099
3090
3100
3091
3101
3092 </table>
3102 </table>
3093 </div>
3103 </div>
3094 </div>
3104 </div>
3095
3105
3096
3106
3097
3107
3098 </body>
3108 </body>
3099 </html>
3109 </html>
3100
3110
3101
3111
3102 Sub-topic topics rendered properly
3112 Sub-topic topics rendered properly
3103
3113
3104 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3114 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3105 200 Script output follows
3115 200 Script output follows
3106
3116
3107 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3117 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3108 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3118 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3109 <head>
3119 <head>
3110 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3120 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3111 <meta name="robots" content="index, nofollow" />
3121 <meta name="robots" content="index, nofollow" />
3112 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3122 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3113 <script type="text/javascript" src="/static/mercurial.js"></script>
3123 <script type="text/javascript" src="/static/mercurial.js"></script>
3114
3124
3115 <title>Help: internals.changegroups</title>
3125 <title>Help: internals.changegroups</title>
3116 </head>
3126 </head>
3117 <body>
3127 <body>
3118
3128
3119 <div class="container">
3129 <div class="container">
3120 <div class="menu">
3130 <div class="menu">
3121 <div class="logo">
3131 <div class="logo">
3122 <a href="https://mercurial-scm.org/">
3132 <a href="https://mercurial-scm.org/">
3123 <img src="/static/hglogo.png" alt="mercurial" /></a>
3133 <img src="/static/hglogo.png" alt="mercurial" /></a>
3124 </div>
3134 </div>
3125 <ul>
3135 <ul>
3126 <li><a href="/shortlog">log</a></li>
3136 <li><a href="/shortlog">log</a></li>
3127 <li><a href="/graph">graph</a></li>
3137 <li><a href="/graph">graph</a></li>
3128 <li><a href="/tags">tags</a></li>
3138 <li><a href="/tags">tags</a></li>
3129 <li><a href="/bookmarks">bookmarks</a></li>
3139 <li><a href="/bookmarks">bookmarks</a></li>
3130 <li><a href="/branches">branches</a></li>
3140 <li><a href="/branches">branches</a></li>
3131 </ul>
3141 </ul>
3132 <ul>
3142 <ul>
3133 <li class="active"><a href="/help">help</a></li>
3143 <li class="active"><a href="/help">help</a></li>
3134 </ul>
3144 </ul>
3135 </div>
3145 </div>
3136
3146
3137 <div class="main">
3147 <div class="main">
3138 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3148 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3139 <h3>Help: internals.changegroups</h3>
3149 <h3>Help: internals.changegroups</h3>
3140
3150
3141 <form class="search" action="/log">
3151 <form class="search" action="/log">
3142
3152
3143 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3153 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3144 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3154 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3145 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3155 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3146 </form>
3156 </form>
3147 <div id="doc">
3157 <div id="doc">
3148 <h1>Changegroups</h1>
3158 <h1>Changegroups</h1>
3149 <p>
3159 <p>
3150 Changegroups are representations of repository revlog data, specifically
3160 Changegroups are representations of repository revlog data, specifically
3151 the changelog data, root/flat manifest data, treemanifest data, and
3161 the changelog data, root/flat manifest data, treemanifest data, and
3152 filelogs.
3162 filelogs.
3153 </p>
3163 </p>
3154 <p>
3164 <p>
3155 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3165 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3156 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3166 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3157 only difference being an additional item in the *delta header*. Version
3167 only difference being an additional item in the *delta header*. Version
3158 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3168 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3159 exchanging treemanifests (enabled by setting an option on the
3169 exchanging treemanifests (enabled by setting an option on the
3160 &quot;changegroup&quot; part in the bundle2).
3170 &quot;changegroup&quot; part in the bundle2).
3161 </p>
3171 </p>
3162 <p>
3172 <p>
3163 Changegroups when not exchanging treemanifests consist of 3 logical
3173 Changegroups when not exchanging treemanifests consist of 3 logical
3164 segments:
3174 segments:
3165 </p>
3175 </p>
3166 <pre>
3176 <pre>
3167 +---------------------------------+
3177 +---------------------------------+
3168 | | | |
3178 | | | |
3169 | changeset | manifest | filelogs |
3179 | changeset | manifest | filelogs |
3170 | | | |
3180 | | | |
3171 | | | |
3181 | | | |
3172 +---------------------------------+
3182 +---------------------------------+
3173 </pre>
3183 </pre>
3174 <p>
3184 <p>
3175 When exchanging treemanifests, there are 4 logical segments:
3185 When exchanging treemanifests, there are 4 logical segments:
3176 </p>
3186 </p>
3177 <pre>
3187 <pre>
3178 +-------------------------------------------------+
3188 +-------------------------------------------------+
3179 | | | | |
3189 | | | | |
3180 | changeset | root | treemanifests | filelogs |
3190 | changeset | root | treemanifests | filelogs |
3181 | | manifest | | |
3191 | | manifest | | |
3182 | | | | |
3192 | | | | |
3183 +-------------------------------------------------+
3193 +-------------------------------------------------+
3184 </pre>
3194 </pre>
3185 <p>
3195 <p>
3186 The principle building block of each segment is a *chunk*. A *chunk*
3196 The principle building block of each segment is a *chunk*. A *chunk*
3187 is a framed piece of data:
3197 is a framed piece of data:
3188 </p>
3198 </p>
3189 <pre>
3199 <pre>
3190 +---------------------------------------+
3200 +---------------------------------------+
3191 | | |
3201 | | |
3192 | length | data |
3202 | length | data |
3193 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3203 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3194 | | |
3204 | | |
3195 +---------------------------------------+
3205 +---------------------------------------+
3196 </pre>
3206 </pre>
3197 <p>
3207 <p>
3198 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3208 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3199 integer indicating the length of the entire chunk (including the length field
3209 integer indicating the length of the entire chunk (including the length field
3200 itself).
3210 itself).
3201 </p>
3211 </p>
3202 <p>
3212 <p>
3203 There is a special case chunk that has a value of 0 for the length
3213 There is a special case chunk that has a value of 0 for the length
3204 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3214 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3205 </p>
3215 </p>
3206 <h2>Delta Groups</h2>
3216 <h2>Delta Groups</h2>
3207 <p>
3217 <p>
3208 A *delta group* expresses the content of a revlog as a series of deltas,
3218 A *delta group* expresses the content of a revlog as a series of deltas,
3209 or patches against previous revisions.
3219 or patches against previous revisions.
3210 </p>
3220 </p>
3211 <p>
3221 <p>
3212 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3222 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3213 to signal the end of the delta group:
3223 to signal the end of the delta group:
3214 </p>
3224 </p>
3215 <pre>
3225 <pre>
3216 +------------------------------------------------------------------------+
3226 +------------------------------------------------------------------------+
3217 | | | | | |
3227 | | | | | |
3218 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3228 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3219 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3229 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3220 | | | | | |
3230 | | | | | |
3221 +------------------------------------------------------------------------+
3231 +------------------------------------------------------------------------+
3222 </pre>
3232 </pre>
3223 <p>
3233 <p>
3224 Each *chunk*'s data consists of the following:
3234 Each *chunk*'s data consists of the following:
3225 </p>
3235 </p>
3226 <pre>
3236 <pre>
3227 +---------------------------------------+
3237 +---------------------------------------+
3228 | | |
3238 | | |
3229 | delta header | delta data |
3239 | delta header | delta data |
3230 | (various by version) | (various) |
3240 | (various by version) | (various) |
3231 | | |
3241 | | |
3232 +---------------------------------------+
3242 +---------------------------------------+
3233 </pre>
3243 </pre>
3234 <p>
3244 <p>
3235 The *delta data* is a series of *delta*s that describe a diff from an existing
3245 The *delta data* is a series of *delta*s that describe a diff from an existing
3236 entry (either that the recipient already has, or previously specified in the
3246 entry (either that the recipient already has, or previously specified in the
3237 bundle/changegroup).
3247 bundle/changegroup).
3238 </p>
3248 </p>
3239 <p>
3249 <p>
3240 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3250 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3241 &quot;3&quot; of the changegroup format.
3251 &quot;3&quot; of the changegroup format.
3242 </p>
3252 </p>
3243 <p>
3253 <p>
3244 Version 1 (headerlen=80):
3254 Version 1 (headerlen=80):
3245 </p>
3255 </p>
3246 <pre>
3256 <pre>
3247 +------------------------------------------------------+
3257 +------------------------------------------------------+
3248 | | | | |
3258 | | | | |
3249 | node | p1 node | p2 node | link node |
3259 | node | p1 node | p2 node | link node |
3250 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3260 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3251 | | | | |
3261 | | | | |
3252 +------------------------------------------------------+
3262 +------------------------------------------------------+
3253 </pre>
3263 </pre>
3254 <p>
3264 <p>
3255 Version 2 (headerlen=100):
3265 Version 2 (headerlen=100):
3256 </p>
3266 </p>
3257 <pre>
3267 <pre>
3258 +------------------------------------------------------------------+
3268 +------------------------------------------------------------------+
3259 | | | | | |
3269 | | | | | |
3260 | node | p1 node | p2 node | base node | link node |
3270 | node | p1 node | p2 node | base node | link node |
3261 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3271 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3262 | | | | | |
3272 | | | | | |
3263 +------------------------------------------------------------------+
3273 +------------------------------------------------------------------+
3264 </pre>
3274 </pre>
3265 <p>
3275 <p>
3266 Version 3 (headerlen=102):
3276 Version 3 (headerlen=102):
3267 </p>
3277 </p>
3268 <pre>
3278 <pre>
3269 +------------------------------------------------------------------------------+
3279 +------------------------------------------------------------------------------+
3270 | | | | | | |
3280 | | | | | | |
3271 | node | p1 node | p2 node | base node | link node | flags |
3281 | node | p1 node | p2 node | base node | link node | flags |
3272 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3282 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3273 | | | | | | |
3283 | | | | | | |
3274 +------------------------------------------------------------------------------+
3284 +------------------------------------------------------------------------------+
3275 </pre>
3285 </pre>
3276 <p>
3286 <p>
3277 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3287 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3278 series of *delta*s, densely packed (no separators). These deltas describe a diff
3288 series of *delta*s, densely packed (no separators). These deltas describe a diff
3279 from an existing entry (either that the recipient already has, or previously
3289 from an existing entry (either that the recipient already has, or previously
3280 specified in the bundle/changegroup). The format is described more fully in
3290 specified in the bundle/changegroup). The format is described more fully in
3281 &quot;hg help internals.bdiff&quot;, but briefly:
3291 &quot;hg help internals.bdiff&quot;, but briefly:
3282 </p>
3292 </p>
3283 <pre>
3293 <pre>
3284 +---------------------------------------------------------------+
3294 +---------------------------------------------------------------+
3285 | | | | |
3295 | | | | |
3286 | start offset | end offset | new length | content |
3296 | start offset | end offset | new length | content |
3287 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3297 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3288 | | | | |
3298 | | | | |
3289 +---------------------------------------------------------------+
3299 +---------------------------------------------------------------+
3290 </pre>
3300 </pre>
3291 <p>
3301 <p>
3292 Please note that the length field in the delta data does *not* include itself.
3302 Please note that the length field in the delta data does *not* include itself.
3293 </p>
3303 </p>
3294 <p>
3304 <p>
3295 In version 1, the delta is always applied against the previous node from
3305 In version 1, the delta is always applied against the previous node from
3296 the changegroup or the first parent if this is the first entry in the
3306 the changegroup or the first parent if this is the first entry in the
3297 changegroup.
3307 changegroup.
3298 </p>
3308 </p>
3299 <p>
3309 <p>
3300 In version 2 and up, the delta base node is encoded in the entry in the
3310 In version 2 and up, the delta base node is encoded in the entry in the
3301 changegroup. This allows the delta to be expressed against any parent,
3311 changegroup. This allows the delta to be expressed against any parent,
3302 which can result in smaller deltas and more efficient encoding of data.
3312 which can result in smaller deltas and more efficient encoding of data.
3303 </p>
3313 </p>
3304 <h2>Changeset Segment</h2>
3314 <h2>Changeset Segment</h2>
3305 <p>
3315 <p>
3306 The *changeset segment* consists of a single *delta group* holding
3316 The *changeset segment* consists of a single *delta group* holding
3307 changelog data. The *empty chunk* at the end of the *delta group* denotes
3317 changelog data. The *empty chunk* at the end of the *delta group* denotes
3308 the boundary to the *manifest segment*.
3318 the boundary to the *manifest segment*.
3309 </p>
3319 </p>
3310 <h2>Manifest Segment</h2>
3320 <h2>Manifest Segment</h2>
3311 <p>
3321 <p>
3312 The *manifest segment* consists of a single *delta group* holding manifest
3322 The *manifest segment* consists of a single *delta group* holding manifest
3313 data. If treemanifests are in use, it contains only the manifest for the
3323 data. If treemanifests are in use, it contains only the manifest for the
3314 root directory of the repository. Otherwise, it contains the entire
3324 root directory of the repository. Otherwise, it contains the entire
3315 manifest data. The *empty chunk* at the end of the *delta group* denotes
3325 manifest data. The *empty chunk* at the end of the *delta group* denotes
3316 the boundary to the next segment (either the *treemanifests segment* or the
3326 the boundary to the next segment (either the *treemanifests segment* or the
3317 *filelogs segment*, depending on version and the request options).
3327 *filelogs segment*, depending on version and the request options).
3318 </p>
3328 </p>
3319 <h3>Treemanifests Segment</h3>
3329 <h3>Treemanifests Segment</h3>
3320 <p>
3330 <p>
3321 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3331 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3322 only if the 'treemanifest' param is part of the bundle2 changegroup part
3332 only if the 'treemanifest' param is part of the bundle2 changegroup part
3323 (it is not possible to use changegroup version 3 outside of bundle2).
3333 (it is not possible to use changegroup version 3 outside of bundle2).
3324 Aside from the filenames in the *treemanifests segment* containing a
3334 Aside from the filenames in the *treemanifests segment* containing a
3325 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3335 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3326 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3336 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3327 a sub-segment with filename size 0). This denotes the boundary to the
3337 a sub-segment with filename size 0). This denotes the boundary to the
3328 *filelogs segment*.
3338 *filelogs segment*.
3329 </p>
3339 </p>
3330 <h2>Filelogs Segment</h2>
3340 <h2>Filelogs Segment</h2>
3331 <p>
3341 <p>
3332 The *filelogs segment* consists of multiple sub-segments, each
3342 The *filelogs segment* consists of multiple sub-segments, each
3333 corresponding to an individual file whose data is being described:
3343 corresponding to an individual file whose data is being described:
3334 </p>
3344 </p>
3335 <pre>
3345 <pre>
3336 +--------------------------------------------------+
3346 +--------------------------------------------------+
3337 | | | | | |
3347 | | | | | |
3338 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3348 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3339 | | | | | (4 bytes) |
3349 | | | | | (4 bytes) |
3340 | | | | | |
3350 | | | | | |
3341 +--------------------------------------------------+
3351 +--------------------------------------------------+
3342 </pre>
3352 </pre>
3343 <p>
3353 <p>
3344 The final filelog sub-segment is followed by an *empty chunk* (logically,
3354 The final filelog sub-segment is followed by an *empty chunk* (logically,
3345 a sub-segment with filename size 0). This denotes the end of the segment
3355 a sub-segment with filename size 0). This denotes the end of the segment
3346 and of the overall changegroup.
3356 and of the overall changegroup.
3347 </p>
3357 </p>
3348 <p>
3358 <p>
3349 Each filelog sub-segment consists of the following:
3359 Each filelog sub-segment consists of the following:
3350 </p>
3360 </p>
3351 <pre>
3361 <pre>
3352 +------------------------------------------------------+
3362 +------------------------------------------------------+
3353 | | | |
3363 | | | |
3354 | filename length | filename | delta group |
3364 | filename length | filename | delta group |
3355 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3365 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3356 | | | |
3366 | | | |
3357 +------------------------------------------------------+
3367 +------------------------------------------------------+
3358 </pre>
3368 </pre>
3359 <p>
3369 <p>
3360 That is, a *chunk* consisting of the filename (not terminated or padded)
3370 That is, a *chunk* consisting of the filename (not terminated or padded)
3361 followed by N chunks constituting the *delta group* for this file. The
3371 followed by N chunks constituting the *delta group* for this file. The
3362 *empty chunk* at the end of each *delta group* denotes the boundary to the
3372 *empty chunk* at the end of each *delta group* denotes the boundary to the
3363 next filelog sub-segment.
3373 next filelog sub-segment.
3364 </p>
3374 </p>
3365
3375
3366 </div>
3376 </div>
3367 </div>
3377 </div>
3368 </div>
3378 </div>
3369
3379
3370
3380
3371
3381
3372 </body>
3382 </body>
3373 </html>
3383 </html>
3374
3384
3375
3385
3376 $ killdaemons.py
3386 $ killdaemons.py
3377
3387
3378 #endif
3388 #endif
@@ -1,1646 +1,1650 b''
1 #require serve
1 #require serve
2
2
3 $ request() {
3 $ request() {
4 > get-with-headers.py --json localhost:$HGPORT "$1"
4 > get-with-headers.py --json localhost:$HGPORT "$1"
5 > }
5 > }
6
6
7 $ hg init test
7 $ hg init test
8 $ cd test
8 $ cd test
9 $ mkdir da
9 $ mkdir da
10 $ echo foo > da/foo
10 $ echo foo > da/foo
11 $ echo foo > foo
11 $ echo foo > foo
12 $ hg -q ci -A -m initial
12 $ hg -q ci -A -m initial
13 $ echo bar > foo
13 $ echo bar > foo
14 $ hg ci -m 'modify foo'
14 $ hg ci -m 'modify foo'
15 $ echo bar > da/foo
15 $ echo bar > da/foo
16 $ hg ci -m 'modify da/foo'
16 $ hg ci -m 'modify da/foo'
17 $ hg bookmark bookmark1
17 $ hg bookmark bookmark1
18 $ hg up default
18 $ hg up default
19 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 (leaving bookmark bookmark1)
20 (leaving bookmark bookmark1)
21 $ hg mv foo foo-new
21 $ hg mv foo foo-new
22 $ hg commit -m 'move foo'
22 $ hg commit -m 'move foo'
23 $ hg tag -m 'create tag' tag1
23 $ hg tag -m 'create tag' tag1
24 $ hg phase --public -r .
24 $ hg phase --public -r .
25 $ echo baz > da/foo
25 $ echo baz > da/foo
26 $ hg commit -m 'another commit to da/foo'
26 $ hg commit -m 'another commit to da/foo'
27 $ hg tag -m 'create tag2' tag2
27 $ hg tag -m 'create tag2' tag2
28 $ hg bookmark bookmark2
28 $ hg bookmark bookmark2
29 $ hg -q up -r 0
29 $ hg -q up -r 0
30 $ hg -q branch test-branch
30 $ hg -q branch test-branch
31 $ echo branch > foo
31 $ echo branch > foo
32 $ hg commit -m 'create test branch'
32 $ hg commit -m 'create test branch'
33 $ echo branch_commit_2 > foo
33 $ echo branch_commit_2 > foo
34 $ hg commit -m 'another commit in test-branch'
34 $ hg commit -m 'another commit in test-branch'
35 $ hg -q up default
35 $ hg -q up default
36 $ hg merge --tool :local test-branch
36 $ hg merge --tool :local test-branch
37 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
37 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
38 (branch merge, don't forget to commit)
38 (branch merge, don't forget to commit)
39 $ hg commit -m 'merge test-branch into default'
39 $ hg commit -m 'merge test-branch into default'
40
40
41 $ hg log -G
41 $ hg log -G
42 @ changeset: 9:cc725e08502a
42 @ changeset: 9:cc725e08502a
43 |\ tag: tip
43 |\ tag: tip
44 | | parent: 6:ceed296fe500
44 | | parent: 6:ceed296fe500
45 | | parent: 8:ed66c30e87eb
45 | | parent: 8:ed66c30e87eb
46 | | user: test
46 | | user: test
47 | | date: Thu Jan 01 00:00:00 1970 +0000
47 | | date: Thu Jan 01 00:00:00 1970 +0000
48 | | summary: merge test-branch into default
48 | | summary: merge test-branch into default
49 | |
49 | |
50 | o changeset: 8:ed66c30e87eb
50 | o changeset: 8:ed66c30e87eb
51 | | branch: test-branch
51 | | branch: test-branch
52 | | user: test
52 | | user: test
53 | | date: Thu Jan 01 00:00:00 1970 +0000
53 | | date: Thu Jan 01 00:00:00 1970 +0000
54 | | summary: another commit in test-branch
54 | | summary: another commit in test-branch
55 | |
55 | |
56 | o changeset: 7:6ab967a8ab34
56 | o changeset: 7:6ab967a8ab34
57 | | branch: test-branch
57 | | branch: test-branch
58 | | parent: 0:06e557f3edf6
58 | | parent: 0:06e557f3edf6
59 | | user: test
59 | | user: test
60 | | date: Thu Jan 01 00:00:00 1970 +0000
60 | | date: Thu Jan 01 00:00:00 1970 +0000
61 | | summary: create test branch
61 | | summary: create test branch
62 | |
62 | |
63 o | changeset: 6:ceed296fe500
63 o | changeset: 6:ceed296fe500
64 | | bookmark: bookmark2
64 | | bookmark: bookmark2
65 | | user: test
65 | | user: test
66 | | date: Thu Jan 01 00:00:00 1970 +0000
66 | | date: Thu Jan 01 00:00:00 1970 +0000
67 | | summary: create tag2
67 | | summary: create tag2
68 | |
68 | |
69 o | changeset: 5:f2890a05fea4
69 o | changeset: 5:f2890a05fea4
70 | | tag: tag2
70 | | tag: tag2
71 | | user: test
71 | | user: test
72 | | date: Thu Jan 01 00:00:00 1970 +0000
72 | | date: Thu Jan 01 00:00:00 1970 +0000
73 | | summary: another commit to da/foo
73 | | summary: another commit to da/foo
74 | |
74 | |
75 o | changeset: 4:93a8ce14f891
75 o | changeset: 4:93a8ce14f891
76 | | user: test
76 | | user: test
77 | | date: Thu Jan 01 00:00:00 1970 +0000
77 | | date: Thu Jan 01 00:00:00 1970 +0000
78 | | summary: create tag
78 | | summary: create tag
79 | |
79 | |
80 o | changeset: 3:78896eb0e102
80 o | changeset: 3:78896eb0e102
81 | | tag: tag1
81 | | tag: tag1
82 | | user: test
82 | | user: test
83 | | date: Thu Jan 01 00:00:00 1970 +0000
83 | | date: Thu Jan 01 00:00:00 1970 +0000
84 | | summary: move foo
84 | | summary: move foo
85 | |
85 | |
86 o | changeset: 2:8d7c456572ac
86 o | changeset: 2:8d7c456572ac
87 | | bookmark: bookmark1
87 | | bookmark: bookmark1
88 | | user: test
88 | | user: test
89 | | date: Thu Jan 01 00:00:00 1970 +0000
89 | | date: Thu Jan 01 00:00:00 1970 +0000
90 | | summary: modify da/foo
90 | | summary: modify da/foo
91 | |
91 | |
92 o | changeset: 1:f8bbb9024b10
92 o | changeset: 1:f8bbb9024b10
93 |/ user: test
93 |/ user: test
94 | date: Thu Jan 01 00:00:00 1970 +0000
94 | date: Thu Jan 01 00:00:00 1970 +0000
95 | summary: modify foo
95 | summary: modify foo
96 |
96 |
97 o changeset: 0:06e557f3edf6
97 o changeset: 0:06e557f3edf6
98 user: test
98 user: test
99 date: Thu Jan 01 00:00:00 1970 +0000
99 date: Thu Jan 01 00:00:00 1970 +0000
100 summary: initial
100 summary: initial
101
101
102
102
103 $ echo '[web]' >> .hg/hgrc
103 $ echo '[web]' >> .hg/hgrc
104 $ echo 'allow_archive = bz2' >> .hg/hgrc
104 $ echo 'allow_archive = bz2' >> .hg/hgrc
105 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log
105 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log
106 $ cat hg.pid >> $DAEMON_PIDS
106 $ cat hg.pid >> $DAEMON_PIDS
107
107
108 (Try to keep these in roughly the order they are defined in webcommands.py)
108 (Try to keep these in roughly the order they are defined in webcommands.py)
109
109
110 (log is handled by filelog/ and changelog/ - ignore it)
110 (log is handled by filelog/ and changelog/ - ignore it)
111
111
112 (rawfile/ doesn't use templating - nothing to test)
112 (rawfile/ doesn't use templating - nothing to test)
113
113
114 file/{revision}/{path} shows file revision
114 file/{revision}/{path} shows file revision
115
115
116 $ request json-file/78896eb0e102/foo-new
116 $ request json-file/78896eb0e102/foo-new
117 200 Script output follows
117 200 Script output follows
118
118
119 {
119 {
120 "bookmarks": [],
120 "bookmarks": [],
121 "branch": "default",
121 "branch": "default",
122 "date": [
122 "date": [
123 0.0,
123 0.0,
124 0
124 0
125 ],
125 ],
126 "desc": "move foo",
126 "desc": "move foo",
127 "lines": [
127 "lines": [
128 {
128 {
129 "line": "bar\n"
129 "line": "bar\n"
130 }
130 }
131 ],
131 ],
132 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
132 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
133 "parents": [
133 "parents": [
134 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
134 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
135 ],
135 ],
136 "path": "foo-new",
136 "path": "foo-new",
137 "phase": "public",
137 "phase": "public",
138 "tags": [
138 "tags": [
139 "tag1"
139 "tag1"
140 ],
140 ],
141 "user": "test"
141 "user": "test"
142 }
142 }
143
143
144 file/{revision} shows root directory info
144 file/{revision} shows root directory info
145
145
146 $ request json-file/cc725e08502a
146 $ request json-file/cc725e08502a
147 200 Script output follows
147 200 Script output follows
148
148
149 {
149 {
150 "abspath": "/",
150 "abspath": "/",
151 "bookmarks": [],
151 "bookmarks": [],
152 "directories": [
152 "directories": [
153 {
153 {
154 "abspath": "/da",
154 "abspath": "/da",
155 "basename": "da",
155 "basename": "da",
156 "emptydirs": ""
156 "emptydirs": ""
157 }
157 }
158 ],
158 ],
159 "files": [
159 "files": [
160 {
160 {
161 "abspath": ".hgtags",
161 "abspath": ".hgtags",
162 "basename": ".hgtags",
162 "basename": ".hgtags",
163 "date": [
163 "date": [
164 0.0,
164 0.0,
165 0
165 0
166 ],
166 ],
167 "flags": "",
167 "flags": "",
168 "size": 92
168 "size": 92
169 },
169 },
170 {
170 {
171 "abspath": "foo-new",
171 "abspath": "foo-new",
172 "basename": "foo-new",
172 "basename": "foo-new",
173 "date": [
173 "date": [
174 0.0,
174 0.0,
175 0
175 0
176 ],
176 ],
177 "flags": "",
177 "flags": "",
178 "size": 4
178 "size": 4
179 }
179 }
180 ],
180 ],
181 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
181 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
182 "tags": [
182 "tags": [
183 "tip"
183 "tip"
184 ]
184 ]
185 }
185 }
186
186
187 changelog/ shows information about several changesets
187 changelog/ shows information about several changesets
188
188
189 $ request json-changelog
189 $ request json-changelog
190 200 Script output follows
190 200 Script output follows
191
191
192 {
192 {
193 "changeset_count": 10,
193 "changeset_count": 10,
194 "changesets": [
194 "changesets": [
195 {
195 {
196 "bookmarks": [],
196 "bookmarks": [],
197 "branch": "default",
197 "branch": "default",
198 "date": [
198 "date": [
199 0.0,
199 0.0,
200 0
200 0
201 ],
201 ],
202 "desc": "merge test-branch into default",
202 "desc": "merge test-branch into default",
203 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
203 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
204 "parents": [
204 "parents": [
205 "ceed296fe500c3fac9541e31dad860cb49c89e45",
205 "ceed296fe500c3fac9541e31dad860cb49c89e45",
206 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
206 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
207 ],
207 ],
208 "phase": "draft",
208 "phase": "draft",
209 "tags": [
209 "tags": [
210 "tip"
210 "tip"
211 ],
211 ],
212 "user": "test"
212 "user": "test"
213 },
213 },
214 {
214 {
215 "bookmarks": [],
215 "bookmarks": [],
216 "branch": "test-branch",
216 "branch": "test-branch",
217 "date": [
217 "date": [
218 0.0,
218 0.0,
219 0
219 0
220 ],
220 ],
221 "desc": "another commit in test-branch",
221 "desc": "another commit in test-branch",
222 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
222 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
223 "parents": [
223 "parents": [
224 "6ab967a8ab3489227a83f80e920faa039a71819f"
224 "6ab967a8ab3489227a83f80e920faa039a71819f"
225 ],
225 ],
226 "phase": "draft",
226 "phase": "draft",
227 "tags": [],
227 "tags": [],
228 "user": "test"
228 "user": "test"
229 },
229 },
230 {
230 {
231 "bookmarks": [],
231 "bookmarks": [],
232 "branch": "test-branch",
232 "branch": "test-branch",
233 "date": [
233 "date": [
234 0.0,
234 0.0,
235 0
235 0
236 ],
236 ],
237 "desc": "create test branch",
237 "desc": "create test branch",
238 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
238 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
239 "parents": [
239 "parents": [
240 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
240 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
241 ],
241 ],
242 "phase": "draft",
242 "phase": "draft",
243 "tags": [],
243 "tags": [],
244 "user": "test"
244 "user": "test"
245 },
245 },
246 {
246 {
247 "bookmarks": [
247 "bookmarks": [
248 "bookmark2"
248 "bookmark2"
249 ],
249 ],
250 "branch": "default",
250 "branch": "default",
251 "date": [
251 "date": [
252 0.0,
252 0.0,
253 0
253 0
254 ],
254 ],
255 "desc": "create tag2",
255 "desc": "create tag2",
256 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
256 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
257 "parents": [
257 "parents": [
258 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
258 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
259 ],
259 ],
260 "phase": "draft",
260 "phase": "draft",
261 "tags": [],
261 "tags": [],
262 "user": "test"
262 "user": "test"
263 },
263 },
264 {
264 {
265 "bookmarks": [],
265 "bookmarks": [],
266 "branch": "default",
266 "branch": "default",
267 "date": [
267 "date": [
268 0.0,
268 0.0,
269 0
269 0
270 ],
270 ],
271 "desc": "another commit to da/foo",
271 "desc": "another commit to da/foo",
272 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
272 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
273 "parents": [
273 "parents": [
274 "93a8ce14f89156426b7fa981af8042da53f03aa0"
274 "93a8ce14f89156426b7fa981af8042da53f03aa0"
275 ],
275 ],
276 "phase": "draft",
276 "phase": "draft",
277 "tags": [
277 "tags": [
278 "tag2"
278 "tag2"
279 ],
279 ],
280 "user": "test"
280 "user": "test"
281 },
281 },
282 {
282 {
283 "bookmarks": [],
283 "bookmarks": [],
284 "branch": "default",
284 "branch": "default",
285 "date": [
285 "date": [
286 0.0,
286 0.0,
287 0
287 0
288 ],
288 ],
289 "desc": "create tag",
289 "desc": "create tag",
290 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
290 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
291 "parents": [
291 "parents": [
292 "78896eb0e102174ce9278438a95e12543e4367a7"
292 "78896eb0e102174ce9278438a95e12543e4367a7"
293 ],
293 ],
294 "phase": "public",
294 "phase": "public",
295 "tags": [],
295 "tags": [],
296 "user": "test"
296 "user": "test"
297 },
297 },
298 {
298 {
299 "bookmarks": [],
299 "bookmarks": [],
300 "branch": "default",
300 "branch": "default",
301 "date": [
301 "date": [
302 0.0,
302 0.0,
303 0
303 0
304 ],
304 ],
305 "desc": "move foo",
305 "desc": "move foo",
306 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
306 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
307 "parents": [
307 "parents": [
308 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
308 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
309 ],
309 ],
310 "phase": "public",
310 "phase": "public",
311 "tags": [
311 "tags": [
312 "tag1"
312 "tag1"
313 ],
313 ],
314 "user": "test"
314 "user": "test"
315 },
315 },
316 {
316 {
317 "bookmarks": [
317 "bookmarks": [
318 "bookmark1"
318 "bookmark1"
319 ],
319 ],
320 "branch": "default",
320 "branch": "default",
321 "date": [
321 "date": [
322 0.0,
322 0.0,
323 0
323 0
324 ],
324 ],
325 "desc": "modify da/foo",
325 "desc": "modify da/foo",
326 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
326 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
327 "parents": [
327 "parents": [
328 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
328 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
329 ],
329 ],
330 "phase": "public",
330 "phase": "public",
331 "tags": [],
331 "tags": [],
332 "user": "test"
332 "user": "test"
333 },
333 },
334 {
334 {
335 "bookmarks": [],
335 "bookmarks": [],
336 "branch": "default",
336 "branch": "default",
337 "date": [
337 "date": [
338 0.0,
338 0.0,
339 0
339 0
340 ],
340 ],
341 "desc": "modify foo",
341 "desc": "modify foo",
342 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
342 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
343 "parents": [
343 "parents": [
344 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
344 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
345 ],
345 ],
346 "phase": "public",
346 "phase": "public",
347 "tags": [],
347 "tags": [],
348 "user": "test"
348 "user": "test"
349 },
349 },
350 {
350 {
351 "bookmarks": [],
351 "bookmarks": [],
352 "branch": "default",
352 "branch": "default",
353 "date": [
353 "date": [
354 0.0,
354 0.0,
355 0
355 0
356 ],
356 ],
357 "desc": "initial",
357 "desc": "initial",
358 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
358 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
359 "parents": [],
359 "parents": [],
360 "phase": "public",
360 "phase": "public",
361 "tags": [],
361 "tags": [],
362 "user": "test"
362 "user": "test"
363 }
363 }
364 ],
364 ],
365 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
365 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
366 }
366 }
367
367
368 changelog/{revision} shows information starting at a specific changeset
368 changelog/{revision} shows information starting at a specific changeset
369
369
370 $ request json-changelog/f8bbb9024b10
370 $ request json-changelog/f8bbb9024b10
371 200 Script output follows
371 200 Script output follows
372
372
373 {
373 {
374 "changeset_count": 10,
374 "changeset_count": 10,
375 "changesets": [
375 "changesets": [
376 {
376 {
377 "bookmarks": [],
377 "bookmarks": [],
378 "branch": "default",
378 "branch": "default",
379 "date": [
379 "date": [
380 0.0,
380 0.0,
381 0
381 0
382 ],
382 ],
383 "desc": "modify foo",
383 "desc": "modify foo",
384 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
384 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
385 "parents": [
385 "parents": [
386 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
386 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
387 ],
387 ],
388 "phase": "public",
388 "phase": "public",
389 "tags": [],
389 "tags": [],
390 "user": "test"
390 "user": "test"
391 },
391 },
392 {
392 {
393 "bookmarks": [],
393 "bookmarks": [],
394 "branch": "default",
394 "branch": "default",
395 "date": [
395 "date": [
396 0.0,
396 0.0,
397 0
397 0
398 ],
398 ],
399 "desc": "initial",
399 "desc": "initial",
400 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
400 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
401 "parents": [],
401 "parents": [],
402 "phase": "public",
402 "phase": "public",
403 "tags": [],
403 "tags": [],
404 "user": "test"
404 "user": "test"
405 }
405 }
406 ],
406 ],
407 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
407 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
408 }
408 }
409
409
410 shortlog/ shows information about a set of changesets
410 shortlog/ shows information about a set of changesets
411
411
412 $ request json-shortlog
412 $ request json-shortlog
413 200 Script output follows
413 200 Script output follows
414
414
415 {
415 {
416 "changeset_count": 10,
416 "changeset_count": 10,
417 "changesets": [
417 "changesets": [
418 {
418 {
419 "bookmarks": [],
419 "bookmarks": [],
420 "branch": "default",
420 "branch": "default",
421 "date": [
421 "date": [
422 0.0,
422 0.0,
423 0
423 0
424 ],
424 ],
425 "desc": "merge test-branch into default",
425 "desc": "merge test-branch into default",
426 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
426 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
427 "parents": [
427 "parents": [
428 "ceed296fe500c3fac9541e31dad860cb49c89e45",
428 "ceed296fe500c3fac9541e31dad860cb49c89e45",
429 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
429 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
430 ],
430 ],
431 "phase": "draft",
431 "phase": "draft",
432 "tags": [
432 "tags": [
433 "tip"
433 "tip"
434 ],
434 ],
435 "user": "test"
435 "user": "test"
436 },
436 },
437 {
437 {
438 "bookmarks": [],
438 "bookmarks": [],
439 "branch": "test-branch",
439 "branch": "test-branch",
440 "date": [
440 "date": [
441 0.0,
441 0.0,
442 0
442 0
443 ],
443 ],
444 "desc": "another commit in test-branch",
444 "desc": "another commit in test-branch",
445 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
445 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
446 "parents": [
446 "parents": [
447 "6ab967a8ab3489227a83f80e920faa039a71819f"
447 "6ab967a8ab3489227a83f80e920faa039a71819f"
448 ],
448 ],
449 "phase": "draft",
449 "phase": "draft",
450 "tags": [],
450 "tags": [],
451 "user": "test"
451 "user": "test"
452 },
452 },
453 {
453 {
454 "bookmarks": [],
454 "bookmarks": [],
455 "branch": "test-branch",
455 "branch": "test-branch",
456 "date": [
456 "date": [
457 0.0,
457 0.0,
458 0
458 0
459 ],
459 ],
460 "desc": "create test branch",
460 "desc": "create test branch",
461 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
461 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
462 "parents": [
462 "parents": [
463 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
463 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
464 ],
464 ],
465 "phase": "draft",
465 "phase": "draft",
466 "tags": [],
466 "tags": [],
467 "user": "test"
467 "user": "test"
468 },
468 },
469 {
469 {
470 "bookmarks": [
470 "bookmarks": [
471 "bookmark2"
471 "bookmark2"
472 ],
472 ],
473 "branch": "default",
473 "branch": "default",
474 "date": [
474 "date": [
475 0.0,
475 0.0,
476 0
476 0
477 ],
477 ],
478 "desc": "create tag2",
478 "desc": "create tag2",
479 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
479 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
480 "parents": [
480 "parents": [
481 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
481 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
482 ],
482 ],
483 "phase": "draft",
483 "phase": "draft",
484 "tags": [],
484 "tags": [],
485 "user": "test"
485 "user": "test"
486 },
486 },
487 {
487 {
488 "bookmarks": [],
488 "bookmarks": [],
489 "branch": "default",
489 "branch": "default",
490 "date": [
490 "date": [
491 0.0,
491 0.0,
492 0
492 0
493 ],
493 ],
494 "desc": "another commit to da/foo",
494 "desc": "another commit to da/foo",
495 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
495 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
496 "parents": [
496 "parents": [
497 "93a8ce14f89156426b7fa981af8042da53f03aa0"
497 "93a8ce14f89156426b7fa981af8042da53f03aa0"
498 ],
498 ],
499 "phase": "draft",
499 "phase": "draft",
500 "tags": [
500 "tags": [
501 "tag2"
501 "tag2"
502 ],
502 ],
503 "user": "test"
503 "user": "test"
504 },
504 },
505 {
505 {
506 "bookmarks": [],
506 "bookmarks": [],
507 "branch": "default",
507 "branch": "default",
508 "date": [
508 "date": [
509 0.0,
509 0.0,
510 0
510 0
511 ],
511 ],
512 "desc": "create tag",
512 "desc": "create tag",
513 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
513 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
514 "parents": [
514 "parents": [
515 "78896eb0e102174ce9278438a95e12543e4367a7"
515 "78896eb0e102174ce9278438a95e12543e4367a7"
516 ],
516 ],
517 "phase": "public",
517 "phase": "public",
518 "tags": [],
518 "tags": [],
519 "user": "test"
519 "user": "test"
520 },
520 },
521 {
521 {
522 "bookmarks": [],
522 "bookmarks": [],
523 "branch": "default",
523 "branch": "default",
524 "date": [
524 "date": [
525 0.0,
525 0.0,
526 0
526 0
527 ],
527 ],
528 "desc": "move foo",
528 "desc": "move foo",
529 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
529 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
530 "parents": [
530 "parents": [
531 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
531 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
532 ],
532 ],
533 "phase": "public",
533 "phase": "public",
534 "tags": [
534 "tags": [
535 "tag1"
535 "tag1"
536 ],
536 ],
537 "user": "test"
537 "user": "test"
538 },
538 },
539 {
539 {
540 "bookmarks": [
540 "bookmarks": [
541 "bookmark1"
541 "bookmark1"
542 ],
542 ],
543 "branch": "default",
543 "branch": "default",
544 "date": [
544 "date": [
545 0.0,
545 0.0,
546 0
546 0
547 ],
547 ],
548 "desc": "modify da/foo",
548 "desc": "modify da/foo",
549 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
549 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
550 "parents": [
550 "parents": [
551 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
551 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
552 ],
552 ],
553 "phase": "public",
553 "phase": "public",
554 "tags": [],
554 "tags": [],
555 "user": "test"
555 "user": "test"
556 },
556 },
557 {
557 {
558 "bookmarks": [],
558 "bookmarks": [],
559 "branch": "default",
559 "branch": "default",
560 "date": [
560 "date": [
561 0.0,
561 0.0,
562 0
562 0
563 ],
563 ],
564 "desc": "modify foo",
564 "desc": "modify foo",
565 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
565 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
566 "parents": [
566 "parents": [
567 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
567 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
568 ],
568 ],
569 "phase": "public",
569 "phase": "public",
570 "tags": [],
570 "tags": [],
571 "user": "test"
571 "user": "test"
572 },
572 },
573 {
573 {
574 "bookmarks": [],
574 "bookmarks": [],
575 "branch": "default",
575 "branch": "default",
576 "date": [
576 "date": [
577 0.0,
577 0.0,
578 0
578 0
579 ],
579 ],
580 "desc": "initial",
580 "desc": "initial",
581 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
581 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
582 "parents": [],
582 "parents": [],
583 "phase": "public",
583 "phase": "public",
584 "tags": [],
584 "tags": [],
585 "user": "test"
585 "user": "test"
586 }
586 }
587 ],
587 ],
588 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
588 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
589 }
589 }
590
590
591 changeset/ renders the tip changeset
591 changeset/ renders the tip changeset
592
592
593 $ request json-rev
593 $ request json-rev
594 200 Script output follows
594 200 Script output follows
595
595
596 {
596 {
597 "bookmarks": [],
597 "bookmarks": [],
598 "branch": "default",
598 "branch": "default",
599 "date": [
599 "date": [
600 0.0,
600 0.0,
601 0
601 0
602 ],
602 ],
603 "desc": "merge test-branch into default",
603 "desc": "merge test-branch into default",
604 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
604 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
605 "parents": [
605 "parents": [
606 "ceed296fe500c3fac9541e31dad860cb49c89e45",
606 "ceed296fe500c3fac9541e31dad860cb49c89e45",
607 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
607 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
608 ],
608 ],
609 "phase": "draft",
609 "phase": "draft",
610 "tags": [
610 "tags": [
611 "tip"
611 "tip"
612 ],
612 ],
613 "user": "test"
613 "user": "test"
614 }
614 }
615
615
616 changeset/{revision} shows tags
616 changeset/{revision} shows tags
617
617
618 $ request json-rev/78896eb0e102
618 $ request json-rev/78896eb0e102
619 200 Script output follows
619 200 Script output follows
620
620
621 {
621 {
622 "bookmarks": [],
622 "bookmarks": [],
623 "branch": "default",
623 "branch": "default",
624 "date": [
624 "date": [
625 0.0,
625 0.0,
626 0
626 0
627 ],
627 ],
628 "desc": "move foo",
628 "desc": "move foo",
629 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
629 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
630 "parents": [
630 "parents": [
631 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
631 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
632 ],
632 ],
633 "phase": "public",
633 "phase": "public",
634 "tags": [
634 "tags": [
635 "tag1"
635 "tag1"
636 ],
636 ],
637 "user": "test"
637 "user": "test"
638 }
638 }
639
639
640 changeset/{revision} shows bookmarks
640 changeset/{revision} shows bookmarks
641
641
642 $ request json-rev/8d7c456572ac
642 $ request json-rev/8d7c456572ac
643 200 Script output follows
643 200 Script output follows
644
644
645 {
645 {
646 "bookmarks": [
646 "bookmarks": [
647 "bookmark1"
647 "bookmark1"
648 ],
648 ],
649 "branch": "default",
649 "branch": "default",
650 "date": [
650 "date": [
651 0.0,
651 0.0,
652 0
652 0
653 ],
653 ],
654 "desc": "modify da/foo",
654 "desc": "modify da/foo",
655 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
655 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
656 "parents": [
656 "parents": [
657 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
657 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
658 ],
658 ],
659 "phase": "public",
659 "phase": "public",
660 "tags": [],
660 "tags": [],
661 "user": "test"
661 "user": "test"
662 }
662 }
663
663
664 changeset/{revision} shows branches
664 changeset/{revision} shows branches
665
665
666 $ request json-rev/6ab967a8ab34
666 $ request json-rev/6ab967a8ab34
667 200 Script output follows
667 200 Script output follows
668
668
669 {
669 {
670 "bookmarks": [],
670 "bookmarks": [],
671 "branch": "test-branch",
671 "branch": "test-branch",
672 "date": [
672 "date": [
673 0.0,
673 0.0,
674 0
674 0
675 ],
675 ],
676 "desc": "create test branch",
676 "desc": "create test branch",
677 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
677 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
678 "parents": [
678 "parents": [
679 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
679 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
680 ],
680 ],
681 "phase": "draft",
681 "phase": "draft",
682 "tags": [],
682 "tags": [],
683 "user": "test"
683 "user": "test"
684 }
684 }
685
685
686 manifest/{revision}/{path} shows info about a directory at a revision
686 manifest/{revision}/{path} shows info about a directory at a revision
687
687
688 $ request json-manifest/06e557f3edf6/
688 $ request json-manifest/06e557f3edf6/
689 200 Script output follows
689 200 Script output follows
690
690
691 {
691 {
692 "abspath": "/",
692 "abspath": "/",
693 "bookmarks": [],
693 "bookmarks": [],
694 "directories": [
694 "directories": [
695 {
695 {
696 "abspath": "/da",
696 "abspath": "/da",
697 "basename": "da",
697 "basename": "da",
698 "emptydirs": ""
698 "emptydirs": ""
699 }
699 }
700 ],
700 ],
701 "files": [
701 "files": [
702 {
702 {
703 "abspath": "foo",
703 "abspath": "foo",
704 "basename": "foo",
704 "basename": "foo",
705 "date": [
705 "date": [
706 0.0,
706 0.0,
707 0
707 0
708 ],
708 ],
709 "flags": "",
709 "flags": "",
710 "size": 4
710 "size": 4
711 }
711 }
712 ],
712 ],
713 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
713 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
714 "tags": []
714 "tags": []
715 }
715 }
716
716
717 tags/ shows tags info
717 tags/ shows tags info
718
718
719 $ request json-tags
719 $ request json-tags
720 200 Script output follows
720 200 Script output follows
721
721
722 {
722 {
723 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
723 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
724 "tags": [
724 "tags": [
725 {
725 {
726 "date": [
726 "date": [
727 0.0,
727 0.0,
728 0
728 0
729 ],
729 ],
730 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
730 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
731 "tag": "tag2"
731 "tag": "tag2"
732 },
732 },
733 {
733 {
734 "date": [
734 "date": [
735 0.0,
735 0.0,
736 0
736 0
737 ],
737 ],
738 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
738 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
739 "tag": "tag1"
739 "tag": "tag1"
740 }
740 }
741 ]
741 ]
742 }
742 }
743
743
744 bookmarks/ shows bookmarks info
744 bookmarks/ shows bookmarks info
745
745
746 $ request json-bookmarks
746 $ request json-bookmarks
747 200 Script output follows
747 200 Script output follows
748
748
749 {
749 {
750 "bookmarks": [
750 "bookmarks": [
751 {
751 {
752 "bookmark": "bookmark2",
752 "bookmark": "bookmark2",
753 "date": [
753 "date": [
754 0.0,
754 0.0,
755 0
755 0
756 ],
756 ],
757 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45"
757 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45"
758 },
758 },
759 {
759 {
760 "bookmark": "bookmark1",
760 "bookmark": "bookmark1",
761 "date": [
761 "date": [
762 0.0,
762 0.0,
763 0
763 0
764 ],
764 ],
765 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5"
765 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5"
766 }
766 }
767 ],
767 ],
768 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
768 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7"
769 }
769 }
770
770
771 branches/ shows branches info
771 branches/ shows branches info
772
772
773 $ request json-branches
773 $ request json-branches
774 200 Script output follows
774 200 Script output follows
775
775
776 {
776 {
777 "branches": [
777 "branches": [
778 {
778 {
779 "branch": "default",
779 "branch": "default",
780 "date": [
780 "date": [
781 0.0,
781 0.0,
782 0
782 0
783 ],
783 ],
784 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
784 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
785 "status": "open"
785 "status": "open"
786 },
786 },
787 {
787 {
788 "branch": "test-branch",
788 "branch": "test-branch",
789 "date": [
789 "date": [
790 0.0,
790 0.0,
791 0
791 0
792 ],
792 ],
793 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
793 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
794 "status": "inactive"
794 "status": "inactive"
795 }
795 }
796 ]
796 ]
797 }
797 }
798
798
799 summary/ shows a summary of repository state
799 summary/ shows a summary of repository state
800
800
801 $ request json-summary
801 $ request json-summary
802 200 Script output follows
802 200 Script output follows
803
803
804 {
804 {
805 "archives": [
805 "archives": [
806 {
806 {
807 "extension": ".tar.bz2",
807 "extension": ".tar.bz2",
808 "node": "tip",
808 "node": "tip",
809 "type": "bz2",
809 "type": "bz2",
810 "url": "http://*:$HGPORT/archive/tip.tar.bz2" (glob)
810 "url": "http://*:$HGPORT/archive/tip.tar.bz2" (glob)
811 }
811 }
812 ],
812 ],
813 "bookmarks": [
813 "bookmarks": [
814 {
814 {
815 "bookmark": "bookmark2",
815 "bookmark": "bookmark2",
816 "date": [
816 "date": [
817 0.0,
817 0.0,
818 0
818 0
819 ],
819 ],
820 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45"
820 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45"
821 },
821 },
822 {
822 {
823 "bookmark": "bookmark1",
823 "bookmark": "bookmark1",
824 "date": [
824 "date": [
825 0.0,
825 0.0,
826 0
826 0
827 ],
827 ],
828 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5"
828 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5"
829 }
829 }
830 ],
830 ],
831 "branches": [
831 "branches": [
832 {
832 {
833 "branch": "default",
833 "branch": "default",
834 "date": [
834 "date": [
835 0.0,
835 0.0,
836 0
836 0
837 ],
837 ],
838 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
838 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
839 "status": "open"
839 "status": "open"
840 },
840 },
841 {
841 {
842 "branch": "test-branch",
842 "branch": "test-branch",
843 "date": [
843 "date": [
844 0.0,
844 0.0,
845 0
845 0
846 ],
846 ],
847 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
847 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
848 "status": "inactive"
848 "status": "inactive"
849 }
849 }
850 ],
850 ],
851 "labels": [],
851 "labels": [],
852 "lastchange": [
852 "lastchange": [
853 0.0,
853 0.0,
854 0
854 0
855 ],
855 ],
856 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
856 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
857 "shortlog": [
857 "shortlog": [
858 {
858 {
859 "bookmarks": [],
859 "bookmarks": [],
860 "branch": "default",
860 "branch": "default",
861 "date": [
861 "date": [
862 0.0,
862 0.0,
863 0
863 0
864 ],
864 ],
865 "desc": "merge test-branch into default",
865 "desc": "merge test-branch into default",
866 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
866 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
867 "parents": [
867 "parents": [
868 "ceed296fe500c3fac9541e31dad860cb49c89e45",
868 "ceed296fe500c3fac9541e31dad860cb49c89e45",
869 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
869 "ed66c30e87eb65337c05a4229efaa5f1d5285a90"
870 ],
870 ],
871 "phase": "draft",
871 "phase": "draft",
872 "tags": [
872 "tags": [
873 "tip"
873 "tip"
874 ],
874 ],
875 "user": "test"
875 "user": "test"
876 },
876 },
877 {
877 {
878 "bookmarks": [],
878 "bookmarks": [],
879 "branch": "test-branch",
879 "branch": "test-branch",
880 "date": [
880 "date": [
881 0.0,
881 0.0,
882 0
882 0
883 ],
883 ],
884 "desc": "another commit in test-branch",
884 "desc": "another commit in test-branch",
885 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
885 "node": "ed66c30e87eb65337c05a4229efaa5f1d5285a90",
886 "parents": [
886 "parents": [
887 "6ab967a8ab3489227a83f80e920faa039a71819f"
887 "6ab967a8ab3489227a83f80e920faa039a71819f"
888 ],
888 ],
889 "phase": "draft",
889 "phase": "draft",
890 "tags": [],
890 "tags": [],
891 "user": "test"
891 "user": "test"
892 },
892 },
893 {
893 {
894 "bookmarks": [],
894 "bookmarks": [],
895 "branch": "test-branch",
895 "branch": "test-branch",
896 "date": [
896 "date": [
897 0.0,
897 0.0,
898 0
898 0
899 ],
899 ],
900 "desc": "create test branch",
900 "desc": "create test branch",
901 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
901 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
902 "parents": [
902 "parents": [
903 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
903 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
904 ],
904 ],
905 "phase": "draft",
905 "phase": "draft",
906 "tags": [],
906 "tags": [],
907 "user": "test"
907 "user": "test"
908 },
908 },
909 {
909 {
910 "bookmarks": [
910 "bookmarks": [
911 "bookmark2"
911 "bookmark2"
912 ],
912 ],
913 "branch": "default",
913 "branch": "default",
914 "date": [
914 "date": [
915 0.0,
915 0.0,
916 0
916 0
917 ],
917 ],
918 "desc": "create tag2",
918 "desc": "create tag2",
919 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
919 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
920 "parents": [
920 "parents": [
921 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
921 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
922 ],
922 ],
923 "phase": "draft",
923 "phase": "draft",
924 "tags": [],
924 "tags": [],
925 "user": "test"
925 "user": "test"
926 },
926 },
927 {
927 {
928 "bookmarks": [],
928 "bookmarks": [],
929 "branch": "default",
929 "branch": "default",
930 "date": [
930 "date": [
931 0.0,
931 0.0,
932 0
932 0
933 ],
933 ],
934 "desc": "another commit to da/foo",
934 "desc": "another commit to da/foo",
935 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
935 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
936 "parents": [
936 "parents": [
937 "93a8ce14f89156426b7fa981af8042da53f03aa0"
937 "93a8ce14f89156426b7fa981af8042da53f03aa0"
938 ],
938 ],
939 "phase": "draft",
939 "phase": "draft",
940 "tags": [
940 "tags": [
941 "tag2"
941 "tag2"
942 ],
942 ],
943 "user": "test"
943 "user": "test"
944 },
944 },
945 {
945 {
946 "bookmarks": [],
946 "bookmarks": [],
947 "branch": "default",
947 "branch": "default",
948 "date": [
948 "date": [
949 0.0,
949 0.0,
950 0
950 0
951 ],
951 ],
952 "desc": "create tag",
952 "desc": "create tag",
953 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
953 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
954 "parents": [
954 "parents": [
955 "78896eb0e102174ce9278438a95e12543e4367a7"
955 "78896eb0e102174ce9278438a95e12543e4367a7"
956 ],
956 ],
957 "phase": "public",
957 "phase": "public",
958 "tags": [],
958 "tags": [],
959 "user": "test"
959 "user": "test"
960 },
960 },
961 {
961 {
962 "bookmarks": [],
962 "bookmarks": [],
963 "branch": "default",
963 "branch": "default",
964 "date": [
964 "date": [
965 0.0,
965 0.0,
966 0
966 0
967 ],
967 ],
968 "desc": "move foo",
968 "desc": "move foo",
969 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
969 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
970 "parents": [
970 "parents": [
971 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
971 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
972 ],
972 ],
973 "phase": "public",
973 "phase": "public",
974 "tags": [
974 "tags": [
975 "tag1"
975 "tag1"
976 ],
976 ],
977 "user": "test"
977 "user": "test"
978 },
978 },
979 {
979 {
980 "bookmarks": [
980 "bookmarks": [
981 "bookmark1"
981 "bookmark1"
982 ],
982 ],
983 "branch": "default",
983 "branch": "default",
984 "date": [
984 "date": [
985 0.0,
985 0.0,
986 0
986 0
987 ],
987 ],
988 "desc": "modify da/foo",
988 "desc": "modify da/foo",
989 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
989 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
990 "parents": [
990 "parents": [
991 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
991 "f8bbb9024b10f93cdbb8d940337398291d40dea8"
992 ],
992 ],
993 "phase": "public",
993 "phase": "public",
994 "tags": [],
994 "tags": [],
995 "user": "test"
995 "user": "test"
996 },
996 },
997 {
997 {
998 "bookmarks": [],
998 "bookmarks": [],
999 "branch": "default",
999 "branch": "default",
1000 "date": [
1000 "date": [
1001 0.0,
1001 0.0,
1002 0
1002 0
1003 ],
1003 ],
1004 "desc": "modify foo",
1004 "desc": "modify foo",
1005 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1005 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1006 "parents": [
1006 "parents": [
1007 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1007 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1008 ],
1008 ],
1009 "phase": "public",
1009 "phase": "public",
1010 "tags": [],
1010 "tags": [],
1011 "user": "test"
1011 "user": "test"
1012 },
1012 },
1013 {
1013 {
1014 "bookmarks": [],
1014 "bookmarks": [],
1015 "branch": "default",
1015 "branch": "default",
1016 "date": [
1016 "date": [
1017 0.0,
1017 0.0,
1018 0
1018 0
1019 ],
1019 ],
1020 "desc": "initial",
1020 "desc": "initial",
1021 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1021 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1022 "parents": [],
1022 "parents": [],
1023 "phase": "public",
1023 "phase": "public",
1024 "tags": [],
1024 "tags": [],
1025 "user": "test"
1025 "user": "test"
1026 }
1026 }
1027 ],
1027 ],
1028 "tags": [
1028 "tags": [
1029 {
1029 {
1030 "date": [
1030 "date": [
1031 0.0,
1031 0.0,
1032 0
1032 0
1033 ],
1033 ],
1034 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1034 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1035 "tag": "tag2"
1035 "tag": "tag2"
1036 },
1036 },
1037 {
1037 {
1038 "date": [
1038 "date": [
1039 0.0,
1039 0.0,
1040 0
1040 0
1041 ],
1041 ],
1042 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
1042 "node": "78896eb0e102174ce9278438a95e12543e4367a7",
1043 "tag": "tag1"
1043 "tag": "tag1"
1044 }
1044 }
1045 ]
1045 ]
1046 }
1046 }
1047
1047
1048 $ request json-changelog?rev=create
1048 $ request json-changelog?rev=create
1049 200 Script output follows
1049 200 Script output follows
1050
1050
1051 {
1051 {
1052 "entries": [
1052 "entries": [
1053 {
1053 {
1054 "bookmarks": [],
1054 "bookmarks": [],
1055 "branch": "test-branch",
1055 "branch": "test-branch",
1056 "date": [
1056 "date": [
1057 0.0,
1057 0.0,
1058 0
1058 0
1059 ],
1059 ],
1060 "desc": "create test branch",
1060 "desc": "create test branch",
1061 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
1061 "node": "6ab967a8ab3489227a83f80e920faa039a71819f",
1062 "parents": [
1062 "parents": [
1063 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1063 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1064 ],
1064 ],
1065 "phase": "draft",
1065 "phase": "draft",
1066 "tags": [],
1066 "tags": [],
1067 "user": "test"
1067 "user": "test"
1068 },
1068 },
1069 {
1069 {
1070 "bookmarks": [
1070 "bookmarks": [
1071 "bookmark2"
1071 "bookmark2"
1072 ],
1072 ],
1073 "branch": "default",
1073 "branch": "default",
1074 "date": [
1074 "date": [
1075 0.0,
1075 0.0,
1076 0
1076 0
1077 ],
1077 ],
1078 "desc": "create tag2",
1078 "desc": "create tag2",
1079 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
1079 "node": "ceed296fe500c3fac9541e31dad860cb49c89e45",
1080 "parents": [
1080 "parents": [
1081 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
1081 "f2890a05fea49bfaf9fb27ed5490894eba32da78"
1082 ],
1082 ],
1083 "phase": "draft",
1083 "phase": "draft",
1084 "tags": [],
1084 "tags": [],
1085 "user": "test"
1085 "user": "test"
1086 },
1086 },
1087 {
1087 {
1088 "bookmarks": [],
1088 "bookmarks": [],
1089 "branch": "default",
1089 "branch": "default",
1090 "date": [
1090 "date": [
1091 0.0,
1091 0.0,
1092 0
1092 0
1093 ],
1093 ],
1094 "desc": "create tag",
1094 "desc": "create tag",
1095 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
1095 "node": "93a8ce14f89156426b7fa981af8042da53f03aa0",
1096 "parents": [
1096 "parents": [
1097 "78896eb0e102174ce9278438a95e12543e4367a7"
1097 "78896eb0e102174ce9278438a95e12543e4367a7"
1098 ],
1098 ],
1099 "phase": "public",
1099 "phase": "public",
1100 "tags": [],
1100 "tags": [],
1101 "user": "test"
1101 "user": "test"
1102 }
1102 }
1103 ],
1103 ],
1104 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1104 "node": "cc725e08502a79dd1eda913760fbe06ed7a9abc7",
1105 "query": "create"
1105 "query": "create"
1106 }
1106 }
1107
1107
1108 filediff/{revision}/{path} shows changes to a file in a revision
1108 filediff/{revision}/{path} shows changes to a file in a revision
1109
1109
1110 $ request json-diff/f8bbb9024b10/foo
1110 $ request json-diff/f8bbb9024b10/foo
1111 200 Script output follows
1111 200 Script output follows
1112
1112
1113 {
1113 {
1114 "author": "test",
1114 "author": "test",
1115 "children": [],
1115 "children": [],
1116 "date": [
1116 "date": [
1117 0.0,
1117 0.0,
1118 0
1118 0
1119 ],
1119 ],
1120 "desc": "modify foo",
1120 "desc": "modify foo",
1121 "diff": [
1121 "diff": [
1122 {
1122 {
1123 "blockno": 1,
1123 "blockno": 1,
1124 "lines": [
1124 "lines": [
1125 {
1125 {
1126 "l": "--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n",
1126 "l": "--- a/foo\tThu Jan 01 00:00:00 1970 +0000\n",
1127 "n": 1,
1127 "n": 1,
1128 "t": "-"
1128 "t": "-"
1129 },
1129 },
1130 {
1130 {
1131 "l": "+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n",
1131 "l": "+++ b/foo\tThu Jan 01 00:00:00 1970 +0000\n",
1132 "n": 2,
1132 "n": 2,
1133 "t": "+"
1133 "t": "+"
1134 },
1134 },
1135 {
1135 {
1136 "l": "@@ -1,1 +1,1 @@\n",
1136 "l": "@@ -1,1 +1,1 @@\n",
1137 "n": 3,
1137 "n": 3,
1138 "t": "@"
1138 "t": "@"
1139 },
1139 },
1140 {
1140 {
1141 "l": "-foo\n",
1141 "l": "-foo\n",
1142 "n": 4,
1142 "n": 4,
1143 "t": "-"
1143 "t": "-"
1144 },
1144 },
1145 {
1145 {
1146 "l": "+bar\n",
1146 "l": "+bar\n",
1147 "n": 5,
1147 "n": 5,
1148 "t": "+"
1148 "t": "+"
1149 }
1149 }
1150 ]
1150 ]
1151 }
1151 }
1152 ],
1152 ],
1153 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1153 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1154 "parents": [
1154 "parents": [
1155 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1155 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1156 ],
1156 ],
1157 "path": "foo"
1157 "path": "foo"
1158 }
1158 }
1159
1159
1160 comparison/{revision}/{path} shows information about before and after for a file
1160 comparison/{revision}/{path} shows information about before and after for a file
1161
1161
1162 $ request json-comparison/f8bbb9024b10/foo
1162 $ request json-comparison/f8bbb9024b10/foo
1163 200 Script output follows
1163 200 Script output follows
1164
1164
1165 {
1165 {
1166 "author": "test",
1166 "author": "test",
1167 "children": [],
1167 "children": [],
1168 "comparison": [
1168 "comparison": [
1169 {
1169 {
1170 "lines": [
1170 "lines": [
1171 {
1171 {
1172 "ll": "foo",
1172 "ll": "foo",
1173 "ln": 1,
1173 "ln": 1,
1174 "rl": "bar",
1174 "rl": "bar",
1175 "rn": 1,
1175 "rn": 1,
1176 "t": "replace"
1176 "t": "replace"
1177 }
1177 }
1178 ]
1178 ]
1179 }
1179 }
1180 ],
1180 ],
1181 "date": [
1181 "date": [
1182 0.0,
1182 0.0,
1183 0
1183 0
1184 ],
1184 ],
1185 "desc": "modify foo",
1185 "desc": "modify foo",
1186 "leftnode": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1186 "leftnode": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1187 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1187 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1188 "parents": [
1188 "parents": [
1189 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1189 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1190 ],
1190 ],
1191 "path": "foo",
1191 "path": "foo",
1192 "rightnode": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
1192 "rightnode": "f8bbb9024b10f93cdbb8d940337398291d40dea8"
1193 }
1193 }
1194
1194
1195 annotate/{revision}/{path} shows annotations for each line
1195 annotate/{revision}/{path} shows annotations for each line
1196
1196
1197 $ request json-annotate/f8bbb9024b10/foo
1197 $ request json-annotate/f8bbb9024b10/foo
1198 200 Script output follows
1198 200 Script output follows
1199
1199
1200 {
1200 {
1201 "abspath": "foo",
1201 "abspath": "foo",
1202 "annotate": [
1202 "annotate": [
1203 {
1203 {
1204 "abspath": "foo",
1204 "abspath": "foo",
1205 "author": "test",
1205 "author": "test",
1206 "desc": "modify foo",
1206 "desc": "modify foo",
1207 "line": "bar\n",
1207 "line": "bar\n",
1208 "lineno": 1,
1208 "lineno": 1,
1209 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1209 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1210 "revdate": [
1210 "revdate": [
1211 0.0,
1211 0.0,
1212 0
1212 0
1213 ],
1213 ],
1214 "targetline": 1
1214 "targetline": 1
1215 }
1215 }
1216 ],
1216 ],
1217 "author": "test",
1217 "author": "test",
1218 "children": [],
1218 "children": [],
1219 "date": [
1219 "date": [
1220 0.0,
1220 0.0,
1221 0
1221 0
1222 ],
1222 ],
1223 "desc": "modify foo",
1223 "desc": "modify foo",
1224 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1224 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1225 "parents": [
1225 "parents": [
1226 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1226 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1227 ],
1227 ],
1228 "permissions": ""
1228 "permissions": ""
1229 }
1229 }
1230
1230
1231 filelog/{revision}/{path} shows history of a single file
1231 filelog/{revision}/{path} shows history of a single file
1232
1232
1233 $ request json-filelog/f8bbb9024b10/foo
1233 $ request json-filelog/f8bbb9024b10/foo
1234 200 Script output follows
1234 200 Script output follows
1235
1235
1236 {
1236 {
1237 "entries": [
1237 "entries": [
1238 {
1238 {
1239 "bookmarks": [],
1239 "bookmarks": [],
1240 "branch": "default",
1240 "branch": "default",
1241 "date": [
1241 "date": [
1242 0.0,
1242 0.0,
1243 0
1243 0
1244 ],
1244 ],
1245 "desc": "modify foo",
1245 "desc": "modify foo",
1246 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1246 "node": "f8bbb9024b10f93cdbb8d940337398291d40dea8",
1247 "parents": [
1247 "parents": [
1248 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1248 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1249 ],
1249 ],
1250 "phase": "public",
1250 "phase": "public",
1251 "tags": [],
1251 "tags": [],
1252 "user": "test"
1252 "user": "test"
1253 },
1253 },
1254 {
1254 {
1255 "bookmarks": [],
1255 "bookmarks": [],
1256 "branch": "default",
1256 "branch": "default",
1257 "date": [
1257 "date": [
1258 0.0,
1258 0.0,
1259 0
1259 0
1260 ],
1260 ],
1261 "desc": "initial",
1261 "desc": "initial",
1262 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1262 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1263 "parents": [],
1263 "parents": [],
1264 "phase": "public",
1264 "phase": "public",
1265 "tags": [],
1265 "tags": [],
1266 "user": "test"
1266 "user": "test"
1267 }
1267 }
1268 ]
1268 ]
1269 }
1269 }
1270
1270
1271 $ request json-filelog/cc725e08502a/da/foo
1271 $ request json-filelog/cc725e08502a/da/foo
1272 200 Script output follows
1272 200 Script output follows
1273
1273
1274 {
1274 {
1275 "entries": [
1275 "entries": [
1276 {
1276 {
1277 "bookmarks": [],
1277 "bookmarks": [],
1278 "branch": "default",
1278 "branch": "default",
1279 "date": [
1279 "date": [
1280 0.0,
1280 0.0,
1281 0
1281 0
1282 ],
1282 ],
1283 "desc": "another commit to da/foo",
1283 "desc": "another commit to da/foo",
1284 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1284 "node": "f2890a05fea49bfaf9fb27ed5490894eba32da78",
1285 "parents": [
1285 "parents": [
1286 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
1286 "8d7c456572acf3557e8ed8a07286b10c408bcec5"
1287 ],
1287 ],
1288 "phase": "draft",
1288 "phase": "draft",
1289 "tags": [
1289 "tags": [
1290 "tag2"
1290 "tag2"
1291 ],
1291 ],
1292 "user": "test"
1292 "user": "test"
1293 },
1293 },
1294 {
1294 {
1295 "bookmarks": [
1295 "bookmarks": [
1296 "bookmark1"
1296 "bookmark1"
1297 ],
1297 ],
1298 "branch": "default",
1298 "branch": "default",
1299 "date": [
1299 "date": [
1300 0.0,
1300 0.0,
1301 0
1301 0
1302 ],
1302 ],
1303 "desc": "modify da/foo",
1303 "desc": "modify da/foo",
1304 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
1304 "node": "8d7c456572acf3557e8ed8a07286b10c408bcec5",
1305 "parents": [
1305 "parents": [
1306 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1306 "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e"
1307 ],
1307 ],
1308 "phase": "public",
1308 "phase": "public",
1309 "tags": [],
1309 "tags": [],
1310 "user": "test"
1310 "user": "test"
1311 },
1311 },
1312 {
1312 {
1313 "bookmarks": [],
1313 "bookmarks": [],
1314 "branch": "default",
1314 "branch": "default",
1315 "date": [
1315 "date": [
1316 0.0,
1316 0.0,
1317 0
1317 0
1318 ],
1318 ],
1319 "desc": "initial",
1319 "desc": "initial",
1320 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1320 "node": "06e557f3edf66faa1ccaba5dd8c203c21cc79f1e",
1321 "parents": [],
1321 "parents": [],
1322 "phase": "public",
1322 "phase": "public",
1323 "tags": [],
1323 "tags": [],
1324 "user": "test"
1324 "user": "test"
1325 }
1325 }
1326 ]
1326 ]
1327 }
1327 }
1328
1328
1329 (archive/ doesn't use templating, so ignore it)
1329 (archive/ doesn't use templating, so ignore it)
1330
1330
1331 (static/ doesn't use templating, so ignore it)
1331 (static/ doesn't use templating, so ignore it)
1332
1332
1333 graph/ shows information that can be used to render a graph of the DAG
1333 graph/ shows information that can be used to render a graph of the DAG
1334
1334
1335 $ request json-graph
1335 $ request json-graph
1336 200 Script output follows
1336 200 Script output follows
1337
1337
1338 "not yet implemented"
1338 "not yet implemented"
1339
1339
1340 help/ shows help topics
1340 help/ shows help topics
1341
1341
1342 $ request json-help
1342 $ request json-help
1343 200 Script output follows
1343 200 Script output follows
1344
1344
1345 {
1345 {
1346 "earlycommands": [
1346 "earlycommands": [
1347 {
1347 {
1348 "summary": "add the specified files on the next commit",
1348 "summary": "add the specified files on the next commit",
1349 "topic": "add"
1349 "topic": "add"
1350 },
1350 },
1351 {
1351 {
1352 "summary": "show changeset information by line for each file",
1352 "summary": "show changeset information by line for each file",
1353 "topic": "annotate"
1353 "topic": "annotate"
1354 },
1354 },
1355 {
1355 {
1356 "summary": "make a copy of an existing repository",
1356 "summary": "make a copy of an existing repository",
1357 "topic": "clone"
1357 "topic": "clone"
1358 },
1358 },
1359 {
1359 {
1360 "summary": "commit the specified files or all outstanding changes",
1360 "summary": "commit the specified files or all outstanding changes",
1361 "topic": "commit"
1361 "topic": "commit"
1362 },
1362 },
1363 {
1363 {
1364 "summary": "diff repository (or selected files)",
1364 "summary": "diff repository (or selected files)",
1365 "topic": "diff"
1365 "topic": "diff"
1366 },
1366 },
1367 {
1367 {
1368 "summary": "dump the header and diffs for one or more changesets",
1368 "summary": "dump the header and diffs for one or more changesets",
1369 "topic": "export"
1369 "topic": "export"
1370 },
1370 },
1371 {
1371 {
1372 "summary": "forget the specified files on the next commit",
1372 "summary": "forget the specified files on the next commit",
1373 "topic": "forget"
1373 "topic": "forget"
1374 },
1374 },
1375 {
1375 {
1376 "summary": "create a new repository in the given directory",
1376 "summary": "create a new repository in the given directory",
1377 "topic": "init"
1377 "topic": "init"
1378 },
1378 },
1379 {
1379 {
1380 "summary": "show revision history of entire repository or files",
1380 "summary": "show revision history of entire repository or files",
1381 "topic": "log"
1381 "topic": "log"
1382 },
1382 },
1383 {
1383 {
1384 "summary": "merge another revision into working directory",
1384 "summary": "merge another revision into working directory",
1385 "topic": "merge"
1385 "topic": "merge"
1386 },
1386 },
1387 {
1387 {
1388 "summary": "pull changes from the specified source",
1388 "summary": "pull changes from the specified source",
1389 "topic": "pull"
1389 "topic": "pull"
1390 },
1390 },
1391 {
1391 {
1392 "summary": "push changes to the specified destination",
1392 "summary": "push changes to the specified destination",
1393 "topic": "push"
1393 "topic": "push"
1394 },
1394 },
1395 {
1395 {
1396 "summary": "remove the specified files on the next commit",
1396 "summary": "remove the specified files on the next commit",
1397 "topic": "remove"
1397 "topic": "remove"
1398 },
1398 },
1399 {
1399 {
1400 "summary": "start stand-alone webserver",
1400 "summary": "start stand-alone webserver",
1401 "topic": "serve"
1401 "topic": "serve"
1402 },
1402 },
1403 {
1403 {
1404 "summary": "show changed files in the working directory",
1404 "summary": "show changed files in the working directory",
1405 "topic": "status"
1405 "topic": "status"
1406 },
1406 },
1407 {
1407 {
1408 "summary": "summarize working directory state",
1408 "summary": "summarize working directory state",
1409 "topic": "summary"
1409 "topic": "summary"
1410 },
1410 },
1411 {
1411 {
1412 "summary": "update working directory (or switch revisions)",
1412 "summary": "update working directory (or switch revisions)",
1413 "topic": "update"
1413 "topic": "update"
1414 }
1414 }
1415 ],
1415 ],
1416 "othercommands": [
1416 "othercommands": [
1417 {
1417 {
1418 "summary": "add all new files, delete all missing files",
1418 "summary": "add all new files, delete all missing files",
1419 "topic": "addremove"
1419 "topic": "addremove"
1420 },
1420 },
1421 {
1421 {
1422 "summary": "create an unversioned archive of a repository revision",
1422 "summary": "create an unversioned archive of a repository revision",
1423 "topic": "archive"
1423 "topic": "archive"
1424 },
1424 },
1425 {
1425 {
1426 "summary": "reverse effect of earlier changeset",
1426 "summary": "reverse effect of earlier changeset",
1427 "topic": "backout"
1427 "topic": "backout"
1428 },
1428 },
1429 {
1429 {
1430 "summary": "subdivision search of changesets",
1430 "summary": "subdivision search of changesets",
1431 "topic": "bisect"
1431 "topic": "bisect"
1432 },
1432 },
1433 {
1433 {
1434 "summary": "create a new bookmark or list existing bookmarks",
1434 "summary": "create a new bookmark or list existing bookmarks",
1435 "topic": "bookmarks"
1435 "topic": "bookmarks"
1436 },
1436 },
1437 {
1437 {
1438 "summary": "set or show the current branch name",
1438 "summary": "set or show the current branch name",
1439 "topic": "branch"
1439 "topic": "branch"
1440 },
1440 },
1441 {
1441 {
1442 "summary": "list repository named branches",
1442 "summary": "list repository named branches",
1443 "topic": "branches"
1443 "topic": "branches"
1444 },
1444 },
1445 {
1445 {
1446 "summary": "create a bundle file",
1446 "summary": "create a bundle file",
1447 "topic": "bundle"
1447 "topic": "bundle"
1448 },
1448 },
1449 {
1449 {
1450 "summary": "output the current or given revision of files",
1450 "summary": "output the current or given revision of files",
1451 "topic": "cat"
1451 "topic": "cat"
1452 },
1452 },
1453 {
1453 {
1454 "summary": "show combined config settings from all hgrc files",
1454 "summary": "show combined config settings from all hgrc files",
1455 "topic": "config"
1455 "topic": "config"
1456 },
1456 },
1457 {
1457 {
1458 "summary": "mark files as copied for the next commit",
1458 "summary": "mark files as copied for the next commit",
1459 "topic": "copy"
1459 "topic": "copy"
1460 },
1460 },
1461 {
1461 {
1462 "summary": "list tracked files",
1462 "summary": "list tracked files",
1463 "topic": "files"
1463 "topic": "files"
1464 },
1464 },
1465 {
1465 {
1466 "summary": "copy changes from other branches onto the current branch",
1466 "summary": "copy changes from other branches onto the current branch",
1467 "topic": "graft"
1467 "topic": "graft"
1468 },
1468 },
1469 {
1469 {
1470 "summary": "search revision history for a pattern in specified files",
1470 "summary": "search revision history for a pattern in specified files",
1471 "topic": "grep"
1471 "topic": "grep"
1472 },
1472 },
1473 {
1473 {
1474 "summary": "show branch heads",
1474 "summary": "show branch heads",
1475 "topic": "heads"
1475 "topic": "heads"
1476 },
1476 },
1477 {
1477 {
1478 "summary": "show help for a given topic or a help overview",
1478 "summary": "show help for a given topic or a help overview",
1479 "topic": "help"
1479 "topic": "help"
1480 },
1480 },
1481 {
1481 {
1482 "summary": "identify the working directory or specified revision",
1482 "summary": "identify the working directory or specified revision",
1483 "topic": "identify"
1483 "topic": "identify"
1484 },
1484 },
1485 {
1485 {
1486 "summary": "import an ordered set of patches",
1486 "summary": "import an ordered set of patches",
1487 "topic": "import"
1487 "topic": "import"
1488 },
1488 },
1489 {
1489 {
1490 "summary": "show new changesets found in source",
1490 "summary": "show new changesets found in source",
1491 "topic": "incoming"
1491 "topic": "incoming"
1492 },
1492 },
1493 {
1493 {
1494 "summary": "output the current or given revision of the project manifest",
1494 "summary": "output the current or given revision of the project manifest",
1495 "topic": "manifest"
1495 "topic": "manifest"
1496 },
1496 },
1497 {
1497 {
1498 "summary": "show changesets not found in the destination",
1498 "summary": "show changesets not found in the destination",
1499 "topic": "outgoing"
1499 "topic": "outgoing"
1500 },
1500 },
1501 {
1501 {
1502 "summary": "show aliases for remote repositories",
1502 "summary": "show aliases for remote repositories",
1503 "topic": "paths"
1503 "topic": "paths"
1504 },
1504 },
1505 {
1505 {
1506 "summary": "set or show the current phase name",
1506 "summary": "set or show the current phase name",
1507 "topic": "phase"
1507 "topic": "phase"
1508 },
1508 },
1509 {
1509 {
1510 "summary": "roll back an interrupted transaction",
1510 "summary": "roll back an interrupted transaction",
1511 "topic": "recover"
1511 "topic": "recover"
1512 },
1512 },
1513 {
1513 {
1514 "summary": "rename files; equivalent of copy + remove",
1514 "summary": "rename files; equivalent of copy + remove",
1515 "topic": "rename"
1515 "topic": "rename"
1516 },
1516 },
1517 {
1517 {
1518 "summary": "redo merges or set/view the merge status of files",
1518 "summary": "redo merges or set/view the merge status of files",
1519 "topic": "resolve"
1519 "topic": "resolve"
1520 },
1520 },
1521 {
1521 {
1522 "summary": "restore files to their checkout state",
1522 "summary": "restore files to their checkout state",
1523 "topic": "revert"
1523 "topic": "revert"
1524 },
1524 },
1525 {
1525 {
1526 "summary": "print the root (top) of the current working directory",
1526 "summary": "print the root (top) of the current working directory",
1527 "topic": "root"
1527 "topic": "root"
1528 },
1528 },
1529 {
1529 {
1530 "summary": "add one or more tags for the current or given revision",
1530 "summary": "add one or more tags for the current or given revision",
1531 "topic": "tag"
1531 "topic": "tag"
1532 },
1532 },
1533 {
1533 {
1534 "summary": "list repository tags",
1534 "summary": "list repository tags",
1535 "topic": "tags"
1535 "topic": "tags"
1536 },
1536 },
1537 {
1537 {
1538 "summary": "apply one or more bundle files",
1538 "summary": "apply one or more bundle files",
1539 "topic": "unbundle"
1539 "topic": "unbundle"
1540 },
1540 },
1541 {
1541 {
1542 "summary": "verify the integrity of the repository",
1542 "summary": "verify the integrity of the repository",
1543 "topic": "verify"
1543 "topic": "verify"
1544 },
1544 },
1545 {
1545 {
1546 "summary": "output version and copyright information",
1546 "summary": "output version and copyright information",
1547 "topic": "version"
1547 "topic": "version"
1548 }
1548 }
1549 ],
1549 ],
1550 "topics": [
1550 "topics": [
1551 {
1551 {
1552 "summary": "Bundle File Formats",
1552 "summary": "Bundle File Formats",
1553 "topic": "bundlespec"
1553 "topic": "bundlespec"
1554 },
1554 },
1555 {
1555 {
1556 "summary": "Colorizing Outputs",
1556 "summary": "Colorizing Outputs",
1557 "topic": "color"
1557 "topic": "color"
1558 },
1558 },
1559 {
1559 {
1560 "summary": "Configuration Files",
1560 "summary": "Configuration Files",
1561 "topic": "config"
1561 "topic": "config"
1562 },
1562 },
1563 {
1563 {
1564 "summary": "Date Formats",
1564 "summary": "Date Formats",
1565 "topic": "dates"
1565 "topic": "dates"
1566 },
1566 },
1567 {
1567 {
1568 "summary": "Diff Formats",
1568 "summary": "Diff Formats",
1569 "topic": "diffs"
1569 "topic": "diffs"
1570 },
1570 },
1571 {
1571 {
1572 "summary": "Environment Variables",
1572 "summary": "Environment Variables",
1573 "topic": "environment"
1573 "topic": "environment"
1574 },
1574 },
1575 {
1575 {
1576 "summary": "Using Additional Features",
1576 "summary": "Using Additional Features",
1577 "topic": "extensions"
1577 "topic": "extensions"
1578 },
1578 },
1579 {
1579 {
1580 "summary": "Specifying File Sets",
1580 "summary": "Specifying File Sets",
1581 "topic": "filesets"
1581 "topic": "filesets"
1582 },
1582 },
1583 {
1583 {
1584 "summary": "Command-line flags",
1585 "topic": "flags"
1586 },
1587 {
1584 "summary": "Glossary",
1588 "summary": "Glossary",
1585 "topic": "glossary"
1589 "topic": "glossary"
1586 },
1590 },
1587 {
1591 {
1588 "summary": "Syntax for Mercurial Ignore Files",
1592 "summary": "Syntax for Mercurial Ignore Files",
1589 "topic": "hgignore"
1593 "topic": "hgignore"
1590 },
1594 },
1591 {
1595 {
1592 "summary": "Configuring hgweb",
1596 "summary": "Configuring hgweb",
1593 "topic": "hgweb"
1597 "topic": "hgweb"
1594 },
1598 },
1595 {
1599 {
1596 "summary": "Technical implementation topics",
1600 "summary": "Technical implementation topics",
1597 "topic": "internals"
1601 "topic": "internals"
1598 },
1602 },
1599 {
1603 {
1600 "summary": "Merge Tools",
1604 "summary": "Merge Tools",
1601 "topic": "merge-tools"
1605 "topic": "merge-tools"
1602 },
1606 },
1603 {
1607 {
1604 "summary": "Pager Support",
1608 "summary": "Pager Support",
1605 "topic": "pager"
1609 "topic": "pager"
1606 },
1610 },
1607 {
1611 {
1608 "summary": "File Name Patterns",
1612 "summary": "File Name Patterns",
1609 "topic": "patterns"
1613 "topic": "patterns"
1610 },
1614 },
1611 {
1615 {
1612 "summary": "Working with Phases",
1616 "summary": "Working with Phases",
1613 "topic": "phases"
1617 "topic": "phases"
1614 },
1618 },
1615 {
1619 {
1616 "summary": "Specifying Revisions",
1620 "summary": "Specifying Revisions",
1617 "topic": "revisions"
1621 "topic": "revisions"
1618 },
1622 },
1619 {
1623 {
1620 "summary": "Using Mercurial from scripts and automation",
1624 "summary": "Using Mercurial from scripts and automation",
1621 "topic": "scripting"
1625 "topic": "scripting"
1622 },
1626 },
1623 {
1627 {
1624 "summary": "Subrepositories",
1628 "summary": "Subrepositories",
1625 "topic": "subrepos"
1629 "topic": "subrepos"
1626 },
1630 },
1627 {
1631 {
1628 "summary": "Template Usage",
1632 "summary": "Template Usage",
1629 "topic": "templating"
1633 "topic": "templating"
1630 },
1634 },
1631 {
1635 {
1632 "summary": "URL Paths",
1636 "summary": "URL Paths",
1633 "topic": "urls"
1637 "topic": "urls"
1634 }
1638 }
1635 ]
1639 ]
1636 }
1640 }
1637
1641
1638 help/{topic} shows an individual help topic
1642 help/{topic} shows an individual help topic
1639
1643
1640 $ request json-help/phases
1644 $ request json-help/phases
1641 200 Script output follows
1645 200 Script output follows
1642
1646
1643 {
1647 {
1644 "rawdoc": "Working with Phases\n*", (glob)
1648 "rawdoc": "Working with Phases\n*", (glob)
1645 "topic": "phases"
1649 "topic": "phases"
1646 }
1650 }
General Comments 0
You need to be logged in to leave comments. Login now