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