##// END OF EJS Templates
help: include parens in DEPRECATED/EXPERIMENTAL keywords...
Yuya Nishihara -
r26370:44cc9f63 default
parent child Browse files
Show More
@@ -1,450 +1,450 b''
1 1 # convert.py Foreign SCM converter
2 2 #
3 3 # Copyright 2005-2007 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 '''import revisions from foreign VCS repositories into Mercurial'''
9 9
10 10 import convcmd
11 11 import cvsps
12 12 import subversion
13 13 from mercurial import cmdutil, templatekw
14 14 from mercurial.i18n import _
15 15
16 16 cmdtable = {}
17 17 command = cmdutil.command(cmdtable)
18 18 # Note for extension authors: ONLY specify testedwith = 'internal' for
19 19 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
20 20 # be specifying the version(s) of Mercurial they are tested with, or
21 21 # leave the attribute unspecified.
22 22 testedwith = 'internal'
23 23
24 24 # Commands definition was moved elsewhere to ease demandload job.
25 25
26 26 @command('convert',
27 27 [('', 'authors', '',
28 _('username mapping filename (DEPRECATED, use --authormap instead)'),
28 _('username mapping filename (DEPRECATED) (use --authormap instead)'),
29 29 _('FILE')),
30 30 ('s', 'source-type', '', _('source repository type'), _('TYPE')),
31 31 ('d', 'dest-type', '', _('destination repository type'), _('TYPE')),
32 32 ('r', 'rev', [], _('import up to source revision REV'), _('REV')),
33 33 ('A', 'authormap', '', _('remap usernames using this file'), _('FILE')),
34 34 ('', 'filemap', '', _('remap file names using contents of file'),
35 35 _('FILE')),
36 36 ('', 'full', None,
37 37 _('apply filemap changes by converting all files again')),
38 38 ('', 'splicemap', '', _('splice synthesized history into place'),
39 39 _('FILE')),
40 40 ('', 'branchmap', '', _('change branch names while converting'),
41 41 _('FILE')),
42 42 ('', 'branchsort', None, _('try to sort changesets by branches')),
43 43 ('', 'datesort', None, _('try to sort changesets by date')),
44 44 ('', 'sourcesort', None, _('preserve source changesets order')),
45 45 ('', 'closesort', None, _('try to reorder closed revisions'))],
46 46 _('hg convert [OPTION]... SOURCE [DEST [REVMAP]]'),
47 47 norepo=True)
48 48 def convert(ui, src, dest=None, revmapfile=None, **opts):
49 49 """convert a foreign SCM repository to a Mercurial one.
50 50
51 51 Accepted source formats [identifiers]:
52 52
53 53 - Mercurial [hg]
54 54 - CVS [cvs]
55 55 - Darcs [darcs]
56 56 - git [git]
57 57 - Subversion [svn]
58 58 - Monotone [mtn]
59 59 - GNU Arch [gnuarch]
60 60 - Bazaar [bzr]
61 61 - Perforce [p4]
62 62
63 63 Accepted destination formats [identifiers]:
64 64
65 65 - Mercurial [hg]
66 66 - Subversion [svn] (history on branches is not preserved)
67 67
68 68 If no revision is given, all revisions will be converted.
69 69 Otherwise, convert will only import up to the named revision
70 70 (given in a format understood by the source).
71 71
72 72 If no destination directory name is specified, it defaults to the
73 73 basename of the source with ``-hg`` appended. If the destination
74 74 repository doesn't exist, it will be created.
75 75
76 76 By default, all sources except Mercurial will use --branchsort.
77 77 Mercurial uses --sourcesort to preserve original revision numbers
78 78 order. Sort modes have the following effects:
79 79
80 80 --branchsort convert from parent to child revision when possible,
81 81 which means branches are usually converted one after
82 82 the other. It generates more compact repositories.
83 83
84 84 --datesort sort revisions by date. Converted repositories have
85 85 good-looking changelogs but are often an order of
86 86 magnitude larger than the same ones generated by
87 87 --branchsort.
88 88
89 89 --sourcesort try to preserve source revisions order, only
90 90 supported by Mercurial sources.
91 91
92 92 --closesort try to move closed revisions as close as possible
93 93 to parent branches, only supported by Mercurial
94 94 sources.
95 95
96 96 If ``REVMAP`` isn't given, it will be put in a default location
97 97 (``<dest>/.hg/shamap`` by default). The ``REVMAP`` is a simple
98 98 text file that maps each source commit ID to the destination ID
99 99 for that revision, like so::
100 100
101 101 <source ID> <destination ID>
102 102
103 103 If the file doesn't exist, it's automatically created. It's
104 104 updated on each commit copied, so :hg:`convert` can be interrupted
105 105 and can be run repeatedly to copy new commits.
106 106
107 107 The authormap is a simple text file that maps each source commit
108 108 author to a destination commit author. It is handy for source SCMs
109 109 that use unix logins to identify authors (e.g.: CVS). One line per
110 110 author mapping and the line format is::
111 111
112 112 source author = destination author
113 113
114 114 Empty lines and lines starting with a ``#`` are ignored.
115 115
116 116 The filemap is a file that allows filtering and remapping of files
117 117 and directories. Each line can contain one of the following
118 118 directives::
119 119
120 120 include path/to/file-or-dir
121 121
122 122 exclude path/to/file-or-dir
123 123
124 124 rename path/to/source path/to/destination
125 125
126 126 Comment lines start with ``#``. A specified path matches if it
127 127 equals the full relative name of a file or one of its parent
128 128 directories. The ``include`` or ``exclude`` directive with the
129 129 longest matching path applies, so line order does not matter.
130 130
131 131 The ``include`` directive causes a file, or all files under a
132 132 directory, to be included in the destination repository. The default
133 133 if there are no ``include`` statements is to include everything.
134 134 If there are any ``include`` statements, nothing else is included.
135 135 The ``exclude`` directive causes files or directories to
136 136 be omitted. The ``rename`` directive renames a file or directory if
137 137 it is converted. To rename from a subdirectory into the root of
138 138 the repository, use ``.`` as the path to rename to.
139 139
140 140 ``--full`` will make sure the converted changesets contain exactly
141 141 the right files with the right content. It will make a full
142 142 conversion of all files, not just the ones that have
143 143 changed. Files that already are correct will not be changed. This
144 144 can be used to apply filemap changes when converting
145 145 incrementally. This is currently only supported for Mercurial and
146 146 Subversion.
147 147
148 148 The splicemap is a file that allows insertion of synthetic
149 149 history, letting you specify the parents of a revision. This is
150 150 useful if you want to e.g. give a Subversion merge two parents, or
151 151 graft two disconnected series of history together. Each entry
152 152 contains a key, followed by a space, followed by one or two
153 153 comma-separated values::
154 154
155 155 key parent1, parent2
156 156
157 157 The key is the revision ID in the source
158 158 revision control system whose parents should be modified (same
159 159 format as a key in .hg/shamap). The values are the revision IDs
160 160 (in either the source or destination revision control system) that
161 161 should be used as the new parents for that node. For example, if
162 162 you have merged "release-1.0" into "trunk", then you should
163 163 specify the revision on "trunk" as the first parent and the one on
164 164 the "release-1.0" branch as the second.
165 165
166 166 The branchmap is a file that allows you to rename a branch when it is
167 167 being brought in from whatever external repository. When used in
168 168 conjunction with a splicemap, it allows for a powerful combination
169 169 to help fix even the most badly mismanaged repositories and turn them
170 170 into nicely structured Mercurial repositories. The branchmap contains
171 171 lines of the form::
172 172
173 173 original_branch_name new_branch_name
174 174
175 175 where "original_branch_name" is the name of the branch in the
176 176 source repository, and "new_branch_name" is the name of the branch
177 177 is the destination repository. No whitespace is allowed in the
178 178 branch names. This can be used to (for instance) move code in one
179 179 repository from "default" to a named branch.
180 180
181 181 Mercurial Source
182 182 ################
183 183
184 184 The Mercurial source recognizes the following configuration
185 185 options, which you can set on the command line with ``--config``:
186 186
187 187 :convert.hg.ignoreerrors: ignore integrity errors when reading.
188 188 Use it to fix Mercurial repositories with missing revlogs, by
189 189 converting from and to Mercurial. Default is False.
190 190
191 191 :convert.hg.saverev: store original revision ID in changeset
192 192 (forces target IDs to change). It takes a boolean argument and
193 193 defaults to False.
194 194
195 195 :convert.hg.startrev: specify the initial Mercurial revision.
196 196 The default is 0.
197 197
198 198 :convert.hg.revs: revset specifying the source revisions to convert.
199 199
200 200 CVS Source
201 201 ##########
202 202
203 203 CVS source will use a sandbox (i.e. a checked-out copy) from CVS
204 204 to indicate the starting point of what will be converted. Direct
205 205 access to the repository files is not needed, unless of course the
206 206 repository is ``:local:``. The conversion uses the top level
207 207 directory in the sandbox to find the CVS repository, and then uses
208 208 CVS rlog commands to find files to convert. This means that unless
209 209 a filemap is given, all files under the starting directory will be
210 210 converted, and that any directory reorganization in the CVS
211 211 sandbox is ignored.
212 212
213 213 The following options can be used with ``--config``:
214 214
215 215 :convert.cvsps.cache: Set to False to disable remote log caching,
216 216 for testing and debugging purposes. Default is True.
217 217
218 218 :convert.cvsps.fuzz: Specify the maximum time (in seconds) that is
219 219 allowed between commits with identical user and log message in
220 220 a single changeset. When very large files were checked in as
221 221 part of a changeset then the default may not be long enough.
222 222 The default is 60.
223 223
224 224 :convert.cvsps.mergeto: Specify a regular expression to which
225 225 commit log messages are matched. If a match occurs, then the
226 226 conversion process will insert a dummy revision merging the
227 227 branch on which this log message occurs to the branch
228 228 indicated in the regex. Default is ``{{mergetobranch
229 229 ([-\\w]+)}}``
230 230
231 231 :convert.cvsps.mergefrom: Specify a regular expression to which
232 232 commit log messages are matched. If a match occurs, then the
233 233 conversion process will add the most recent revision on the
234 234 branch indicated in the regex as the second parent of the
235 235 changeset. Default is ``{{mergefrombranch ([-\\w]+)}}``
236 236
237 237 :convert.localtimezone: use local time (as determined by the TZ
238 238 environment variable) for changeset date/times. The default
239 239 is False (use UTC).
240 240
241 241 :hooks.cvslog: Specify a Python function to be called at the end of
242 242 gathering the CVS log. The function is passed a list with the
243 243 log entries, and can modify the entries in-place, or add or
244 244 delete them.
245 245
246 246 :hooks.cvschangesets: Specify a Python function to be called after
247 247 the changesets are calculated from the CVS log. The
248 248 function is passed a list with the changeset entries, and can
249 249 modify the changesets in-place, or add or delete them.
250 250
251 251 An additional "debugcvsps" Mercurial command allows the builtin
252 252 changeset merging code to be run without doing a conversion. Its
253 253 parameters and output are similar to that of cvsps 2.1. Please see
254 254 the command help for more details.
255 255
256 256 Subversion Source
257 257 #################
258 258
259 259 Subversion source detects classical trunk/branches/tags layouts.
260 260 By default, the supplied ``svn://repo/path/`` source URL is
261 261 converted as a single branch. If ``svn://repo/path/trunk`` exists
262 262 it replaces the default branch. If ``svn://repo/path/branches``
263 263 exists, its subdirectories are listed as possible branches. If
264 264 ``svn://repo/path/tags`` exists, it is looked for tags referencing
265 265 converted branches. Default ``trunk``, ``branches`` and ``tags``
266 266 values can be overridden with following options. Set them to paths
267 267 relative to the source URL, or leave them blank to disable auto
268 268 detection.
269 269
270 270 The following options can be set with ``--config``:
271 271
272 272 :convert.svn.branches: specify the directory containing branches.
273 273 The default is ``branches``.
274 274
275 275 :convert.svn.tags: specify the directory containing tags. The
276 276 default is ``tags``.
277 277
278 278 :convert.svn.trunk: specify the name of the trunk branch. The
279 279 default is ``trunk``.
280 280
281 281 :convert.localtimezone: use local time (as determined by the TZ
282 282 environment variable) for changeset date/times. The default
283 283 is False (use UTC).
284 284
285 285 Source history can be retrieved starting at a specific revision,
286 286 instead of being integrally converted. Only single branch
287 287 conversions are supported.
288 288
289 289 :convert.svn.startrev: specify start Subversion revision number.
290 290 The default is 0.
291 291
292 292 Git Source
293 293 ##########
294 294
295 295 The Git importer converts commits from all reachable branches (refs
296 296 in refs/heads) and remotes (refs in refs/remotes) to Mercurial.
297 297 Branches are converted to bookmarks with the same name, with the
298 298 leading 'refs/heads' stripped. Git submodules are converted to Git
299 299 subrepos in Mercurial.
300 300
301 301 The following options can be set with ``--config``:
302 302
303 303 :convert.git.similarity: specify how similar files modified in a
304 304 commit must be to be imported as renames or copies, as a
305 305 percentage between ``0`` (disabled) and ``100`` (files must be
306 306 identical). For example, ``90`` means that a delete/add pair will
307 307 be imported as a rename if more than 90% of the file hasn't
308 308 changed. The default is ``50``.
309 309
310 310 :convert.git.findcopiesharder: while detecting copies, look at all
311 311 files in the working copy instead of just changed ones. This
312 312 is very expensive for large projects, and is only effective when
313 313 ``convert.git.similarity`` is greater than 0. The default is False.
314 314
315 315 :convert.git.remoteprefix: remote refs are converted as bookmarks with
316 316 ``convert.git.remoteprefix`` as a prefix followed by a /. The default
317 317 is 'remote'.
318 318
319 319 :convert.git.skipsubmodules: does not convert root level .gitmodules files
320 320 or files with 160000 mode indicating a submodule. Default is False.
321 321
322 322 Perforce Source
323 323 ###############
324 324
325 325 The Perforce (P4) importer can be given a p4 depot path or a
326 326 client specification as source. It will convert all files in the
327 327 source to a flat Mercurial repository, ignoring labels, branches
328 328 and integrations. Note that when a depot path is given you then
329 329 usually should specify a target directory, because otherwise the
330 330 target may be named ``...-hg``.
331 331
332 332 The following options can be set with ``--config``:
333 333
334 334 :convert.p4.encoding: specify the encoding to use when decoding standard
335 335 output of the Perforce command line tool. The default is default system
336 336 encoding.
337 337
338 338 :convert.p4.startrev: specify initial Perforce revision (a
339 339 Perforce changelist number).
340 340
341 341 Mercurial Destination
342 342 #####################
343 343
344 344 The Mercurial destination will recognize Mercurial subrepositories in the
345 345 destination directory, and update the .hgsubstate file automatically if the
346 346 destination subrepositories contain the <dest>/<sub>/.hg/shamap file.
347 347 Converting a repository with subrepositories requires converting a single
348 348 repository at a time, from the bottom up.
349 349
350 350 .. container:: verbose
351 351
352 352 An example showing how to convert a repository with subrepositories::
353 353
354 354 # so convert knows the type when it sees a non empty destination
355 355 $ hg init converted
356 356
357 357 $ hg convert orig/sub1 converted/sub1
358 358 $ hg convert orig/sub2 converted/sub2
359 359 $ hg convert orig converted
360 360
361 361 The following options are supported:
362 362
363 363 :convert.hg.clonebranches: dispatch source branches in separate
364 364 clones. The default is False.
365 365
366 366 :convert.hg.tagsbranch: branch name for tag revisions, defaults to
367 367 ``default``.
368 368
369 369 :convert.hg.usebranchnames: preserve branch names. The default is
370 370 True.
371 371
372 372 :convert.hg.sourcename: records the given string as a 'convert_source' extra
373 373 value on each commit made in the target repository. The default is None.
374 374
375 375 All Destinations
376 376 ################
377 377
378 378 All destination types accept the following options:
379 379
380 380 :convert.skiptags: does not convert tags from the source repo to the target
381 381 repo. The default is False.
382 382 """
383 383 return convcmd.convert(ui, src, dest, revmapfile, **opts)
384 384
385 385 @command('debugsvnlog', [], 'hg debugsvnlog', norepo=True)
386 386 def debugsvnlog(ui, **opts):
387 387 return subversion.debugsvnlog(ui, **opts)
388 388
389 389 @command('debugcvsps',
390 390 [
391 391 # Main options shared with cvsps-2.1
392 392 ('b', 'branches', [], _('only return changes on specified branches')),
393 393 ('p', 'prefix', '', _('prefix to remove from file names')),
394 394 ('r', 'revisions', [],
395 395 _('only return changes after or between specified tags')),
396 396 ('u', 'update-cache', None, _("update cvs log cache")),
397 397 ('x', 'new-cache', None, _("create new cvs log cache")),
398 398 ('z', 'fuzz', 60, _('set commit time fuzz in seconds')),
399 399 ('', 'root', '', _('specify cvsroot')),
400 400 # Options specific to builtin cvsps
401 401 ('', 'parents', '', _('show parent changesets')),
402 402 ('', 'ancestors', '', _('show current changeset in ancestor branches')),
403 403 # Options that are ignored for compatibility with cvsps-2.1
404 404 ('A', 'cvs-direct', None, _('ignored for compatibility')),
405 405 ],
406 406 _('hg debugcvsps [OPTION]... [PATH]...'),
407 407 norepo=True)
408 408 def debugcvsps(ui, *args, **opts):
409 409 '''create changeset information from CVS
410 410
411 411 This command is intended as a debugging tool for the CVS to
412 412 Mercurial converter, and can be used as a direct replacement for
413 413 cvsps.
414 414
415 415 Hg debugcvsps reads the CVS rlog for current directory (or any
416 416 named directory) in the CVS repository, and converts the log to a
417 417 series of changesets based on matching commit log entries and
418 418 dates.'''
419 419 return cvsps.debugcvsps(ui, *args, **opts)
420 420
421 421 def kwconverted(ctx, name):
422 422 rev = ctx.extra().get('convert_revision', '')
423 423 if rev.startswith('svn:'):
424 424 if name == 'svnrev':
425 425 return str(subversion.revsplit(rev)[2])
426 426 elif name == 'svnpath':
427 427 return subversion.revsplit(rev)[1]
428 428 elif name == 'svnuuid':
429 429 return subversion.revsplit(rev)[0]
430 430 return rev
431 431
432 432 def kwsvnrev(repo, ctx, **args):
433 433 """:svnrev: String. Converted subversion revision number."""
434 434 return kwconverted(ctx, 'svnrev')
435 435
436 436 def kwsvnpath(repo, ctx, **args):
437 437 """:svnpath: String. Converted subversion revision project path."""
438 438 return kwconverted(ctx, 'svnpath')
439 439
440 440 def kwsvnuuid(repo, ctx, **args):
441 441 """:svnuuid: String. Converted subversion revision repository identifier."""
442 442 return kwconverted(ctx, 'svnuuid')
443 443
444 444 def extsetup(ui):
445 445 templatekw.keywords['svnrev'] = kwsvnrev
446 446 templatekw.keywords['svnpath'] = kwsvnpath
447 447 templatekw.keywords['svnuuid'] = kwsvnuuid
448 448
449 449 # tell hggettext to extract docstrings from these functions:
450 450 i18nfunctions = [kwsvnrev, kwsvnpath, kwsvnuuid]
@@ -1,532 +1,534 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, os, textwrap
10 10 import error
11 11 import extensions, revset, fileset, templatekw, templatefilters, filemerge
12 12 import templater
13 13 import encoding, util, minirst
14 14 import cmdutil
15 15 import hgweb.webcommands as webcommands
16 16
17 17 _exclkeywords = [
18 "DEPRECATED",
19 "EXPERIMENTAL",
20 _("DEPRECATED"),
21 _("EXPERIMENTAL"),
18 "(DEPRECATED)",
19 "(EXPERIMENTAL)",
20 # i18n: "(DEPRECATED)" is a keyword, must be translated consistently
21 _("(DEPRECATED)"),
22 # i18n: "(EXPERIMENTAL)" is a keyword, must be translated consistently
23 _("(EXPERIMENTAL)"),
22 24 ]
23 25
24 26 def listexts(header, exts, indent=1, showdeprecated=False):
25 27 '''return a text listing of the given extensions'''
26 28 rst = []
27 29 if exts:
28 30 rst.append('\n%s\n\n' % header)
29 31 for name, desc in sorted(exts.iteritems()):
30 32 if '(DEPRECATED)' in desc and not showdeprecated:
31 33 continue
32 34 rst.append('%s:%s: %s\n' % (' ' * indent, name, desc))
33 35 return rst
34 36
35 37 def extshelp():
36 38 rst = loaddoc('extensions')().splitlines(True)
37 39 rst.extend(listexts(
38 40 _('enabled extensions:'), extensions.enabled(), showdeprecated=True))
39 41 rst.extend(listexts(_('disabled extensions:'), extensions.disabled()))
40 42 doc = ''.join(rst)
41 43 return doc
42 44
43 45 def optrst(header, options, verbose):
44 46 data = []
45 47 multioccur = False
46 48 for option in options:
47 49 if len(option) == 5:
48 50 shortopt, longopt, default, desc, optlabel = option
49 51 else:
50 52 shortopt, longopt, default, desc = option
51 53 optlabel = _("VALUE") # default label
52 54
53 55 if not verbose and any(w in desc for w in _exclkeywords):
54 56 continue
55 57
56 58 so = ''
57 59 if shortopt:
58 60 so = '-' + shortopt
59 61 lo = '--' + longopt
60 62 if default:
61 63 desc += _(" (default: %s)") % default
62 64
63 65 if isinstance(default, list):
64 66 lo += " %s [+]" % optlabel
65 67 multioccur = True
66 68 elif (default is not None) and not isinstance(default, bool):
67 69 lo += " %s" % optlabel
68 70
69 71 data.append((so, lo, desc))
70 72
71 73 if multioccur:
72 74 header += (_(" ([+] can be repeated)"))
73 75
74 76 rst = ['\n%s:\n\n' % header]
75 77 rst.extend(minirst.maketable(data, 1))
76 78
77 79 return ''.join(rst)
78 80
79 81 def indicateomitted(rst, omitted, notomitted=None):
80 82 rst.append('\n\n.. container:: omitted\n\n %s\n\n' % omitted)
81 83 if notomitted:
82 84 rst.append('\n\n.. container:: notomitted\n\n %s\n\n' % notomitted)
83 85
84 86 def topicmatch(kw):
85 87 """Return help topics matching kw.
86 88
87 89 Returns {'section': [(name, summary), ...], ...} where section is
88 90 one of topics, commands, extensions, or extensioncommands.
89 91 """
90 92 kw = encoding.lower(kw)
91 93 def lowercontains(container):
92 94 return kw in encoding.lower(container) # translated in helptable
93 95 results = {'topics': [],
94 96 'commands': [],
95 97 'extensions': [],
96 98 'extensioncommands': [],
97 99 }
98 100 for names, header, doc in helptable:
99 101 # Old extensions may use a str as doc.
100 102 if (sum(map(lowercontains, names))
101 103 or lowercontains(header)
102 104 or (callable(doc) and lowercontains(doc()))):
103 105 results['topics'].append((names[0], header))
104 106 import commands # avoid cycle
105 107 for cmd, entry in commands.table.iteritems():
106 108 if len(entry) == 3:
107 109 summary = entry[2]
108 110 else:
109 111 summary = ''
110 112 # translate docs *before* searching there
111 113 docs = _(getattr(entry[0], '__doc__', None)) or ''
112 114 if kw in cmd or lowercontains(summary) or lowercontains(docs):
113 115 doclines = docs.splitlines()
114 116 if doclines:
115 117 summary = doclines[0]
116 118 cmdname = cmd.split('|')[0].lstrip('^')
117 119 results['commands'].append((cmdname, summary))
118 120 for name, docs in itertools.chain(
119 121 extensions.enabled(False).iteritems(),
120 122 extensions.disabled().iteritems()):
121 123 # extensions.load ignores the UI argument
122 124 mod = extensions.load(None, name, '')
123 125 name = name.split('.')[-1]
124 126 if lowercontains(name) or lowercontains(docs):
125 127 # extension docs are already translated
126 128 results['extensions'].append((name, docs.splitlines()[0]))
127 129 for cmd, entry in getattr(mod, 'cmdtable', {}).iteritems():
128 130 if kw in cmd or (len(entry) > 2 and lowercontains(entry[2])):
129 131 cmdname = cmd.split('|')[0].lstrip('^')
130 132 if entry[0].__doc__:
131 133 cmddoc = gettext(entry[0].__doc__).splitlines()[0]
132 134 else:
133 135 cmddoc = _('(no help text available)')
134 136 results['extensioncommands'].append((cmdname, cmddoc))
135 137 return results
136 138
137 139 def loaddoc(topic):
138 140 """Return a delayed loader for help/topic.txt."""
139 141
140 142 def loader():
141 143 docdir = os.path.join(util.datapath, 'help')
142 144 path = os.path.join(docdir, topic + ".txt")
143 145 doc = gettext(util.readfile(path))
144 146 for rewriter in helphooks.get(topic, []):
145 147 doc = rewriter(topic, doc)
146 148 return doc
147 149
148 150 return loader
149 151
150 152 helptable = sorted([
151 153 (["config", "hgrc"], _("Configuration Files"), loaddoc('config')),
152 154 (["dates"], _("Date Formats"), loaddoc('dates')),
153 155 (["patterns"], _("File Name Patterns"), loaddoc('patterns')),
154 156 (['environment', 'env'], _('Environment Variables'),
155 157 loaddoc('environment')),
156 158 (['revisions', 'revs'], _('Specifying Single Revisions'),
157 159 loaddoc('revisions')),
158 160 (['multirevs', 'mrevs'], _('Specifying Multiple Revisions'),
159 161 loaddoc('multirevs')),
160 162 (['revsets', 'revset'], _("Specifying Revision Sets"), loaddoc('revsets')),
161 163 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets')),
162 164 (['diffs'], _('Diff Formats'), loaddoc('diffs')),
163 165 (['merge-tools', 'mergetools'], _('Merge Tools'), loaddoc('merge-tools')),
164 166 (['templating', 'templates', 'template', 'style'], _('Template Usage'),
165 167 loaddoc('templates')),
166 168 (['urls'], _('URL Paths'), loaddoc('urls')),
167 169 (["extensions"], _("Using Additional Features"), extshelp),
168 170 (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos')),
169 171 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')),
170 172 (["glossary"], _("Glossary"), loaddoc('glossary')),
171 173 (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"),
172 174 loaddoc('hgignore')),
173 175 (["phases"], _("Working with Phases"), loaddoc('phases')),
174 176 (['scripting'], _('Using Mercurial from scripts and automation'),
175 177 loaddoc('scripting')),
176 178 ])
177 179
178 180 # Map topics to lists of callable taking the current topic help and
179 181 # returning the updated version
180 182 helphooks = {}
181 183
182 184 def addtopichook(topic, rewriter):
183 185 helphooks.setdefault(topic, []).append(rewriter)
184 186
185 187 def makeitemsdoc(topic, doc, marker, items, dedent=False):
186 188 """Extract docstring from the items key to function mapping, build a
187 189 single documentation block and use it to overwrite the marker in doc.
188 190 """
189 191 entries = []
190 192 for name in sorted(items):
191 193 text = (items[name].__doc__ or '').rstrip()
192 194 if not text:
193 195 continue
194 196 text = gettext(text)
195 197 if dedent:
196 198 text = textwrap.dedent(text)
197 199 lines = text.splitlines()
198 200 doclines = [(lines[0])]
199 201 for l in lines[1:]:
200 202 # Stop once we find some Python doctest
201 203 if l.strip().startswith('>>>'):
202 204 break
203 205 if dedent:
204 206 doclines.append(l.rstrip())
205 207 else:
206 208 doclines.append(' ' + l.strip())
207 209 entries.append('\n'.join(doclines))
208 210 entries = '\n\n'.join(entries)
209 211 return doc.replace(marker, entries)
210 212
211 213 def addtopicsymbols(topic, marker, symbols, dedent=False):
212 214 def add(topic, doc):
213 215 return makeitemsdoc(topic, doc, marker, symbols, dedent=dedent)
214 216 addtopichook(topic, add)
215 217
216 218 addtopicsymbols('filesets', '.. predicatesmarker', fileset.symbols)
217 219 addtopicsymbols('merge-tools', '.. internaltoolsmarker',
218 220 filemerge.internalsdoc)
219 221 addtopicsymbols('revsets', '.. predicatesmarker', revset.symbols)
220 222 addtopicsymbols('templates', '.. keywordsmarker', templatekw.dockeywords)
221 223 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
222 224 addtopicsymbols('templates', '.. functionsmarker', templater.funcs)
223 225 addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands,
224 226 dedent=True)
225 227
226 228 def help_(ui, name, unknowncmd=False, full=True, **opts):
227 229 '''
228 230 Generate the help for 'name' as unformatted restructured text. If
229 231 'name' is None, describe the commands available.
230 232 '''
231 233
232 234 import commands # avoid cycle
233 235
234 236 def helpcmd(name):
235 237 try:
236 238 aliases, entry = cmdutil.findcmd(name, commands.table,
237 239 strict=unknowncmd)
238 240 except error.AmbiguousCommand as inst:
239 241 # py3k fix: except vars can't be used outside the scope of the
240 242 # except block, nor can be used inside a lambda. python issue4617
241 243 prefix = inst.args[0]
242 244 select = lambda c: c.lstrip('^').startswith(prefix)
243 245 rst = helplist(select)
244 246 return rst
245 247
246 248 rst = []
247 249
248 250 # check if it's an invalid alias and display its error if it is
249 251 if getattr(entry[0], 'badalias', None):
250 252 rst.append(entry[0].badalias + '\n')
251 253 if entry[0].unknowncmd:
252 254 try:
253 255 rst.extend(helpextcmd(entry[0].cmdname))
254 256 except error.UnknownCommand:
255 257 pass
256 258 return rst
257 259
258 260 # synopsis
259 261 if len(entry) > 2:
260 262 if entry[2].startswith('hg'):
261 263 rst.append("%s\n" % entry[2])
262 264 else:
263 265 rst.append('hg %s %s\n' % (aliases[0], entry[2]))
264 266 else:
265 267 rst.append('hg %s\n' % aliases[0])
266 268 # aliases
267 269 if full and not ui.quiet and len(aliases) > 1:
268 270 rst.append(_("\naliases: %s\n") % ', '.join(aliases[1:]))
269 271 rst.append('\n')
270 272
271 273 # description
272 274 doc = gettext(entry[0].__doc__)
273 275 if not doc:
274 276 doc = _("(no help text available)")
275 277 if util.safehasattr(entry[0], 'definition'): # aliased command
276 278 if entry[0].definition.startswith('!'): # shell alias
277 279 doc = _('shell alias for::\n\n %s') % entry[0].definition[1:]
278 280 else:
279 281 doc = _('alias for: hg %s\n\n%s') % (entry[0].definition, doc)
280 282 doc = doc.splitlines(True)
281 283 if ui.quiet or not full:
282 284 rst.append(doc[0])
283 285 else:
284 286 rst.extend(doc)
285 287 rst.append('\n')
286 288
287 289 # check if this command shadows a non-trivial (multi-line)
288 290 # extension help text
289 291 try:
290 292 mod = extensions.find(name)
291 293 doc = gettext(mod.__doc__) or ''
292 294 if '\n' in doc.strip():
293 295 msg = _('(use "hg help -e %s" to show help for '
294 296 'the %s extension)') % (name, name)
295 297 rst.append('\n%s\n' % msg)
296 298 except KeyError:
297 299 pass
298 300
299 301 # options
300 302 if not ui.quiet and entry[1]:
301 303 rst.append(optrst(_("options"), entry[1], ui.verbose))
302 304
303 305 if ui.verbose:
304 306 rst.append(optrst(_("global options"),
305 307 commands.globalopts, ui.verbose))
306 308
307 309 if not ui.verbose:
308 310 if not full:
309 311 rst.append(_('\n(use "hg %s -h" to show more help)\n')
310 312 % name)
311 313 elif not ui.quiet:
312 314 rst.append(_('\n(some details hidden, use --verbose '
313 315 'to show complete help)'))
314 316
315 317 return rst
316 318
317 319
318 320 def helplist(select=None):
319 321 # list of commands
320 322 if name == "shortlist":
321 323 header = _('basic commands:\n\n')
322 324 elif name == "debug":
323 325 header = _('debug commands (internal and unsupported):\n\n')
324 326 else:
325 327 header = _('list of commands:\n\n')
326 328
327 329 h = {}
328 330 cmds = {}
329 331 for c, e in commands.table.iteritems():
330 332 f = c.split("|", 1)[0]
331 333 if select and not select(f):
332 334 continue
333 335 if (not select and name != 'shortlist' and
334 336 e[0].__module__ != commands.__name__):
335 337 continue
336 338 if name == "shortlist" and not f.startswith("^"):
337 339 continue
338 340 f = f.lstrip("^")
339 341 if not ui.debugflag and f.startswith("debug") and name != "debug":
340 342 continue
341 343 doc = e[0].__doc__
342 if doc and 'DEPRECATED' in doc and not ui.verbose:
344 if doc and '(DEPRECATED)' in doc and not ui.verbose:
343 345 continue
344 346 doc = gettext(doc)
345 347 if not doc:
346 348 doc = _("(no help text available)")
347 349 h[f] = doc.splitlines()[0].rstrip()
348 350 cmds[f] = c.lstrip("^")
349 351
350 352 rst = []
351 353 if not h:
352 354 if not ui.quiet:
353 355 rst.append(_('no commands defined\n'))
354 356 return rst
355 357
356 358 if not ui.quiet:
357 359 rst.append(header)
358 360 fns = sorted(h)
359 361 for f in fns:
360 362 if ui.verbose:
361 363 commacmds = cmds[f].replace("|",", ")
362 364 rst.append(" :%s: %s\n" % (commacmds, h[f]))
363 365 else:
364 366 rst.append(' :%s: %s\n' % (f, h[f]))
365 367
366 368 if not name:
367 369 exts = listexts(_('enabled extensions:'), extensions.enabled())
368 370 if exts:
369 371 rst.append('\n')
370 372 rst.extend(exts)
371 373
372 374 rst.append(_("\nadditional help topics:\n\n"))
373 375 topics = []
374 376 for names, header, doc in helptable:
375 377 topics.append((names[0], header))
376 378 for t, desc in topics:
377 379 rst.append(" :%s: %s\n" % (t, desc))
378 380
379 381 if ui.quiet:
380 382 pass
381 383 elif ui.verbose:
382 384 rst.append('\n%s\n' % optrst(_("global options"),
383 385 commands.globalopts, ui.verbose))
384 386 if name == 'shortlist':
385 387 rst.append(_('\n(use "hg help" for the full list '
386 388 'of commands)\n'))
387 389 else:
388 390 if name == 'shortlist':
389 391 rst.append(_('\n(use "hg help" for the full list of commands '
390 392 'or "hg -v" for details)\n'))
391 393 elif name and not full:
392 394 rst.append(_('\n(use "hg help %s" to show the full help '
393 395 'text)\n') % name)
394 396 elif name and cmds and name in cmds.keys():
395 397 rst.append(_('\n(use "hg help -v -e %s" to show built-in '
396 398 'aliases and global options)\n') % name)
397 399 else:
398 400 rst.append(_('\n(use "hg help -v%s" to show built-in aliases '
399 401 'and global options)\n')
400 402 % (name and " " + name or ""))
401 403 return rst
402 404
403 405 def helptopic(name):
404 406 for names, header, doc in helptable:
405 407 if name in names:
406 408 break
407 409 else:
408 410 raise error.UnknownCommand(name)
409 411
410 412 rst = [minirst.section(header)]
411 413
412 414 # description
413 415 if not doc:
414 416 rst.append(" %s\n" % _("(no help text available)"))
415 417 if callable(doc):
416 418 rst += [" %s\n" % l for l in doc().splitlines()]
417 419
418 420 if not ui.verbose:
419 421 omitted = _('(some details hidden, use --verbose'
420 422 ' to show complete help)')
421 423 indicateomitted(rst, omitted)
422 424
423 425 try:
424 426 cmdutil.findcmd(name, commands.table)
425 427 rst.append(_('\nuse "hg help -c %s" to see help for '
426 428 'the %s command\n') % (name, name))
427 429 except error.UnknownCommand:
428 430 pass
429 431 return rst
430 432
431 433 def helpext(name):
432 434 try:
433 435 mod = extensions.find(name)
434 436 doc = gettext(mod.__doc__) or _('no help text available')
435 437 except KeyError:
436 438 mod = None
437 439 doc = extensions.disabledext(name)
438 440 if not doc:
439 441 raise error.UnknownCommand(name)
440 442
441 443 if '\n' not in doc:
442 444 head, tail = doc, ""
443 445 else:
444 446 head, tail = doc.split('\n', 1)
445 447 rst = [_('%s extension - %s\n\n') % (name.split('.')[-1], head)]
446 448 if tail:
447 449 rst.extend(tail.splitlines(True))
448 450 rst.append('\n')
449 451
450 452 if not ui.verbose:
451 453 omitted = _('(some details hidden, use --verbose'
452 454 ' to show complete help)')
453 455 indicateomitted(rst, omitted)
454 456
455 457 if mod:
456 458 try:
457 459 ct = mod.cmdtable
458 460 except AttributeError:
459 461 ct = {}
460 462 modcmds = set([c.split('|', 1)[0] for c in ct])
461 463 rst.extend(helplist(modcmds.__contains__))
462 464 else:
463 465 rst.append(_('(use "hg help extensions" for information on enabling'
464 466 ' extensions)\n'))
465 467 return rst
466 468
467 469 def helpextcmd(name):
468 470 cmd, ext, mod = extensions.disabledcmd(ui, name,
469 471 ui.configbool('ui', 'strict'))
470 472 doc = gettext(mod.__doc__).splitlines()[0]
471 473
472 474 rst = listexts(_("'%s' is provided by the following "
473 475 "extension:") % cmd, {ext: doc}, indent=4)
474 476 rst.append('\n')
475 477 rst.append(_('(use "hg help extensions" for information on enabling '
476 478 'extensions)\n'))
477 479 return rst
478 480
479 481
480 482 rst = []
481 483 kw = opts.get('keyword')
482 484 if kw:
483 485 matches = topicmatch(name)
484 486 helpareas = []
485 487 if opts.get('extension'):
486 488 helpareas += [('extensions', _('Extensions'))]
487 489 if opts.get('command'):
488 490 helpareas += [('commands', _('Commands'))]
489 491 if not helpareas:
490 492 helpareas = [('topics', _('Topics')),
491 493 ('commands', _('Commands')),
492 494 ('extensions', _('Extensions')),
493 495 ('extensioncommands', _('Extension Commands'))]
494 496 for t, title in helpareas:
495 497 if matches[t]:
496 498 rst.append('%s:\n\n' % title)
497 499 rst.extend(minirst.maketable(sorted(matches[t]), 1))
498 500 rst.append('\n')
499 501 if not rst:
500 502 msg = _('no matches')
501 503 hint = _('try "hg help" for a list of topics')
502 504 raise util.Abort(msg, hint=hint)
503 505 elif name and name != 'shortlist':
504 506 queries = []
505 507 if unknowncmd:
506 508 queries += [helpextcmd]
507 509 if opts.get('extension'):
508 510 queries += [helpext]
509 511 if opts.get('command'):
510 512 queries += [helpcmd]
511 513 if not queries:
512 514 queries = (helptopic, helpcmd, helpext, helpextcmd)
513 515 for f in queries:
514 516 try:
515 517 rst = f(name)
516 518 break
517 519 except error.UnknownCommand:
518 520 pass
519 521 else:
520 522 if unknowncmd:
521 523 raise error.UnknownCommand(name)
522 524 else:
523 525 msg = _('no such help topic: %s') % name
524 526 hint = _('try "hg help --keyword %s"') % name
525 527 raise util.Abort(msg, hint=hint)
526 528 else:
527 529 # program name
528 530 if not ui.quiet:
529 531 rst = [_("Mercurial Distributed SCM\n"), '\n']
530 532 rst.extend(helplist())
531 533
532 534 return ''.join(rst)
@@ -1,2364 +1,2364 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 another revision into working directory
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 another revision into working directory
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 create a new bookmark or list existing bookmarks
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 files list tracked files
70 70 forget forget the specified files on the next commit
71 71 graft copy changes from other branches onto the current branch
72 72 grep search for a pattern in specified files and revisions
73 73 heads show branch heads
74 74 help show help for a given topic or a help overview
75 75 identify identify the working directory or specified revision
76 76 import import an ordered set of patches
77 77 incoming show new changesets found in source
78 78 init create a new repository in the given directory
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 another revision into working directory
82 82 outgoing show changesets not found in the destination
83 83 paths show aliases for remote repositories
84 84 phase set or show the current phase name
85 85 pull pull changes from the specified source
86 86 push push changes to the specified destination
87 87 recover roll back an interrupted transaction
88 88 remove remove the specified files on the next commit
89 89 rename rename files; equivalent of copy + remove
90 90 resolve redo merges or set/view the merge status of files
91 91 revert restore files to their checkout state
92 92 root print the root (top) of the current working directory
93 93 serve start stand-alone webserver
94 94 status show changed files in the working directory
95 95 summary summarize working directory state
96 96 tag add one or more tags for the current or given revision
97 97 tags list repository tags
98 98 unbundle apply one or more changegroup files
99 99 update update working directory (or switch revisions)
100 100 verify verify the integrity of the repository
101 101 version output version and copyright information
102 102
103 103 additional help topics:
104 104
105 105 config Configuration Files
106 106 dates Date Formats
107 107 diffs Diff Formats
108 108 environment Environment Variables
109 109 extensions Using Additional Features
110 110 filesets Specifying File Sets
111 111 glossary Glossary
112 112 hgignore Syntax for Mercurial Ignore Files
113 113 hgweb Configuring hgweb
114 114 merge-tools Merge Tools
115 115 multirevs Specifying Multiple Revisions
116 116 patterns File Name Patterns
117 117 phases Working with Phases
118 118 revisions Specifying Single Revisions
119 119 revsets Specifying Revision Sets
120 120 scripting Using Mercurial from scripts and automation
121 121 subrepos Subrepositories
122 122 templating Template Usage
123 123 urls URL Paths
124 124
125 125 (use "hg help -v" to show built-in 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 create a new bookmark or list existing bookmarks
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 files list tracked files
146 146 forget forget the specified files on the next commit
147 147 graft copy changes from other branches onto the current branch
148 148 grep search for a pattern in specified files and revisions
149 149 heads show branch heads
150 150 help show help for a given topic or a help overview
151 151 identify identify the working directory or specified revision
152 152 import import an ordered set of patches
153 153 incoming show new changesets found in source
154 154 init create a new repository in the given directory
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 another revision into working directory
158 158 outgoing show changesets not found in the destination
159 159 paths show aliases for remote repositories
160 160 phase set or show the current phase name
161 161 pull pull changes from the specified source
162 162 push push changes to the specified destination
163 163 recover roll back an interrupted transaction
164 164 remove remove the specified files on the next commit
165 165 rename rename files; equivalent of copy + remove
166 166 resolve redo merges or set/view the merge status of files
167 167 revert restore files to their checkout state
168 168 root print the root (top) of the current working directory
169 169 serve start stand-alone webserver
170 170 status show changed files in the working directory
171 171 summary summarize working directory state
172 172 tag add one or more tags for the current or given revision
173 173 tags list repository tags
174 174 unbundle apply one or more changegroup files
175 175 update update working directory (or switch revisions)
176 176 verify verify the integrity of the repository
177 177 version output version and copyright information
178 178
179 179 additional help topics:
180 180
181 181 config Configuration Files
182 182 dates Date Formats
183 183 diffs Diff Formats
184 184 environment Environment Variables
185 185 extensions Using Additional Features
186 186 filesets Specifying File Sets
187 187 glossary Glossary
188 188 hgignore Syntax for Mercurial Ignore Files
189 189 hgweb Configuring hgweb
190 190 merge-tools Merge Tools
191 191 multirevs Specifying Multiple Revisions
192 192 patterns File Name Patterns
193 193 phases Working with Phases
194 194 revisions Specifying Single Revisions
195 195 revsets Specifying Revision Sets
196 196 scripting Using Mercurial from scripts and automation
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 censor erase file content at a given revision
251 251 churn command to display statistics about repository history
252 252 color colorize output from some commands
253 253 convert import revisions from foreign VCS repositories into
254 254 Mercurial
255 255 eol automatically manage newlines in repository files
256 256 extdiff command to allow external programs to compare revisions
257 257 factotum http authentication with factotum
258 258 gpg commands to sign and verify changesets
259 259 hgcia hooks for integrating with the CIA.vc notification service
260 260 hgk browse the repository in a graphical way
261 261 highlight syntax highlighting for hgweb (requires Pygments)
262 262 histedit interactive history editing
263 263 keyword expand keywords in tracked files
264 264 largefiles track large binary files
265 265 mq manage a stack of patches
266 266 notify hooks for sending email push notifications
267 267 pager browse command output with an external pager
268 268 patchbomb command to send changesets as (a series of) patch emails
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 descendants 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 another revision into working directory
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 ([+] can be repeated):
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 (use "hg help" for the full list of commands)
330 330
331 331 $ hg add -h
332 332 hg add [OPTION]... [FILE]...
333 333
334 334 add the specified files on the next commit
335 335
336 336 Schedule files to be version controlled and added to the repository.
337 337
338 338 The files will be added to the repository at the next commit. To undo an
339 339 add before that, see "hg forget".
340 340
341 341 If no names are given, add all files to the repository.
342 342
343 343 Returns 0 if all files are successfully added.
344 344
345 345 options ([+] can be repeated):
346 346
347 347 -I --include PATTERN [+] include names matching the given patterns
348 348 -X --exclude PATTERN [+] exclude names matching the given patterns
349 349 -S --subrepos recurse into subrepositories
350 350 -n --dry-run do not perform actions, just print output
351 351
352 352 (some details hidden, use --verbose to show complete help)
353 353
354 354 Verbose help for add
355 355
356 356 $ hg add -hv
357 357 hg add [OPTION]... [FILE]...
358 358
359 359 add the specified files on the next commit
360 360
361 361 Schedule files to be version controlled and added to the repository.
362 362
363 363 The files will be added to the repository at the next commit. To undo an
364 364 add before that, see "hg forget".
365 365
366 366 If no names are given, add all files to the repository.
367 367
368 368 An example showing how new (unknown) files are added automatically by "hg
369 369 add":
370 370
371 371 $ ls
372 372 foo.c
373 373 $ hg status
374 374 ? foo.c
375 375 $ hg add
376 376 adding foo.c
377 377 $ hg status
378 378 A foo.c
379 379
380 380 Returns 0 if all files are successfully added.
381 381
382 382 options ([+] can be repeated):
383 383
384 384 -I --include PATTERN [+] include names matching the given patterns
385 385 -X --exclude PATTERN [+] exclude names matching the given patterns
386 386 -S --subrepos recurse into subrepositories
387 387 -n --dry-run do not perform actions, just print output
388 388
389 389 global options ([+] can be repeated):
390 390
391 391 -R --repository REPO repository root directory or name of overlay bundle
392 392 file
393 393 --cwd DIR change working directory
394 394 -y --noninteractive do not prompt, automatically pick the first choice for
395 395 all prompts
396 396 -q --quiet suppress output
397 397 -v --verbose enable additional output
398 398 --config CONFIG [+] set/override config option (use 'section.name=value')
399 399 --debug enable debugging output
400 400 --debugger start debugger
401 401 --encoding ENCODE set the charset encoding (default: ascii)
402 402 --encodingmode MODE set the charset encoding mode (default: strict)
403 403 --traceback always print a traceback on exception
404 404 --time time how long the command takes
405 405 --profile print command execution profile
406 406 --version output version information and exit
407 407 -h --help display help and exit
408 408 --hidden consider hidden changesets
409 409
410 410 Test help option with version option
411 411
412 412 $ hg add -h --version
413 413 Mercurial Distributed SCM (version *) (glob)
414 414 (see http://mercurial.selenic.com for more information)
415 415
416 416 Copyright (C) 2005-2015 Matt Mackall and others
417 417 This is free software; see the source for copying conditions. There is NO
418 418 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
419 419
420 420 $ hg add --skjdfks
421 421 hg add: option --skjdfks not recognized
422 422 hg add [OPTION]... [FILE]...
423 423
424 424 add the specified files on the next commit
425 425
426 426 options ([+] can be repeated):
427 427
428 428 -I --include PATTERN [+] include names matching the given patterns
429 429 -X --exclude PATTERN [+] exclude names matching the given patterns
430 430 -S --subrepos recurse into subrepositories
431 431 -n --dry-run do not perform actions, just print output
432 432
433 433 (use "hg add -h" to show more help)
434 434 [255]
435 435
436 436 Test ambiguous command help
437 437
438 438 $ hg help ad
439 439 list of commands:
440 440
441 441 add add the specified files on the next commit
442 442 addremove add all new files, delete all missing files
443 443
444 444 (use "hg help -v ad" to show built-in aliases and global options)
445 445
446 446 Test command without options
447 447
448 448 $ hg help verify
449 449 hg verify
450 450
451 451 verify the integrity of the repository
452 452
453 453 Verify the integrity of the current repository.
454 454
455 455 This will perform an extensive check of the repository's integrity,
456 456 validating the hashes and checksums of each entry in the changelog,
457 457 manifest, and tracked files, as well as the integrity of their crosslinks
458 458 and indices.
459 459
460 460 Please see http://mercurial.selenic.com/wiki/RepositoryCorruption for more
461 461 information about recovery from corruption of the repository.
462 462
463 463 Returns 0 on success, 1 if errors are encountered.
464 464
465 465 (some details hidden, use --verbose to show complete help)
466 466
467 467 $ hg help diff
468 468 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
469 469
470 470 diff repository (or selected files)
471 471
472 472 Show differences between revisions for the specified files.
473 473
474 474 Differences between files are shown using the unified diff format.
475 475
476 476 Note:
477 477 diff may generate unexpected results for merges, as it will default to
478 478 comparing against the working directory's first parent changeset if no
479 479 revisions are specified.
480 480
481 481 When two revision arguments are given, then changes are shown between
482 482 those revisions. If only one revision is specified then that revision is
483 483 compared to the working directory, and, when no revisions are specified,
484 484 the working directory files are compared to its parent.
485 485
486 486 Alternatively you can specify -c/--change with a revision to see the
487 487 changes in that changeset relative to its first parent.
488 488
489 489 Without the -a/--text option, diff will avoid generating diffs of files it
490 490 detects as binary. With -a, diff will generate a diff anyway, probably
491 491 with undesirable results.
492 492
493 493 Use the -g/--git option to generate diffs in the git extended diff format.
494 494 For more information, read "hg help diffs".
495 495
496 496 Returns 0 on success.
497 497
498 498 options ([+] can be repeated):
499 499
500 500 -r --rev REV [+] revision
501 501 -c --change REV change made by revision
502 502 -a --text treat all files as text
503 503 -g --git use git extended diff format
504 504 --nodates omit dates from diff headers
505 505 --noprefix omit a/ and b/ prefixes from filenames
506 506 -p --show-function show which function each change is in
507 507 --reverse produce a diff that undoes the changes
508 508 -w --ignore-all-space ignore white space when comparing lines
509 509 -b --ignore-space-change ignore changes in the amount of white space
510 510 -B --ignore-blank-lines ignore changes whose lines are all blank
511 511 -U --unified NUM number of lines of context to show
512 512 --stat output diffstat-style summary of changes
513 513 --root DIR produce diffs relative to subdirectory
514 514 -I --include PATTERN [+] include names matching the given patterns
515 515 -X --exclude PATTERN [+] exclude names matching the given patterns
516 516 -S --subrepos recurse into subrepositories
517 517
518 518 (some details hidden, use --verbose to show complete help)
519 519
520 520 $ hg help status
521 521 hg status [OPTION]... [FILE]...
522 522
523 523 aliases: st
524 524
525 525 show changed files in the working directory
526 526
527 527 Show status of files in the repository. If names are given, only files
528 528 that match are shown. Files that are clean or ignored or the source of a
529 529 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
530 530 -C/--copies or -A/--all are given. Unless options described with "show
531 531 only ..." are given, the options -mardu are used.
532 532
533 533 Option -q/--quiet hides untracked (unknown and ignored) files unless
534 534 explicitly requested with -u/--unknown or -i/--ignored.
535 535
536 536 Note:
537 537 status may appear to disagree with diff if permissions have changed or
538 538 a merge has occurred. The standard diff format does not report
539 539 permission changes and diff only reports changes relative to one merge
540 540 parent.
541 541
542 542 If one revision is given, it is used as the base revision. If two
543 543 revisions are given, the differences between them are shown. The --change
544 544 option can also be used as a shortcut to list the changed files of a
545 545 revision from its first parent.
546 546
547 547 The codes used to show the status of files are:
548 548
549 549 M = modified
550 550 A = added
551 551 R = removed
552 552 C = clean
553 553 ! = missing (deleted by non-hg command, but still tracked)
554 554 ? = not tracked
555 555 I = ignored
556 556 = origin of the previous file (with --copies)
557 557
558 558 Returns 0 on success.
559 559
560 560 options ([+] can be repeated):
561 561
562 562 -A --all show status of all files
563 563 -m --modified show only modified files
564 564 -a --added show only added files
565 565 -r --removed show only removed files
566 566 -d --deleted show only deleted (but tracked) files
567 567 -c --clean show only files without changes
568 568 -u --unknown show only unknown (not tracked) files
569 569 -i --ignored show only ignored files
570 570 -n --no-status hide status prefix
571 571 -C --copies show source of copied files
572 572 -0 --print0 end filenames with NUL, for use with xargs
573 573 --rev REV [+] show difference from revision
574 574 --change REV list the changed files of a revision
575 575 -I --include PATTERN [+] include names matching the given patterns
576 576 -X --exclude PATTERN [+] exclude names matching the given patterns
577 577 -S --subrepos recurse into subrepositories
578 578
579 579 (some details hidden, use --verbose to show complete help)
580 580
581 581 $ hg -q help status
582 582 hg status [OPTION]... [FILE]...
583 583
584 584 show changed files in the working directory
585 585
586 586 $ hg help foo
587 587 abort: no such help topic: foo
588 588 (try "hg help --keyword foo")
589 589 [255]
590 590
591 591 $ hg skjdfks
592 592 hg: unknown command 'skjdfks'
593 593 Mercurial Distributed SCM
594 594
595 595 basic commands:
596 596
597 597 add add the specified files on the next commit
598 598 annotate show changeset information by line for each file
599 599 clone make a copy of an existing repository
600 600 commit commit the specified files or all outstanding changes
601 601 diff diff repository (or selected files)
602 602 export dump the header and diffs for one or more changesets
603 603 forget forget the specified files on the next commit
604 604 init create a new repository in the given directory
605 605 log show revision history of entire repository or files
606 606 merge merge another revision into working directory
607 607 pull pull changes from the specified source
608 608 push push changes to the specified destination
609 609 remove remove the specified files on the next commit
610 610 serve start stand-alone webserver
611 611 status show changed files in the working directory
612 612 summary summarize working directory state
613 613 update update working directory (or switch revisions)
614 614
615 615 (use "hg help" for the full list of commands or "hg -v" for details)
616 616 [255]
617 617
618 618
619 619 Make sure that we don't run afoul of the help system thinking that
620 620 this is a section and erroring out weirdly.
621 621
622 622 $ hg .log
623 623 hg: unknown command '.log'
624 624 (did you mean one of log?)
625 625 [255]
626 626
627 627 $ hg log.
628 628 hg: unknown command 'log.'
629 629 (did you mean one of log?)
630 630 [255]
631 631 $ hg pu.lh
632 632 hg: unknown command 'pu.lh'
633 633 (did you mean one of pull, push?)
634 634 [255]
635 635
636 636 $ cat > helpext.py <<EOF
637 637 > import os
638 638 > from mercurial import cmdutil, commands
639 639 >
640 640 > cmdtable = {}
641 641 > command = cmdutil.command(cmdtable)
642 642 >
643 643 > @command('nohelp',
644 644 > [('', 'longdesc', 3, 'x'*90),
645 645 > ('n', '', None, 'normal desc'),
646 646 > ('', 'newline', '', 'line1\nline2')],
647 647 > 'hg nohelp',
648 648 > norepo=True)
649 > @command('debugoptDEP', [('', 'dopt', None, 'option is DEPRECATED')])
650 > @command('debugoptEXP', [('', 'eopt', None, 'option is EXPERIMENTAL')])
649 > @command('debugoptDEP', [('', 'dopt', None, 'option is (DEPRECATED)')])
650 > @command('debugoptEXP', [('', 'eopt', None, 'option is (EXPERIMENTAL)')])
651 651 > def nohelp(ui, *args, **kwargs):
652 652 > pass
653 653 >
654 654 > EOF
655 655 $ echo '[extensions]' >> $HGRCPATH
656 656 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
657 657
658 658 Test command with no help text
659 659
660 660 $ hg help nohelp
661 661 hg nohelp
662 662
663 663 (no help text available)
664 664
665 665 options:
666 666
667 667 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
668 668 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
669 669 -n -- normal desc
670 670 --newline VALUE line1 line2
671 671
672 672 (some details hidden, use --verbose to show complete help)
673 673
674 674 $ hg help -k nohelp
675 675 Commands:
676 676
677 677 nohelp hg nohelp
678 678
679 679 Extension Commands:
680 680
681 681 nohelp (no help text available)
682 682
683 683 Test that default list of commands omits extension commands
684 684
685 685 $ hg help
686 686 Mercurial Distributed SCM
687 687
688 688 list of commands:
689 689
690 690 add add the specified files on the next commit
691 691 addremove add all new files, delete all missing files
692 692 annotate show changeset information by line for each file
693 693 archive create an unversioned archive of a repository revision
694 694 backout reverse effect of earlier changeset
695 695 bisect subdivision search of changesets
696 696 bookmarks create a new bookmark or list existing bookmarks
697 697 branch set or show the current branch name
698 698 branches list repository named branches
699 699 bundle create a changegroup file
700 700 cat output the current or given revision of files
701 701 clone make a copy of an existing repository
702 702 commit commit the specified files or all outstanding changes
703 703 config show combined config settings from all hgrc files
704 704 copy mark files as copied for the next commit
705 705 diff diff repository (or selected files)
706 706 export dump the header and diffs for one or more changesets
707 707 files list tracked files
708 708 forget forget the specified files on the next commit
709 709 graft copy changes from other branches onto the current branch
710 710 grep search for a pattern in specified files and revisions
711 711 heads show branch heads
712 712 help show help for a given topic or a help overview
713 713 identify identify the working directory or specified revision
714 714 import import an ordered set of patches
715 715 incoming show new changesets found in source
716 716 init create a new repository in the given directory
717 717 log show revision history of entire repository or files
718 718 manifest output the current or given revision of the project manifest
719 719 merge merge another revision into working directory
720 720 outgoing show changesets not found in the destination
721 721 paths show aliases for remote repositories
722 722 phase set or show the current phase name
723 723 pull pull changes from the specified source
724 724 push push changes to the specified destination
725 725 recover roll back an interrupted transaction
726 726 remove remove the specified files on the next commit
727 727 rename rename files; equivalent of copy + remove
728 728 resolve redo merges or set/view the merge status of files
729 729 revert restore files to their checkout state
730 730 root print the root (top) of the current working directory
731 731 serve start stand-alone webserver
732 732 status show changed files in the working directory
733 733 summary summarize working directory state
734 734 tag add one or more tags for the current or given revision
735 735 tags list repository tags
736 736 unbundle apply one or more changegroup files
737 737 update update working directory (or switch revisions)
738 738 verify verify the integrity of the repository
739 739 version output version and copyright information
740 740
741 741 enabled extensions:
742 742
743 743 helpext (no help text available)
744 744
745 745 additional help topics:
746 746
747 747 config Configuration Files
748 748 dates Date Formats
749 749 diffs Diff Formats
750 750 environment Environment Variables
751 751 extensions Using Additional Features
752 752 filesets Specifying File Sets
753 753 glossary Glossary
754 754 hgignore Syntax for Mercurial Ignore Files
755 755 hgweb Configuring hgweb
756 756 merge-tools Merge Tools
757 757 multirevs Specifying Multiple Revisions
758 758 patterns File Name Patterns
759 759 phases Working with Phases
760 760 revisions Specifying Single Revisions
761 761 revsets Specifying Revision Sets
762 762 scripting Using Mercurial from scripts and automation
763 763 subrepos Subrepositories
764 764 templating Template Usage
765 765 urls URL Paths
766 766
767 767 (use "hg help -v" to show built-in aliases and global options)
768 768
769 769
770 770 Test list of internal help commands
771 771
772 772 $ hg help debug
773 773 debug commands (internal and unsupported):
774 774
775 775 debugancestor
776 776 find the ancestor revision of two revisions in a given index
777 777 debugbuilddag
778 778 builds a repo with a given DAG from scratch in the current
779 779 empty repo
780 780 debugbundle lists the contents of a bundle
781 781 debugcheckstate
782 782 validate the correctness of the current dirstate
783 783 debugcommands
784 784 list all available commands and options
785 785 debugcomplete
786 786 returns the completion list associated with the given command
787 787 debugdag format the changelog or an index DAG as a concise textual
788 788 description
789 789 debugdata dump the contents of a data file revision
790 790 debugdate parse and display a date
791 791 debugdirstate
792 792 show the contents of the current dirstate
793 793 debugdiscovery
794 794 runs the changeset discovery protocol in isolation
795 795 debugextensions
796 796 show information about active extensions
797 797 debugfileset parse and apply a fileset specification
798 798 debugfsinfo show information detected about current filesystem
799 799 debuggetbundle
800 800 retrieves a bundle from a repo
801 801 debugignore display the combined ignore pattern
802 802 debugindex dump the contents of an index file
803 803 debugindexdot
804 804 dump an index DAG as a graphviz dot file
805 805 debuginstall test Mercurial installation
806 806 debugknown test whether node ids are known to a repo
807 807 debuglocks show or modify state of locks
808 808 debugnamecomplete
809 809 complete "names" - tags, open branch names, bookmark names
810 810 debugobsolete
811 811 create arbitrary obsolete marker
812 812 debugoptDEP (no help text available)
813 813 debugoptEXP (no help text available)
814 814 debugpathcomplete
815 815 complete part or all of a tracked path
816 816 debugpushkey access the pushkey key/value protocol
817 817 debugpvec (no help text available)
818 818 debugrebuilddirstate
819 819 rebuild the dirstate as it would look like for the given
820 820 revision
821 821 debugrebuildfncache
822 822 rebuild the fncache file
823 823 debugrename dump rename information
824 824 debugrevlog show data and statistics about a revlog
825 825 debugrevspec parse and apply a revision specification
826 826 debugsetparents
827 827 manually set the parents of the current working directory
828 828 debugsub (no help text available)
829 829 debugsuccessorssets
830 830 show set of successors for revision
831 831 debugwalk show how files match on given patterns
832 832 debugwireargs
833 833 (no help text available)
834 834
835 835 (use "hg help -v debug" to show built-in aliases and global options)
836 836
837 837
838 838 Test list of commands with command with no help text
839 839
840 840 $ hg help helpext
841 841 helpext extension - no help text available
842 842
843 843 list of commands:
844 844
845 845 nohelp (no help text available)
846 846
847 847 (use "hg help -v helpext" to show built-in aliases and global options)
848 848
849 849
850 850 test deprecated and experimental options are hidden in command help
851 851 $ hg help debugoptDEP
852 852 hg debugoptDEP
853 853
854 854 (no help text available)
855 855
856 856 options:
857 857
858 858 (some details hidden, use --verbose to show complete help)
859 859
860 860 $ hg help debugoptEXP
861 861 hg debugoptEXP
862 862
863 863 (no help text available)
864 864
865 865 options:
866 866
867 867 (some details hidden, use --verbose to show complete help)
868 868
869 869 test deprecated and experimental options is shown with -v
870 870 $ hg help -v debugoptDEP | grep dopt
871 --dopt option is DEPRECATED
871 --dopt option is (DEPRECATED)
872 872 $ hg help -v debugoptEXP | grep eopt
873 --eopt option is EXPERIMENTAL
873 --eopt option is (EXPERIMENTAL)
874 874
875 875 #if gettext
876 876 test deprecated option is hidden with translation with untranslated description
877 877 (use many globy for not failing on changed transaction)
878 878 $ LANGUAGE=sv hg help debugoptDEP
879 879 hg debugoptDEP
880 880
881 881 (*) (glob)
882 882
883 883 options:
884 884
885 885 (some details hidden, use --verbose to show complete help)
886 886 #endif
887 887
888 888 Test commands that collide with topics (issue4240)
889 889
890 890 $ hg config -hq
891 891 hg config [-u] [NAME]...
892 892
893 893 show combined config settings from all hgrc files
894 894 $ hg showconfig -hq
895 895 hg config [-u] [NAME]...
896 896
897 897 show combined config settings from all hgrc files
898 898
899 899 Test a help topic
900 900
901 901 $ hg help revs
902 902 Specifying Single Revisions
903 903 """""""""""""""""""""""""""
904 904
905 905 Mercurial supports several ways to specify individual revisions.
906 906
907 907 A plain integer is treated as a revision number. Negative integers are
908 908 treated as sequential offsets from the tip, with -1 denoting the tip, -2
909 909 denoting the revision prior to the tip, and so forth.
910 910
911 911 A 40-digit hexadecimal string is treated as a unique revision identifier.
912 912
913 913 A hexadecimal string less than 40 characters long is treated as a unique
914 914 revision identifier and is referred to as a short-form identifier. A
915 915 short-form identifier is only valid if it is the prefix of exactly one
916 916 full-length identifier.
917 917
918 918 Any other string is treated as a bookmark, tag, or branch name. A bookmark
919 919 is a movable pointer to a revision. A tag is a permanent name associated
920 920 with a revision. A branch name denotes the tipmost open branch head of
921 921 that branch - or if they are all closed, the tipmost closed head of the
922 922 branch. Bookmark, tag, and branch names must not contain the ":"
923 923 character.
924 924
925 925 The reserved name "tip" always identifies the most recent revision.
926 926
927 927 The reserved name "null" indicates the null revision. This is the revision
928 928 of an empty repository, and the parent of revision 0.
929 929
930 930 The reserved name "." indicates the working directory parent. If no
931 931 working directory is checked out, it is equivalent to null. If an
932 932 uncommitted merge is in progress, "." is the revision of the first parent.
933 933
934 934 Test repeated config section name
935 935
936 936 $ hg help config.host
937 937 "http_proxy.host"
938 938 Host name and (optional) port of the proxy server, for example
939 939 "myproxy:8000".
940 940
941 941 "smtp.host"
942 942 Host name of mail server, e.g. "mail.example.com".
943 943
944 944 Unrelated trailing paragraphs shouldn't be included
945 945
946 946 $ hg help config.extramsg | grep '^$'
947 947
948 948
949 949 Test capitalized section name
950 950
951 951 $ hg help scripting.HGPLAIN > /dev/null
952 952
953 953 Help subsection:
954 954
955 955 $ hg help config.charsets |grep "Email example:" > /dev/null
956 956 [1]
957 957
958 958 Show nested definitions
959 959 ("profiling.type"[break]"ls"[break]"stat"[break])
960 960
961 961 $ hg help config.type | egrep '^$'|wc -l
962 962 \s*3 (re)
963 963
964 964 Last item in help config.*:
965 965
966 966 $ hg help config.`hg help config|grep '^ "'| \
967 967 > tail -1|sed 's![ "]*!!g'`| \
968 968 > grep "hg help -c config" > /dev/null
969 969 [1]
970 970
971 971 note to use help -c for general hg help config:
972 972
973 973 $ hg help config |grep "hg help -c config" > /dev/null
974 974
975 975 Test templating help
976 976
977 977 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
978 978 desc String. The text of the changeset description.
979 979 diffstat String. Statistics of changes with the following format:
980 980 firstline Any text. Returns the first line of text.
981 981 nonempty Any text. Returns '(none)' if the string is empty.
982 982
983 983 Test help hooks
984 984
985 985 $ cat > helphook1.py <<EOF
986 986 > from mercurial import help
987 987 >
988 988 > def rewrite(topic, doc):
989 989 > return doc + '\nhelphook1\n'
990 990 >
991 991 > def extsetup(ui):
992 992 > help.addtopichook('revsets', rewrite)
993 993 > EOF
994 994 $ cat > helphook2.py <<EOF
995 995 > from mercurial import help
996 996 >
997 997 > def rewrite(topic, doc):
998 998 > return doc + '\nhelphook2\n'
999 999 >
1000 1000 > def extsetup(ui):
1001 1001 > help.addtopichook('revsets', rewrite)
1002 1002 > EOF
1003 1003 $ echo '[extensions]' >> $HGRCPATH
1004 1004 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1005 1005 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1006 1006 $ hg help revsets | grep helphook
1007 1007 helphook1
1008 1008 helphook2
1009 1009
1010 1010 Test -e / -c / -k combinations
1011 1011
1012 1012 $ hg help -c progress
1013 1013 abort: no such help topic: progress
1014 1014 (try "hg help --keyword progress")
1015 1015 [255]
1016 1016 $ hg help -e progress |head -1
1017 1017 progress extension - show progress bars for some actions (DEPRECATED)
1018 1018 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1019 1019 Commands:
1020 1020 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1021 1021 Extensions:
1022 1022 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1023 1023 Extensions:
1024 1024 Commands:
1025 1025 $ hg help -c commit > /dev/null
1026 1026 $ hg help -e -c commit > /dev/null
1027 1027 $ hg help -e commit > /dev/null
1028 1028 abort: no such help topic: commit
1029 1029 (try "hg help --keyword commit")
1030 1030 [255]
1031 1031
1032 1032 Test keyword search help
1033 1033
1034 1034 $ cat > prefixedname.py <<EOF
1035 1035 > '''matched against word "clone"
1036 1036 > '''
1037 1037 > EOF
1038 1038 $ echo '[extensions]' >> $HGRCPATH
1039 1039 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1040 1040 $ hg help -k clone
1041 1041 Topics:
1042 1042
1043 1043 config Configuration Files
1044 1044 extensions Using Additional Features
1045 1045 glossary Glossary
1046 1046 phases Working with Phases
1047 1047 subrepos Subrepositories
1048 1048 urls URL Paths
1049 1049
1050 1050 Commands:
1051 1051
1052 1052 bookmarks create a new bookmark or list existing bookmarks
1053 1053 clone make a copy of an existing repository
1054 1054 paths show aliases for remote repositories
1055 1055 update update working directory (or switch revisions)
1056 1056
1057 1057 Extensions:
1058 1058
1059 1059 prefixedname matched against word "clone"
1060 1060 relink recreates hardlinks between repository clones
1061 1061
1062 1062 Extension Commands:
1063 1063
1064 1064 qclone clone main and patch repository at same time
1065 1065
1066 1066 Test unfound topic
1067 1067
1068 1068 $ hg help nonexistingtopicthatwillneverexisteverever
1069 1069 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1070 1070 (try "hg help --keyword nonexistingtopicthatwillneverexisteverever")
1071 1071 [255]
1072 1072
1073 1073 Test unfound keyword
1074 1074
1075 1075 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1076 1076 abort: no matches
1077 1077 (try "hg help" for a list of topics)
1078 1078 [255]
1079 1079
1080 1080 Test omit indicating for help
1081 1081
1082 1082 $ cat > addverboseitems.py <<EOF
1083 1083 > '''extension to test omit indicating.
1084 1084 >
1085 1085 > This paragraph is never omitted (for extension)
1086 1086 >
1087 1087 > .. container:: verbose
1088 1088 >
1089 1089 > This paragraph is omitted,
1090 1090 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1091 1091 >
1092 1092 > This paragraph is never omitted, too (for extension)
1093 1093 > '''
1094 1094 >
1095 1095 > from mercurial import help, commands
1096 1096 > testtopic = """This paragraph is never omitted (for topic).
1097 1097 >
1098 1098 > .. container:: verbose
1099 1099 >
1100 1100 > This paragraph is omitted,
1101 1101 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1102 1102 >
1103 1103 > This paragraph is never omitted, too (for topic)
1104 1104 > """
1105 1105 > def extsetup(ui):
1106 1106 > help.helptable.append((["topic-containing-verbose"],
1107 1107 > "This is the topic to test omit indicating.",
1108 1108 > lambda : testtopic))
1109 1109 > EOF
1110 1110 $ echo '[extensions]' >> $HGRCPATH
1111 1111 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1112 1112 $ hg help addverboseitems
1113 1113 addverboseitems extension - extension to test omit indicating.
1114 1114
1115 1115 This paragraph is never omitted (for extension)
1116 1116
1117 1117 This paragraph is never omitted, too (for extension)
1118 1118
1119 1119 (some details hidden, use --verbose to show complete help)
1120 1120
1121 1121 no commands defined
1122 1122 $ hg help -v addverboseitems
1123 1123 addverboseitems extension - extension to test omit indicating.
1124 1124
1125 1125 This paragraph is never omitted (for extension)
1126 1126
1127 1127 This paragraph is omitted, if "hg help" is invoked without "-v" (for
1128 1128 extension)
1129 1129
1130 1130 This paragraph is never omitted, too (for extension)
1131 1131
1132 1132 no commands defined
1133 1133 $ hg help topic-containing-verbose
1134 1134 This is the topic to test omit indicating.
1135 1135 """"""""""""""""""""""""""""""""""""""""""
1136 1136
1137 1137 This paragraph is never omitted (for topic).
1138 1138
1139 1139 This paragraph is never omitted, too (for topic)
1140 1140
1141 1141 (some details hidden, use --verbose to show complete help)
1142 1142 $ hg help -v topic-containing-verbose
1143 1143 This is the topic to test omit indicating.
1144 1144 """"""""""""""""""""""""""""""""""""""""""
1145 1145
1146 1146 This paragraph is never omitted (for topic).
1147 1147
1148 1148 This paragraph is omitted, if "hg help" is invoked without "-v" (for
1149 1149 topic)
1150 1150
1151 1151 This paragraph is never omitted, too (for topic)
1152 1152
1153 1153 Test section lookup
1154 1154
1155 1155 $ hg help revset.merge
1156 1156 "merge()"
1157 1157 Changeset is a merge changeset.
1158 1158
1159 1159 $ hg help glossary.dag
1160 1160 DAG
1161 1161 The repository of changesets of a distributed version control system
1162 1162 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1163 1163 of nodes and edges, where nodes correspond to changesets and edges
1164 1164 imply a parent -> child relation. This graph can be visualized by
1165 1165 graphical tools such as "hg log --graph". In Mercurial, the DAG is
1166 1166 limited by the requirement for children to have at most two parents.
1167 1167
1168 1168
1169 1169 $ hg help hgrc.paths
1170 1170 "paths"
1171 1171 -------
1172 1172
1173 1173 Assigns symbolic names to repositories. The left side is the symbolic
1174 1174 name, and the right gives the directory or URL that is the location of the
1175 1175 repository. Default paths can be declared by setting the following
1176 1176 entries.
1177 1177
1178 1178 "default"
1179 1179 Directory or URL to use when pulling if no source is specified.
1180 1180 (default: repository from which the current repository was cloned)
1181 1181
1182 1182 "default-push"
1183 1183 Optional. Directory or URL to use when pushing if no destination is
1184 1184 specified.
1185 1185
1186 1186 Custom paths can be defined by assigning the path to a name that later can
1187 1187 be used from the command line. Example:
1188 1188
1189 1189 [paths]
1190 1190 my_path = http://example.com/path
1191 1191
1192 1192 To push to the path defined in "my_path" run the command:
1193 1193
1194 1194 hg push my_path
1195 1195
1196 1196 $ hg help glossary.mcguffin
1197 1197 abort: help section not found
1198 1198 [255]
1199 1199
1200 1200 $ hg help glossary.mc.guffin
1201 1201 abort: help section not found
1202 1202 [255]
1203 1203
1204 1204 $ hg help template.files
1205 1205 files List of strings. All files modified, added, or removed by
1206 1206 this changeset.
1207 1207
1208 1208 Test dynamic list of merge tools only shows up once
1209 1209 $ hg help merge-tools
1210 1210 Merge Tools
1211 1211 """""""""""
1212 1212
1213 1213 To merge files Mercurial uses merge tools.
1214 1214
1215 1215 A merge tool combines two different versions of a file into a merged file.
1216 1216 Merge tools are given the two files and the greatest common ancestor of
1217 1217 the two file versions, so they can determine the changes made on both
1218 1218 branches.
1219 1219
1220 1220 Merge tools are used both for "hg resolve", "hg merge", "hg update", "hg
1221 1221 backout" and in several extensions.
1222 1222
1223 1223 Usually, the merge tool tries to automatically reconcile the files by
1224 1224 combining all non-overlapping changes that occurred separately in the two
1225 1225 different evolutions of the same initial base file. Furthermore, some
1226 1226 interactive merge programs make it easier to manually resolve conflicting
1227 1227 merges, either in a graphical way, or by inserting some conflict markers.
1228 1228 Mercurial does not include any interactive merge programs but relies on
1229 1229 external tools for that.
1230 1230
1231 1231 Available merge tools
1232 1232 =====================
1233 1233
1234 1234 External merge tools and their properties are configured in the merge-
1235 1235 tools configuration section - see hgrc(5) - but they can often just be
1236 1236 named by their executable.
1237 1237
1238 1238 A merge tool is generally usable if its executable can be found on the
1239 1239 system and if it can handle the merge. The executable is found if it is an
1240 1240 absolute or relative executable path or the name of an application in the
1241 1241 executable search path. The tool is assumed to be able to handle the merge
1242 1242 if it can handle symlinks if the file is a symlink, if it can handle
1243 1243 binary files if the file is binary, and if a GUI is available if the tool
1244 1244 requires a GUI.
1245 1245
1246 1246 There are some internal merge tools which can be used. The internal merge
1247 1247 tools are:
1248 1248
1249 1249 ":dump"
1250 1250 Creates three versions of the files to merge, containing the contents of
1251 1251 local, other and base. These files can then be used to perform a merge
1252 1252 manually. If the file to be merged is named "a.txt", these files will
1253 1253 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1254 1254 they will be placed in the same directory as "a.txt".
1255 1255
1256 1256 ":fail"
1257 1257 Rather than attempting to merge files that were modified on both
1258 1258 branches, it marks them as unresolved. The resolve command must be used
1259 1259 to resolve these conflicts.
1260 1260
1261 1261 ":local"
1262 1262 Uses the local version of files as the merged version.
1263 1263
1264 1264 ":merge"
1265 1265 Uses the internal non-interactive simple merge algorithm for merging
1266 1266 files. It will fail if there are any conflicts and leave markers in the
1267 1267 partially merged file. Markers will have two sections, one for each side
1268 1268 of merge.
1269 1269
1270 1270 ":merge-local"
1271 1271 Like :merge, but resolve all conflicts non-interactively in favor of the
1272 1272 local changes.
1273 1273
1274 1274 ":merge-other"
1275 1275 Like :merge, but resolve all conflicts non-interactively in favor of the
1276 1276 other changes.
1277 1277
1278 1278 ":merge3"
1279 1279 Uses the internal non-interactive simple merge algorithm for merging
1280 1280 files. It will fail if there are any conflicts and leave markers in the
1281 1281 partially merged file. Marker will have three sections, one from each
1282 1282 side of the merge and one for the base content.
1283 1283
1284 1284 ":other"
1285 1285 Uses the other version of files as the merged version.
1286 1286
1287 1287 ":prompt"
1288 1288 Asks the user which of the local or the other version to keep as the
1289 1289 merged version.
1290 1290
1291 1291 ":tagmerge"
1292 1292 Uses the internal tag merge algorithm (experimental).
1293 1293
1294 1294 ":union"
1295 1295 Uses the internal non-interactive simple merge algorithm for merging
1296 1296 files. It will use both left and right sides for conflict regions. No
1297 1297 markers are inserted.
1298 1298
1299 1299 Internal tools are always available and do not require a GUI but will by
1300 1300 default not handle symlinks or binary files.
1301 1301
1302 1302 Choosing a merge tool
1303 1303 =====================
1304 1304
1305 1305 Mercurial uses these rules when deciding which merge tool to use:
1306 1306
1307 1307 1. If a tool has been specified with the --tool option to merge or
1308 1308 resolve, it is used. If it is the name of a tool in the merge-tools
1309 1309 configuration, its configuration is used. Otherwise the specified tool
1310 1310 must be executable by the shell.
1311 1311 2. If the "HGMERGE" environment variable is present, its value is used and
1312 1312 must be executable by the shell.
1313 1313 3. If the filename of the file to be merged matches any of the patterns in
1314 1314 the merge-patterns configuration section, the first usable merge tool
1315 1315 corresponding to a matching pattern is used. Here, binary capabilities
1316 1316 of the merge tool are not considered.
1317 1317 4. If ui.merge is set it will be considered next. If the value is not the
1318 1318 name of a configured tool, the specified value is used and must be
1319 1319 executable by the shell. Otherwise the named tool is used if it is
1320 1320 usable.
1321 1321 5. If any usable merge tools are present in the merge-tools configuration
1322 1322 section, the one with the highest priority is used.
1323 1323 6. If a program named "hgmerge" can be found on the system, it is used -
1324 1324 but it will by default not be used for symlinks and binary files.
1325 1325 7. If the file to be merged is not binary and is not a symlink, then
1326 1326 internal ":merge" is used.
1327 1327 8. The merge of the file fails and must be resolved before commit.
1328 1328
1329 1329 Note:
1330 1330 After selecting a merge program, Mercurial will by default attempt to
1331 1331 merge the files using a simple merge algorithm first. Only if it
1332 1332 doesn't succeed because of conflicting changes Mercurial will actually
1333 1333 execute the merge program. Whether to use the simple merge algorithm
1334 1334 first can be controlled by the premerge setting of the merge tool.
1335 1335 Premerge is enabled by default unless the file is binary or a symlink.
1336 1336
1337 1337 See the merge-tools and ui sections of hgrc(5) for details on the
1338 1338 configuration of merge tools.
1339 1339
1340 1340 Test usage of section marks in help documents
1341 1341
1342 1342 $ cd "$TESTDIR"/../doc
1343 1343 $ python check-seclevel.py
1344 1344 $ cd $TESTTMP
1345 1345
1346 1346 #if serve
1347 1347
1348 1348 Test the help pages in hgweb.
1349 1349
1350 1350 Dish up an empty repo; serve it cold.
1351 1351
1352 1352 $ hg init "$TESTTMP/test"
1353 1353 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1354 1354 $ cat hg.pid >> $DAEMON_PIDS
1355 1355
1356 1356 $ get-with-headers.py 127.0.0.1:$HGPORT "help"
1357 1357 200 Script output follows
1358 1358
1359 1359 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1360 1360 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1361 1361 <head>
1362 1362 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1363 1363 <meta name="robots" content="index, nofollow" />
1364 1364 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1365 1365 <script type="text/javascript" src="/static/mercurial.js"></script>
1366 1366
1367 1367 <title>Help: Index</title>
1368 1368 </head>
1369 1369 <body>
1370 1370
1371 1371 <div class="container">
1372 1372 <div class="menu">
1373 1373 <div class="logo">
1374 1374 <a href="http://mercurial.selenic.com/">
1375 1375 <img src="/static/hglogo.png" alt="mercurial" /></a>
1376 1376 </div>
1377 1377 <ul>
1378 1378 <li><a href="/shortlog">log</a></li>
1379 1379 <li><a href="/graph">graph</a></li>
1380 1380 <li><a href="/tags">tags</a></li>
1381 1381 <li><a href="/bookmarks">bookmarks</a></li>
1382 1382 <li><a href="/branches">branches</a></li>
1383 1383 </ul>
1384 1384 <ul>
1385 1385 <li class="active">help</li>
1386 1386 </ul>
1387 1387 </div>
1388 1388
1389 1389 <div class="main">
1390 1390 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1391 1391 <form class="search" action="/log">
1392 1392
1393 1393 <p><input name="rev" id="search1" type="text" size="30" /></p>
1394 1394 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1395 1395 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1396 1396 </form>
1397 1397 <table class="bigtable">
1398 1398 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
1399 1399
1400 1400 <tr><td>
1401 1401 <a href="/help/config">
1402 1402 config
1403 1403 </a>
1404 1404 </td><td>
1405 1405 Configuration Files
1406 1406 </td></tr>
1407 1407 <tr><td>
1408 1408 <a href="/help/dates">
1409 1409 dates
1410 1410 </a>
1411 1411 </td><td>
1412 1412 Date Formats
1413 1413 </td></tr>
1414 1414 <tr><td>
1415 1415 <a href="/help/diffs">
1416 1416 diffs
1417 1417 </a>
1418 1418 </td><td>
1419 1419 Diff Formats
1420 1420 </td></tr>
1421 1421 <tr><td>
1422 1422 <a href="/help/environment">
1423 1423 environment
1424 1424 </a>
1425 1425 </td><td>
1426 1426 Environment Variables
1427 1427 </td></tr>
1428 1428 <tr><td>
1429 1429 <a href="/help/extensions">
1430 1430 extensions
1431 1431 </a>
1432 1432 </td><td>
1433 1433 Using Additional Features
1434 1434 </td></tr>
1435 1435 <tr><td>
1436 1436 <a href="/help/filesets">
1437 1437 filesets
1438 1438 </a>
1439 1439 </td><td>
1440 1440 Specifying File Sets
1441 1441 </td></tr>
1442 1442 <tr><td>
1443 1443 <a href="/help/glossary">
1444 1444 glossary
1445 1445 </a>
1446 1446 </td><td>
1447 1447 Glossary
1448 1448 </td></tr>
1449 1449 <tr><td>
1450 1450 <a href="/help/hgignore">
1451 1451 hgignore
1452 1452 </a>
1453 1453 </td><td>
1454 1454 Syntax for Mercurial Ignore Files
1455 1455 </td></tr>
1456 1456 <tr><td>
1457 1457 <a href="/help/hgweb">
1458 1458 hgweb
1459 1459 </a>
1460 1460 </td><td>
1461 1461 Configuring hgweb
1462 1462 </td></tr>
1463 1463 <tr><td>
1464 1464 <a href="/help/merge-tools">
1465 1465 merge-tools
1466 1466 </a>
1467 1467 </td><td>
1468 1468 Merge Tools
1469 1469 </td></tr>
1470 1470 <tr><td>
1471 1471 <a href="/help/multirevs">
1472 1472 multirevs
1473 1473 </a>
1474 1474 </td><td>
1475 1475 Specifying Multiple Revisions
1476 1476 </td></tr>
1477 1477 <tr><td>
1478 1478 <a href="/help/patterns">
1479 1479 patterns
1480 1480 </a>
1481 1481 </td><td>
1482 1482 File Name Patterns
1483 1483 </td></tr>
1484 1484 <tr><td>
1485 1485 <a href="/help/phases">
1486 1486 phases
1487 1487 </a>
1488 1488 </td><td>
1489 1489 Working with Phases
1490 1490 </td></tr>
1491 1491 <tr><td>
1492 1492 <a href="/help/revisions">
1493 1493 revisions
1494 1494 </a>
1495 1495 </td><td>
1496 1496 Specifying Single Revisions
1497 1497 </td></tr>
1498 1498 <tr><td>
1499 1499 <a href="/help/revsets">
1500 1500 revsets
1501 1501 </a>
1502 1502 </td><td>
1503 1503 Specifying Revision Sets
1504 1504 </td></tr>
1505 1505 <tr><td>
1506 1506 <a href="/help/scripting">
1507 1507 scripting
1508 1508 </a>
1509 1509 </td><td>
1510 1510 Using Mercurial from scripts and automation
1511 1511 </td></tr>
1512 1512 <tr><td>
1513 1513 <a href="/help/subrepos">
1514 1514 subrepos
1515 1515 </a>
1516 1516 </td><td>
1517 1517 Subrepositories
1518 1518 </td></tr>
1519 1519 <tr><td>
1520 1520 <a href="/help/templating">
1521 1521 templating
1522 1522 </a>
1523 1523 </td><td>
1524 1524 Template Usage
1525 1525 </td></tr>
1526 1526 <tr><td>
1527 1527 <a href="/help/urls">
1528 1528 urls
1529 1529 </a>
1530 1530 </td><td>
1531 1531 URL Paths
1532 1532 </td></tr>
1533 1533 <tr><td>
1534 1534 <a href="/help/topic-containing-verbose">
1535 1535 topic-containing-verbose
1536 1536 </a>
1537 1537 </td><td>
1538 1538 This is the topic to test omit indicating.
1539 1539 </td></tr>
1540 1540
1541 1541 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
1542 1542
1543 1543 <tr><td>
1544 1544 <a href="/help/add">
1545 1545 add
1546 1546 </a>
1547 1547 </td><td>
1548 1548 add the specified files on the next commit
1549 1549 </td></tr>
1550 1550 <tr><td>
1551 1551 <a href="/help/annotate">
1552 1552 annotate
1553 1553 </a>
1554 1554 </td><td>
1555 1555 show changeset information by line for each file
1556 1556 </td></tr>
1557 1557 <tr><td>
1558 1558 <a href="/help/clone">
1559 1559 clone
1560 1560 </a>
1561 1561 </td><td>
1562 1562 make a copy of an existing repository
1563 1563 </td></tr>
1564 1564 <tr><td>
1565 1565 <a href="/help/commit">
1566 1566 commit
1567 1567 </a>
1568 1568 </td><td>
1569 1569 commit the specified files or all outstanding changes
1570 1570 </td></tr>
1571 1571 <tr><td>
1572 1572 <a href="/help/diff">
1573 1573 diff
1574 1574 </a>
1575 1575 </td><td>
1576 1576 diff repository (or selected files)
1577 1577 </td></tr>
1578 1578 <tr><td>
1579 1579 <a href="/help/export">
1580 1580 export
1581 1581 </a>
1582 1582 </td><td>
1583 1583 dump the header and diffs for one or more changesets
1584 1584 </td></tr>
1585 1585 <tr><td>
1586 1586 <a href="/help/forget">
1587 1587 forget
1588 1588 </a>
1589 1589 </td><td>
1590 1590 forget the specified files on the next commit
1591 1591 </td></tr>
1592 1592 <tr><td>
1593 1593 <a href="/help/init">
1594 1594 init
1595 1595 </a>
1596 1596 </td><td>
1597 1597 create a new repository in the given directory
1598 1598 </td></tr>
1599 1599 <tr><td>
1600 1600 <a href="/help/log">
1601 1601 log
1602 1602 </a>
1603 1603 </td><td>
1604 1604 show revision history of entire repository or files
1605 1605 </td></tr>
1606 1606 <tr><td>
1607 1607 <a href="/help/merge">
1608 1608 merge
1609 1609 </a>
1610 1610 </td><td>
1611 1611 merge another revision into working directory
1612 1612 </td></tr>
1613 1613 <tr><td>
1614 1614 <a href="/help/pull">
1615 1615 pull
1616 1616 </a>
1617 1617 </td><td>
1618 1618 pull changes from the specified source
1619 1619 </td></tr>
1620 1620 <tr><td>
1621 1621 <a href="/help/push">
1622 1622 push
1623 1623 </a>
1624 1624 </td><td>
1625 1625 push changes to the specified destination
1626 1626 </td></tr>
1627 1627 <tr><td>
1628 1628 <a href="/help/remove">
1629 1629 remove
1630 1630 </a>
1631 1631 </td><td>
1632 1632 remove the specified files on the next commit
1633 1633 </td></tr>
1634 1634 <tr><td>
1635 1635 <a href="/help/serve">
1636 1636 serve
1637 1637 </a>
1638 1638 </td><td>
1639 1639 start stand-alone webserver
1640 1640 </td></tr>
1641 1641 <tr><td>
1642 1642 <a href="/help/status">
1643 1643 status
1644 1644 </a>
1645 1645 </td><td>
1646 1646 show changed files in the working directory
1647 1647 </td></tr>
1648 1648 <tr><td>
1649 1649 <a href="/help/summary">
1650 1650 summary
1651 1651 </a>
1652 1652 </td><td>
1653 1653 summarize working directory state
1654 1654 </td></tr>
1655 1655 <tr><td>
1656 1656 <a href="/help/update">
1657 1657 update
1658 1658 </a>
1659 1659 </td><td>
1660 1660 update working directory (or switch revisions)
1661 1661 </td></tr>
1662 1662
1663 1663 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
1664 1664
1665 1665 <tr><td>
1666 1666 <a href="/help/addremove">
1667 1667 addremove
1668 1668 </a>
1669 1669 </td><td>
1670 1670 add all new files, delete all missing files
1671 1671 </td></tr>
1672 1672 <tr><td>
1673 1673 <a href="/help/archive">
1674 1674 archive
1675 1675 </a>
1676 1676 </td><td>
1677 1677 create an unversioned archive of a repository revision
1678 1678 </td></tr>
1679 1679 <tr><td>
1680 1680 <a href="/help/backout">
1681 1681 backout
1682 1682 </a>
1683 1683 </td><td>
1684 1684 reverse effect of earlier changeset
1685 1685 </td></tr>
1686 1686 <tr><td>
1687 1687 <a href="/help/bisect">
1688 1688 bisect
1689 1689 </a>
1690 1690 </td><td>
1691 1691 subdivision search of changesets
1692 1692 </td></tr>
1693 1693 <tr><td>
1694 1694 <a href="/help/bookmarks">
1695 1695 bookmarks
1696 1696 </a>
1697 1697 </td><td>
1698 1698 create a new bookmark or list existing bookmarks
1699 1699 </td></tr>
1700 1700 <tr><td>
1701 1701 <a href="/help/branch">
1702 1702 branch
1703 1703 </a>
1704 1704 </td><td>
1705 1705 set or show the current branch name
1706 1706 </td></tr>
1707 1707 <tr><td>
1708 1708 <a href="/help/branches">
1709 1709 branches
1710 1710 </a>
1711 1711 </td><td>
1712 1712 list repository named branches
1713 1713 </td></tr>
1714 1714 <tr><td>
1715 1715 <a href="/help/bundle">
1716 1716 bundle
1717 1717 </a>
1718 1718 </td><td>
1719 1719 create a changegroup file
1720 1720 </td></tr>
1721 1721 <tr><td>
1722 1722 <a href="/help/cat">
1723 1723 cat
1724 1724 </a>
1725 1725 </td><td>
1726 1726 output the current or given revision of files
1727 1727 </td></tr>
1728 1728 <tr><td>
1729 1729 <a href="/help/config">
1730 1730 config
1731 1731 </a>
1732 1732 </td><td>
1733 1733 show combined config settings from all hgrc files
1734 1734 </td></tr>
1735 1735 <tr><td>
1736 1736 <a href="/help/copy">
1737 1737 copy
1738 1738 </a>
1739 1739 </td><td>
1740 1740 mark files as copied for the next commit
1741 1741 </td></tr>
1742 1742 <tr><td>
1743 1743 <a href="/help/files">
1744 1744 files
1745 1745 </a>
1746 1746 </td><td>
1747 1747 list tracked files
1748 1748 </td></tr>
1749 1749 <tr><td>
1750 1750 <a href="/help/graft">
1751 1751 graft
1752 1752 </a>
1753 1753 </td><td>
1754 1754 copy changes from other branches onto the current branch
1755 1755 </td></tr>
1756 1756 <tr><td>
1757 1757 <a href="/help/grep">
1758 1758 grep
1759 1759 </a>
1760 1760 </td><td>
1761 1761 search for a pattern in specified files and revisions
1762 1762 </td></tr>
1763 1763 <tr><td>
1764 1764 <a href="/help/heads">
1765 1765 heads
1766 1766 </a>
1767 1767 </td><td>
1768 1768 show branch heads
1769 1769 </td></tr>
1770 1770 <tr><td>
1771 1771 <a href="/help/help">
1772 1772 help
1773 1773 </a>
1774 1774 </td><td>
1775 1775 show help for a given topic or a help overview
1776 1776 </td></tr>
1777 1777 <tr><td>
1778 1778 <a href="/help/identify">
1779 1779 identify
1780 1780 </a>
1781 1781 </td><td>
1782 1782 identify the working directory or specified revision
1783 1783 </td></tr>
1784 1784 <tr><td>
1785 1785 <a href="/help/import">
1786 1786 import
1787 1787 </a>
1788 1788 </td><td>
1789 1789 import an ordered set of patches
1790 1790 </td></tr>
1791 1791 <tr><td>
1792 1792 <a href="/help/incoming">
1793 1793 incoming
1794 1794 </a>
1795 1795 </td><td>
1796 1796 show new changesets found in source
1797 1797 </td></tr>
1798 1798 <tr><td>
1799 1799 <a href="/help/manifest">
1800 1800 manifest
1801 1801 </a>
1802 1802 </td><td>
1803 1803 output the current or given revision of the project manifest
1804 1804 </td></tr>
1805 1805 <tr><td>
1806 1806 <a href="/help/nohelp">
1807 1807 nohelp
1808 1808 </a>
1809 1809 </td><td>
1810 1810 (no help text available)
1811 1811 </td></tr>
1812 1812 <tr><td>
1813 1813 <a href="/help/outgoing">
1814 1814 outgoing
1815 1815 </a>
1816 1816 </td><td>
1817 1817 show changesets not found in the destination
1818 1818 </td></tr>
1819 1819 <tr><td>
1820 1820 <a href="/help/paths">
1821 1821 paths
1822 1822 </a>
1823 1823 </td><td>
1824 1824 show aliases for remote repositories
1825 1825 </td></tr>
1826 1826 <tr><td>
1827 1827 <a href="/help/phase">
1828 1828 phase
1829 1829 </a>
1830 1830 </td><td>
1831 1831 set or show the current phase name
1832 1832 </td></tr>
1833 1833 <tr><td>
1834 1834 <a href="/help/recover">
1835 1835 recover
1836 1836 </a>
1837 1837 </td><td>
1838 1838 roll back an interrupted transaction
1839 1839 </td></tr>
1840 1840 <tr><td>
1841 1841 <a href="/help/rename">
1842 1842 rename
1843 1843 </a>
1844 1844 </td><td>
1845 1845 rename files; equivalent of copy + remove
1846 1846 </td></tr>
1847 1847 <tr><td>
1848 1848 <a href="/help/resolve">
1849 1849 resolve
1850 1850 </a>
1851 1851 </td><td>
1852 1852 redo merges or set/view the merge status of files
1853 1853 </td></tr>
1854 1854 <tr><td>
1855 1855 <a href="/help/revert">
1856 1856 revert
1857 1857 </a>
1858 1858 </td><td>
1859 1859 restore files to their checkout state
1860 1860 </td></tr>
1861 1861 <tr><td>
1862 1862 <a href="/help/root">
1863 1863 root
1864 1864 </a>
1865 1865 </td><td>
1866 1866 print the root (top) of the current working directory
1867 1867 </td></tr>
1868 1868 <tr><td>
1869 1869 <a href="/help/tag">
1870 1870 tag
1871 1871 </a>
1872 1872 </td><td>
1873 1873 add one or more tags for the current or given revision
1874 1874 </td></tr>
1875 1875 <tr><td>
1876 1876 <a href="/help/tags">
1877 1877 tags
1878 1878 </a>
1879 1879 </td><td>
1880 1880 list repository tags
1881 1881 </td></tr>
1882 1882 <tr><td>
1883 1883 <a href="/help/unbundle">
1884 1884 unbundle
1885 1885 </a>
1886 1886 </td><td>
1887 1887 apply one or more changegroup files
1888 1888 </td></tr>
1889 1889 <tr><td>
1890 1890 <a href="/help/verify">
1891 1891 verify
1892 1892 </a>
1893 1893 </td><td>
1894 1894 verify the integrity of the repository
1895 1895 </td></tr>
1896 1896 <tr><td>
1897 1897 <a href="/help/version">
1898 1898 version
1899 1899 </a>
1900 1900 </td><td>
1901 1901 output version and copyright information
1902 1902 </td></tr>
1903 1903 </table>
1904 1904 </div>
1905 1905 </div>
1906 1906
1907 1907 <script type="text/javascript">process_dates()</script>
1908 1908
1909 1909
1910 1910 </body>
1911 1911 </html>
1912 1912
1913 1913
1914 1914 $ get-with-headers.py 127.0.0.1:$HGPORT "help/add"
1915 1915 200 Script output follows
1916 1916
1917 1917 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1918 1918 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1919 1919 <head>
1920 1920 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1921 1921 <meta name="robots" content="index, nofollow" />
1922 1922 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1923 1923 <script type="text/javascript" src="/static/mercurial.js"></script>
1924 1924
1925 1925 <title>Help: add</title>
1926 1926 </head>
1927 1927 <body>
1928 1928
1929 1929 <div class="container">
1930 1930 <div class="menu">
1931 1931 <div class="logo">
1932 1932 <a href="http://mercurial.selenic.com/">
1933 1933 <img src="/static/hglogo.png" alt="mercurial" /></a>
1934 1934 </div>
1935 1935 <ul>
1936 1936 <li><a href="/shortlog">log</a></li>
1937 1937 <li><a href="/graph">graph</a></li>
1938 1938 <li><a href="/tags">tags</a></li>
1939 1939 <li><a href="/bookmarks">bookmarks</a></li>
1940 1940 <li><a href="/branches">branches</a></li>
1941 1941 </ul>
1942 1942 <ul>
1943 1943 <li class="active"><a href="/help">help</a></li>
1944 1944 </ul>
1945 1945 </div>
1946 1946
1947 1947 <div class="main">
1948 1948 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1949 1949 <h3>Help: add</h3>
1950 1950
1951 1951 <form class="search" action="/log">
1952 1952
1953 1953 <p><input name="rev" id="search1" type="text" size="30" /></p>
1954 1954 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1955 1955 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1956 1956 </form>
1957 1957 <div id="doc">
1958 1958 <p>
1959 1959 hg add [OPTION]... [FILE]...
1960 1960 </p>
1961 1961 <p>
1962 1962 add the specified files on the next commit
1963 1963 </p>
1964 1964 <p>
1965 1965 Schedule files to be version controlled and added to the
1966 1966 repository.
1967 1967 </p>
1968 1968 <p>
1969 1969 The files will be added to the repository at the next commit. To
1970 1970 undo an add before that, see &quot;hg forget&quot;.
1971 1971 </p>
1972 1972 <p>
1973 1973 If no names are given, add all files to the repository.
1974 1974 </p>
1975 1975 <p>
1976 1976 An example showing how new (unknown) files are added
1977 1977 automatically by &quot;hg add&quot;:
1978 1978 </p>
1979 1979 <pre>
1980 1980 \$ ls (re)
1981 1981 foo.c
1982 1982 \$ hg status (re)
1983 1983 ? foo.c
1984 1984 \$ hg add (re)
1985 1985 adding foo.c
1986 1986 \$ hg status (re)
1987 1987 A foo.c
1988 1988 </pre>
1989 1989 <p>
1990 1990 Returns 0 if all files are successfully added.
1991 1991 </p>
1992 1992 <p>
1993 1993 options ([+] can be repeated):
1994 1994 </p>
1995 1995 <table>
1996 1996 <tr><td>-I</td>
1997 1997 <td>--include PATTERN [+]</td>
1998 1998 <td>include names matching the given patterns</td></tr>
1999 1999 <tr><td>-X</td>
2000 2000 <td>--exclude PATTERN [+]</td>
2001 2001 <td>exclude names matching the given patterns</td></tr>
2002 2002 <tr><td>-S</td>
2003 2003 <td>--subrepos</td>
2004 2004 <td>recurse into subrepositories</td></tr>
2005 2005 <tr><td>-n</td>
2006 2006 <td>--dry-run</td>
2007 2007 <td>do not perform actions, just print output</td></tr>
2008 2008 </table>
2009 2009 <p>
2010 2010 global options ([+] can be repeated):
2011 2011 </p>
2012 2012 <table>
2013 2013 <tr><td>-R</td>
2014 2014 <td>--repository REPO</td>
2015 2015 <td>repository root directory or name of overlay bundle file</td></tr>
2016 2016 <tr><td></td>
2017 2017 <td>--cwd DIR</td>
2018 2018 <td>change working directory</td></tr>
2019 2019 <tr><td>-y</td>
2020 2020 <td>--noninteractive</td>
2021 2021 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2022 2022 <tr><td>-q</td>
2023 2023 <td>--quiet</td>
2024 2024 <td>suppress output</td></tr>
2025 2025 <tr><td>-v</td>
2026 2026 <td>--verbose</td>
2027 2027 <td>enable additional output</td></tr>
2028 2028 <tr><td></td>
2029 2029 <td>--config CONFIG [+]</td>
2030 2030 <td>set/override config option (use 'section.name=value')</td></tr>
2031 2031 <tr><td></td>
2032 2032 <td>--debug</td>
2033 2033 <td>enable debugging output</td></tr>
2034 2034 <tr><td></td>
2035 2035 <td>--debugger</td>
2036 2036 <td>start debugger</td></tr>
2037 2037 <tr><td></td>
2038 2038 <td>--encoding ENCODE</td>
2039 2039 <td>set the charset encoding (default: ascii)</td></tr>
2040 2040 <tr><td></td>
2041 2041 <td>--encodingmode MODE</td>
2042 2042 <td>set the charset encoding mode (default: strict)</td></tr>
2043 2043 <tr><td></td>
2044 2044 <td>--traceback</td>
2045 2045 <td>always print a traceback on exception</td></tr>
2046 2046 <tr><td></td>
2047 2047 <td>--time</td>
2048 2048 <td>time how long the command takes</td></tr>
2049 2049 <tr><td></td>
2050 2050 <td>--profile</td>
2051 2051 <td>print command execution profile</td></tr>
2052 2052 <tr><td></td>
2053 2053 <td>--version</td>
2054 2054 <td>output version information and exit</td></tr>
2055 2055 <tr><td>-h</td>
2056 2056 <td>--help</td>
2057 2057 <td>display help and exit</td></tr>
2058 2058 <tr><td></td>
2059 2059 <td>--hidden</td>
2060 2060 <td>consider hidden changesets</td></tr>
2061 2061 </table>
2062 2062
2063 2063 </div>
2064 2064 </div>
2065 2065 </div>
2066 2066
2067 2067 <script type="text/javascript">process_dates()</script>
2068 2068
2069 2069
2070 2070 </body>
2071 2071 </html>
2072 2072
2073 2073
2074 2074 $ get-with-headers.py 127.0.0.1:$HGPORT "help/remove"
2075 2075 200 Script output follows
2076 2076
2077 2077 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2078 2078 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2079 2079 <head>
2080 2080 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2081 2081 <meta name="robots" content="index, nofollow" />
2082 2082 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2083 2083 <script type="text/javascript" src="/static/mercurial.js"></script>
2084 2084
2085 2085 <title>Help: remove</title>
2086 2086 </head>
2087 2087 <body>
2088 2088
2089 2089 <div class="container">
2090 2090 <div class="menu">
2091 2091 <div class="logo">
2092 2092 <a href="http://mercurial.selenic.com/">
2093 2093 <img src="/static/hglogo.png" alt="mercurial" /></a>
2094 2094 </div>
2095 2095 <ul>
2096 2096 <li><a href="/shortlog">log</a></li>
2097 2097 <li><a href="/graph">graph</a></li>
2098 2098 <li><a href="/tags">tags</a></li>
2099 2099 <li><a href="/bookmarks">bookmarks</a></li>
2100 2100 <li><a href="/branches">branches</a></li>
2101 2101 </ul>
2102 2102 <ul>
2103 2103 <li class="active"><a href="/help">help</a></li>
2104 2104 </ul>
2105 2105 </div>
2106 2106
2107 2107 <div class="main">
2108 2108 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2109 2109 <h3>Help: remove</h3>
2110 2110
2111 2111 <form class="search" action="/log">
2112 2112
2113 2113 <p><input name="rev" id="search1" type="text" size="30" /></p>
2114 2114 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2115 2115 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2116 2116 </form>
2117 2117 <div id="doc">
2118 2118 <p>
2119 2119 hg remove [OPTION]... FILE...
2120 2120 </p>
2121 2121 <p>
2122 2122 aliases: rm
2123 2123 </p>
2124 2124 <p>
2125 2125 remove the specified files on the next commit
2126 2126 </p>
2127 2127 <p>
2128 2128 Schedule the indicated files for removal from the current branch.
2129 2129 </p>
2130 2130 <p>
2131 2131 This command schedules the files to be removed at the next commit.
2132 2132 To undo a remove before that, see &quot;hg revert&quot;. To undo added
2133 2133 files, see &quot;hg forget&quot;.
2134 2134 </p>
2135 2135 <p>
2136 2136 -A/--after can be used to remove only files that have already
2137 2137 been deleted, -f/--force can be used to force deletion, and -Af
2138 2138 can be used to remove files from the next revision without
2139 2139 deleting them from the working directory.
2140 2140 </p>
2141 2141 <p>
2142 2142 The following table details the behavior of remove for different
2143 2143 file states (columns) and option combinations (rows). The file
2144 2144 states are Added [A], Clean [C], Modified [M] and Missing [!]
2145 2145 (as reported by &quot;hg status&quot;). The actions are Warn, Remove
2146 2146 (from branch) and Delete (from disk):
2147 2147 </p>
2148 2148 <table>
2149 2149 <tr><td>opt/state</td>
2150 2150 <td>A</td>
2151 2151 <td>C</td>
2152 2152 <td>M</td>
2153 2153 <td>!</td></tr>
2154 2154 <tr><td>none</td>
2155 2155 <td>W</td>
2156 2156 <td>RD</td>
2157 2157 <td>W</td>
2158 2158 <td>R</td></tr>
2159 2159 <tr><td>-f</td>
2160 2160 <td>R</td>
2161 2161 <td>RD</td>
2162 2162 <td>RD</td>
2163 2163 <td>R</td></tr>
2164 2164 <tr><td>-A</td>
2165 2165 <td>W</td>
2166 2166 <td>W</td>
2167 2167 <td>W</td>
2168 2168 <td>R</td></tr>
2169 2169 <tr><td>-Af</td>
2170 2170 <td>R</td>
2171 2171 <td>R</td>
2172 2172 <td>R</td>
2173 2173 <td>R</td></tr>
2174 2174 </table>
2175 2175 <p>
2176 2176 Note that remove never deletes files in Added [A] state from the
2177 2177 working directory, not even if option --force is specified.
2178 2178 </p>
2179 2179 <p>
2180 2180 Returns 0 on success, 1 if any warnings encountered.
2181 2181 </p>
2182 2182 <p>
2183 2183 options ([+] can be repeated):
2184 2184 </p>
2185 2185 <table>
2186 2186 <tr><td>-A</td>
2187 2187 <td>--after</td>
2188 2188 <td>record delete for missing files</td></tr>
2189 2189 <tr><td>-f</td>
2190 2190 <td>--force</td>
2191 2191 <td>remove (and delete) file even if added or modified</td></tr>
2192 2192 <tr><td>-S</td>
2193 2193 <td>--subrepos</td>
2194 2194 <td>recurse into subrepositories</td></tr>
2195 2195 <tr><td>-I</td>
2196 2196 <td>--include PATTERN [+]</td>
2197 2197 <td>include names matching the given patterns</td></tr>
2198 2198 <tr><td>-X</td>
2199 2199 <td>--exclude PATTERN [+]</td>
2200 2200 <td>exclude names matching the given patterns</td></tr>
2201 2201 </table>
2202 2202 <p>
2203 2203 global options ([+] can be repeated):
2204 2204 </p>
2205 2205 <table>
2206 2206 <tr><td>-R</td>
2207 2207 <td>--repository REPO</td>
2208 2208 <td>repository root directory or name of overlay bundle file</td></tr>
2209 2209 <tr><td></td>
2210 2210 <td>--cwd DIR</td>
2211 2211 <td>change working directory</td></tr>
2212 2212 <tr><td>-y</td>
2213 2213 <td>--noninteractive</td>
2214 2214 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2215 2215 <tr><td>-q</td>
2216 2216 <td>--quiet</td>
2217 2217 <td>suppress output</td></tr>
2218 2218 <tr><td>-v</td>
2219 2219 <td>--verbose</td>
2220 2220 <td>enable additional output</td></tr>
2221 2221 <tr><td></td>
2222 2222 <td>--config CONFIG [+]</td>
2223 2223 <td>set/override config option (use 'section.name=value')</td></tr>
2224 2224 <tr><td></td>
2225 2225 <td>--debug</td>
2226 2226 <td>enable debugging output</td></tr>
2227 2227 <tr><td></td>
2228 2228 <td>--debugger</td>
2229 2229 <td>start debugger</td></tr>
2230 2230 <tr><td></td>
2231 2231 <td>--encoding ENCODE</td>
2232 2232 <td>set the charset encoding (default: ascii)</td></tr>
2233 2233 <tr><td></td>
2234 2234 <td>--encodingmode MODE</td>
2235 2235 <td>set the charset encoding mode (default: strict)</td></tr>
2236 2236 <tr><td></td>
2237 2237 <td>--traceback</td>
2238 2238 <td>always print a traceback on exception</td></tr>
2239 2239 <tr><td></td>
2240 2240 <td>--time</td>
2241 2241 <td>time how long the command takes</td></tr>
2242 2242 <tr><td></td>
2243 2243 <td>--profile</td>
2244 2244 <td>print command execution profile</td></tr>
2245 2245 <tr><td></td>
2246 2246 <td>--version</td>
2247 2247 <td>output version information and exit</td></tr>
2248 2248 <tr><td>-h</td>
2249 2249 <td>--help</td>
2250 2250 <td>display help and exit</td></tr>
2251 2251 <tr><td></td>
2252 2252 <td>--hidden</td>
2253 2253 <td>consider hidden changesets</td></tr>
2254 2254 </table>
2255 2255
2256 2256 </div>
2257 2257 </div>
2258 2258 </div>
2259 2259
2260 2260 <script type="text/javascript">process_dates()</script>
2261 2261
2262 2262
2263 2263 </body>
2264 2264 </html>
2265 2265
2266 2266
2267 2267 $ get-with-headers.py 127.0.0.1:$HGPORT "help/revisions"
2268 2268 200 Script output follows
2269 2269
2270 2270 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2271 2271 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2272 2272 <head>
2273 2273 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2274 2274 <meta name="robots" content="index, nofollow" />
2275 2275 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2276 2276 <script type="text/javascript" src="/static/mercurial.js"></script>
2277 2277
2278 2278 <title>Help: revisions</title>
2279 2279 </head>
2280 2280 <body>
2281 2281
2282 2282 <div class="container">
2283 2283 <div class="menu">
2284 2284 <div class="logo">
2285 2285 <a href="http://mercurial.selenic.com/">
2286 2286 <img src="/static/hglogo.png" alt="mercurial" /></a>
2287 2287 </div>
2288 2288 <ul>
2289 2289 <li><a href="/shortlog">log</a></li>
2290 2290 <li><a href="/graph">graph</a></li>
2291 2291 <li><a href="/tags">tags</a></li>
2292 2292 <li><a href="/bookmarks">bookmarks</a></li>
2293 2293 <li><a href="/branches">branches</a></li>
2294 2294 </ul>
2295 2295 <ul>
2296 2296 <li class="active"><a href="/help">help</a></li>
2297 2297 </ul>
2298 2298 </div>
2299 2299
2300 2300 <div class="main">
2301 2301 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2302 2302 <h3>Help: revisions</h3>
2303 2303
2304 2304 <form class="search" action="/log">
2305 2305
2306 2306 <p><input name="rev" id="search1" type="text" size="30" /></p>
2307 2307 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2308 2308 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2309 2309 </form>
2310 2310 <div id="doc">
2311 2311 <h1>Specifying Single Revisions</h1>
2312 2312 <p>
2313 2313 Mercurial supports several ways to specify individual revisions.
2314 2314 </p>
2315 2315 <p>
2316 2316 A plain integer is treated as a revision number. Negative integers are
2317 2317 treated as sequential offsets from the tip, with -1 denoting the tip,
2318 2318 -2 denoting the revision prior to the tip, and so forth.
2319 2319 </p>
2320 2320 <p>
2321 2321 A 40-digit hexadecimal string is treated as a unique revision
2322 2322 identifier.
2323 2323 </p>
2324 2324 <p>
2325 2325 A hexadecimal string less than 40 characters long is treated as a
2326 2326 unique revision identifier and is referred to as a short-form
2327 2327 identifier. A short-form identifier is only valid if it is the prefix
2328 2328 of exactly one full-length identifier.
2329 2329 </p>
2330 2330 <p>
2331 2331 Any other string is treated as a bookmark, tag, or branch name. A
2332 2332 bookmark is a movable pointer to a revision. A tag is a permanent name
2333 2333 associated with a revision. A branch name denotes the tipmost open branch head
2334 2334 of that branch - or if they are all closed, the tipmost closed head of the
2335 2335 branch. Bookmark, tag, and branch names must not contain the &quot;:&quot; character.
2336 2336 </p>
2337 2337 <p>
2338 2338 The reserved name &quot;tip&quot; always identifies the most recent revision.
2339 2339 </p>
2340 2340 <p>
2341 2341 The reserved name &quot;null&quot; indicates the null revision. This is the
2342 2342 revision of an empty repository, and the parent of revision 0.
2343 2343 </p>
2344 2344 <p>
2345 2345 The reserved name &quot;.&quot; indicates the working directory parent. If no
2346 2346 working directory is checked out, it is equivalent to null. If an
2347 2347 uncommitted merge is in progress, &quot;.&quot; is the revision of the first
2348 2348 parent.
2349 2349 </p>
2350 2350
2351 2351 </div>
2352 2352 </div>
2353 2353 </div>
2354 2354
2355 2355 <script type="text/javascript">process_dates()</script>
2356 2356
2357 2357
2358 2358 </body>
2359 2359 </html>
2360 2360
2361 2361
2362 2362 $ killdaemons.py
2363 2363
2364 2364 #endif
General Comments 0
You need to be logged in to leave comments. Login now