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