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