##// END OF EJS Templates
help: assigning topic categories...
Rodrigo Damazio -
r40330:fabbf931 default
parent child Browse files
Show More
@@ -1,229 +1,230 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 """usage: %s DOC ...
2 """usage: %s DOC ...
3
3
4 where DOC is the name of a document
4 where DOC is the name of a document
5 """
5 """
6
6
7 from __future__ import absolute_import
7 from __future__ import absolute_import
8
8
9 import os
9 import os
10 import sys
10 import sys
11 import textwrap
11 import textwrap
12
12
13 # This script is executed during installs and may not have C extensions
13 # This script is executed during installs and may not have C extensions
14 # available. Relax C module requirements.
14 # available. Relax C module requirements.
15 os.environ['HGMODULEPOLICY'] = 'allow'
15 os.environ['HGMODULEPOLICY'] = 'allow'
16 # import from the live mercurial repo
16 # import from the live mercurial repo
17 sys.path.insert(0, "..")
17 sys.path.insert(0, "..")
18 from mercurial import demandimport; demandimport.enable()
18 from mercurial import demandimport; demandimport.enable()
19 # Load util so that the locale path is set by i18n.setdatapath() before
19 # Load util so that the locale path is set by i18n.setdatapath() before
20 # calling _().
20 # calling _().
21 from mercurial import util
21 from mercurial import util
22 util.datapath
22 util.datapath
23 from mercurial import (
23 from mercurial import (
24 commands,
24 commands,
25 extensions,
25 extensions,
26 help,
26 help,
27 minirst,
27 minirst,
28 ui as uimod,
28 ui as uimod,
29 )
29 )
30 from mercurial.i18n import (
30 from mercurial.i18n import (
31 gettext,
31 gettext,
32 _,
32 _,
33 )
33 )
34
34
35 table = commands.table
35 table = commands.table
36 globalopts = commands.globalopts
36 globalopts = commands.globalopts
37 helptable = help.helptable
37 helptable = help.helptable
38 loaddoc = help.loaddoc
38 loaddoc = help.loaddoc
39
39
40 def get_desc(docstr):
40 def get_desc(docstr):
41 if not docstr:
41 if not docstr:
42 return "", ""
42 return "", ""
43 # sanitize
43 # sanitize
44 docstr = docstr.strip("\n")
44 docstr = docstr.strip("\n")
45 docstr = docstr.rstrip()
45 docstr = docstr.rstrip()
46 shortdesc = docstr.splitlines()[0].strip()
46 shortdesc = docstr.splitlines()[0].strip()
47
47
48 i = docstr.find("\n")
48 i = docstr.find("\n")
49 if i != -1:
49 if i != -1:
50 desc = docstr[i + 2:]
50 desc = docstr[i + 2:]
51 else:
51 else:
52 desc = shortdesc
52 desc = shortdesc
53
53
54 desc = textwrap.dedent(desc)
54 desc = textwrap.dedent(desc)
55
55
56 return (shortdesc, desc)
56 return (shortdesc, desc)
57
57
58 def get_opts(opts):
58 def get_opts(opts):
59 for opt in opts:
59 for opt in opts:
60 if len(opt) == 5:
60 if len(opt) == 5:
61 shortopt, longopt, default, desc, optlabel = opt
61 shortopt, longopt, default, desc, optlabel = opt
62 else:
62 else:
63 shortopt, longopt, default, desc = opt
63 shortopt, longopt, default, desc = opt
64 optlabel = _("VALUE")
64 optlabel = _("VALUE")
65 allopts = []
65 allopts = []
66 if shortopt:
66 if shortopt:
67 allopts.append("-%s" % shortopt)
67 allopts.append("-%s" % shortopt)
68 if longopt:
68 if longopt:
69 allopts.append("--%s" % longopt)
69 allopts.append("--%s" % longopt)
70 if isinstance(default, list):
70 if isinstance(default, list):
71 allopts[-1] += " <%s[+]>" % optlabel
71 allopts[-1] += " <%s[+]>" % optlabel
72 elif (default is not None) and not isinstance(default, bool):
72 elif (default is not None) and not isinstance(default, bool):
73 allopts[-1] += " <%s>" % optlabel
73 allopts[-1] += " <%s>" % optlabel
74 if '\n' in desc:
74 if '\n' in desc:
75 # only remove line breaks and indentation
75 # only remove line breaks and indentation
76 desc = ' '.join(l.lstrip() for l in desc.split('\n'))
76 desc = ' '.join(l.lstrip() for l in desc.split('\n'))
77 desc += default and _(" (default: %s)") % default or ""
77 desc += default and _(" (default: %s)") % default or ""
78 yield (", ".join(allopts), desc)
78 yield (", ".join(allopts), desc)
79
79
80 def get_cmd(cmd, cmdtable):
80 def get_cmd(cmd, cmdtable):
81 d = {}
81 d = {}
82 attr = cmdtable[cmd]
82 attr = cmdtable[cmd]
83 cmds = cmd.lstrip("^").split("|")
83 cmds = cmd.lstrip("^").split("|")
84
84
85 d['cmd'] = cmds[0]
85 d['cmd'] = cmds[0]
86 d['aliases'] = cmd.split("|")[1:]
86 d['aliases'] = cmd.split("|")[1:]
87 d['desc'] = get_desc(gettext(attr[0].__doc__))
87 d['desc'] = get_desc(gettext(attr[0].__doc__))
88 d['opts'] = list(get_opts(attr[1]))
88 d['opts'] = list(get_opts(attr[1]))
89
89
90 s = 'hg ' + cmds[0]
90 s = 'hg ' + cmds[0]
91 if len(attr) > 2:
91 if len(attr) > 2:
92 if not attr[2].startswith('hg'):
92 if not attr[2].startswith('hg'):
93 s += ' ' + attr[2]
93 s += ' ' + attr[2]
94 else:
94 else:
95 s = attr[2]
95 s = attr[2]
96 d['synopsis'] = s.strip()
96 d['synopsis'] = s.strip()
97
97
98 return d
98 return d
99
99
100 def showdoc(ui):
100 def showdoc(ui):
101 # print options
101 # print options
102 ui.write(minirst.section(_("Options")))
102 ui.write(minirst.section(_("Options")))
103 multioccur = False
103 multioccur = False
104 for optstr, desc in get_opts(globalopts):
104 for optstr, desc in get_opts(globalopts):
105 ui.write("%s\n %s\n\n" % (optstr, desc))
105 ui.write("%s\n %s\n\n" % (optstr, desc))
106 if optstr.endswith("[+]>"):
106 if optstr.endswith("[+]>"):
107 multioccur = True
107 multioccur = True
108 if multioccur:
108 if multioccur:
109 ui.write(_("\n[+] marked option can be specified multiple times\n"))
109 ui.write(_("\n[+] marked option can be specified multiple times\n"))
110 ui.write("\n")
110 ui.write("\n")
111
111
112 # print cmds
112 # print cmds
113 ui.write(minirst.section(_("Commands")))
113 ui.write(minirst.section(_("Commands")))
114 commandprinter(ui, table, minirst.subsection)
114 commandprinter(ui, table, minirst.subsection)
115
115
116 # print help topics
116 # print help topics
117 # The config help topic is included in the hgrc.5 man page.
117 # The config help topic is included in the hgrc.5 man page.
118 helpprinter(ui, helptable, minirst.section, exclude=['config'])
118 helpprinter(ui, helptable, minirst.section, exclude=['config'])
119
119
120 ui.write(minirst.section(_("Extensions")))
120 ui.write(minirst.section(_("Extensions")))
121 ui.write(_("This section contains help for extensions that are "
121 ui.write(_("This section contains help for extensions that are "
122 "distributed together with Mercurial. Help for other "
122 "distributed together with Mercurial. Help for other "
123 "extensions is available in the help system."))
123 "extensions is available in the help system."))
124 ui.write(("\n\n"
124 ui.write(("\n\n"
125 ".. contents::\n"
125 ".. contents::\n"
126 " :class: htmlonly\n"
126 " :class: htmlonly\n"
127 " :local:\n"
127 " :local:\n"
128 " :depth: 1\n\n"))
128 " :depth: 1\n\n"))
129
129
130 for extensionname in sorted(allextensionnames()):
130 for extensionname in sorted(allextensionnames()):
131 mod = extensions.load(ui, extensionname, None)
131 mod = extensions.load(ui, extensionname, None)
132 ui.write(minirst.subsection(extensionname))
132 ui.write(minirst.subsection(extensionname))
133 ui.write("%s\n\n" % gettext(mod.__doc__))
133 ui.write("%s\n\n" % gettext(mod.__doc__))
134 cmdtable = getattr(mod, 'cmdtable', None)
134 cmdtable = getattr(mod, 'cmdtable', None)
135 if cmdtable:
135 if cmdtable:
136 ui.write(minirst.subsubsection(_('Commands')))
136 ui.write(minirst.subsubsection(_('Commands')))
137 commandprinter(ui, cmdtable, minirst.subsubsubsection)
137 commandprinter(ui, cmdtable, minirst.subsubsubsection)
138
138
139 def showtopic(ui, topic):
139 def showtopic(ui, topic):
140 extrahelptable = [
140 extrahelptable = [
141 (["common"], '', loaddoc('common')),
141 (["common"], '', loaddoc('common'), help.TOPIC_CATEGORY_MISC),
142 (["hg.1"], '', loaddoc('hg.1')),
142 (["hg.1"], '', loaddoc('hg.1'), help.TOPIC_CATEGORY_CONFIG),
143 (["hg-ssh.8"], '', loaddoc('hg-ssh.8')),
143 (["hg-ssh.8"], '', loaddoc('hg-ssh.8'), help.TOPIC_CATEGORY_CONFIG),
144 (["hgignore.5"], '', loaddoc('hgignore.5')),
144 (["hgignore.5"], '', loaddoc('hgignore.5'), help.TOPIC_CATEGORY_CONFIG),
145 (["hgrc.5"], '', loaddoc('hgrc.5')),
145 (["hgrc.5"], '', loaddoc('hgrc.5'), help.TOPIC_CATEGORY_CONFIG),
146 (["hgignore.5.gendoc"], '', loaddoc('hgignore')),
146 (["hgignore.5.gendoc"], '', loaddoc('hgignore'),
147 (["hgrc.5.gendoc"], '', loaddoc('config')),
147 help.TOPIC_CATEGORY_CONFIG),
148 (["hgrc.5.gendoc"], '', loaddoc('config'), help.TOPIC_CATEGORY_CONFIG),
148 ]
149 ]
149 helpprinter(ui, helptable + extrahelptable, None, include=[topic])
150 helpprinter(ui, helptable + extrahelptable, None, include=[topic])
150
151
151 def helpprinter(ui, helptable, sectionfunc, include=[], exclude=[]):
152 def helpprinter(ui, helptable, sectionfunc, include=[], exclude=[]):
152 for h in helptable:
153 for h in helptable:
153 names, sec, doc = h[0:3]
154 names, sec, doc = h[0:3]
154 if exclude and names[0] in exclude:
155 if exclude and names[0] in exclude:
155 continue
156 continue
156 if include and names[0] not in include:
157 if include and names[0] not in include:
157 continue
158 continue
158 for name in names:
159 for name in names:
159 ui.write(".. _%s:\n" % name)
160 ui.write(".. _%s:\n" % name)
160 ui.write("\n")
161 ui.write("\n")
161 if sectionfunc:
162 if sectionfunc:
162 ui.write(sectionfunc(sec))
163 ui.write(sectionfunc(sec))
163 if callable(doc):
164 if callable(doc):
164 doc = doc(ui)
165 doc = doc(ui)
165 ui.write(doc)
166 ui.write(doc)
166 ui.write("\n")
167 ui.write("\n")
167
168
168 def commandprinter(ui, cmdtable, sectionfunc):
169 def commandprinter(ui, cmdtable, sectionfunc):
169 h = {}
170 h = {}
170 for c, attr in cmdtable.items():
171 for c, attr in cmdtable.items():
171 f = c.split("|")[0]
172 f = c.split("|")[0]
172 f = f.lstrip("^")
173 f = f.lstrip("^")
173 h[f] = c
174 h[f] = c
174 cmds = h.keys()
175 cmds = h.keys()
175 cmds.sort()
176 cmds.sort()
176
177
177 for f in cmds:
178 for f in cmds:
178 if f.startswith("debug"):
179 if f.startswith("debug"):
179 continue
180 continue
180 d = get_cmd(h[f], cmdtable)
181 d = get_cmd(h[f], cmdtable)
181 ui.write(sectionfunc(d['cmd']))
182 ui.write(sectionfunc(d['cmd']))
182 # short description
183 # short description
183 ui.write(d['desc'][0])
184 ui.write(d['desc'][0])
184 # synopsis
185 # synopsis
185 ui.write("::\n\n")
186 ui.write("::\n\n")
186 synopsislines = d['synopsis'].splitlines()
187 synopsislines = d['synopsis'].splitlines()
187 for line in synopsislines:
188 for line in synopsislines:
188 # some commands (such as rebase) have a multi-line
189 # some commands (such as rebase) have a multi-line
189 # synopsis
190 # synopsis
190 ui.write(" %s\n" % line)
191 ui.write(" %s\n" % line)
191 ui.write('\n')
192 ui.write('\n')
192 # description
193 # description
193 ui.write("%s\n\n" % d['desc'][1])
194 ui.write("%s\n\n" % d['desc'][1])
194 # options
195 # options
195 opt_output = list(d['opts'])
196 opt_output = list(d['opts'])
196 if opt_output:
197 if opt_output:
197 opts_len = max([len(line[0]) for line in opt_output])
198 opts_len = max([len(line[0]) for line in opt_output])
198 ui.write(_("Options:\n\n"))
199 ui.write(_("Options:\n\n"))
199 multioccur = False
200 multioccur = False
200 for optstr, desc in opt_output:
201 for optstr, desc in opt_output:
201 if desc:
202 if desc:
202 s = "%-*s %s" % (opts_len, optstr, desc)
203 s = "%-*s %s" % (opts_len, optstr, desc)
203 else:
204 else:
204 s = optstr
205 s = optstr
205 ui.write("%s\n" % s)
206 ui.write("%s\n" % s)
206 if optstr.endswith("[+]>"):
207 if optstr.endswith("[+]>"):
207 multioccur = True
208 multioccur = True
208 if multioccur:
209 if multioccur:
209 ui.write(_("\n[+] marked option can be specified"
210 ui.write(_("\n[+] marked option can be specified"
210 " multiple times\n"))
211 " multiple times\n"))
211 ui.write("\n")
212 ui.write("\n")
212 # aliases
213 # aliases
213 if d['aliases']:
214 if d['aliases']:
214 ui.write(_(" aliases: %s\n\n") % " ".join(d['aliases']))
215 ui.write(_(" aliases: %s\n\n") % " ".join(d['aliases']))
215
216
216
217
217 def allextensionnames():
218 def allextensionnames():
218 return extensions.enabled().keys() + extensions.disabled().keys()
219 return extensions.enabled().keys() + extensions.disabled().keys()
219
220
220 if __name__ == "__main__":
221 if __name__ == "__main__":
221 doc = 'hg.1.gendoc'
222 doc = 'hg.1.gendoc'
222 if len(sys.argv) > 1:
223 if len(sys.argv) > 1:
223 doc = sys.argv[1]
224 doc = sys.argv[1]
224
225
225 ui = uimod.ui.load()
226 ui = uimod.ui.load()
226 if doc == 'hg.1.gendoc':
227 if doc == 'hg.1.gendoc':
227 showdoc(ui)
228 showdoc(ui)
228 else:
229 else:
229 showtopic(ui, sys.argv[1])
230 showtopic(ui, sys.argv[1])
@@ -1,803 +1,830 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 fancyopts,
23 fancyopts,
24 filemerge,
24 filemerge,
25 fileset,
25 fileset,
26 minirst,
26 minirst,
27 pycompat,
27 pycompat,
28 registrar,
28 registrar,
29 revset,
29 revset,
30 templatefilters,
30 templatefilters,
31 templatefuncs,
31 templatefuncs,
32 templatekw,
32 templatekw,
33 util,
33 util,
34 )
34 )
35 from .hgweb import (
35 from .hgweb import (
36 webcommands,
36 webcommands,
37 )
37 )
38
38
39 _exclkeywords = {
39 _exclkeywords = {
40 "(ADVANCED)",
40 "(ADVANCED)",
41 "(DEPRECATED)",
41 "(DEPRECATED)",
42 "(EXPERIMENTAL)",
42 "(EXPERIMENTAL)",
43 # i18n: "(ADVANCED)" is a keyword, must be translated consistently
43 # i18n: "(ADVANCED)" is a keyword, must be translated consistently
44 _("(ADVANCED)"),
44 _("(ADVANCED)"),
45 # i18n: "(DEPRECATED)" is a keyword, must be translated consistently
45 # i18n: "(DEPRECATED)" is a keyword, must be translated consistently
46 _("(DEPRECATED)"),
46 _("(DEPRECATED)"),
47 # i18n: "(EXPERIMENTAL)" is a keyword, must be translated consistently
47 # i18n: "(EXPERIMENTAL)" is a keyword, must be translated consistently
48 _("(EXPERIMENTAL)"),
48 _("(EXPERIMENTAL)"),
49 }
49 }
50
50
51 # The order in which command categories will be displayed.
51 # The order in which command categories will be displayed.
52 # Extensions with custom categories should insert them into this list
52 # Extensions with custom categories should insert them into this list
53 # after/before the appropriate item, rather than replacing the list or
53 # after/before the appropriate item, rather than replacing the list or
54 # assuming absolute positions.
54 # assuming absolute positions.
55 CATEGORY_ORDER = [
55 CATEGORY_ORDER = [
56 registrar.command.CATEGORY_REPO_CREATION,
56 registrar.command.CATEGORY_REPO_CREATION,
57 registrar.command.CATEGORY_REMOTE_REPO_MANAGEMENT,
57 registrar.command.CATEGORY_REMOTE_REPO_MANAGEMENT,
58 registrar.command.CATEGORY_COMMITTING,
58 registrar.command.CATEGORY_COMMITTING,
59 registrar.command.CATEGORY_CHANGE_MANAGEMENT,
59 registrar.command.CATEGORY_CHANGE_MANAGEMENT,
60 registrar.command.CATEGORY_CHANGE_ORGANIZATION,
60 registrar.command.CATEGORY_CHANGE_ORGANIZATION,
61 registrar.command.CATEGORY_FILE_CONTENTS,
61 registrar.command.CATEGORY_FILE_CONTENTS,
62 registrar.command.CATEGORY_CHANGE_NAVIGATION ,
62 registrar.command.CATEGORY_CHANGE_NAVIGATION ,
63 registrar.command.CATEGORY_WORKING_DIRECTORY,
63 registrar.command.CATEGORY_WORKING_DIRECTORY,
64 registrar.command.CATEGORY_IMPORT_EXPORT,
64 registrar.command.CATEGORY_IMPORT_EXPORT,
65 registrar.command.CATEGORY_MAINTENANCE,
65 registrar.command.CATEGORY_MAINTENANCE,
66 registrar.command.CATEGORY_HELP,
66 registrar.command.CATEGORY_HELP,
67 registrar.command.CATEGORY_MISC,
67 registrar.command.CATEGORY_MISC,
68 registrar.command.CATEGORY_NONE,
68 registrar.command.CATEGORY_NONE,
69 ]
69 ]
70
70
71 # Human-readable category names. These are translated.
71 # Human-readable category names. These are translated.
72 # Extensions with custom categories should add their names here.
72 # Extensions with custom categories should add their names here.
73 CATEGORY_NAMES = {
73 CATEGORY_NAMES = {
74 registrar.command.CATEGORY_REPO_CREATION: 'Repository creation',
74 registrar.command.CATEGORY_REPO_CREATION: 'Repository creation',
75 registrar.command.CATEGORY_REMOTE_REPO_MANAGEMENT:
75 registrar.command.CATEGORY_REMOTE_REPO_MANAGEMENT:
76 'Remote repository management',
76 'Remote repository management',
77 registrar.command.CATEGORY_COMMITTING: 'Change creation',
77 registrar.command.CATEGORY_COMMITTING: 'Change creation',
78 registrar.command.CATEGORY_CHANGE_NAVIGATION: 'Change navigation',
78 registrar.command.CATEGORY_CHANGE_NAVIGATION: 'Change navigation',
79 registrar.command.CATEGORY_CHANGE_MANAGEMENT: 'Change manipulation',
79 registrar.command.CATEGORY_CHANGE_MANAGEMENT: 'Change manipulation',
80 registrar.command.CATEGORY_CHANGE_ORGANIZATION: 'Change organization',
80 registrar.command.CATEGORY_CHANGE_ORGANIZATION: 'Change organization',
81 registrar.command.CATEGORY_WORKING_DIRECTORY:
81 registrar.command.CATEGORY_WORKING_DIRECTORY:
82 'Working directory management',
82 'Working directory management',
83 registrar.command.CATEGORY_FILE_CONTENTS: 'File content management',
83 registrar.command.CATEGORY_FILE_CONTENTS: 'File content management',
84 registrar.command.CATEGORY_IMPORT_EXPORT: 'Change import/export',
84 registrar.command.CATEGORY_IMPORT_EXPORT: 'Change import/export',
85 registrar.command.CATEGORY_MAINTENANCE: 'Repository maintenance',
85 registrar.command.CATEGORY_MAINTENANCE: 'Repository maintenance',
86 registrar.command.CATEGORY_HELP: 'Help',
86 registrar.command.CATEGORY_HELP: 'Help',
87 registrar.command.CATEGORY_MISC: 'Miscellaneous commands',
87 registrar.command.CATEGORY_MISC: 'Miscellaneous commands',
88 registrar.command.CATEGORY_NONE: 'Uncategorized commands',
88 registrar.command.CATEGORY_NONE: 'Uncategorized commands',
89 }
89 }
90
90
91 # Topic categories.
91 # Topic categories.
92 TOPIC_CATEGORY_IDS = 'ids'
93 TOPIC_CATEGORY_OUTPUT = 'output'
94 TOPIC_CATEGORY_CONFIG = 'config'
95 TOPIC_CATEGORY_CONCEPTS = 'concepts'
96 TOPIC_CATEGORY_MISC = 'misc'
92 TOPIC_CATEGORY_NONE = 'none'
97 TOPIC_CATEGORY_NONE = 'none'
93
98
94 # The order in which topic categories will be displayed.
99 # The order in which topic categories will be displayed.
95 # Extensions with custom categories should insert them into this list
100 # Extensions with custom categories should insert them into this list
96 # after/before the appropriate item, rather than replacing the list or
101 # after/before the appropriate item, rather than replacing the list or
97 # assuming absolute positions.
102 # assuming absolute positions.
98 TOPIC_CATEGORY_ORDER = [
103 TOPIC_CATEGORY_ORDER = [
104 TOPIC_CATEGORY_IDS,
105 TOPIC_CATEGORY_OUTPUT,
106 TOPIC_CATEGORY_CONFIG,
107 TOPIC_CATEGORY_CONCEPTS,
108 TOPIC_CATEGORY_MISC,
99 TOPIC_CATEGORY_NONE,
109 TOPIC_CATEGORY_NONE,
100 ]
110 ]
101
111
102 # Human-readable topic category names. These are translated.
112 # Human-readable topic category names. These are translated.
103 TOPIC_CATEGORY_NAMES = {
113 TOPIC_CATEGORY_NAMES = {
114 TOPIC_CATEGORY_IDS: 'Mercurial identifiers',
115 TOPIC_CATEGORY_OUTPUT: 'Mercurial output',
116 TOPIC_CATEGORY_CONFIG: 'Mercurial configuration',
117 TOPIC_CATEGORY_CONCEPTS: 'Concepts',
118 TOPIC_CATEGORY_MISC: 'Miscellaneous',
119 TOPIC_CATEGORY_NONE: 'Uncategorized topics',
104 TOPIC_CATEGORY_NONE: 'Uncategorized topics',
120 TOPIC_CATEGORY_NONE: 'Uncategorized topics',
105 }
121 }
106
122
107 def listexts(header, exts, indent=1, showdeprecated=False):
123 def listexts(header, exts, indent=1, showdeprecated=False):
108 '''return a text listing of the given extensions'''
124 '''return a text listing of the given extensions'''
109 rst = []
125 rst = []
110 if exts:
126 if exts:
111 for name, desc in sorted(exts.iteritems()):
127 for name, desc in sorted(exts.iteritems()):
112 if not showdeprecated and any(w in desc for w in _exclkeywords):
128 if not showdeprecated and any(w in desc for w in _exclkeywords):
113 continue
129 continue
114 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
130 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
115 if rst:
131 if rst:
116 rst.insert(0, '\n%s\n\n' % header)
132 rst.insert(0, '\n%s\n\n' % header)
117 return rst
133 return rst
118
134
119 def extshelp(ui):
135 def extshelp(ui):
120 rst = loaddoc('extensions')(ui).splitlines(True)
136 rst = loaddoc('extensions')(ui).splitlines(True)
121 rst.extend(listexts(
137 rst.extend(listexts(
122 _('enabled extensions:'), extensions.enabled(), showdeprecated=True))
138 _('enabled extensions:'), extensions.enabled(), showdeprecated=True))
123 rst.extend(listexts(_('disabled extensions:'), extensions.disabled(),
139 rst.extend(listexts(_('disabled extensions:'), extensions.disabled(),
124 showdeprecated=ui.verbose))
140 showdeprecated=ui.verbose))
125 doc = ''.join(rst)
141 doc = ''.join(rst)
126 return doc
142 return doc
127
143
128 def optrst(header, options, verbose):
144 def optrst(header, options, verbose):
129 data = []
145 data = []
130 multioccur = False
146 multioccur = False
131 for option in options:
147 for option in options:
132 if len(option) == 5:
148 if len(option) == 5:
133 shortopt, longopt, default, desc, optlabel = option
149 shortopt, longopt, default, desc, optlabel = option
134 else:
150 else:
135 shortopt, longopt, default, desc = option
151 shortopt, longopt, default, desc = option
136 optlabel = _("VALUE") # default label
152 optlabel = _("VALUE") # default label
137
153
138 if not verbose and any(w in desc for w in _exclkeywords):
154 if not verbose and any(w in desc for w in _exclkeywords):
139 continue
155 continue
140
156
141 so = ''
157 so = ''
142 if shortopt:
158 if shortopt:
143 so = '-' + shortopt
159 so = '-' + shortopt
144 lo = '--' + longopt
160 lo = '--' + longopt
145
161
146 if isinstance(default, fancyopts.customopt):
162 if isinstance(default, fancyopts.customopt):
147 default = default.getdefaultvalue()
163 default = default.getdefaultvalue()
148 if default and not callable(default):
164 if default and not callable(default):
149 # default is of unknown type, and in Python 2 we abused
165 # default is of unknown type, and in Python 2 we abused
150 # the %s-shows-repr property to handle integers etc. To
166 # the %s-shows-repr property to handle integers etc. To
151 # match that behavior on Python 3, we do str(default) and
167 # match that behavior on Python 3, we do str(default) and
152 # then convert it to bytes.
168 # then convert it to bytes.
153 desc += _(" (default: %s)") % pycompat.bytestr(default)
169 desc += _(" (default: %s)") % pycompat.bytestr(default)
154
170
155 if isinstance(default, list):
171 if isinstance(default, list):
156 lo += " %s [+]" % optlabel
172 lo += " %s [+]" % optlabel
157 multioccur = True
173 multioccur = True
158 elif (default is not None) and not isinstance(default, bool):
174 elif (default is not None) and not isinstance(default, bool):
159 lo += " %s" % optlabel
175 lo += " %s" % optlabel
160
176
161 data.append((so, lo, desc))
177 data.append((so, lo, desc))
162
178
163 if multioccur:
179 if multioccur:
164 header += (_(" ([+] can be repeated)"))
180 header += (_(" ([+] can be repeated)"))
165
181
166 rst = ['\n%s:\n\n' % header]
182 rst = ['\n%s:\n\n' % header]
167 rst.extend(minirst.maketable(data, 1))
183 rst.extend(minirst.maketable(data, 1))
168
184
169 return ''.join(rst)
185 return ''.join(rst)
170
186
171 def indicateomitted(rst, omitted, notomitted=None):
187 def indicateomitted(rst, omitted, notomitted=None):
172 rst.append('\n\n.. container:: omitted\n\n %s\n\n' % omitted)
188 rst.append('\n\n.. container:: omitted\n\n %s\n\n' % omitted)
173 if notomitted:
189 if notomitted:
174 rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted)
190 rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted)
175
191
176 def filtercmd(ui, cmd, kw, doc):
192 def filtercmd(ui, cmd, kw, doc):
177 if not ui.debugflag and cmd.startswith("debug") and kw != "debug":
193 if not ui.debugflag and cmd.startswith("debug") and kw != "debug":
178 return True
194 return True
179 if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
195 if not ui.verbose and doc and any(w in doc for w in _exclkeywords):
180 return True
196 return True
181 return False
197 return False
182
198
183 def topicmatch(ui, commands, kw):
199 def topicmatch(ui, commands, kw):
184 """Return help topics matching kw.
200 """Return help topics matching kw.
185
201
186 Returns {'section': [(name, summary), ...], ...} where section is
202 Returns {'section': [(name, summary), ...], ...} where section is
187 one of topics, commands, extensions, or extensioncommands.
203 one of topics, commands, extensions, or extensioncommands.
188 """
204 """
189 kw = encoding.lower(kw)
205 kw = encoding.lower(kw)
190 def lowercontains(container):
206 def lowercontains(container):
191 return kw in encoding.lower(container) # translated in helptable
207 return kw in encoding.lower(container) # translated in helptable
192 results = {'topics': [],
208 results = {'topics': [],
193 'commands': [],
209 'commands': [],
194 'extensions': [],
210 'extensions': [],
195 'extensioncommands': [],
211 'extensioncommands': [],
196 }
212 }
197 for topic in helptable:
213 for topic in helptable:
198 names, header, doc = topic[0:3]
214 names, header, doc = topic[0:3]
199 # Old extensions may use a str as doc.
215 # Old extensions may use a str as doc.
200 if (sum(map(lowercontains, names))
216 if (sum(map(lowercontains, names))
201 or lowercontains(header)
217 or lowercontains(header)
202 or (callable(doc) and lowercontains(doc(ui)))):
218 or (callable(doc) and lowercontains(doc(ui)))):
203 results['topics'].append((names[0], header))
219 results['topics'].append((names[0], header))
204 for cmd, entry in commands.table.iteritems():
220 for cmd, entry in commands.table.iteritems():
205 if len(entry) == 3:
221 if len(entry) == 3:
206 summary = entry[2]
222 summary = entry[2]
207 else:
223 else:
208 summary = ''
224 summary = ''
209 # translate docs *before* searching there
225 # translate docs *before* searching there
210 docs = _(pycompat.getdoc(entry[0])) or ''
226 docs = _(pycompat.getdoc(entry[0])) or ''
211 if kw in cmd or lowercontains(summary) or lowercontains(docs):
227 if kw in cmd or lowercontains(summary) or lowercontains(docs):
212 doclines = docs.splitlines()
228 doclines = docs.splitlines()
213 if doclines:
229 if doclines:
214 summary = doclines[0]
230 summary = doclines[0]
215 cmdname = cmdutil.parsealiases(cmd)[0]
231 cmdname = cmdutil.parsealiases(cmd)[0]
216 if filtercmd(ui, cmdname, kw, docs):
232 if filtercmd(ui, cmdname, kw, docs):
217 continue
233 continue
218 results['commands'].append((cmdname, summary))
234 results['commands'].append((cmdname, summary))
219 for name, docs in itertools.chain(
235 for name, docs in itertools.chain(
220 extensions.enabled(False).iteritems(),
236 extensions.enabled(False).iteritems(),
221 extensions.disabled().iteritems()):
237 extensions.disabled().iteritems()):
222 if not docs:
238 if not docs:
223 continue
239 continue
224 name = name.rpartition('.')[-1]
240 name = name.rpartition('.')[-1]
225 if lowercontains(name) or lowercontains(docs):
241 if lowercontains(name) or lowercontains(docs):
226 # extension docs are already translated
242 # extension docs are already translated
227 results['extensions'].append((name, docs.splitlines()[0]))
243 results['extensions'].append((name, docs.splitlines()[0]))
228 try:
244 try:
229 mod = extensions.load(ui, name, '')
245 mod = extensions.load(ui, name, '')
230 except ImportError:
246 except ImportError:
231 # debug message would be printed in extensions.load()
247 # debug message would be printed in extensions.load()
232 continue
248 continue
233 for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems():
249 for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems():
234 if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])):
250 if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])):
235 cmdname = cmdutil.parsealiases(cmd)[0]
251 cmdname = cmdutil.parsealiases(cmd)[0]
236 cmddoc = pycompat.getdoc(entry[0])
252 cmddoc = pycompat.getdoc(entry[0])
237 if cmddoc:
253 if cmddoc:
238 cmddoc = gettext(cmddoc).splitlines()[0]
254 cmddoc = gettext(cmddoc).splitlines()[0]
239 else:
255 else:
240 cmddoc = _('(no help text available)')
256 cmddoc = _('(no help text available)')
241 if filtercmd(ui, cmdname, kw, cmddoc):
257 if filtercmd(ui, cmdname, kw, cmddoc):
242 continue
258 continue
243 results['extensioncommands'].append((cmdname, cmddoc))
259 results['extensioncommands'].append((cmdname, cmddoc))
244 return results
260 return results
245
261
246 def loaddoc(topic, subdir=None):
262 def loaddoc(topic, subdir=None):
247 """Return a delayed loader for help/topic.txt."""
263 """Return a delayed loader for help/topic.txt."""
248
264
249 def loader(ui):
265 def loader(ui):
250 docdir = os.path.join(util.datapath, 'help')
266 docdir = os.path.join(util.datapath, 'help')
251 if subdir:
267 if subdir:
252 docdir = os.path.join(docdir, subdir)
268 docdir = os.path.join(docdir, subdir)
253 path = os.path.join(docdir, topic + ".txt")
269 path = os.path.join(docdir, topic + ".txt")
254 doc = gettext(util.readfile(path))
270 doc = gettext(util.readfile(path))
255 for rewriter in helphooks.get(topic, []):
271 for rewriter in helphooks.get(topic, []):
256 doc = rewriter(ui, topic, doc)
272 doc = rewriter(ui, topic, doc)
257 return doc
273 return doc
258
274
259 return loader
275 return loader
260
276
261 internalstable = sorted([
277 internalstable = sorted([
262 (['bundle2'], _('Bundle2'),
278 (['bundle2'], _('Bundle2'),
263 loaddoc('bundle2', subdir='internals')),
279 loaddoc('bundle2', subdir='internals')),
264 (['bundles'], _('Bundles'),
280 (['bundles'], _('Bundles'),
265 loaddoc('bundles', subdir='internals')),
281 loaddoc('bundles', subdir='internals')),
266 (['cbor'], _('CBOR'),
282 (['cbor'], _('CBOR'),
267 loaddoc('cbor', subdir='internals')),
283 loaddoc('cbor', subdir='internals')),
268 (['censor'], _('Censor'),
284 (['censor'], _('Censor'),
269 loaddoc('censor', subdir='internals')),
285 loaddoc('censor', subdir='internals')),
270 (['changegroups'], _('Changegroups'),
286 (['changegroups'], _('Changegroups'),
271 loaddoc('changegroups', subdir='internals')),
287 loaddoc('changegroups', subdir='internals')),
272 (['config'], _('Config Registrar'),
288 (['config'], _('Config Registrar'),
273 loaddoc('config', subdir='internals')),
289 loaddoc('config', subdir='internals')),
274 (['requirements'], _('Repository Requirements'),
290 (['requirements'], _('Repository Requirements'),
275 loaddoc('requirements', subdir='internals')),
291 loaddoc('requirements', subdir='internals')),
276 (['revlogs'], _('Revision Logs'),
292 (['revlogs'], _('Revision Logs'),
277 loaddoc('revlogs', subdir='internals')),
293 loaddoc('revlogs', subdir='internals')),
278 (['wireprotocol'], _('Wire Protocol'),
294 (['wireprotocol'], _('Wire Protocol'),
279 loaddoc('wireprotocol', subdir='internals')),
295 loaddoc('wireprotocol', subdir='internals')),
280 (['wireprotocolrpc'], _('Wire Protocol RPC'),
296 (['wireprotocolrpc'], _('Wire Protocol RPC'),
281 loaddoc('wireprotocolrpc', subdir='internals')),
297 loaddoc('wireprotocolrpc', subdir='internals')),
282 (['wireprotocolv2'], _('Wire Protocol Version 2'),
298 (['wireprotocolv2'], _('Wire Protocol Version 2'),
283 loaddoc('wireprotocolv2', subdir='internals')),
299 loaddoc('wireprotocolv2', subdir='internals')),
284 ])
300 ])
285
301
286 def internalshelp(ui):
302 def internalshelp(ui):
287 """Generate the index for the "internals" topic."""
303 """Generate the index for the "internals" topic."""
288 lines = ['To access a subtopic, use "hg help internals.{subtopic-name}"\n',
304 lines = ['To access a subtopic, use "hg help internals.{subtopic-name}"\n',
289 '\n']
305 '\n']
290 for names, header, doc in internalstable:
306 for names, header, doc in internalstable:
291 lines.append(' :%s: %s\n' % (names[0], header))
307 lines.append(' :%s: %s\n' % (names[0], header))
292
308
293 return ''.join(lines)
309 return ''.join(lines)
294
310
295 helptable = sorted([
311 helptable = sorted([
296 (['bundlespec'], _("Bundle File Formats"), loaddoc('bundlespec')),
312 (['bundlespec'], _("Bundle File Formats"), loaddoc('bundlespec'),
297 (['color'], _("Colorizing Outputs"), loaddoc('color')),
313 TOPIC_CATEGORY_CONCEPTS),
298 (["config", "hgrc"], _("Configuration Files"), loaddoc('config')),
314 (['color'], _("Colorizing Outputs"), loaddoc('color'),
299 (['deprecated'], _("Deprecated Features"), loaddoc('deprecated')),
315 TOPIC_CATEGORY_OUTPUT),
300 (["dates"], _("Date Formats"), loaddoc('dates')),
316 (["config", "hgrc"], _("Configuration Files"), loaddoc('config'),
301 (["flags"], _("Command-line flags"), loaddoc('flags')),
317 TOPIC_CATEGORY_CONFIG),
302 (["patterns"], _("File Name Patterns"), loaddoc('patterns')),
318 (['deprecated'], _("Deprecated Features"), loaddoc('deprecated'),
319 TOPIC_CATEGORY_MISC),
320 (["dates"], _("Date Formats"), loaddoc('dates'), TOPIC_CATEGORY_OUTPUT),
321 (["flags"], _("Command-line flags"), loaddoc('flags'),
322 TOPIC_CATEGORY_CONFIG),
323 (["patterns"], _("File Name Patterns"), loaddoc('patterns'),
324 TOPIC_CATEGORY_IDS),
303 (['environment', 'env'], _('Environment Variables'),
325 (['environment', 'env'], _('Environment Variables'),
304 loaddoc('environment')),
326 loaddoc('environment'), TOPIC_CATEGORY_CONFIG),
305 (['revisions', 'revs', 'revsets', 'revset', 'multirevs', 'mrevs'],
327 (['revisions', 'revs', 'revsets', 'revset', 'multirevs', 'mrevs'],
306 _('Specifying Revisions'), loaddoc('revisions')),
328 _('Specifying Revisions'), loaddoc('revisions'), TOPIC_CATEGORY_IDS),
307 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets')),
329 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets'),
308 (['diffs'], _('Diff Formats'), loaddoc('diffs')),
330 TOPIC_CATEGORY_IDS),
331 (['diffs'], _('Diff Formats'), loaddoc('diffs'), TOPIC_CATEGORY_OUTPUT),
309 (['merge-tools', 'mergetools', 'mergetool'], _('Merge Tools'),
332 (['merge-tools', 'mergetools', 'mergetool'], _('Merge Tools'),
310 loaddoc('merge-tools')),
333 loaddoc('merge-tools'), TOPIC_CATEGORY_CONFIG),
311 (['templating', 'templates', 'template', 'style'], _('Template Usage'),
334 (['templating', 'templates', 'template', 'style'], _('Template Usage'),
312 loaddoc('templates')),
335 loaddoc('templates'), TOPIC_CATEGORY_OUTPUT),
313 (['urls'], _('URL Paths'), loaddoc('urls')),
336 (['urls'], _('URL Paths'), loaddoc('urls'), TOPIC_CATEGORY_IDS),
314 (["extensions"], _("Using Additional Features"), extshelp),
337 (["extensions"], _("Using Additional Features"), extshelp,
315 (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos')),
338 TOPIC_CATEGORY_CONFIG),
316 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')),
339 (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos'),
317 (["glossary"], _("Glossary"), loaddoc('glossary')),
340 TOPIC_CATEGORY_CONCEPTS),
341 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb'),
342 TOPIC_CATEGORY_CONFIG),
343 (["glossary"], _("Glossary"), loaddoc('glossary'), TOPIC_CATEGORY_CONCEPTS),
318 (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"),
344 (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"),
319 loaddoc('hgignore')),
345 loaddoc('hgignore'), TOPIC_CATEGORY_IDS),
320 (["phases"], _("Working with Phases"), loaddoc('phases')),
346 (["phases"], _("Working with Phases"), loaddoc('phases'),
347 TOPIC_CATEGORY_CONCEPTS),
321 (['scripting'], _('Using Mercurial from scripts and automation'),
348 (['scripting'], _('Using Mercurial from scripts and automation'),
322 loaddoc('scripting')),
349 loaddoc('scripting'), TOPIC_CATEGORY_MISC),
323 (['internals'], _("Technical implementation topics"),
350 (['internals'], _("Technical implementation topics"), internalshelp,
324 internalshelp),
351 TOPIC_CATEGORY_MISC),
325 (['pager'], _("Pager Support"), loaddoc('pager')),
352 (['pager'], _("Pager Support"), loaddoc('pager'), TOPIC_CATEGORY_CONFIG),
326 ])
353 ])
327
354
328 # Maps topics with sub-topics to a list of their sub-topics.
355 # Maps topics with sub-topics to a list of their sub-topics.
329 subtopics = {
356 subtopics = {
330 'internals': internalstable,
357 'internals': internalstable,
331 }
358 }
332
359
333 # Map topics to lists of callable taking the current topic help and
360 # Map topics to lists of callable taking the current topic help and
334 # returning the updated version
361 # returning the updated version
335 helphooks = {}
362 helphooks = {}
336
363
337 def addtopichook(topic, rewriter):
364 def addtopichook(topic, rewriter):
338 helphooks.setdefault(topic, []).append(rewriter)
365 helphooks.setdefault(topic, []).append(rewriter)
339
366
340 def makeitemsdoc(ui, topic, doc, marker, items, dedent=False):
367 def makeitemsdoc(ui, topic, doc, marker, items, dedent=False):
341 """Extract docstring from the items key to function mapping, build a
368 """Extract docstring from the items key to function mapping, build a
342 single documentation block and use it to overwrite the marker in doc.
369 single documentation block and use it to overwrite the marker in doc.
343 """
370 """
344 entries = []
371 entries = []
345 for name in sorted(items):
372 for name in sorted(items):
346 text = (pycompat.getdoc(items[name]) or '').rstrip()
373 text = (pycompat.getdoc(items[name]) or '').rstrip()
347 if (not text
374 if (not text
348 or not ui.verbose and any(w in text for w in _exclkeywords)):
375 or not ui.verbose and any(w in text for w in _exclkeywords)):
349 continue
376 continue
350 text = gettext(text)
377 text = gettext(text)
351 if dedent:
378 if dedent:
352 # Abuse latin1 to use textwrap.dedent() on bytes.
379 # Abuse latin1 to use textwrap.dedent() on bytes.
353 text = textwrap.dedent(text.decode('latin1')).encode('latin1')
380 text = textwrap.dedent(text.decode('latin1')).encode('latin1')
354 lines = text.splitlines()
381 lines = text.splitlines()
355 doclines = [(lines[0])]
382 doclines = [(lines[0])]
356 for l in lines[1:]:
383 for l in lines[1:]:
357 # Stop once we find some Python doctest
384 # Stop once we find some Python doctest
358 if l.strip().startswith('>>>'):
385 if l.strip().startswith('>>>'):
359 break
386 break
360 if dedent:
387 if dedent:
361 doclines.append(l.rstrip())
388 doclines.append(l.rstrip())
362 else:
389 else:
363 doclines.append(' ' + l.strip())
390 doclines.append(' ' + l.strip())
364 entries.append('\n'.join(doclines))
391 entries.append('\n'.join(doclines))
365 entries = '\n\n'.join(entries)
392 entries = '\n\n'.join(entries)
366 return doc.replace(marker, entries)
393 return doc.replace(marker, entries)
367
394
368 def addtopicsymbols(topic, marker, symbols, dedent=False):
395 def addtopicsymbols(topic, marker, symbols, dedent=False):
369 def add(ui, topic, doc):
396 def add(ui, topic, doc):
370 return makeitemsdoc(ui, topic, doc, marker, symbols, dedent=dedent)
397 return makeitemsdoc(ui, topic, doc, marker, symbols, dedent=dedent)
371 addtopichook(topic, add)
398 addtopichook(topic, add)
372
399
373 addtopicsymbols('bundlespec', '.. bundlecompressionmarker',
400 addtopicsymbols('bundlespec', '.. bundlecompressionmarker',
374 util.bundlecompressiontopics())
401 util.bundlecompressiontopics())
375 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
402 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
376 addtopicsymbols('merge-tools', '.. internaltoolsmarker',
403 addtopicsymbols('merge-tools', '.. internaltoolsmarker',
377 filemerge.internalsdoc)
404 filemerge.internalsdoc)
378 addtopicsymbols('revisions', '.. predicatesmarker', revset.symbols)
405 addtopicsymbols('revisions', '.. predicatesmarker', revset.symbols)
379 addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords)
406 addtopicsymbols('templates', '.. keywordsmarker', templatekw.keywords)
380 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
407 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
381 addtopicsymbols('templates', '.. functionsmarker', templatefuncs.funcs)
408 addtopicsymbols('templates', '.. functionsmarker', templatefuncs.funcs)
382 addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands,
409 addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands,
383 dedent=True)
410 dedent=True)
384
411
385 def help_(ui, commands, name, unknowncmd=False, full=True, subtopic=None,
412 def help_(ui, commands, name, unknowncmd=False, full=True, subtopic=None,
386 **opts):
413 **opts):
387 '''
414 '''
388 Generate the help for 'name' as unformatted restructured text. If
415 Generate the help for 'name' as unformatted restructured text. If
389 'name' is None, describe the commands available.
416 'name' is None, describe the commands available.
390 '''
417 '''
391
418
392 opts = pycompat.byteskwargs(opts)
419 opts = pycompat.byteskwargs(opts)
393
420
394 def helpcmd(name, subtopic=None):
421 def helpcmd(name, subtopic=None):
395 try:
422 try:
396 aliases, entry = cmdutil.findcmd(name, commands.table,
423 aliases, entry = cmdutil.findcmd(name, commands.table,
397 strict=unknowncmd)
424 strict=unknowncmd)
398 except error.AmbiguousCommand as inst:
425 except error.AmbiguousCommand as inst:
399 # py3 fix: except vars can't be used outside the scope of the
426 # py3 fix: except vars can't be used outside the scope of the
400 # except block, nor can be used inside a lambda. python issue4617
427 # except block, nor can be used inside a lambda. python issue4617
401 prefix = inst.args[0]
428 prefix = inst.args[0]
402 select = lambda c: cmdutil.parsealiases(c)[0].startswith(prefix)
429 select = lambda c: cmdutil.parsealiases(c)[0].startswith(prefix)
403 rst = helplist(select)
430 rst = helplist(select)
404 return rst
431 return rst
405
432
406 rst = []
433 rst = []
407
434
408 # check if it's an invalid alias and display its error if it is
435 # check if it's an invalid alias and display its error if it is
409 if getattr(entry[0], 'badalias', None):
436 if getattr(entry[0], 'badalias', None):
410 rst.append(entry[0].badalias + '\n')
437 rst.append(entry[0].badalias + '\n')
411 if entry[0].unknowncmd:
438 if entry[0].unknowncmd:
412 try:
439 try:
413 rst.extend(helpextcmd(entry[0].cmdname))
440 rst.extend(helpextcmd(entry[0].cmdname))
414 except error.UnknownCommand:
441 except error.UnknownCommand:
415 pass
442 pass
416 return rst
443 return rst
417
444
418 # synopsis
445 # synopsis
419 if len(entry) > 2:
446 if len(entry) > 2:
420 if entry[2].startswith('hg'):
447 if entry[2].startswith('hg'):
421 rst.append("%s\n" % entry[2])
448 rst.append("%s\n" % entry[2])
422 else:
449 else:
423 rst.append('hg %s %s\n' % (aliases[0], entry[2]))
450 rst.append('hg %s %s\n' % (aliases[0], entry[2]))
424 else:
451 else:
425 rst.append('hg %s\n' % aliases[0])
452 rst.append('hg %s\n' % aliases[0])
426 # aliases
453 # aliases
427 if full and not ui.quiet and len(aliases) > 1:
454 if full and not ui.quiet and len(aliases) > 1:
428 rst.append(_("\naliases: %s\n") % ', '.join(aliases[1:]))
455 rst.append(_("\naliases: %s\n") % ', '.join(aliases[1:]))
429 rst.append('\n')
456 rst.append('\n')
430
457
431 # description
458 # description
432 doc = gettext(pycompat.getdoc(entry[0]))
459 doc = gettext(pycompat.getdoc(entry[0]))
433 if not doc:
460 if not doc:
434 doc = _("(no help text available)")
461 doc = _("(no help text available)")
435 if util.safehasattr(entry[0], 'definition'): # aliased command
462 if util.safehasattr(entry[0], 'definition'): # aliased command
436 source = entry[0].source
463 source = entry[0].source
437 if entry[0].definition.startswith('!'): # shell alias
464 if entry[0].definition.startswith('!'): # shell alias
438 doc = (_('shell alias for: %s\n\n%s\n\ndefined by: %s\n') %
465 doc = (_('shell alias for: %s\n\n%s\n\ndefined by: %s\n') %
439 (entry[0].definition[1:], doc, source))
466 (entry[0].definition[1:], doc, source))
440 else:
467 else:
441 doc = (_('alias for: hg %s\n\n%s\n\ndefined by: %s\n') %
468 doc = (_('alias for: hg %s\n\n%s\n\ndefined by: %s\n') %
442 (entry[0].definition, doc, source))
469 (entry[0].definition, doc, source))
443 doc = doc.splitlines(True)
470 doc = doc.splitlines(True)
444 if ui.quiet or not full:
471 if ui.quiet or not full:
445 rst.append(doc[0])
472 rst.append(doc[0])
446 else:
473 else:
447 rst.extend(doc)
474 rst.extend(doc)
448 rst.append('\n')
475 rst.append('\n')
449
476
450 # check if this command shadows a non-trivial (multi-line)
477 # check if this command shadows a non-trivial (multi-line)
451 # extension help text
478 # extension help text
452 try:
479 try:
453 mod = extensions.find(name)
480 mod = extensions.find(name)
454 doc = gettext(pycompat.getdoc(mod)) or ''
481 doc = gettext(pycompat.getdoc(mod)) or ''
455 if '\n' in doc.strip():
482 if '\n' in doc.strip():
456 msg = _("(use 'hg help -e %s' to show help for "
483 msg = _("(use 'hg help -e %s' to show help for "
457 "the %s extension)") % (name, name)
484 "the %s extension)") % (name, name)
458 rst.append('\n%s\n' % msg)
485 rst.append('\n%s\n' % msg)
459 except KeyError:
486 except KeyError:
460 pass
487 pass
461
488
462 # options
489 # options
463 if not ui.quiet and entry[1]:
490 if not ui.quiet and entry[1]:
464 rst.append(optrst(_("options"), entry[1], ui.verbose))
491 rst.append(optrst(_("options"), entry[1], ui.verbose))
465
492
466 if ui.verbose:
493 if ui.verbose:
467 rst.append(optrst(_("global options"),
494 rst.append(optrst(_("global options"),
468 commands.globalopts, ui.verbose))
495 commands.globalopts, ui.verbose))
469
496
470 if not ui.verbose:
497 if not ui.verbose:
471 if not full:
498 if not full:
472 rst.append(_("\n(use 'hg %s -h' to show more help)\n")
499 rst.append(_("\n(use 'hg %s -h' to show more help)\n")
473 % name)
500 % name)
474 elif not ui.quiet:
501 elif not ui.quiet:
475 rst.append(_('\n(some details hidden, use --verbose '
502 rst.append(_('\n(some details hidden, use --verbose '
476 'to show complete help)'))
503 'to show complete help)'))
477
504
478 return rst
505 return rst
479
506
480 def helplist(select=None, **opts):
507 def helplist(select=None, **opts):
481 # Category -> list of commands
508 # Category -> list of commands
482 cats = {}
509 cats = {}
483 # Command -> short description
510 # Command -> short description
484 h = {}
511 h = {}
485 # Command -> string showing synonyms
512 # Command -> string showing synonyms
486 syns = {}
513 syns = {}
487 for c, e in commands.table.iteritems():
514 for c, e in commands.table.iteritems():
488 fs = cmdutil.parsealiases(c)
515 fs = cmdutil.parsealiases(c)
489 f = fs[0]
516 f = fs[0]
490 syns[f] = ', '.join(fs)
517 syns[f] = ', '.join(fs)
491 func = e[0]
518 func = e[0]
492 p = ''
519 p = ''
493 if c.startswith("^"):
520 if c.startswith("^"):
494 p = '^'
521 p = '^'
495 if select and not select(p + f):
522 if select and not select(p + f):
496 continue
523 continue
497 if (not select and name != 'shortlist' and
524 if (not select and name != 'shortlist' and
498 func.__module__ != commands.__name__):
525 func.__module__ != commands.__name__):
499 continue
526 continue
500 if name == "shortlist" and not p:
527 if name == "shortlist" and not p:
501 continue
528 continue
502 doc = pycompat.getdoc(func)
529 doc = pycompat.getdoc(func)
503 if filtercmd(ui, f, name, doc):
530 if filtercmd(ui, f, name, doc):
504 continue
531 continue
505 doc = gettext(doc)
532 doc = gettext(doc)
506 if not doc:
533 if not doc:
507 doc = _("(no help text available)")
534 doc = _("(no help text available)")
508 h[f] = doc.splitlines()[0].rstrip()
535 h[f] = doc.splitlines()[0].rstrip()
509
536
510 cat = getattr(func, 'helpcategory', None) or (
537 cat = getattr(func, 'helpcategory', None) or (
511 registrar.command.CATEGORY_NONE)
538 registrar.command.CATEGORY_NONE)
512 cats.setdefault(cat, []).append(f)
539 cats.setdefault(cat, []).append(f)
513
540
514 rst = []
541 rst = []
515 if not h:
542 if not h:
516 if not ui.quiet:
543 if not ui.quiet:
517 rst.append(_('no commands defined\n'))
544 rst.append(_('no commands defined\n'))
518 return rst
545 return rst
519
546
520 # Output top header.
547 # Output top header.
521 if not ui.quiet:
548 if not ui.quiet:
522 if name == "shortlist":
549 if name == "shortlist":
523 rst.append(_('basic commands:\n\n'))
550 rst.append(_('basic commands:\n\n'))
524 elif name == "debug":
551 elif name == "debug":
525 rst.append(_('debug commands (internal and unsupported):\n\n'))
552 rst.append(_('debug commands (internal and unsupported):\n\n'))
526 else:
553 else:
527 rst.append(_('list of commands:\n'))
554 rst.append(_('list of commands:\n'))
528
555
529 def appendcmds(cmds):
556 def appendcmds(cmds):
530 cmds = sorted(cmds)
557 cmds = sorted(cmds)
531 for c in cmds:
558 for c in cmds:
532 if ui.verbose:
559 if ui.verbose:
533 rst.append(" :%s: %s\n" % (syns[c], h[c]))
560 rst.append(" :%s: %s\n" % (syns[c], h[c]))
534 else:
561 else:
535 rst.append(' :%s: %s\n' % (c, h[c]))
562 rst.append(' :%s: %s\n' % (c, h[c]))
536
563
537 if name in ('shortlist', 'debug'):
564 if name in ('shortlist', 'debug'):
538 # List without categories.
565 # List without categories.
539 appendcmds(h)
566 appendcmds(h)
540 else:
567 else:
541 # Check that all categories have an order.
568 # Check that all categories have an order.
542 missing_order = set(cats.keys()) - set(CATEGORY_ORDER)
569 missing_order = set(cats.keys()) - set(CATEGORY_ORDER)
543 if missing_order:
570 if missing_order:
544 ui.develwarn('help categories missing from CATEGORY_ORDER: %s' %
571 ui.develwarn('help categories missing from CATEGORY_ORDER: %s' %
545 missing_order)
572 missing_order)
546
573
547 # List per category.
574 # List per category.
548 for cat in CATEGORY_ORDER:
575 for cat in CATEGORY_ORDER:
549 catfns = cats.get(cat, [])
576 catfns = cats.get(cat, [])
550 if catfns:
577 if catfns:
551 if len(cats) > 1:
578 if len(cats) > 1:
552 catname = gettext(CATEGORY_NAMES[cat])
579 catname = gettext(CATEGORY_NAMES[cat])
553 rst.append("\n%s:\n" % catname)
580 rst.append("\n%s:\n" % catname)
554 rst.append("\n")
581 rst.append("\n")
555 appendcmds(catfns)
582 appendcmds(catfns)
556
583
557 ex = opts.get
584 ex = opts.get
558 anyopts = (ex(r'keyword') or not (ex(r'command') or ex(r'extension')))
585 anyopts = (ex(r'keyword') or not (ex(r'command') or ex(r'extension')))
559 if not name and anyopts:
586 if not name and anyopts:
560 exts = listexts(_('enabled extensions:'), extensions.enabled())
587 exts = listexts(_('enabled extensions:'), extensions.enabled())
561 if exts:
588 if exts:
562 rst.append('\n')
589 rst.append('\n')
563 rst.extend(exts)
590 rst.extend(exts)
564
591
565 rst.append(_("\nadditional help topics:\n"))
592 rst.append(_("\nadditional help topics:\n"))
566 # Group commands by category.
593 # Group commands by category.
567 topiccats = {}
594 topiccats = {}
568 for topic in helptable:
595 for topic in helptable:
569 names, header, doc = topic[0:3]
596 names, header, doc = topic[0:3]
570 if len(topic) > 3 and topic[3]:
597 if len(topic) > 3 and topic[3]:
571 category = topic[3]
598 category = topic[3]
572 else:
599 else:
573 category = TOPIC_CATEGORY_NONE
600 category = TOPIC_CATEGORY_NONE
574
601
575 topiccats.setdefault(category, []).append((names[0], header))
602 topiccats.setdefault(category, []).append((names[0], header))
576
603
577 # Check that all categories have an order.
604 # Check that all categories have an order.
578 missing_order = set(topiccats.keys()) - set(TOPIC_CATEGORY_ORDER)
605 missing_order = set(topiccats.keys()) - set(TOPIC_CATEGORY_ORDER)
579 if missing_order:
606 if missing_order:
580 ui.develwarn(
607 ui.develwarn(
581 'help categories missing from TOPIC_CATEGORY_ORDER: %s' %
608 'help categories missing from TOPIC_CATEGORY_ORDER: %s' %
582 missing_order)
609 missing_order)
583
610
584 # Output topics per category.
611 # Output topics per category.
585 for cat in TOPIC_CATEGORY_ORDER:
612 for cat in TOPIC_CATEGORY_ORDER:
586 topics = topiccats.get(cat, [])
613 topics = topiccats.get(cat, [])
587 if topics:
614 if topics:
588 if len(topiccats) > 1:
615 if len(topiccats) > 1:
589 catname = gettext(TOPIC_CATEGORY_NAMES[cat])
616 catname = gettext(TOPIC_CATEGORY_NAMES[cat])
590 rst.append("\n%s:\n" % catname)
617 rst.append("\n%s:\n" % catname)
591 rst.append("\n")
618 rst.append("\n")
592 for t, desc in topics:
619 for t, desc in topics:
593 rst.append(" :%s: %s\n" % (t, desc))
620 rst.append(" :%s: %s\n" % (t, desc))
594
621
595 if ui.quiet:
622 if ui.quiet:
596 pass
623 pass
597 elif ui.verbose:
624 elif ui.verbose:
598 rst.append('\n%s\n' % optrst(_("global options"),
625 rst.append('\n%s\n' % optrst(_("global options"),
599 commands.globalopts, ui.verbose))
626 commands.globalopts, ui.verbose))
600 if name == 'shortlist':
627 if name == 'shortlist':
601 rst.append(_("\n(use 'hg help' for the full list "
628 rst.append(_("\n(use 'hg help' for the full list "
602 "of commands)\n"))
629 "of commands)\n"))
603 else:
630 else:
604 if name == 'shortlist':
631 if name == 'shortlist':
605 rst.append(_("\n(use 'hg help' for the full list of commands "
632 rst.append(_("\n(use 'hg help' for the full list of commands "
606 "or 'hg -v' for details)\n"))
633 "or 'hg -v' for details)\n"))
607 elif name and not full:
634 elif name and not full:
608 rst.append(_("\n(use 'hg help %s' to show the full help "
635 rst.append(_("\n(use 'hg help %s' to show the full help "
609 "text)\n") % name)
636 "text)\n") % name)
610 elif name and syns and name in syns.keys():
637 elif name and syns and name in syns.keys():
611 rst.append(_("\n(use 'hg help -v -e %s' to show built-in "
638 rst.append(_("\n(use 'hg help -v -e %s' to show built-in "
612 "aliases and global options)\n") % name)
639 "aliases and global options)\n") % name)
613 else:
640 else:
614 rst.append(_("\n(use 'hg help -v%s' to show built-in aliases "
641 rst.append(_("\n(use 'hg help -v%s' to show built-in aliases "
615 "and global options)\n")
642 "and global options)\n")
616 % (name and " " + name or ""))
643 % (name and " " + name or ""))
617 return rst
644 return rst
618
645
619 def helptopic(name, subtopic=None):
646 def helptopic(name, subtopic=None):
620 # Look for sub-topic entry first.
647 # Look for sub-topic entry first.
621 header, doc = None, None
648 header, doc = None, None
622 if subtopic and name in subtopics:
649 if subtopic and name in subtopics:
623 for names, header, doc in subtopics[name]:
650 for names, header, doc in subtopics[name]:
624 if subtopic in names:
651 if subtopic in names:
625 break
652 break
626
653
627 if not header:
654 if not header:
628 for topic in helptable:
655 for topic in helptable:
629 names, header, doc = topic[0:3]
656 names, header, doc = topic[0:3]
630 if name in names:
657 if name in names:
631 break
658 break
632 else:
659 else:
633 raise error.UnknownCommand(name)
660 raise error.UnknownCommand(name)
634
661
635 rst = [minirst.section(header)]
662 rst = [minirst.section(header)]
636
663
637 # description
664 # description
638 if not doc:
665 if not doc:
639 rst.append(" %s\n" % _("(no help text available)"))
666 rst.append(" %s\n" % _("(no help text available)"))
640 if callable(doc):
667 if callable(doc):
641 rst += [" %s\n" % l for l in doc(ui).splitlines()]
668 rst += [" %s\n" % l for l in doc(ui).splitlines()]
642
669
643 if not ui.verbose:
670 if not ui.verbose:
644 omitted = _('(some details hidden, use --verbose'
671 omitted = _('(some details hidden, use --verbose'
645 ' to show complete help)')
672 ' to show complete help)')
646 indicateomitted(rst, omitted)
673 indicateomitted(rst, omitted)
647
674
648 try:
675 try:
649 cmdutil.findcmd(name, commands.table)
676 cmdutil.findcmd(name, commands.table)
650 rst.append(_("\nuse 'hg help -c %s' to see help for "
677 rst.append(_("\nuse 'hg help -c %s' to see help for "
651 "the %s command\n") % (name, name))
678 "the %s command\n") % (name, name))
652 except error.UnknownCommand:
679 except error.UnknownCommand:
653 pass
680 pass
654 return rst
681 return rst
655
682
656 def helpext(name, subtopic=None):
683 def helpext(name, subtopic=None):
657 try:
684 try:
658 mod = extensions.find(name)
685 mod = extensions.find(name)
659 doc = gettext(pycompat.getdoc(mod)) or _('no help text available')
686 doc = gettext(pycompat.getdoc(mod)) or _('no help text available')
660 except KeyError:
687 except KeyError:
661 mod = None
688 mod = None
662 doc = extensions.disabledext(name)
689 doc = extensions.disabledext(name)
663 if not doc:
690 if not doc:
664 raise error.UnknownCommand(name)
691 raise error.UnknownCommand(name)
665
692
666 if '\n' not in doc:
693 if '\n' not in doc:
667 head, tail = doc, ""
694 head, tail = doc, ""
668 else:
695 else:
669 head, tail = doc.split('\n', 1)
696 head, tail = doc.split('\n', 1)
670 rst = [_('%s extension - %s\n\n') % (name.rpartition('.')[-1], head)]
697 rst = [_('%s extension - %s\n\n') % (name.rpartition('.')[-1], head)]
671 if tail:
698 if tail:
672 rst.extend(tail.splitlines(True))
699 rst.extend(tail.splitlines(True))
673 rst.append('\n')
700 rst.append('\n')
674
701
675 if not ui.verbose:
702 if not ui.verbose:
676 omitted = _('(some details hidden, use --verbose'
703 omitted = _('(some details hidden, use --verbose'
677 ' to show complete help)')
704 ' to show complete help)')
678 indicateomitted(rst, omitted)
705 indicateomitted(rst, omitted)
679
706
680 if mod:
707 if mod:
681 try:
708 try:
682 ct = mod.cmdtable
709 ct = mod.cmdtable
683 except AttributeError:
710 except AttributeError:
684 ct = {}
711 ct = {}
685 modcmds = set([c.partition('|')[0] for c in ct])
712 modcmds = set([c.partition('|')[0] for c in ct])
686 rst.extend(helplist(modcmds.__contains__))
713 rst.extend(helplist(modcmds.__contains__))
687 else:
714 else:
688 rst.append(_("(use 'hg help extensions' for information on enabling"
715 rst.append(_("(use 'hg help extensions' for information on enabling"
689 " extensions)\n"))
716 " extensions)\n"))
690 return rst
717 return rst
691
718
692 def helpextcmd(name, subtopic=None):
719 def helpextcmd(name, subtopic=None):
693 cmd, ext, doc = extensions.disabledcmd(ui, name,
720 cmd, ext, doc = extensions.disabledcmd(ui, name,
694 ui.configbool('ui', 'strict'))
721 ui.configbool('ui', 'strict'))
695 doc = doc.splitlines()[0]
722 doc = doc.splitlines()[0]
696
723
697 rst = listexts(_("'%s' is provided by the following "
724 rst = listexts(_("'%s' is provided by the following "
698 "extension:") % cmd, {ext: doc}, indent=4,
725 "extension:") % cmd, {ext: doc}, indent=4,
699 showdeprecated=True)
726 showdeprecated=True)
700 rst.append('\n')
727 rst.append('\n')
701 rst.append(_("(use 'hg help extensions' for information on enabling "
728 rst.append(_("(use 'hg help extensions' for information on enabling "
702 "extensions)\n"))
729 "extensions)\n"))
703 return rst
730 return rst
704
731
705
732
706 rst = []
733 rst = []
707 kw = opts.get('keyword')
734 kw = opts.get('keyword')
708 if kw or name is None and any(opts[o] for o in opts):
735 if kw or name is None and any(opts[o] for o in opts):
709 matches = topicmatch(ui, commands, name or '')
736 matches = topicmatch(ui, commands, name or '')
710 helpareas = []
737 helpareas = []
711 if opts.get('extension'):
738 if opts.get('extension'):
712 helpareas += [('extensions', _('Extensions'))]
739 helpareas += [('extensions', _('Extensions'))]
713 if opts.get('command'):
740 if opts.get('command'):
714 helpareas += [('commands', _('Commands'))]
741 helpareas += [('commands', _('Commands'))]
715 if not helpareas:
742 if not helpareas:
716 helpareas = [('topics', _('Topics')),
743 helpareas = [('topics', _('Topics')),
717 ('commands', _('Commands')),
744 ('commands', _('Commands')),
718 ('extensions', _('Extensions')),
745 ('extensions', _('Extensions')),
719 ('extensioncommands', _('Extension Commands'))]
746 ('extensioncommands', _('Extension Commands'))]
720 for t, title in helpareas:
747 for t, title in helpareas:
721 if matches[t]:
748 if matches[t]:
722 rst.append('%s:\n\n' % title)
749 rst.append('%s:\n\n' % title)
723 rst.extend(minirst.maketable(sorted(matches[t]), 1))
750 rst.extend(minirst.maketable(sorted(matches[t]), 1))
724 rst.append('\n')
751 rst.append('\n')
725 if not rst:
752 if not rst:
726 msg = _('no matches')
753 msg = _('no matches')
727 hint = _("try 'hg help' for a list of topics")
754 hint = _("try 'hg help' for a list of topics")
728 raise error.Abort(msg, hint=hint)
755 raise error.Abort(msg, hint=hint)
729 elif name and name != 'shortlist':
756 elif name and name != 'shortlist':
730 queries = []
757 queries = []
731 if unknowncmd:
758 if unknowncmd:
732 queries += [helpextcmd]
759 queries += [helpextcmd]
733 if opts.get('extension'):
760 if opts.get('extension'):
734 queries += [helpext]
761 queries += [helpext]
735 if opts.get('command'):
762 if opts.get('command'):
736 queries += [helpcmd]
763 queries += [helpcmd]
737 if not queries:
764 if not queries:
738 queries = (helptopic, helpcmd, helpext, helpextcmd)
765 queries = (helptopic, helpcmd, helpext, helpextcmd)
739 for f in queries:
766 for f in queries:
740 try:
767 try:
741 rst = f(name, subtopic)
768 rst = f(name, subtopic)
742 break
769 break
743 except error.UnknownCommand:
770 except error.UnknownCommand:
744 pass
771 pass
745 else:
772 else:
746 if unknowncmd:
773 if unknowncmd:
747 raise error.UnknownCommand(name)
774 raise error.UnknownCommand(name)
748 else:
775 else:
749 msg = _('no such help topic: %s') % name
776 msg = _('no such help topic: %s') % name
750 hint = _("try 'hg help --keyword %s'") % name
777 hint = _("try 'hg help --keyword %s'") % name
751 raise error.Abort(msg, hint=hint)
778 raise error.Abort(msg, hint=hint)
752 else:
779 else:
753 # program name
780 # program name
754 if not ui.quiet:
781 if not ui.quiet:
755 rst = [_("Mercurial Distributed SCM\n"), '\n']
782 rst = [_("Mercurial Distributed SCM\n"), '\n']
756 rst.extend(helplist(None, **pycompat.strkwargs(opts)))
783 rst.extend(helplist(None, **pycompat.strkwargs(opts)))
757
784
758 return ''.join(rst)
785 return ''.join(rst)
759
786
760 def formattedhelp(ui, commands, fullname, keep=None, unknowncmd=False,
787 def formattedhelp(ui, commands, fullname, keep=None, unknowncmd=False,
761 full=True, **opts):
788 full=True, **opts):
762 """get help for a given topic (as a dotted name) as rendered rst
789 """get help for a given topic (as a dotted name) as rendered rst
763
790
764 Either returns the rendered help text or raises an exception.
791 Either returns the rendered help text or raises an exception.
765 """
792 """
766 if keep is None:
793 if keep is None:
767 keep = []
794 keep = []
768 else:
795 else:
769 keep = list(keep) # make a copy so we can mutate this later
796 keep = list(keep) # make a copy so we can mutate this later
770
797
771 # <fullname> := <name>[.<subtopic][.<section>]
798 # <fullname> := <name>[.<subtopic][.<section>]
772 name = subtopic = section = None
799 name = subtopic = section = None
773 if fullname is not None:
800 if fullname is not None:
774 nameparts = fullname.split('.')
801 nameparts = fullname.split('.')
775 name = nameparts.pop(0)
802 name = nameparts.pop(0)
776 if nameparts and name in subtopics:
803 if nameparts and name in subtopics:
777 subtopic = nameparts.pop(0)
804 subtopic = nameparts.pop(0)
778 if nameparts:
805 if nameparts:
779 section = encoding.lower('.'.join(nameparts))
806 section = encoding.lower('.'.join(nameparts))
780
807
781 textwidth = ui.configint('ui', 'textwidth')
808 textwidth = ui.configint('ui', 'textwidth')
782 termwidth = ui.termwidth() - 2
809 termwidth = ui.termwidth() - 2
783 if textwidth <= 0 or termwidth < textwidth:
810 if textwidth <= 0 or termwidth < textwidth:
784 textwidth = termwidth
811 textwidth = termwidth
785 text = help_(ui, commands, name,
812 text = help_(ui, commands, name,
786 subtopic=subtopic, unknowncmd=unknowncmd, full=full, **opts)
813 subtopic=subtopic, unknowncmd=unknowncmd, full=full, **opts)
787
814
788 blocks, pruned = minirst.parse(text, keep=keep)
815 blocks, pruned = minirst.parse(text, keep=keep)
789 if 'verbose' in pruned:
816 if 'verbose' in pruned:
790 keep.append('omitted')
817 keep.append('omitted')
791 else:
818 else:
792 keep.append('notomitted')
819 keep.append('notomitted')
793 blocks, pruned = minirst.parse(text, keep=keep)
820 blocks, pruned = minirst.parse(text, keep=keep)
794 if section:
821 if section:
795 blocks = minirst.filtersections(blocks, section)
822 blocks = minirst.filtersections(blocks, section)
796
823
797 # We could have been given a weird ".foo" section without a name
824 # We could have been given a weird ".foo" section without a name
798 # to look for, or we could have simply failed to found "foo.bar"
825 # to look for, or we could have simply failed to found "foo.bar"
799 # because bar isn't a section of foo
826 # because bar isn't a section of foo
800 if section and not (blocks and name):
827 if section and not (blocks and name):
801 raise error.Abort(_("help section not found: %s") % fullname)
828 raise error.Abort(_("help section not found: %s") % fullname)
802
829
803 return minirst.formatplain(blocks, textwidth)
830 return minirst.formatplain(blocks, textwidth)
@@ -1,530 +1,558 b''
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ echo a > a
3 $ echo a > a
4 $ hg ci -A -d'1 0' -m a
4 $ hg ci -A -d'1 0' -m a
5 adding a
5 adding a
6
6
7 $ cd ..
7 $ cd ..
8
8
9 $ hg init b
9 $ hg init b
10 $ cd b
10 $ cd b
11 $ echo b > b
11 $ echo b > b
12 $ hg ci -A -d'1 0' -m b
12 $ hg ci -A -d'1 0' -m b
13 adding b
13 adding b
14
14
15 $ cd ..
15 $ cd ..
16
16
17 $ hg clone a c
17 $ hg clone a c
18 updating to branch default
18 updating to branch default
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 $ cd c
20 $ cd c
21 $ cat >> .hg/hgrc <<EOF
21 $ cat >> .hg/hgrc <<EOF
22 > [paths]
22 > [paths]
23 > relative = ../a
23 > relative = ../a
24 > EOF
24 > EOF
25 $ hg pull -f ../b
25 $ hg pull -f ../b
26 pulling from ../b
26 pulling from ../b
27 searching for changes
27 searching for changes
28 warning: repository is unrelated
28 warning: repository is unrelated
29 requesting all changes
29 requesting all changes
30 adding changesets
30 adding changesets
31 adding manifests
31 adding manifests
32 adding file changes
32 adding file changes
33 added 1 changesets with 1 changes to 1 files (+1 heads)
33 added 1 changesets with 1 changes to 1 files (+1 heads)
34 new changesets b6c483daf290
34 new changesets b6c483daf290
35 (run 'hg heads' to see heads, 'hg merge' to merge)
35 (run 'hg heads' to see heads, 'hg merge' to merge)
36 $ hg merge
36 $ hg merge
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 (branch merge, don't forget to commit)
38 (branch merge, don't forget to commit)
39
39
40 $ cd ..
40 $ cd ..
41
41
42 Testing -R/--repository:
42 Testing -R/--repository:
43
43
44 $ hg -R a tip
44 $ hg -R a tip
45 changeset: 0:8580ff50825a
45 changeset: 0:8580ff50825a
46 tag: tip
46 tag: tip
47 user: test
47 user: test
48 date: Thu Jan 01 00:00:01 1970 +0000
48 date: Thu Jan 01 00:00:01 1970 +0000
49 summary: a
49 summary: a
50
50
51 $ hg --repository b tip
51 $ hg --repository b tip
52 changeset: 0:b6c483daf290
52 changeset: 0:b6c483daf290
53 tag: tip
53 tag: tip
54 user: test
54 user: test
55 date: Thu Jan 01 00:00:01 1970 +0000
55 date: Thu Jan 01 00:00:01 1970 +0000
56 summary: b
56 summary: b
57
57
58
58
59 -R with a URL:
59 -R with a URL:
60
60
61 $ hg -R file:a identify
61 $ hg -R file:a identify
62 8580ff50825a tip
62 8580ff50825a tip
63 $ hg -R file://localhost/`pwd`/a/ identify
63 $ hg -R file://localhost/`pwd`/a/ identify
64 8580ff50825a tip
64 8580ff50825a tip
65
65
66 -R with path aliases:
66 -R with path aliases:
67
67
68 $ cd c
68 $ cd c
69 $ hg -R default identify
69 $ hg -R default identify
70 8580ff50825a tip
70 8580ff50825a tip
71 $ hg -R relative identify
71 $ hg -R relative identify
72 8580ff50825a tip
72 8580ff50825a tip
73 $ echo '[paths]' >> $HGRCPATH
73 $ echo '[paths]' >> $HGRCPATH
74 $ echo 'relativetohome = a' >> $HGRCPATH
74 $ echo 'relativetohome = a' >> $HGRCPATH
75 $ HOME=`pwd`/../ hg -R relativetohome identify
75 $ HOME=`pwd`/../ hg -R relativetohome identify
76 8580ff50825a tip
76 8580ff50825a tip
77 $ cd ..
77 $ cd ..
78
78
79 #if no-outer-repo
79 #if no-outer-repo
80
80
81 Implicit -R:
81 Implicit -R:
82
82
83 $ hg ann a/a
83 $ hg ann a/a
84 0: a
84 0: a
85 $ hg ann a/a a/a
85 $ hg ann a/a a/a
86 0: a
86 0: a
87 $ hg ann a/a b/b
87 $ hg ann a/a b/b
88 abort: no repository found in '$TESTTMP' (.hg not found)!
88 abort: no repository found in '$TESTTMP' (.hg not found)!
89 [255]
89 [255]
90 $ hg -R b ann a/a
90 $ hg -R b ann a/a
91 abort: a/a not under root '$TESTTMP/b'
91 abort: a/a not under root '$TESTTMP/b'
92 (consider using '--cwd b')
92 (consider using '--cwd b')
93 [255]
93 [255]
94 $ hg log
94 $ hg log
95 abort: no repository found in '$TESTTMP' (.hg not found)!
95 abort: no repository found in '$TESTTMP' (.hg not found)!
96 [255]
96 [255]
97
97
98 #endif
98 #endif
99
99
100 Abbreviation of long option:
100 Abbreviation of long option:
101
101
102 $ hg --repo c tip
102 $ hg --repo c tip
103 changeset: 1:b6c483daf290
103 changeset: 1:b6c483daf290
104 tag: tip
104 tag: tip
105 parent: -1:000000000000
105 parent: -1:000000000000
106 user: test
106 user: test
107 date: Thu Jan 01 00:00:01 1970 +0000
107 date: Thu Jan 01 00:00:01 1970 +0000
108 summary: b
108 summary: b
109
109
110
110
111 earlygetopt with duplicate options (36d23de02da1):
111 earlygetopt with duplicate options (36d23de02da1):
112
112
113 $ hg --cwd a --cwd b --cwd c tip
113 $ hg --cwd a --cwd b --cwd c tip
114 changeset: 1:b6c483daf290
114 changeset: 1:b6c483daf290
115 tag: tip
115 tag: tip
116 parent: -1:000000000000
116 parent: -1:000000000000
117 user: test
117 user: test
118 date: Thu Jan 01 00:00:01 1970 +0000
118 date: Thu Jan 01 00:00:01 1970 +0000
119 summary: b
119 summary: b
120
120
121 $ hg --repo c --repository b -R a tip
121 $ hg --repo c --repository b -R a tip
122 changeset: 0:8580ff50825a
122 changeset: 0:8580ff50825a
123 tag: tip
123 tag: tip
124 user: test
124 user: test
125 date: Thu Jan 01 00:00:01 1970 +0000
125 date: Thu Jan 01 00:00:01 1970 +0000
126 summary: a
126 summary: a
127
127
128
128
129 earlygetopt short option without following space:
129 earlygetopt short option without following space:
130
130
131 $ hg -q -Rb tip
131 $ hg -q -Rb tip
132 0:b6c483daf290
132 0:b6c483daf290
133
133
134 earlygetopt with illegal abbreviations:
134 earlygetopt with illegal abbreviations:
135
135
136 $ hg --confi "foo.bar=baz"
136 $ hg --confi "foo.bar=baz"
137 abort: option --config may not be abbreviated!
137 abort: option --config may not be abbreviated!
138 [255]
138 [255]
139 $ hg --cw a tip
139 $ hg --cw a tip
140 abort: option --cwd may not be abbreviated!
140 abort: option --cwd may not be abbreviated!
141 [255]
141 [255]
142 $ hg --rep a tip
142 $ hg --rep a tip
143 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
143 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
144 [255]
144 [255]
145 $ hg --repositor a tip
145 $ hg --repositor a tip
146 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
146 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
147 [255]
147 [255]
148 $ hg -qR a tip
148 $ hg -qR a tip
149 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
149 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
150 [255]
150 [255]
151 $ hg -qRa tip
151 $ hg -qRa tip
152 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
152 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
153 [255]
153 [255]
154
154
155 Testing --cwd:
155 Testing --cwd:
156
156
157 $ hg --cwd a parents
157 $ hg --cwd a parents
158 changeset: 0:8580ff50825a
158 changeset: 0:8580ff50825a
159 tag: tip
159 tag: tip
160 user: test
160 user: test
161 date: Thu Jan 01 00:00:01 1970 +0000
161 date: Thu Jan 01 00:00:01 1970 +0000
162 summary: a
162 summary: a
163
163
164
164
165 Testing -y/--noninteractive - just be sure it is parsed:
165 Testing -y/--noninteractive - just be sure it is parsed:
166
166
167 $ hg --cwd a tip -q --noninteractive
167 $ hg --cwd a tip -q --noninteractive
168 0:8580ff50825a
168 0:8580ff50825a
169 $ hg --cwd a tip -q -y
169 $ hg --cwd a tip -q -y
170 0:8580ff50825a
170 0:8580ff50825a
171
171
172 Testing -q/--quiet:
172 Testing -q/--quiet:
173
173
174 $ hg -R a -q tip
174 $ hg -R a -q tip
175 0:8580ff50825a
175 0:8580ff50825a
176 $ hg -R b -q tip
176 $ hg -R b -q tip
177 0:b6c483daf290
177 0:b6c483daf290
178 $ hg -R c --quiet parents
178 $ hg -R c --quiet parents
179 0:8580ff50825a
179 0:8580ff50825a
180 1:b6c483daf290
180 1:b6c483daf290
181
181
182 Testing -v/--verbose:
182 Testing -v/--verbose:
183
183
184 $ hg --cwd c head -v
184 $ hg --cwd c head -v
185 changeset: 1:b6c483daf290
185 changeset: 1:b6c483daf290
186 tag: tip
186 tag: tip
187 parent: -1:000000000000
187 parent: -1:000000000000
188 user: test
188 user: test
189 date: Thu Jan 01 00:00:01 1970 +0000
189 date: Thu Jan 01 00:00:01 1970 +0000
190 files: b
190 files: b
191 description:
191 description:
192 b
192 b
193
193
194
194
195 changeset: 0:8580ff50825a
195 changeset: 0:8580ff50825a
196 user: test
196 user: test
197 date: Thu Jan 01 00:00:01 1970 +0000
197 date: Thu Jan 01 00:00:01 1970 +0000
198 files: a
198 files: a
199 description:
199 description:
200 a
200 a
201
201
202
202
203 $ hg --cwd b tip --verbose
203 $ hg --cwd b tip --verbose
204 changeset: 0:b6c483daf290
204 changeset: 0:b6c483daf290
205 tag: tip
205 tag: tip
206 user: test
206 user: test
207 date: Thu Jan 01 00:00:01 1970 +0000
207 date: Thu Jan 01 00:00:01 1970 +0000
208 files: b
208 files: b
209 description:
209 description:
210 b
210 b
211
211
212
212
213
213
214 Testing --config:
214 Testing --config:
215
215
216 $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
216 $ hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
217 quuxfoo
217 quuxfoo
218 $ hg --cwd c --config '' tip -q
218 $ hg --cwd c --config '' tip -q
219 abort: malformed --config option: '' (use --config section.name=value)
219 abort: malformed --config option: '' (use --config section.name=value)
220 [255]
220 [255]
221 $ hg --cwd c --config a.b tip -q
221 $ hg --cwd c --config a.b tip -q
222 abort: malformed --config option: 'a.b' (use --config section.name=value)
222 abort: malformed --config option: 'a.b' (use --config section.name=value)
223 [255]
223 [255]
224 $ hg --cwd c --config a tip -q
224 $ hg --cwd c --config a tip -q
225 abort: malformed --config option: 'a' (use --config section.name=value)
225 abort: malformed --config option: 'a' (use --config section.name=value)
226 [255]
226 [255]
227 $ hg --cwd c --config a.= tip -q
227 $ hg --cwd c --config a.= tip -q
228 abort: malformed --config option: 'a.=' (use --config section.name=value)
228 abort: malformed --config option: 'a.=' (use --config section.name=value)
229 [255]
229 [255]
230 $ hg --cwd c --config .b= tip -q
230 $ hg --cwd c --config .b= tip -q
231 abort: malformed --config option: '.b=' (use --config section.name=value)
231 abort: malformed --config option: '.b=' (use --config section.name=value)
232 [255]
232 [255]
233
233
234 Testing --debug:
234 Testing --debug:
235
235
236 $ hg --cwd c log --debug
236 $ hg --cwd c log --debug
237 changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
237 changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
238 tag: tip
238 tag: tip
239 phase: public
239 phase: public
240 parent: -1:0000000000000000000000000000000000000000
240 parent: -1:0000000000000000000000000000000000000000
241 parent: -1:0000000000000000000000000000000000000000
241 parent: -1:0000000000000000000000000000000000000000
242 manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
242 manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
243 user: test
243 user: test
244 date: Thu Jan 01 00:00:01 1970 +0000
244 date: Thu Jan 01 00:00:01 1970 +0000
245 files+: b
245 files+: b
246 extra: branch=default
246 extra: branch=default
247 description:
247 description:
248 b
248 b
249
249
250
250
251 changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
251 changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
252 phase: public
252 phase: public
253 parent: -1:0000000000000000000000000000000000000000
253 parent: -1:0000000000000000000000000000000000000000
254 parent: -1:0000000000000000000000000000000000000000
254 parent: -1:0000000000000000000000000000000000000000
255 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
255 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
256 user: test
256 user: test
257 date: Thu Jan 01 00:00:01 1970 +0000
257 date: Thu Jan 01 00:00:01 1970 +0000
258 files+: a
258 files+: a
259 extra: branch=default
259 extra: branch=default
260 description:
260 description:
261 a
261 a
262
262
263
263
264
264
265 Testing --traceback:
265 Testing --traceback:
266
266
267 #if no-chg
267 #if no-chg
268 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
268 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
269 Traceback (most recent call last):
269 Traceback (most recent call last):
270 Traceback (most recent call last): (py3 !)
270 Traceback (most recent call last): (py3 !)
271 #else
271 #else
272 Traceback for '--config' errors not supported with chg.
272 Traceback for '--config' errors not supported with chg.
273 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
273 $ hg --cwd c --config x --traceback id 2>&1 | grep -i 'traceback'
274 [1]
274 [1]
275 #endif
275 #endif
276
276
277 Testing --time:
277 Testing --time:
278
278
279 $ hg --cwd a --time id
279 $ hg --cwd a --time id
280 8580ff50825a tip
280 8580ff50825a tip
281 time: real * (glob)
281 time: real * (glob)
282
282
283 Testing --version:
283 Testing --version:
284
284
285 $ hg --version -q
285 $ hg --version -q
286 Mercurial Distributed SCM * (glob)
286 Mercurial Distributed SCM * (glob)
287
287
288 hide outer repo
288 hide outer repo
289 $ hg init
289 $ hg init
290
290
291 Testing -h/--help:
291 Testing -h/--help:
292
292
293 #if no-extraextensions
293 #if no-extraextensions
294
294
295 $ hg -h
295 $ hg -h
296 Mercurial Distributed SCM
296 Mercurial Distributed SCM
297
297
298 list of commands:
298 list of commands:
299
299
300 Repository creation:
300 Repository creation:
301
301
302 clone make a copy of an existing repository
302 clone make a copy of an existing repository
303 init create a new repository in the given directory
303 init create a new repository in the given directory
304
304
305 Remote repository management:
305 Remote repository management:
306
306
307 incoming show new changesets found in source
307 incoming show new changesets found in source
308 outgoing show changesets not found in the destination
308 outgoing show changesets not found in the destination
309 paths show aliases for remote repositories
309 paths show aliases for remote repositories
310 pull pull changes from the specified source
310 pull pull changes from the specified source
311 push push changes to the specified destination
311 push push changes to the specified destination
312 serve start stand-alone webserver
312 serve start stand-alone webserver
313
313
314 Change creation:
314 Change creation:
315
315
316 commit commit the specified files or all outstanding changes
316 commit commit the specified files or all outstanding changes
317
317
318 Change manipulation:
318 Change manipulation:
319
319
320 backout reverse effect of earlier changeset
320 backout reverse effect of earlier changeset
321 graft copy changes from other branches onto the current branch
321 graft copy changes from other branches onto the current branch
322 merge merge another revision into working directory
322 merge merge another revision into working directory
323
323
324 Change organization:
324 Change organization:
325
325
326 bookmarks create a new bookmark or list existing bookmarks
326 bookmarks create a new bookmark or list existing bookmarks
327 branch set or show the current branch name
327 branch set or show the current branch name
328 branches list repository named branches
328 branches list repository named branches
329 phase set or show the current phase name
329 phase set or show the current phase name
330 tag add one or more tags for the current or given revision
330 tag add one or more tags for the current or given revision
331 tags list repository tags
331 tags list repository tags
332
332
333 File content management:
333 File content management:
334
334
335 annotate show changeset information by line for each file
335 annotate show changeset information by line for each file
336 cat output the current or given revision of files
336 cat output the current or given revision of files
337 copy mark files as copied for the next commit
337 copy mark files as copied for the next commit
338 diff diff repository (or selected files)
338 diff diff repository (or selected files)
339 grep search revision history for a pattern in specified files
339 grep search revision history for a pattern in specified files
340
340
341 Change navigation:
341 Change navigation:
342
342
343 bisect subdivision search of changesets
343 bisect subdivision search of changesets
344 heads show branch heads
344 heads show branch heads
345 identify identify the working directory or specified revision
345 identify identify the working directory or specified revision
346 log show revision history of entire repository or files
346 log show revision history of entire repository or files
347
347
348 Working directory management:
348 Working directory management:
349
349
350 add add the specified files on the next commit
350 add add the specified files on the next commit
351 addremove add all new files, delete all missing files
351 addremove add all new files, delete all missing files
352 files list tracked files
352 files list tracked files
353 forget forget the specified files on the next commit
353 forget forget the specified files on the next commit
354 remove remove the specified files on the next commit
354 remove remove the specified files on the next commit
355 rename rename files; equivalent of copy + remove
355 rename rename files; equivalent of copy + remove
356 resolve redo merges or set/view the merge status of files
356 resolve redo merges or set/view the merge status of files
357 revert restore files to their checkout state
357 revert restore files to their checkout state
358 root print the root (top) of the current working directory
358 root print the root (top) of the current working directory
359 status show changed files in the working directory
359 status show changed files in the working directory
360 summary summarize working directory state
360 summary summarize working directory state
361 update update working directory (or switch revisions)
361 update update working directory (or switch revisions)
362
362
363 Change import/export:
363 Change import/export:
364
364
365 archive create an unversioned archive of a repository revision
365 archive create an unversioned archive of a repository revision
366 bundle create a bundle file
366 bundle create a bundle file
367 export dump the header and diffs for one or more changesets
367 export dump the header and diffs for one or more changesets
368 import import an ordered set of patches
368 import import an ordered set of patches
369 unbundle apply one or more bundle files
369 unbundle apply one or more bundle files
370
370
371 Repository maintenance:
371 Repository maintenance:
372
372
373 manifest output the current or given revision of the project manifest
373 manifest output the current or given revision of the project manifest
374 recover roll back an interrupted transaction
374 recover roll back an interrupted transaction
375 verify verify the integrity of the repository
375 verify verify the integrity of the repository
376
376
377 Help:
377 Help:
378
378
379 config show combined config settings from all hgrc files
379 config show combined config settings from all hgrc files
380 help show help for a given topic or a help overview
380 help show help for a given topic or a help overview
381 version output version and copyright information
381 version output version and copyright information
382
382
383 additional help topics:
383 additional help topics:
384
384
385 bundlespec Bundle File Formats
385 Mercurial identifiers:
386
387 filesets Specifying File Sets
388 hgignore Syntax for Mercurial Ignore Files
389 patterns File Name Patterns
390 revisions Specifying Revisions
391 urls URL Paths
392
393 Mercurial output:
394
386 color Colorizing Outputs
395 color Colorizing Outputs
396 dates Date Formats
397 diffs Diff Formats
398 templating Template Usage
399
400 Mercurial configuration:
401
387 config Configuration Files
402 config Configuration Files
388 dates Date Formats
389 deprecated Deprecated Features
390 diffs Diff Formats
391 environment Environment Variables
403 environment Environment Variables
392 extensions Using Additional Features
404 extensions Using Additional Features
393 filesets Specifying File Sets
394 flags Command-line flags
405 flags Command-line flags
395 glossary Glossary
396 hgignore Syntax for Mercurial Ignore Files
397 hgweb Configuring hgweb
406 hgweb Configuring hgweb
398 internals Technical implementation topics
399 merge-tools Merge Tools
407 merge-tools Merge Tools
400 pager Pager Support
408 pager Pager Support
401 patterns File Name Patterns
409
410 Concepts:
411
412 bundlespec Bundle File Formats
413 glossary Glossary
402 phases Working with Phases
414 phases Working with Phases
403 revisions Specifying Revisions
415 subrepos Subrepositories
416
417 Miscellaneous:
418
419 deprecated Deprecated Features
420 internals Technical implementation topics
404 scripting Using Mercurial from scripts and automation
421 scripting Using Mercurial from scripts and automation
405 subrepos Subrepositories
406 templating Template Usage
407 urls URL Paths
408
422
409 (use 'hg help -v' to show built-in aliases and global options)
423 (use 'hg help -v' to show built-in aliases and global options)
410
424
411 $ hg --help
425 $ hg --help
412 Mercurial Distributed SCM
426 Mercurial Distributed SCM
413
427
414 list of commands:
428 list of commands:
415
429
416 Repository creation:
430 Repository creation:
417
431
418 clone make a copy of an existing repository
432 clone make a copy of an existing repository
419 init create a new repository in the given directory
433 init create a new repository in the given directory
420
434
421 Remote repository management:
435 Remote repository management:
422
436
423 incoming show new changesets found in source
437 incoming show new changesets found in source
424 outgoing show changesets not found in the destination
438 outgoing show changesets not found in the destination
425 paths show aliases for remote repositories
439 paths show aliases for remote repositories
426 pull pull changes from the specified source
440 pull pull changes from the specified source
427 push push changes to the specified destination
441 push push changes to the specified destination
428 serve start stand-alone webserver
442 serve start stand-alone webserver
429
443
430 Change creation:
444 Change creation:
431
445
432 commit commit the specified files or all outstanding changes
446 commit commit the specified files or all outstanding changes
433
447
434 Change manipulation:
448 Change manipulation:
435
449
436 backout reverse effect of earlier changeset
450 backout reverse effect of earlier changeset
437 graft copy changes from other branches onto the current branch
451 graft copy changes from other branches onto the current branch
438 merge merge another revision into working directory
452 merge merge another revision into working directory
439
453
440 Change organization:
454 Change organization:
441
455
442 bookmarks create a new bookmark or list existing bookmarks
456 bookmarks create a new bookmark or list existing bookmarks
443 branch set or show the current branch name
457 branch set or show the current branch name
444 branches list repository named branches
458 branches list repository named branches
445 phase set or show the current phase name
459 phase set or show the current phase name
446 tag add one or more tags for the current or given revision
460 tag add one or more tags for the current or given revision
447 tags list repository tags
461 tags list repository tags
448
462
449 File content management:
463 File content management:
450
464
451 annotate show changeset information by line for each file
465 annotate show changeset information by line for each file
452 cat output the current or given revision of files
466 cat output the current or given revision of files
453 copy mark files as copied for the next commit
467 copy mark files as copied for the next commit
454 diff diff repository (or selected files)
468 diff diff repository (or selected files)
455 grep search revision history for a pattern in specified files
469 grep search revision history for a pattern in specified files
456
470
457 Change navigation:
471 Change navigation:
458
472
459 bisect subdivision search of changesets
473 bisect subdivision search of changesets
460 heads show branch heads
474 heads show branch heads
461 identify identify the working directory or specified revision
475 identify identify the working directory or specified revision
462 log show revision history of entire repository or files
476 log show revision history of entire repository or files
463
477
464 Working directory management:
478 Working directory management:
465
479
466 add add the specified files on the next commit
480 add add the specified files on the next commit
467 addremove add all new files, delete all missing files
481 addremove add all new files, delete all missing files
468 files list tracked files
482 files list tracked files
469 forget forget the specified files on the next commit
483 forget forget the specified files on the next commit
470 remove remove the specified files on the next commit
484 remove remove the specified files on the next commit
471 rename rename files; equivalent of copy + remove
485 rename rename files; equivalent of copy + remove
472 resolve redo merges or set/view the merge status of files
486 resolve redo merges or set/view the merge status of files
473 revert restore files to their checkout state
487 revert restore files to their checkout state
474 root print the root (top) of the current working directory
488 root print the root (top) of the current working directory
475 status show changed files in the working directory
489 status show changed files in the working directory
476 summary summarize working directory state
490 summary summarize working directory state
477 update update working directory (or switch revisions)
491 update update working directory (or switch revisions)
478
492
479 Change import/export:
493 Change import/export:
480
494
481 archive create an unversioned archive of a repository revision
495 archive create an unversioned archive of a repository revision
482 bundle create a bundle file
496 bundle create a bundle file
483 export dump the header and diffs for one or more changesets
497 export dump the header and diffs for one or more changesets
484 import import an ordered set of patches
498 import import an ordered set of patches
485 unbundle apply one or more bundle files
499 unbundle apply one or more bundle files
486
500
487 Repository maintenance:
501 Repository maintenance:
488
502
489 manifest output the current or given revision of the project manifest
503 manifest output the current or given revision of the project manifest
490 recover roll back an interrupted transaction
504 recover roll back an interrupted transaction
491 verify verify the integrity of the repository
505 verify verify the integrity of the repository
492
506
493 Help:
507 Help:
494
508
495 config show combined config settings from all hgrc files
509 config show combined config settings from all hgrc files
496 help show help for a given topic or a help overview
510 help show help for a given topic or a help overview
497 version output version and copyright information
511 version output version and copyright information
498
512
499 additional help topics:
513 additional help topics:
500
514
501 bundlespec Bundle File Formats
515 Mercurial identifiers:
516
517 filesets Specifying File Sets
518 hgignore Syntax for Mercurial Ignore Files
519 patterns File Name Patterns
520 revisions Specifying Revisions
521 urls URL Paths
522
523 Mercurial output:
524
502 color Colorizing Outputs
525 color Colorizing Outputs
526 dates Date Formats
527 diffs Diff Formats
528 templating Template Usage
529
530 Mercurial configuration:
531
503 config Configuration Files
532 config Configuration Files
504 dates Date Formats
505 deprecated Deprecated Features
506 diffs Diff Formats
507 environment Environment Variables
533 environment Environment Variables
508 extensions Using Additional Features
534 extensions Using Additional Features
509 filesets Specifying File Sets
510 flags Command-line flags
535 flags Command-line flags
511 glossary Glossary
512 hgignore Syntax for Mercurial Ignore Files
513 hgweb Configuring hgweb
536 hgweb Configuring hgweb
514 internals Technical implementation topics
515 merge-tools Merge Tools
537 merge-tools Merge Tools
516 pager Pager Support
538 pager Pager Support
517 patterns File Name Patterns
539
540 Concepts:
541
542 bundlespec Bundle File Formats
543 glossary Glossary
518 phases Working with Phases
544 phases Working with Phases
519 revisions Specifying Revisions
545 subrepos Subrepositories
546
547 Miscellaneous:
548
549 deprecated Deprecated Features
550 internals Technical implementation topics
520 scripting Using Mercurial from scripts and automation
551 scripting Using Mercurial from scripts and automation
521 subrepos Subrepositories
522 templating Template Usage
523 urls URL Paths
524
552
525 (use 'hg help -v' to show built-in aliases and global options)
553 (use 'hg help -v' to show built-in aliases and global options)
526
554
527 #endif
555 #endif
528
556
529 Not tested: --debugger
557 Not tested: --debugger
530
558
@@ -1,3860 +1,3902 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 Extra extensions will be printed in help output in a non-reliable order since
47 Extra extensions will be printed in help output in a non-reliable order since
48 the extension is unknown.
48 the extension is unknown.
49 #if no-extraextensions
49 #if no-extraextensions
50
50
51 $ hg help
51 $ hg help
52 Mercurial Distributed SCM
52 Mercurial Distributed SCM
53
53
54 list of commands:
54 list of commands:
55
55
56 Repository creation:
56 Repository creation:
57
57
58 clone make a copy of an existing repository
58 clone make a copy of an existing repository
59 init create a new repository in the given directory
59 init create a new repository in the given directory
60
60
61 Remote repository management:
61 Remote repository management:
62
62
63 incoming show new changesets found in source
63 incoming show new changesets found in source
64 outgoing show changesets not found in the destination
64 outgoing show changesets not found in the destination
65 paths show aliases for remote repositories
65 paths show aliases for remote repositories
66 pull pull changes from the specified source
66 pull pull changes from the specified source
67 push push changes to the specified destination
67 push push changes to the specified destination
68 serve start stand-alone webserver
68 serve start stand-alone webserver
69
69
70 Change creation:
70 Change creation:
71
71
72 commit commit the specified files or all outstanding changes
72 commit commit the specified files or all outstanding changes
73
73
74 Change manipulation:
74 Change manipulation:
75
75
76 backout reverse effect of earlier changeset
76 backout reverse effect of earlier changeset
77 graft copy changes from other branches onto the current branch
77 graft copy changes from other branches onto the current branch
78 merge merge another revision into working directory
78 merge merge another revision into working directory
79
79
80 Change organization:
80 Change organization:
81
81
82 bookmarks create a new bookmark or list existing bookmarks
82 bookmarks create a new bookmark or list existing bookmarks
83 branch set or show the current branch name
83 branch set or show the current branch name
84 branches list repository named branches
84 branches list repository named branches
85 phase set or show the current phase name
85 phase set or show the current phase name
86 tag add one or more tags for the current or given revision
86 tag add one or more tags for the current or given revision
87 tags list repository tags
87 tags list repository tags
88
88
89 File content management:
89 File content management:
90
90
91 annotate show changeset information by line for each file
91 annotate show changeset information by line for each file
92 cat output the current or given revision of files
92 cat output the current or given revision of files
93 copy mark files as copied for the next commit
93 copy mark files as copied for the next commit
94 diff diff repository (or selected files)
94 diff diff repository (or selected files)
95 grep search revision history for a pattern in specified files
95 grep search revision history for a pattern in specified files
96
96
97 Change navigation:
97 Change navigation:
98
98
99 bisect subdivision search of changesets
99 bisect subdivision search of changesets
100 heads show branch heads
100 heads show branch heads
101 identify identify the working directory or specified revision
101 identify identify the working directory or specified revision
102 log show revision history of entire repository or files
102 log show revision history of entire repository or files
103
103
104 Working directory management:
104 Working directory management:
105
105
106 add add the specified files on the next commit
106 add add the specified files on the next commit
107 addremove add all new files, delete all missing files
107 addremove add all new files, delete all missing files
108 files list tracked files
108 files list tracked files
109 forget forget the specified files on the next commit
109 forget forget the specified files on the next commit
110 remove remove the specified files on the next commit
110 remove remove the specified files on the next commit
111 rename rename files; equivalent of copy + remove
111 rename rename files; equivalent of copy + remove
112 resolve redo merges or set/view the merge status of files
112 resolve redo merges or set/view the merge status of files
113 revert restore files to their checkout state
113 revert restore files to their checkout state
114 root print the root (top) of the current working directory
114 root print the root (top) of the current working directory
115 status show changed files in the working directory
115 status show changed files in the working directory
116 summary summarize working directory state
116 summary summarize working directory state
117 update update working directory (or switch revisions)
117 update update working directory (or switch revisions)
118
118
119 Change import/export:
119 Change import/export:
120
120
121 archive create an unversioned archive of a repository revision
121 archive create an unversioned archive of a repository revision
122 bundle create a bundle file
122 bundle create a bundle file
123 export dump the header and diffs for one or more changesets
123 export dump the header and diffs for one or more changesets
124 import import an ordered set of patches
124 import import an ordered set of patches
125 unbundle apply one or more bundle files
125 unbundle apply one or more bundle files
126
126
127 Repository maintenance:
127 Repository maintenance:
128
128
129 manifest output the current or given revision of the project manifest
129 manifest output the current or given revision of the project manifest
130 recover roll back an interrupted transaction
130 recover roll back an interrupted transaction
131 verify verify the integrity of the repository
131 verify verify the integrity of the repository
132
132
133 Help:
133 Help:
134
134
135 config show combined config settings from all hgrc files
135 config show combined config settings from all hgrc files
136 help show help for a given topic or a help overview
136 help show help for a given topic or a help overview
137 version output version and copyright information
137 version output version and copyright information
138
138
139 additional help topics:
139 additional help topics:
140
140
141 bundlespec Bundle File Formats
141 Mercurial identifiers:
142
143 filesets Specifying File Sets
144 hgignore Syntax for Mercurial Ignore Files
145 patterns File Name Patterns
146 revisions Specifying Revisions
147 urls URL Paths
148
149 Mercurial output:
150
142 color Colorizing Outputs
151 color Colorizing Outputs
152 dates Date Formats
153 diffs Diff Formats
154 templating Template Usage
155
156 Mercurial configuration:
157
143 config Configuration Files
158 config Configuration Files
144 dates Date Formats
145 deprecated Deprecated Features
146 diffs Diff Formats
147 environment Environment Variables
159 environment Environment Variables
148 extensions Using Additional Features
160 extensions Using Additional Features
149 filesets Specifying File Sets
150 flags Command-line flags
161 flags Command-line flags
151 glossary Glossary
152 hgignore Syntax for Mercurial Ignore Files
153 hgweb Configuring hgweb
162 hgweb Configuring hgweb
154 internals Technical implementation topics
155 merge-tools Merge Tools
163 merge-tools Merge Tools
156 pager Pager Support
164 pager Pager Support
157 patterns File Name Patterns
165
166 Concepts:
167
168 bundlespec Bundle File Formats
169 glossary Glossary
158 phases Working with Phases
170 phases Working with Phases
159 revisions Specifying Revisions
171 subrepos Subrepositories
172
173 Miscellaneous:
174
175 deprecated Deprecated Features
176 internals Technical implementation topics
160 scripting Using Mercurial from scripts and automation
177 scripting Using Mercurial from scripts and automation
161 subrepos Subrepositories
162 templating Template Usage
163 urls URL Paths
164
178
165 (use 'hg help -v' to show built-in aliases and global options)
179 (use 'hg help -v' to show built-in aliases and global options)
166
180
167 $ hg -q help
181 $ hg -q help
168 Repository creation:
182 Repository creation:
169
183
170 clone make a copy of an existing repository
184 clone make a copy of an existing repository
171 init create a new repository in the given directory
185 init create a new repository in the given directory
172
186
173 Remote repository management:
187 Remote repository management:
174
188
175 incoming show new changesets found in source
189 incoming show new changesets found in source
176 outgoing show changesets not found in the destination
190 outgoing show changesets not found in the destination
177 paths show aliases for remote repositories
191 paths show aliases for remote repositories
178 pull pull changes from the specified source
192 pull pull changes from the specified source
179 push push changes to the specified destination
193 push push changes to the specified destination
180 serve start stand-alone webserver
194 serve start stand-alone webserver
181
195
182 Change creation:
196 Change creation:
183
197
184 commit commit the specified files or all outstanding changes
198 commit commit the specified files or all outstanding changes
185
199
186 Change manipulation:
200 Change manipulation:
187
201
188 backout reverse effect of earlier changeset
202 backout reverse effect of earlier changeset
189 graft copy changes from other branches onto the current branch
203 graft copy changes from other branches onto the current branch
190 merge merge another revision into working directory
204 merge merge another revision into working directory
191
205
192 Change organization:
206 Change organization:
193
207
194 bookmarks create a new bookmark or list existing bookmarks
208 bookmarks create a new bookmark or list existing bookmarks
195 branch set or show the current branch name
209 branch set or show the current branch name
196 branches list repository named branches
210 branches list repository named branches
197 phase set or show the current phase name
211 phase set or show the current phase name
198 tag add one or more tags for the current or given revision
212 tag add one or more tags for the current or given revision
199 tags list repository tags
213 tags list repository tags
200
214
201 File content management:
215 File content management:
202
216
203 annotate show changeset information by line for each file
217 annotate show changeset information by line for each file
204 cat output the current or given revision of files
218 cat output the current or given revision of files
205 copy mark files as copied for the next commit
219 copy mark files as copied for the next commit
206 diff diff repository (or selected files)
220 diff diff repository (or selected files)
207 grep search revision history for a pattern in specified files
221 grep search revision history for a pattern in specified files
208
222
209 Change navigation:
223 Change navigation:
210
224
211 bisect subdivision search of changesets
225 bisect subdivision search of changesets
212 heads show branch heads
226 heads show branch heads
213 identify identify the working directory or specified revision
227 identify identify the working directory or specified revision
214 log show revision history of entire repository or files
228 log show revision history of entire repository or files
215
229
216 Working directory management:
230 Working directory management:
217
231
218 add add the specified files on the next commit
232 add add the specified files on the next commit
219 addremove add all new files, delete all missing files
233 addremove add all new files, delete all missing files
220 files list tracked files
234 files list tracked files
221 forget forget the specified files on the next commit
235 forget forget the specified files on the next commit
222 remove remove the specified files on the next commit
236 remove remove the specified files on the next commit
223 rename rename files; equivalent of copy + remove
237 rename rename files; equivalent of copy + remove
224 resolve redo merges or set/view the merge status of files
238 resolve redo merges or set/view the merge status of files
225 revert restore files to their checkout state
239 revert restore files to their checkout state
226 root print the root (top) of the current working directory
240 root print the root (top) of the current working directory
227 status show changed files in the working directory
241 status show changed files in the working directory
228 summary summarize working directory state
242 summary summarize working directory state
229 update update working directory (or switch revisions)
243 update update working directory (or switch revisions)
230
244
231 Change import/export:
245 Change import/export:
232
246
233 archive create an unversioned archive of a repository revision
247 archive create an unversioned archive of a repository revision
234 bundle create a bundle file
248 bundle create a bundle file
235 export dump the header and diffs for one or more changesets
249 export dump the header and diffs for one or more changesets
236 import import an ordered set of patches
250 import import an ordered set of patches
237 unbundle apply one or more bundle files
251 unbundle apply one or more bundle files
238
252
239 Repository maintenance:
253 Repository maintenance:
240
254
241 manifest output the current or given revision of the project manifest
255 manifest output the current or given revision of the project manifest
242 recover roll back an interrupted transaction
256 recover roll back an interrupted transaction
243 verify verify the integrity of the repository
257 verify verify the integrity of the repository
244
258
245 Help:
259 Help:
246
260
247 config show combined config settings from all hgrc files
261 config show combined config settings from all hgrc files
248 help show help for a given topic or a help overview
262 help show help for a given topic or a help overview
249 version output version and copyright information
263 version output version and copyright information
250
264
251 additional help topics:
265 additional help topics:
252
266
253 bundlespec Bundle File Formats
267 Mercurial identifiers:
268
269 filesets Specifying File Sets
270 hgignore Syntax for Mercurial Ignore Files
271 patterns File Name Patterns
272 revisions Specifying Revisions
273 urls URL Paths
274
275 Mercurial output:
276
254 color Colorizing Outputs
277 color Colorizing Outputs
278 dates Date Formats
279 diffs Diff Formats
280 templating Template Usage
281
282 Mercurial configuration:
283
255 config Configuration Files
284 config Configuration Files
256 dates Date Formats
257 deprecated Deprecated Features
258 diffs Diff Formats
259 environment Environment Variables
285 environment Environment Variables
260 extensions Using Additional Features
286 extensions Using Additional Features
261 filesets Specifying File Sets
262 flags Command-line flags
287 flags Command-line flags
263 glossary Glossary
264 hgignore Syntax for Mercurial Ignore Files
265 hgweb Configuring hgweb
288 hgweb Configuring hgweb
266 internals Technical implementation topics
267 merge-tools Merge Tools
289 merge-tools Merge Tools
268 pager Pager Support
290 pager Pager Support
269 patterns File Name Patterns
291
292 Concepts:
293
294 bundlespec Bundle File Formats
295 glossary Glossary
270 phases Working with Phases
296 phases Working with Phases
271 revisions Specifying Revisions
297 subrepos Subrepositories
298
299 Miscellaneous:
300
301 deprecated Deprecated Features
302 internals Technical implementation topics
272 scripting Using Mercurial from scripts and automation
303 scripting Using Mercurial from scripts and automation
273 subrepos Subrepositories
274 templating Template Usage
275 urls URL Paths
276
304
277 Test extension help:
305 Test extension help:
278 $ hg help extensions --config extensions.rebase= --config extensions.children=
306 $ hg help extensions --config extensions.rebase= --config extensions.children=
279 Using Additional Features
307 Using Additional Features
280 """""""""""""""""""""""""
308 """""""""""""""""""""""""
281
309
282 Mercurial has the ability to add new features through the use of
310 Mercurial has the ability to add new features through the use of
283 extensions. Extensions may add new commands, add options to existing
311 extensions. Extensions may add new commands, add options to existing
284 commands, change the default behavior of commands, or implement hooks.
312 commands, change the default behavior of commands, or implement hooks.
285
313
286 To enable the "foo" extension, either shipped with Mercurial or in the
314 To enable the "foo" extension, either shipped with Mercurial or in the
287 Python search path, create an entry for it in your configuration file,
315 Python search path, create an entry for it in your configuration file,
288 like this:
316 like this:
289
317
290 [extensions]
318 [extensions]
291 foo =
319 foo =
292
320
293 You may also specify the full path to an extension:
321 You may also specify the full path to an extension:
294
322
295 [extensions]
323 [extensions]
296 myfeature = ~/.hgext/myfeature.py
324 myfeature = ~/.hgext/myfeature.py
297
325
298 See 'hg help config' for more information on configuration files.
326 See 'hg help config' for more information on configuration files.
299
327
300 Extensions are not loaded by default for a variety of reasons: they can
328 Extensions are not loaded by default for a variety of reasons: they can
301 increase startup overhead; they may be meant for advanced usage only; they
329 increase startup overhead; they may be meant for advanced usage only; they
302 may provide potentially dangerous abilities (such as letting you destroy
330 may provide potentially dangerous abilities (such as letting you destroy
303 or modify history); they might not be ready for prime time; or they may
331 or modify history); they might not be ready for prime time; or they may
304 alter some usual behaviors of stock Mercurial. It is thus up to the user
332 alter some usual behaviors of stock Mercurial. It is thus up to the user
305 to activate extensions as needed.
333 to activate extensions as needed.
306
334
307 To explicitly disable an extension enabled in a configuration file of
335 To explicitly disable an extension enabled in a configuration file of
308 broader scope, prepend its path with !:
336 broader scope, prepend its path with !:
309
337
310 [extensions]
338 [extensions]
311 # disabling extension bar residing in /path/to/extension/bar.py
339 # disabling extension bar residing in /path/to/extension/bar.py
312 bar = !/path/to/extension/bar.py
340 bar = !/path/to/extension/bar.py
313 # ditto, but no path was supplied for extension baz
341 # ditto, but no path was supplied for extension baz
314 baz = !
342 baz = !
315
343
316 enabled extensions:
344 enabled extensions:
317
345
318 children command to display child changesets (DEPRECATED)
346 children command to display child changesets (DEPRECATED)
319 rebase command to move sets of revisions to a different ancestor
347 rebase command to move sets of revisions to a different ancestor
320
348
321 disabled extensions:
349 disabled extensions:
322
350
323 acl hooks for controlling repository access
351 acl hooks for controlling repository access
324 blackbox log repository events to a blackbox for debugging
352 blackbox log repository events to a blackbox for debugging
325 bugzilla hooks for integrating with the Bugzilla bug tracker
353 bugzilla hooks for integrating with the Bugzilla bug tracker
326 censor erase file content at a given revision
354 censor erase file content at a given revision
327 churn command to display statistics about repository history
355 churn command to display statistics about repository history
328 clonebundles advertise pre-generated bundles to seed clones
356 clonebundles advertise pre-generated bundles to seed clones
329 closehead close arbitrary heads without checking them out first
357 closehead close arbitrary heads without checking them out first
330 convert import revisions from foreign VCS repositories into
358 convert import revisions from foreign VCS repositories into
331 Mercurial
359 Mercurial
332 eol automatically manage newlines in repository files
360 eol automatically manage newlines in repository files
333 extdiff command to allow external programs to compare revisions
361 extdiff command to allow external programs to compare revisions
334 factotum http authentication with factotum
362 factotum http authentication with factotum
335 githelp try mapping git commands to Mercurial commands
363 githelp try mapping git commands to Mercurial commands
336 gpg commands to sign and verify changesets
364 gpg commands to sign and verify changesets
337 hgk browse the repository in a graphical way
365 hgk browse the repository in a graphical way
338 highlight syntax highlighting for hgweb (requires Pygments)
366 highlight syntax highlighting for hgweb (requires Pygments)
339 histedit interactive history editing
367 histedit interactive history editing
340 keyword expand keywords in tracked files
368 keyword expand keywords in tracked files
341 largefiles track large binary files
369 largefiles track large binary files
342 mq manage a stack of patches
370 mq manage a stack of patches
343 notify hooks for sending email push notifications
371 notify hooks for sending email push notifications
344 patchbomb command to send changesets as (a series of) patch emails
372 patchbomb command to send changesets as (a series of) patch emails
345 purge command to delete untracked files from the working
373 purge command to delete untracked files from the working
346 directory
374 directory
347 relink recreates hardlinks between repository clones
375 relink recreates hardlinks between repository clones
348 schemes extend schemes with shortcuts to repository swarms
376 schemes extend schemes with shortcuts to repository swarms
349 share share a common history between several working directories
377 share share a common history between several working directories
350 shelve save and restore changes to the working directory
378 shelve save and restore changes to the working directory
351 strip strip changesets and their descendants from history
379 strip strip changesets and their descendants from history
352 transplant command to transplant changesets from another branch
380 transplant command to transplant changesets from another branch
353 win32mbcs allow the use of MBCS paths with problematic encodings
381 win32mbcs allow the use of MBCS paths with problematic encodings
354 zeroconf discover and advertise repositories on the local network
382 zeroconf discover and advertise repositories on the local network
355
383
356 #endif
384 #endif
357
385
358 Verify that deprecated extensions are included if --verbose:
386 Verify that deprecated extensions are included if --verbose:
359
387
360 $ hg -v help extensions | grep children
388 $ hg -v help extensions | grep children
361 children command to display child changesets (DEPRECATED)
389 children command to display child changesets (DEPRECATED)
362
390
363 Verify that extension keywords appear in help templates
391 Verify that extension keywords appear in help templates
364
392
365 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
393 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
366
394
367 Test short command list with verbose option
395 Test short command list with verbose option
368
396
369 $ hg -v help shortlist
397 $ hg -v help shortlist
370 Mercurial Distributed SCM
398 Mercurial Distributed SCM
371
399
372 basic commands:
400 basic commands:
373
401
374 add add the specified files on the next commit
402 add add the specified files on the next commit
375 annotate, blame
403 annotate, blame
376 show changeset information by line for each file
404 show changeset information by line for each file
377 clone make a copy of an existing repository
405 clone make a copy of an existing repository
378 commit, ci commit the specified files or all outstanding changes
406 commit, ci commit the specified files or all outstanding changes
379 diff diff repository (or selected files)
407 diff diff repository (or selected files)
380 export dump the header and diffs for one or more changesets
408 export dump the header and diffs for one or more changesets
381 forget forget the specified files on the next commit
409 forget forget the specified files on the next commit
382 init create a new repository in the given directory
410 init create a new repository in the given directory
383 log, history show revision history of entire repository or files
411 log, history show revision history of entire repository or files
384 merge merge another revision into working directory
412 merge merge another revision into working directory
385 pull pull changes from the specified source
413 pull pull changes from the specified source
386 push push changes to the specified destination
414 push push changes to the specified destination
387 remove, rm remove the specified files on the next commit
415 remove, rm remove the specified files on the next commit
388 serve start stand-alone webserver
416 serve start stand-alone webserver
389 status, st show changed files in the working directory
417 status, st show changed files in the working directory
390 summary, sum summarize working directory state
418 summary, sum summarize working directory state
391 update, up, checkout, co
419 update, up, checkout, co
392 update working directory (or switch revisions)
420 update working directory (or switch revisions)
393
421
394 global options ([+] can be repeated):
422 global options ([+] can be repeated):
395
423
396 -R --repository REPO repository root directory or name of overlay bundle
424 -R --repository REPO repository root directory or name of overlay bundle
397 file
425 file
398 --cwd DIR change working directory
426 --cwd DIR change working directory
399 -y --noninteractive do not prompt, automatically pick the first choice for
427 -y --noninteractive do not prompt, automatically pick the first choice for
400 all prompts
428 all prompts
401 -q --quiet suppress output
429 -q --quiet suppress output
402 -v --verbose enable additional output
430 -v --verbose enable additional output
403 --color TYPE when to colorize (boolean, always, auto, never, or
431 --color TYPE when to colorize (boolean, always, auto, never, or
404 debug)
432 debug)
405 --config CONFIG [+] set/override config option (use 'section.name=value')
433 --config CONFIG [+] set/override config option (use 'section.name=value')
406 --debug enable debugging output
434 --debug enable debugging output
407 --debugger start debugger
435 --debugger start debugger
408 --encoding ENCODE set the charset encoding (default: ascii)
436 --encoding ENCODE set the charset encoding (default: ascii)
409 --encodingmode MODE set the charset encoding mode (default: strict)
437 --encodingmode MODE set the charset encoding mode (default: strict)
410 --traceback always print a traceback on exception
438 --traceback always print a traceback on exception
411 --time time how long the command takes
439 --time time how long the command takes
412 --profile print command execution profile
440 --profile print command execution profile
413 --version output version information and exit
441 --version output version information and exit
414 -h --help display help and exit
442 -h --help display help and exit
415 --hidden consider hidden changesets
443 --hidden consider hidden changesets
416 --pager TYPE when to paginate (boolean, always, auto, or never)
444 --pager TYPE when to paginate (boolean, always, auto, or never)
417 (default: auto)
445 (default: auto)
418
446
419 (use 'hg help' for the full list of commands)
447 (use 'hg help' for the full list of commands)
420
448
421 $ hg add -h
449 $ hg add -h
422 hg add [OPTION]... [FILE]...
450 hg add [OPTION]... [FILE]...
423
451
424 add the specified files on the next commit
452 add the specified files on the next commit
425
453
426 Schedule files to be version controlled and added to the repository.
454 Schedule files to be version controlled and added to the repository.
427
455
428 The files will be added to the repository at the next commit. To undo an
456 The files will be added to the repository at the next commit. To undo an
429 add before that, see 'hg forget'.
457 add before that, see 'hg forget'.
430
458
431 If no names are given, add all files to the repository (except files
459 If no names are given, add all files to the repository (except files
432 matching ".hgignore").
460 matching ".hgignore").
433
461
434 Returns 0 if all files are successfully added.
462 Returns 0 if all files are successfully added.
435
463
436 options ([+] can be repeated):
464 options ([+] can be repeated):
437
465
438 -I --include PATTERN [+] include names matching the given patterns
466 -I --include PATTERN [+] include names matching the given patterns
439 -X --exclude PATTERN [+] exclude names matching the given patterns
467 -X --exclude PATTERN [+] exclude names matching the given patterns
440 -S --subrepos recurse into subrepositories
468 -S --subrepos recurse into subrepositories
441 -n --dry-run do not perform actions, just print output
469 -n --dry-run do not perform actions, just print output
442
470
443 (some details hidden, use --verbose to show complete help)
471 (some details hidden, use --verbose to show complete help)
444
472
445 Verbose help for add
473 Verbose help for add
446
474
447 $ hg add -hv
475 $ hg add -hv
448 hg add [OPTION]... [FILE]...
476 hg add [OPTION]... [FILE]...
449
477
450 add the specified files on the next commit
478 add the specified files on the next commit
451
479
452 Schedule files to be version controlled and added to the repository.
480 Schedule files to be version controlled and added to the repository.
453
481
454 The files will be added to the repository at the next commit. To undo an
482 The files will be added to the repository at the next commit. To undo an
455 add before that, see 'hg forget'.
483 add before that, see 'hg forget'.
456
484
457 If no names are given, add all files to the repository (except files
485 If no names are given, add all files to the repository (except files
458 matching ".hgignore").
486 matching ".hgignore").
459
487
460 Examples:
488 Examples:
461
489
462 - New (unknown) files are added automatically by 'hg add':
490 - New (unknown) files are added automatically by 'hg add':
463
491
464 $ ls
492 $ ls
465 foo.c
493 foo.c
466 $ hg status
494 $ hg status
467 ? foo.c
495 ? foo.c
468 $ hg add
496 $ hg add
469 adding foo.c
497 adding foo.c
470 $ hg status
498 $ hg status
471 A foo.c
499 A foo.c
472
500
473 - Specific files to be added can be specified:
501 - Specific files to be added can be specified:
474
502
475 $ ls
503 $ ls
476 bar.c foo.c
504 bar.c foo.c
477 $ hg status
505 $ hg status
478 ? bar.c
506 ? bar.c
479 ? foo.c
507 ? foo.c
480 $ hg add bar.c
508 $ hg add bar.c
481 $ hg status
509 $ hg status
482 A bar.c
510 A bar.c
483 ? foo.c
511 ? foo.c
484
512
485 Returns 0 if all files are successfully added.
513 Returns 0 if all files are successfully added.
486
514
487 options ([+] can be repeated):
515 options ([+] can be repeated):
488
516
489 -I --include PATTERN [+] include names matching the given patterns
517 -I --include PATTERN [+] include names matching the given patterns
490 -X --exclude PATTERN [+] exclude names matching the given patterns
518 -X --exclude PATTERN [+] exclude names matching the given patterns
491 -S --subrepos recurse into subrepositories
519 -S --subrepos recurse into subrepositories
492 -n --dry-run do not perform actions, just print output
520 -n --dry-run do not perform actions, just print output
493
521
494 global options ([+] can be repeated):
522 global options ([+] can be repeated):
495
523
496 -R --repository REPO repository root directory or name of overlay bundle
524 -R --repository REPO repository root directory or name of overlay bundle
497 file
525 file
498 --cwd DIR change working directory
526 --cwd DIR change working directory
499 -y --noninteractive do not prompt, automatically pick the first choice for
527 -y --noninteractive do not prompt, automatically pick the first choice for
500 all prompts
528 all prompts
501 -q --quiet suppress output
529 -q --quiet suppress output
502 -v --verbose enable additional output
530 -v --verbose enable additional output
503 --color TYPE when to colorize (boolean, always, auto, never, or
531 --color TYPE when to colorize (boolean, always, auto, never, or
504 debug)
532 debug)
505 --config CONFIG [+] set/override config option (use 'section.name=value')
533 --config CONFIG [+] set/override config option (use 'section.name=value')
506 --debug enable debugging output
534 --debug enable debugging output
507 --debugger start debugger
535 --debugger start debugger
508 --encoding ENCODE set the charset encoding (default: ascii)
536 --encoding ENCODE set the charset encoding (default: ascii)
509 --encodingmode MODE set the charset encoding mode (default: strict)
537 --encodingmode MODE set the charset encoding mode (default: strict)
510 --traceback always print a traceback on exception
538 --traceback always print a traceback on exception
511 --time time how long the command takes
539 --time time how long the command takes
512 --profile print command execution profile
540 --profile print command execution profile
513 --version output version information and exit
541 --version output version information and exit
514 -h --help display help and exit
542 -h --help display help and exit
515 --hidden consider hidden changesets
543 --hidden consider hidden changesets
516 --pager TYPE when to paginate (boolean, always, auto, or never)
544 --pager TYPE when to paginate (boolean, always, auto, or never)
517 (default: auto)
545 (default: auto)
518
546
519 Test the textwidth config option
547 Test the textwidth config option
520
548
521 $ hg root -h --config ui.textwidth=50
549 $ hg root -h --config ui.textwidth=50
522 hg root
550 hg root
523
551
524 print the root (top) of the current working
552 print the root (top) of the current working
525 directory
553 directory
526
554
527 Print the root directory of the current
555 Print the root directory of the current
528 repository.
556 repository.
529
557
530 Returns 0 on success.
558 Returns 0 on success.
531
559
532 (some details hidden, use --verbose to show
560 (some details hidden, use --verbose to show
533 complete help)
561 complete help)
534
562
535 Test help option with version option
563 Test help option with version option
536
564
537 $ hg add -h --version
565 $ hg add -h --version
538 Mercurial Distributed SCM (version *) (glob)
566 Mercurial Distributed SCM (version *) (glob)
539 (see https://mercurial-scm.org for more information)
567 (see https://mercurial-scm.org for more information)
540
568
541 Copyright (C) 2005-* Matt Mackall and others (glob)
569 Copyright (C) 2005-* Matt Mackall and others (glob)
542 This is free software; see the source for copying conditions. There is NO
570 This is free software; see the source for copying conditions. There is NO
543 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
571 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
544
572
545 $ hg add --skjdfks
573 $ hg add --skjdfks
546 hg add: option --skjdfks not recognized
574 hg add: option --skjdfks not recognized
547 hg add [OPTION]... [FILE]...
575 hg add [OPTION]... [FILE]...
548
576
549 add the specified files on the next commit
577 add the specified files on the next commit
550
578
551 options ([+] can be repeated):
579 options ([+] can be repeated):
552
580
553 -I --include PATTERN [+] include names matching the given patterns
581 -I --include PATTERN [+] include names matching the given patterns
554 -X --exclude PATTERN [+] exclude names matching the given patterns
582 -X --exclude PATTERN [+] exclude names matching the given patterns
555 -S --subrepos recurse into subrepositories
583 -S --subrepos recurse into subrepositories
556 -n --dry-run do not perform actions, just print output
584 -n --dry-run do not perform actions, just print output
557
585
558 (use 'hg add -h' to show more help)
586 (use 'hg add -h' to show more help)
559 [255]
587 [255]
560
588
561 Test ambiguous command help
589 Test ambiguous command help
562
590
563 $ hg help ad
591 $ hg help ad
564 list of commands:
592 list of commands:
565
593
566 add add the specified files on the next commit
594 add add the specified files on the next commit
567 addremove add all new files, delete all missing files
595 addremove add all new files, delete all missing files
568
596
569 (use 'hg help -v ad' to show built-in aliases and global options)
597 (use 'hg help -v ad' to show built-in aliases and global options)
570
598
571 Test command without options
599 Test command without options
572
600
573 $ hg help verify
601 $ hg help verify
574 hg verify
602 hg verify
575
603
576 verify the integrity of the repository
604 verify the integrity of the repository
577
605
578 Verify the integrity of the current repository.
606 Verify the integrity of the current repository.
579
607
580 This will perform an extensive check of the repository's integrity,
608 This will perform an extensive check of the repository's integrity,
581 validating the hashes and checksums of each entry in the changelog,
609 validating the hashes and checksums of each entry in the changelog,
582 manifest, and tracked files, as well as the integrity of their crosslinks
610 manifest, and tracked files, as well as the integrity of their crosslinks
583 and indices.
611 and indices.
584
612
585 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
613 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
586 information about recovery from corruption of the repository.
614 information about recovery from corruption of the repository.
587
615
588 Returns 0 on success, 1 if errors are encountered.
616 Returns 0 on success, 1 if errors are encountered.
589
617
590 (some details hidden, use --verbose to show complete help)
618 (some details hidden, use --verbose to show complete help)
591
619
592 $ hg help diff
620 $ hg help diff
593 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
621 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
594
622
595 diff repository (or selected files)
623 diff repository (or selected files)
596
624
597 Show differences between revisions for the specified files.
625 Show differences between revisions for the specified files.
598
626
599 Differences between files are shown using the unified diff format.
627 Differences between files are shown using the unified diff format.
600
628
601 Note:
629 Note:
602 'hg diff' may generate unexpected results for merges, as it will
630 'hg diff' may generate unexpected results for merges, as it will
603 default to comparing against the working directory's first parent
631 default to comparing against the working directory's first parent
604 changeset if no revisions are specified.
632 changeset if no revisions are specified.
605
633
606 When two revision arguments are given, then changes are shown between
634 When two revision arguments are given, then changes are shown between
607 those revisions. If only one revision is specified then that revision is
635 those revisions. If only one revision is specified then that revision is
608 compared to the working directory, and, when no revisions are specified,
636 compared to the working directory, and, when no revisions are specified,
609 the working directory files are compared to its first parent.
637 the working directory files are compared to its first parent.
610
638
611 Alternatively you can specify -c/--change with a revision to see the
639 Alternatively you can specify -c/--change with a revision to see the
612 changes in that changeset relative to its first parent.
640 changes in that changeset relative to its first parent.
613
641
614 Without the -a/--text option, diff will avoid generating diffs of files it
642 Without the -a/--text option, diff will avoid generating diffs of files it
615 detects as binary. With -a, diff will generate a diff anyway, probably
643 detects as binary. With -a, diff will generate a diff anyway, probably
616 with undesirable results.
644 with undesirable results.
617
645
618 Use the -g/--git option to generate diffs in the git extended diff format.
646 Use the -g/--git option to generate diffs in the git extended diff format.
619 For more information, read 'hg help diffs'.
647 For more information, read 'hg help diffs'.
620
648
621 Returns 0 on success.
649 Returns 0 on success.
622
650
623 options ([+] can be repeated):
651 options ([+] can be repeated):
624
652
625 -r --rev REV [+] revision
653 -r --rev REV [+] revision
626 -c --change REV change made by revision
654 -c --change REV change made by revision
627 -a --text treat all files as text
655 -a --text treat all files as text
628 -g --git use git extended diff format
656 -g --git use git extended diff format
629 --binary generate binary diffs in git mode (default)
657 --binary generate binary diffs in git mode (default)
630 --nodates omit dates from diff headers
658 --nodates omit dates from diff headers
631 --noprefix omit a/ and b/ prefixes from filenames
659 --noprefix omit a/ and b/ prefixes from filenames
632 -p --show-function show which function each change is in
660 -p --show-function show which function each change is in
633 --reverse produce a diff that undoes the changes
661 --reverse produce a diff that undoes the changes
634 -w --ignore-all-space ignore white space when comparing lines
662 -w --ignore-all-space ignore white space when comparing lines
635 -b --ignore-space-change ignore changes in the amount of white space
663 -b --ignore-space-change ignore changes in the amount of white space
636 -B --ignore-blank-lines ignore changes whose lines are all blank
664 -B --ignore-blank-lines ignore changes whose lines are all blank
637 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
665 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
638 -U --unified NUM number of lines of context to show
666 -U --unified NUM number of lines of context to show
639 --stat output diffstat-style summary of changes
667 --stat output diffstat-style summary of changes
640 --root DIR produce diffs relative to subdirectory
668 --root DIR produce diffs relative to subdirectory
641 -I --include PATTERN [+] include names matching the given patterns
669 -I --include PATTERN [+] include names matching the given patterns
642 -X --exclude PATTERN [+] exclude names matching the given patterns
670 -X --exclude PATTERN [+] exclude names matching the given patterns
643 -S --subrepos recurse into subrepositories
671 -S --subrepos recurse into subrepositories
644
672
645 (some details hidden, use --verbose to show complete help)
673 (some details hidden, use --verbose to show complete help)
646
674
647 $ hg help status
675 $ hg help status
648 hg status [OPTION]... [FILE]...
676 hg status [OPTION]... [FILE]...
649
677
650 aliases: st
678 aliases: st
651
679
652 show changed files in the working directory
680 show changed files in the working directory
653
681
654 Show status of files in the repository. If names are given, only files
682 Show status of files in the repository. If names are given, only files
655 that match are shown. Files that are clean or ignored or the source of a
683 that match are shown. Files that are clean or ignored or the source of a
656 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
684 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
657 -C/--copies or -A/--all are given. Unless options described with "show
685 -C/--copies or -A/--all are given. Unless options described with "show
658 only ..." are given, the options -mardu are used.
686 only ..." are given, the options -mardu are used.
659
687
660 Option -q/--quiet hides untracked (unknown and ignored) files unless
688 Option -q/--quiet hides untracked (unknown and ignored) files unless
661 explicitly requested with -u/--unknown or -i/--ignored.
689 explicitly requested with -u/--unknown or -i/--ignored.
662
690
663 Note:
691 Note:
664 'hg status' may appear to disagree with diff if permissions have
692 'hg status' may appear to disagree with diff if permissions have
665 changed or a merge has occurred. The standard diff format does not
693 changed or a merge has occurred. The standard diff format does not
666 report permission changes and diff only reports changes relative to one
694 report permission changes and diff only reports changes relative to one
667 merge parent.
695 merge parent.
668
696
669 If one revision is given, it is used as the base revision. If two
697 If one revision is given, it is used as the base revision. If two
670 revisions are given, the differences between them are shown. The --change
698 revisions are given, the differences between them are shown. The --change
671 option can also be used as a shortcut to list the changed files of a
699 option can also be used as a shortcut to list the changed files of a
672 revision from its first parent.
700 revision from its first parent.
673
701
674 The codes used to show the status of files are:
702 The codes used to show the status of files are:
675
703
676 M = modified
704 M = modified
677 A = added
705 A = added
678 R = removed
706 R = removed
679 C = clean
707 C = clean
680 ! = missing (deleted by non-hg command, but still tracked)
708 ! = missing (deleted by non-hg command, but still tracked)
681 ? = not tracked
709 ? = not tracked
682 I = ignored
710 I = ignored
683 = origin of the previous file (with --copies)
711 = origin of the previous file (with --copies)
684
712
685 Returns 0 on success.
713 Returns 0 on success.
686
714
687 options ([+] can be repeated):
715 options ([+] can be repeated):
688
716
689 -A --all show status of all files
717 -A --all show status of all files
690 -m --modified show only modified files
718 -m --modified show only modified files
691 -a --added show only added files
719 -a --added show only added files
692 -r --removed show only removed files
720 -r --removed show only removed files
693 -d --deleted show only deleted (but tracked) files
721 -d --deleted show only deleted (but tracked) files
694 -c --clean show only files without changes
722 -c --clean show only files without changes
695 -u --unknown show only unknown (not tracked) files
723 -u --unknown show only unknown (not tracked) files
696 -i --ignored show only ignored files
724 -i --ignored show only ignored files
697 -n --no-status hide status prefix
725 -n --no-status hide status prefix
698 -C --copies show source of copied files
726 -C --copies show source of copied files
699 -0 --print0 end filenames with NUL, for use with xargs
727 -0 --print0 end filenames with NUL, for use with xargs
700 --rev REV [+] show difference from revision
728 --rev REV [+] show difference from revision
701 --change REV list the changed files of a revision
729 --change REV list the changed files of a revision
702 -I --include PATTERN [+] include names matching the given patterns
730 -I --include PATTERN [+] include names matching the given patterns
703 -X --exclude PATTERN [+] exclude names matching the given patterns
731 -X --exclude PATTERN [+] exclude names matching the given patterns
704 -S --subrepos recurse into subrepositories
732 -S --subrepos recurse into subrepositories
705 -T --template TEMPLATE display with template
733 -T --template TEMPLATE display with template
706
734
707 (some details hidden, use --verbose to show complete help)
735 (some details hidden, use --verbose to show complete help)
708
736
709 $ hg -q help status
737 $ hg -q help status
710 hg status [OPTION]... [FILE]...
738 hg status [OPTION]... [FILE]...
711
739
712 show changed files in the working directory
740 show changed files in the working directory
713
741
714 $ hg help foo
742 $ hg help foo
715 abort: no such help topic: foo
743 abort: no such help topic: foo
716 (try 'hg help --keyword foo')
744 (try 'hg help --keyword foo')
717 [255]
745 [255]
718
746
719 $ hg skjdfks
747 $ hg skjdfks
720 hg: unknown command 'skjdfks'
748 hg: unknown command 'skjdfks'
721 (use 'hg help' for a list of commands)
749 (use 'hg help' for a list of commands)
722 [255]
750 [255]
723
751
724 Typoed command gives suggestion
752 Typoed command gives suggestion
725 $ hg puls
753 $ hg puls
726 hg: unknown command 'puls'
754 hg: unknown command 'puls'
727 (did you mean one of pull, push?)
755 (did you mean one of pull, push?)
728 [255]
756 [255]
729
757
730 Not enabled extension gets suggested
758 Not enabled extension gets suggested
731
759
732 $ hg rebase
760 $ hg rebase
733 hg: unknown command 'rebase'
761 hg: unknown command 'rebase'
734 'rebase' is provided by the following extension:
762 'rebase' is provided by the following extension:
735
763
736 rebase command to move sets of revisions to a different ancestor
764 rebase command to move sets of revisions to a different ancestor
737
765
738 (use 'hg help extensions' for information on enabling extensions)
766 (use 'hg help extensions' for information on enabling extensions)
739 [255]
767 [255]
740
768
741 Disabled extension gets suggested
769 Disabled extension gets suggested
742 $ hg --config extensions.rebase=! rebase
770 $ hg --config extensions.rebase=! rebase
743 hg: unknown command 'rebase'
771 hg: unknown command 'rebase'
744 'rebase' is provided by the following extension:
772 'rebase' is provided by the following extension:
745
773
746 rebase command to move sets of revisions to a different ancestor
774 rebase command to move sets of revisions to a different ancestor
747
775
748 (use 'hg help extensions' for information on enabling extensions)
776 (use 'hg help extensions' for information on enabling extensions)
749 [255]
777 [255]
750
778
751 Make sure that we don't run afoul of the help system thinking that
779 Make sure that we don't run afoul of the help system thinking that
752 this is a section and erroring out weirdly.
780 this is a section and erroring out weirdly.
753
781
754 $ hg .log
782 $ hg .log
755 hg: unknown command '.log'
783 hg: unknown command '.log'
756 (did you mean log?)
784 (did you mean log?)
757 [255]
785 [255]
758
786
759 $ hg log.
787 $ hg log.
760 hg: unknown command 'log.'
788 hg: unknown command 'log.'
761 (did you mean log?)
789 (did you mean log?)
762 [255]
790 [255]
763 $ hg pu.lh
791 $ hg pu.lh
764 hg: unknown command 'pu.lh'
792 hg: unknown command 'pu.lh'
765 (did you mean one of pull, push?)
793 (did you mean one of pull, push?)
766 [255]
794 [255]
767
795
768 $ cat > helpext.py <<EOF
796 $ cat > helpext.py <<EOF
769 > import os
797 > import os
770 > from mercurial import commands, fancyopts, registrar
798 > from mercurial import commands, fancyopts, registrar
771 >
799 >
772 > def func(arg):
800 > def func(arg):
773 > return '%sfoo' % arg
801 > return '%sfoo' % arg
774 > class customopt(fancyopts.customopt):
802 > class customopt(fancyopts.customopt):
775 > def newstate(self, oldstate, newparam, abort):
803 > def newstate(self, oldstate, newparam, abort):
776 > return '%sbar' % oldstate
804 > return '%sbar' % oldstate
777 > cmdtable = {}
805 > cmdtable = {}
778 > command = registrar.command(cmdtable)
806 > command = registrar.command(cmdtable)
779 >
807 >
780 > @command(b'nohelp',
808 > @command(b'nohelp',
781 > [(b'', b'longdesc', 3, b'x'*67),
809 > [(b'', b'longdesc', 3, b'x'*67),
782 > (b'n', b'', None, b'normal desc'),
810 > (b'n', b'', None, b'normal desc'),
783 > (b'', b'newline', b'', b'line1\nline2'),
811 > (b'', b'newline', b'', b'line1\nline2'),
784 > (b'', b'callableopt', func, b'adds foo'),
812 > (b'', b'callableopt', func, b'adds foo'),
785 > (b'', b'customopt', customopt(''), b'adds bar'),
813 > (b'', b'customopt', customopt(''), b'adds bar'),
786 > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')],
814 > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')],
787 > b'hg nohelp',
815 > b'hg nohelp',
788 > norepo=True)
816 > norepo=True)
789 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
817 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
790 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
818 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
791 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
819 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
792 > def nohelp(ui, *args, **kwargs):
820 > def nohelp(ui, *args, **kwargs):
793 > pass
821 > pass
794 >
822 >
795 > def uisetup(ui):
823 > def uisetup(ui):
796 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
824 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
797 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
825 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
798 >
826 >
799 > EOF
827 > EOF
800 $ echo '[extensions]' >> $HGRCPATH
828 $ echo '[extensions]' >> $HGRCPATH
801 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
829 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
802
830
803 Test for aliases
831 Test for aliases
804
832
805 $ hg help hgalias
833 $ hg help hgalias
806 hg hgalias [--remote]
834 hg hgalias [--remote]
807
835
808 alias for: hg summary
836 alias for: hg summary
809
837
810 summarize working directory state
838 summarize working directory state
811
839
812 This generates a brief summary of the working directory state, including
840 This generates a brief summary of the working directory state, including
813 parents, branch, commit status, phase and available updates.
841 parents, branch, commit status, phase and available updates.
814
842
815 With the --remote option, this will check the default paths for incoming
843 With the --remote option, this will check the default paths for incoming
816 and outgoing changes. This can be time-consuming.
844 and outgoing changes. This can be time-consuming.
817
845
818 Returns 0 on success.
846 Returns 0 on success.
819
847
820 defined by: helpext
848 defined by: helpext
821
849
822 options:
850 options:
823
851
824 --remote check for push and pull
852 --remote check for push and pull
825
853
826 (some details hidden, use --verbose to show complete help)
854 (some details hidden, use --verbose to show complete help)
827
855
828 $ hg help shellalias
856 $ hg help shellalias
829 hg shellalias
857 hg shellalias
830
858
831 shell alias for: echo hi
859 shell alias for: echo hi
832
860
833 (no help text available)
861 (no help text available)
834
862
835 defined by: helpext
863 defined by: helpext
836
864
837 (some details hidden, use --verbose to show complete help)
865 (some details hidden, use --verbose to show complete help)
838
866
839 Test command with no help text
867 Test command with no help text
840
868
841 $ hg help nohelp
869 $ hg help nohelp
842 hg nohelp
870 hg nohelp
843
871
844 (no help text available)
872 (no help text available)
845
873
846 options:
874 options:
847
875
848 --longdesc VALUE
876 --longdesc VALUE
849 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
877 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
850 xxxxxxxxxxxxxxxxxxxxxxx (default: 3)
878 xxxxxxxxxxxxxxxxxxxxxxx (default: 3)
851 -n -- normal desc
879 -n -- normal desc
852 --newline VALUE line1 line2
880 --newline VALUE line1 line2
853 --callableopt VALUE adds foo
881 --callableopt VALUE adds foo
854 --customopt VALUE adds bar
882 --customopt VALUE adds bar
855 --customopt-withdefault VALUE adds bar (default: foo)
883 --customopt-withdefault VALUE adds bar (default: foo)
856
884
857 (some details hidden, use --verbose to show complete help)
885 (some details hidden, use --verbose to show complete help)
858
886
859 $ hg help -k nohelp
887 $ hg help -k nohelp
860 Commands:
888 Commands:
861
889
862 nohelp hg nohelp
890 nohelp hg nohelp
863
891
864 Extension Commands:
892 Extension Commands:
865
893
866 nohelp (no help text available)
894 nohelp (no help text available)
867
895
868 Test that default list of commands omits extension commands
896 Test that default list of commands omits extension commands
869
897
870 #if no-extraextensions
898 #if no-extraextensions
871
899
872 $ hg help
900 $ hg help
873 Mercurial Distributed SCM
901 Mercurial Distributed SCM
874
902
875 list of commands:
903 list of commands:
876
904
877 Repository creation:
905 Repository creation:
878
906
879 clone make a copy of an existing repository
907 clone make a copy of an existing repository
880 init create a new repository in the given directory
908 init create a new repository in the given directory
881
909
882 Remote repository management:
910 Remote repository management:
883
911
884 incoming show new changesets found in source
912 incoming show new changesets found in source
885 outgoing show changesets not found in the destination
913 outgoing show changesets not found in the destination
886 paths show aliases for remote repositories
914 paths show aliases for remote repositories
887 pull pull changes from the specified source
915 pull pull changes from the specified source
888 push push changes to the specified destination
916 push push changes to the specified destination
889 serve start stand-alone webserver
917 serve start stand-alone webserver
890
918
891 Change creation:
919 Change creation:
892
920
893 commit commit the specified files or all outstanding changes
921 commit commit the specified files or all outstanding changes
894
922
895 Change manipulation:
923 Change manipulation:
896
924
897 backout reverse effect of earlier changeset
925 backout reverse effect of earlier changeset
898 graft copy changes from other branches onto the current branch
926 graft copy changes from other branches onto the current branch
899 merge merge another revision into working directory
927 merge merge another revision into working directory
900
928
901 Change organization:
929 Change organization:
902
930
903 bookmarks create a new bookmark or list existing bookmarks
931 bookmarks create a new bookmark or list existing bookmarks
904 branch set or show the current branch name
932 branch set or show the current branch name
905 branches list repository named branches
933 branches list repository named branches
906 phase set or show the current phase name
934 phase set or show the current phase name
907 tag add one or more tags for the current or given revision
935 tag add one or more tags for the current or given revision
908 tags list repository tags
936 tags list repository tags
909
937
910 File content management:
938 File content management:
911
939
912 annotate show changeset information by line for each file
940 annotate show changeset information by line for each file
913 cat output the current or given revision of files
941 cat output the current or given revision of files
914 copy mark files as copied for the next commit
942 copy mark files as copied for the next commit
915 diff diff repository (or selected files)
943 diff diff repository (or selected files)
916 grep search revision history for a pattern in specified files
944 grep search revision history for a pattern in specified files
917
945
918 Change navigation:
946 Change navigation:
919
947
920 bisect subdivision search of changesets
948 bisect subdivision search of changesets
921 heads show branch heads
949 heads show branch heads
922 identify identify the working directory or specified revision
950 identify identify the working directory or specified revision
923 log show revision history of entire repository or files
951 log show revision history of entire repository or files
924
952
925 Working directory management:
953 Working directory management:
926
954
927 add add the specified files on the next commit
955 add add the specified files on the next commit
928 addremove add all new files, delete all missing files
956 addremove add all new files, delete all missing files
929 files list tracked files
957 files list tracked files
930 forget forget the specified files on the next commit
958 forget forget the specified files on the next commit
931 remove remove the specified files on the next commit
959 remove remove the specified files on the next commit
932 rename rename files; equivalent of copy + remove
960 rename rename files; equivalent of copy + remove
933 resolve redo merges or set/view the merge status of files
961 resolve redo merges or set/view the merge status of files
934 revert restore files to their checkout state
962 revert restore files to their checkout state
935 root print the root (top) of the current working directory
963 root print the root (top) of the current working directory
936 status show changed files in the working directory
964 status show changed files in the working directory
937 summary summarize working directory state
965 summary summarize working directory state
938 update update working directory (or switch revisions)
966 update update working directory (or switch revisions)
939
967
940 Change import/export:
968 Change import/export:
941
969
942 archive create an unversioned archive of a repository revision
970 archive create an unversioned archive of a repository revision
943 bundle create a bundle file
971 bundle create a bundle file
944 export dump the header and diffs for one or more changesets
972 export dump the header and diffs for one or more changesets
945 import import an ordered set of patches
973 import import an ordered set of patches
946 unbundle apply one or more bundle files
974 unbundle apply one or more bundle files
947
975
948 Repository maintenance:
976 Repository maintenance:
949
977
950 manifest output the current or given revision of the project manifest
978 manifest output the current or given revision of the project manifest
951 recover roll back an interrupted transaction
979 recover roll back an interrupted transaction
952 verify verify the integrity of the repository
980 verify verify the integrity of the repository
953
981
954 Help:
982 Help:
955
983
956 config show combined config settings from all hgrc files
984 config show combined config settings from all hgrc files
957 help show help for a given topic or a help overview
985 help show help for a given topic or a help overview
958 version output version and copyright information
986 version output version and copyright information
959
987
960 enabled extensions:
988 enabled extensions:
961
989
962 helpext (no help text available)
990 helpext (no help text available)
963
991
964 additional help topics:
992 additional help topics:
965
993
966 bundlespec Bundle File Formats
994 Mercurial identifiers:
995
996 filesets Specifying File Sets
997 hgignore Syntax for Mercurial Ignore Files
998 patterns File Name Patterns
999 revisions Specifying Revisions
1000 urls URL Paths
1001
1002 Mercurial output:
1003
967 color Colorizing Outputs
1004 color Colorizing Outputs
1005 dates Date Formats
1006 diffs Diff Formats
1007 templating Template Usage
1008
1009 Mercurial configuration:
1010
968 config Configuration Files
1011 config Configuration Files
969 dates Date Formats
970 deprecated Deprecated Features
971 diffs Diff Formats
972 environment Environment Variables
1012 environment Environment Variables
973 extensions Using Additional Features
1013 extensions Using Additional Features
974 filesets Specifying File Sets
975 flags Command-line flags
1014 flags Command-line flags
976 glossary Glossary
977 hgignore Syntax for Mercurial Ignore Files
978 hgweb Configuring hgweb
1015 hgweb Configuring hgweb
979 internals Technical implementation topics
980 merge-tools Merge Tools
1016 merge-tools Merge Tools
981 pager Pager Support
1017 pager Pager Support
982 patterns File Name Patterns
1018
1019 Concepts:
1020
1021 bundlespec Bundle File Formats
1022 glossary Glossary
983 phases Working with Phases
1023 phases Working with Phases
984 revisions Specifying Revisions
1024 subrepos Subrepositories
1025
1026 Miscellaneous:
1027
1028 deprecated Deprecated Features
1029 internals Technical implementation topics
985 scripting Using Mercurial from scripts and automation
1030 scripting Using Mercurial from scripts and automation
986 subrepos Subrepositories
987 templating Template Usage
988 urls URL Paths
989
1031
990 (use 'hg help -v' to show built-in aliases and global options)
1032 (use 'hg help -v' to show built-in aliases and global options)
991
1033
992 #endif
1034 #endif
993
1035
994 Test list of internal help commands
1036 Test list of internal help commands
995
1037
996 $ hg help debug
1038 $ hg help debug
997 debug commands (internal and unsupported):
1039 debug commands (internal and unsupported):
998
1040
999 debugancestor
1041 debugancestor
1000 find the ancestor revision of two revisions in a given index
1042 find the ancestor revision of two revisions in a given index
1001 debugapplystreamclonebundle
1043 debugapplystreamclonebundle
1002 apply a stream clone bundle file
1044 apply a stream clone bundle file
1003 debugbuilddag
1045 debugbuilddag
1004 builds a repo with a given DAG from scratch in the current
1046 builds a repo with a given DAG from scratch in the current
1005 empty repo
1047 empty repo
1006 debugbundle lists the contents of a bundle
1048 debugbundle lists the contents of a bundle
1007 debugcapabilities
1049 debugcapabilities
1008 lists the capabilities of a remote peer
1050 lists the capabilities of a remote peer
1009 debugcheckstate
1051 debugcheckstate
1010 validate the correctness of the current dirstate
1052 validate the correctness of the current dirstate
1011 debugcolor show available color, effects or style
1053 debugcolor show available color, effects or style
1012 debugcommands
1054 debugcommands
1013 list all available commands and options
1055 list all available commands and options
1014 debugcomplete
1056 debugcomplete
1015 returns the completion list associated with the given command
1057 returns the completion list associated with the given command
1016 debugcreatestreamclonebundle
1058 debugcreatestreamclonebundle
1017 create a stream clone bundle file
1059 create a stream clone bundle file
1018 debugdag format the changelog or an index DAG as a concise textual
1060 debugdag format the changelog or an index DAG as a concise textual
1019 description
1061 description
1020 debugdata dump the contents of a data file revision
1062 debugdata dump the contents of a data file revision
1021 debugdate parse and display a date
1063 debugdate parse and display a date
1022 debugdeltachain
1064 debugdeltachain
1023 dump information about delta chains in a revlog
1065 dump information about delta chains in a revlog
1024 debugdirstate
1066 debugdirstate
1025 show the contents of the current dirstate
1067 show the contents of the current dirstate
1026 debugdiscovery
1068 debugdiscovery
1027 runs the changeset discovery protocol in isolation
1069 runs the changeset discovery protocol in isolation
1028 debugdownload
1070 debugdownload
1029 download a resource using Mercurial logic and config
1071 download a resource using Mercurial logic and config
1030 debugextensions
1072 debugextensions
1031 show information about active extensions
1073 show information about active extensions
1032 debugfileset parse and apply a fileset specification
1074 debugfileset parse and apply a fileset specification
1033 debugformat display format information about the current repository
1075 debugformat display format information about the current repository
1034 debugfsinfo show information detected about current filesystem
1076 debugfsinfo show information detected about current filesystem
1035 debuggetbundle
1077 debuggetbundle
1036 retrieves a bundle from a repo
1078 retrieves a bundle from a repo
1037 debugignore display the combined ignore pattern and information about
1079 debugignore display the combined ignore pattern and information about
1038 ignored files
1080 ignored files
1039 debugindex dump index data for a storage primitive
1081 debugindex dump index data for a storage primitive
1040 debugindexdot
1082 debugindexdot
1041 dump an index DAG as a graphviz dot file
1083 dump an index DAG as a graphviz dot file
1042 debugindexstats
1084 debugindexstats
1043 show stats related to the changelog index
1085 show stats related to the changelog index
1044 debuginstall test Mercurial installation
1086 debuginstall test Mercurial installation
1045 debugknown test whether node ids are known to a repo
1087 debugknown test whether node ids are known to a repo
1046 debuglocks show or modify state of locks
1088 debuglocks show or modify state of locks
1047 debugmanifestfulltextcache
1089 debugmanifestfulltextcache
1048 show, clear or amend the contents of the manifest fulltext
1090 show, clear or amend the contents of the manifest fulltext
1049 cache
1091 cache
1050 debugmergestate
1092 debugmergestate
1051 print merge state
1093 print merge state
1052 debugnamecomplete
1094 debugnamecomplete
1053 complete "names" - tags, open branch names, bookmark names
1095 complete "names" - tags, open branch names, bookmark names
1054 debugobsolete
1096 debugobsolete
1055 create arbitrary obsolete marker
1097 create arbitrary obsolete marker
1056 debugoptADV (no help text available)
1098 debugoptADV (no help text available)
1057 debugoptDEP (no help text available)
1099 debugoptDEP (no help text available)
1058 debugoptEXP (no help text available)
1100 debugoptEXP (no help text available)
1059 debugpathcomplete
1101 debugpathcomplete
1060 complete part or all of a tracked path
1102 complete part or all of a tracked path
1061 debugpeer establish a connection to a peer repository
1103 debugpeer establish a connection to a peer repository
1062 debugpickmergetool
1104 debugpickmergetool
1063 examine which merge tool is chosen for specified file
1105 examine which merge tool is chosen for specified file
1064 debugpushkey access the pushkey key/value protocol
1106 debugpushkey access the pushkey key/value protocol
1065 debugpvec (no help text available)
1107 debugpvec (no help text available)
1066 debugrebuilddirstate
1108 debugrebuilddirstate
1067 rebuild the dirstate as it would look like for the given
1109 rebuild the dirstate as it would look like for the given
1068 revision
1110 revision
1069 debugrebuildfncache
1111 debugrebuildfncache
1070 rebuild the fncache file
1112 rebuild the fncache file
1071 debugrename dump rename information
1113 debugrename dump rename information
1072 debugrevlog show data and statistics about a revlog
1114 debugrevlog show data and statistics about a revlog
1073 debugrevlogindex
1115 debugrevlogindex
1074 dump the contents of a revlog index
1116 dump the contents of a revlog index
1075 debugrevspec parse and apply a revision specification
1117 debugrevspec parse and apply a revision specification
1076 debugserve run a server with advanced settings
1118 debugserve run a server with advanced settings
1077 debugsetparents
1119 debugsetparents
1078 manually set the parents of the current working directory
1120 manually set the parents of the current working directory
1079 debugssl test a secure connection to a server
1121 debugssl test a secure connection to a server
1080 debugsub (no help text available)
1122 debugsub (no help text available)
1081 debugsuccessorssets
1123 debugsuccessorssets
1082 show set of successors for revision
1124 show set of successors for revision
1083 debugtemplate
1125 debugtemplate
1084 parse and apply a template
1126 parse and apply a template
1085 debuguigetpass
1127 debuguigetpass
1086 show prompt to type password
1128 show prompt to type password
1087 debuguiprompt
1129 debuguiprompt
1088 show plain prompt
1130 show plain prompt
1089 debugupdatecaches
1131 debugupdatecaches
1090 warm all known caches in the repository
1132 warm all known caches in the repository
1091 debugupgraderepo
1133 debugupgraderepo
1092 upgrade a repository to use different features
1134 upgrade a repository to use different features
1093 debugwalk show how files match on given patterns
1135 debugwalk show how files match on given patterns
1094 debugwhyunstable
1136 debugwhyunstable
1095 explain instabilities of a changeset
1137 explain instabilities of a changeset
1096 debugwireargs
1138 debugwireargs
1097 (no help text available)
1139 (no help text available)
1098 debugwireproto
1140 debugwireproto
1099 send wire protocol commands to a server
1141 send wire protocol commands to a server
1100
1142
1101 (use 'hg help -v debug' to show built-in aliases and global options)
1143 (use 'hg help -v debug' to show built-in aliases and global options)
1102
1144
1103 internals topic renders index of available sub-topics
1145 internals topic renders index of available sub-topics
1104
1146
1105 $ hg help internals
1147 $ hg help internals
1106 Technical implementation topics
1148 Technical implementation topics
1107 """""""""""""""""""""""""""""""
1149 """""""""""""""""""""""""""""""
1108
1150
1109 To access a subtopic, use "hg help internals.{subtopic-name}"
1151 To access a subtopic, use "hg help internals.{subtopic-name}"
1110
1152
1111 bundle2 Bundle2
1153 bundle2 Bundle2
1112 bundles Bundles
1154 bundles Bundles
1113 cbor CBOR
1155 cbor CBOR
1114 censor Censor
1156 censor Censor
1115 changegroups Changegroups
1157 changegroups Changegroups
1116 config Config Registrar
1158 config Config Registrar
1117 requirements Repository Requirements
1159 requirements Repository Requirements
1118 revlogs Revision Logs
1160 revlogs Revision Logs
1119 wireprotocol Wire Protocol
1161 wireprotocol Wire Protocol
1120 wireprotocolrpc
1162 wireprotocolrpc
1121 Wire Protocol RPC
1163 Wire Protocol RPC
1122 wireprotocolv2
1164 wireprotocolv2
1123 Wire Protocol Version 2
1165 Wire Protocol Version 2
1124
1166
1125 sub-topics can be accessed
1167 sub-topics can be accessed
1126
1168
1127 $ hg help internals.changegroups
1169 $ hg help internals.changegroups
1128 Changegroups
1170 Changegroups
1129 """"""""""""
1171 """"""""""""
1130
1172
1131 Changegroups are representations of repository revlog data, specifically
1173 Changegroups are representations of repository revlog data, specifically
1132 the changelog data, root/flat manifest data, treemanifest data, and
1174 the changelog data, root/flat manifest data, treemanifest data, and
1133 filelogs.
1175 filelogs.
1134
1176
1135 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1177 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1136 level, versions "1" and "2" are almost exactly the same, with the only
1178 level, versions "1" and "2" are almost exactly the same, with the only
1137 difference being an additional item in the *delta header*. Version "3"
1179 difference being an additional item in the *delta header*. Version "3"
1138 adds support for storage flags in the *delta header* and optionally
1180 adds support for storage flags in the *delta header* and optionally
1139 exchanging treemanifests (enabled by setting an option on the
1181 exchanging treemanifests (enabled by setting an option on the
1140 "changegroup" part in the bundle2).
1182 "changegroup" part in the bundle2).
1141
1183
1142 Changegroups when not exchanging treemanifests consist of 3 logical
1184 Changegroups when not exchanging treemanifests consist of 3 logical
1143 segments:
1185 segments:
1144
1186
1145 +---------------------------------+
1187 +---------------------------------+
1146 | | | |
1188 | | | |
1147 | changeset | manifest | filelogs |
1189 | changeset | manifest | filelogs |
1148 | | | |
1190 | | | |
1149 | | | |
1191 | | | |
1150 +---------------------------------+
1192 +---------------------------------+
1151
1193
1152 When exchanging treemanifests, there are 4 logical segments:
1194 When exchanging treemanifests, there are 4 logical segments:
1153
1195
1154 +-------------------------------------------------+
1196 +-------------------------------------------------+
1155 | | | | |
1197 | | | | |
1156 | changeset | root | treemanifests | filelogs |
1198 | changeset | root | treemanifests | filelogs |
1157 | | manifest | | |
1199 | | manifest | | |
1158 | | | | |
1200 | | | | |
1159 +-------------------------------------------------+
1201 +-------------------------------------------------+
1160
1202
1161 The principle building block of each segment is a *chunk*. A *chunk* is a
1203 The principle building block of each segment is a *chunk*. A *chunk* is a
1162 framed piece of data:
1204 framed piece of data:
1163
1205
1164 +---------------------------------------+
1206 +---------------------------------------+
1165 | | |
1207 | | |
1166 | length | data |
1208 | length | data |
1167 | (4 bytes) | (<length - 4> bytes) |
1209 | (4 bytes) | (<length - 4> bytes) |
1168 | | |
1210 | | |
1169 +---------------------------------------+
1211 +---------------------------------------+
1170
1212
1171 All integers are big-endian signed integers. Each chunk starts with a
1213 All integers are big-endian signed integers. Each chunk starts with a
1172 32-bit integer indicating the length of the entire chunk (including the
1214 32-bit integer indicating the length of the entire chunk (including the
1173 length field itself).
1215 length field itself).
1174
1216
1175 There is a special case chunk that has a value of 0 for the length
1217 There is a special case chunk that has a value of 0 for the length
1176 ("0x00000000"). We call this an *empty chunk*.
1218 ("0x00000000"). We call this an *empty chunk*.
1177
1219
1178 Delta Groups
1220 Delta Groups
1179 ============
1221 ============
1180
1222
1181 A *delta group* expresses the content of a revlog as a series of deltas,
1223 A *delta group* expresses the content of a revlog as a series of deltas,
1182 or patches against previous revisions.
1224 or patches against previous revisions.
1183
1225
1184 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1226 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1185 to signal the end of the delta group:
1227 to signal the end of the delta group:
1186
1228
1187 +------------------------------------------------------------------------+
1229 +------------------------------------------------------------------------+
1188 | | | | | |
1230 | | | | | |
1189 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1231 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1190 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1232 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1191 | | | | | |
1233 | | | | | |
1192 +------------------------------------------------------------------------+
1234 +------------------------------------------------------------------------+
1193
1235
1194 Each *chunk*'s data consists of the following:
1236 Each *chunk*'s data consists of the following:
1195
1237
1196 +---------------------------------------+
1238 +---------------------------------------+
1197 | | |
1239 | | |
1198 | delta header | delta data |
1240 | delta header | delta data |
1199 | (various by version) | (various) |
1241 | (various by version) | (various) |
1200 | | |
1242 | | |
1201 +---------------------------------------+
1243 +---------------------------------------+
1202
1244
1203 The *delta data* is a series of *delta*s that describe a diff from an
1245 The *delta data* is a series of *delta*s that describe a diff from an
1204 existing entry (either that the recipient already has, or previously
1246 existing entry (either that the recipient already has, or previously
1205 specified in the bundle/changegroup).
1247 specified in the bundle/changegroup).
1206
1248
1207 The *delta header* is different between versions "1", "2", and "3" of the
1249 The *delta header* is different between versions "1", "2", and "3" of the
1208 changegroup format.
1250 changegroup format.
1209
1251
1210 Version 1 (headerlen=80):
1252 Version 1 (headerlen=80):
1211
1253
1212 +------------------------------------------------------+
1254 +------------------------------------------------------+
1213 | | | | |
1255 | | | | |
1214 | node | p1 node | p2 node | link node |
1256 | node | p1 node | p2 node | link node |
1215 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1257 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1216 | | | | |
1258 | | | | |
1217 +------------------------------------------------------+
1259 +------------------------------------------------------+
1218
1260
1219 Version 2 (headerlen=100):
1261 Version 2 (headerlen=100):
1220
1262
1221 +------------------------------------------------------------------+
1263 +------------------------------------------------------------------+
1222 | | | | | |
1264 | | | | | |
1223 | node | p1 node | p2 node | base node | link node |
1265 | node | p1 node | p2 node | base node | link node |
1224 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1266 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1225 | | | | | |
1267 | | | | | |
1226 +------------------------------------------------------------------+
1268 +------------------------------------------------------------------+
1227
1269
1228 Version 3 (headerlen=102):
1270 Version 3 (headerlen=102):
1229
1271
1230 +------------------------------------------------------------------------------+
1272 +------------------------------------------------------------------------------+
1231 | | | | | | |
1273 | | | | | | |
1232 | node | p1 node | p2 node | base node | link node | flags |
1274 | node | p1 node | p2 node | base node | link node | flags |
1233 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1275 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1234 | | | | | | |
1276 | | | | | | |
1235 +------------------------------------------------------------------------------+
1277 +------------------------------------------------------------------------------+
1236
1278
1237 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1279 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1238 contain a series of *delta*s, densely packed (no separators). These deltas
1280 contain a series of *delta*s, densely packed (no separators). These deltas
1239 describe a diff from an existing entry (either that the recipient already
1281 describe a diff from an existing entry (either that the recipient already
1240 has, or previously specified in the bundle/changegroup). The format is
1282 has, or previously specified in the bundle/changegroup). The format is
1241 described more fully in "hg help internals.bdiff", but briefly:
1283 described more fully in "hg help internals.bdiff", but briefly:
1242
1284
1243 +---------------------------------------------------------------+
1285 +---------------------------------------------------------------+
1244 | | | | |
1286 | | | | |
1245 | start offset | end offset | new length | content |
1287 | start offset | end offset | new length | content |
1246 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1288 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1247 | | | | |
1289 | | | | |
1248 +---------------------------------------------------------------+
1290 +---------------------------------------------------------------+
1249
1291
1250 Please note that the length field in the delta data does *not* include
1292 Please note that the length field in the delta data does *not* include
1251 itself.
1293 itself.
1252
1294
1253 In version 1, the delta is always applied against the previous node from
1295 In version 1, the delta is always applied against the previous node from
1254 the changegroup or the first parent if this is the first entry in the
1296 the changegroup or the first parent if this is the first entry in the
1255 changegroup.
1297 changegroup.
1256
1298
1257 In version 2 and up, the delta base node is encoded in the entry in the
1299 In version 2 and up, the delta base node is encoded in the entry in the
1258 changegroup. This allows the delta to be expressed against any parent,
1300 changegroup. This allows the delta to be expressed against any parent,
1259 which can result in smaller deltas and more efficient encoding of data.
1301 which can result in smaller deltas and more efficient encoding of data.
1260
1302
1261 The *flags* field holds bitwise flags affecting the processing of revision
1303 The *flags* field holds bitwise flags affecting the processing of revision
1262 data. The following flags are defined:
1304 data. The following flags are defined:
1263
1305
1264 32768
1306 32768
1265 Censored revision. The revision's fulltext has been replaced by censor
1307 Censored revision. The revision's fulltext has been replaced by censor
1266 metadata. May only occur on file revisions.
1308 metadata. May only occur on file revisions.
1267
1309
1268 16384
1310 16384
1269 Ellipsis revision. Revision hash does not match data (likely due to
1311 Ellipsis revision. Revision hash does not match data (likely due to
1270 rewritten parents).
1312 rewritten parents).
1271
1313
1272 8192
1314 8192
1273 Externally stored. The revision fulltext contains "key:value" "\n"
1315 Externally stored. The revision fulltext contains "key:value" "\n"
1274 delimited metadata defining an object stored elsewhere. Used by the LFS
1316 delimited metadata defining an object stored elsewhere. Used by the LFS
1275 extension.
1317 extension.
1276
1318
1277 For historical reasons, the integer values are identical to revlog version
1319 For historical reasons, the integer values are identical to revlog version
1278 1 per-revision storage flags and correspond to bits being set in this
1320 1 per-revision storage flags and correspond to bits being set in this
1279 2-byte field. Bits were allocated starting from the most-significant bit,
1321 2-byte field. Bits were allocated starting from the most-significant bit,
1280 hence the reverse ordering and allocation of these flags.
1322 hence the reverse ordering and allocation of these flags.
1281
1323
1282 Changeset Segment
1324 Changeset Segment
1283 =================
1325 =================
1284
1326
1285 The *changeset segment* consists of a single *delta group* holding
1327 The *changeset segment* consists of a single *delta group* holding
1286 changelog data. The *empty chunk* at the end of the *delta group* denotes
1328 changelog data. The *empty chunk* at the end of the *delta group* denotes
1287 the boundary to the *manifest segment*.
1329 the boundary to the *manifest segment*.
1288
1330
1289 Manifest Segment
1331 Manifest Segment
1290 ================
1332 ================
1291
1333
1292 The *manifest segment* consists of a single *delta group* holding manifest
1334 The *manifest segment* consists of a single *delta group* holding manifest
1293 data. If treemanifests are in use, it contains only the manifest for the
1335 data. If treemanifests are in use, it contains only the manifest for the
1294 root directory of the repository. Otherwise, it contains the entire
1336 root directory of the repository. Otherwise, it contains the entire
1295 manifest data. The *empty chunk* at the end of the *delta group* denotes
1337 manifest data. The *empty chunk* at the end of the *delta group* denotes
1296 the boundary to the next segment (either the *treemanifests segment* or
1338 the boundary to the next segment (either the *treemanifests segment* or
1297 the *filelogs segment*, depending on version and the request options).
1339 the *filelogs segment*, depending on version and the request options).
1298
1340
1299 Treemanifests Segment
1341 Treemanifests Segment
1300 ---------------------
1342 ---------------------
1301
1343
1302 The *treemanifests segment* only exists in changegroup version "3", and
1344 The *treemanifests segment* only exists in changegroup version "3", and
1303 only if the 'treemanifest' param is part of the bundle2 changegroup part
1345 only if the 'treemanifest' param is part of the bundle2 changegroup part
1304 (it is not possible to use changegroup version 3 outside of bundle2).
1346 (it is not possible to use changegroup version 3 outside of bundle2).
1305 Aside from the filenames in the *treemanifests segment* containing a
1347 Aside from the filenames in the *treemanifests segment* containing a
1306 trailing "/" character, it behaves identically to the *filelogs segment*
1348 trailing "/" character, it behaves identically to the *filelogs segment*
1307 (see below). The final sub-segment is followed by an *empty chunk*
1349 (see below). The final sub-segment is followed by an *empty chunk*
1308 (logically, a sub-segment with filename size 0). This denotes the boundary
1350 (logically, a sub-segment with filename size 0). This denotes the boundary
1309 to the *filelogs segment*.
1351 to the *filelogs segment*.
1310
1352
1311 Filelogs Segment
1353 Filelogs Segment
1312 ================
1354 ================
1313
1355
1314 The *filelogs segment* consists of multiple sub-segments, each
1356 The *filelogs segment* consists of multiple sub-segments, each
1315 corresponding to an individual file whose data is being described:
1357 corresponding to an individual file whose data is being described:
1316
1358
1317 +--------------------------------------------------+
1359 +--------------------------------------------------+
1318 | | | | | |
1360 | | | | | |
1319 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1361 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1320 | | | | | (4 bytes) |
1362 | | | | | (4 bytes) |
1321 | | | | | |
1363 | | | | | |
1322 +--------------------------------------------------+
1364 +--------------------------------------------------+
1323
1365
1324 The final filelog sub-segment is followed by an *empty chunk* (logically,
1366 The final filelog sub-segment is followed by an *empty chunk* (logically,
1325 a sub-segment with filename size 0). This denotes the end of the segment
1367 a sub-segment with filename size 0). This denotes the end of the segment
1326 and of the overall changegroup.
1368 and of the overall changegroup.
1327
1369
1328 Each filelog sub-segment consists of the following:
1370 Each filelog sub-segment consists of the following:
1329
1371
1330 +------------------------------------------------------+
1372 +------------------------------------------------------+
1331 | | | |
1373 | | | |
1332 | filename length | filename | delta group |
1374 | filename length | filename | delta group |
1333 | (4 bytes) | (<length - 4> bytes) | (various) |
1375 | (4 bytes) | (<length - 4> bytes) | (various) |
1334 | | | |
1376 | | | |
1335 +------------------------------------------------------+
1377 +------------------------------------------------------+
1336
1378
1337 That is, a *chunk* consisting of the filename (not terminated or padded)
1379 That is, a *chunk* consisting of the filename (not terminated or padded)
1338 followed by N chunks constituting the *delta group* for this file. The
1380 followed by N chunks constituting the *delta group* for this file. The
1339 *empty chunk* at the end of each *delta group* denotes the boundary to the
1381 *empty chunk* at the end of each *delta group* denotes the boundary to the
1340 next filelog sub-segment.
1382 next filelog sub-segment.
1341
1383
1342 Test list of commands with command with no help text
1384 Test list of commands with command with no help text
1343
1385
1344 $ hg help helpext
1386 $ hg help helpext
1345 helpext extension - no help text available
1387 helpext extension - no help text available
1346
1388
1347 list of commands:
1389 list of commands:
1348
1390
1349 nohelp (no help text available)
1391 nohelp (no help text available)
1350
1392
1351 (use 'hg help -v helpext' to show built-in aliases and global options)
1393 (use 'hg help -v helpext' to show built-in aliases and global options)
1352
1394
1353
1395
1354 test advanced, deprecated and experimental options are hidden in command help
1396 test advanced, deprecated and experimental options are hidden in command help
1355 $ hg help debugoptADV
1397 $ hg help debugoptADV
1356 hg debugoptADV
1398 hg debugoptADV
1357
1399
1358 (no help text available)
1400 (no help text available)
1359
1401
1360 options:
1402 options:
1361
1403
1362 (some details hidden, use --verbose to show complete help)
1404 (some details hidden, use --verbose to show complete help)
1363 $ hg help debugoptDEP
1405 $ hg help debugoptDEP
1364 hg debugoptDEP
1406 hg debugoptDEP
1365
1407
1366 (no help text available)
1408 (no help text available)
1367
1409
1368 options:
1410 options:
1369
1411
1370 (some details hidden, use --verbose to show complete help)
1412 (some details hidden, use --verbose to show complete help)
1371
1413
1372 $ hg help debugoptEXP
1414 $ hg help debugoptEXP
1373 hg debugoptEXP
1415 hg debugoptEXP
1374
1416
1375 (no help text available)
1417 (no help text available)
1376
1418
1377 options:
1419 options:
1378
1420
1379 (some details hidden, use --verbose to show complete help)
1421 (some details hidden, use --verbose to show complete help)
1380
1422
1381 test advanced, deprecated and experimental options are shown with -v
1423 test advanced, deprecated and experimental options are shown with -v
1382 $ hg help -v debugoptADV | grep aopt
1424 $ hg help -v debugoptADV | grep aopt
1383 --aopt option is (ADVANCED)
1425 --aopt option is (ADVANCED)
1384 $ hg help -v debugoptDEP | grep dopt
1426 $ hg help -v debugoptDEP | grep dopt
1385 --dopt option is (DEPRECATED)
1427 --dopt option is (DEPRECATED)
1386 $ hg help -v debugoptEXP | grep eopt
1428 $ hg help -v debugoptEXP | grep eopt
1387 --eopt option is (EXPERIMENTAL)
1429 --eopt option is (EXPERIMENTAL)
1388
1430
1389 #if gettext
1431 #if gettext
1390 test deprecated option is hidden with translation with untranslated description
1432 test deprecated option is hidden with translation with untranslated description
1391 (use many globy for not failing on changed transaction)
1433 (use many globy for not failing on changed transaction)
1392 $ LANGUAGE=sv hg help debugoptDEP
1434 $ LANGUAGE=sv hg help debugoptDEP
1393 hg debugoptDEP
1435 hg debugoptDEP
1394
1436
1395 (*) (glob)
1437 (*) (glob)
1396
1438
1397 options:
1439 options:
1398
1440
1399 (some details hidden, use --verbose to show complete help)
1441 (some details hidden, use --verbose to show complete help)
1400 #endif
1442 #endif
1401
1443
1402 Test commands that collide with topics (issue4240)
1444 Test commands that collide with topics (issue4240)
1403
1445
1404 $ hg config -hq
1446 $ hg config -hq
1405 hg config [-u] [NAME]...
1447 hg config [-u] [NAME]...
1406
1448
1407 show combined config settings from all hgrc files
1449 show combined config settings from all hgrc files
1408 $ hg showconfig -hq
1450 $ hg showconfig -hq
1409 hg config [-u] [NAME]...
1451 hg config [-u] [NAME]...
1410
1452
1411 show combined config settings from all hgrc files
1453 show combined config settings from all hgrc files
1412
1454
1413 Test a help topic
1455 Test a help topic
1414
1456
1415 $ hg help dates
1457 $ hg help dates
1416 Date Formats
1458 Date Formats
1417 """"""""""""
1459 """"""""""""
1418
1460
1419 Some commands allow the user to specify a date, e.g.:
1461 Some commands allow the user to specify a date, e.g.:
1420
1462
1421 - backout, commit, import, tag: Specify the commit date.
1463 - backout, commit, import, tag: Specify the commit date.
1422 - log, revert, update: Select revision(s) by date.
1464 - log, revert, update: Select revision(s) by date.
1423
1465
1424 Many date formats are valid. Here are some examples:
1466 Many date formats are valid. Here are some examples:
1425
1467
1426 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1468 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1427 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1469 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1428 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1470 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1429 - "Dec 6" (midnight)
1471 - "Dec 6" (midnight)
1430 - "13:18" (today assumed)
1472 - "13:18" (today assumed)
1431 - "3:39" (3:39AM assumed)
1473 - "3:39" (3:39AM assumed)
1432 - "3:39pm" (15:39)
1474 - "3:39pm" (15:39)
1433 - "2006-12-06 13:18:29" (ISO 8601 format)
1475 - "2006-12-06 13:18:29" (ISO 8601 format)
1434 - "2006-12-6 13:18"
1476 - "2006-12-6 13:18"
1435 - "2006-12-6"
1477 - "2006-12-6"
1436 - "12-6"
1478 - "12-6"
1437 - "12/6"
1479 - "12/6"
1438 - "12/6/6" (Dec 6 2006)
1480 - "12/6/6" (Dec 6 2006)
1439 - "today" (midnight)
1481 - "today" (midnight)
1440 - "yesterday" (midnight)
1482 - "yesterday" (midnight)
1441 - "now" - right now
1483 - "now" - right now
1442
1484
1443 Lastly, there is Mercurial's internal format:
1485 Lastly, there is Mercurial's internal format:
1444
1486
1445 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1487 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1446
1488
1447 This is the internal representation format for dates. The first number is
1489 This is the internal representation format for dates. The first number is
1448 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1490 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1449 is the offset of the local timezone, in seconds west of UTC (negative if
1491 is the offset of the local timezone, in seconds west of UTC (negative if
1450 the timezone is east of UTC).
1492 the timezone is east of UTC).
1451
1493
1452 The log command also accepts date ranges:
1494 The log command also accepts date ranges:
1453
1495
1454 - "<DATE" - at or before a given date/time
1496 - "<DATE" - at or before a given date/time
1455 - ">DATE" - on or after a given date/time
1497 - ">DATE" - on or after a given date/time
1456 - "DATE to DATE" - a date range, inclusive
1498 - "DATE to DATE" - a date range, inclusive
1457 - "-DAYS" - within a given number of days of today
1499 - "-DAYS" - within a given number of days of today
1458
1500
1459 Test repeated config section name
1501 Test repeated config section name
1460
1502
1461 $ hg help config.host
1503 $ hg help config.host
1462 "http_proxy.host"
1504 "http_proxy.host"
1463 Host name and (optional) port of the proxy server, for example
1505 Host name and (optional) port of the proxy server, for example
1464 "myproxy:8000".
1506 "myproxy:8000".
1465
1507
1466 "smtp.host"
1508 "smtp.host"
1467 Host name of mail server, e.g. "mail.example.com".
1509 Host name of mail server, e.g. "mail.example.com".
1468
1510
1469
1511
1470 Test section name with dot
1512 Test section name with dot
1471
1513
1472 $ hg help config.ui.username
1514 $ hg help config.ui.username
1473 "ui.username"
1515 "ui.username"
1474 The committer of a changeset created when running "commit". Typically
1516 The committer of a changeset created when running "commit". Typically
1475 a person's name and email address, e.g. "Fred Widget
1517 a person's name and email address, e.g. "Fred Widget
1476 <fred@example.com>". Environment variables in the username are
1518 <fred@example.com>". Environment variables in the username are
1477 expanded.
1519 expanded.
1478
1520
1479 (default: "$EMAIL" or "username@hostname". If the username in hgrc is
1521 (default: "$EMAIL" or "username@hostname". If the username in hgrc is
1480 empty, e.g. if the system admin set "username =" in the system hgrc,
1522 empty, e.g. if the system admin set "username =" in the system hgrc,
1481 it has to be specified manually or in a different hgrc file)
1523 it has to be specified manually or in a different hgrc file)
1482
1524
1483
1525
1484 $ hg help config.annotate.git
1526 $ hg help config.annotate.git
1485 abort: help section not found: config.annotate.git
1527 abort: help section not found: config.annotate.git
1486 [255]
1528 [255]
1487
1529
1488 $ hg help config.update.check
1530 $ hg help config.update.check
1489 "commands.update.check"
1531 "commands.update.check"
1490 Determines what level of checking 'hg update' will perform before
1532 Determines what level of checking 'hg update' will perform before
1491 moving to a destination revision. Valid values are "abort", "none",
1533 moving to a destination revision. Valid values are "abort", "none",
1492 "linear", and "noconflict". "abort" always fails if the working
1534 "linear", and "noconflict". "abort" always fails if the working
1493 directory has uncommitted changes. "none" performs no checking, and
1535 directory has uncommitted changes. "none" performs no checking, and
1494 may result in a merge with uncommitted changes. "linear" allows any
1536 may result in a merge with uncommitted changes. "linear" allows any
1495 update as long as it follows a straight line in the revision history,
1537 update as long as it follows a straight line in the revision history,
1496 and may trigger a merge with uncommitted changes. "noconflict" will
1538 and may trigger a merge with uncommitted changes. "noconflict" will
1497 allow any update which would not trigger a merge with uncommitted
1539 allow any update which would not trigger a merge with uncommitted
1498 changes, if any are present. (default: "linear")
1540 changes, if any are present. (default: "linear")
1499
1541
1500
1542
1501 $ hg help config.commands.update.check
1543 $ hg help config.commands.update.check
1502 "commands.update.check"
1544 "commands.update.check"
1503 Determines what level of checking 'hg update' will perform before
1545 Determines what level of checking 'hg update' will perform before
1504 moving to a destination revision. Valid values are "abort", "none",
1546 moving to a destination revision. Valid values are "abort", "none",
1505 "linear", and "noconflict". "abort" always fails if the working
1547 "linear", and "noconflict". "abort" always fails if the working
1506 directory has uncommitted changes. "none" performs no checking, and
1548 directory has uncommitted changes. "none" performs no checking, and
1507 may result in a merge with uncommitted changes. "linear" allows any
1549 may result in a merge with uncommitted changes. "linear" allows any
1508 update as long as it follows a straight line in the revision history,
1550 update as long as it follows a straight line in the revision history,
1509 and may trigger a merge with uncommitted changes. "noconflict" will
1551 and may trigger a merge with uncommitted changes. "noconflict" will
1510 allow any update which would not trigger a merge with uncommitted
1552 allow any update which would not trigger a merge with uncommitted
1511 changes, if any are present. (default: "linear")
1553 changes, if any are present. (default: "linear")
1512
1554
1513
1555
1514 $ hg help config.ommands.update.check
1556 $ hg help config.ommands.update.check
1515 abort: help section not found: config.ommands.update.check
1557 abort: help section not found: config.ommands.update.check
1516 [255]
1558 [255]
1517
1559
1518 Unrelated trailing paragraphs shouldn't be included
1560 Unrelated trailing paragraphs shouldn't be included
1519
1561
1520 $ hg help config.extramsg | grep '^$'
1562 $ hg help config.extramsg | grep '^$'
1521
1563
1522
1564
1523 Test capitalized section name
1565 Test capitalized section name
1524
1566
1525 $ hg help scripting.HGPLAIN > /dev/null
1567 $ hg help scripting.HGPLAIN > /dev/null
1526
1568
1527 Help subsection:
1569 Help subsection:
1528
1570
1529 $ hg help config.charsets |grep "Email example:" > /dev/null
1571 $ hg help config.charsets |grep "Email example:" > /dev/null
1530 [1]
1572 [1]
1531
1573
1532 Show nested definitions
1574 Show nested definitions
1533 ("profiling.type"[break]"ls"[break]"stat"[break])
1575 ("profiling.type"[break]"ls"[break]"stat"[break])
1534
1576
1535 $ hg help config.type | egrep '^$'|wc -l
1577 $ hg help config.type | egrep '^$'|wc -l
1536 \s*3 (re)
1578 \s*3 (re)
1537
1579
1538 $ hg help config.profiling.type.ls
1580 $ hg help config.profiling.type.ls
1539 "profiling.type.ls"
1581 "profiling.type.ls"
1540 Use Python's built-in instrumenting profiler. This profiler works on
1582 Use Python's built-in instrumenting profiler. This profiler works on
1541 all platforms, but each line number it reports is the first line of
1583 all platforms, but each line number it reports is the first line of
1542 a function. This restriction makes it difficult to identify the
1584 a function. This restriction makes it difficult to identify the
1543 expensive parts of a non-trivial function.
1585 expensive parts of a non-trivial function.
1544
1586
1545
1587
1546 Separate sections from subsections
1588 Separate sections from subsections
1547
1589
1548 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1590 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1549 "format"
1591 "format"
1550 --------
1592 --------
1551
1593
1552 "usegeneraldelta"
1594 "usegeneraldelta"
1553
1595
1554 "dotencode"
1596 "dotencode"
1555
1597
1556 "usefncache"
1598 "usefncache"
1557
1599
1558 "usestore"
1600 "usestore"
1559
1601
1560 "profiling"
1602 "profiling"
1561 -----------
1603 -----------
1562
1604
1563 "format"
1605 "format"
1564
1606
1565 "progress"
1607 "progress"
1566 ----------
1608 ----------
1567
1609
1568 "format"
1610 "format"
1569
1611
1570
1612
1571 Last item in help config.*:
1613 Last item in help config.*:
1572
1614
1573 $ hg help config.`hg help config|grep '^ "'| \
1615 $ hg help config.`hg help config|grep '^ "'| \
1574 > tail -1|sed 's![ "]*!!g'`| \
1616 > tail -1|sed 's![ "]*!!g'`| \
1575 > grep 'hg help -c config' > /dev/null
1617 > grep 'hg help -c config' > /dev/null
1576 [1]
1618 [1]
1577
1619
1578 note to use help -c for general hg help config:
1620 note to use help -c for general hg help config:
1579
1621
1580 $ hg help config |grep 'hg help -c config' > /dev/null
1622 $ hg help config |grep 'hg help -c config' > /dev/null
1581
1623
1582 Test templating help
1624 Test templating help
1583
1625
1584 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1626 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1585 desc String. The text of the changeset description.
1627 desc String. The text of the changeset description.
1586 diffstat String. Statistics of changes with the following format:
1628 diffstat String. Statistics of changes with the following format:
1587 firstline Any text. Returns the first line of text.
1629 firstline Any text. Returns the first line of text.
1588 nonempty Any text. Returns '(none)' if the string is empty.
1630 nonempty Any text. Returns '(none)' if the string is empty.
1589
1631
1590 Test deprecated items
1632 Test deprecated items
1591
1633
1592 $ hg help -v templating | grep currentbookmark
1634 $ hg help -v templating | grep currentbookmark
1593 currentbookmark
1635 currentbookmark
1594 $ hg help templating | (grep currentbookmark || true)
1636 $ hg help templating | (grep currentbookmark || true)
1595
1637
1596 Test help hooks
1638 Test help hooks
1597
1639
1598 $ cat > helphook1.py <<EOF
1640 $ cat > helphook1.py <<EOF
1599 > from mercurial import help
1641 > from mercurial import help
1600 >
1642 >
1601 > def rewrite(ui, topic, doc):
1643 > def rewrite(ui, topic, doc):
1602 > return doc + b'\nhelphook1\n'
1644 > return doc + b'\nhelphook1\n'
1603 >
1645 >
1604 > def extsetup(ui):
1646 > def extsetup(ui):
1605 > help.addtopichook(b'revisions', rewrite)
1647 > help.addtopichook(b'revisions', rewrite)
1606 > EOF
1648 > EOF
1607 $ cat > helphook2.py <<EOF
1649 $ cat > helphook2.py <<EOF
1608 > from mercurial import help
1650 > from mercurial import help
1609 >
1651 >
1610 > def rewrite(ui, topic, doc):
1652 > def rewrite(ui, topic, doc):
1611 > return doc + b'\nhelphook2\n'
1653 > return doc + b'\nhelphook2\n'
1612 >
1654 >
1613 > def extsetup(ui):
1655 > def extsetup(ui):
1614 > help.addtopichook(b'revisions', rewrite)
1656 > help.addtopichook(b'revisions', rewrite)
1615 > EOF
1657 > EOF
1616 $ echo '[extensions]' >> $HGRCPATH
1658 $ echo '[extensions]' >> $HGRCPATH
1617 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1659 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1618 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1660 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1619 $ hg help revsets | grep helphook
1661 $ hg help revsets | grep helphook
1620 helphook1
1662 helphook1
1621 helphook2
1663 helphook2
1622
1664
1623 help -c should only show debug --debug
1665 help -c should only show debug --debug
1624
1666
1625 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1667 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1626 [1]
1668 [1]
1627
1669
1628 help -c should only show deprecated for -v
1670 help -c should only show deprecated for -v
1629
1671
1630 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1672 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1631 [1]
1673 [1]
1632
1674
1633 Test -s / --system
1675 Test -s / --system
1634
1676
1635 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1677 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1636 > wc -l | sed -e 's/ //g'
1678 > wc -l | sed -e 's/ //g'
1637 0
1679 0
1638 $ hg help config.files --system unix | grep 'USER' | \
1680 $ hg help config.files --system unix | grep 'USER' | \
1639 > wc -l | sed -e 's/ //g'
1681 > wc -l | sed -e 's/ //g'
1640 0
1682 0
1641
1683
1642 Test -e / -c / -k combinations
1684 Test -e / -c / -k combinations
1643
1685
1644 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1686 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1645 Commands:
1687 Commands:
1646 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1688 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1647 Extensions:
1689 Extensions:
1648 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1690 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1649 Topics:
1691 Topics:
1650 Commands:
1692 Commands:
1651 Extensions:
1693 Extensions:
1652 Extension Commands:
1694 Extension Commands:
1653 $ hg help -c schemes
1695 $ hg help -c schemes
1654 abort: no such help topic: schemes
1696 abort: no such help topic: schemes
1655 (try 'hg help --keyword schemes')
1697 (try 'hg help --keyword schemes')
1656 [255]
1698 [255]
1657 $ hg help -e schemes |head -1
1699 $ hg help -e schemes |head -1
1658 schemes extension - extend schemes with shortcuts to repository swarms
1700 schemes extension - extend schemes with shortcuts to repository swarms
1659 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1701 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1660 Commands:
1702 Commands:
1661 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1703 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1662 Extensions:
1704 Extensions:
1663 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1705 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1664 Extensions:
1706 Extensions:
1665 Commands:
1707 Commands:
1666 $ hg help -c commit > /dev/null
1708 $ hg help -c commit > /dev/null
1667 $ hg help -e -c commit > /dev/null
1709 $ hg help -e -c commit > /dev/null
1668 $ hg help -e commit
1710 $ hg help -e commit
1669 abort: no such help topic: commit
1711 abort: no such help topic: commit
1670 (try 'hg help --keyword commit')
1712 (try 'hg help --keyword commit')
1671 [255]
1713 [255]
1672
1714
1673 Test keyword search help
1715 Test keyword search help
1674
1716
1675 $ cat > prefixedname.py <<EOF
1717 $ cat > prefixedname.py <<EOF
1676 > '''matched against word "clone"
1718 > '''matched against word "clone"
1677 > '''
1719 > '''
1678 > EOF
1720 > EOF
1679 $ echo '[extensions]' >> $HGRCPATH
1721 $ echo '[extensions]' >> $HGRCPATH
1680 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1722 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1681 $ hg help -k clone
1723 $ hg help -k clone
1682 Topics:
1724 Topics:
1683
1725
1684 config Configuration Files
1726 config Configuration Files
1685 extensions Using Additional Features
1727 extensions Using Additional Features
1686 glossary Glossary
1728 glossary Glossary
1687 phases Working with Phases
1729 phases Working with Phases
1688 subrepos Subrepositories
1730 subrepos Subrepositories
1689 urls URL Paths
1731 urls URL Paths
1690
1732
1691 Commands:
1733 Commands:
1692
1734
1693 bookmarks create a new bookmark or list existing bookmarks
1735 bookmarks create a new bookmark or list existing bookmarks
1694 clone make a copy of an existing repository
1736 clone make a copy of an existing repository
1695 paths show aliases for remote repositories
1737 paths show aliases for remote repositories
1696 pull pull changes from the specified source
1738 pull pull changes from the specified source
1697 update update working directory (or switch revisions)
1739 update update working directory (or switch revisions)
1698
1740
1699 Extensions:
1741 Extensions:
1700
1742
1701 clonebundles advertise pre-generated bundles to seed clones
1743 clonebundles advertise pre-generated bundles to seed clones
1702 narrow create clones which fetch history data for subset of files
1744 narrow create clones which fetch history data for subset of files
1703 (EXPERIMENTAL)
1745 (EXPERIMENTAL)
1704 prefixedname matched against word "clone"
1746 prefixedname matched against word "clone"
1705 relink recreates hardlinks between repository clones
1747 relink recreates hardlinks between repository clones
1706
1748
1707 Extension Commands:
1749 Extension Commands:
1708
1750
1709 qclone clone main and patch repository at same time
1751 qclone clone main and patch repository at same time
1710
1752
1711 Test unfound topic
1753 Test unfound topic
1712
1754
1713 $ hg help nonexistingtopicthatwillneverexisteverever
1755 $ hg help nonexistingtopicthatwillneverexisteverever
1714 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1756 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1715 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1757 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1716 [255]
1758 [255]
1717
1759
1718 Test unfound keyword
1760 Test unfound keyword
1719
1761
1720 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1762 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1721 abort: no matches
1763 abort: no matches
1722 (try 'hg help' for a list of topics)
1764 (try 'hg help' for a list of topics)
1723 [255]
1765 [255]
1724
1766
1725 Test omit indicating for help
1767 Test omit indicating for help
1726
1768
1727 $ cat > addverboseitems.py <<EOF
1769 $ cat > addverboseitems.py <<EOF
1728 > '''extension to test omit indicating.
1770 > '''extension to test omit indicating.
1729 >
1771 >
1730 > This paragraph is never omitted (for extension)
1772 > This paragraph is never omitted (for extension)
1731 >
1773 >
1732 > .. container:: verbose
1774 > .. container:: verbose
1733 >
1775 >
1734 > This paragraph is omitted,
1776 > This paragraph is omitted,
1735 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1777 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1736 >
1778 >
1737 > This paragraph is never omitted, too (for extension)
1779 > This paragraph is never omitted, too (for extension)
1738 > '''
1780 > '''
1739 > from __future__ import absolute_import
1781 > from __future__ import absolute_import
1740 > from mercurial import commands, help
1782 > from mercurial import commands, help
1741 > testtopic = b"""This paragraph is never omitted (for topic).
1783 > testtopic = b"""This paragraph is never omitted (for topic).
1742 >
1784 >
1743 > .. container:: verbose
1785 > .. container:: verbose
1744 >
1786 >
1745 > This paragraph is omitted,
1787 > This paragraph is omitted,
1746 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1788 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1747 >
1789 >
1748 > This paragraph is never omitted, too (for topic)
1790 > This paragraph is never omitted, too (for topic)
1749 > """
1791 > """
1750 > def extsetup(ui):
1792 > def extsetup(ui):
1751 > help.helptable.append(([b"topic-containing-verbose"],
1793 > help.helptable.append(([b"topic-containing-verbose"],
1752 > b"This is the topic to test omit indicating.",
1794 > b"This is the topic to test omit indicating.",
1753 > lambda ui: testtopic))
1795 > lambda ui: testtopic))
1754 > EOF
1796 > EOF
1755 $ echo '[extensions]' >> $HGRCPATH
1797 $ echo '[extensions]' >> $HGRCPATH
1756 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1798 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1757 $ hg help addverboseitems
1799 $ hg help addverboseitems
1758 addverboseitems extension - extension to test omit indicating.
1800 addverboseitems extension - extension to test omit indicating.
1759
1801
1760 This paragraph is never omitted (for extension)
1802 This paragraph is never omitted (for extension)
1761
1803
1762 This paragraph is never omitted, too (for extension)
1804 This paragraph is never omitted, too (for extension)
1763
1805
1764 (some details hidden, use --verbose to show complete help)
1806 (some details hidden, use --verbose to show complete help)
1765
1807
1766 no commands defined
1808 no commands defined
1767 $ hg help -v addverboseitems
1809 $ hg help -v addverboseitems
1768 addverboseitems extension - extension to test omit indicating.
1810 addverboseitems extension - extension to test omit indicating.
1769
1811
1770 This paragraph is never omitted (for extension)
1812 This paragraph is never omitted (for extension)
1771
1813
1772 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1814 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1773 extension)
1815 extension)
1774
1816
1775 This paragraph is never omitted, too (for extension)
1817 This paragraph is never omitted, too (for extension)
1776
1818
1777 no commands defined
1819 no commands defined
1778 $ hg help topic-containing-verbose
1820 $ hg help topic-containing-verbose
1779 This is the topic to test omit indicating.
1821 This is the topic to test omit indicating.
1780 """"""""""""""""""""""""""""""""""""""""""
1822 """"""""""""""""""""""""""""""""""""""""""
1781
1823
1782 This paragraph is never omitted (for topic).
1824 This paragraph is never omitted (for topic).
1783
1825
1784 This paragraph is never omitted, too (for topic)
1826 This paragraph is never omitted, too (for topic)
1785
1827
1786 (some details hidden, use --verbose to show complete help)
1828 (some details hidden, use --verbose to show complete help)
1787 $ hg help -v topic-containing-verbose
1829 $ hg help -v topic-containing-verbose
1788 This is the topic to test omit indicating.
1830 This is the topic to test omit indicating.
1789 """"""""""""""""""""""""""""""""""""""""""
1831 """"""""""""""""""""""""""""""""""""""""""
1790
1832
1791 This paragraph is never omitted (for topic).
1833 This paragraph is never omitted (for topic).
1792
1834
1793 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1835 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1794 topic)
1836 topic)
1795
1837
1796 This paragraph is never omitted, too (for topic)
1838 This paragraph is never omitted, too (for topic)
1797
1839
1798 Test section lookup
1840 Test section lookup
1799
1841
1800 $ hg help revset.merge
1842 $ hg help revset.merge
1801 "merge()"
1843 "merge()"
1802 Changeset is a merge changeset.
1844 Changeset is a merge changeset.
1803
1845
1804 $ hg help glossary.dag
1846 $ hg help glossary.dag
1805 DAG
1847 DAG
1806 The repository of changesets of a distributed version control system
1848 The repository of changesets of a distributed version control system
1807 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1849 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1808 of nodes and edges, where nodes correspond to changesets and edges
1850 of nodes and edges, where nodes correspond to changesets and edges
1809 imply a parent -> child relation. This graph can be visualized by
1851 imply a parent -> child relation. This graph can be visualized by
1810 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1852 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1811 limited by the requirement for children to have at most two parents.
1853 limited by the requirement for children to have at most two parents.
1812
1854
1813
1855
1814 $ hg help hgrc.paths
1856 $ hg help hgrc.paths
1815 "paths"
1857 "paths"
1816 -------
1858 -------
1817
1859
1818 Assigns symbolic names and behavior to repositories.
1860 Assigns symbolic names and behavior to repositories.
1819
1861
1820 Options are symbolic names defining the URL or directory that is the
1862 Options are symbolic names defining the URL or directory that is the
1821 location of the repository. Example:
1863 location of the repository. Example:
1822
1864
1823 [paths]
1865 [paths]
1824 my_server = https://example.com/my_repo
1866 my_server = https://example.com/my_repo
1825 local_path = /home/me/repo
1867 local_path = /home/me/repo
1826
1868
1827 These symbolic names can be used from the command line. To pull from
1869 These symbolic names can be used from the command line. To pull from
1828 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1870 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1829 local_path'.
1871 local_path'.
1830
1872
1831 Options containing colons (":") denote sub-options that can influence
1873 Options containing colons (":") denote sub-options that can influence
1832 behavior for that specific path. Example:
1874 behavior for that specific path. Example:
1833
1875
1834 [paths]
1876 [paths]
1835 my_server = https://example.com/my_path
1877 my_server = https://example.com/my_path
1836 my_server:pushurl = ssh://example.com/my_path
1878 my_server:pushurl = ssh://example.com/my_path
1837
1879
1838 The following sub-options can be defined:
1880 The following sub-options can be defined:
1839
1881
1840 "pushurl"
1882 "pushurl"
1841 The URL to use for push operations. If not defined, the location
1883 The URL to use for push operations. If not defined, the location
1842 defined by the path's main entry is used.
1884 defined by the path's main entry is used.
1843
1885
1844 "pushrev"
1886 "pushrev"
1845 A revset defining which revisions to push by default.
1887 A revset defining which revisions to push by default.
1846
1888
1847 When 'hg push' is executed without a "-r" argument, the revset defined
1889 When 'hg push' is executed without a "-r" argument, the revset defined
1848 by this sub-option is evaluated to determine what to push.
1890 by this sub-option is evaluated to determine what to push.
1849
1891
1850 For example, a value of "." will push the working directory's revision
1892 For example, a value of "." will push the working directory's revision
1851 by default.
1893 by default.
1852
1894
1853 Revsets specifying bookmarks will not result in the bookmark being
1895 Revsets specifying bookmarks will not result in the bookmark being
1854 pushed.
1896 pushed.
1855
1897
1856 The following special named paths exist:
1898 The following special named paths exist:
1857
1899
1858 "default"
1900 "default"
1859 The URL or directory to use when no source or remote is specified.
1901 The URL or directory to use when no source or remote is specified.
1860
1902
1861 'hg clone' will automatically define this path to the location the
1903 'hg clone' will automatically define this path to the location the
1862 repository was cloned from.
1904 repository was cloned from.
1863
1905
1864 "default-push"
1906 "default-push"
1865 (deprecated) The URL or directory for the default 'hg push' location.
1907 (deprecated) The URL or directory for the default 'hg push' location.
1866 "default:pushurl" should be used instead.
1908 "default:pushurl" should be used instead.
1867
1909
1868 $ hg help glossary.mcguffin
1910 $ hg help glossary.mcguffin
1869 abort: help section not found: glossary.mcguffin
1911 abort: help section not found: glossary.mcguffin
1870 [255]
1912 [255]
1871
1913
1872 $ hg help glossary.mc.guffin
1914 $ hg help glossary.mc.guffin
1873 abort: help section not found: glossary.mc.guffin
1915 abort: help section not found: glossary.mc.guffin
1874 [255]
1916 [255]
1875
1917
1876 $ hg help template.files
1918 $ hg help template.files
1877 files List of strings. All files modified, added, or removed by
1919 files List of strings. All files modified, added, or removed by
1878 this changeset.
1920 this changeset.
1879 files(pattern)
1921 files(pattern)
1880 All files of the current changeset matching the pattern. See
1922 All files of the current changeset matching the pattern. See
1881 'hg help patterns'.
1923 'hg help patterns'.
1882
1924
1883 Test section lookup by translated message
1925 Test section lookup by translated message
1884
1926
1885 str.lower() instead of encoding.lower(str) on translated message might
1927 str.lower() instead of encoding.lower(str) on translated message might
1886 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1928 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1887 as the second or later byte of multi-byte character.
1929 as the second or later byte of multi-byte character.
1888
1930
1889 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1931 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1890 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1932 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1891 replacement makes message meaningless.
1933 replacement makes message meaningless.
1892
1934
1893 This tests that section lookup by translated string isn't broken by
1935 This tests that section lookup by translated string isn't broken by
1894 such str.lower().
1936 such str.lower().
1895
1937
1896 $ "$PYTHON" <<EOF
1938 $ "$PYTHON" <<EOF
1897 > def escape(s):
1939 > def escape(s):
1898 > return b''.join(b'\\u%x' % ord(uc) for uc in s.decode('cp932'))
1940 > return b''.join(b'\\u%x' % ord(uc) for uc in s.decode('cp932'))
1899 > # translation of "record" in ja_JP.cp932
1941 > # translation of "record" in ja_JP.cp932
1900 > upper = b"\x8bL\x98^"
1942 > upper = b"\x8bL\x98^"
1901 > # str.lower()-ed section name should be treated as different one
1943 > # str.lower()-ed section name should be treated as different one
1902 > lower = b"\x8bl\x98^"
1944 > lower = b"\x8bl\x98^"
1903 > with open('ambiguous.py', 'wb') as fp:
1945 > with open('ambiguous.py', 'wb') as fp:
1904 > fp.write(b"""# ambiguous section names in ja_JP.cp932
1946 > fp.write(b"""# ambiguous section names in ja_JP.cp932
1905 > u'''summary of extension
1947 > u'''summary of extension
1906 >
1948 >
1907 > %s
1949 > %s
1908 > ----
1950 > ----
1909 >
1951 >
1910 > Upper name should show only this message
1952 > Upper name should show only this message
1911 >
1953 >
1912 > %s
1954 > %s
1913 > ----
1955 > ----
1914 >
1956 >
1915 > Lower name should show only this message
1957 > Lower name should show only this message
1916 >
1958 >
1917 > subsequent section
1959 > subsequent section
1918 > ------------------
1960 > ------------------
1919 >
1961 >
1920 > This should be hidden at 'hg help ambiguous' with section name.
1962 > This should be hidden at 'hg help ambiguous' with section name.
1921 > '''
1963 > '''
1922 > """ % (escape(upper), escape(lower)))
1964 > """ % (escape(upper), escape(lower)))
1923 > EOF
1965 > EOF
1924
1966
1925 $ cat >> $HGRCPATH <<EOF
1967 $ cat >> $HGRCPATH <<EOF
1926 > [extensions]
1968 > [extensions]
1927 > ambiguous = ./ambiguous.py
1969 > ambiguous = ./ambiguous.py
1928 > EOF
1970 > EOF
1929
1971
1930 $ "$PYTHON" <<EOF | sh
1972 $ "$PYTHON" <<EOF | sh
1931 > from mercurial import pycompat
1973 > from mercurial import pycompat
1932 > upper = b"\x8bL\x98^"
1974 > upper = b"\x8bL\x98^"
1933 > pycompat.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % upper)
1975 > pycompat.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % upper)
1934 > EOF
1976 > EOF
1935 \x8bL\x98^ (esc)
1977 \x8bL\x98^ (esc)
1936 ----
1978 ----
1937
1979
1938 Upper name should show only this message
1980 Upper name should show only this message
1939
1981
1940
1982
1941 $ "$PYTHON" <<EOF | sh
1983 $ "$PYTHON" <<EOF | sh
1942 > from mercurial import pycompat
1984 > from mercurial import pycompat
1943 > lower = b"\x8bl\x98^"
1985 > lower = b"\x8bl\x98^"
1944 > pycompat.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % lower)
1986 > pycompat.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % lower)
1945 > EOF
1987 > EOF
1946 \x8bl\x98^ (esc)
1988 \x8bl\x98^ (esc)
1947 ----
1989 ----
1948
1990
1949 Lower name should show only this message
1991 Lower name should show only this message
1950
1992
1951
1993
1952 $ cat >> $HGRCPATH <<EOF
1994 $ cat >> $HGRCPATH <<EOF
1953 > [extensions]
1995 > [extensions]
1954 > ambiguous = !
1996 > ambiguous = !
1955 > EOF
1997 > EOF
1956
1998
1957 Show help content of disabled extensions
1999 Show help content of disabled extensions
1958
2000
1959 $ cat >> $HGRCPATH <<EOF
2001 $ cat >> $HGRCPATH <<EOF
1960 > [extensions]
2002 > [extensions]
1961 > ambiguous = !./ambiguous.py
2003 > ambiguous = !./ambiguous.py
1962 > EOF
2004 > EOF
1963 $ hg help -e ambiguous
2005 $ hg help -e ambiguous
1964 ambiguous extension - (no help text available)
2006 ambiguous extension - (no help text available)
1965
2007
1966 (use 'hg help extensions' for information on enabling extensions)
2008 (use 'hg help extensions' for information on enabling extensions)
1967
2009
1968 Test dynamic list of merge tools only shows up once
2010 Test dynamic list of merge tools only shows up once
1969 $ hg help merge-tools
2011 $ hg help merge-tools
1970 Merge Tools
2012 Merge Tools
1971 """""""""""
2013 """""""""""
1972
2014
1973 To merge files Mercurial uses merge tools.
2015 To merge files Mercurial uses merge tools.
1974
2016
1975 A merge tool combines two different versions of a file into a merged file.
2017 A merge tool combines two different versions of a file into a merged file.
1976 Merge tools are given the two files and the greatest common ancestor of
2018 Merge tools are given the two files and the greatest common ancestor of
1977 the two file versions, so they can determine the changes made on both
2019 the two file versions, so they can determine the changes made on both
1978 branches.
2020 branches.
1979
2021
1980 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
2022 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1981 backout' and in several extensions.
2023 backout' and in several extensions.
1982
2024
1983 Usually, the merge tool tries to automatically reconcile the files by
2025 Usually, the merge tool tries to automatically reconcile the files by
1984 combining all non-overlapping changes that occurred separately in the two
2026 combining all non-overlapping changes that occurred separately in the two
1985 different evolutions of the same initial base file. Furthermore, some
2027 different evolutions of the same initial base file. Furthermore, some
1986 interactive merge programs make it easier to manually resolve conflicting
2028 interactive merge programs make it easier to manually resolve conflicting
1987 merges, either in a graphical way, or by inserting some conflict markers.
2029 merges, either in a graphical way, or by inserting some conflict markers.
1988 Mercurial does not include any interactive merge programs but relies on
2030 Mercurial does not include any interactive merge programs but relies on
1989 external tools for that.
2031 external tools for that.
1990
2032
1991 Available merge tools
2033 Available merge tools
1992 =====================
2034 =====================
1993
2035
1994 External merge tools and their properties are configured in the merge-
2036 External merge tools and their properties are configured in the merge-
1995 tools configuration section - see hgrc(5) - but they can often just be
2037 tools configuration section - see hgrc(5) - but they can often just be
1996 named by their executable.
2038 named by their executable.
1997
2039
1998 A merge tool is generally usable if its executable can be found on the
2040 A merge tool is generally usable if its executable can be found on the
1999 system and if it can handle the merge. The executable is found if it is an
2041 system and if it can handle the merge. The executable is found if it is an
2000 absolute or relative executable path or the name of an application in the
2042 absolute or relative executable path or the name of an application in the
2001 executable search path. The tool is assumed to be able to handle the merge
2043 executable search path. The tool is assumed to be able to handle the merge
2002 if it can handle symlinks if the file is a symlink, if it can handle
2044 if it can handle symlinks if the file is a symlink, if it can handle
2003 binary files if the file is binary, and if a GUI is available if the tool
2045 binary files if the file is binary, and if a GUI is available if the tool
2004 requires a GUI.
2046 requires a GUI.
2005
2047
2006 There are some internal merge tools which can be used. The internal merge
2048 There are some internal merge tools which can be used. The internal merge
2007 tools are:
2049 tools are:
2008
2050
2009 ":dump"
2051 ":dump"
2010 Creates three versions of the files to merge, containing the contents of
2052 Creates three versions of the files to merge, containing the contents of
2011 local, other and base. These files can then be used to perform a merge
2053 local, other and base. These files can then be used to perform a merge
2012 manually. If the file to be merged is named "a.txt", these files will
2054 manually. If the file to be merged is named "a.txt", these files will
2013 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
2055 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
2014 they will be placed in the same directory as "a.txt".
2056 they will be placed in the same directory as "a.txt".
2015
2057
2016 This implies premerge. Therefore, files aren't dumped, if premerge runs
2058 This implies premerge. Therefore, files aren't dumped, if premerge runs
2017 successfully. Use :forcedump to forcibly write files out.
2059 successfully. Use :forcedump to forcibly write files out.
2018
2060
2019 (actual capabilities: binary, symlink)
2061 (actual capabilities: binary, symlink)
2020
2062
2021 ":fail"
2063 ":fail"
2022 Rather than attempting to merge files that were modified on both
2064 Rather than attempting to merge files that were modified on both
2023 branches, it marks them as unresolved. The resolve command must be used
2065 branches, it marks them as unresolved. The resolve command must be used
2024 to resolve these conflicts.
2066 to resolve these conflicts.
2025
2067
2026 (actual capabilities: binary, symlink)
2068 (actual capabilities: binary, symlink)
2027
2069
2028 ":forcedump"
2070 ":forcedump"
2029 Creates three versions of the files as same as :dump, but omits
2071 Creates three versions of the files as same as :dump, but omits
2030 premerge.
2072 premerge.
2031
2073
2032 (actual capabilities: binary, symlink)
2074 (actual capabilities: binary, symlink)
2033
2075
2034 ":local"
2076 ":local"
2035 Uses the local 'p1()' version of files as the merged version.
2077 Uses the local 'p1()' version of files as the merged version.
2036
2078
2037 (actual capabilities: binary, symlink)
2079 (actual capabilities: binary, symlink)
2038
2080
2039 ":merge"
2081 ":merge"
2040 Uses the internal non-interactive simple merge algorithm for merging
2082 Uses the internal non-interactive simple merge algorithm for merging
2041 files. It will fail if there are any conflicts and leave markers in the
2083 files. It will fail if there are any conflicts and leave markers in the
2042 partially merged file. Markers will have two sections, one for each side
2084 partially merged file. Markers will have two sections, one for each side
2043 of merge.
2085 of merge.
2044
2086
2045 ":merge-local"
2087 ":merge-local"
2046 Like :merge, but resolve all conflicts non-interactively in favor of the
2088 Like :merge, but resolve all conflicts non-interactively in favor of the
2047 local 'p1()' changes.
2089 local 'p1()' changes.
2048
2090
2049 ":merge-other"
2091 ":merge-other"
2050 Like :merge, but resolve all conflicts non-interactively in favor of the
2092 Like :merge, but resolve all conflicts non-interactively in favor of the
2051 other 'p2()' changes.
2093 other 'p2()' changes.
2052
2094
2053 ":merge3"
2095 ":merge3"
2054 Uses the internal non-interactive simple merge algorithm for merging
2096 Uses the internal non-interactive simple merge algorithm for merging
2055 files. It will fail if there are any conflicts and leave markers in the
2097 files. It will fail if there are any conflicts and leave markers in the
2056 partially merged file. Marker will have three sections, one from each
2098 partially merged file. Marker will have three sections, one from each
2057 side of the merge and one for the base content.
2099 side of the merge and one for the base content.
2058
2100
2059 ":other"
2101 ":other"
2060 Uses the other 'p2()' version of files as the merged version.
2102 Uses the other 'p2()' version of files as the merged version.
2061
2103
2062 (actual capabilities: binary, symlink)
2104 (actual capabilities: binary, symlink)
2063
2105
2064 ":prompt"
2106 ":prompt"
2065 Asks the user which of the local 'p1()' or the other 'p2()' version to
2107 Asks the user which of the local 'p1()' or the other 'p2()' version to
2066 keep as the merged version.
2108 keep as the merged version.
2067
2109
2068 (actual capabilities: binary, symlink)
2110 (actual capabilities: binary, symlink)
2069
2111
2070 ":tagmerge"
2112 ":tagmerge"
2071 Uses the internal tag merge algorithm (experimental).
2113 Uses the internal tag merge algorithm (experimental).
2072
2114
2073 ":union"
2115 ":union"
2074 Uses the internal non-interactive simple merge algorithm for merging
2116 Uses the internal non-interactive simple merge algorithm for merging
2075 files. It will use both left and right sides for conflict regions. No
2117 files. It will use both left and right sides for conflict regions. No
2076 markers are inserted.
2118 markers are inserted.
2077
2119
2078 Internal tools are always available and do not require a GUI but will by
2120 Internal tools are always available and do not require a GUI but will by
2079 default not handle symlinks or binary files. See next section for detail
2121 default not handle symlinks or binary files. See next section for detail
2080 about "actual capabilities" described above.
2122 about "actual capabilities" described above.
2081
2123
2082 Choosing a merge tool
2124 Choosing a merge tool
2083 =====================
2125 =====================
2084
2126
2085 Mercurial uses these rules when deciding which merge tool to use:
2127 Mercurial uses these rules when deciding which merge tool to use:
2086
2128
2087 1. If a tool has been specified with the --tool option to merge or
2129 1. If a tool has been specified with the --tool option to merge or
2088 resolve, it is used. If it is the name of a tool in the merge-tools
2130 resolve, it is used. If it is the name of a tool in the merge-tools
2089 configuration, its configuration is used. Otherwise the specified tool
2131 configuration, its configuration is used. Otherwise the specified tool
2090 must be executable by the shell.
2132 must be executable by the shell.
2091 2. If the "HGMERGE" environment variable is present, its value is used and
2133 2. If the "HGMERGE" environment variable is present, its value is used and
2092 must be executable by the shell.
2134 must be executable by the shell.
2093 3. If the filename of the file to be merged matches any of the patterns in
2135 3. If the filename of the file to be merged matches any of the patterns in
2094 the merge-patterns configuration section, the first usable merge tool
2136 the merge-patterns configuration section, the first usable merge tool
2095 corresponding to a matching pattern is used.
2137 corresponding to a matching pattern is used.
2096 4. If ui.merge is set it will be considered next. If the value is not the
2138 4. If ui.merge is set it will be considered next. If the value is not the
2097 name of a configured tool, the specified value is used and must be
2139 name of a configured tool, the specified value is used and must be
2098 executable by the shell. Otherwise the named tool is used if it is
2140 executable by the shell. Otherwise the named tool is used if it is
2099 usable.
2141 usable.
2100 5. If any usable merge tools are present in the merge-tools configuration
2142 5. If any usable merge tools are present in the merge-tools configuration
2101 section, the one with the highest priority is used.
2143 section, the one with the highest priority is used.
2102 6. If a program named "hgmerge" can be found on the system, it is used -
2144 6. If a program named "hgmerge" can be found on the system, it is used -
2103 but it will by default not be used for symlinks and binary files.
2145 but it will by default not be used for symlinks and binary files.
2104 7. If the file to be merged is not binary and is not a symlink, then
2146 7. If the file to be merged is not binary and is not a symlink, then
2105 internal ":merge" is used.
2147 internal ":merge" is used.
2106 8. Otherwise, ":prompt" is used.
2148 8. Otherwise, ":prompt" is used.
2107
2149
2108 For historical reason, Mercurial treats merge tools as below while
2150 For historical reason, Mercurial treats merge tools as below while
2109 examining rules above.
2151 examining rules above.
2110
2152
2111 step specified via binary symlink
2153 step specified via binary symlink
2112 ----------------------------------
2154 ----------------------------------
2113 1. --tool o/o o/o
2155 1. --tool o/o o/o
2114 2. HGMERGE o/o o/o
2156 2. HGMERGE o/o o/o
2115 3. merge-patterns o/o(*) x/?(*)
2157 3. merge-patterns o/o(*) x/?(*)
2116 4. ui.merge x/?(*) x/?(*)
2158 4. ui.merge x/?(*) x/?(*)
2117
2159
2118 Each capability column indicates Mercurial behavior for internal/external
2160 Each capability column indicates Mercurial behavior for internal/external
2119 merge tools at examining each rule.
2161 merge tools at examining each rule.
2120
2162
2121 - "o": "assume that a tool has capability"
2163 - "o": "assume that a tool has capability"
2122 - "x": "assume that a tool does not have capability"
2164 - "x": "assume that a tool does not have capability"
2123 - "?": "check actual capability of a tool"
2165 - "?": "check actual capability of a tool"
2124
2166
2125 If "merge.strict-capability-check" configuration is true, Mercurial checks
2167 If "merge.strict-capability-check" configuration is true, Mercurial checks
2126 capabilities of merge tools strictly in (*) cases above (= each capability
2168 capabilities of merge tools strictly in (*) cases above (= each capability
2127 column becomes "?/?"). It is false by default for backward compatibility.
2169 column becomes "?/?"). It is false by default for backward compatibility.
2128
2170
2129 Note:
2171 Note:
2130 After selecting a merge program, Mercurial will by default attempt to
2172 After selecting a merge program, Mercurial will by default attempt to
2131 merge the files using a simple merge algorithm first. Only if it
2173 merge the files using a simple merge algorithm first. Only if it
2132 doesn't succeed because of conflicting changes will Mercurial actually
2174 doesn't succeed because of conflicting changes will Mercurial actually
2133 execute the merge program. Whether to use the simple merge algorithm
2175 execute the merge program. Whether to use the simple merge algorithm
2134 first can be controlled by the premerge setting of the merge tool.
2176 first can be controlled by the premerge setting of the merge tool.
2135 Premerge is enabled by default unless the file is binary or a symlink.
2177 Premerge is enabled by default unless the file is binary or a symlink.
2136
2178
2137 See the merge-tools and ui sections of hgrc(5) for details on the
2179 See the merge-tools and ui sections of hgrc(5) for details on the
2138 configuration of merge tools.
2180 configuration of merge tools.
2139
2181
2140 Compression engines listed in `hg help bundlespec`
2182 Compression engines listed in `hg help bundlespec`
2141
2183
2142 $ hg help bundlespec | grep gzip
2184 $ hg help bundlespec | grep gzip
2143 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
2185 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
2144 An algorithm that produces smaller bundles than "gzip".
2186 An algorithm that produces smaller bundles than "gzip".
2145 This engine will likely produce smaller bundles than "gzip" but will be
2187 This engine will likely produce smaller bundles than "gzip" but will be
2146 "gzip"
2188 "gzip"
2147 better compression than "gzip". It also frequently yields better (?)
2189 better compression than "gzip". It also frequently yields better (?)
2148
2190
2149 Test usage of section marks in help documents
2191 Test usage of section marks in help documents
2150
2192
2151 $ cd "$TESTDIR"/../doc
2193 $ cd "$TESTDIR"/../doc
2152 $ "$PYTHON" check-seclevel.py
2194 $ "$PYTHON" check-seclevel.py
2153 $ cd $TESTTMP
2195 $ cd $TESTTMP
2154
2196
2155 #if serve
2197 #if serve
2156
2198
2157 Test the help pages in hgweb.
2199 Test the help pages in hgweb.
2158
2200
2159 Dish up an empty repo; serve it cold.
2201 Dish up an empty repo; serve it cold.
2160
2202
2161 $ hg init "$TESTTMP/test"
2203 $ hg init "$TESTTMP/test"
2162 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
2204 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
2163 $ cat hg.pid >> $DAEMON_PIDS
2205 $ cat hg.pid >> $DAEMON_PIDS
2164
2206
2165 $ get-with-headers.py $LOCALIP:$HGPORT "help"
2207 $ get-with-headers.py $LOCALIP:$HGPORT "help"
2166 200 Script output follows
2208 200 Script output follows
2167
2209
2168 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2210 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2169 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2211 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2170 <head>
2212 <head>
2171 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2213 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2172 <meta name="robots" content="index, nofollow" />
2214 <meta name="robots" content="index, nofollow" />
2173 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2215 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2174 <script type="text/javascript" src="/static/mercurial.js"></script>
2216 <script type="text/javascript" src="/static/mercurial.js"></script>
2175
2217
2176 <title>Help: Index</title>
2218 <title>Help: Index</title>
2177 </head>
2219 </head>
2178 <body>
2220 <body>
2179
2221
2180 <div class="container">
2222 <div class="container">
2181 <div class="menu">
2223 <div class="menu">
2182 <div class="logo">
2224 <div class="logo">
2183 <a href="https://mercurial-scm.org/">
2225 <a href="https://mercurial-scm.org/">
2184 <img src="/static/hglogo.png" alt="mercurial" /></a>
2226 <img src="/static/hglogo.png" alt="mercurial" /></a>
2185 </div>
2227 </div>
2186 <ul>
2228 <ul>
2187 <li><a href="/shortlog">log</a></li>
2229 <li><a href="/shortlog">log</a></li>
2188 <li><a href="/graph">graph</a></li>
2230 <li><a href="/graph">graph</a></li>
2189 <li><a href="/tags">tags</a></li>
2231 <li><a href="/tags">tags</a></li>
2190 <li><a href="/bookmarks">bookmarks</a></li>
2232 <li><a href="/bookmarks">bookmarks</a></li>
2191 <li><a href="/branches">branches</a></li>
2233 <li><a href="/branches">branches</a></li>
2192 </ul>
2234 </ul>
2193 <ul>
2235 <ul>
2194 <li class="active">help</li>
2236 <li class="active">help</li>
2195 </ul>
2237 </ul>
2196 </div>
2238 </div>
2197
2239
2198 <div class="main">
2240 <div class="main">
2199 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2241 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2200
2242
2201 <form class="search" action="/log">
2243 <form class="search" action="/log">
2202
2244
2203 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2245 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2204 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2246 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2205 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2247 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2206 </form>
2248 </form>
2207 <table class="bigtable">
2249 <table class="bigtable">
2208 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2250 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2209
2251
2210 <tr><td>
2252 <tr><td>
2211 <a href="/help/bundlespec">
2253 <a href="/help/bundlespec">
2212 bundlespec
2254 bundlespec
2213 </a>
2255 </a>
2214 </td><td>
2256 </td><td>
2215 Bundle File Formats
2257 Bundle File Formats
2216 </td></tr>
2258 </td></tr>
2217 <tr><td>
2259 <tr><td>
2218 <a href="/help/color">
2260 <a href="/help/color">
2219 color
2261 color
2220 </a>
2262 </a>
2221 </td><td>
2263 </td><td>
2222 Colorizing Outputs
2264 Colorizing Outputs
2223 </td></tr>
2265 </td></tr>
2224 <tr><td>
2266 <tr><td>
2225 <a href="/help/config">
2267 <a href="/help/config">
2226 config
2268 config
2227 </a>
2269 </a>
2228 </td><td>
2270 </td><td>
2229 Configuration Files
2271 Configuration Files
2230 </td></tr>
2272 </td></tr>
2231 <tr><td>
2273 <tr><td>
2232 <a href="/help/dates">
2274 <a href="/help/dates">
2233 dates
2275 dates
2234 </a>
2276 </a>
2235 </td><td>
2277 </td><td>
2236 Date Formats
2278 Date Formats
2237 </td></tr>
2279 </td></tr>
2238 <tr><td>
2280 <tr><td>
2239 <a href="/help/deprecated">
2281 <a href="/help/deprecated">
2240 deprecated
2282 deprecated
2241 </a>
2283 </a>
2242 </td><td>
2284 </td><td>
2243 Deprecated Features
2285 Deprecated Features
2244 </td></tr>
2286 </td></tr>
2245 <tr><td>
2287 <tr><td>
2246 <a href="/help/diffs">
2288 <a href="/help/diffs">
2247 diffs
2289 diffs
2248 </a>
2290 </a>
2249 </td><td>
2291 </td><td>
2250 Diff Formats
2292 Diff Formats
2251 </td></tr>
2293 </td></tr>
2252 <tr><td>
2294 <tr><td>
2253 <a href="/help/environment">
2295 <a href="/help/environment">
2254 environment
2296 environment
2255 </a>
2297 </a>
2256 </td><td>
2298 </td><td>
2257 Environment Variables
2299 Environment Variables
2258 </td></tr>
2300 </td></tr>
2259 <tr><td>
2301 <tr><td>
2260 <a href="/help/extensions">
2302 <a href="/help/extensions">
2261 extensions
2303 extensions
2262 </a>
2304 </a>
2263 </td><td>
2305 </td><td>
2264 Using Additional Features
2306 Using Additional Features
2265 </td></tr>
2307 </td></tr>
2266 <tr><td>
2308 <tr><td>
2267 <a href="/help/filesets">
2309 <a href="/help/filesets">
2268 filesets
2310 filesets
2269 </a>
2311 </a>
2270 </td><td>
2312 </td><td>
2271 Specifying File Sets
2313 Specifying File Sets
2272 </td></tr>
2314 </td></tr>
2273 <tr><td>
2315 <tr><td>
2274 <a href="/help/flags">
2316 <a href="/help/flags">
2275 flags
2317 flags
2276 </a>
2318 </a>
2277 </td><td>
2319 </td><td>
2278 Command-line flags
2320 Command-line flags
2279 </td></tr>
2321 </td></tr>
2280 <tr><td>
2322 <tr><td>
2281 <a href="/help/glossary">
2323 <a href="/help/glossary">
2282 glossary
2324 glossary
2283 </a>
2325 </a>
2284 </td><td>
2326 </td><td>
2285 Glossary
2327 Glossary
2286 </td></tr>
2328 </td></tr>
2287 <tr><td>
2329 <tr><td>
2288 <a href="/help/hgignore">
2330 <a href="/help/hgignore">
2289 hgignore
2331 hgignore
2290 </a>
2332 </a>
2291 </td><td>
2333 </td><td>
2292 Syntax for Mercurial Ignore Files
2334 Syntax for Mercurial Ignore Files
2293 </td></tr>
2335 </td></tr>
2294 <tr><td>
2336 <tr><td>
2295 <a href="/help/hgweb">
2337 <a href="/help/hgweb">
2296 hgweb
2338 hgweb
2297 </a>
2339 </a>
2298 </td><td>
2340 </td><td>
2299 Configuring hgweb
2341 Configuring hgweb
2300 </td></tr>
2342 </td></tr>
2301 <tr><td>
2343 <tr><td>
2302 <a href="/help/internals">
2344 <a href="/help/internals">
2303 internals
2345 internals
2304 </a>
2346 </a>
2305 </td><td>
2347 </td><td>
2306 Technical implementation topics
2348 Technical implementation topics
2307 </td></tr>
2349 </td></tr>
2308 <tr><td>
2350 <tr><td>
2309 <a href="/help/merge-tools">
2351 <a href="/help/merge-tools">
2310 merge-tools
2352 merge-tools
2311 </a>
2353 </a>
2312 </td><td>
2354 </td><td>
2313 Merge Tools
2355 Merge Tools
2314 </td></tr>
2356 </td></tr>
2315 <tr><td>
2357 <tr><td>
2316 <a href="/help/pager">
2358 <a href="/help/pager">
2317 pager
2359 pager
2318 </a>
2360 </a>
2319 </td><td>
2361 </td><td>
2320 Pager Support
2362 Pager Support
2321 </td></tr>
2363 </td></tr>
2322 <tr><td>
2364 <tr><td>
2323 <a href="/help/patterns">
2365 <a href="/help/patterns">
2324 patterns
2366 patterns
2325 </a>
2367 </a>
2326 </td><td>
2368 </td><td>
2327 File Name Patterns
2369 File Name Patterns
2328 </td></tr>
2370 </td></tr>
2329 <tr><td>
2371 <tr><td>
2330 <a href="/help/phases">
2372 <a href="/help/phases">
2331 phases
2373 phases
2332 </a>
2374 </a>
2333 </td><td>
2375 </td><td>
2334 Working with Phases
2376 Working with Phases
2335 </td></tr>
2377 </td></tr>
2336 <tr><td>
2378 <tr><td>
2337 <a href="/help/revisions">
2379 <a href="/help/revisions">
2338 revisions
2380 revisions
2339 </a>
2381 </a>
2340 </td><td>
2382 </td><td>
2341 Specifying Revisions
2383 Specifying Revisions
2342 </td></tr>
2384 </td></tr>
2343 <tr><td>
2385 <tr><td>
2344 <a href="/help/scripting">
2386 <a href="/help/scripting">
2345 scripting
2387 scripting
2346 </a>
2388 </a>
2347 </td><td>
2389 </td><td>
2348 Using Mercurial from scripts and automation
2390 Using Mercurial from scripts and automation
2349 </td></tr>
2391 </td></tr>
2350 <tr><td>
2392 <tr><td>
2351 <a href="/help/subrepos">
2393 <a href="/help/subrepos">
2352 subrepos
2394 subrepos
2353 </a>
2395 </a>
2354 </td><td>
2396 </td><td>
2355 Subrepositories
2397 Subrepositories
2356 </td></tr>
2398 </td></tr>
2357 <tr><td>
2399 <tr><td>
2358 <a href="/help/templating">
2400 <a href="/help/templating">
2359 templating
2401 templating
2360 </a>
2402 </a>
2361 </td><td>
2403 </td><td>
2362 Template Usage
2404 Template Usage
2363 </td></tr>
2405 </td></tr>
2364 <tr><td>
2406 <tr><td>
2365 <a href="/help/urls">
2407 <a href="/help/urls">
2366 urls
2408 urls
2367 </a>
2409 </a>
2368 </td><td>
2410 </td><td>
2369 URL Paths
2411 URL Paths
2370 </td></tr>
2412 </td></tr>
2371 <tr><td>
2413 <tr><td>
2372 <a href="/help/topic-containing-verbose">
2414 <a href="/help/topic-containing-verbose">
2373 topic-containing-verbose
2415 topic-containing-verbose
2374 </a>
2416 </a>
2375 </td><td>
2417 </td><td>
2376 This is the topic to test omit indicating.
2418 This is the topic to test omit indicating.
2377 </td></tr>
2419 </td></tr>
2378
2420
2379
2421
2380 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2422 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2381
2423
2382 <tr><td>
2424 <tr><td>
2383 <a href="/help/add">
2425 <a href="/help/add">
2384 add
2426 add
2385 </a>
2427 </a>
2386 </td><td>
2428 </td><td>
2387 add the specified files on the next commit
2429 add the specified files on the next commit
2388 </td></tr>
2430 </td></tr>
2389 <tr><td>
2431 <tr><td>
2390 <a href="/help/annotate">
2432 <a href="/help/annotate">
2391 annotate
2433 annotate
2392 </a>
2434 </a>
2393 </td><td>
2435 </td><td>
2394 show changeset information by line for each file
2436 show changeset information by line for each file
2395 </td></tr>
2437 </td></tr>
2396 <tr><td>
2438 <tr><td>
2397 <a href="/help/clone">
2439 <a href="/help/clone">
2398 clone
2440 clone
2399 </a>
2441 </a>
2400 </td><td>
2442 </td><td>
2401 make a copy of an existing repository
2443 make a copy of an existing repository
2402 </td></tr>
2444 </td></tr>
2403 <tr><td>
2445 <tr><td>
2404 <a href="/help/commit">
2446 <a href="/help/commit">
2405 commit
2447 commit
2406 </a>
2448 </a>
2407 </td><td>
2449 </td><td>
2408 commit the specified files or all outstanding changes
2450 commit the specified files or all outstanding changes
2409 </td></tr>
2451 </td></tr>
2410 <tr><td>
2452 <tr><td>
2411 <a href="/help/diff">
2453 <a href="/help/diff">
2412 diff
2454 diff
2413 </a>
2455 </a>
2414 </td><td>
2456 </td><td>
2415 diff repository (or selected files)
2457 diff repository (or selected files)
2416 </td></tr>
2458 </td></tr>
2417 <tr><td>
2459 <tr><td>
2418 <a href="/help/export">
2460 <a href="/help/export">
2419 export
2461 export
2420 </a>
2462 </a>
2421 </td><td>
2463 </td><td>
2422 dump the header and diffs for one or more changesets
2464 dump the header and diffs for one or more changesets
2423 </td></tr>
2465 </td></tr>
2424 <tr><td>
2466 <tr><td>
2425 <a href="/help/forget">
2467 <a href="/help/forget">
2426 forget
2468 forget
2427 </a>
2469 </a>
2428 </td><td>
2470 </td><td>
2429 forget the specified files on the next commit
2471 forget the specified files on the next commit
2430 </td></tr>
2472 </td></tr>
2431 <tr><td>
2473 <tr><td>
2432 <a href="/help/init">
2474 <a href="/help/init">
2433 init
2475 init
2434 </a>
2476 </a>
2435 </td><td>
2477 </td><td>
2436 create a new repository in the given directory
2478 create a new repository in the given directory
2437 </td></tr>
2479 </td></tr>
2438 <tr><td>
2480 <tr><td>
2439 <a href="/help/log">
2481 <a href="/help/log">
2440 log
2482 log
2441 </a>
2483 </a>
2442 </td><td>
2484 </td><td>
2443 show revision history of entire repository or files
2485 show revision history of entire repository or files
2444 </td></tr>
2486 </td></tr>
2445 <tr><td>
2487 <tr><td>
2446 <a href="/help/merge">
2488 <a href="/help/merge">
2447 merge
2489 merge
2448 </a>
2490 </a>
2449 </td><td>
2491 </td><td>
2450 merge another revision into working directory
2492 merge another revision into working directory
2451 </td></tr>
2493 </td></tr>
2452 <tr><td>
2494 <tr><td>
2453 <a href="/help/pull">
2495 <a href="/help/pull">
2454 pull
2496 pull
2455 </a>
2497 </a>
2456 </td><td>
2498 </td><td>
2457 pull changes from the specified source
2499 pull changes from the specified source
2458 </td></tr>
2500 </td></tr>
2459 <tr><td>
2501 <tr><td>
2460 <a href="/help/push">
2502 <a href="/help/push">
2461 push
2503 push
2462 </a>
2504 </a>
2463 </td><td>
2505 </td><td>
2464 push changes to the specified destination
2506 push changes to the specified destination
2465 </td></tr>
2507 </td></tr>
2466 <tr><td>
2508 <tr><td>
2467 <a href="/help/remove">
2509 <a href="/help/remove">
2468 remove
2510 remove
2469 </a>
2511 </a>
2470 </td><td>
2512 </td><td>
2471 remove the specified files on the next commit
2513 remove the specified files on the next commit
2472 </td></tr>
2514 </td></tr>
2473 <tr><td>
2515 <tr><td>
2474 <a href="/help/serve">
2516 <a href="/help/serve">
2475 serve
2517 serve
2476 </a>
2518 </a>
2477 </td><td>
2519 </td><td>
2478 start stand-alone webserver
2520 start stand-alone webserver
2479 </td></tr>
2521 </td></tr>
2480 <tr><td>
2522 <tr><td>
2481 <a href="/help/status">
2523 <a href="/help/status">
2482 status
2524 status
2483 </a>
2525 </a>
2484 </td><td>
2526 </td><td>
2485 show changed files in the working directory
2527 show changed files in the working directory
2486 </td></tr>
2528 </td></tr>
2487 <tr><td>
2529 <tr><td>
2488 <a href="/help/summary">
2530 <a href="/help/summary">
2489 summary
2531 summary
2490 </a>
2532 </a>
2491 </td><td>
2533 </td><td>
2492 summarize working directory state
2534 summarize working directory state
2493 </td></tr>
2535 </td></tr>
2494 <tr><td>
2536 <tr><td>
2495 <a href="/help/update">
2537 <a href="/help/update">
2496 update
2538 update
2497 </a>
2539 </a>
2498 </td><td>
2540 </td><td>
2499 update working directory (or switch revisions)
2541 update working directory (or switch revisions)
2500 </td></tr>
2542 </td></tr>
2501
2543
2502
2544
2503
2545
2504 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2546 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2505
2547
2506 <tr><td>
2548 <tr><td>
2507 <a href="/help/addremove">
2549 <a href="/help/addremove">
2508 addremove
2550 addremove
2509 </a>
2551 </a>
2510 </td><td>
2552 </td><td>
2511 add all new files, delete all missing files
2553 add all new files, delete all missing files
2512 </td></tr>
2554 </td></tr>
2513 <tr><td>
2555 <tr><td>
2514 <a href="/help/archive">
2556 <a href="/help/archive">
2515 archive
2557 archive
2516 </a>
2558 </a>
2517 </td><td>
2559 </td><td>
2518 create an unversioned archive of a repository revision
2560 create an unversioned archive of a repository revision
2519 </td></tr>
2561 </td></tr>
2520 <tr><td>
2562 <tr><td>
2521 <a href="/help/backout">
2563 <a href="/help/backout">
2522 backout
2564 backout
2523 </a>
2565 </a>
2524 </td><td>
2566 </td><td>
2525 reverse effect of earlier changeset
2567 reverse effect of earlier changeset
2526 </td></tr>
2568 </td></tr>
2527 <tr><td>
2569 <tr><td>
2528 <a href="/help/bisect">
2570 <a href="/help/bisect">
2529 bisect
2571 bisect
2530 </a>
2572 </a>
2531 </td><td>
2573 </td><td>
2532 subdivision search of changesets
2574 subdivision search of changesets
2533 </td></tr>
2575 </td></tr>
2534 <tr><td>
2576 <tr><td>
2535 <a href="/help/bookmarks">
2577 <a href="/help/bookmarks">
2536 bookmarks
2578 bookmarks
2537 </a>
2579 </a>
2538 </td><td>
2580 </td><td>
2539 create a new bookmark or list existing bookmarks
2581 create a new bookmark or list existing bookmarks
2540 </td></tr>
2582 </td></tr>
2541 <tr><td>
2583 <tr><td>
2542 <a href="/help/branch">
2584 <a href="/help/branch">
2543 branch
2585 branch
2544 </a>
2586 </a>
2545 </td><td>
2587 </td><td>
2546 set or show the current branch name
2588 set or show the current branch name
2547 </td></tr>
2589 </td></tr>
2548 <tr><td>
2590 <tr><td>
2549 <a href="/help/branches">
2591 <a href="/help/branches">
2550 branches
2592 branches
2551 </a>
2593 </a>
2552 </td><td>
2594 </td><td>
2553 list repository named branches
2595 list repository named branches
2554 </td></tr>
2596 </td></tr>
2555 <tr><td>
2597 <tr><td>
2556 <a href="/help/bundle">
2598 <a href="/help/bundle">
2557 bundle
2599 bundle
2558 </a>
2600 </a>
2559 </td><td>
2601 </td><td>
2560 create a bundle file
2602 create a bundle file
2561 </td></tr>
2603 </td></tr>
2562 <tr><td>
2604 <tr><td>
2563 <a href="/help/cat">
2605 <a href="/help/cat">
2564 cat
2606 cat
2565 </a>
2607 </a>
2566 </td><td>
2608 </td><td>
2567 output the current or given revision of files
2609 output the current or given revision of files
2568 </td></tr>
2610 </td></tr>
2569 <tr><td>
2611 <tr><td>
2570 <a href="/help/config">
2612 <a href="/help/config">
2571 config
2613 config
2572 </a>
2614 </a>
2573 </td><td>
2615 </td><td>
2574 show combined config settings from all hgrc files
2616 show combined config settings from all hgrc files
2575 </td></tr>
2617 </td></tr>
2576 <tr><td>
2618 <tr><td>
2577 <a href="/help/copy">
2619 <a href="/help/copy">
2578 copy
2620 copy
2579 </a>
2621 </a>
2580 </td><td>
2622 </td><td>
2581 mark files as copied for the next commit
2623 mark files as copied for the next commit
2582 </td></tr>
2624 </td></tr>
2583 <tr><td>
2625 <tr><td>
2584 <a href="/help/files">
2626 <a href="/help/files">
2585 files
2627 files
2586 </a>
2628 </a>
2587 </td><td>
2629 </td><td>
2588 list tracked files
2630 list tracked files
2589 </td></tr>
2631 </td></tr>
2590 <tr><td>
2632 <tr><td>
2591 <a href="/help/graft">
2633 <a href="/help/graft">
2592 graft
2634 graft
2593 </a>
2635 </a>
2594 </td><td>
2636 </td><td>
2595 copy changes from other branches onto the current branch
2637 copy changes from other branches onto the current branch
2596 </td></tr>
2638 </td></tr>
2597 <tr><td>
2639 <tr><td>
2598 <a href="/help/grep">
2640 <a href="/help/grep">
2599 grep
2641 grep
2600 </a>
2642 </a>
2601 </td><td>
2643 </td><td>
2602 search revision history for a pattern in specified files
2644 search revision history for a pattern in specified files
2603 </td></tr>
2645 </td></tr>
2604 <tr><td>
2646 <tr><td>
2605 <a href="/help/heads">
2647 <a href="/help/heads">
2606 heads
2648 heads
2607 </a>
2649 </a>
2608 </td><td>
2650 </td><td>
2609 show branch heads
2651 show branch heads
2610 </td></tr>
2652 </td></tr>
2611 <tr><td>
2653 <tr><td>
2612 <a href="/help/help">
2654 <a href="/help/help">
2613 help
2655 help
2614 </a>
2656 </a>
2615 </td><td>
2657 </td><td>
2616 show help for a given topic or a help overview
2658 show help for a given topic or a help overview
2617 </td></tr>
2659 </td></tr>
2618 <tr><td>
2660 <tr><td>
2619 <a href="/help/hgalias">
2661 <a href="/help/hgalias">
2620 hgalias
2662 hgalias
2621 </a>
2663 </a>
2622 </td><td>
2664 </td><td>
2623 summarize working directory state
2665 summarize working directory state
2624 </td></tr>
2666 </td></tr>
2625 <tr><td>
2667 <tr><td>
2626 <a href="/help/identify">
2668 <a href="/help/identify">
2627 identify
2669 identify
2628 </a>
2670 </a>
2629 </td><td>
2671 </td><td>
2630 identify the working directory or specified revision
2672 identify the working directory or specified revision
2631 </td></tr>
2673 </td></tr>
2632 <tr><td>
2674 <tr><td>
2633 <a href="/help/import">
2675 <a href="/help/import">
2634 import
2676 import
2635 </a>
2677 </a>
2636 </td><td>
2678 </td><td>
2637 import an ordered set of patches
2679 import an ordered set of patches
2638 </td></tr>
2680 </td></tr>
2639 <tr><td>
2681 <tr><td>
2640 <a href="/help/incoming">
2682 <a href="/help/incoming">
2641 incoming
2683 incoming
2642 </a>
2684 </a>
2643 </td><td>
2685 </td><td>
2644 show new changesets found in source
2686 show new changesets found in source
2645 </td></tr>
2687 </td></tr>
2646 <tr><td>
2688 <tr><td>
2647 <a href="/help/manifest">
2689 <a href="/help/manifest">
2648 manifest
2690 manifest
2649 </a>
2691 </a>
2650 </td><td>
2692 </td><td>
2651 output the current or given revision of the project manifest
2693 output the current or given revision of the project manifest
2652 </td></tr>
2694 </td></tr>
2653 <tr><td>
2695 <tr><td>
2654 <a href="/help/nohelp">
2696 <a href="/help/nohelp">
2655 nohelp
2697 nohelp
2656 </a>
2698 </a>
2657 </td><td>
2699 </td><td>
2658 (no help text available)
2700 (no help text available)
2659 </td></tr>
2701 </td></tr>
2660 <tr><td>
2702 <tr><td>
2661 <a href="/help/outgoing">
2703 <a href="/help/outgoing">
2662 outgoing
2704 outgoing
2663 </a>
2705 </a>
2664 </td><td>
2706 </td><td>
2665 show changesets not found in the destination
2707 show changesets not found in the destination
2666 </td></tr>
2708 </td></tr>
2667 <tr><td>
2709 <tr><td>
2668 <a href="/help/paths">
2710 <a href="/help/paths">
2669 paths
2711 paths
2670 </a>
2712 </a>
2671 </td><td>
2713 </td><td>
2672 show aliases for remote repositories
2714 show aliases for remote repositories
2673 </td></tr>
2715 </td></tr>
2674 <tr><td>
2716 <tr><td>
2675 <a href="/help/phase">
2717 <a href="/help/phase">
2676 phase
2718 phase
2677 </a>
2719 </a>
2678 </td><td>
2720 </td><td>
2679 set or show the current phase name
2721 set or show the current phase name
2680 </td></tr>
2722 </td></tr>
2681 <tr><td>
2723 <tr><td>
2682 <a href="/help/recover">
2724 <a href="/help/recover">
2683 recover
2725 recover
2684 </a>
2726 </a>
2685 </td><td>
2727 </td><td>
2686 roll back an interrupted transaction
2728 roll back an interrupted transaction
2687 </td></tr>
2729 </td></tr>
2688 <tr><td>
2730 <tr><td>
2689 <a href="/help/rename">
2731 <a href="/help/rename">
2690 rename
2732 rename
2691 </a>
2733 </a>
2692 </td><td>
2734 </td><td>
2693 rename files; equivalent of copy + remove
2735 rename files; equivalent of copy + remove
2694 </td></tr>
2736 </td></tr>
2695 <tr><td>
2737 <tr><td>
2696 <a href="/help/resolve">
2738 <a href="/help/resolve">
2697 resolve
2739 resolve
2698 </a>
2740 </a>
2699 </td><td>
2741 </td><td>
2700 redo merges or set/view the merge status of files
2742 redo merges or set/view the merge status of files
2701 </td></tr>
2743 </td></tr>
2702 <tr><td>
2744 <tr><td>
2703 <a href="/help/revert">
2745 <a href="/help/revert">
2704 revert
2746 revert
2705 </a>
2747 </a>
2706 </td><td>
2748 </td><td>
2707 restore files to their checkout state
2749 restore files to their checkout state
2708 </td></tr>
2750 </td></tr>
2709 <tr><td>
2751 <tr><td>
2710 <a href="/help/root">
2752 <a href="/help/root">
2711 root
2753 root
2712 </a>
2754 </a>
2713 </td><td>
2755 </td><td>
2714 print the root (top) of the current working directory
2756 print the root (top) of the current working directory
2715 </td></tr>
2757 </td></tr>
2716 <tr><td>
2758 <tr><td>
2717 <a href="/help/shellalias">
2759 <a href="/help/shellalias">
2718 shellalias
2760 shellalias
2719 </a>
2761 </a>
2720 </td><td>
2762 </td><td>
2721 (no help text available)
2763 (no help text available)
2722 </td></tr>
2764 </td></tr>
2723 <tr><td>
2765 <tr><td>
2724 <a href="/help/tag">
2766 <a href="/help/tag">
2725 tag
2767 tag
2726 </a>
2768 </a>
2727 </td><td>
2769 </td><td>
2728 add one or more tags for the current or given revision
2770 add one or more tags for the current or given revision
2729 </td></tr>
2771 </td></tr>
2730 <tr><td>
2772 <tr><td>
2731 <a href="/help/tags">
2773 <a href="/help/tags">
2732 tags
2774 tags
2733 </a>
2775 </a>
2734 </td><td>
2776 </td><td>
2735 list repository tags
2777 list repository tags
2736 </td></tr>
2778 </td></tr>
2737 <tr><td>
2779 <tr><td>
2738 <a href="/help/unbundle">
2780 <a href="/help/unbundle">
2739 unbundle
2781 unbundle
2740 </a>
2782 </a>
2741 </td><td>
2783 </td><td>
2742 apply one or more bundle files
2784 apply one or more bundle files
2743 </td></tr>
2785 </td></tr>
2744 <tr><td>
2786 <tr><td>
2745 <a href="/help/verify">
2787 <a href="/help/verify">
2746 verify
2788 verify
2747 </a>
2789 </a>
2748 </td><td>
2790 </td><td>
2749 verify the integrity of the repository
2791 verify the integrity of the repository
2750 </td></tr>
2792 </td></tr>
2751 <tr><td>
2793 <tr><td>
2752 <a href="/help/version">
2794 <a href="/help/version">
2753 version
2795 version
2754 </a>
2796 </a>
2755 </td><td>
2797 </td><td>
2756 output version and copyright information
2798 output version and copyright information
2757 </td></tr>
2799 </td></tr>
2758
2800
2759
2801
2760 </table>
2802 </table>
2761 </div>
2803 </div>
2762 </div>
2804 </div>
2763
2805
2764
2806
2765
2807
2766 </body>
2808 </body>
2767 </html>
2809 </html>
2768
2810
2769
2811
2770 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2812 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2771 200 Script output follows
2813 200 Script output follows
2772
2814
2773 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2815 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2774 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2816 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2775 <head>
2817 <head>
2776 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2818 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2777 <meta name="robots" content="index, nofollow" />
2819 <meta name="robots" content="index, nofollow" />
2778 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2820 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2779 <script type="text/javascript" src="/static/mercurial.js"></script>
2821 <script type="text/javascript" src="/static/mercurial.js"></script>
2780
2822
2781 <title>Help: add</title>
2823 <title>Help: add</title>
2782 </head>
2824 </head>
2783 <body>
2825 <body>
2784
2826
2785 <div class="container">
2827 <div class="container">
2786 <div class="menu">
2828 <div class="menu">
2787 <div class="logo">
2829 <div class="logo">
2788 <a href="https://mercurial-scm.org/">
2830 <a href="https://mercurial-scm.org/">
2789 <img src="/static/hglogo.png" alt="mercurial" /></a>
2831 <img src="/static/hglogo.png" alt="mercurial" /></a>
2790 </div>
2832 </div>
2791 <ul>
2833 <ul>
2792 <li><a href="/shortlog">log</a></li>
2834 <li><a href="/shortlog">log</a></li>
2793 <li><a href="/graph">graph</a></li>
2835 <li><a href="/graph">graph</a></li>
2794 <li><a href="/tags">tags</a></li>
2836 <li><a href="/tags">tags</a></li>
2795 <li><a href="/bookmarks">bookmarks</a></li>
2837 <li><a href="/bookmarks">bookmarks</a></li>
2796 <li><a href="/branches">branches</a></li>
2838 <li><a href="/branches">branches</a></li>
2797 </ul>
2839 </ul>
2798 <ul>
2840 <ul>
2799 <li class="active"><a href="/help">help</a></li>
2841 <li class="active"><a href="/help">help</a></li>
2800 </ul>
2842 </ul>
2801 </div>
2843 </div>
2802
2844
2803 <div class="main">
2845 <div class="main">
2804 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2846 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2805 <h3>Help: add</h3>
2847 <h3>Help: add</h3>
2806
2848
2807 <form class="search" action="/log">
2849 <form class="search" action="/log">
2808
2850
2809 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2851 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2810 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2852 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2811 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2853 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2812 </form>
2854 </form>
2813 <div id="doc">
2855 <div id="doc">
2814 <p>
2856 <p>
2815 hg add [OPTION]... [FILE]...
2857 hg add [OPTION]... [FILE]...
2816 </p>
2858 </p>
2817 <p>
2859 <p>
2818 add the specified files on the next commit
2860 add the specified files on the next commit
2819 </p>
2861 </p>
2820 <p>
2862 <p>
2821 Schedule files to be version controlled and added to the
2863 Schedule files to be version controlled and added to the
2822 repository.
2864 repository.
2823 </p>
2865 </p>
2824 <p>
2866 <p>
2825 The files will be added to the repository at the next commit. To
2867 The files will be added to the repository at the next commit. To
2826 undo an add before that, see 'hg forget'.
2868 undo an add before that, see 'hg forget'.
2827 </p>
2869 </p>
2828 <p>
2870 <p>
2829 If no names are given, add all files to the repository (except
2871 If no names are given, add all files to the repository (except
2830 files matching &quot;.hgignore&quot;).
2872 files matching &quot;.hgignore&quot;).
2831 </p>
2873 </p>
2832 <p>
2874 <p>
2833 Examples:
2875 Examples:
2834 </p>
2876 </p>
2835 <ul>
2877 <ul>
2836 <li> New (unknown) files are added automatically by 'hg add':
2878 <li> New (unknown) files are added automatically by 'hg add':
2837 <pre>
2879 <pre>
2838 \$ ls (re)
2880 \$ ls (re)
2839 foo.c
2881 foo.c
2840 \$ hg status (re)
2882 \$ hg status (re)
2841 ? foo.c
2883 ? foo.c
2842 \$ hg add (re)
2884 \$ hg add (re)
2843 adding foo.c
2885 adding foo.c
2844 \$ hg status (re)
2886 \$ hg status (re)
2845 A foo.c
2887 A foo.c
2846 </pre>
2888 </pre>
2847 <li> Specific files to be added can be specified:
2889 <li> Specific files to be added can be specified:
2848 <pre>
2890 <pre>
2849 \$ ls (re)
2891 \$ ls (re)
2850 bar.c foo.c
2892 bar.c foo.c
2851 \$ hg status (re)
2893 \$ hg status (re)
2852 ? bar.c
2894 ? bar.c
2853 ? foo.c
2895 ? foo.c
2854 \$ hg add bar.c (re)
2896 \$ hg add bar.c (re)
2855 \$ hg status (re)
2897 \$ hg status (re)
2856 A bar.c
2898 A bar.c
2857 ? foo.c
2899 ? foo.c
2858 </pre>
2900 </pre>
2859 </ul>
2901 </ul>
2860 <p>
2902 <p>
2861 Returns 0 if all files are successfully added.
2903 Returns 0 if all files are successfully added.
2862 </p>
2904 </p>
2863 <p>
2905 <p>
2864 options ([+] can be repeated):
2906 options ([+] can be repeated):
2865 </p>
2907 </p>
2866 <table>
2908 <table>
2867 <tr><td>-I</td>
2909 <tr><td>-I</td>
2868 <td>--include PATTERN [+]</td>
2910 <td>--include PATTERN [+]</td>
2869 <td>include names matching the given patterns</td></tr>
2911 <td>include names matching the given patterns</td></tr>
2870 <tr><td>-X</td>
2912 <tr><td>-X</td>
2871 <td>--exclude PATTERN [+]</td>
2913 <td>--exclude PATTERN [+]</td>
2872 <td>exclude names matching the given patterns</td></tr>
2914 <td>exclude names matching the given patterns</td></tr>
2873 <tr><td>-S</td>
2915 <tr><td>-S</td>
2874 <td>--subrepos</td>
2916 <td>--subrepos</td>
2875 <td>recurse into subrepositories</td></tr>
2917 <td>recurse into subrepositories</td></tr>
2876 <tr><td>-n</td>
2918 <tr><td>-n</td>
2877 <td>--dry-run</td>
2919 <td>--dry-run</td>
2878 <td>do not perform actions, just print output</td></tr>
2920 <td>do not perform actions, just print output</td></tr>
2879 </table>
2921 </table>
2880 <p>
2922 <p>
2881 global options ([+] can be repeated):
2923 global options ([+] can be repeated):
2882 </p>
2924 </p>
2883 <table>
2925 <table>
2884 <tr><td>-R</td>
2926 <tr><td>-R</td>
2885 <td>--repository REPO</td>
2927 <td>--repository REPO</td>
2886 <td>repository root directory or name of overlay bundle file</td></tr>
2928 <td>repository root directory or name of overlay bundle file</td></tr>
2887 <tr><td></td>
2929 <tr><td></td>
2888 <td>--cwd DIR</td>
2930 <td>--cwd DIR</td>
2889 <td>change working directory</td></tr>
2931 <td>change working directory</td></tr>
2890 <tr><td>-y</td>
2932 <tr><td>-y</td>
2891 <td>--noninteractive</td>
2933 <td>--noninteractive</td>
2892 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2934 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2893 <tr><td>-q</td>
2935 <tr><td>-q</td>
2894 <td>--quiet</td>
2936 <td>--quiet</td>
2895 <td>suppress output</td></tr>
2937 <td>suppress output</td></tr>
2896 <tr><td>-v</td>
2938 <tr><td>-v</td>
2897 <td>--verbose</td>
2939 <td>--verbose</td>
2898 <td>enable additional output</td></tr>
2940 <td>enable additional output</td></tr>
2899 <tr><td></td>
2941 <tr><td></td>
2900 <td>--color TYPE</td>
2942 <td>--color TYPE</td>
2901 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2943 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2902 <tr><td></td>
2944 <tr><td></td>
2903 <td>--config CONFIG [+]</td>
2945 <td>--config CONFIG [+]</td>
2904 <td>set/override config option (use 'section.name=value')</td></tr>
2946 <td>set/override config option (use 'section.name=value')</td></tr>
2905 <tr><td></td>
2947 <tr><td></td>
2906 <td>--debug</td>
2948 <td>--debug</td>
2907 <td>enable debugging output</td></tr>
2949 <td>enable debugging output</td></tr>
2908 <tr><td></td>
2950 <tr><td></td>
2909 <td>--debugger</td>
2951 <td>--debugger</td>
2910 <td>start debugger</td></tr>
2952 <td>start debugger</td></tr>
2911 <tr><td></td>
2953 <tr><td></td>
2912 <td>--encoding ENCODE</td>
2954 <td>--encoding ENCODE</td>
2913 <td>set the charset encoding (default: ascii)</td></tr>
2955 <td>set the charset encoding (default: ascii)</td></tr>
2914 <tr><td></td>
2956 <tr><td></td>
2915 <td>--encodingmode MODE</td>
2957 <td>--encodingmode MODE</td>
2916 <td>set the charset encoding mode (default: strict)</td></tr>
2958 <td>set the charset encoding mode (default: strict)</td></tr>
2917 <tr><td></td>
2959 <tr><td></td>
2918 <td>--traceback</td>
2960 <td>--traceback</td>
2919 <td>always print a traceback on exception</td></tr>
2961 <td>always print a traceback on exception</td></tr>
2920 <tr><td></td>
2962 <tr><td></td>
2921 <td>--time</td>
2963 <td>--time</td>
2922 <td>time how long the command takes</td></tr>
2964 <td>time how long the command takes</td></tr>
2923 <tr><td></td>
2965 <tr><td></td>
2924 <td>--profile</td>
2966 <td>--profile</td>
2925 <td>print command execution profile</td></tr>
2967 <td>print command execution profile</td></tr>
2926 <tr><td></td>
2968 <tr><td></td>
2927 <td>--version</td>
2969 <td>--version</td>
2928 <td>output version information and exit</td></tr>
2970 <td>output version information and exit</td></tr>
2929 <tr><td>-h</td>
2971 <tr><td>-h</td>
2930 <td>--help</td>
2972 <td>--help</td>
2931 <td>display help and exit</td></tr>
2973 <td>display help and exit</td></tr>
2932 <tr><td></td>
2974 <tr><td></td>
2933 <td>--hidden</td>
2975 <td>--hidden</td>
2934 <td>consider hidden changesets</td></tr>
2976 <td>consider hidden changesets</td></tr>
2935 <tr><td></td>
2977 <tr><td></td>
2936 <td>--pager TYPE</td>
2978 <td>--pager TYPE</td>
2937 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2979 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2938 </table>
2980 </table>
2939
2981
2940 </div>
2982 </div>
2941 </div>
2983 </div>
2942 </div>
2984 </div>
2943
2985
2944
2986
2945
2987
2946 </body>
2988 </body>
2947 </html>
2989 </html>
2948
2990
2949
2991
2950 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2992 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2951 200 Script output follows
2993 200 Script output follows
2952
2994
2953 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2995 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2954 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2996 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2955 <head>
2997 <head>
2956 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2998 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2957 <meta name="robots" content="index, nofollow" />
2999 <meta name="robots" content="index, nofollow" />
2958 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3000 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2959 <script type="text/javascript" src="/static/mercurial.js"></script>
3001 <script type="text/javascript" src="/static/mercurial.js"></script>
2960
3002
2961 <title>Help: remove</title>
3003 <title>Help: remove</title>
2962 </head>
3004 </head>
2963 <body>
3005 <body>
2964
3006
2965 <div class="container">
3007 <div class="container">
2966 <div class="menu">
3008 <div class="menu">
2967 <div class="logo">
3009 <div class="logo">
2968 <a href="https://mercurial-scm.org/">
3010 <a href="https://mercurial-scm.org/">
2969 <img src="/static/hglogo.png" alt="mercurial" /></a>
3011 <img src="/static/hglogo.png" alt="mercurial" /></a>
2970 </div>
3012 </div>
2971 <ul>
3013 <ul>
2972 <li><a href="/shortlog">log</a></li>
3014 <li><a href="/shortlog">log</a></li>
2973 <li><a href="/graph">graph</a></li>
3015 <li><a href="/graph">graph</a></li>
2974 <li><a href="/tags">tags</a></li>
3016 <li><a href="/tags">tags</a></li>
2975 <li><a href="/bookmarks">bookmarks</a></li>
3017 <li><a href="/bookmarks">bookmarks</a></li>
2976 <li><a href="/branches">branches</a></li>
3018 <li><a href="/branches">branches</a></li>
2977 </ul>
3019 </ul>
2978 <ul>
3020 <ul>
2979 <li class="active"><a href="/help">help</a></li>
3021 <li class="active"><a href="/help">help</a></li>
2980 </ul>
3022 </ul>
2981 </div>
3023 </div>
2982
3024
2983 <div class="main">
3025 <div class="main">
2984 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3026 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2985 <h3>Help: remove</h3>
3027 <h3>Help: remove</h3>
2986
3028
2987 <form class="search" action="/log">
3029 <form class="search" action="/log">
2988
3030
2989 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3031 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2990 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3032 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2991 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3033 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2992 </form>
3034 </form>
2993 <div id="doc">
3035 <div id="doc">
2994 <p>
3036 <p>
2995 hg remove [OPTION]... FILE...
3037 hg remove [OPTION]... FILE...
2996 </p>
3038 </p>
2997 <p>
3039 <p>
2998 aliases: rm
3040 aliases: rm
2999 </p>
3041 </p>
3000 <p>
3042 <p>
3001 remove the specified files on the next commit
3043 remove the specified files on the next commit
3002 </p>
3044 </p>
3003 <p>
3045 <p>
3004 Schedule the indicated files for removal from the current branch.
3046 Schedule the indicated files for removal from the current branch.
3005 </p>
3047 </p>
3006 <p>
3048 <p>
3007 This command schedules the files to be removed at the next commit.
3049 This command schedules the files to be removed at the next commit.
3008 To undo a remove before that, see 'hg revert'. To undo added
3050 To undo a remove before that, see 'hg revert'. To undo added
3009 files, see 'hg forget'.
3051 files, see 'hg forget'.
3010 </p>
3052 </p>
3011 <p>
3053 <p>
3012 -A/--after can be used to remove only files that have already
3054 -A/--after can be used to remove only files that have already
3013 been deleted, -f/--force can be used to force deletion, and -Af
3055 been deleted, -f/--force can be used to force deletion, and -Af
3014 can be used to remove files from the next revision without
3056 can be used to remove files from the next revision without
3015 deleting them from the working directory.
3057 deleting them from the working directory.
3016 </p>
3058 </p>
3017 <p>
3059 <p>
3018 The following table details the behavior of remove for different
3060 The following table details the behavior of remove for different
3019 file states (columns) and option combinations (rows). The file
3061 file states (columns) and option combinations (rows). The file
3020 states are Added [A], Clean [C], Modified [M] and Missing [!]
3062 states are Added [A], Clean [C], Modified [M] and Missing [!]
3021 (as reported by 'hg status'). The actions are Warn, Remove
3063 (as reported by 'hg status'). The actions are Warn, Remove
3022 (from branch) and Delete (from disk):
3064 (from branch) and Delete (from disk):
3023 </p>
3065 </p>
3024 <table>
3066 <table>
3025 <tr><td>opt/state</td>
3067 <tr><td>opt/state</td>
3026 <td>A</td>
3068 <td>A</td>
3027 <td>C</td>
3069 <td>C</td>
3028 <td>M</td>
3070 <td>M</td>
3029 <td>!</td></tr>
3071 <td>!</td></tr>
3030 <tr><td>none</td>
3072 <tr><td>none</td>
3031 <td>W</td>
3073 <td>W</td>
3032 <td>RD</td>
3074 <td>RD</td>
3033 <td>W</td>
3075 <td>W</td>
3034 <td>R</td></tr>
3076 <td>R</td></tr>
3035 <tr><td>-f</td>
3077 <tr><td>-f</td>
3036 <td>R</td>
3078 <td>R</td>
3037 <td>RD</td>
3079 <td>RD</td>
3038 <td>RD</td>
3080 <td>RD</td>
3039 <td>R</td></tr>
3081 <td>R</td></tr>
3040 <tr><td>-A</td>
3082 <tr><td>-A</td>
3041 <td>W</td>
3083 <td>W</td>
3042 <td>W</td>
3084 <td>W</td>
3043 <td>W</td>
3085 <td>W</td>
3044 <td>R</td></tr>
3086 <td>R</td></tr>
3045 <tr><td>-Af</td>
3087 <tr><td>-Af</td>
3046 <td>R</td>
3088 <td>R</td>
3047 <td>R</td>
3089 <td>R</td>
3048 <td>R</td>
3090 <td>R</td>
3049 <td>R</td></tr>
3091 <td>R</td></tr>
3050 </table>
3092 </table>
3051 <p>
3093 <p>
3052 <b>Note:</b>
3094 <b>Note:</b>
3053 </p>
3095 </p>
3054 <p>
3096 <p>
3055 'hg remove' never deletes files in Added [A] state from the
3097 'hg remove' never deletes files in Added [A] state from the
3056 working directory, not even if &quot;--force&quot; is specified.
3098 working directory, not even if &quot;--force&quot; is specified.
3057 </p>
3099 </p>
3058 <p>
3100 <p>
3059 Returns 0 on success, 1 if any warnings encountered.
3101 Returns 0 on success, 1 if any warnings encountered.
3060 </p>
3102 </p>
3061 <p>
3103 <p>
3062 options ([+] can be repeated):
3104 options ([+] can be repeated):
3063 </p>
3105 </p>
3064 <table>
3106 <table>
3065 <tr><td>-A</td>
3107 <tr><td>-A</td>
3066 <td>--after</td>
3108 <td>--after</td>
3067 <td>record delete for missing files</td></tr>
3109 <td>record delete for missing files</td></tr>
3068 <tr><td>-f</td>
3110 <tr><td>-f</td>
3069 <td>--force</td>
3111 <td>--force</td>
3070 <td>forget added files, delete modified files</td></tr>
3112 <td>forget added files, delete modified files</td></tr>
3071 <tr><td>-S</td>
3113 <tr><td>-S</td>
3072 <td>--subrepos</td>
3114 <td>--subrepos</td>
3073 <td>recurse into subrepositories</td></tr>
3115 <td>recurse into subrepositories</td></tr>
3074 <tr><td>-I</td>
3116 <tr><td>-I</td>
3075 <td>--include PATTERN [+]</td>
3117 <td>--include PATTERN [+]</td>
3076 <td>include names matching the given patterns</td></tr>
3118 <td>include names matching the given patterns</td></tr>
3077 <tr><td>-X</td>
3119 <tr><td>-X</td>
3078 <td>--exclude PATTERN [+]</td>
3120 <td>--exclude PATTERN [+]</td>
3079 <td>exclude names matching the given patterns</td></tr>
3121 <td>exclude names matching the given patterns</td></tr>
3080 <tr><td>-n</td>
3122 <tr><td>-n</td>
3081 <td>--dry-run</td>
3123 <td>--dry-run</td>
3082 <td>do not perform actions, just print output</td></tr>
3124 <td>do not perform actions, just print output</td></tr>
3083 </table>
3125 </table>
3084 <p>
3126 <p>
3085 global options ([+] can be repeated):
3127 global options ([+] can be repeated):
3086 </p>
3128 </p>
3087 <table>
3129 <table>
3088 <tr><td>-R</td>
3130 <tr><td>-R</td>
3089 <td>--repository REPO</td>
3131 <td>--repository REPO</td>
3090 <td>repository root directory or name of overlay bundle file</td></tr>
3132 <td>repository root directory or name of overlay bundle file</td></tr>
3091 <tr><td></td>
3133 <tr><td></td>
3092 <td>--cwd DIR</td>
3134 <td>--cwd DIR</td>
3093 <td>change working directory</td></tr>
3135 <td>change working directory</td></tr>
3094 <tr><td>-y</td>
3136 <tr><td>-y</td>
3095 <td>--noninteractive</td>
3137 <td>--noninteractive</td>
3096 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3138 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3097 <tr><td>-q</td>
3139 <tr><td>-q</td>
3098 <td>--quiet</td>
3140 <td>--quiet</td>
3099 <td>suppress output</td></tr>
3141 <td>suppress output</td></tr>
3100 <tr><td>-v</td>
3142 <tr><td>-v</td>
3101 <td>--verbose</td>
3143 <td>--verbose</td>
3102 <td>enable additional output</td></tr>
3144 <td>enable additional output</td></tr>
3103 <tr><td></td>
3145 <tr><td></td>
3104 <td>--color TYPE</td>
3146 <td>--color TYPE</td>
3105 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3147 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3106 <tr><td></td>
3148 <tr><td></td>
3107 <td>--config CONFIG [+]</td>
3149 <td>--config CONFIG [+]</td>
3108 <td>set/override config option (use 'section.name=value')</td></tr>
3150 <td>set/override config option (use 'section.name=value')</td></tr>
3109 <tr><td></td>
3151 <tr><td></td>
3110 <td>--debug</td>
3152 <td>--debug</td>
3111 <td>enable debugging output</td></tr>
3153 <td>enable debugging output</td></tr>
3112 <tr><td></td>
3154 <tr><td></td>
3113 <td>--debugger</td>
3155 <td>--debugger</td>
3114 <td>start debugger</td></tr>
3156 <td>start debugger</td></tr>
3115 <tr><td></td>
3157 <tr><td></td>
3116 <td>--encoding ENCODE</td>
3158 <td>--encoding ENCODE</td>
3117 <td>set the charset encoding (default: ascii)</td></tr>
3159 <td>set the charset encoding (default: ascii)</td></tr>
3118 <tr><td></td>
3160 <tr><td></td>
3119 <td>--encodingmode MODE</td>
3161 <td>--encodingmode MODE</td>
3120 <td>set the charset encoding mode (default: strict)</td></tr>
3162 <td>set the charset encoding mode (default: strict)</td></tr>
3121 <tr><td></td>
3163 <tr><td></td>
3122 <td>--traceback</td>
3164 <td>--traceback</td>
3123 <td>always print a traceback on exception</td></tr>
3165 <td>always print a traceback on exception</td></tr>
3124 <tr><td></td>
3166 <tr><td></td>
3125 <td>--time</td>
3167 <td>--time</td>
3126 <td>time how long the command takes</td></tr>
3168 <td>time how long the command takes</td></tr>
3127 <tr><td></td>
3169 <tr><td></td>
3128 <td>--profile</td>
3170 <td>--profile</td>
3129 <td>print command execution profile</td></tr>
3171 <td>print command execution profile</td></tr>
3130 <tr><td></td>
3172 <tr><td></td>
3131 <td>--version</td>
3173 <td>--version</td>
3132 <td>output version information and exit</td></tr>
3174 <td>output version information and exit</td></tr>
3133 <tr><td>-h</td>
3175 <tr><td>-h</td>
3134 <td>--help</td>
3176 <td>--help</td>
3135 <td>display help and exit</td></tr>
3177 <td>display help and exit</td></tr>
3136 <tr><td></td>
3178 <tr><td></td>
3137 <td>--hidden</td>
3179 <td>--hidden</td>
3138 <td>consider hidden changesets</td></tr>
3180 <td>consider hidden changesets</td></tr>
3139 <tr><td></td>
3181 <tr><td></td>
3140 <td>--pager TYPE</td>
3182 <td>--pager TYPE</td>
3141 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3183 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3142 </table>
3184 </table>
3143
3185
3144 </div>
3186 </div>
3145 </div>
3187 </div>
3146 </div>
3188 </div>
3147
3189
3148
3190
3149
3191
3150 </body>
3192 </body>
3151 </html>
3193 </html>
3152
3194
3153
3195
3154 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
3196 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
3155 200 Script output follows
3197 200 Script output follows
3156
3198
3157 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3199 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3158 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3200 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3159 <head>
3201 <head>
3160 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3202 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3161 <meta name="robots" content="index, nofollow" />
3203 <meta name="robots" content="index, nofollow" />
3162 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3204 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3163 <script type="text/javascript" src="/static/mercurial.js"></script>
3205 <script type="text/javascript" src="/static/mercurial.js"></script>
3164
3206
3165 <title>Help: dates</title>
3207 <title>Help: dates</title>
3166 </head>
3208 </head>
3167 <body>
3209 <body>
3168
3210
3169 <div class="container">
3211 <div class="container">
3170 <div class="menu">
3212 <div class="menu">
3171 <div class="logo">
3213 <div class="logo">
3172 <a href="https://mercurial-scm.org/">
3214 <a href="https://mercurial-scm.org/">
3173 <img src="/static/hglogo.png" alt="mercurial" /></a>
3215 <img src="/static/hglogo.png" alt="mercurial" /></a>
3174 </div>
3216 </div>
3175 <ul>
3217 <ul>
3176 <li><a href="/shortlog">log</a></li>
3218 <li><a href="/shortlog">log</a></li>
3177 <li><a href="/graph">graph</a></li>
3219 <li><a href="/graph">graph</a></li>
3178 <li><a href="/tags">tags</a></li>
3220 <li><a href="/tags">tags</a></li>
3179 <li><a href="/bookmarks">bookmarks</a></li>
3221 <li><a href="/bookmarks">bookmarks</a></li>
3180 <li><a href="/branches">branches</a></li>
3222 <li><a href="/branches">branches</a></li>
3181 </ul>
3223 </ul>
3182 <ul>
3224 <ul>
3183 <li class="active"><a href="/help">help</a></li>
3225 <li class="active"><a href="/help">help</a></li>
3184 </ul>
3226 </ul>
3185 </div>
3227 </div>
3186
3228
3187 <div class="main">
3229 <div class="main">
3188 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3230 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3189 <h3>Help: dates</h3>
3231 <h3>Help: dates</h3>
3190
3232
3191 <form class="search" action="/log">
3233 <form class="search" action="/log">
3192
3234
3193 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3235 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3194 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3236 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3195 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3237 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3196 </form>
3238 </form>
3197 <div id="doc">
3239 <div id="doc">
3198 <h1>Date Formats</h1>
3240 <h1>Date Formats</h1>
3199 <p>
3241 <p>
3200 Some commands allow the user to specify a date, e.g.:
3242 Some commands allow the user to specify a date, e.g.:
3201 </p>
3243 </p>
3202 <ul>
3244 <ul>
3203 <li> backout, commit, import, tag: Specify the commit date.
3245 <li> backout, commit, import, tag: Specify the commit date.
3204 <li> log, revert, update: Select revision(s) by date.
3246 <li> log, revert, update: Select revision(s) by date.
3205 </ul>
3247 </ul>
3206 <p>
3248 <p>
3207 Many date formats are valid. Here are some examples:
3249 Many date formats are valid. Here are some examples:
3208 </p>
3250 </p>
3209 <ul>
3251 <ul>
3210 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
3252 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
3211 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
3253 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
3212 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
3254 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
3213 <li> &quot;Dec 6&quot; (midnight)
3255 <li> &quot;Dec 6&quot; (midnight)
3214 <li> &quot;13:18&quot; (today assumed)
3256 <li> &quot;13:18&quot; (today assumed)
3215 <li> &quot;3:39&quot; (3:39AM assumed)
3257 <li> &quot;3:39&quot; (3:39AM assumed)
3216 <li> &quot;3:39pm&quot; (15:39)
3258 <li> &quot;3:39pm&quot; (15:39)
3217 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
3259 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
3218 <li> &quot;2006-12-6 13:18&quot;
3260 <li> &quot;2006-12-6 13:18&quot;
3219 <li> &quot;2006-12-6&quot;
3261 <li> &quot;2006-12-6&quot;
3220 <li> &quot;12-6&quot;
3262 <li> &quot;12-6&quot;
3221 <li> &quot;12/6&quot;
3263 <li> &quot;12/6&quot;
3222 <li> &quot;12/6/6&quot; (Dec 6 2006)
3264 <li> &quot;12/6/6&quot; (Dec 6 2006)
3223 <li> &quot;today&quot; (midnight)
3265 <li> &quot;today&quot; (midnight)
3224 <li> &quot;yesterday&quot; (midnight)
3266 <li> &quot;yesterday&quot; (midnight)
3225 <li> &quot;now&quot; - right now
3267 <li> &quot;now&quot; - right now
3226 </ul>
3268 </ul>
3227 <p>
3269 <p>
3228 Lastly, there is Mercurial's internal format:
3270 Lastly, there is Mercurial's internal format:
3229 </p>
3271 </p>
3230 <ul>
3272 <ul>
3231 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
3273 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
3232 </ul>
3274 </ul>
3233 <p>
3275 <p>
3234 This is the internal representation format for dates. The first number
3276 This is the internal representation format for dates. The first number
3235 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
3277 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
3236 second is the offset of the local timezone, in seconds west of UTC
3278 second is the offset of the local timezone, in seconds west of UTC
3237 (negative if the timezone is east of UTC).
3279 (negative if the timezone is east of UTC).
3238 </p>
3280 </p>
3239 <p>
3281 <p>
3240 The log command also accepts date ranges:
3282 The log command also accepts date ranges:
3241 </p>
3283 </p>
3242 <ul>
3284 <ul>
3243 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3285 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3244 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3286 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3245 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3287 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3246 <li> &quot;-DAYS&quot; - within a given number of days of today
3288 <li> &quot;-DAYS&quot; - within a given number of days of today
3247 </ul>
3289 </ul>
3248
3290
3249 </div>
3291 </div>
3250 </div>
3292 </div>
3251 </div>
3293 </div>
3252
3294
3253
3295
3254
3296
3255 </body>
3297 </body>
3256 </html>
3298 </html>
3257
3299
3258
3300
3259 $ get-with-headers.py $LOCALIP:$HGPORT "help/pager"
3301 $ get-with-headers.py $LOCALIP:$HGPORT "help/pager"
3260 200 Script output follows
3302 200 Script output follows
3261
3303
3262 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3304 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3263 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3305 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3264 <head>
3306 <head>
3265 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3307 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3266 <meta name="robots" content="index, nofollow" />
3308 <meta name="robots" content="index, nofollow" />
3267 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3309 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3268 <script type="text/javascript" src="/static/mercurial.js"></script>
3310 <script type="text/javascript" src="/static/mercurial.js"></script>
3269
3311
3270 <title>Help: pager</title>
3312 <title>Help: pager</title>
3271 </head>
3313 </head>
3272 <body>
3314 <body>
3273
3315
3274 <div class="container">
3316 <div class="container">
3275 <div class="menu">
3317 <div class="menu">
3276 <div class="logo">
3318 <div class="logo">
3277 <a href="https://mercurial-scm.org/">
3319 <a href="https://mercurial-scm.org/">
3278 <img src="/static/hglogo.png" alt="mercurial" /></a>
3320 <img src="/static/hglogo.png" alt="mercurial" /></a>
3279 </div>
3321 </div>
3280 <ul>
3322 <ul>
3281 <li><a href="/shortlog">log</a></li>
3323 <li><a href="/shortlog">log</a></li>
3282 <li><a href="/graph">graph</a></li>
3324 <li><a href="/graph">graph</a></li>
3283 <li><a href="/tags">tags</a></li>
3325 <li><a href="/tags">tags</a></li>
3284 <li><a href="/bookmarks">bookmarks</a></li>
3326 <li><a href="/bookmarks">bookmarks</a></li>
3285 <li><a href="/branches">branches</a></li>
3327 <li><a href="/branches">branches</a></li>
3286 </ul>
3328 </ul>
3287 <ul>
3329 <ul>
3288 <li class="active"><a href="/help">help</a></li>
3330 <li class="active"><a href="/help">help</a></li>
3289 </ul>
3331 </ul>
3290 </div>
3332 </div>
3291
3333
3292 <div class="main">
3334 <div class="main">
3293 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3335 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3294 <h3>Help: pager</h3>
3336 <h3>Help: pager</h3>
3295
3337
3296 <form class="search" action="/log">
3338 <form class="search" action="/log">
3297
3339
3298 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3340 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3299 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3341 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3300 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3342 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3301 </form>
3343 </form>
3302 <div id="doc">
3344 <div id="doc">
3303 <h1>Pager Support</h1>
3345 <h1>Pager Support</h1>
3304 <p>
3346 <p>
3305 Some Mercurial commands can produce a lot of output, and Mercurial will
3347 Some Mercurial commands can produce a lot of output, and Mercurial will
3306 attempt to use a pager to make those commands more pleasant.
3348 attempt to use a pager to make those commands more pleasant.
3307 </p>
3349 </p>
3308 <p>
3350 <p>
3309 To set the pager that should be used, set the application variable:
3351 To set the pager that should be used, set the application variable:
3310 </p>
3352 </p>
3311 <pre>
3353 <pre>
3312 [pager]
3354 [pager]
3313 pager = less -FRX
3355 pager = less -FRX
3314 </pre>
3356 </pre>
3315 <p>
3357 <p>
3316 If no pager is set in the user or repository configuration, Mercurial uses the
3358 If no pager is set in the user or repository configuration, Mercurial uses the
3317 environment variable $PAGER. If $PAGER is not set, pager.pager from the default
3359 environment variable $PAGER. If $PAGER is not set, pager.pager from the default
3318 or system configuration is used. If none of these are set, a default pager will
3360 or system configuration is used. If none of these are set, a default pager will
3319 be used, typically 'less' on Unix and 'more' on Windows.
3361 be used, typically 'less' on Unix and 'more' on Windows.
3320 </p>
3362 </p>
3321 <p>
3363 <p>
3322 You can disable the pager for certain commands by adding them to the
3364 You can disable the pager for certain commands by adding them to the
3323 pager.ignore list:
3365 pager.ignore list:
3324 </p>
3366 </p>
3325 <pre>
3367 <pre>
3326 [pager]
3368 [pager]
3327 ignore = version, help, update
3369 ignore = version, help, update
3328 </pre>
3370 </pre>
3329 <p>
3371 <p>
3330 To ignore global commands like 'hg version' or 'hg help', you have
3372 To ignore global commands like 'hg version' or 'hg help', you have
3331 to specify them in your user configuration file.
3373 to specify them in your user configuration file.
3332 </p>
3374 </p>
3333 <p>
3375 <p>
3334 To control whether the pager is used at all for an individual command,
3376 To control whether the pager is used at all for an individual command,
3335 you can use --pager=&lt;value&gt;:
3377 you can use --pager=&lt;value&gt;:
3336 </p>
3378 </p>
3337 <ul>
3379 <ul>
3338 <li> use as needed: 'auto'.
3380 <li> use as needed: 'auto'.
3339 <li> require the pager: 'yes' or 'on'.
3381 <li> require the pager: 'yes' or 'on'.
3340 <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work).
3382 <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work).
3341 </ul>
3383 </ul>
3342 <p>
3384 <p>
3343 To globally turn off all attempts to use a pager, set:
3385 To globally turn off all attempts to use a pager, set:
3344 </p>
3386 </p>
3345 <pre>
3387 <pre>
3346 [ui]
3388 [ui]
3347 paginate = never
3389 paginate = never
3348 </pre>
3390 </pre>
3349 <p>
3391 <p>
3350 which will prevent the pager from running.
3392 which will prevent the pager from running.
3351 </p>
3393 </p>
3352
3394
3353 </div>
3395 </div>
3354 </div>
3396 </div>
3355 </div>
3397 </div>
3356
3398
3357
3399
3358
3400
3359 </body>
3401 </body>
3360 </html>
3402 </html>
3361
3403
3362
3404
3363 Sub-topic indexes rendered properly
3405 Sub-topic indexes rendered properly
3364
3406
3365 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3407 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3366 200 Script output follows
3408 200 Script output follows
3367
3409
3368 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3410 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3369 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3411 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3370 <head>
3412 <head>
3371 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3413 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3372 <meta name="robots" content="index, nofollow" />
3414 <meta name="robots" content="index, nofollow" />
3373 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3415 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3374 <script type="text/javascript" src="/static/mercurial.js"></script>
3416 <script type="text/javascript" src="/static/mercurial.js"></script>
3375
3417
3376 <title>Help: internals</title>
3418 <title>Help: internals</title>
3377 </head>
3419 </head>
3378 <body>
3420 <body>
3379
3421
3380 <div class="container">
3422 <div class="container">
3381 <div class="menu">
3423 <div class="menu">
3382 <div class="logo">
3424 <div class="logo">
3383 <a href="https://mercurial-scm.org/">
3425 <a href="https://mercurial-scm.org/">
3384 <img src="/static/hglogo.png" alt="mercurial" /></a>
3426 <img src="/static/hglogo.png" alt="mercurial" /></a>
3385 </div>
3427 </div>
3386 <ul>
3428 <ul>
3387 <li><a href="/shortlog">log</a></li>
3429 <li><a href="/shortlog">log</a></li>
3388 <li><a href="/graph">graph</a></li>
3430 <li><a href="/graph">graph</a></li>
3389 <li><a href="/tags">tags</a></li>
3431 <li><a href="/tags">tags</a></li>
3390 <li><a href="/bookmarks">bookmarks</a></li>
3432 <li><a href="/bookmarks">bookmarks</a></li>
3391 <li><a href="/branches">branches</a></li>
3433 <li><a href="/branches">branches</a></li>
3392 </ul>
3434 </ul>
3393 <ul>
3435 <ul>
3394 <li><a href="/help">help</a></li>
3436 <li><a href="/help">help</a></li>
3395 </ul>
3437 </ul>
3396 </div>
3438 </div>
3397
3439
3398 <div class="main">
3440 <div class="main">
3399 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3441 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3400
3442
3401 <form class="search" action="/log">
3443 <form class="search" action="/log">
3402
3444
3403 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3445 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3404 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3446 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3405 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3447 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3406 </form>
3448 </form>
3407 <table class="bigtable">
3449 <table class="bigtable">
3408 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3450 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3409
3451
3410 <tr><td>
3452 <tr><td>
3411 <a href="/help/internals.bundle2">
3453 <a href="/help/internals.bundle2">
3412 bundle2
3454 bundle2
3413 </a>
3455 </a>
3414 </td><td>
3456 </td><td>
3415 Bundle2
3457 Bundle2
3416 </td></tr>
3458 </td></tr>
3417 <tr><td>
3459 <tr><td>
3418 <a href="/help/internals.bundles">
3460 <a href="/help/internals.bundles">
3419 bundles
3461 bundles
3420 </a>
3462 </a>
3421 </td><td>
3463 </td><td>
3422 Bundles
3464 Bundles
3423 </td></tr>
3465 </td></tr>
3424 <tr><td>
3466 <tr><td>
3425 <a href="/help/internals.cbor">
3467 <a href="/help/internals.cbor">
3426 cbor
3468 cbor
3427 </a>
3469 </a>
3428 </td><td>
3470 </td><td>
3429 CBOR
3471 CBOR
3430 </td></tr>
3472 </td></tr>
3431 <tr><td>
3473 <tr><td>
3432 <a href="/help/internals.censor">
3474 <a href="/help/internals.censor">
3433 censor
3475 censor
3434 </a>
3476 </a>
3435 </td><td>
3477 </td><td>
3436 Censor
3478 Censor
3437 </td></tr>
3479 </td></tr>
3438 <tr><td>
3480 <tr><td>
3439 <a href="/help/internals.changegroups">
3481 <a href="/help/internals.changegroups">
3440 changegroups
3482 changegroups
3441 </a>
3483 </a>
3442 </td><td>
3484 </td><td>
3443 Changegroups
3485 Changegroups
3444 </td></tr>
3486 </td></tr>
3445 <tr><td>
3487 <tr><td>
3446 <a href="/help/internals.config">
3488 <a href="/help/internals.config">
3447 config
3489 config
3448 </a>
3490 </a>
3449 </td><td>
3491 </td><td>
3450 Config Registrar
3492 Config Registrar
3451 </td></tr>
3493 </td></tr>
3452 <tr><td>
3494 <tr><td>
3453 <a href="/help/internals.requirements">
3495 <a href="/help/internals.requirements">
3454 requirements
3496 requirements
3455 </a>
3497 </a>
3456 </td><td>
3498 </td><td>
3457 Repository Requirements
3499 Repository Requirements
3458 </td></tr>
3500 </td></tr>
3459 <tr><td>
3501 <tr><td>
3460 <a href="/help/internals.revlogs">
3502 <a href="/help/internals.revlogs">
3461 revlogs
3503 revlogs
3462 </a>
3504 </a>
3463 </td><td>
3505 </td><td>
3464 Revision Logs
3506 Revision Logs
3465 </td></tr>
3507 </td></tr>
3466 <tr><td>
3508 <tr><td>
3467 <a href="/help/internals.wireprotocol">
3509 <a href="/help/internals.wireprotocol">
3468 wireprotocol
3510 wireprotocol
3469 </a>
3511 </a>
3470 </td><td>
3512 </td><td>
3471 Wire Protocol
3513 Wire Protocol
3472 </td></tr>
3514 </td></tr>
3473 <tr><td>
3515 <tr><td>
3474 <a href="/help/internals.wireprotocolrpc">
3516 <a href="/help/internals.wireprotocolrpc">
3475 wireprotocolrpc
3517 wireprotocolrpc
3476 </a>
3518 </a>
3477 </td><td>
3519 </td><td>
3478 Wire Protocol RPC
3520 Wire Protocol RPC
3479 </td></tr>
3521 </td></tr>
3480 <tr><td>
3522 <tr><td>
3481 <a href="/help/internals.wireprotocolv2">
3523 <a href="/help/internals.wireprotocolv2">
3482 wireprotocolv2
3524 wireprotocolv2
3483 </a>
3525 </a>
3484 </td><td>
3526 </td><td>
3485 Wire Protocol Version 2
3527 Wire Protocol Version 2
3486 </td></tr>
3528 </td></tr>
3487
3529
3488
3530
3489
3531
3490
3532
3491
3533
3492 </table>
3534 </table>
3493 </div>
3535 </div>
3494 </div>
3536 </div>
3495
3537
3496
3538
3497
3539
3498 </body>
3540 </body>
3499 </html>
3541 </html>
3500
3542
3501
3543
3502 Sub-topic topics rendered properly
3544 Sub-topic topics rendered properly
3503
3545
3504 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3546 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3505 200 Script output follows
3547 200 Script output follows
3506
3548
3507 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3549 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3508 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3550 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3509 <head>
3551 <head>
3510 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3552 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3511 <meta name="robots" content="index, nofollow" />
3553 <meta name="robots" content="index, nofollow" />
3512 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3554 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3513 <script type="text/javascript" src="/static/mercurial.js"></script>
3555 <script type="text/javascript" src="/static/mercurial.js"></script>
3514
3556
3515 <title>Help: internals.changegroups</title>
3557 <title>Help: internals.changegroups</title>
3516 </head>
3558 </head>
3517 <body>
3559 <body>
3518
3560
3519 <div class="container">
3561 <div class="container">
3520 <div class="menu">
3562 <div class="menu">
3521 <div class="logo">
3563 <div class="logo">
3522 <a href="https://mercurial-scm.org/">
3564 <a href="https://mercurial-scm.org/">
3523 <img src="/static/hglogo.png" alt="mercurial" /></a>
3565 <img src="/static/hglogo.png" alt="mercurial" /></a>
3524 </div>
3566 </div>
3525 <ul>
3567 <ul>
3526 <li><a href="/shortlog">log</a></li>
3568 <li><a href="/shortlog">log</a></li>
3527 <li><a href="/graph">graph</a></li>
3569 <li><a href="/graph">graph</a></li>
3528 <li><a href="/tags">tags</a></li>
3570 <li><a href="/tags">tags</a></li>
3529 <li><a href="/bookmarks">bookmarks</a></li>
3571 <li><a href="/bookmarks">bookmarks</a></li>
3530 <li><a href="/branches">branches</a></li>
3572 <li><a href="/branches">branches</a></li>
3531 </ul>
3573 </ul>
3532 <ul>
3574 <ul>
3533 <li class="active"><a href="/help">help</a></li>
3575 <li class="active"><a href="/help">help</a></li>
3534 </ul>
3576 </ul>
3535 </div>
3577 </div>
3536
3578
3537 <div class="main">
3579 <div class="main">
3538 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3580 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3539 <h3>Help: internals.changegroups</h3>
3581 <h3>Help: internals.changegroups</h3>
3540
3582
3541 <form class="search" action="/log">
3583 <form class="search" action="/log">
3542
3584
3543 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3585 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3544 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3586 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3545 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3587 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3546 </form>
3588 </form>
3547 <div id="doc">
3589 <div id="doc">
3548 <h1>Changegroups</h1>
3590 <h1>Changegroups</h1>
3549 <p>
3591 <p>
3550 Changegroups are representations of repository revlog data, specifically
3592 Changegroups are representations of repository revlog data, specifically
3551 the changelog data, root/flat manifest data, treemanifest data, and
3593 the changelog data, root/flat manifest data, treemanifest data, and
3552 filelogs.
3594 filelogs.
3553 </p>
3595 </p>
3554 <p>
3596 <p>
3555 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3597 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3556 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3598 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3557 only difference being an additional item in the *delta header*. Version
3599 only difference being an additional item in the *delta header*. Version
3558 &quot;3&quot; adds support for storage flags in the *delta header* and optionally
3600 &quot;3&quot; adds support for storage flags in the *delta header* and optionally
3559 exchanging treemanifests (enabled by setting an option on the
3601 exchanging treemanifests (enabled by setting an option on the
3560 &quot;changegroup&quot; part in the bundle2).
3602 &quot;changegroup&quot; part in the bundle2).
3561 </p>
3603 </p>
3562 <p>
3604 <p>
3563 Changegroups when not exchanging treemanifests consist of 3 logical
3605 Changegroups when not exchanging treemanifests consist of 3 logical
3564 segments:
3606 segments:
3565 </p>
3607 </p>
3566 <pre>
3608 <pre>
3567 +---------------------------------+
3609 +---------------------------------+
3568 | | | |
3610 | | | |
3569 | changeset | manifest | filelogs |
3611 | changeset | manifest | filelogs |
3570 | | | |
3612 | | | |
3571 | | | |
3613 | | | |
3572 +---------------------------------+
3614 +---------------------------------+
3573 </pre>
3615 </pre>
3574 <p>
3616 <p>
3575 When exchanging treemanifests, there are 4 logical segments:
3617 When exchanging treemanifests, there are 4 logical segments:
3576 </p>
3618 </p>
3577 <pre>
3619 <pre>
3578 +-------------------------------------------------+
3620 +-------------------------------------------------+
3579 | | | | |
3621 | | | | |
3580 | changeset | root | treemanifests | filelogs |
3622 | changeset | root | treemanifests | filelogs |
3581 | | manifest | | |
3623 | | manifest | | |
3582 | | | | |
3624 | | | | |
3583 +-------------------------------------------------+
3625 +-------------------------------------------------+
3584 </pre>
3626 </pre>
3585 <p>
3627 <p>
3586 The principle building block of each segment is a *chunk*. A *chunk*
3628 The principle building block of each segment is a *chunk*. A *chunk*
3587 is a framed piece of data:
3629 is a framed piece of data:
3588 </p>
3630 </p>
3589 <pre>
3631 <pre>
3590 +---------------------------------------+
3632 +---------------------------------------+
3591 | | |
3633 | | |
3592 | length | data |
3634 | length | data |
3593 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3635 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3594 | | |
3636 | | |
3595 +---------------------------------------+
3637 +---------------------------------------+
3596 </pre>
3638 </pre>
3597 <p>
3639 <p>
3598 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3640 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3599 integer indicating the length of the entire chunk (including the length field
3641 integer indicating the length of the entire chunk (including the length field
3600 itself).
3642 itself).
3601 </p>
3643 </p>
3602 <p>
3644 <p>
3603 There is a special case chunk that has a value of 0 for the length
3645 There is a special case chunk that has a value of 0 for the length
3604 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3646 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3605 </p>
3647 </p>
3606 <h2>Delta Groups</h2>
3648 <h2>Delta Groups</h2>
3607 <p>
3649 <p>
3608 A *delta group* expresses the content of a revlog as a series of deltas,
3650 A *delta group* expresses the content of a revlog as a series of deltas,
3609 or patches against previous revisions.
3651 or patches against previous revisions.
3610 </p>
3652 </p>
3611 <p>
3653 <p>
3612 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3654 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3613 to signal the end of the delta group:
3655 to signal the end of the delta group:
3614 </p>
3656 </p>
3615 <pre>
3657 <pre>
3616 +------------------------------------------------------------------------+
3658 +------------------------------------------------------------------------+
3617 | | | | | |
3659 | | | | | |
3618 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3660 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3619 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3661 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3620 | | | | | |
3662 | | | | | |
3621 +------------------------------------------------------------------------+
3663 +------------------------------------------------------------------------+
3622 </pre>
3664 </pre>
3623 <p>
3665 <p>
3624 Each *chunk*'s data consists of the following:
3666 Each *chunk*'s data consists of the following:
3625 </p>
3667 </p>
3626 <pre>
3668 <pre>
3627 +---------------------------------------+
3669 +---------------------------------------+
3628 | | |
3670 | | |
3629 | delta header | delta data |
3671 | delta header | delta data |
3630 | (various by version) | (various) |
3672 | (various by version) | (various) |
3631 | | |
3673 | | |
3632 +---------------------------------------+
3674 +---------------------------------------+
3633 </pre>
3675 </pre>
3634 <p>
3676 <p>
3635 The *delta data* is a series of *delta*s that describe a diff from an existing
3677 The *delta data* is a series of *delta*s that describe a diff from an existing
3636 entry (either that the recipient already has, or previously specified in the
3678 entry (either that the recipient already has, or previously specified in the
3637 bundle/changegroup).
3679 bundle/changegroup).
3638 </p>
3680 </p>
3639 <p>
3681 <p>
3640 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3682 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3641 &quot;3&quot; of the changegroup format.
3683 &quot;3&quot; of the changegroup format.
3642 </p>
3684 </p>
3643 <p>
3685 <p>
3644 Version 1 (headerlen=80):
3686 Version 1 (headerlen=80):
3645 </p>
3687 </p>
3646 <pre>
3688 <pre>
3647 +------------------------------------------------------+
3689 +------------------------------------------------------+
3648 | | | | |
3690 | | | | |
3649 | node | p1 node | p2 node | link node |
3691 | node | p1 node | p2 node | link node |
3650 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3692 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3651 | | | | |
3693 | | | | |
3652 +------------------------------------------------------+
3694 +------------------------------------------------------+
3653 </pre>
3695 </pre>
3654 <p>
3696 <p>
3655 Version 2 (headerlen=100):
3697 Version 2 (headerlen=100):
3656 </p>
3698 </p>
3657 <pre>
3699 <pre>
3658 +------------------------------------------------------------------+
3700 +------------------------------------------------------------------+
3659 | | | | | |
3701 | | | | | |
3660 | node | p1 node | p2 node | base node | link node |
3702 | node | p1 node | p2 node | base node | link node |
3661 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3703 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3662 | | | | | |
3704 | | | | | |
3663 +------------------------------------------------------------------+
3705 +------------------------------------------------------------------+
3664 </pre>
3706 </pre>
3665 <p>
3707 <p>
3666 Version 3 (headerlen=102):
3708 Version 3 (headerlen=102):
3667 </p>
3709 </p>
3668 <pre>
3710 <pre>
3669 +------------------------------------------------------------------------------+
3711 +------------------------------------------------------------------------------+
3670 | | | | | | |
3712 | | | | | | |
3671 | node | p1 node | p2 node | base node | link node | flags |
3713 | node | p1 node | p2 node | base node | link node | flags |
3672 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3714 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3673 | | | | | | |
3715 | | | | | | |
3674 +------------------------------------------------------------------------------+
3716 +------------------------------------------------------------------------------+
3675 </pre>
3717 </pre>
3676 <p>
3718 <p>
3677 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3719 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3678 series of *delta*s, densely packed (no separators). These deltas describe a diff
3720 series of *delta*s, densely packed (no separators). These deltas describe a diff
3679 from an existing entry (either that the recipient already has, or previously
3721 from an existing entry (either that the recipient already has, or previously
3680 specified in the bundle/changegroup). The format is described more fully in
3722 specified in the bundle/changegroup). The format is described more fully in
3681 &quot;hg help internals.bdiff&quot;, but briefly:
3723 &quot;hg help internals.bdiff&quot;, but briefly:
3682 </p>
3724 </p>
3683 <pre>
3725 <pre>
3684 +---------------------------------------------------------------+
3726 +---------------------------------------------------------------+
3685 | | | | |
3727 | | | | |
3686 | start offset | end offset | new length | content |
3728 | start offset | end offset | new length | content |
3687 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3729 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3688 | | | | |
3730 | | | | |
3689 +---------------------------------------------------------------+
3731 +---------------------------------------------------------------+
3690 </pre>
3732 </pre>
3691 <p>
3733 <p>
3692 Please note that the length field in the delta data does *not* include itself.
3734 Please note that the length field in the delta data does *not* include itself.
3693 </p>
3735 </p>
3694 <p>
3736 <p>
3695 In version 1, the delta is always applied against the previous node from
3737 In version 1, the delta is always applied against the previous node from
3696 the changegroup or the first parent if this is the first entry in the
3738 the changegroup or the first parent if this is the first entry in the
3697 changegroup.
3739 changegroup.
3698 </p>
3740 </p>
3699 <p>
3741 <p>
3700 In version 2 and up, the delta base node is encoded in the entry in the
3742 In version 2 and up, the delta base node is encoded in the entry in the
3701 changegroup. This allows the delta to be expressed against any parent,
3743 changegroup. This allows the delta to be expressed against any parent,
3702 which can result in smaller deltas and more efficient encoding of data.
3744 which can result in smaller deltas and more efficient encoding of data.
3703 </p>
3745 </p>
3704 <p>
3746 <p>
3705 The *flags* field holds bitwise flags affecting the processing of revision
3747 The *flags* field holds bitwise flags affecting the processing of revision
3706 data. The following flags are defined:
3748 data. The following flags are defined:
3707 </p>
3749 </p>
3708 <dl>
3750 <dl>
3709 <dt>32768
3751 <dt>32768
3710 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions.
3752 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions.
3711 <dt>16384
3753 <dt>16384
3712 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents).
3754 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents).
3713 <dt>8192
3755 <dt>8192
3714 <dd>Externally stored. The revision fulltext contains &quot;key:value&quot; &quot;\n&quot; delimited metadata defining an object stored elsewhere. Used by the LFS extension.
3756 <dd>Externally stored. The revision fulltext contains &quot;key:value&quot; &quot;\n&quot; delimited metadata defining an object stored elsewhere. Used by the LFS extension.
3715 </dl>
3757 </dl>
3716 <p>
3758 <p>
3717 For historical reasons, the integer values are identical to revlog version 1
3759 For historical reasons, the integer values are identical to revlog version 1
3718 per-revision storage flags and correspond to bits being set in this 2-byte
3760 per-revision storage flags and correspond to bits being set in this 2-byte
3719 field. Bits were allocated starting from the most-significant bit, hence the
3761 field. Bits were allocated starting from the most-significant bit, hence the
3720 reverse ordering and allocation of these flags.
3762 reverse ordering and allocation of these flags.
3721 </p>
3763 </p>
3722 <h2>Changeset Segment</h2>
3764 <h2>Changeset Segment</h2>
3723 <p>
3765 <p>
3724 The *changeset segment* consists of a single *delta group* holding
3766 The *changeset segment* consists of a single *delta group* holding
3725 changelog data. The *empty chunk* at the end of the *delta group* denotes
3767 changelog data. The *empty chunk* at the end of the *delta group* denotes
3726 the boundary to the *manifest segment*.
3768 the boundary to the *manifest segment*.
3727 </p>
3769 </p>
3728 <h2>Manifest Segment</h2>
3770 <h2>Manifest Segment</h2>
3729 <p>
3771 <p>
3730 The *manifest segment* consists of a single *delta group* holding manifest
3772 The *manifest segment* consists of a single *delta group* holding manifest
3731 data. If treemanifests are in use, it contains only the manifest for the
3773 data. If treemanifests are in use, it contains only the manifest for the
3732 root directory of the repository. Otherwise, it contains the entire
3774 root directory of the repository. Otherwise, it contains the entire
3733 manifest data. The *empty chunk* at the end of the *delta group* denotes
3775 manifest data. The *empty chunk* at the end of the *delta group* denotes
3734 the boundary to the next segment (either the *treemanifests segment* or the
3776 the boundary to the next segment (either the *treemanifests segment* or the
3735 *filelogs segment*, depending on version and the request options).
3777 *filelogs segment*, depending on version and the request options).
3736 </p>
3778 </p>
3737 <h3>Treemanifests Segment</h3>
3779 <h3>Treemanifests Segment</h3>
3738 <p>
3780 <p>
3739 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3781 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3740 only if the 'treemanifest' param is part of the bundle2 changegroup part
3782 only if the 'treemanifest' param is part of the bundle2 changegroup part
3741 (it is not possible to use changegroup version 3 outside of bundle2).
3783 (it is not possible to use changegroup version 3 outside of bundle2).
3742 Aside from the filenames in the *treemanifests segment* containing a
3784 Aside from the filenames in the *treemanifests segment* containing a
3743 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3785 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3744 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3786 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3745 a sub-segment with filename size 0). This denotes the boundary to the
3787 a sub-segment with filename size 0). This denotes the boundary to the
3746 *filelogs segment*.
3788 *filelogs segment*.
3747 </p>
3789 </p>
3748 <h2>Filelogs Segment</h2>
3790 <h2>Filelogs Segment</h2>
3749 <p>
3791 <p>
3750 The *filelogs segment* consists of multiple sub-segments, each
3792 The *filelogs segment* consists of multiple sub-segments, each
3751 corresponding to an individual file whose data is being described:
3793 corresponding to an individual file whose data is being described:
3752 </p>
3794 </p>
3753 <pre>
3795 <pre>
3754 +--------------------------------------------------+
3796 +--------------------------------------------------+
3755 | | | | | |
3797 | | | | | |
3756 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3798 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3757 | | | | | (4 bytes) |
3799 | | | | | (4 bytes) |
3758 | | | | | |
3800 | | | | | |
3759 +--------------------------------------------------+
3801 +--------------------------------------------------+
3760 </pre>
3802 </pre>
3761 <p>
3803 <p>
3762 The final filelog sub-segment is followed by an *empty chunk* (logically,
3804 The final filelog sub-segment is followed by an *empty chunk* (logically,
3763 a sub-segment with filename size 0). This denotes the end of the segment
3805 a sub-segment with filename size 0). This denotes the end of the segment
3764 and of the overall changegroup.
3806 and of the overall changegroup.
3765 </p>
3807 </p>
3766 <p>
3808 <p>
3767 Each filelog sub-segment consists of the following:
3809 Each filelog sub-segment consists of the following:
3768 </p>
3810 </p>
3769 <pre>
3811 <pre>
3770 +------------------------------------------------------+
3812 +------------------------------------------------------+
3771 | | | |
3813 | | | |
3772 | filename length | filename | delta group |
3814 | filename length | filename | delta group |
3773 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3815 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3774 | | | |
3816 | | | |
3775 +------------------------------------------------------+
3817 +------------------------------------------------------+
3776 </pre>
3818 </pre>
3777 <p>
3819 <p>
3778 That is, a *chunk* consisting of the filename (not terminated or padded)
3820 That is, a *chunk* consisting of the filename (not terminated or padded)
3779 followed by N chunks constituting the *delta group* for this file. The
3821 followed by N chunks constituting the *delta group* for this file. The
3780 *empty chunk* at the end of each *delta group* denotes the boundary to the
3822 *empty chunk* at the end of each *delta group* denotes the boundary to the
3781 next filelog sub-segment.
3823 next filelog sub-segment.
3782 </p>
3824 </p>
3783
3825
3784 </div>
3826 </div>
3785 </div>
3827 </div>
3786 </div>
3828 </div>
3787
3829
3788
3830
3789
3831
3790 </body>
3832 </body>
3791 </html>
3833 </html>
3792
3834
3793
3835
3794 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
3836 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
3795 404 Not Found
3837 404 Not Found
3796
3838
3797 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3839 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3798 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3840 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3799 <head>
3841 <head>
3800 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3842 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3801 <meta name="robots" content="index, nofollow" />
3843 <meta name="robots" content="index, nofollow" />
3802 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3844 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3803 <script type="text/javascript" src="/static/mercurial.js"></script>
3845 <script type="text/javascript" src="/static/mercurial.js"></script>
3804
3846
3805 <title>test: error</title>
3847 <title>test: error</title>
3806 </head>
3848 </head>
3807 <body>
3849 <body>
3808
3850
3809 <div class="container">
3851 <div class="container">
3810 <div class="menu">
3852 <div class="menu">
3811 <div class="logo">
3853 <div class="logo">
3812 <a href="https://mercurial-scm.org/">
3854 <a href="https://mercurial-scm.org/">
3813 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
3855 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
3814 </div>
3856 </div>
3815 <ul>
3857 <ul>
3816 <li><a href="/shortlog">log</a></li>
3858 <li><a href="/shortlog">log</a></li>
3817 <li><a href="/graph">graph</a></li>
3859 <li><a href="/graph">graph</a></li>
3818 <li><a href="/tags">tags</a></li>
3860 <li><a href="/tags">tags</a></li>
3819 <li><a href="/bookmarks">bookmarks</a></li>
3861 <li><a href="/bookmarks">bookmarks</a></li>
3820 <li><a href="/branches">branches</a></li>
3862 <li><a href="/branches">branches</a></li>
3821 </ul>
3863 </ul>
3822 <ul>
3864 <ul>
3823 <li><a href="/help">help</a></li>
3865 <li><a href="/help">help</a></li>
3824 </ul>
3866 </ul>
3825 </div>
3867 </div>
3826
3868
3827 <div class="main">
3869 <div class="main">
3828
3870
3829 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3871 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3830 <h3>error</h3>
3872 <h3>error</h3>
3831
3873
3832
3874
3833 <form class="search" action="/log">
3875 <form class="search" action="/log">
3834
3876
3835 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3877 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3836 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3878 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3837 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3879 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3838 </form>
3880 </form>
3839
3881
3840 <div class="description">
3882 <div class="description">
3841 <p>
3883 <p>
3842 An error occurred while processing your request:
3884 An error occurred while processing your request:
3843 </p>
3885 </p>
3844 <p>
3886 <p>
3845 Not Found
3887 Not Found
3846 </p>
3888 </p>
3847 </div>
3889 </div>
3848 </div>
3890 </div>
3849 </div>
3891 </div>
3850
3892
3851
3893
3852
3894
3853 </body>
3895 </body>
3854 </html>
3896 </html>
3855
3897
3856 [1]
3898 [1]
3857
3899
3858 $ killdaemons.py
3900 $ killdaemons.py
3859
3901
3860 #endif
3902 #endif
General Comments 0
You need to be logged in to leave comments. Login now