Show More
@@ -1,506 +1,509 b'' | |||
|
1 | 1 | # help.py - help data for mercurial |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2006 Matt Mackall <mpm@selenic.com> |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | 8 | from i18n import gettext, _ |
|
9 | 9 | import itertools, sys, os |
|
10 | 10 | import error |
|
11 | 11 | import extensions, revset, fileset, templatekw, templatefilters, filemerge |
|
12 | 12 | import encoding, util, minirst |
|
13 | 13 | import cmdutil |
|
14 | 14 | |
|
15 | def listexts(header, exts, indent=1): | |
|
15 | def listexts(header, exts, indent=1, showdeprecated=False): | |
|
16 | 16 | '''return a text listing of the given extensions''' |
|
17 | 17 | rst = [] |
|
18 | 18 | if exts: |
|
19 | 19 | rst.append('\n%s\n\n' % header) |
|
20 | 20 | for name, desc in sorted(exts.iteritems()): |
|
21 | if '(DEPRECATED)' in desc and not showdeprecated: | |
|
22 | continue | |
|
21 | 23 | rst.append('%s:%s: %s\n' % (' ' * indent, name, desc)) |
|
22 | 24 | return rst |
|
23 | 25 | |
|
24 | 26 | def extshelp(): |
|
25 | 27 | rst = loaddoc('extensions')().splitlines(True) |
|
26 | rst.extend(listexts(_('enabled extensions:'), extensions.enabled())) | |
|
28 | rst.extend(listexts( | |
|
29 | _('enabled extensions:'), extensions.enabled(), showdeprecated=True)) | |
|
27 | 30 | rst.extend(listexts(_('disabled extensions:'), extensions.disabled())) |
|
28 | 31 | doc = ''.join(rst) |
|
29 | 32 | return doc |
|
30 | 33 | |
|
31 | 34 | def optrst(options, verbose): |
|
32 | 35 | data = [] |
|
33 | 36 | multioccur = False |
|
34 | 37 | for option in options: |
|
35 | 38 | if len(option) == 5: |
|
36 | 39 | shortopt, longopt, default, desc, optlabel = option |
|
37 | 40 | else: |
|
38 | 41 | shortopt, longopt, default, desc = option |
|
39 | 42 | optlabel = _("VALUE") # default label |
|
40 | 43 | |
|
41 | 44 | if _("DEPRECATED") in desc and not verbose: |
|
42 | 45 | continue |
|
43 | 46 | |
|
44 | 47 | so = '' |
|
45 | 48 | if shortopt: |
|
46 | 49 | so = '-' + shortopt |
|
47 | 50 | lo = '--' + longopt |
|
48 | 51 | if default: |
|
49 | 52 | desc += _(" (default: %s)") % default |
|
50 | 53 | |
|
51 | 54 | if isinstance(default, list): |
|
52 | 55 | lo += " %s [+]" % optlabel |
|
53 | 56 | multioccur = True |
|
54 | 57 | elif (default is not None) and not isinstance(default, bool): |
|
55 | 58 | lo += " %s" % optlabel |
|
56 | 59 | |
|
57 | 60 | data.append((so, lo, desc)) |
|
58 | 61 | |
|
59 | 62 | rst = minirst.maketable(data, 1) |
|
60 | 63 | |
|
61 | 64 | if multioccur: |
|
62 | 65 | rst.append(_("\n[+] marked option can be specified multiple times\n")) |
|
63 | 66 | |
|
64 | 67 | return ''.join(rst) |
|
65 | 68 | |
|
66 | 69 | def indicateomitted(rst, omitted, notomitted=None): |
|
67 | 70 | rst.append('\n\n.. container:: omitted\n\n %s\n\n' % omitted) |
|
68 | 71 | if notomitted: |
|
69 | 72 | rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted) |
|
70 | 73 | |
|
71 | 74 | def topicmatch(kw): |
|
72 | 75 | """Return help topics matching kw. |
|
73 | 76 | |
|
74 | 77 | Returns {'section': [(name, summary), ...], ...} where section is |
|
75 | 78 | one of topics, commands, extensions, or extensioncommands. |
|
76 | 79 | """ |
|
77 | 80 | kw = encoding.lower(kw) |
|
78 | 81 | def lowercontains(container): |
|
79 | 82 | return kw in encoding.lower(container) # translated in helptable |
|
80 | 83 | results = {'topics': [], |
|
81 | 84 | 'commands': [], |
|
82 | 85 | 'extensions': [], |
|
83 | 86 | 'extensioncommands': [], |
|
84 | 87 | } |
|
85 | 88 | for names, header, doc in helptable: |
|
86 | 89 | if (sum(map(lowercontains, names)) |
|
87 | 90 | or lowercontains(header) |
|
88 | 91 | or lowercontains(doc())): |
|
89 | 92 | results['topics'].append((names[0], header)) |
|
90 | 93 | import commands # avoid cycle |
|
91 | 94 | for cmd, entry in commands.table.iteritems(): |
|
92 | 95 | if cmd.startswith('debug'): |
|
93 | 96 | continue |
|
94 | 97 | if len(entry) == 3: |
|
95 | 98 | summary = entry[2] |
|
96 | 99 | else: |
|
97 | 100 | summary = '' |
|
98 | 101 | # translate docs *before* searching there |
|
99 | 102 | docs = _(getattr(entry[0], '__doc__', None)) or '' |
|
100 | 103 | if kw in cmd or lowercontains(summary) or lowercontains(docs): |
|
101 | 104 | doclines = docs.splitlines() |
|
102 | 105 | if doclines: |
|
103 | 106 | summary = doclines[0] |
|
104 | 107 | cmdname = cmd.split('|')[0].lstrip('^') |
|
105 | 108 | results['commands'].append((cmdname, summary)) |
|
106 | 109 | for name, docs in itertools.chain( |
|
107 | 110 | extensions.enabled(False).iteritems(), |
|
108 | 111 | extensions.disabled().iteritems()): |
|
109 | 112 | # extensions.load ignores the UI argument |
|
110 | 113 | mod = extensions.load(None, name, '') |
|
111 | 114 | name = name.split('.')[-1] |
|
112 | 115 | if lowercontains(name) or lowercontains(docs): |
|
113 | 116 | # extension docs are already translated |
|
114 | 117 | results['extensions'].append((name, docs.splitlines()[0])) |
|
115 | 118 | for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems(): |
|
116 | 119 | if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])): |
|
117 | 120 | cmdname = cmd.split('|')[0].lstrip('^') |
|
118 | 121 | if entry[0].__doc__: |
|
119 | 122 | cmddoc = gettext(entry[0].__doc__).splitlines()[0] |
|
120 | 123 | else: |
|
121 | 124 | cmddoc = _('(no help text available)') |
|
122 | 125 | results['extensioncommands'].append((cmdname, cmddoc)) |
|
123 | 126 | return results |
|
124 | 127 | |
|
125 | 128 | def loaddoc(topic): |
|
126 | 129 | """Return a delayed loader for help/topic.txt.""" |
|
127 | 130 | |
|
128 | 131 | def loader(): |
|
129 | 132 | if util.mainfrozen(): |
|
130 | 133 | module = sys.executable |
|
131 | 134 | else: |
|
132 | 135 | module = __file__ |
|
133 | 136 | base = os.path.dirname(module) |
|
134 | 137 | |
|
135 | 138 | for dir in ('.', '..'): |
|
136 | 139 | docdir = os.path.join(base, dir, 'help') |
|
137 | 140 | if os.path.isdir(docdir): |
|
138 | 141 | break |
|
139 | 142 | |
|
140 | 143 | path = os.path.join(docdir, topic + ".txt") |
|
141 | 144 | doc = gettext(util.readfile(path)) |
|
142 | 145 | for rewriter in helphooks.get(topic, []): |
|
143 | 146 | doc = rewriter(topic, doc) |
|
144 | 147 | return doc |
|
145 | 148 | |
|
146 | 149 | return loader |
|
147 | 150 | |
|
148 | 151 | helptable = sorted([ |
|
149 | 152 | (["config", "hgrc"], _("Configuration Files"), loaddoc('config')), |
|
150 | 153 | (["dates"], _("Date Formats"), loaddoc('dates')), |
|
151 | 154 | (["patterns"], _("File Name Patterns"), loaddoc('patterns')), |
|
152 | 155 | (['environment', 'env'], _('Environment Variables'), |
|
153 | 156 | loaddoc('environment')), |
|
154 | 157 | (['revisions', 'revs'], _('Specifying Single Revisions'), |
|
155 | 158 | loaddoc('revisions')), |
|
156 | 159 | (['multirevs', 'mrevs'], _('Specifying Multiple Revisions'), |
|
157 | 160 | loaddoc('multirevs')), |
|
158 | 161 | (['revsets', 'revset'], _("Specifying Revision Sets"), loaddoc('revsets')), |
|
159 | 162 | (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets')), |
|
160 | 163 | (['diffs'], _('Diff Formats'), loaddoc('diffs')), |
|
161 | 164 | (['merge-tools', 'mergetools'], _('Merge Tools'), loaddoc('merge-tools')), |
|
162 | 165 | (['templating', 'templates', 'template', 'style'], _('Template Usage'), |
|
163 | 166 | loaddoc('templates')), |
|
164 | 167 | (['urls'], _('URL Paths'), loaddoc('urls')), |
|
165 | 168 | (["extensions"], _("Using Additional Features"), extshelp), |
|
166 | 169 | (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos')), |
|
167 | 170 | (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')), |
|
168 | 171 | (["glossary"], _("Glossary"), loaddoc('glossary')), |
|
169 | 172 | (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"), |
|
170 | 173 | loaddoc('hgignore')), |
|
171 | 174 | (["phases"], _("Working with Phases"), loaddoc('phases')), |
|
172 | 175 | ]) |
|
173 | 176 | |
|
174 | 177 | # Map topics to lists of callable taking the current topic help and |
|
175 | 178 | # returning the updated version |
|
176 | 179 | helphooks = {} |
|
177 | 180 | |
|
178 | 181 | def addtopichook(topic, rewriter): |
|
179 | 182 | helphooks.setdefault(topic, []).append(rewriter) |
|
180 | 183 | |
|
181 | 184 | def makeitemsdoc(topic, doc, marker, items): |
|
182 | 185 | """Extract docstring from the items key to function mapping, build a |
|
183 | 186 | .single documentation block and use it to overwrite the marker in doc |
|
184 | 187 | """ |
|
185 | 188 | entries = [] |
|
186 | 189 | for name in sorted(items): |
|
187 | 190 | text = (items[name].__doc__ or '').rstrip() |
|
188 | 191 | if not text: |
|
189 | 192 | continue |
|
190 | 193 | text = gettext(text) |
|
191 | 194 | lines = text.splitlines() |
|
192 | 195 | doclines = [(lines[0])] |
|
193 | 196 | for l in lines[1:]: |
|
194 | 197 | # Stop once we find some Python doctest |
|
195 | 198 | if l.strip().startswith('>>>'): |
|
196 | 199 | break |
|
197 | 200 | doclines.append(' ' + l.strip()) |
|
198 | 201 | entries.append('\n'.join(doclines)) |
|
199 | 202 | entries = '\n\n'.join(entries) |
|
200 | 203 | return doc.replace(marker, entries) |
|
201 | 204 | |
|
202 | 205 | def addtopicsymbols(topic, marker, symbols): |
|
203 | 206 | def add(topic, doc): |
|
204 | 207 | return makeitemsdoc(topic, doc, marker, symbols) |
|
205 | 208 | addtopichook(topic, add) |
|
206 | 209 | |
|
207 | 210 | addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols) |
|
208 | 211 | addtopicsymbols('merge-tools', '.. internaltoolsmarker', filemerge.internals) |
|
209 | 212 | addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols) |
|
210 | 213 | addtopicsymbols('templates', '.. keywordsmarker', templatekw.dockeywords) |
|
211 | 214 | addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters) |
|
212 | 215 | |
|
213 | 216 | def help_(ui, name, unknowncmd=False, full=True, **opts): |
|
214 | 217 | ''' |
|
215 | 218 | Generate the help for 'name' as unformatted restructured text. If |
|
216 | 219 | 'name' is None, describe the commands available. |
|
217 | 220 | ''' |
|
218 | 221 | |
|
219 | 222 | import commands # avoid cycle |
|
220 | 223 | |
|
221 | 224 | def helpcmd(name): |
|
222 | 225 | try: |
|
223 | 226 | aliases, entry = cmdutil.findcmd(name, commands.table, |
|
224 | 227 | strict=unknowncmd) |
|
225 | 228 | except error.AmbiguousCommand, inst: |
|
226 | 229 | # py3k fix: except vars can't be used outside the scope of the |
|
227 | 230 | # except block, nor can be used inside a lambda. python issue4617 |
|
228 | 231 | prefix = inst.args[0] |
|
229 | 232 | select = lambda c: c.lstrip('^').startswith(prefix) |
|
230 | 233 | rst = helplist(select) |
|
231 | 234 | return rst |
|
232 | 235 | |
|
233 | 236 | rst = [] |
|
234 | 237 | |
|
235 | 238 | # check if it's an invalid alias and display its error if it is |
|
236 | 239 | if getattr(entry[0], 'badalias', False): |
|
237 | 240 | if not unknowncmd: |
|
238 | 241 | ui.pushbuffer() |
|
239 | 242 | entry[0](ui) |
|
240 | 243 | rst.append(ui.popbuffer()) |
|
241 | 244 | return rst |
|
242 | 245 | |
|
243 | 246 | # synopsis |
|
244 | 247 | if len(entry) > 2: |
|
245 | 248 | if entry[2].startswith('hg'): |
|
246 | 249 | rst.append("%s\n" % entry[2]) |
|
247 | 250 | else: |
|
248 | 251 | rst.append('hg %s %s\n' % (aliases[0], entry[2])) |
|
249 | 252 | else: |
|
250 | 253 | rst.append('hg %s\n' % aliases[0]) |
|
251 | 254 | # aliases |
|
252 | 255 | if full and not ui.quiet and len(aliases) > 1: |
|
253 | 256 | rst.append(_("\naliases: %s\n") % ', '.join(aliases[1:])) |
|
254 | 257 | rst.append('\n') |
|
255 | 258 | |
|
256 | 259 | # description |
|
257 | 260 | doc = gettext(entry[0].__doc__) |
|
258 | 261 | if not doc: |
|
259 | 262 | doc = _("(no help text available)") |
|
260 | 263 | if util.safehasattr(entry[0], 'definition'): # aliased command |
|
261 | 264 | if entry[0].definition.startswith('!'): # shell alias |
|
262 | 265 | doc = _('shell alias for::\n\n %s') % entry[0].definition[1:] |
|
263 | 266 | else: |
|
264 | 267 | doc = _('alias for: hg %s\n\n%s') % (entry[0].definition, doc) |
|
265 | 268 | doc = doc.splitlines(True) |
|
266 | 269 | if ui.quiet or not full: |
|
267 | 270 | rst.append(doc[0]) |
|
268 | 271 | else: |
|
269 | 272 | rst.extend(doc) |
|
270 | 273 | rst.append('\n') |
|
271 | 274 | |
|
272 | 275 | # check if this command shadows a non-trivial (multi-line) |
|
273 | 276 | # extension help text |
|
274 | 277 | try: |
|
275 | 278 | mod = extensions.find(name) |
|
276 | 279 | doc = gettext(mod.__doc__) or '' |
|
277 | 280 | if '\n' in doc.strip(): |
|
278 | 281 | msg = _('use "hg help -e %s" to show help for ' |
|
279 | 282 | 'the %s extension') % (name, name) |
|
280 | 283 | rst.append('\n%s\n' % msg) |
|
281 | 284 | except KeyError: |
|
282 | 285 | pass |
|
283 | 286 | |
|
284 | 287 | # options |
|
285 | 288 | if not ui.quiet and entry[1]: |
|
286 | 289 | rst.append('\n%s\n\n' % _("options:")) |
|
287 | 290 | rst.append(optrst(entry[1], ui.verbose)) |
|
288 | 291 | |
|
289 | 292 | if ui.verbose: |
|
290 | 293 | rst.append('\n%s\n\n' % _("global options:")) |
|
291 | 294 | rst.append(optrst(commands.globalopts, ui.verbose)) |
|
292 | 295 | |
|
293 | 296 | if not ui.verbose: |
|
294 | 297 | if not full: |
|
295 | 298 | rst.append(_('\nuse "hg help %s" to show the full help text\n') |
|
296 | 299 | % name) |
|
297 | 300 | elif not ui.quiet: |
|
298 | 301 | omitted = _('use "hg -v help %s" to show more complete' |
|
299 | 302 | ' help and the global options') % name |
|
300 | 303 | notomitted = _('use "hg -v help %s" to show' |
|
301 | 304 | ' the global options') % name |
|
302 | 305 | indicateomitted(rst, omitted, notomitted) |
|
303 | 306 | |
|
304 | 307 | return rst |
|
305 | 308 | |
|
306 | 309 | |
|
307 | 310 | def helplist(select=None): |
|
308 | 311 | # list of commands |
|
309 | 312 | if name == "shortlist": |
|
310 | 313 | header = _('basic commands:\n\n') |
|
311 | 314 | else: |
|
312 | 315 | header = _('list of commands:\n\n') |
|
313 | 316 | |
|
314 | 317 | h = {} |
|
315 | 318 | cmds = {} |
|
316 | 319 | for c, e in commands.table.iteritems(): |
|
317 | 320 | f = c.split("|", 1)[0] |
|
318 | 321 | if select and not select(f): |
|
319 | 322 | continue |
|
320 | 323 | if (not select and name != 'shortlist' and |
|
321 | 324 | e[0].__module__ != commands.__name__): |
|
322 | 325 | continue |
|
323 | 326 | if name == "shortlist" and not f.startswith("^"): |
|
324 | 327 | continue |
|
325 | 328 | f = f.lstrip("^") |
|
326 | 329 | if not ui.debugflag and f.startswith("debug"): |
|
327 | 330 | continue |
|
328 | 331 | doc = e[0].__doc__ |
|
329 | 332 | if doc and 'DEPRECATED' in doc and not ui.verbose: |
|
330 | 333 | continue |
|
331 | 334 | doc = gettext(doc) |
|
332 | 335 | if not doc: |
|
333 | 336 | doc = _("(no help text available)") |
|
334 | 337 | h[f] = doc.splitlines()[0].rstrip() |
|
335 | 338 | cmds[f] = c.lstrip("^") |
|
336 | 339 | |
|
337 | 340 | rst = [] |
|
338 | 341 | if not h: |
|
339 | 342 | if not ui.quiet: |
|
340 | 343 | rst.append(_('no commands defined\n')) |
|
341 | 344 | return rst |
|
342 | 345 | |
|
343 | 346 | if not ui.quiet: |
|
344 | 347 | rst.append(header) |
|
345 | 348 | fns = sorted(h) |
|
346 | 349 | for f in fns: |
|
347 | 350 | if ui.verbose: |
|
348 | 351 | commacmds = cmds[f].replace("|",", ") |
|
349 | 352 | rst.append(" :%s: %s\n" % (commacmds, h[f])) |
|
350 | 353 | else: |
|
351 | 354 | rst.append(' :%s: %s\n' % (f, h[f])) |
|
352 | 355 | |
|
353 | 356 | if not name: |
|
354 | 357 | exts = listexts(_('enabled extensions:'), extensions.enabled()) |
|
355 | 358 | if exts: |
|
356 | 359 | rst.append('\n') |
|
357 | 360 | rst.extend(exts) |
|
358 | 361 | |
|
359 | 362 | rst.append(_("\nadditional help topics:\n\n")) |
|
360 | 363 | topics = [] |
|
361 | 364 | for names, header, doc in helptable: |
|
362 | 365 | topics.append((names[0], header)) |
|
363 | 366 | for t, desc in topics: |
|
364 | 367 | rst.append(" :%s: %s\n" % (t, desc)) |
|
365 | 368 | |
|
366 | 369 | optlist = [] |
|
367 | 370 | if not ui.quiet: |
|
368 | 371 | if ui.verbose: |
|
369 | 372 | optlist.append((_("global options:"), commands.globalopts)) |
|
370 | 373 | if name == 'shortlist': |
|
371 | 374 | optlist.append((_('use "hg help" for the full list ' |
|
372 | 375 | 'of commands'), ())) |
|
373 | 376 | else: |
|
374 | 377 | if name == 'shortlist': |
|
375 | 378 | msg = _('use "hg help" for the full list of commands ' |
|
376 | 379 | 'or "hg -v" for details') |
|
377 | 380 | elif name and not full: |
|
378 | 381 | msg = _('use "hg help %s" to show the full help ' |
|
379 | 382 | 'text') % name |
|
380 | 383 | else: |
|
381 | 384 | msg = _('use "hg -v help%s" to show builtin aliases and ' |
|
382 | 385 | 'global options') % (name and " " + name or "") |
|
383 | 386 | optlist.append((msg, ())) |
|
384 | 387 | |
|
385 | 388 | if optlist: |
|
386 | 389 | for title, options in optlist: |
|
387 | 390 | rst.append('\n%s\n' % title) |
|
388 | 391 | if options: |
|
389 | 392 | rst.append('\n%s\n' % optrst(options, ui.verbose)) |
|
390 | 393 | return rst |
|
391 | 394 | |
|
392 | 395 | def helptopic(name): |
|
393 | 396 | for names, header, doc in helptable: |
|
394 | 397 | if name in names: |
|
395 | 398 | break |
|
396 | 399 | else: |
|
397 | 400 | raise error.UnknownCommand(name) |
|
398 | 401 | |
|
399 | 402 | rst = [minirst.section(header)] |
|
400 | 403 | |
|
401 | 404 | # description |
|
402 | 405 | if not doc: |
|
403 | 406 | rst.append(" %s\n" % _("(no help text available)")) |
|
404 | 407 | if util.safehasattr(doc, '__call__'): |
|
405 | 408 | rst += [" %s\n" % l for l in doc().splitlines()] |
|
406 | 409 | |
|
407 | 410 | if not ui.verbose: |
|
408 | 411 | omitted = (_('use "hg help -v %s" to show more complete help') % |
|
409 | 412 | name) |
|
410 | 413 | indicateomitted(rst, omitted) |
|
411 | 414 | |
|
412 | 415 | try: |
|
413 | 416 | cmdutil.findcmd(name, commands.table) |
|
414 | 417 | rst.append(_('\nuse "hg help -c %s" to see help for ' |
|
415 | 418 | 'the %s command\n') % (name, name)) |
|
416 | 419 | except error.UnknownCommand: |
|
417 | 420 | pass |
|
418 | 421 | return rst |
|
419 | 422 | |
|
420 | 423 | def helpext(name): |
|
421 | 424 | try: |
|
422 | 425 | mod = extensions.find(name) |
|
423 | 426 | doc = gettext(mod.__doc__) or _('no help text available') |
|
424 | 427 | except KeyError: |
|
425 | 428 | mod = None |
|
426 | 429 | doc = extensions.disabledext(name) |
|
427 | 430 | if not doc: |
|
428 | 431 | raise error.UnknownCommand(name) |
|
429 | 432 | |
|
430 | 433 | if '\n' not in doc: |
|
431 | 434 | head, tail = doc, "" |
|
432 | 435 | else: |
|
433 | 436 | head, tail = doc.split('\n', 1) |
|
434 | 437 | rst = [_('%s extension - %s\n\n') % (name.split('.')[-1], head)] |
|
435 | 438 | if tail: |
|
436 | 439 | rst.extend(tail.splitlines(True)) |
|
437 | 440 | rst.append('\n') |
|
438 | 441 | |
|
439 | 442 | if not ui.verbose: |
|
440 | 443 | omitted = (_('use "hg help -v %s" to show more complete help') % |
|
441 | 444 | name) |
|
442 | 445 | indicateomitted(rst, omitted) |
|
443 | 446 | |
|
444 | 447 | if mod: |
|
445 | 448 | try: |
|
446 | 449 | ct = mod.cmdtable |
|
447 | 450 | except AttributeError: |
|
448 | 451 | ct = {} |
|
449 | 452 | modcmds = set([c.split('|', 1)[0] for c in ct]) |
|
450 | 453 | rst.extend(helplist(modcmds.__contains__)) |
|
451 | 454 | else: |
|
452 | 455 | rst.append(_('use "hg help extensions" for information on enabling ' |
|
453 | 456 | 'extensions\n')) |
|
454 | 457 | return rst |
|
455 | 458 | |
|
456 | 459 | def helpextcmd(name): |
|
457 | 460 | cmd, ext, mod = extensions.disabledcmd(ui, name, |
|
458 | 461 | ui.configbool('ui', 'strict')) |
|
459 | 462 | doc = gettext(mod.__doc__).splitlines()[0] |
|
460 | 463 | |
|
461 | 464 | rst = listexts(_("'%s' is provided by the following " |
|
462 | 465 | "extension:") % cmd, {ext: doc}, indent=4) |
|
463 | 466 | rst.append('\n') |
|
464 | 467 | rst.append(_('use "hg help extensions" for information on enabling ' |
|
465 | 468 | 'extensions\n')) |
|
466 | 469 | return rst |
|
467 | 470 | |
|
468 | 471 | |
|
469 | 472 | rst = [] |
|
470 | 473 | kw = opts.get('keyword') |
|
471 | 474 | if kw: |
|
472 | 475 | matches = topicmatch(kw) |
|
473 | 476 | for t, title in (('topics', _('Topics')), |
|
474 | 477 | ('commands', _('Commands')), |
|
475 | 478 | ('extensions', _('Extensions')), |
|
476 | 479 | ('extensioncommands', _('Extension Commands'))): |
|
477 | 480 | if matches[t]: |
|
478 | 481 | rst.append('%s:\n\n' % title) |
|
479 | 482 | rst.extend(minirst.maketable(sorted(matches[t]), 1)) |
|
480 | 483 | rst.append('\n') |
|
481 | 484 | elif name and name != 'shortlist': |
|
482 | 485 | i = None |
|
483 | 486 | if unknowncmd: |
|
484 | 487 | queries = (helpextcmd,) |
|
485 | 488 | elif opts.get('extension'): |
|
486 | 489 | queries = (helpext,) |
|
487 | 490 | elif opts.get('command'): |
|
488 | 491 | queries = (helpcmd,) |
|
489 | 492 | else: |
|
490 | 493 | queries = (helptopic, helpcmd, helpext, helpextcmd) |
|
491 | 494 | for f in queries: |
|
492 | 495 | try: |
|
493 | 496 | rst = f(name) |
|
494 | 497 | i = None |
|
495 | 498 | break |
|
496 | 499 | except error.UnknownCommand, inst: |
|
497 | 500 | i = inst |
|
498 | 501 | if i: |
|
499 | 502 | raise i |
|
500 | 503 | else: |
|
501 | 504 | # program name |
|
502 | 505 | if not ui.quiet: |
|
503 | 506 | rst = [_("Mercurial Distributed SCM\n"), '\n'] |
|
504 | 507 | rst.extend(helplist()) |
|
505 | 508 | |
|
506 | 509 | return ''.join(rst) |
@@ -1,1913 +1,1996 b'' | |||
|
1 | 1 | Short help: |
|
2 | 2 | |
|
3 | 3 | $ hg |
|
4 | 4 | Mercurial Distributed SCM |
|
5 | 5 | |
|
6 | 6 | basic commands: |
|
7 | 7 | |
|
8 | 8 | add add the specified files on the next commit |
|
9 | 9 | annotate show changeset information by line for each file |
|
10 | 10 | clone make a copy of an existing repository |
|
11 | 11 | commit commit the specified files or all outstanding changes |
|
12 | 12 | diff diff repository (or selected files) |
|
13 | 13 | export dump the header and diffs for one or more changesets |
|
14 | 14 | forget forget the specified files on the next commit |
|
15 | 15 | init create a new repository in the given directory |
|
16 | 16 | log show revision history of entire repository or files |
|
17 | 17 | merge merge working directory with another revision |
|
18 | 18 | pull pull changes from the specified source |
|
19 | 19 | push push changes to the specified destination |
|
20 | 20 | remove remove the specified files on the next commit |
|
21 | 21 | serve start stand-alone webserver |
|
22 | 22 | status show changed files in the working directory |
|
23 | 23 | summary summarize working directory state |
|
24 | 24 | update update working directory (or switch revisions) |
|
25 | 25 | |
|
26 | 26 | use "hg help" for the full list of commands or "hg -v" for details |
|
27 | 27 | |
|
28 | 28 | $ hg -q |
|
29 | 29 | add add the specified files on the next commit |
|
30 | 30 | annotate show changeset information by line for each file |
|
31 | 31 | clone make a copy of an existing repository |
|
32 | 32 | commit commit the specified files or all outstanding changes |
|
33 | 33 | diff diff repository (or selected files) |
|
34 | 34 | export dump the header and diffs for one or more changesets |
|
35 | 35 | forget forget the specified files on the next commit |
|
36 | 36 | init create a new repository in the given directory |
|
37 | 37 | log show revision history of entire repository or files |
|
38 | 38 | merge merge working directory with another revision |
|
39 | 39 | pull pull changes from the specified source |
|
40 | 40 | push push changes to the specified destination |
|
41 | 41 | remove remove the specified files on the next commit |
|
42 | 42 | serve start stand-alone webserver |
|
43 | 43 | status show changed files in the working directory |
|
44 | 44 | summary summarize working directory state |
|
45 | 45 | update update working directory (or switch revisions) |
|
46 | 46 | |
|
47 | 47 | $ hg help |
|
48 | 48 | Mercurial Distributed SCM |
|
49 | 49 | |
|
50 | 50 | list of commands: |
|
51 | 51 | |
|
52 | 52 | add add the specified files on the next commit |
|
53 | 53 | addremove add all new files, delete all missing files |
|
54 | 54 | annotate show changeset information by line for each file |
|
55 | 55 | archive create an unversioned archive of a repository revision |
|
56 | 56 | backout reverse effect of earlier changeset |
|
57 | 57 | bisect subdivision search of changesets |
|
58 | 58 | bookmarks track a line of development with movable markers |
|
59 | 59 | branch set or show the current branch name |
|
60 | 60 | branches list repository named branches |
|
61 | 61 | bundle create a changegroup file |
|
62 | 62 | cat output the current or given revision of files |
|
63 | 63 | clone make a copy of an existing repository |
|
64 | 64 | commit commit the specified files or all outstanding changes |
|
65 | 65 | config show combined config settings from all hgrc files |
|
66 | 66 | copy mark files as copied for the next commit |
|
67 | 67 | diff diff repository (or selected files) |
|
68 | 68 | export dump the header and diffs for one or more changesets |
|
69 | 69 | forget forget the specified files on the next commit |
|
70 | 70 | graft copy changes from other branches onto the current branch |
|
71 | 71 | grep search for a pattern in specified files and revisions |
|
72 | 72 | heads show branch heads |
|
73 | 73 | help show help for a given topic or a help overview |
|
74 | 74 | identify identify the working copy or specified revision |
|
75 | 75 | import import an ordered set of patches |
|
76 | 76 | incoming show new changesets found in source |
|
77 | 77 | init create a new repository in the given directory |
|
78 | 78 | locate locate files matching specific patterns |
|
79 | 79 | log show revision history of entire repository or files |
|
80 | 80 | manifest output the current or given revision of the project manifest |
|
81 | 81 | merge merge working directory with another revision |
|
82 | 82 | outgoing show changesets not found in the destination |
|
83 | 83 | parents show the parents of the working directory or revision |
|
84 | 84 | paths show aliases for remote repositories |
|
85 | 85 | phase set or show the current phase name |
|
86 | 86 | pull pull changes from the specified source |
|
87 | 87 | push push changes to the specified destination |
|
88 | 88 | recover roll back an interrupted transaction |
|
89 | 89 | remove remove the specified files on the next commit |
|
90 | 90 | rename rename files; equivalent of copy + remove |
|
91 | 91 | resolve redo merges or set/view the merge status of files |
|
92 | 92 | revert restore files to their checkout state |
|
93 | 93 | root print the root (top) of the current working directory |
|
94 | 94 | serve start stand-alone webserver |
|
95 | 95 | status show changed files in the working directory |
|
96 | 96 | summary summarize working directory state |
|
97 | 97 | tag add one or more tags for the current or given revision |
|
98 | 98 | tags list repository tags |
|
99 | 99 | unbundle apply one or more changegroup files |
|
100 | 100 | update update working directory (or switch revisions) |
|
101 | 101 | verify verify the integrity of the repository |
|
102 | 102 | version output version and copyright information |
|
103 | 103 | |
|
104 | 104 | additional help topics: |
|
105 | 105 | |
|
106 | 106 | config Configuration Files |
|
107 | 107 | dates Date Formats |
|
108 | 108 | diffs Diff Formats |
|
109 | 109 | environment Environment Variables |
|
110 | 110 | extensions Using Additional Features |
|
111 | 111 | filesets Specifying File Sets |
|
112 | 112 | glossary Glossary |
|
113 | 113 | hgignore Syntax for Mercurial Ignore Files |
|
114 | 114 | hgweb Configuring hgweb |
|
115 | 115 | merge-tools Merge Tools |
|
116 | 116 | multirevs Specifying Multiple Revisions |
|
117 | 117 | patterns File Name Patterns |
|
118 | 118 | phases Working with Phases |
|
119 | 119 | revisions Specifying Single Revisions |
|
120 | 120 | revsets Specifying Revision Sets |
|
121 | 121 | subrepos Subrepositories |
|
122 | 122 | templating Template Usage |
|
123 | 123 | urls URL Paths |
|
124 | 124 | |
|
125 | 125 | use "hg -v help" to show builtin aliases and global options |
|
126 | 126 | |
|
127 | 127 | $ hg -q help |
|
128 | 128 | add add the specified files on the next commit |
|
129 | 129 | addremove add all new files, delete all missing files |
|
130 | 130 | annotate show changeset information by line for each file |
|
131 | 131 | archive create an unversioned archive of a repository revision |
|
132 | 132 | backout reverse effect of earlier changeset |
|
133 | 133 | bisect subdivision search of changesets |
|
134 | 134 | bookmarks track a line of development with movable markers |
|
135 | 135 | branch set or show the current branch name |
|
136 | 136 | branches list repository named branches |
|
137 | 137 | bundle create a changegroup file |
|
138 | 138 | cat output the current or given revision of files |
|
139 | 139 | clone make a copy of an existing repository |
|
140 | 140 | commit commit the specified files or all outstanding changes |
|
141 | 141 | config show combined config settings from all hgrc files |
|
142 | 142 | copy mark files as copied for the next commit |
|
143 | 143 | diff diff repository (or selected files) |
|
144 | 144 | export dump the header and diffs for one or more changesets |
|
145 | 145 | forget forget the specified files on the next commit |
|
146 | 146 | graft copy changes from other branches onto the current branch |
|
147 | 147 | grep search for a pattern in specified files and revisions |
|
148 | 148 | heads show branch heads |
|
149 | 149 | help show help for a given topic or a help overview |
|
150 | 150 | identify identify the working copy or specified revision |
|
151 | 151 | import import an ordered set of patches |
|
152 | 152 | incoming show new changesets found in source |
|
153 | 153 | init create a new repository in the given directory |
|
154 | 154 | locate locate files matching specific patterns |
|
155 | 155 | log show revision history of entire repository or files |
|
156 | 156 | manifest output the current or given revision of the project manifest |
|
157 | 157 | merge merge working directory with another revision |
|
158 | 158 | outgoing show changesets not found in the destination |
|
159 | 159 | parents show the parents of the working directory or revision |
|
160 | 160 | paths show aliases for remote repositories |
|
161 | 161 | phase set or show the current phase name |
|
162 | 162 | pull pull changes from the specified source |
|
163 | 163 | push push changes to the specified destination |
|
164 | 164 | recover roll back an interrupted transaction |
|
165 | 165 | remove remove the specified files on the next commit |
|
166 | 166 | rename rename files; equivalent of copy + remove |
|
167 | 167 | resolve redo merges or set/view the merge status of files |
|
168 | 168 | revert restore files to their checkout state |
|
169 | 169 | root print the root (top) of the current working directory |
|
170 | 170 | serve start stand-alone webserver |
|
171 | 171 | status show changed files in the working directory |
|
172 | 172 | summary summarize working directory state |
|
173 | 173 | tag add one or more tags for the current or given revision |
|
174 | 174 | tags list repository tags |
|
175 | 175 | unbundle apply one or more changegroup files |
|
176 | 176 | update update working directory (or switch revisions) |
|
177 | 177 | verify verify the integrity of the repository |
|
178 | 178 | version output version and copyright information |
|
179 | 179 | |
|
180 | 180 | additional help topics: |
|
181 | 181 | |
|
182 | 182 | config Configuration Files |
|
183 | 183 | dates Date Formats |
|
184 | 184 | diffs Diff Formats |
|
185 | 185 | environment Environment Variables |
|
186 | 186 | extensions Using Additional Features |
|
187 | 187 | filesets Specifying File Sets |
|
188 | 188 | glossary Glossary |
|
189 | 189 | hgignore Syntax for Mercurial Ignore Files |
|
190 | 190 | hgweb Configuring hgweb |
|
191 | 191 | merge-tools Merge Tools |
|
192 | 192 | multirevs Specifying Multiple Revisions |
|
193 | 193 | patterns File Name Patterns |
|
194 | 194 | phases Working with Phases |
|
195 | 195 | revisions Specifying Single Revisions |
|
196 | 196 | revsets Specifying Revision Sets |
|
197 | 197 | subrepos Subrepositories |
|
198 | 198 | templating Template Usage |
|
199 | 199 | urls URL Paths |
|
200 | 200 | |
|
201 | Test extension help: | |
|
202 | $ hg help extensions --config extensions.rebase= --config extensions.children= | |
|
203 | Using Additional Features | |
|
204 | """"""""""""""""""""""""" | |
|
205 | ||
|
206 | Mercurial has the ability to add new features through the use of | |
|
207 | extensions. Extensions may add new commands, add options to existing | |
|
208 | commands, change the default behavior of commands, or implement hooks. | |
|
209 | ||
|
210 | To enable the "foo" extension, either shipped with Mercurial or in the | |
|
211 | Python search path, create an entry for it in your configuration file, | |
|
212 | like this: | |
|
213 | ||
|
214 | [extensions] | |
|
215 | foo = | |
|
216 | ||
|
217 | You may also specify the full path to an extension: | |
|
218 | ||
|
219 | [extensions] | |
|
220 | myfeature = ~/.hgext/myfeature.py | |
|
221 | ||
|
222 | See "hg help config" for more information on configuration files. | |
|
223 | ||
|
224 | Extensions are not loaded by default for a variety of reasons: they can | |
|
225 | increase startup overhead; they may be meant for advanced usage only; they | |
|
226 | may provide potentially dangerous abilities (such as letting you destroy | |
|
227 | or modify history); they might not be ready for prime time; or they may | |
|
228 | alter some usual behaviors of stock Mercurial. It is thus up to the user | |
|
229 | to activate extensions as needed. | |
|
230 | ||
|
231 | To explicitly disable an extension enabled in a configuration file of | |
|
232 | broader scope, prepend its path with !: | |
|
233 | ||
|
234 | [extensions] | |
|
235 | # disabling extension bar residing in /path/to/extension/bar.py | |
|
236 | bar = !/path/to/extension/bar.py | |
|
237 | # ditto, but no path was supplied for extension baz | |
|
238 | baz = ! | |
|
239 | ||
|
240 | enabled extensions: | |
|
241 | ||
|
242 | children command to display child changesets (DEPRECATED) | |
|
243 | rebase command to move sets of revisions to a different ancestor | |
|
244 | ||
|
245 | disabled extensions: | |
|
246 | ||
|
247 | acl hooks for controlling repository access | |
|
248 | blackbox log repository events to a blackbox for debugging | |
|
249 | bugzilla hooks for integrating with the Bugzilla bug tracker | |
|
250 | churn command to display statistics about repository history | |
|
251 | color colorize output from some commands | |
|
252 | convert import revisions from foreign VCS repositories into | |
|
253 | Mercurial | |
|
254 | eol automatically manage newlines in repository files | |
|
255 | extdiff command to allow external programs to compare revisions | |
|
256 | factotum http authentication with factotum | |
|
257 | gpg commands to sign and verify changesets | |
|
258 | hgcia hooks for integrating with the CIA.vc notification service | |
|
259 | hgk browse the repository in a graphical way | |
|
260 | highlight syntax highlighting for hgweb (requires Pygments) | |
|
261 | histedit interactive history editing | |
|
262 | inotify accelerate status report using Linux's inotify service | |
|
263 | interhg expand expressions into changelog and summaries | |
|
264 | keyword expand keywords in tracked files | |
|
265 | largefiles track large binary files | |
|
266 | mq manage a stack of patches | |
|
267 | notify hooks for sending email push notifications | |
|
268 | pager browse command output with an external pager | |
|
269 | patchbomb command to send changesets as (a series of) patch emails | |
|
270 | progress show progress bars for some actions | |
|
271 | purge command to delete untracked files from the working | |
|
272 | directory | |
|
273 | record commands to interactively select changes for | |
|
274 | commit/qrefresh | |
|
275 | relink recreates hardlinks between repository clones | |
|
276 | schemes extend schemes with shortcuts to repository swarms | |
|
277 | share share a common history between several working directories | |
|
278 | shelve save and restore changes to the working directory | |
|
279 | strip strip changesets and their descendents from history | |
|
280 | transplant command to transplant changesets from another branch | |
|
281 | win32mbcs allow the use of MBCS paths with problematic encodings | |
|
282 | win32text perform automatic newline conversion | |
|
283 | zeroconf discover and advertise repositories on the local network | |
|
201 | 284 | Test short command list with verbose option |
|
202 | 285 | |
|
203 | 286 | $ hg -v help shortlist |
|
204 | 287 | Mercurial Distributed SCM |
|
205 | 288 |
|
|
206 | 289 | basic commands: |
|
207 | 290 |
|
|
208 | 291 | add add the specified files on the next commit |
|
209 | 292 | annotate, blame |
|
210 | 293 | show changeset information by line for each file |
|
211 | 294 | clone make a copy of an existing repository |
|
212 | 295 | commit, ci commit the specified files or all outstanding changes |
|
213 | 296 | diff diff repository (or selected files) |
|
214 | 297 | export dump the header and diffs for one or more changesets |
|
215 | 298 | forget forget the specified files on the next commit |
|
216 | 299 | init create a new repository in the given directory |
|
217 | 300 | log, history show revision history of entire repository or files |
|
218 | 301 | merge merge working directory with another revision |
|
219 | 302 | pull pull changes from the specified source |
|
220 | 303 | push push changes to the specified destination |
|
221 | 304 | remove, rm remove the specified files on the next commit |
|
222 | 305 | serve start stand-alone webserver |
|
223 | 306 | status, st show changed files in the working directory |
|
224 | 307 | summary, sum summarize working directory state |
|
225 | 308 | update, up, checkout, co |
|
226 | 309 | update working directory (or switch revisions) |
|
227 | 310 |
|
|
228 | 311 | global options: |
|
229 | 312 |
|
|
230 | 313 | -R --repository REPO repository root directory or name of overlay bundle |
|
231 | 314 | file |
|
232 | 315 | --cwd DIR change working directory |
|
233 | 316 | -y --noninteractive do not prompt, automatically pick the first choice for |
|
234 | 317 | all prompts |
|
235 | 318 | -q --quiet suppress output |
|
236 | 319 | -v --verbose enable additional output |
|
237 | 320 |
--config CONFIG [+] set/override config option (use 'section.name=value') |
|
238 | 321 | --debug enable debugging output |
|
239 | 322 | --debugger start debugger |
|
240 | 323 | --encoding ENCODE set the charset encoding (default: ascii) |
|
241 | 324 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
242 | 325 | --traceback always print a traceback on exception |
|
243 | 326 | --time time how long the command takes |
|
244 | 327 | --profile print command execution profile |
|
245 | 328 | --version output version information and exit |
|
246 | 329 | -h --help display help and exit |
|
247 | 330 | --hidden consider hidden changesets |
|
248 | 331 |
|
|
249 | 332 | [+] marked option can be specified multiple times |
|
250 | 333 |
|
|
251 | 334 | use "hg help" for the full list of commands |
|
252 | 335 | |
|
253 | 336 | $ hg add -h |
|
254 | 337 | hg add [OPTION]... [FILE]... |
|
255 | 338 |
|
|
256 | 339 | add the specified files on the next commit |
|
257 | 340 |
|
|
258 | 341 | Schedule files to be version controlled and added to the repository. |
|
259 | 342 |
|
|
260 | 343 | The files will be added to the repository at the next commit. To undo an |
|
261 | 344 | add before that, see "hg forget". |
|
262 | 345 |
|
|
263 | 346 | If no names are given, add all files to the repository. |
|
264 | 347 |
|
|
265 | 348 | Returns 0 if all files are successfully added. |
|
266 | 349 |
|
|
267 | 350 | options: |
|
268 | 351 |
|
|
269 | 352 | -I --include PATTERN [+] include names matching the given patterns |
|
270 | 353 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
271 | 354 | -S --subrepos recurse into subrepositories |
|
272 | 355 | -n --dry-run do not perform actions, just print output |
|
273 | 356 |
|
|
274 | 357 | [+] marked option can be specified multiple times |
|
275 | 358 |
|
|
276 | 359 | use "hg -v help add" to show more complete help and the global options |
|
277 | 360 | |
|
278 | 361 | Verbose help for add |
|
279 | 362 | |
|
280 | 363 | $ hg add -hv |
|
281 | 364 | hg add [OPTION]... [FILE]... |
|
282 | 365 |
|
|
283 | 366 | add the specified files on the next commit |
|
284 | 367 |
|
|
285 | 368 | Schedule files to be version controlled and added to the repository. |
|
286 | 369 |
|
|
287 | 370 | The files will be added to the repository at the next commit. To undo an |
|
288 | 371 | add before that, see "hg forget". |
|
289 | 372 |
|
|
290 | 373 | If no names are given, add all files to the repository. |
|
291 | 374 |
|
|
292 | 375 | An example showing how new (unknown) files are added automatically by "hg |
|
293 | 376 | add": |
|
294 | 377 |
|
|
295 | 378 | $ ls |
|
296 | 379 | foo.c |
|
297 | 380 | $ hg status |
|
298 | 381 | ? foo.c |
|
299 | 382 | $ hg add |
|
300 | 383 | adding foo.c |
|
301 | 384 | $ hg status |
|
302 | 385 | A foo.c |
|
303 | 386 |
|
|
304 | 387 | Returns 0 if all files are successfully added. |
|
305 | 388 |
|
|
306 | 389 | options: |
|
307 | 390 |
|
|
308 | 391 | -I --include PATTERN [+] include names matching the given patterns |
|
309 | 392 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
310 | 393 | -S --subrepos recurse into subrepositories |
|
311 | 394 | -n --dry-run do not perform actions, just print output |
|
312 | 395 |
|
|
313 | 396 | [+] marked option can be specified multiple times |
|
314 | 397 |
|
|
315 | 398 | global options: |
|
316 | 399 |
|
|
317 | 400 | -R --repository REPO repository root directory or name of overlay bundle |
|
318 | 401 | file |
|
319 | 402 | --cwd DIR change working directory |
|
320 | 403 | -y --noninteractive do not prompt, automatically pick the first choice for |
|
321 | 404 | all prompts |
|
322 | 405 | -q --quiet suppress output |
|
323 | 406 | -v --verbose enable additional output |
|
324 | 407 |
--config CONFIG [+] set/override config option (use 'section.name=value') |
|
325 | 408 | --debug enable debugging output |
|
326 | 409 | --debugger start debugger |
|
327 | 410 | --encoding ENCODE set the charset encoding (default: ascii) |
|
328 | 411 | --encodingmode MODE set the charset encoding mode (default: strict) |
|
329 | 412 | --traceback always print a traceback on exception |
|
330 | 413 | --time time how long the command takes |
|
331 | 414 | --profile print command execution profile |
|
332 | 415 | --version output version information and exit |
|
333 | 416 | -h --help display help and exit |
|
334 | 417 | --hidden consider hidden changesets |
|
335 | 418 |
|
|
336 | 419 | [+] marked option can be specified multiple times |
|
337 | 420 | |
|
338 | 421 | Test help option with version option |
|
339 | 422 | |
|
340 | 423 | $ hg add -h --version |
|
341 | 424 | Mercurial Distributed SCM (version *) (glob) |
|
342 | 425 | (see http://mercurial.selenic.com for more information) |
|
343 | 426 |
|
|
344 | 427 | Copyright (C) 2005-2014 Matt Mackall and others |
|
345 | 428 | This is free software; see the source for copying conditions. There is NO |
|
346 | 429 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
347 | 430 | |
|
348 | 431 | $ hg add --skjdfks |
|
349 | 432 | hg add: option --skjdfks not recognized |
|
350 | 433 | hg add [OPTION]... [FILE]... |
|
351 | 434 |
|
|
352 | 435 | add the specified files on the next commit |
|
353 | 436 |
|
|
354 | 437 | options: |
|
355 | 438 |
|
|
356 | 439 | -I --include PATTERN [+] include names matching the given patterns |
|
357 | 440 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
358 | 441 | -S --subrepos recurse into subrepositories |
|
359 | 442 | -n --dry-run do not perform actions, just print output |
|
360 | 443 |
|
|
361 | 444 | [+] marked option can be specified multiple times |
|
362 | 445 |
|
|
363 | 446 | use "hg help add" to show the full help text |
|
364 | 447 | [255] |
|
365 | 448 | |
|
366 | 449 | Test ambiguous command help |
|
367 | 450 | |
|
368 | 451 | $ hg help ad |
|
369 | 452 | list of commands: |
|
370 | 453 |
|
|
371 | 454 | add add the specified files on the next commit |
|
372 | 455 | addremove add all new files, delete all missing files |
|
373 | 456 |
|
|
374 | 457 | use "hg -v help ad" to show builtin aliases and global options |
|
375 | 458 | |
|
376 | 459 | Test command without options |
|
377 | 460 | |
|
378 | 461 | $ hg help verify |
|
379 | 462 | hg verify |
|
380 | 463 |
|
|
381 | 464 | verify the integrity of the repository |
|
382 | 465 |
|
|
383 | 466 | Verify the integrity of the current repository. |
|
384 | 467 |
|
|
385 | 468 |
|
|
386 | 469 | validating the hashes and checksums of each entry in the changelog, |
|
387 | 470 | manifest, and tracked files, as well as the integrity of their crosslinks |
|
388 | 471 | and indices. |
|
389 | 472 | |
|
390 | 473 | Please see http://mercurial.selenic.com/wiki/RepositoryCorruption for more |
|
391 | 474 | information about recovery from corruption of the repository. |
|
392 | 475 | |
|
393 | 476 | Returns 0 on success, 1 if errors are encountered. |
|
394 | 477 | |
|
395 | 478 | use "hg -v help verify" to show the global options |
|
396 | 479 | |
|
397 | 480 | $ hg help diff |
|
398 | 481 | hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]... |
|
399 | 482 | |
|
400 | 483 | diff repository (or selected files) |
|
401 | 484 | |
|
402 | 485 | Show differences between revisions for the specified files. |
|
403 | 486 | |
|
404 | 487 | Differences between files are shown using the unified diff format. |
|
405 | 488 | |
|
406 | 489 | Note: |
|
407 | 490 | diff may generate unexpected results for merges, as it will default to |
|
408 | 491 | comparing against the working directory's first parent changeset if no |
|
409 | 492 | revisions are specified. |
|
410 | 493 |
|
|
411 | 494 | When two revision arguments are given, then changes are shown between |
|
412 | 495 | those revisions. If only one revision is specified then that revision is |
|
413 | 496 | compared to the working directory, and, when no revisions are specified, |
|
414 | 497 | the working directory files are compared to its parent. |
|
415 | 498 |
|
|
416 | 499 | Alternatively you can specify -c/--change with a revision to see the |
|
417 | 500 | changes in that changeset relative to its first parent. |
|
418 | 501 |
|
|
419 | 502 | Without the -a/--text option, diff will avoid generating diffs of files it |
|
420 | 503 | detects as binary. With -a, diff will generate a diff anyway, probably |
|
421 | 504 | with undesirable results. |
|
422 | 505 |
|
|
423 | 506 | Use the -g/--git option to generate diffs in the git extended diff format. |
|
424 | 507 | For more information, read "hg help diffs". |
|
425 | 508 |
|
|
426 | 509 | Returns 0 on success. |
|
427 | 510 |
|
|
428 | 511 | options: |
|
429 | 512 |
|
|
430 | 513 | -r --rev REV [+] revision |
|
431 | 514 | -c --change REV change made by revision |
|
432 | 515 | -a --text treat all files as text |
|
433 | 516 | -g --git use git extended diff format |
|
434 | 517 | --nodates omit dates from diff headers |
|
435 | 518 | -p --show-function show which function each change is in |
|
436 | 519 | --reverse produce a diff that undoes the changes |
|
437 | 520 | -w --ignore-all-space ignore white space when comparing lines |
|
438 | 521 | -b --ignore-space-change ignore changes in the amount of white space |
|
439 | 522 | -B --ignore-blank-lines ignore changes whose lines are all blank |
|
440 | 523 | -U --unified NUM number of lines of context to show |
|
441 | 524 | --stat output diffstat-style summary of changes |
|
442 | 525 | -I --include PATTERN [+] include names matching the given patterns |
|
443 | 526 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
444 | 527 | -S --subrepos recurse into subrepositories |
|
445 | 528 |
|
|
446 | 529 | [+] marked option can be specified multiple times |
|
447 | 530 |
|
|
448 | 531 | use "hg -v help diff" to show more complete help and the global options |
|
449 | 532 | |
|
450 | 533 | $ hg help status |
|
451 | 534 | hg status [OPTION]... [FILE]... |
|
452 | 535 |
|
|
453 | 536 | aliases: st |
|
454 | 537 |
|
|
455 | 538 | show changed files in the working directory |
|
456 | 539 |
|
|
457 | 540 | Show status of files in the repository. If names are given, only files |
|
458 | 541 | that match are shown. Files that are clean or ignored or the source of a |
|
459 | 542 | copy/move operation, are not listed unless -c/--clean, -i/--ignored, |
|
460 | 543 | -C/--copies or -A/--all are given. Unless options described with "show |
|
461 | 544 | only ..." are given, the options -mardu are used. |
|
462 | 545 |
|
|
463 | 546 | Option -q/--quiet hides untracked (unknown and ignored) files unless |
|
464 | 547 | explicitly requested with -u/--unknown or -i/--ignored. |
|
465 | 548 |
|
|
466 | 549 | Note: |
|
467 | 550 | status may appear to disagree with diff if permissions have changed or |
|
468 | 551 | a merge has occurred. The standard diff format does not report |
|
469 | 552 | permission changes and diff only reports changes relative to one merge |
|
470 | 553 | parent. |
|
471 | 554 |
|
|
472 | 555 | If one revision is given, it is used as the base revision. If two |
|
473 | 556 | revisions are given, the differences between them are shown. The --change |
|
474 | 557 | option can also be used as a shortcut to list the changed files of a |
|
475 | 558 | revision from its first parent. |
|
476 | 559 |
|
|
477 | 560 | The codes used to show the status of files are: |
|
478 | 561 |
|
|
479 | 562 | M = modified |
|
480 | 563 | A = added |
|
481 | 564 | R = removed |
|
482 | 565 | C = clean |
|
483 | 566 | ! = missing (deleted by non-hg command, but still tracked) |
|
484 | 567 | ? = not tracked |
|
485 | 568 | I = ignored |
|
486 | 569 | = origin of the previous file listed as A (added) |
|
487 | 570 |
|
|
488 | 571 | Returns 0 on success. |
|
489 | 572 |
|
|
490 | 573 | options: |
|
491 | 574 |
|
|
492 | 575 | -A --all show status of all files |
|
493 | 576 | -m --modified show only modified files |
|
494 | 577 | -a --added show only added files |
|
495 | 578 | -r --removed show only removed files |
|
496 | 579 | -d --deleted show only deleted (but tracked) files |
|
497 | 580 | -c --clean show only files without changes |
|
498 | 581 | -u --unknown show only unknown (not tracked) files |
|
499 | 582 | -i --ignored show only ignored files |
|
500 | 583 | -n --no-status hide status prefix |
|
501 | 584 | -C --copies show source of copied files |
|
502 | 585 | -0 --print0 end filenames with NUL, for use with xargs |
|
503 | 586 | --rev REV [+] show difference from revision |
|
504 | 587 | --change REV list the changed files of a revision |
|
505 | 588 | -I --include PATTERN [+] include names matching the given patterns |
|
506 | 589 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
507 | 590 | -S --subrepos recurse into subrepositories |
|
508 | 591 |
|
|
509 | 592 | [+] marked option can be specified multiple times |
|
510 | 593 |
|
|
511 | 594 | use "hg -v help status" to show more complete help and the global options |
|
512 | 595 | |
|
513 | 596 | $ hg -q help status |
|
514 | 597 | hg status [OPTION]... [FILE]... |
|
515 | 598 |
|
|
516 | 599 | show changed files in the working directory |
|
517 | 600 | |
|
518 | 601 | $ hg help foo |
|
519 | 602 | hg: unknown command 'foo' |
|
520 | 603 | Mercurial Distributed SCM |
|
521 | 604 |
|
|
522 | 605 | basic commands: |
|
523 | 606 |
|
|
524 | 607 | add add the specified files on the next commit |
|
525 | 608 | annotate show changeset information by line for each file |
|
526 | 609 | clone make a copy of an existing repository |
|
527 | 610 | commit commit the specified files or all outstanding changes |
|
528 | 611 | diff diff repository (or selected files) |
|
529 | 612 | export dump the header and diffs for one or more changesets |
|
530 | 613 | forget forget the specified files on the next commit |
|
531 | 614 | init create a new repository in the given directory |
|
532 | 615 | log show revision history of entire repository or files |
|
533 | 616 | merge merge working directory with another revision |
|
534 | 617 | pull pull changes from the specified source |
|
535 | 618 | push push changes to the specified destination |
|
536 | 619 | remove remove the specified files on the next commit |
|
537 | 620 | serve start stand-alone webserver |
|
538 | 621 | status show changed files in the working directory |
|
539 | 622 | summary summarize working directory state |
|
540 | 623 | update update working directory (or switch revisions) |
|
541 | 624 |
|
|
542 | 625 | use "hg help" for the full list of commands or "hg -v" for details |
|
543 | 626 | [255] |
|
544 | 627 | |
|
545 | 628 | $ hg skjdfks |
|
546 | 629 | hg: unknown command 'skjdfks' |
|
547 | 630 | Mercurial Distributed SCM |
|
548 | 631 |
|
|
549 | 632 | basic commands: |
|
550 | 633 |
|
|
551 | 634 | add add the specified files on the next commit |
|
552 | 635 | annotate show changeset information by line for each file |
|
553 | 636 | clone make a copy of an existing repository |
|
554 | 637 | commit commit the specified files or all outstanding changes |
|
555 | 638 | diff diff repository (or selected files) |
|
556 | 639 | export dump the header and diffs for one or more changesets |
|
557 | 640 | forget forget the specified files on the next commit |
|
558 | 641 | init create a new repository in the given directory |
|
559 | 642 | log show revision history of entire repository or files |
|
560 | 643 | merge merge working directory with another revision |
|
561 | 644 | pull pull changes from the specified source |
|
562 | 645 | push push changes to the specified destination |
|
563 | 646 | remove remove the specified files on the next commit |
|
564 | 647 | serve start stand-alone webserver |
|
565 | 648 | status show changed files in the working directory |
|
566 | 649 | summary summarize working directory state |
|
567 | 650 | update update working directory (or switch revisions) |
|
568 | 651 |
|
|
569 | 652 | use "hg help" for the full list of commands or "hg -v" for details |
|
570 | 653 | [255] |
|
571 | 654 | |
|
572 | 655 | $ cat > helpext.py <<EOF |
|
573 | 656 | > import os |
|
574 | 657 | > from mercurial import commands |
|
575 | 658 | > |
|
576 | 659 | > def nohelp(ui, *args, **kwargs): |
|
577 | 660 | > pass |
|
578 | 661 | > |
|
579 | 662 | > cmdtable = { |
|
580 | 663 | > "nohelp": (nohelp, [], "hg nohelp"), |
|
581 | 664 | > } |
|
582 | 665 | > |
|
583 | 666 | > commands.norepo += ' nohelp' |
|
584 | 667 | > EOF |
|
585 | 668 | $ echo '[extensions]' >> $HGRCPATH |
|
586 | 669 | $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH |
|
587 | 670 | |
|
588 | 671 | Test command with no help text |
|
589 | 672 | |
|
590 | 673 | $ hg help nohelp |
|
591 | 674 | hg nohelp |
|
592 | 675 |
|
|
593 | 676 | (no help text available) |
|
594 | 677 |
|
|
595 | 678 | use "hg -v help nohelp" to show the global options |
|
596 | 679 | |
|
597 | 680 | $ hg help -k nohelp |
|
598 | 681 | Commands: |
|
599 | 682 |
|
|
600 | 683 | nohelp hg nohelp |
|
601 | 684 |
|
|
602 | 685 | Extension Commands: |
|
603 | 686 |
|
|
604 | 687 | nohelp (no help text available) |
|
605 | 688 | |
|
606 | 689 | Test that default list of commands omits extension commands |
|
607 | 690 | |
|
608 | 691 | $ hg help |
|
609 | 692 | Mercurial Distributed SCM |
|
610 | 693 |
|
|
611 | 694 | list of commands: |
|
612 | 695 |
|
|
613 | 696 | add add the specified files on the next commit |
|
614 | 697 | addremove add all new files, delete all missing files |
|
615 | 698 | annotate show changeset information by line for each file |
|
616 | 699 | archive create an unversioned archive of a repository revision |
|
617 | 700 | backout reverse effect of earlier changeset |
|
618 | 701 | bisect subdivision search of changesets |
|
619 | 702 | bookmarks track a line of development with movable markers |
|
620 | 703 | branch set or show the current branch name |
|
621 | 704 | branches list repository named branches |
|
622 | 705 | bundle create a changegroup file |
|
623 | 706 | cat output the current or given revision of files |
|
624 | 707 | clone make a copy of an existing repository |
|
625 | 708 | commit commit the specified files or all outstanding changes |
|
626 | 709 | config show combined config settings from all hgrc files |
|
627 | 710 | copy mark files as copied for the next commit |
|
628 | 711 | diff diff repository (or selected files) |
|
629 | 712 | export dump the header and diffs for one or more changesets |
|
630 | 713 | forget forget the specified files on the next commit |
|
631 | 714 | graft copy changes from other branches onto the current branch |
|
632 | 715 | grep search for a pattern in specified files and revisions |
|
633 | 716 | heads show branch heads |
|
634 | 717 | help show help for a given topic or a help overview |
|
635 | 718 | identify identify the working copy or specified revision |
|
636 | 719 | import import an ordered set of patches |
|
637 | 720 | incoming show new changesets found in source |
|
638 | 721 | init create a new repository in the given directory |
|
639 | 722 | locate locate files matching specific patterns |
|
640 | 723 | log show revision history of entire repository or files |
|
641 | 724 | manifest output the current or given revision of the project manifest |
|
642 | 725 | merge merge working directory with another revision |
|
643 | 726 | outgoing show changesets not found in the destination |
|
644 | 727 | parents show the parents of the working directory or revision |
|
645 | 728 | paths show aliases for remote repositories |
|
646 | 729 | phase set or show the current phase name |
|
647 | 730 | pull pull changes from the specified source |
|
648 | 731 | push push changes to the specified destination |
|
649 | 732 | recover roll back an interrupted transaction |
|
650 | 733 | remove remove the specified files on the next commit |
|
651 | 734 | rename rename files; equivalent of copy + remove |
|
652 | 735 | resolve redo merges or set/view the merge status of files |
|
653 | 736 | revert restore files to their checkout state |
|
654 | 737 | root print the root (top) of the current working directory |
|
655 | 738 | serve start stand-alone webserver |
|
656 | 739 | status show changed files in the working directory |
|
657 | 740 | summary summarize working directory state |
|
658 | 741 | tag add one or more tags for the current or given revision |
|
659 | 742 | tags list repository tags |
|
660 | 743 | unbundle apply one or more changegroup files |
|
661 | 744 | update update working directory (or switch revisions) |
|
662 | 745 | verify verify the integrity of the repository |
|
663 | 746 | version output version and copyright information |
|
664 | 747 |
|
|
665 | 748 | enabled extensions: |
|
666 | 749 |
|
|
667 | 750 | helpext (no help text available) |
|
668 | 751 |
|
|
669 | 752 | additional help topics: |
|
670 | 753 |
|
|
671 | 754 | config Configuration Files |
|
672 | 755 | dates Date Formats |
|
673 | 756 | diffs Diff Formats |
|
674 | 757 | environment Environment Variables |
|
675 | 758 | extensions Using Additional Features |
|
676 | 759 | filesets Specifying File Sets |
|
677 | 760 | glossary Glossary |
|
678 | 761 | hgignore Syntax for Mercurial Ignore Files |
|
679 | 762 | hgweb Configuring hgweb |
|
680 | 763 | merge-tools Merge Tools |
|
681 | 764 | multirevs Specifying Multiple Revisions |
|
682 | 765 | patterns File Name Patterns |
|
683 | 766 | phases Working with Phases |
|
684 | 767 | revisions Specifying Single Revisions |
|
685 | 768 | revsets Specifying Revision Sets |
|
686 | 769 | subrepos Subrepositories |
|
687 | 770 | templating Template Usage |
|
688 | 771 | urls URL Paths |
|
689 | 772 |
|
|
690 | 773 | use "hg -v help" to show builtin aliases and global options |
|
691 | 774 | |
|
692 | 775 | |
|
693 | 776 | |
|
694 | 777 | Test list of commands with command with no help text |
|
695 | 778 | |
|
696 | 779 | $ hg help helpext |
|
697 | 780 | helpext extension - no help text available |
|
698 | 781 |
|
|
699 | 782 | list of commands: |
|
700 | 783 |
|
|
701 | 784 | nohelp (no help text available) |
|
702 | 785 |
|
|
703 | 786 | use "hg -v help helpext" to show builtin aliases and global options |
|
704 | 787 | |
|
705 | 788 | Test a help topic |
|
706 | 789 | |
|
707 | 790 | $ hg help revs |
|
708 | 791 | Specifying Single Revisions |
|
709 | 792 | """"""""""""""""""""""""""" |
|
710 | 793 |
|
|
711 | 794 | Mercurial supports several ways to specify individual revisions. |
|
712 | 795 |
|
|
713 | 796 | A plain integer is treated as a revision number. Negative integers are |
|
714 | 797 | treated as sequential offsets from the tip, with -1 denoting the tip, -2 |
|
715 | 798 | denoting the revision prior to the tip, and so forth. |
|
716 | 799 |
|
|
717 | 800 | A 40-digit hexadecimal string is treated as a unique revision identifier. |
|
718 | 801 |
|
|
719 | 802 | A hexadecimal string less than 40 characters long is treated as a unique |
|
720 | 803 | revision identifier and is referred to as a short-form identifier. A |
|
721 | 804 | short-form identifier is only valid if it is the prefix of exactly one |
|
722 | 805 | full-length identifier. |
|
723 | 806 |
|
|
724 | 807 | Any other string is treated as a bookmark, tag, or branch name. A bookmark |
|
725 | 808 | is a movable pointer to a revision. A tag is a permanent name associated |
|
726 | 809 | with a revision. A branch name denotes the tipmost open branch head of |
|
727 | 810 | that branch - or if they are all closed, the tipmost closed head of the |
|
728 | 811 | branch. Bookmark, tag, and branch names must not contain the ":" |
|
729 | 812 | character. |
|
730 | 813 |
|
|
731 | 814 | The reserved name "tip" always identifies the most recent revision. |
|
732 | 815 |
|
|
733 | 816 | The reserved name "null" indicates the null revision. This is the revision |
|
734 | 817 | of an empty repository, and the parent of revision 0. |
|
735 | 818 |
|
|
736 | 819 | The reserved name "." indicates the working directory parent. If no |
|
737 | 820 | working directory is checked out, it is equivalent to null. If an |
|
738 | 821 | uncommitted merge is in progress, "." is the revision of the first parent. |
|
739 | 822 | |
|
740 | 823 | Test templating help |
|
741 | 824 | |
|
742 | 825 |
|
|
743 | 826 | desc String. The text of the changeset description. |
|
744 | 827 | diffstat String. Statistics of changes with the following format: |
|
745 | 828 | firstline Any text. Returns the first line of text. |
|
746 | 829 | nonempty Any text. Returns '(none)' if the string is empty. |
|
747 | 830 | |
|
748 | 831 | Test help hooks |
|
749 | 832 | |
|
750 | 833 | $ cat > helphook1.py <<EOF |
|
751 | 834 | > from mercurial import help |
|
752 | 835 | > |
|
753 | 836 | > def rewrite(topic, doc): |
|
754 | 837 | > return doc + '\nhelphook1\n' |
|
755 | 838 | > |
|
756 | 839 | > def extsetup(ui): |
|
757 | 840 | > help.addtopichook('revsets', rewrite) |
|
758 | 841 | > EOF |
|
759 | 842 | $ cat > helphook2.py <<EOF |
|
760 | 843 | > from mercurial import help |
|
761 | 844 | > |
|
762 | 845 | > def rewrite(topic, doc): |
|
763 | 846 | > return doc + '\nhelphook2\n' |
|
764 | 847 | > |
|
765 | 848 | > def extsetup(ui): |
|
766 | 849 | > help.addtopichook('revsets', rewrite) |
|
767 | 850 | > EOF |
|
768 | 851 | $ echo '[extensions]' >> $HGRCPATH |
|
769 | 852 | $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH |
|
770 | 853 | $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH |
|
771 | 854 | $ hg help revsets | grep helphook |
|
772 | 855 | helphook1 |
|
773 | 856 | helphook2 |
|
774 | 857 | |
|
775 | 858 | Test keyword search help |
|
776 | 859 | |
|
777 | 860 | $ cat > prefixedname.py <<EOF |
|
778 | 861 | > '''matched against word "clone" |
|
779 | 862 | > ''' |
|
780 | 863 | > EOF |
|
781 | 864 | $ echo '[extensions]' >> $HGRCPATH |
|
782 | 865 | $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH |
|
783 | 866 | $ hg help -k clone |
|
784 | 867 | Topics: |
|
785 | 868 |
|
|
786 | 869 | config Configuration Files |
|
787 | 870 | extensions Using Additional Features |
|
788 | 871 | glossary Glossary |
|
789 | 872 | phases Working with Phases |
|
790 | 873 | subrepos Subrepositories |
|
791 | 874 | urls URL Paths |
|
792 | 875 |
|
|
793 | 876 | Commands: |
|
794 | 877 |
|
|
795 | 878 | bookmarks track a line of development with movable markers |
|
796 | 879 | clone make a copy of an existing repository |
|
797 | 880 | paths show aliases for remote repositories |
|
798 | 881 | update update working directory (or switch revisions) |
|
799 | 882 |
|
|
800 | 883 | Extensions: |
|
801 | 884 |
|
|
802 | 885 | prefixedname matched against word "clone" |
|
803 | 886 | relink recreates hardlinks between repository clones |
|
804 | 887 |
|
|
805 | 888 | Extension Commands: |
|
806 | 889 |
|
|
807 | 890 | qclone clone main and patch repository at same time |
|
808 | 891 | |
|
809 | 892 | Test omit indicating for help |
|
810 | 893 | |
|
811 | 894 | $ cat > addverboseitems.py <<EOF |
|
812 | 895 | > '''extension to test omit indicating. |
|
813 | 896 | > |
|
814 | 897 | > This paragraph is never omitted (for extension) |
|
815 | 898 | > |
|
816 | 899 | > .. container:: verbose |
|
817 | 900 | > |
|
818 | 901 | > This paragraph is omitted, |
|
819 | 902 | > if :hg:\`help\` is invoked witout \`\`-v\`\` (for extension) |
|
820 | 903 | > |
|
821 | 904 | > This paragraph is never omitted, too (for extension) |
|
822 | 905 | > ''' |
|
823 | 906 | > |
|
824 | 907 | > from mercurial import help, commands |
|
825 | 908 | > testtopic = """This paragraph is never omitted (for topic). |
|
826 | 909 | > |
|
827 | 910 | > .. container:: verbose |
|
828 | 911 | > |
|
829 | 912 | > This paragraph is omitted, |
|
830 | 913 | > if :hg:\`help\` is invoked witout \`\`-v\`\` (for topic) |
|
831 | 914 | > |
|
832 | 915 | > This paragraph is never omitted, too (for topic) |
|
833 | 916 | > """ |
|
834 | 917 | > def extsetup(ui): |
|
835 | 918 | > help.helptable.append((["topic-containing-verbose"], |
|
836 | 919 | > "This is the topic to test omit indicating.", |
|
837 | 920 | > lambda : testtopic)) |
|
838 | 921 | > EOF |
|
839 | 922 | $ echo '[extensions]' >> $HGRCPATH |
|
840 | 923 | $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH |
|
841 | 924 | $ hg help addverboseitems |
|
842 | 925 | addverboseitems extension - extension to test omit indicating. |
|
843 | 926 |
|
|
844 | 927 | This paragraph is never omitted (for extension) |
|
845 | 928 |
|
|
846 | 929 | This paragraph is never omitted, too (for extension) |
|
847 | 930 |
|
|
848 | 931 | use "hg help -v addverboseitems" to show more complete help |
|
849 | 932 |
|
|
850 | 933 | no commands defined |
|
851 | 934 | $ hg help -v addverboseitems |
|
852 | 935 | addverboseitems extension - extension to test omit indicating. |
|
853 | 936 |
|
|
854 | 937 | This paragraph is never omitted (for extension) |
|
855 | 938 |
|
|
856 | 939 | This paragraph is omitted, if "hg help" is invoked witout "-v" (for extension) |
|
857 | 940 |
|
|
858 | 941 | This paragraph is never omitted, too (for extension) |
|
859 | 942 |
|
|
860 | 943 | no commands defined |
|
861 | 944 | $ hg help topic-containing-verbose |
|
862 | 945 | This is the topic to test omit indicating. |
|
863 | 946 | """""""""""""""""""""""""""""""""""""""""" |
|
864 | 947 |
|
|
865 | 948 | This paragraph is never omitted (for topic). |
|
866 | 949 |
|
|
867 | 950 | This paragraph is never omitted, too (for topic) |
|
868 | 951 |
|
|
869 | 952 | use "hg help -v topic-containing-verbose" to show more complete help |
|
870 | 953 | $ hg help -v topic-containing-verbose |
|
871 | 954 | This is the topic to test omit indicating. |
|
872 | 955 | """""""""""""""""""""""""""""""""""""""""" |
|
873 | 956 |
|
|
874 | 957 | This paragraph is never omitted (for topic). |
|
875 | 958 |
|
|
876 | 959 | This paragraph is omitted, if "hg help" is invoked witout "-v" (for topic) |
|
877 | 960 |
|
|
878 | 961 | This paragraph is never omitted, too (for topic) |
|
879 | 962 | |
|
880 | 963 | Test usage of section marks in help documents |
|
881 | 964 | |
|
882 | 965 | $ cd "$TESTDIR"/../doc |
|
883 | 966 | $ python check-seclevel.py |
|
884 | 967 | $ cd $TESTTMP |
|
885 | 968 | |
|
886 | 969 |
|
|
887 | 970 |
|
|
888 | 971 | Test the help pages in hgweb. |
|
889 | 972 | |
|
890 | 973 | Dish up an empty repo; serve it cold. |
|
891 | 974 | |
|
892 | 975 | $ hg init "$TESTTMP/test" |
|
893 | 976 | $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid |
|
894 | 977 | $ cat hg.pid >> $DAEMON_PIDS |
|
895 | 978 | |
|
896 | 979 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help" |
|
897 | 980 | 200 Script output follows |
|
898 | 981 |
|
|
899 | 982 |
|
|
900 | 983 |
|
|
901 | 984 |
|
|
902 | 985 |
|
|
903 | 986 |
|
|
904 | 987 |
|
|
905 | 988 |
|
|
906 | 989 |
|
|
907 | 990 |
|
|
908 | 991 |
|
|
909 | 992 |
|
|
910 | 993 |
|
|
911 | 994 |
|
|
912 | 995 |
|
|
913 | 996 |
|
|
914 | 997 |
|
|
915 | 998 |
|
|
916 | 999 |
|
|
917 | 1000 |
|
|
918 | 1001 |
|
|
919 | 1002 |
|
|
920 | 1003 |
|
|
921 | 1004 |
|
|
922 | 1005 |
|
|
923 | 1006 |
|
|
924 | 1007 |
|
|
925 | 1008 |
|
|
926 | 1009 |
|
|
927 | 1010 |
|
|
928 | 1011 |
|
|
929 | 1012 |
|
|
930 | 1013 |
|
|
931 | 1014 |
|
|
932 | 1015 |
|
|
933 | 1016 |
|
|
934 | 1017 |
|
|
935 | 1018 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
936 | 1019 |
|
|
937 | 1020 |
|
|
938 | 1021 |
|
|
939 | 1022 |
|
|
940 | 1023 |
|
|
941 | 1024 |
|
|
942 | 1025 | config |
|
943 | 1026 |
|
|
944 | 1027 |
|
|
945 | 1028 | Configuration Files |
|
946 | 1029 |
|
|
947 | 1030 |
|
|
948 | 1031 |
|
|
949 | 1032 | dates |
|
950 | 1033 |
|
|
951 | 1034 |
|
|
952 | 1035 | Date Formats |
|
953 | 1036 |
|
|
954 | 1037 |
|
|
955 | 1038 |
|
|
956 | 1039 | diffs |
|
957 | 1040 |
|
|
958 | 1041 |
|
|
959 | 1042 | Diff Formats |
|
960 | 1043 |
|
|
961 | 1044 |
|
|
962 | 1045 |
|
|
963 | 1046 | environment |
|
964 | 1047 |
|
|
965 | 1048 |
|
|
966 | 1049 | Environment Variables |
|
967 | 1050 |
|
|
968 | 1051 |
|
|
969 | 1052 |
|
|
970 | 1053 | extensions |
|
971 | 1054 |
|
|
972 | 1055 |
|
|
973 | 1056 | Using Additional Features |
|
974 | 1057 |
|
|
975 | 1058 |
|
|
976 | 1059 |
|
|
977 | 1060 | filesets |
|
978 | 1061 |
|
|
979 | 1062 |
|
|
980 | 1063 | Specifying File Sets |
|
981 | 1064 |
|
|
982 | 1065 |
|
|
983 | 1066 |
|
|
984 | 1067 | glossary |
|
985 | 1068 |
|
|
986 | 1069 |
|
|
987 | 1070 | Glossary |
|
988 | 1071 |
|
|
989 | 1072 |
|
|
990 | 1073 |
|
|
991 | 1074 | hgignore |
|
992 | 1075 |
|
|
993 | 1076 |
|
|
994 | 1077 | Syntax for Mercurial Ignore Files |
|
995 | 1078 |
|
|
996 | 1079 |
|
|
997 | 1080 |
|
|
998 | 1081 | hgweb |
|
999 | 1082 |
|
|
1000 | 1083 |
|
|
1001 | 1084 | Configuring hgweb |
|
1002 | 1085 |
|
|
1003 | 1086 |
|
|
1004 | 1087 |
|
|
1005 | 1088 | merge-tools |
|
1006 | 1089 |
|
|
1007 | 1090 |
|
|
1008 | 1091 | Merge Tools |
|
1009 | 1092 |
|
|
1010 | 1093 |
|
|
1011 | 1094 |
|
|
1012 | 1095 | multirevs |
|
1013 | 1096 |
|
|
1014 | 1097 |
|
|
1015 | 1098 | Specifying Multiple Revisions |
|
1016 | 1099 |
|
|
1017 | 1100 |
|
|
1018 | 1101 |
|
|
1019 | 1102 | patterns |
|
1020 | 1103 |
|
|
1021 | 1104 |
|
|
1022 | 1105 | File Name Patterns |
|
1023 | 1106 |
|
|
1024 | 1107 |
|
|
1025 | 1108 |
|
|
1026 | 1109 | phases |
|
1027 | 1110 |
|
|
1028 | 1111 |
|
|
1029 | 1112 | Working with Phases |
|
1030 | 1113 |
|
|
1031 | 1114 |
|
|
1032 | 1115 |
|
|
1033 | 1116 | revisions |
|
1034 | 1117 |
|
|
1035 | 1118 |
|
|
1036 | 1119 | Specifying Single Revisions |
|
1037 | 1120 |
|
|
1038 | 1121 |
|
|
1039 | 1122 |
|
|
1040 | 1123 | revsets |
|
1041 | 1124 |
|
|
1042 | 1125 |
|
|
1043 | 1126 | Specifying Revision Sets |
|
1044 | 1127 |
|
|
1045 | 1128 |
|
|
1046 | 1129 |
|
|
1047 | 1130 | subrepos |
|
1048 | 1131 |
|
|
1049 | 1132 |
|
|
1050 | 1133 | Subrepositories |
|
1051 | 1134 |
|
|
1052 | 1135 |
|
|
1053 | 1136 |
|
|
1054 | 1137 | templating |
|
1055 | 1138 |
|
|
1056 | 1139 |
|
|
1057 | 1140 | Template Usage |
|
1058 | 1141 |
|
|
1059 | 1142 |
|
|
1060 | 1143 |
|
|
1061 | 1144 | urls |
|
1062 | 1145 |
|
|
1063 | 1146 |
|
|
1064 | 1147 | URL Paths |
|
1065 | 1148 |
|
|
1066 | 1149 |
|
|
1067 | 1150 |
|
|
1068 | 1151 | topic-containing-verbose |
|
1069 | 1152 |
|
|
1070 | 1153 |
|
|
1071 | 1154 | This is the topic to test omit indicating. |
|
1072 | 1155 |
|
|
1073 | 1156 |
|
|
1074 | 1157 |
|
|
1075 | 1158 |
|
|
1076 | 1159 |
|
|
1077 | 1160 |
|
|
1078 | 1161 | add |
|
1079 | 1162 |
|
|
1080 | 1163 |
|
|
1081 | 1164 | add the specified files on the next commit |
|
1082 | 1165 |
|
|
1083 | 1166 |
|
|
1084 | 1167 |
|
|
1085 | 1168 | annotate |
|
1086 | 1169 |
|
|
1087 | 1170 |
|
|
1088 | 1171 | show changeset information by line for each file |
|
1089 | 1172 |
|
|
1090 | 1173 |
|
|
1091 | 1174 |
|
|
1092 | 1175 | clone |
|
1093 | 1176 |
|
|
1094 | 1177 |
|
|
1095 | 1178 | make a copy of an existing repository |
|
1096 | 1179 |
|
|
1097 | 1180 |
|
|
1098 | 1181 |
|
|
1099 | 1182 | commit |
|
1100 | 1183 |
|
|
1101 | 1184 |
|
|
1102 | 1185 | commit the specified files or all outstanding changes |
|
1103 | 1186 |
|
|
1104 | 1187 |
|
|
1105 | 1188 |
|
|
1106 | 1189 | diff |
|
1107 | 1190 |
|
|
1108 | 1191 |
|
|
1109 | 1192 | diff repository (or selected files) |
|
1110 | 1193 |
|
|
1111 | 1194 |
|
|
1112 | 1195 |
|
|
1113 | 1196 | export |
|
1114 | 1197 |
|
|
1115 | 1198 |
|
|
1116 | 1199 | dump the header and diffs for one or more changesets |
|
1117 | 1200 |
|
|
1118 | 1201 |
|
|
1119 | 1202 |
|
|
1120 | 1203 | forget |
|
1121 | 1204 |
|
|
1122 | 1205 |
|
|
1123 | 1206 | forget the specified files on the next commit |
|
1124 | 1207 |
|
|
1125 | 1208 |
|
|
1126 | 1209 |
|
|
1127 | 1210 | init |
|
1128 | 1211 |
|
|
1129 | 1212 |
|
|
1130 | 1213 | create a new repository in the given directory |
|
1131 | 1214 |
|
|
1132 | 1215 |
|
|
1133 | 1216 |
|
|
1134 | 1217 | log |
|
1135 | 1218 |
|
|
1136 | 1219 |
|
|
1137 | 1220 | show revision history of entire repository or files |
|
1138 | 1221 |
|
|
1139 | 1222 |
|
|
1140 | 1223 |
|
|
1141 | 1224 | merge |
|
1142 | 1225 |
|
|
1143 | 1226 |
|
|
1144 | 1227 | merge working directory with another revision |
|
1145 | 1228 |
|
|
1146 | 1229 |
|
|
1147 | 1230 |
|
|
1148 | 1231 | pull |
|
1149 | 1232 |
|
|
1150 | 1233 |
|
|
1151 | 1234 | pull changes from the specified source |
|
1152 | 1235 |
|
|
1153 | 1236 |
|
|
1154 | 1237 |
|
|
1155 | 1238 | push |
|
1156 | 1239 |
|
|
1157 | 1240 |
|
|
1158 | 1241 | push changes to the specified destination |
|
1159 | 1242 |
|
|
1160 | 1243 |
|
|
1161 | 1244 |
|
|
1162 | 1245 | remove |
|
1163 | 1246 |
|
|
1164 | 1247 |
|
|
1165 | 1248 | remove the specified files on the next commit |
|
1166 | 1249 |
|
|
1167 | 1250 |
|
|
1168 | 1251 |
|
|
1169 | 1252 | serve |
|
1170 | 1253 |
|
|
1171 | 1254 |
|
|
1172 | 1255 | start stand-alone webserver |
|
1173 | 1256 |
|
|
1174 | 1257 |
|
|
1175 | 1258 |
|
|
1176 | 1259 | status |
|
1177 | 1260 |
|
|
1178 | 1261 |
|
|
1179 | 1262 | show changed files in the working directory |
|
1180 | 1263 |
|
|
1181 | 1264 |
|
|
1182 | 1265 |
|
|
1183 | 1266 | summary |
|
1184 | 1267 |
|
|
1185 | 1268 |
|
|
1186 | 1269 | summarize working directory state |
|
1187 | 1270 |
|
|
1188 | 1271 |
|
|
1189 | 1272 |
|
|
1190 | 1273 | update |
|
1191 | 1274 |
|
|
1192 | 1275 |
|
|
1193 | 1276 | update working directory (or switch revisions) |
|
1194 | 1277 |
|
|
1195 | 1278 |
|
|
1196 | 1279 |
|
|
1197 | 1280 |
|
|
1198 | 1281 |
|
|
1199 | 1282 |
|
|
1200 | 1283 | addremove |
|
1201 | 1284 |
|
|
1202 | 1285 |
|
|
1203 | 1286 | add all new files, delete all missing files |
|
1204 | 1287 |
|
|
1205 | 1288 |
|
|
1206 | 1289 |
|
|
1207 | 1290 | archive |
|
1208 | 1291 |
|
|
1209 | 1292 |
|
|
1210 | 1293 | create an unversioned archive of a repository revision |
|
1211 | 1294 |
|
|
1212 | 1295 |
|
|
1213 | 1296 |
|
|
1214 | 1297 | backout |
|
1215 | 1298 |
|
|
1216 | 1299 |
|
|
1217 | 1300 | reverse effect of earlier changeset |
|
1218 | 1301 |
|
|
1219 | 1302 |
|
|
1220 | 1303 |
|
|
1221 | 1304 | bisect |
|
1222 | 1305 |
|
|
1223 | 1306 |
|
|
1224 | 1307 | subdivision search of changesets |
|
1225 | 1308 |
|
|
1226 | 1309 |
|
|
1227 | 1310 |
|
|
1228 | 1311 | bookmarks |
|
1229 | 1312 |
|
|
1230 | 1313 |
|
|
1231 | 1314 | track a line of development with movable markers |
|
1232 | 1315 |
|
|
1233 | 1316 |
|
|
1234 | 1317 |
|
|
1235 | 1318 | branch |
|
1236 | 1319 |
|
|
1237 | 1320 |
|
|
1238 | 1321 | set or show the current branch name |
|
1239 | 1322 |
|
|
1240 | 1323 |
|
|
1241 | 1324 |
|
|
1242 | 1325 | branches |
|
1243 | 1326 |
|
|
1244 | 1327 |
|
|
1245 | 1328 | list repository named branches |
|
1246 | 1329 |
|
|
1247 | 1330 |
|
|
1248 | 1331 |
|
|
1249 | 1332 | bundle |
|
1250 | 1333 |
|
|
1251 | 1334 |
|
|
1252 | 1335 | create a changegroup file |
|
1253 | 1336 |
|
|
1254 | 1337 |
|
|
1255 | 1338 |
|
|
1256 | 1339 | cat |
|
1257 | 1340 |
|
|
1258 | 1341 |
|
|
1259 | 1342 | output the current or given revision of files |
|
1260 | 1343 |
|
|
1261 | 1344 |
|
|
1262 | 1345 |
|
|
1263 | 1346 | config |
|
1264 | 1347 |
|
|
1265 | 1348 |
|
|
1266 | 1349 | show combined config settings from all hgrc files |
|
1267 | 1350 |
|
|
1268 | 1351 |
|
|
1269 | 1352 |
|
|
1270 | 1353 | copy |
|
1271 | 1354 |
|
|
1272 | 1355 |
|
|
1273 | 1356 | mark files as copied for the next commit |
|
1274 | 1357 |
|
|
1275 | 1358 |
|
|
1276 | 1359 |
|
|
1277 | 1360 | graft |
|
1278 | 1361 |
|
|
1279 | 1362 |
|
|
1280 | 1363 | copy changes from other branches onto the current branch |
|
1281 | 1364 |
|
|
1282 | 1365 |
|
|
1283 | 1366 |
|
|
1284 | 1367 | grep |
|
1285 | 1368 |
|
|
1286 | 1369 |
|
|
1287 | 1370 | search for a pattern in specified files and revisions |
|
1288 | 1371 |
|
|
1289 | 1372 |
|
|
1290 | 1373 |
|
|
1291 | 1374 | heads |
|
1292 | 1375 |
|
|
1293 | 1376 |
|
|
1294 | 1377 | show branch heads |
|
1295 | 1378 |
|
|
1296 | 1379 |
|
|
1297 | 1380 |
|
|
1298 | 1381 | help |
|
1299 | 1382 |
|
|
1300 | 1383 |
|
|
1301 | 1384 | show help for a given topic or a help overview |
|
1302 | 1385 |
|
|
1303 | 1386 |
|
|
1304 | 1387 |
|
|
1305 | 1388 | identify |
|
1306 | 1389 |
|
|
1307 | 1390 |
|
|
1308 | 1391 | identify the working copy or specified revision |
|
1309 | 1392 |
|
|
1310 | 1393 |
|
|
1311 | 1394 |
|
|
1312 | 1395 | import |
|
1313 | 1396 |
|
|
1314 | 1397 |
|
|
1315 | 1398 | import an ordered set of patches |
|
1316 | 1399 |
|
|
1317 | 1400 |
|
|
1318 | 1401 |
|
|
1319 | 1402 | incoming |
|
1320 | 1403 |
|
|
1321 | 1404 |
|
|
1322 | 1405 | show new changesets found in source |
|
1323 | 1406 |
|
|
1324 | 1407 |
|
|
1325 | 1408 |
|
|
1326 | 1409 | locate |
|
1327 | 1410 |
|
|
1328 | 1411 |
|
|
1329 | 1412 | locate files matching specific patterns |
|
1330 | 1413 |
|
|
1331 | 1414 |
|
|
1332 | 1415 |
|
|
1333 | 1416 | manifest |
|
1334 | 1417 |
|
|
1335 | 1418 |
|
|
1336 | 1419 | output the current or given revision of the project manifest |
|
1337 | 1420 |
|
|
1338 | 1421 |
|
|
1339 | 1422 |
|
|
1340 | 1423 | nohelp |
|
1341 | 1424 |
|
|
1342 | 1425 |
|
|
1343 | 1426 | (no help text available) |
|
1344 | 1427 |
|
|
1345 | 1428 |
|
|
1346 | 1429 |
|
|
1347 | 1430 | outgoing |
|
1348 | 1431 |
|
|
1349 | 1432 |
|
|
1350 | 1433 | show changesets not found in the destination |
|
1351 | 1434 |
|
|
1352 | 1435 |
|
|
1353 | 1436 |
|
|
1354 | 1437 | parents |
|
1355 | 1438 |
|
|
1356 | 1439 |
|
|
1357 | 1440 | show the parents of the working directory or revision |
|
1358 | 1441 |
|
|
1359 | 1442 |
|
|
1360 | 1443 |
|
|
1361 | 1444 | paths |
|
1362 | 1445 |
|
|
1363 | 1446 |
|
|
1364 | 1447 | show aliases for remote repositories |
|
1365 | 1448 |
|
|
1366 | 1449 |
|
|
1367 | 1450 |
|
|
1368 | 1451 | phase |
|
1369 | 1452 |
|
|
1370 | 1453 |
|
|
1371 | 1454 | set or show the current phase name |
|
1372 | 1455 |
|
|
1373 | 1456 |
|
|
1374 | 1457 |
|
|
1375 | 1458 | recover |
|
1376 | 1459 |
|
|
1377 | 1460 |
|
|
1378 | 1461 | roll back an interrupted transaction |
|
1379 | 1462 |
|
|
1380 | 1463 |
|
|
1381 | 1464 |
|
|
1382 | 1465 | rename |
|
1383 | 1466 |
|
|
1384 | 1467 |
|
|
1385 | 1468 | rename files; equivalent of copy + remove |
|
1386 | 1469 |
|
|
1387 | 1470 |
|
|
1388 | 1471 |
|
|
1389 | 1472 | resolve |
|
1390 | 1473 |
|
|
1391 | 1474 |
|
|
1392 | 1475 | redo merges or set/view the merge status of files |
|
1393 | 1476 |
|
|
1394 | 1477 |
|
|
1395 | 1478 |
|
|
1396 | 1479 | revert |
|
1397 | 1480 |
|
|
1398 | 1481 |
|
|
1399 | 1482 | restore files to their checkout state |
|
1400 | 1483 |
|
|
1401 | 1484 |
|
|
1402 | 1485 |
|
|
1403 | 1486 | root |
|
1404 | 1487 |
|
|
1405 | 1488 |
|
|
1406 | 1489 | print the root (top) of the current working directory |
|
1407 | 1490 |
|
|
1408 | 1491 |
|
|
1409 | 1492 |
|
|
1410 | 1493 | tag |
|
1411 | 1494 |
|
|
1412 | 1495 |
|
|
1413 | 1496 | add one or more tags for the current or given revision |
|
1414 | 1497 |
|
|
1415 | 1498 |
|
|
1416 | 1499 |
|
|
1417 | 1500 | tags |
|
1418 | 1501 |
|
|
1419 | 1502 |
|
|
1420 | 1503 | list repository tags |
|
1421 | 1504 |
|
|
1422 | 1505 |
|
|
1423 | 1506 |
|
|
1424 | 1507 | unbundle |
|
1425 | 1508 |
|
|
1426 | 1509 |
|
|
1427 | 1510 | apply one or more changegroup files |
|
1428 | 1511 |
|
|
1429 | 1512 |
|
|
1430 | 1513 |
|
|
1431 | 1514 | verify |
|
1432 | 1515 |
|
|
1433 | 1516 |
|
|
1434 | 1517 | verify the integrity of the repository |
|
1435 | 1518 |
|
|
1436 | 1519 |
|
|
1437 | 1520 |
|
|
1438 | 1521 | version |
|
1439 | 1522 |
|
|
1440 | 1523 |
|
|
1441 | 1524 | output version and copyright information |
|
1442 | 1525 |
|
|
1443 | 1526 |
|
|
1444 | 1527 |
|
|
1445 | 1528 |
|
|
1446 | 1529 |
|
|
1447 | 1530 |
|
|
1448 | 1531 |
|
|
1449 | 1532 |
|
|
1450 | 1533 |
|
|
1451 | 1534 |
|
|
1452 | 1535 |
|
|
1453 | 1536 | |
|
1454 | 1537 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/add" |
|
1455 | 1538 | 200 Script output follows |
|
1456 | 1539 |
|
|
1457 | 1540 |
|
|
1458 | 1541 |
|
|
1459 | 1542 |
|
|
1460 | 1543 |
|
|
1461 | 1544 |
|
|
1462 | 1545 |
|
|
1463 | 1546 |
|
|
1464 | 1547 |
|
|
1465 | 1548 |
|
|
1466 | 1549 |
|
|
1467 | 1550 |
|
|
1468 | 1551 |
|
|
1469 | 1552 |
|
|
1470 | 1553 |
|
|
1471 | 1554 |
|
|
1472 | 1555 |
|
|
1473 | 1556 |
|
|
1474 | 1557 |
|
|
1475 | 1558 |
|
|
1476 | 1559 |
|
|
1477 | 1560 |
|
|
1478 | 1561 |
|
|
1479 | 1562 |
|
|
1480 | 1563 |
|
|
1481 | 1564 |
|
|
1482 | 1565 |
|
|
1483 | 1566 |
|
|
1484 | 1567 |
|
|
1485 | 1568 |
|
|
1486 | 1569 |
|
|
1487 | 1570 |
|
|
1488 | 1571 |
|
|
1489 | 1572 |
|
|
1490 | 1573 |
|
|
1491 | 1574 |
|
|
1492 | 1575 |
|
|
1493 | 1576 |
|
|
1494 | 1577 |
|
|
1495 | 1578 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
1496 | 1579 |
|
|
1497 | 1580 |
|
|
1498 | 1581 |
|
|
1499 | 1582 | hg add [OPTION]... [FILE]... |
|
1500 | 1583 |
|
|
1501 | 1584 |
|
|
1502 | 1585 | add the specified files on the next commit |
|
1503 | 1586 |
|
|
1504 | 1587 |
|
|
1505 | 1588 | Schedule files to be version controlled and added to the |
|
1506 | 1589 | repository. |
|
1507 | 1590 |
|
|
1508 | 1591 |
|
|
1509 | 1592 | The files will be added to the repository at the next commit. To |
|
1510 | 1593 |
undo an add before that, see "hg forget". |
|
1511 | 1594 |
|
|
1512 | 1595 |
|
|
1513 | 1596 | If no names are given, add all files to the repository. |
|
1514 | 1597 |
|
|
1515 | 1598 |
|
|
1516 | 1599 | An example showing how new (unknown) files are added |
|
1517 | 1600 |
automatically by "hg add": |
|
1518 | 1601 |
|
|
1519 | 1602 |
|
|
1520 | 1603 | \$ ls (re) |
|
1521 | 1604 | foo.c |
|
1522 | 1605 | \$ hg status (re) |
|
1523 | 1606 | ? foo.c |
|
1524 | 1607 | \$ hg add (re) |
|
1525 | 1608 | adding foo.c |
|
1526 | 1609 | \$ hg status (re) |
|
1527 | 1610 | A foo.c |
|
1528 | 1611 |
|
|
1529 | 1612 |
|
|
1530 | 1613 | Returns 0 if all files are successfully added. |
|
1531 | 1614 |
|
|
1532 | 1615 |
|
|
1533 | 1616 | options: |
|
1534 | 1617 |
|
|
1535 | 1618 |
|
|
1536 | 1619 |
|
|
1537 | 1620 |
|
|
1538 | 1621 |
|
|
1539 | 1622 |
|
|
1540 | 1623 |
|
|
1541 | 1624 |
|
|
1542 | 1625 |
|
|
1543 | 1626 |
|
|
1544 | 1627 |
|
|
1545 | 1628 |
|
|
1546 | 1629 |
|
|
1547 | 1630 |
|
|
1548 | 1631 |
|
|
1549 | 1632 |
|
|
1550 | 1633 | [+] marked option can be specified multiple times |
|
1551 | 1634 |
|
|
1552 | 1635 |
|
|
1553 | 1636 | global options: |
|
1554 | 1637 |
|
|
1555 | 1638 |
|
|
1556 | 1639 |
|
|
1557 | 1640 |
|
|
1558 | 1641 |
|
|
1559 | 1642 |
|
|
1560 | 1643 |
|
|
1561 | 1644 |
|
|
1562 | 1645 |
|
|
1563 | 1646 |
|
|
1564 | 1647 |
|
|
1565 | 1648 |
|
|
1566 | 1649 |
|
|
1567 | 1650 |
|
|
1568 | 1651 |
|
|
1569 | 1652 |
|
|
1570 | 1653 |
|
|
1571 | 1654 |
|
|
1572 | 1655 |
|
|
1573 | 1656 |
|
|
1574 | 1657 |
|
|
1575 | 1658 |
|
|
1576 | 1659 |
|
|
1577 | 1660 |
|
|
1578 | 1661 |
|
|
1579 | 1662 |
|
|
1580 | 1663 |
|
|
1581 | 1664 |
|
|
1582 | 1665 |
|
|
1583 | 1666 |
|
|
1584 | 1667 |
|
|
1585 | 1668 |
|
|
1586 | 1669 |
|
|
1587 | 1670 |
|
|
1588 | 1671 |
|
|
1589 | 1672 |
|
|
1590 | 1673 |
|
|
1591 | 1674 |
|
|
1592 | 1675 |
|
|
1593 | 1676 |
|
|
1594 | 1677 |
|
|
1595 | 1678 |
|
|
1596 | 1679 |
|
|
1597 | 1680 |
|
|
1598 | 1681 |
|
|
1599 | 1682 |
|
|
1600 | 1683 |
|
|
1601 | 1684 |
|
|
1602 | 1685 |
|
|
1603 | 1686 |
|
|
1604 | 1687 |
|
|
1605 | 1688 |
|
|
1606 | 1689 | [+] marked option can be specified multiple times |
|
1607 | 1690 |
|
|
1608 | 1691 |
|
|
1609 | 1692 |
|
|
1610 | 1693 |
|
|
1611 | 1694 |
|
|
1612 | 1695 |
|
|
1613 | 1696 |
|
|
1614 | 1697 |
|
|
1615 | 1698 |
|
|
1616 | 1699 |
|
|
1617 | 1700 |
|
|
1618 | 1701 |
|
|
1619 | 1702 | |
|
1620 | 1703 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/remove" |
|
1621 | 1704 | 200 Script output follows |
|
1622 | 1705 |
|
|
1623 | 1706 |
|
|
1624 | 1707 |
|
|
1625 | 1708 |
|
|
1626 | 1709 |
|
|
1627 | 1710 |
|
|
1628 | 1711 |
|
|
1629 | 1712 |
|
|
1630 | 1713 |
|
|
1631 | 1714 |
|
|
1632 | 1715 |
|
|
1633 | 1716 |
|
|
1634 | 1717 |
|
|
1635 | 1718 |
|
|
1636 | 1719 |
|
|
1637 | 1720 |
|
|
1638 | 1721 |
|
|
1639 | 1722 |
|
|
1640 | 1723 |
|
|
1641 | 1724 |
|
|
1642 | 1725 |
|
|
1643 | 1726 |
|
|
1644 | 1727 |
|
|
1645 | 1728 |
|
|
1646 | 1729 |
|
|
1647 | 1730 |
|
|
1648 | 1731 |
|
|
1649 | 1732 |
|
|
1650 | 1733 |
|
|
1651 | 1734 |
|
|
1652 | 1735 |
|
|
1653 | 1736 |
|
|
1654 | 1737 |
|
|
1655 | 1738 |
|
|
1656 | 1739 |
|
|
1657 | 1740 |
|
|
1658 | 1741 |
|
|
1659 | 1742 |
|
|
1660 | 1743 |
|
|
1661 | 1744 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
1662 | 1745 |
|
|
1663 | 1746 |
|
|
1664 | 1747 |
|
|
1665 | 1748 | hg remove [OPTION]... FILE... |
|
1666 | 1749 |
|
|
1667 | 1750 |
|
|
1668 | 1751 | aliases: rm |
|
1669 | 1752 |
|
|
1670 | 1753 |
|
|
1671 | 1754 | remove the specified files on the next commit |
|
1672 | 1755 |
|
|
1673 | 1756 |
|
|
1674 | 1757 | Schedule the indicated files for removal from the current branch. |
|
1675 | 1758 |
|
|
1676 | 1759 |
|
|
1677 | 1760 | This command schedules the files to be removed at the next commit. |
|
1678 | 1761 | To undo a remove before that, see "hg revert". To undo added |
|
1679 | 1762 |
files, see "hg forget". |
|
1680 | 1763 |
|
|
1681 | 1764 |
|
|
1682 | 1765 | -A/--after can be used to remove only files that have already |
|
1683 | 1766 | been deleted, -f/--force can be used to force deletion, and -Af |
|
1684 | 1767 | can be used to remove files from the next revision without |
|
1685 | 1768 | deleting them from the working directory. |
|
1686 | 1769 |
|
|
1687 | 1770 |
|
|
1688 | 1771 | The following table details the behavior of remove for different |
|
1689 | 1772 | file states (columns) and option combinations (rows). The file |
|
1690 | 1773 | states are Added [A], Clean [C], Modified [M] and Missing [!] |
|
1691 | 1774 | (as reported by "hg status"). The actions are Warn, Remove |
|
1692 | 1775 | (from branch) and Delete (from disk): |
|
1693 | 1776 |
|
|
1694 | 1777 |
|
|
1695 | 1778 |
|
|
1696 | 1779 |
|
|
1697 | 1780 |
|
|
1698 | 1781 |
|
|
1699 | 1782 |
|
|
1700 | 1783 |
|
|
1701 | 1784 |
|
|
1702 | 1785 |
|
|
1703 | 1786 |
|
|
1704 | 1787 |
|
|
1705 | 1788 |
|
|
1706 | 1789 |
|
|
1707 | 1790 |
|
|
1708 | 1791 |
|
|
1709 | 1792 |
|
|
1710 | 1793 |
|
|
1711 | 1794 |
|
|
1712 | 1795 |
|
|
1713 | 1796 |
|
|
1714 | 1797 |
|
|
1715 | 1798 |
|
|
1716 | 1799 |
|
|
1717 | 1800 |
|
|
1718 | 1801 |
|
|
1719 | 1802 |
|
|
1720 | 1803 |
|
|
1721 | 1804 |
|
|
1722 | 1805 | Note that remove never deletes files in Added [A] state from the |
|
1723 | 1806 | working directory, not even if option --force is specified. |
|
1724 | 1807 |
|
|
1725 | 1808 |
|
|
1726 | 1809 | Returns 0 on success, 1 if any warnings encountered. |
|
1727 | 1810 |
|
|
1728 | 1811 |
|
|
1729 | 1812 | options: |
|
1730 | 1813 |
|
|
1731 | 1814 |
|
|
1732 | 1815 |
|
|
1733 | 1816 |
|
|
1734 | 1817 |
|
|
1735 | 1818 |
|
|
1736 | 1819 |
|
|
1737 | 1820 |
|
|
1738 | 1821 |
|
|
1739 | 1822 |
|
|
1740 | 1823 |
|
|
1741 | 1824 |
|
|
1742 | 1825 |
|
|
1743 | 1826 |
|
|
1744 | 1827 |
|
|
1745 | 1828 |
|
|
1746 | 1829 | [+] marked option can be specified multiple times |
|
1747 | 1830 |
|
|
1748 | 1831 |
|
|
1749 | 1832 | global options: |
|
1750 | 1833 |
|
|
1751 | 1834 |
|
|
1752 | 1835 |
|
|
1753 | 1836 |
|
|
1754 | 1837 |
|
|
1755 | 1838 |
|
|
1756 | 1839 |
|
|
1757 | 1840 |
|
|
1758 | 1841 |
|
|
1759 | 1842 |
|
|
1760 | 1843 |
|
|
1761 | 1844 |
|
|
1762 | 1845 |
|
|
1763 | 1846 |
|
|
1764 | 1847 |
|
|
1765 | 1848 |
|
|
1766 | 1849 |
|
|
1767 | 1850 |
|
|
1768 | 1851 |
|
|
1769 | 1852 |
|
|
1770 | 1853 |
|
|
1771 | 1854 |
|
|
1772 | 1855 |
|
|
1773 | 1856 |
|
|
1774 | 1857 |
|
|
1775 | 1858 |
|
|
1776 | 1859 |
|
|
1777 | 1860 |
|
|
1778 | 1861 |
|
|
1779 | 1862 |
|
|
1780 | 1863 |
|
|
1781 | 1864 |
|
|
1782 | 1865 |
|
|
1783 | 1866 |
|
|
1784 | 1867 |
|
|
1785 | 1868 |
|
|
1786 | 1869 |
|
|
1787 | 1870 |
|
|
1788 | 1871 |
|
|
1789 | 1872 |
|
|
1790 | 1873 |
|
|
1791 | 1874 |
|
|
1792 | 1875 |
|
|
1793 | 1876 |
|
|
1794 | 1877 |
|
|
1795 | 1878 |
|
|
1796 | 1879 |
|
|
1797 | 1880 |
|
|
1798 | 1881 |
|
|
1799 | 1882 |
|
|
1800 | 1883 |
|
|
1801 | 1884 |
|
|
1802 | 1885 | [+] marked option can be specified multiple times |
|
1803 | 1886 |
|
|
1804 | 1887 |
|
|
1805 | 1888 |
|
|
1806 | 1889 |
|
|
1807 | 1890 |
|
|
1808 | 1891 |
|
|
1809 | 1892 |
|
|
1810 | 1893 |
|
|
1811 | 1894 |
|
|
1812 | 1895 |
|
|
1813 | 1896 |
|
|
1814 | 1897 |
|
|
1815 | 1898 | |
|
1816 | 1899 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help/revisions" |
|
1817 | 1900 | 200 Script output follows |
|
1818 | 1901 |
|
|
1819 | 1902 |
|
|
1820 | 1903 |
|
|
1821 | 1904 |
|
|
1822 | 1905 |
|
|
1823 | 1906 |
|
|
1824 | 1907 |
|
|
1825 | 1908 |
|
|
1826 | 1909 |
|
|
1827 | 1910 |
|
|
1828 | 1911 |
|
|
1829 | 1912 |
|
|
1830 | 1913 |
|
|
1831 | 1914 |
|
|
1832 | 1915 |
|
|
1833 | 1916 |
|
|
1834 | 1917 |
|
|
1835 | 1918 |
|
|
1836 | 1919 |
|
|
1837 | 1920 |
|
|
1838 | 1921 |
|
|
1839 | 1922 |
|
|
1840 | 1923 |
|
|
1841 | 1924 |
|
|
1842 | 1925 |
|
|
1843 | 1926 |
|
|
1844 | 1927 |
|
|
1845 | 1928 |
|
|
1846 | 1929 |
|
|
1847 | 1930 |
|
|
1848 | 1931 |
|
|
1849 | 1932 |
|
|
1850 | 1933 |
|
|
1851 | 1934 |
|
|
1852 | 1935 |
|
|
1853 | 1936 |
|
|
1854 | 1937 |
|
|
1855 | 1938 |
|
|
1856 | 1939 |
|
|
1857 | 1940 | number or hash, or <a href="/help/revsets">revset expression</a>.</div> |
|
1858 | 1941 |
|
|
1859 | 1942 |
|
|
1860 | 1943 |
|
|
1861 | 1944 |
|
|
1862 | 1945 | Mercurial supports several ways to specify individual revisions. |
|
1863 | 1946 |
|
|
1864 | 1947 |
|
|
1865 | 1948 | A plain integer is treated as a revision number. Negative integers are |
|
1866 | 1949 | treated as sequential offsets from the tip, with -1 denoting the tip, |
|
1867 | 1950 | -2 denoting the revision prior to the tip, and so forth. |
|
1868 | 1951 |
|
|
1869 | 1952 |
|
|
1870 | 1953 | A 40-digit hexadecimal string is treated as a unique revision |
|
1871 | 1954 | identifier. |
|
1872 | 1955 |
|
|
1873 | 1956 |
|
|
1874 | 1957 | A hexadecimal string less than 40 characters long is treated as a |
|
1875 | 1958 | unique revision identifier and is referred to as a short-form |
|
1876 | 1959 | identifier. A short-form identifier is only valid if it is the prefix |
|
1877 | 1960 | of exactly one full-length identifier. |
|
1878 | 1961 |
|
|
1879 | 1962 |
|
|
1880 | 1963 | Any other string is treated as a bookmark, tag, or branch name. A |
|
1881 | 1964 | bookmark is a movable pointer to a revision. A tag is a permanent name |
|
1882 | 1965 | associated with a revision. A branch name denotes the tipmost open branch head |
|
1883 | 1966 | of that branch - or if they are all closed, the tipmost closed head of the |
|
1884 | 1967 | branch. Bookmark, tag, and branch names must not contain the ":" character. |
|
1885 | 1968 |
|
|
1886 | 1969 |
|
|
1887 | 1970 | The reserved name "tip" always identifies the most recent revision. |
|
1888 | 1971 |
|
|
1889 | 1972 |
|
|
1890 | 1973 | The reserved name "null" indicates the null revision. This is the |
|
1891 | 1974 | revision of an empty repository, and the parent of revision 0. |
|
1892 | 1975 |
|
|
1893 | 1976 |
|
|
1894 | 1977 | The reserved name "." indicates the working directory parent. If no |
|
1895 | 1978 | working directory is checked out, it is equivalent to null. If an |
|
1896 | 1979 | uncommitted merge is in progress, "." is the revision of the first |
|
1897 | 1980 | parent. |
|
1898 | 1981 |
|
|
1899 | 1982 |
|
|
1900 | 1983 |
|
|
1901 | 1984 |
|
|
1902 | 1985 |
|
|
1903 | 1986 |
|
|
1904 | 1987 |
|
|
1905 | 1988 |
|
|
1906 | 1989 |
|
|
1907 | 1990 |
|
|
1908 | 1991 |
|
|
1909 | 1992 |
|
|
1910 | 1993 | |
|
1911 | 1994 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
1912 | 1995 | |
|
1913 | 1996 |
|
General Comments 0
You need to be logged in to leave comments.
Login now