##// END OF EJS Templates
dispatch: fix typo suggestion for disabled extension...
Martin von Zweigbergk -
r33327:68b7ceda default
parent child Browse files
Show More
@@ -1,660 +1,664 b''
1 # extensions.py - extension handling for mercurial
1 # extensions.py - extension handling for mercurial
2 #
2 #
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import imp
10 import imp
11 import inspect
11 import inspect
12 import os
12 import os
13
13
14 from .i18n import (
14 from .i18n import (
15 _,
15 _,
16 gettext,
16 gettext,
17 )
17 )
18
18
19 from . import (
19 from . import (
20 cmdutil,
20 cmdutil,
21 configitems,
21 configitems,
22 encoding,
22 encoding,
23 error,
23 error,
24 pycompat,
24 pycompat,
25 util,
25 util,
26 )
26 )
27
27
28 _extensions = {}
28 _extensions = {}
29 _disabledextensions = {}
29 _disabledextensions = {}
30 _aftercallbacks = {}
30 _aftercallbacks = {}
31 _order = []
31 _order = []
32 _builtin = {'hbisect', 'bookmarks', 'parentrevspec', 'progress', 'interhg',
32 _builtin = {'hbisect', 'bookmarks', 'parentrevspec', 'progress', 'interhg',
33 'inotify', 'hgcia'}
33 'inotify', 'hgcia'}
34
34
35 def extensions(ui=None):
35 def extensions(ui=None):
36 if ui:
36 if ui:
37 def enabled(name):
37 def enabled(name):
38 for format in ['%s', 'hgext.%s']:
38 for format in ['%s', 'hgext.%s']:
39 conf = ui.config('extensions', format % name)
39 conf = ui.config('extensions', format % name)
40 if conf is not None and not conf.startswith('!'):
40 if conf is not None and not conf.startswith('!'):
41 return True
41 return True
42 else:
42 else:
43 enabled = lambda name: True
43 enabled = lambda name: True
44 for name in _order:
44 for name in _order:
45 module = _extensions[name]
45 module = _extensions[name]
46 if module and enabled(name):
46 if module and enabled(name):
47 yield name, module
47 yield name, module
48
48
49 def find(name):
49 def find(name):
50 '''return module with given extension name'''
50 '''return module with given extension name'''
51 mod = None
51 mod = None
52 try:
52 try:
53 mod = _extensions[name]
53 mod = _extensions[name]
54 except KeyError:
54 except KeyError:
55 for k, v in _extensions.iteritems():
55 for k, v in _extensions.iteritems():
56 if k.endswith('.' + name) or k.endswith('/' + name):
56 if k.endswith('.' + name) or k.endswith('/' + name):
57 mod = v
57 mod = v
58 break
58 break
59 if not mod:
59 if not mod:
60 raise KeyError(name)
60 raise KeyError(name)
61 return mod
61 return mod
62
62
63 def loadpath(path, module_name):
63 def loadpath(path, module_name):
64 module_name = module_name.replace('.', '_')
64 module_name = module_name.replace('.', '_')
65 path = util.normpath(util.expandpath(path))
65 path = util.normpath(util.expandpath(path))
66 module_name = pycompat.fsdecode(module_name)
66 module_name = pycompat.fsdecode(module_name)
67 path = pycompat.fsdecode(path)
67 path = pycompat.fsdecode(path)
68 if os.path.isdir(path):
68 if os.path.isdir(path):
69 # module/__init__.py style
69 # module/__init__.py style
70 d, f = os.path.split(path)
70 d, f = os.path.split(path)
71 fd, fpath, desc = imp.find_module(f, [d])
71 fd, fpath, desc = imp.find_module(f, [d])
72 return imp.load_module(module_name, fd, fpath, desc)
72 return imp.load_module(module_name, fd, fpath, desc)
73 else:
73 else:
74 try:
74 try:
75 return imp.load_source(module_name, path)
75 return imp.load_source(module_name, path)
76 except IOError as exc:
76 except IOError as exc:
77 if not exc.filename:
77 if not exc.filename:
78 exc.filename = path # python does not fill this
78 exc.filename = path # python does not fill this
79 raise
79 raise
80
80
81 def _importh(name):
81 def _importh(name):
82 """import and return the <name> module"""
82 """import and return the <name> module"""
83 mod = __import__(pycompat.sysstr(name))
83 mod = __import__(pycompat.sysstr(name))
84 components = name.split('.')
84 components = name.split('.')
85 for comp in components[1:]:
85 for comp in components[1:]:
86 mod = getattr(mod, comp)
86 mod = getattr(mod, comp)
87 return mod
87 return mod
88
88
89 def _importext(name, path=None, reportfunc=None):
89 def _importext(name, path=None, reportfunc=None):
90 if path:
90 if path:
91 # the module will be loaded in sys.modules
91 # the module will be loaded in sys.modules
92 # choose an unique name so that it doesn't
92 # choose an unique name so that it doesn't
93 # conflicts with other modules
93 # conflicts with other modules
94 mod = loadpath(path, 'hgext.%s' % name)
94 mod = loadpath(path, 'hgext.%s' % name)
95 else:
95 else:
96 try:
96 try:
97 mod = _importh("hgext.%s" % name)
97 mod = _importh("hgext.%s" % name)
98 except ImportError as err:
98 except ImportError as err:
99 if reportfunc:
99 if reportfunc:
100 reportfunc(err, "hgext.%s" % name, "hgext3rd.%s" % name)
100 reportfunc(err, "hgext.%s" % name, "hgext3rd.%s" % name)
101 try:
101 try:
102 mod = _importh("hgext3rd.%s" % name)
102 mod = _importh("hgext3rd.%s" % name)
103 except ImportError as err:
103 except ImportError as err:
104 if reportfunc:
104 if reportfunc:
105 reportfunc(err, "hgext3rd.%s" % name, name)
105 reportfunc(err, "hgext3rd.%s" % name, name)
106 mod = _importh(name)
106 mod = _importh(name)
107 return mod
107 return mod
108
108
109 def _forbytes(inst):
109 def _forbytes(inst):
110 """Portably format an import error into a form suitable for
110 """Portably format an import error into a form suitable for
111 %-formatting into bytestrings."""
111 %-formatting into bytestrings."""
112 return encoding.strtolocal(str(inst))
112 return encoding.strtolocal(str(inst))
113
113
114 def _reportimporterror(ui, err, failed, next):
114 def _reportimporterror(ui, err, failed, next):
115 # note: this ui.debug happens before --debug is processed,
115 # note: this ui.debug happens before --debug is processed,
116 # Use --config ui.debug=1 to see them.
116 # Use --config ui.debug=1 to see them.
117 ui.debug('could not import %s (%s): trying %s\n'
117 ui.debug('could not import %s (%s): trying %s\n'
118 % (failed, _forbytes(err), next))
118 % (failed, _forbytes(err), next))
119 if ui.debugflag:
119 if ui.debugflag:
120 ui.traceback()
120 ui.traceback()
121
121
122 # attributes set by registrar.command
122 # attributes set by registrar.command
123 _cmdfuncattrs = ('norepo', 'optionalrepo', 'inferrepo')
123 _cmdfuncattrs = ('norepo', 'optionalrepo', 'inferrepo')
124
124
125 def _validatecmdtable(ui, cmdtable):
125 def _validatecmdtable(ui, cmdtable):
126 """Check if extension commands have required attributes"""
126 """Check if extension commands have required attributes"""
127 for c, e in cmdtable.iteritems():
127 for c, e in cmdtable.iteritems():
128 f = e[0]
128 f = e[0]
129 if getattr(f, '_deprecatedregistrar', False):
129 if getattr(f, '_deprecatedregistrar', False):
130 ui.deprecwarn("cmdutil.command is deprecated, use "
130 ui.deprecwarn("cmdutil.command is deprecated, use "
131 "registrar.command to register '%s'" % c, '4.6')
131 "registrar.command to register '%s'" % c, '4.6')
132 missing = [a for a in _cmdfuncattrs if not util.safehasattr(f, a)]
132 missing = [a for a in _cmdfuncattrs if not util.safehasattr(f, a)]
133 if not missing:
133 if not missing:
134 continue
134 continue
135 raise error.ProgrammingError(
135 raise error.ProgrammingError(
136 'missing attributes: %s' % ', '.join(missing),
136 'missing attributes: %s' % ', '.join(missing),
137 hint="use @command decorator to register '%s'" % c)
137 hint="use @command decorator to register '%s'" % c)
138
138
139 def load(ui, name, path):
139 def load(ui, name, path):
140 if name.startswith('hgext.') or name.startswith('hgext/'):
140 if name.startswith('hgext.') or name.startswith('hgext/'):
141 shortname = name[6:]
141 shortname = name[6:]
142 else:
142 else:
143 shortname = name
143 shortname = name
144 if shortname in _builtin:
144 if shortname in _builtin:
145 return None
145 return None
146 if shortname in _extensions:
146 if shortname in _extensions:
147 return _extensions[shortname]
147 return _extensions[shortname]
148 _extensions[shortname] = None
148 _extensions[shortname] = None
149 mod = _importext(name, path, bind(_reportimporterror, ui))
149 mod = _importext(name, path, bind(_reportimporterror, ui))
150
150
151 # Before we do anything with the extension, check against minimum stated
151 # Before we do anything with the extension, check against minimum stated
152 # compatibility. This gives extension authors a mechanism to have their
152 # compatibility. This gives extension authors a mechanism to have their
153 # extensions short circuit when loaded with a known incompatible version
153 # extensions short circuit when loaded with a known incompatible version
154 # of Mercurial.
154 # of Mercurial.
155 minver = getattr(mod, 'minimumhgversion', None)
155 minver = getattr(mod, 'minimumhgversion', None)
156 if minver and util.versiontuple(minver, 2) > util.versiontuple(n=2):
156 if minver and util.versiontuple(minver, 2) > util.versiontuple(n=2):
157 ui.warn(_('(third party extension %s requires version %s or newer '
157 ui.warn(_('(third party extension %s requires version %s or newer '
158 'of Mercurial; disabling)\n') % (shortname, minver))
158 'of Mercurial; disabling)\n') % (shortname, minver))
159 return
159 return
160 _validatecmdtable(ui, getattr(mod, 'cmdtable', {}))
160 _validatecmdtable(ui, getattr(mod, 'cmdtable', {}))
161
161
162 _extensions[shortname] = mod
162 _extensions[shortname] = mod
163 _order.append(shortname)
163 _order.append(shortname)
164 for fn in _aftercallbacks.get(shortname, []):
164 for fn in _aftercallbacks.get(shortname, []):
165 fn(loaded=True)
165 fn(loaded=True)
166 return mod
166 return mod
167
167
168 def _runuisetup(name, ui):
168 def _runuisetup(name, ui):
169 uisetup = getattr(_extensions[name], 'uisetup', None)
169 uisetup = getattr(_extensions[name], 'uisetup', None)
170 if uisetup:
170 if uisetup:
171 try:
171 try:
172 uisetup(ui)
172 uisetup(ui)
173 except Exception as inst:
173 except Exception as inst:
174 ui.traceback()
174 ui.traceback()
175 msg = _forbytes(inst)
175 msg = _forbytes(inst)
176 ui.warn(_("*** failed to set up extension %s: %s\n") % (name, msg))
176 ui.warn(_("*** failed to set up extension %s: %s\n") % (name, msg))
177 return False
177 return False
178 return True
178 return True
179
179
180 def _runextsetup(name, ui):
180 def _runextsetup(name, ui):
181 extsetup = getattr(_extensions[name], 'extsetup', None)
181 extsetup = getattr(_extensions[name], 'extsetup', None)
182 if extsetup:
182 if extsetup:
183 try:
183 try:
184 try:
184 try:
185 extsetup(ui)
185 extsetup(ui)
186 except TypeError:
186 except TypeError:
187 if inspect.getargspec(extsetup).args:
187 if inspect.getargspec(extsetup).args:
188 raise
188 raise
189 extsetup() # old extsetup with no ui argument
189 extsetup() # old extsetup with no ui argument
190 except Exception as inst:
190 except Exception as inst:
191 ui.traceback()
191 ui.traceback()
192 msg = _forbytes(inst)
192 msg = _forbytes(inst)
193 ui.warn(_("*** failed to set up extension %s: %s\n") % (name, msg))
193 ui.warn(_("*** failed to set up extension %s: %s\n") % (name, msg))
194 return False
194 return False
195 return True
195 return True
196
196
197 def loadall(ui, whitelist=None):
197 def loadall(ui, whitelist=None):
198 result = ui.configitems("extensions")
198 result = ui.configitems("extensions")
199 if whitelist is not None:
199 if whitelist is not None:
200 result = [(k, v) for (k, v) in result if k in whitelist]
200 result = [(k, v) for (k, v) in result if k in whitelist]
201 newindex = len(_order)
201 newindex = len(_order)
202 for (name, path) in result:
202 for (name, path) in result:
203 if path:
203 if path:
204 if path[0:1] == '!':
204 if path[0:1] == '!':
205 _disabledextensions[name] = path[1:]
205 _disabledextensions[name] = path[1:]
206 continue
206 continue
207 try:
207 try:
208 load(ui, name, path)
208 load(ui, name, path)
209 except Exception as inst:
209 except Exception as inst:
210 msg = _forbytes(inst)
210 msg = _forbytes(inst)
211 if path:
211 if path:
212 ui.warn(_("*** failed to import extension %s from %s: %s\n")
212 ui.warn(_("*** failed to import extension %s from %s: %s\n")
213 % (name, path, msg))
213 % (name, path, msg))
214 else:
214 else:
215 ui.warn(_("*** failed to import extension %s: %s\n")
215 ui.warn(_("*** failed to import extension %s: %s\n")
216 % (name, msg))
216 % (name, msg))
217 if isinstance(inst, error.Hint) and inst.hint:
217 if isinstance(inst, error.Hint) and inst.hint:
218 ui.warn(_("*** (%s)\n") % inst.hint)
218 ui.warn(_("*** (%s)\n") % inst.hint)
219 ui.traceback()
219 ui.traceback()
220
220
221 broken = set()
221 broken = set()
222 for name in _order[newindex:]:
222 for name in _order[newindex:]:
223 if not _runuisetup(name, ui):
223 if not _runuisetup(name, ui):
224 broken.add(name)
224 broken.add(name)
225
225
226 for name in _order[newindex:]:
226 for name in _order[newindex:]:
227 if name in broken:
227 if name in broken:
228 continue
228 continue
229 if not _runextsetup(name, ui):
229 if not _runextsetup(name, ui):
230 broken.add(name)
230 broken.add(name)
231
231
232 for name in broken:
232 for name in broken:
233 _extensions[name] = None
233 _extensions[name] = None
234
234
235 # Call aftercallbacks that were never met.
235 # Call aftercallbacks that were never met.
236 for shortname in _aftercallbacks:
236 for shortname in _aftercallbacks:
237 if shortname in _extensions:
237 if shortname in _extensions:
238 continue
238 continue
239
239
240 for fn in _aftercallbacks[shortname]:
240 for fn in _aftercallbacks[shortname]:
241 fn(loaded=False)
241 fn(loaded=False)
242
242
243 # loadall() is called multiple times and lingering _aftercallbacks
243 # loadall() is called multiple times and lingering _aftercallbacks
244 # entries could result in double execution. See issue4646.
244 # entries could result in double execution. See issue4646.
245 _aftercallbacks.clear()
245 _aftercallbacks.clear()
246
246
247 # delay importing avoids cyclic dependency (especially commands)
247 # delay importing avoids cyclic dependency (especially commands)
248 from . import (
248 from . import (
249 color,
249 color,
250 commands,
250 commands,
251 fileset,
251 fileset,
252 revset,
252 revset,
253 templatefilters,
253 templatefilters,
254 templatekw,
254 templatekw,
255 templater,
255 templater,
256 )
256 )
257
257
258 # list of (objname, loadermod, loadername) tuple:
258 # list of (objname, loadermod, loadername) tuple:
259 # - objname is the name of an object in extension module,
259 # - objname is the name of an object in extension module,
260 # from which extra information is loaded
260 # from which extra information is loaded
261 # - loadermod is the module where loader is placed
261 # - loadermod is the module where loader is placed
262 # - loadername is the name of the function,
262 # - loadername is the name of the function,
263 # which takes (ui, extensionname, extraobj) arguments
263 # which takes (ui, extensionname, extraobj) arguments
264 extraloaders = [
264 extraloaders = [
265 ('cmdtable', commands, 'loadcmdtable'),
265 ('cmdtable', commands, 'loadcmdtable'),
266 ('colortable', color, 'loadcolortable'),
266 ('colortable', color, 'loadcolortable'),
267 ('configtable', configitems, 'loadconfigtable'),
267 ('configtable', configitems, 'loadconfigtable'),
268 ('filesetpredicate', fileset, 'loadpredicate'),
268 ('filesetpredicate', fileset, 'loadpredicate'),
269 ('revsetpredicate', revset, 'loadpredicate'),
269 ('revsetpredicate', revset, 'loadpredicate'),
270 ('templatefilter', templatefilters, 'loadfilter'),
270 ('templatefilter', templatefilters, 'loadfilter'),
271 ('templatefunc', templater, 'loadfunction'),
271 ('templatefunc', templater, 'loadfunction'),
272 ('templatekeyword', templatekw, 'loadkeyword'),
272 ('templatekeyword', templatekw, 'loadkeyword'),
273 ]
273 ]
274
274
275 for name in _order[newindex:]:
275 for name in _order[newindex:]:
276 module = _extensions[name]
276 module = _extensions[name]
277 if not module:
277 if not module:
278 continue # loading this module failed
278 continue # loading this module failed
279
279
280 for objname, loadermod, loadername in extraloaders:
280 for objname, loadermod, loadername in extraloaders:
281 extraobj = getattr(module, objname, None)
281 extraobj = getattr(module, objname, None)
282 if extraobj is not None:
282 if extraobj is not None:
283 getattr(loadermod, loadername)(ui, name, extraobj)
283 getattr(loadermod, loadername)(ui, name, extraobj)
284
284
285 def afterloaded(extension, callback):
285 def afterloaded(extension, callback):
286 '''Run the specified function after a named extension is loaded.
286 '''Run the specified function after a named extension is loaded.
287
287
288 If the named extension is already loaded, the callback will be called
288 If the named extension is already loaded, the callback will be called
289 immediately.
289 immediately.
290
290
291 If the named extension never loads, the callback will be called after
291 If the named extension never loads, the callback will be called after
292 all extensions have been loaded.
292 all extensions have been loaded.
293
293
294 The callback receives the named argument ``loaded``, which is a boolean
294 The callback receives the named argument ``loaded``, which is a boolean
295 indicating whether the dependent extension actually loaded.
295 indicating whether the dependent extension actually loaded.
296 '''
296 '''
297
297
298 if extension in _extensions:
298 if extension in _extensions:
299 # Report loaded as False if the extension is disabled
299 # Report loaded as False if the extension is disabled
300 loaded = (_extensions[extension] is not None)
300 loaded = (_extensions[extension] is not None)
301 callback(loaded=loaded)
301 callback(loaded=loaded)
302 else:
302 else:
303 _aftercallbacks.setdefault(extension, []).append(callback)
303 _aftercallbacks.setdefault(extension, []).append(callback)
304
304
305 def bind(func, *args):
305 def bind(func, *args):
306 '''Partial function application
306 '''Partial function application
307
307
308 Returns a new function that is the partial application of args and kwargs
308 Returns a new function that is the partial application of args and kwargs
309 to func. For example,
309 to func. For example,
310
310
311 f(1, 2, bar=3) === bind(f, 1)(2, bar=3)'''
311 f(1, 2, bar=3) === bind(f, 1)(2, bar=3)'''
312 assert callable(func)
312 assert callable(func)
313 def closure(*a, **kw):
313 def closure(*a, **kw):
314 return func(*(args + a), **kw)
314 return func(*(args + a), **kw)
315 return closure
315 return closure
316
316
317 def _updatewrapper(wrap, origfn, unboundwrapper):
317 def _updatewrapper(wrap, origfn, unboundwrapper):
318 '''Copy and add some useful attributes to wrapper'''
318 '''Copy and add some useful attributes to wrapper'''
319 wrap.__module__ = getattr(origfn, '__module__')
319 wrap.__module__ = getattr(origfn, '__module__')
320 wrap.__doc__ = getattr(origfn, '__doc__')
320 wrap.__doc__ = getattr(origfn, '__doc__')
321 wrap.__dict__.update(getattr(origfn, '__dict__', {}))
321 wrap.__dict__.update(getattr(origfn, '__dict__', {}))
322 wrap._origfunc = origfn
322 wrap._origfunc = origfn
323 wrap._unboundwrapper = unboundwrapper
323 wrap._unboundwrapper = unboundwrapper
324
324
325 def wrapcommand(table, command, wrapper, synopsis=None, docstring=None):
325 def wrapcommand(table, command, wrapper, synopsis=None, docstring=None):
326 '''Wrap the command named `command' in table
326 '''Wrap the command named `command' in table
327
327
328 Replace command in the command table with wrapper. The wrapped command will
328 Replace command in the command table with wrapper. The wrapped command will
329 be inserted into the command table specified by the table argument.
329 be inserted into the command table specified by the table argument.
330
330
331 The wrapper will be called like
331 The wrapper will be called like
332
332
333 wrapper(orig, *args, **kwargs)
333 wrapper(orig, *args, **kwargs)
334
334
335 where orig is the original (wrapped) function, and *args, **kwargs
335 where orig is the original (wrapped) function, and *args, **kwargs
336 are the arguments passed to it.
336 are the arguments passed to it.
337
337
338 Optionally append to the command synopsis and docstring, used for help.
338 Optionally append to the command synopsis and docstring, used for help.
339 For example, if your extension wraps the ``bookmarks`` command to add the
339 For example, if your extension wraps the ``bookmarks`` command to add the
340 flags ``--remote`` and ``--all`` you might call this function like so:
340 flags ``--remote`` and ``--all`` you might call this function like so:
341
341
342 synopsis = ' [-a] [--remote]'
342 synopsis = ' [-a] [--remote]'
343 docstring = """
343 docstring = """
344
344
345 The ``remotenames`` extension adds the ``--remote`` and ``--all`` (``-a``)
345 The ``remotenames`` extension adds the ``--remote`` and ``--all`` (``-a``)
346 flags to the bookmarks command. Either flag will show the remote bookmarks
346 flags to the bookmarks command. Either flag will show the remote bookmarks
347 known to the repository; ``--remote`` will also suppress the output of the
347 known to the repository; ``--remote`` will also suppress the output of the
348 local bookmarks.
348 local bookmarks.
349 """
349 """
350
350
351 extensions.wrapcommand(commands.table, 'bookmarks', exbookmarks,
351 extensions.wrapcommand(commands.table, 'bookmarks', exbookmarks,
352 synopsis, docstring)
352 synopsis, docstring)
353 '''
353 '''
354 assert callable(wrapper)
354 assert callable(wrapper)
355 aliases, entry = cmdutil.findcmd(command, table)
355 aliases, entry = cmdutil.findcmd(command, table)
356 for alias, e in table.iteritems():
356 for alias, e in table.iteritems():
357 if e is entry:
357 if e is entry:
358 key = alias
358 key = alias
359 break
359 break
360
360
361 origfn = entry[0]
361 origfn = entry[0]
362 wrap = bind(util.checksignature(wrapper), util.checksignature(origfn))
362 wrap = bind(util.checksignature(wrapper), util.checksignature(origfn))
363 _updatewrapper(wrap, origfn, wrapper)
363 _updatewrapper(wrap, origfn, wrapper)
364 if docstring is not None:
364 if docstring is not None:
365 wrap.__doc__ += docstring
365 wrap.__doc__ += docstring
366
366
367 newentry = list(entry)
367 newentry = list(entry)
368 newentry[0] = wrap
368 newentry[0] = wrap
369 if synopsis is not None:
369 if synopsis is not None:
370 newentry[2] += synopsis
370 newentry[2] += synopsis
371 table[key] = tuple(newentry)
371 table[key] = tuple(newentry)
372 return entry
372 return entry
373
373
374 def wrapfilecache(cls, propname, wrapper):
374 def wrapfilecache(cls, propname, wrapper):
375 """Wraps a filecache property.
375 """Wraps a filecache property.
376
376
377 These can't be wrapped using the normal wrapfunction.
377 These can't be wrapped using the normal wrapfunction.
378 """
378 """
379 assert callable(wrapper)
379 assert callable(wrapper)
380 for currcls in cls.__mro__:
380 for currcls in cls.__mro__:
381 if propname in currcls.__dict__:
381 if propname in currcls.__dict__:
382 origfn = currcls.__dict__[propname].func
382 origfn = currcls.__dict__[propname].func
383 assert callable(origfn)
383 assert callable(origfn)
384 def wrap(*args, **kwargs):
384 def wrap(*args, **kwargs):
385 return wrapper(origfn, *args, **kwargs)
385 return wrapper(origfn, *args, **kwargs)
386 currcls.__dict__[propname].func = wrap
386 currcls.__dict__[propname].func = wrap
387 break
387 break
388
388
389 if currcls is object:
389 if currcls is object:
390 raise AttributeError(
390 raise AttributeError(
391 _("type '%s' has no property '%s'") % (cls, propname))
391 _("type '%s' has no property '%s'") % (cls, propname))
392
392
393 def wrapfunction(container, funcname, wrapper):
393 def wrapfunction(container, funcname, wrapper):
394 '''Wrap the function named funcname in container
394 '''Wrap the function named funcname in container
395
395
396 Replace the funcname member in the given container with the specified
396 Replace the funcname member in the given container with the specified
397 wrapper. The container is typically a module, class, or instance.
397 wrapper. The container is typically a module, class, or instance.
398
398
399 The wrapper will be called like
399 The wrapper will be called like
400
400
401 wrapper(orig, *args, **kwargs)
401 wrapper(orig, *args, **kwargs)
402
402
403 where orig is the original (wrapped) function, and *args, **kwargs
403 where orig is the original (wrapped) function, and *args, **kwargs
404 are the arguments passed to it.
404 are the arguments passed to it.
405
405
406 Wrapping methods of the repository object is not recommended since
406 Wrapping methods of the repository object is not recommended since
407 it conflicts with extensions that extend the repository by
407 it conflicts with extensions that extend the repository by
408 subclassing. All extensions that need to extend methods of
408 subclassing. All extensions that need to extend methods of
409 localrepository should use this subclassing trick: namely,
409 localrepository should use this subclassing trick: namely,
410 reposetup() should look like
410 reposetup() should look like
411
411
412 def reposetup(ui, repo):
412 def reposetup(ui, repo):
413 class myrepo(repo.__class__):
413 class myrepo(repo.__class__):
414 def whatever(self, *args, **kwargs):
414 def whatever(self, *args, **kwargs):
415 [...extension stuff...]
415 [...extension stuff...]
416 super(myrepo, self).whatever(*args, **kwargs)
416 super(myrepo, self).whatever(*args, **kwargs)
417 [...extension stuff...]
417 [...extension stuff...]
418
418
419 repo.__class__ = myrepo
419 repo.__class__ = myrepo
420
420
421 In general, combining wrapfunction() with subclassing does not
421 In general, combining wrapfunction() with subclassing does not
422 work. Since you cannot control what other extensions are loaded by
422 work. Since you cannot control what other extensions are loaded by
423 your end users, you should play nicely with others by using the
423 your end users, you should play nicely with others by using the
424 subclass trick.
424 subclass trick.
425 '''
425 '''
426 assert callable(wrapper)
426 assert callable(wrapper)
427
427
428 origfn = getattr(container, funcname)
428 origfn = getattr(container, funcname)
429 assert callable(origfn)
429 assert callable(origfn)
430 wrap = bind(wrapper, origfn)
430 wrap = bind(wrapper, origfn)
431 _updatewrapper(wrap, origfn, wrapper)
431 _updatewrapper(wrap, origfn, wrapper)
432 setattr(container, funcname, wrap)
432 setattr(container, funcname, wrap)
433 return origfn
433 return origfn
434
434
435 def unwrapfunction(container, funcname, wrapper=None):
435 def unwrapfunction(container, funcname, wrapper=None):
436 '''undo wrapfunction
436 '''undo wrapfunction
437
437
438 If wrappers is None, undo the last wrap. Otherwise removes the wrapper
438 If wrappers is None, undo the last wrap. Otherwise removes the wrapper
439 from the chain of wrappers.
439 from the chain of wrappers.
440
440
441 Return the removed wrapper.
441 Return the removed wrapper.
442 Raise IndexError if wrapper is None and nothing to unwrap; ValueError if
442 Raise IndexError if wrapper is None and nothing to unwrap; ValueError if
443 wrapper is not None but is not found in the wrapper chain.
443 wrapper is not None but is not found in the wrapper chain.
444 '''
444 '''
445 chain = getwrapperchain(container, funcname)
445 chain = getwrapperchain(container, funcname)
446 origfn = chain.pop()
446 origfn = chain.pop()
447 if wrapper is None:
447 if wrapper is None:
448 wrapper = chain[0]
448 wrapper = chain[0]
449 chain.remove(wrapper)
449 chain.remove(wrapper)
450 setattr(container, funcname, origfn)
450 setattr(container, funcname, origfn)
451 for w in reversed(chain):
451 for w in reversed(chain):
452 wrapfunction(container, funcname, w)
452 wrapfunction(container, funcname, w)
453 return wrapper
453 return wrapper
454
454
455 def getwrapperchain(container, funcname):
455 def getwrapperchain(container, funcname):
456 '''get a chain of wrappers of a function
456 '''get a chain of wrappers of a function
457
457
458 Return a list of functions: [newest wrapper, ..., oldest wrapper, origfunc]
458 Return a list of functions: [newest wrapper, ..., oldest wrapper, origfunc]
459
459
460 The wrapper functions are the ones passed to wrapfunction, whose first
460 The wrapper functions are the ones passed to wrapfunction, whose first
461 argument is origfunc.
461 argument is origfunc.
462 '''
462 '''
463 result = []
463 result = []
464 fn = getattr(container, funcname)
464 fn = getattr(container, funcname)
465 while fn:
465 while fn:
466 assert callable(fn)
466 assert callable(fn)
467 result.append(getattr(fn, '_unboundwrapper', fn))
467 result.append(getattr(fn, '_unboundwrapper', fn))
468 fn = getattr(fn, '_origfunc', None)
468 fn = getattr(fn, '_origfunc', None)
469 return result
469 return result
470
470
471 def _disabledpaths(strip_init=False):
471 def _disabledpaths(strip_init=False):
472 '''find paths of disabled extensions. returns a dict of {name: path}
472 '''find paths of disabled extensions. returns a dict of {name: path}
473 removes /__init__.py from packages if strip_init is True'''
473 removes /__init__.py from packages if strip_init is True'''
474 import hgext
474 import hgext
475 extpath = os.path.dirname(
475 extpath = os.path.dirname(
476 os.path.abspath(pycompat.fsencode(hgext.__file__)))
476 os.path.abspath(pycompat.fsencode(hgext.__file__)))
477 try: # might not be a filesystem path
477 try: # might not be a filesystem path
478 files = os.listdir(extpath)
478 files = os.listdir(extpath)
479 except OSError:
479 except OSError:
480 return {}
480 return {}
481
481
482 exts = {}
482 exts = {}
483 for e in files:
483 for e in files:
484 if e.endswith('.py'):
484 if e.endswith('.py'):
485 name = e.rsplit('.', 1)[0]
485 name = e.rsplit('.', 1)[0]
486 path = os.path.join(extpath, e)
486 path = os.path.join(extpath, e)
487 else:
487 else:
488 name = e
488 name = e
489 path = os.path.join(extpath, e, '__init__.py')
489 path = os.path.join(extpath, e, '__init__.py')
490 if not os.path.exists(path):
490 if not os.path.exists(path):
491 continue
491 continue
492 if strip_init:
492 if strip_init:
493 path = os.path.dirname(path)
493 path = os.path.dirname(path)
494 if name in exts or name in _order or name == '__init__':
494 if name in exts or name in _order or name == '__init__':
495 continue
495 continue
496 exts[name] = path
496 exts[name] = path
497 exts.update(_disabledextensions)
497 for name, path in _disabledextensions.iteritems():
498 # If no path was provided for a disabled extension (e.g. "color=!"),
499 # don't replace the path we already found by the scan above.
500 if path:
501 exts[name] = path
498 return exts
502 return exts
499
503
500 def _moduledoc(file):
504 def _moduledoc(file):
501 '''return the top-level python documentation for the given file
505 '''return the top-level python documentation for the given file
502
506
503 Loosely inspired by pydoc.source_synopsis(), but rewritten to
507 Loosely inspired by pydoc.source_synopsis(), but rewritten to
504 handle triple quotes and to return the whole text instead of just
508 handle triple quotes and to return the whole text instead of just
505 the synopsis'''
509 the synopsis'''
506 result = []
510 result = []
507
511
508 line = file.readline()
512 line = file.readline()
509 while line[:1] == '#' or not line.strip():
513 while line[:1] == '#' or not line.strip():
510 line = file.readline()
514 line = file.readline()
511 if not line:
515 if not line:
512 break
516 break
513
517
514 start = line[:3]
518 start = line[:3]
515 if start == '"""' or start == "'''":
519 if start == '"""' or start == "'''":
516 line = line[3:]
520 line = line[3:]
517 while line:
521 while line:
518 if line.rstrip().endswith(start):
522 if line.rstrip().endswith(start):
519 line = line.split(start)[0]
523 line = line.split(start)[0]
520 if line:
524 if line:
521 result.append(line)
525 result.append(line)
522 break
526 break
523 elif not line:
527 elif not line:
524 return None # unmatched delimiter
528 return None # unmatched delimiter
525 result.append(line)
529 result.append(line)
526 line = file.readline()
530 line = file.readline()
527 else:
531 else:
528 return None
532 return None
529
533
530 return ''.join(result)
534 return ''.join(result)
531
535
532 def _disabledhelp(path):
536 def _disabledhelp(path):
533 '''retrieve help synopsis of a disabled extension (without importing)'''
537 '''retrieve help synopsis of a disabled extension (without importing)'''
534 try:
538 try:
535 file = open(path)
539 file = open(path)
536 except IOError:
540 except IOError:
537 return
541 return
538 else:
542 else:
539 doc = _moduledoc(file)
543 doc = _moduledoc(file)
540 file.close()
544 file.close()
541
545
542 if doc: # extracting localized synopsis
546 if doc: # extracting localized synopsis
543 return gettext(doc)
547 return gettext(doc)
544 else:
548 else:
545 return _('(no help text available)')
549 return _('(no help text available)')
546
550
547 def disabled():
551 def disabled():
548 '''find disabled extensions from hgext. returns a dict of {name: desc}'''
552 '''find disabled extensions from hgext. returns a dict of {name: desc}'''
549 try:
553 try:
550 from hgext import __index__
554 from hgext import __index__
551 return dict((name, gettext(desc))
555 return dict((name, gettext(desc))
552 for name, desc in __index__.docs.iteritems()
556 for name, desc in __index__.docs.iteritems()
553 if name not in _order)
557 if name not in _order)
554 except (ImportError, AttributeError):
558 except (ImportError, AttributeError):
555 pass
559 pass
556
560
557 paths = _disabledpaths()
561 paths = _disabledpaths()
558 if not paths:
562 if not paths:
559 return {}
563 return {}
560
564
561 exts = {}
565 exts = {}
562 for name, path in paths.iteritems():
566 for name, path in paths.iteritems():
563 doc = _disabledhelp(path)
567 doc = _disabledhelp(path)
564 if doc:
568 if doc:
565 exts[name] = doc.splitlines()[0]
569 exts[name] = doc.splitlines()[0]
566
570
567 return exts
571 return exts
568
572
569 def disabledext(name):
573 def disabledext(name):
570 '''find a specific disabled extension from hgext. returns desc'''
574 '''find a specific disabled extension from hgext. returns desc'''
571 try:
575 try:
572 from hgext import __index__
576 from hgext import __index__
573 if name in _order: # enabled
577 if name in _order: # enabled
574 return
578 return
575 else:
579 else:
576 return gettext(__index__.docs.get(name))
580 return gettext(__index__.docs.get(name))
577 except (ImportError, AttributeError):
581 except (ImportError, AttributeError):
578 pass
582 pass
579
583
580 paths = _disabledpaths()
584 paths = _disabledpaths()
581 if name in paths:
585 if name in paths:
582 return _disabledhelp(paths[name])
586 return _disabledhelp(paths[name])
583
587
584 def disabledcmd(ui, cmd, strict=False):
588 def disabledcmd(ui, cmd, strict=False):
585 '''import disabled extensions until cmd is found.
589 '''import disabled extensions until cmd is found.
586 returns (cmdname, extname, module)'''
590 returns (cmdname, extname, module)'''
587
591
588 paths = _disabledpaths(strip_init=True)
592 paths = _disabledpaths(strip_init=True)
589 if not paths:
593 if not paths:
590 raise error.UnknownCommand(cmd)
594 raise error.UnknownCommand(cmd)
591
595
592 def findcmd(cmd, name, path):
596 def findcmd(cmd, name, path):
593 try:
597 try:
594 mod = loadpath(path, 'hgext.%s' % name)
598 mod = loadpath(path, 'hgext.%s' % name)
595 except Exception:
599 except Exception:
596 return
600 return
597 try:
601 try:
598 aliases, entry = cmdutil.findcmd(cmd,
602 aliases, entry = cmdutil.findcmd(cmd,
599 getattr(mod, 'cmdtable', {}), strict)
603 getattr(mod, 'cmdtable', {}), strict)
600 except (error.AmbiguousCommand, error.UnknownCommand):
604 except (error.AmbiguousCommand, error.UnknownCommand):
601 return
605 return
602 except Exception:
606 except Exception:
603 ui.warn(_('warning: error finding commands in %s\n') % path)
607 ui.warn(_('warning: error finding commands in %s\n') % path)
604 ui.traceback()
608 ui.traceback()
605 return
609 return
606 for c in aliases:
610 for c in aliases:
607 if c.startswith(cmd):
611 if c.startswith(cmd):
608 cmd = c
612 cmd = c
609 break
613 break
610 else:
614 else:
611 cmd = aliases[0]
615 cmd = aliases[0]
612 return (cmd, name, mod)
616 return (cmd, name, mod)
613
617
614 ext = None
618 ext = None
615 # first, search for an extension with the same name as the command
619 # first, search for an extension with the same name as the command
616 path = paths.pop(cmd, None)
620 path = paths.pop(cmd, None)
617 if path:
621 if path:
618 ext = findcmd(cmd, cmd, path)
622 ext = findcmd(cmd, cmd, path)
619 if not ext:
623 if not ext:
620 # otherwise, interrogate each extension until there's a match
624 # otherwise, interrogate each extension until there's a match
621 for name, path in paths.iteritems():
625 for name, path in paths.iteritems():
622 ext = findcmd(cmd, name, path)
626 ext = findcmd(cmd, name, path)
623 if ext:
627 if ext:
624 break
628 break
625 if ext and 'DEPRECATED' not in ext.__doc__:
629 if ext and 'DEPRECATED' not in ext.__doc__:
626 return ext
630 return ext
627
631
628 raise error.UnknownCommand(cmd)
632 raise error.UnknownCommand(cmd)
629
633
630 def enabled(shortname=True):
634 def enabled(shortname=True):
631 '''return a dict of {name: desc} of extensions'''
635 '''return a dict of {name: desc} of extensions'''
632 exts = {}
636 exts = {}
633 for ename, ext in extensions():
637 for ename, ext in extensions():
634 doc = (gettext(ext.__doc__) or _('(no help text available)'))
638 doc = (gettext(ext.__doc__) or _('(no help text available)'))
635 if shortname:
639 if shortname:
636 ename = ename.split('.')[-1]
640 ename = ename.split('.')[-1]
637 exts[ename] = doc.splitlines()[0].strip()
641 exts[ename] = doc.splitlines()[0].strip()
638
642
639 return exts
643 return exts
640
644
641 def notloaded():
645 def notloaded():
642 '''return short names of extensions that failed to load'''
646 '''return short names of extensions that failed to load'''
643 return [name for name, mod in _extensions.iteritems() if mod is None]
647 return [name for name, mod in _extensions.iteritems() if mod is None]
644
648
645 def moduleversion(module):
649 def moduleversion(module):
646 '''return version information from given module as a string'''
650 '''return version information from given module as a string'''
647 if (util.safehasattr(module, 'getversion')
651 if (util.safehasattr(module, 'getversion')
648 and callable(module.getversion)):
652 and callable(module.getversion)):
649 version = module.getversion()
653 version = module.getversion()
650 elif util.safehasattr(module, '__version__'):
654 elif util.safehasattr(module, '__version__'):
651 version = module.__version__
655 version = module.__version__
652 else:
656 else:
653 version = ''
657 version = ''
654 if isinstance(version, (list, tuple)):
658 if isinstance(version, (list, tuple)):
655 version = '.'.join(str(o) for o in version)
659 version = '.'.join(str(o) for o in version)
656 return version
660 return version
657
661
658 def ismoduleinternal(module):
662 def ismoduleinternal(module):
659 exttestedwith = getattr(module, 'testedwith', None)
663 exttestedwith = getattr(module, 'testedwith', None)
660 return exttestedwith == "ships-with-hg-core"
664 return exttestedwith == "ships-with-hg-core"
@@ -1,3362 +1,3366 b''
1 Short help:
1 Short help:
2
2
3 $ hg
3 $ hg
4 Mercurial Distributed SCM
4 Mercurial Distributed SCM
5
5
6 basic commands:
6 basic commands:
7
7
8 add add the specified files on the next commit
8 add add the specified files on the next commit
9 annotate show changeset information by line for each file
9 annotate show changeset information by line for each file
10 clone make a copy of an existing repository
10 clone make a copy of an existing repository
11 commit commit the specified files or all outstanding changes
11 commit commit the specified files or all outstanding changes
12 diff diff repository (or selected files)
12 diff diff repository (or selected files)
13 export dump the header and diffs for one or more changesets
13 export dump the header and diffs for one or more changesets
14 forget forget the specified files on the next commit
14 forget forget the specified files on the next commit
15 init create a new repository in the given directory
15 init create a new repository in the given directory
16 log show revision history of entire repository or files
16 log show revision history of entire repository or files
17 merge merge another revision into working directory
17 merge merge another revision into working directory
18 pull pull changes from the specified source
18 pull pull changes from the specified source
19 push push changes to the specified destination
19 push push changes to the specified destination
20 remove remove the specified files on the next commit
20 remove remove the specified files on the next commit
21 serve start stand-alone webserver
21 serve start stand-alone webserver
22 status show changed files in the working directory
22 status show changed files in the working directory
23 summary summarize working directory state
23 summary summarize working directory state
24 update update working directory (or switch revisions)
24 update update working directory (or switch revisions)
25
25
26 (use 'hg help' for the full list of commands or 'hg -v' for details)
26 (use 'hg help' for the full list of commands or 'hg -v' for details)
27
27
28 $ hg -q
28 $ hg -q
29 add add the specified files on the next commit
29 add add the specified files on the next commit
30 annotate show changeset information by line for each file
30 annotate show changeset information by line for each file
31 clone make a copy of an existing repository
31 clone make a copy of an existing repository
32 commit commit the specified files or all outstanding changes
32 commit commit the specified files or all outstanding changes
33 diff diff repository (or selected files)
33 diff diff repository (or selected files)
34 export dump the header and diffs for one or more changesets
34 export dump the header and diffs for one or more changesets
35 forget forget the specified files on the next commit
35 forget forget the specified files on the next commit
36 init create a new repository in the given directory
36 init create a new repository in the given directory
37 log show revision history of entire repository or files
37 log show revision history of entire repository or files
38 merge merge another revision into working directory
38 merge merge another revision into working directory
39 pull pull changes from the specified source
39 pull pull changes from the specified source
40 push push changes to the specified destination
40 push push changes to the specified destination
41 remove remove the specified files on the next commit
41 remove remove the specified files on the next commit
42 serve start stand-alone webserver
42 serve start stand-alone webserver
43 status show changed files in the working directory
43 status show changed files in the working directory
44 summary summarize working directory state
44 summary summarize working directory state
45 update update working directory (or switch revisions)
45 update update working directory (or switch revisions)
46
46
47 $ hg help
47 $ hg help
48 Mercurial Distributed SCM
48 Mercurial Distributed SCM
49
49
50 list of commands:
50 list of commands:
51
51
52 add add the specified files on the next commit
52 add add the specified files on the next commit
53 addremove add all new files, delete all missing files
53 addremove add all new files, delete all missing files
54 annotate show changeset information by line for each file
54 annotate show changeset information by line for each file
55 archive create an unversioned archive of a repository revision
55 archive create an unversioned archive of a repository revision
56 backout reverse effect of earlier changeset
56 backout reverse effect of earlier changeset
57 bisect subdivision search of changesets
57 bisect subdivision search of changesets
58 bookmarks create a new bookmark or list existing bookmarks
58 bookmarks create a new bookmark or list existing bookmarks
59 branch set or show the current branch name
59 branch set or show the current branch name
60 branches list repository named branches
60 branches list repository named branches
61 bundle create a bundle file
61 bundle create a bundle file
62 cat output the current or given revision of files
62 cat output the current or given revision of files
63 clone make a copy of an existing repository
63 clone make a copy of an existing repository
64 commit commit the specified files or all outstanding changes
64 commit commit the specified files or all outstanding changes
65 config show combined config settings from all hgrc files
65 config show combined config settings from all hgrc files
66 copy mark files as copied for the next commit
66 copy mark files as copied for the next commit
67 diff diff repository (or selected files)
67 diff diff repository (or selected files)
68 export dump the header and diffs for one or more changesets
68 export dump the header and diffs for one or more changesets
69 files list tracked files
69 files list tracked files
70 forget forget the specified files on the next commit
70 forget forget the specified files on the next commit
71 graft copy changes from other branches onto the current branch
71 graft copy changes from other branches onto the current branch
72 grep search revision history for a pattern in specified files
72 grep search revision history for a pattern in specified files
73 heads show branch heads
73 heads show branch heads
74 help show help for a given topic or a help overview
74 help show help for a given topic or a help overview
75 identify identify the working directory or specified revision
75 identify identify the working directory or specified revision
76 import import an ordered set of patches
76 import import an ordered set of patches
77 incoming show new changesets found in source
77 incoming show new changesets found in source
78 init create a new repository in the given directory
78 init create a new repository in the given directory
79 log show revision history of entire repository or files
79 log show revision history of entire repository or files
80 manifest output the current or given revision of the project manifest
80 manifest output the current or given revision of the project manifest
81 merge merge another revision into working directory
81 merge merge another revision into working directory
82 outgoing show changesets not found in the destination
82 outgoing show changesets not found in the destination
83 paths show aliases for remote repositories
83 paths show aliases for remote repositories
84 phase set or show the current phase name
84 phase set or show the current phase name
85 pull pull changes from the specified source
85 pull pull changes from the specified source
86 push push changes to the specified destination
86 push push changes to the specified destination
87 recover roll back an interrupted transaction
87 recover roll back an interrupted transaction
88 remove remove the specified files on the next commit
88 remove remove the specified files on the next commit
89 rename rename files; equivalent of copy + remove
89 rename rename files; equivalent of copy + remove
90 resolve redo merges or set/view the merge status of files
90 resolve redo merges or set/view the merge status of files
91 revert restore files to their checkout state
91 revert restore files to their checkout state
92 root print the root (top) of the current working directory
92 root print the root (top) of the current working directory
93 serve start stand-alone webserver
93 serve start stand-alone webserver
94 status show changed files in the working directory
94 status show changed files in the working directory
95 summary summarize working directory state
95 summary summarize working directory state
96 tag add one or more tags for the current or given revision
96 tag add one or more tags for the current or given revision
97 tags list repository tags
97 tags list repository tags
98 unbundle apply one or more bundle files
98 unbundle apply one or more bundle files
99 update update working directory (or switch revisions)
99 update update working directory (or switch revisions)
100 verify verify the integrity of the repository
100 verify verify the integrity of the repository
101 version output version and copyright information
101 version output version and copyright information
102
102
103 additional help topics:
103 additional help topics:
104
104
105 bundlespec Bundle File Formats
105 bundlespec Bundle File Formats
106 color Colorizing Outputs
106 color Colorizing Outputs
107 config Configuration Files
107 config Configuration Files
108 dates Date Formats
108 dates Date Formats
109 diffs Diff Formats
109 diffs Diff Formats
110 environment Environment Variables
110 environment Environment Variables
111 extensions Using Additional Features
111 extensions Using Additional Features
112 filesets Specifying File Sets
112 filesets Specifying File Sets
113 glossary Glossary
113 glossary Glossary
114 hgignore Syntax for Mercurial Ignore Files
114 hgignore Syntax for Mercurial Ignore Files
115 hgweb Configuring hgweb
115 hgweb Configuring hgweb
116 internals Technical implementation topics
116 internals Technical implementation topics
117 merge-tools Merge Tools
117 merge-tools Merge Tools
118 pager Pager Support
118 pager Pager Support
119 patterns File Name Patterns
119 patterns File Name Patterns
120 phases Working with Phases
120 phases Working with Phases
121 revisions Specifying Revisions
121 revisions Specifying Revisions
122 scripting Using Mercurial from scripts and automation
122 scripting Using Mercurial from scripts and automation
123 subrepos Subrepositories
123 subrepos Subrepositories
124 templating Template Usage
124 templating Template Usage
125 urls URL Paths
125 urls URL Paths
126
126
127 (use 'hg help -v' to show built-in aliases and global options)
127 (use 'hg help -v' to show built-in aliases and global options)
128
128
129 $ hg -q help
129 $ hg -q help
130 add add the specified files on the next commit
130 add add the specified files on the next commit
131 addremove add all new files, delete all missing files
131 addremove add all new files, delete all missing files
132 annotate show changeset information by line for each file
132 annotate show changeset information by line for each file
133 archive create an unversioned archive of a repository revision
133 archive create an unversioned archive of a repository revision
134 backout reverse effect of earlier changeset
134 backout reverse effect of earlier changeset
135 bisect subdivision search of changesets
135 bisect subdivision search of changesets
136 bookmarks create a new bookmark or list existing bookmarks
136 bookmarks create a new bookmark or list existing bookmarks
137 branch set or show the current branch name
137 branch set or show the current branch name
138 branches list repository named branches
138 branches list repository named branches
139 bundle create a bundle file
139 bundle create a bundle file
140 cat output the current or given revision of files
140 cat output the current or given revision of files
141 clone make a copy of an existing repository
141 clone make a copy of an existing repository
142 commit commit the specified files or all outstanding changes
142 commit commit the specified files or all outstanding changes
143 config show combined config settings from all hgrc files
143 config show combined config settings from all hgrc files
144 copy mark files as copied for the next commit
144 copy mark files as copied for the next commit
145 diff diff repository (or selected files)
145 diff diff repository (or selected files)
146 export dump the header and diffs for one or more changesets
146 export dump the header and diffs for one or more changesets
147 files list tracked files
147 files list tracked files
148 forget forget the specified files on the next commit
148 forget forget the specified files on the next commit
149 graft copy changes from other branches onto the current branch
149 graft copy changes from other branches onto the current branch
150 grep search revision history for a pattern in specified files
150 grep search revision history for a pattern in specified files
151 heads show branch heads
151 heads show branch heads
152 help show help for a given topic or a help overview
152 help show help for a given topic or a help overview
153 identify identify the working directory or specified revision
153 identify identify the working directory or specified revision
154 import import an ordered set of patches
154 import import an ordered set of patches
155 incoming show new changesets found in source
155 incoming show new changesets found in source
156 init create a new repository in the given directory
156 init create a new repository in the given directory
157 log show revision history of entire repository or files
157 log show revision history of entire repository or files
158 manifest output the current or given revision of the project manifest
158 manifest output the current or given revision of the project manifest
159 merge merge another revision into working directory
159 merge merge another revision into working directory
160 outgoing show changesets not found in the destination
160 outgoing show changesets not found in the destination
161 paths show aliases for remote repositories
161 paths show aliases for remote repositories
162 phase set or show the current phase name
162 phase set or show the current phase name
163 pull pull changes from the specified source
163 pull pull changes from the specified source
164 push push changes to the specified destination
164 push push changes to the specified destination
165 recover roll back an interrupted transaction
165 recover roll back an interrupted transaction
166 remove remove the specified files on the next commit
166 remove remove the specified files on the next commit
167 rename rename files; equivalent of copy + remove
167 rename rename files; equivalent of copy + remove
168 resolve redo merges or set/view the merge status of files
168 resolve redo merges or set/view the merge status of files
169 revert restore files to their checkout state
169 revert restore files to their checkout state
170 root print the root (top) of the current working directory
170 root print the root (top) of the current working directory
171 serve start stand-alone webserver
171 serve start stand-alone webserver
172 status show changed files in the working directory
172 status show changed files in the working directory
173 summary summarize working directory state
173 summary summarize working directory state
174 tag add one or more tags for the current or given revision
174 tag add one or more tags for the current or given revision
175 tags list repository tags
175 tags list repository tags
176 unbundle apply one or more bundle files
176 unbundle apply one or more bundle files
177 update update working directory (or switch revisions)
177 update update working directory (or switch revisions)
178 verify verify the integrity of the repository
178 verify verify the integrity of the repository
179 version output version and copyright information
179 version output version and copyright information
180
180
181 additional help topics:
181 additional help topics:
182
182
183 bundlespec Bundle File Formats
183 bundlespec Bundle File Formats
184 color Colorizing Outputs
184 color Colorizing Outputs
185 config Configuration Files
185 config Configuration Files
186 dates Date Formats
186 dates Date Formats
187 diffs Diff Formats
187 diffs Diff Formats
188 environment Environment Variables
188 environment Environment Variables
189 extensions Using Additional Features
189 extensions Using Additional Features
190 filesets Specifying File Sets
190 filesets Specifying File Sets
191 glossary Glossary
191 glossary Glossary
192 hgignore Syntax for Mercurial Ignore Files
192 hgignore Syntax for Mercurial Ignore Files
193 hgweb Configuring hgweb
193 hgweb Configuring hgweb
194 internals Technical implementation topics
194 internals Technical implementation topics
195 merge-tools Merge Tools
195 merge-tools Merge Tools
196 pager Pager Support
196 pager Pager Support
197 patterns File Name Patterns
197 patterns File Name Patterns
198 phases Working with Phases
198 phases Working with Phases
199 revisions Specifying Revisions
199 revisions Specifying Revisions
200 scripting Using Mercurial from scripts and automation
200 scripting Using Mercurial from scripts and automation
201 subrepos Subrepositories
201 subrepos Subrepositories
202 templating Template Usage
202 templating Template Usage
203 urls URL Paths
203 urls URL Paths
204
204
205 Test extension help:
205 Test extension help:
206 $ hg help extensions --config extensions.rebase= --config extensions.children=
206 $ hg help extensions --config extensions.rebase= --config extensions.children=
207 Using Additional Features
207 Using Additional Features
208 """""""""""""""""""""""""
208 """""""""""""""""""""""""
209
209
210 Mercurial has the ability to add new features through the use of
210 Mercurial has the ability to add new features through the use of
211 extensions. Extensions may add new commands, add options to existing
211 extensions. Extensions may add new commands, add options to existing
212 commands, change the default behavior of commands, or implement hooks.
212 commands, change the default behavior of commands, or implement hooks.
213
213
214 To enable the "foo" extension, either shipped with Mercurial or in the
214 To enable the "foo" extension, either shipped with Mercurial or in the
215 Python search path, create an entry for it in your configuration file,
215 Python search path, create an entry for it in your configuration file,
216 like this:
216 like this:
217
217
218 [extensions]
218 [extensions]
219 foo =
219 foo =
220
220
221 You may also specify the full path to an extension:
221 You may also specify the full path to an extension:
222
222
223 [extensions]
223 [extensions]
224 myfeature = ~/.hgext/myfeature.py
224 myfeature = ~/.hgext/myfeature.py
225
225
226 See 'hg help config' for more information on configuration files.
226 See 'hg help config' for more information on configuration files.
227
227
228 Extensions are not loaded by default for a variety of reasons: they can
228 Extensions are not loaded by default for a variety of reasons: they can
229 increase startup overhead; they may be meant for advanced usage only; they
229 increase startup overhead; they may be meant for advanced usage only; they
230 may provide potentially dangerous abilities (such as letting you destroy
230 may provide potentially dangerous abilities (such as letting you destroy
231 or modify history); they might not be ready for prime time; or they may
231 or modify history); they might not be ready for prime time; or they may
232 alter some usual behaviors of stock Mercurial. It is thus up to the user
232 alter some usual behaviors of stock Mercurial. It is thus up to the user
233 to activate extensions as needed.
233 to activate extensions as needed.
234
234
235 To explicitly disable an extension enabled in a configuration file of
235 To explicitly disable an extension enabled in a configuration file of
236 broader scope, prepend its path with !:
236 broader scope, prepend its path with !:
237
237
238 [extensions]
238 [extensions]
239 # disabling extension bar residing in /path/to/extension/bar.py
239 # disabling extension bar residing in /path/to/extension/bar.py
240 bar = !/path/to/extension/bar.py
240 bar = !/path/to/extension/bar.py
241 # ditto, but no path was supplied for extension baz
241 # ditto, but no path was supplied for extension baz
242 baz = !
242 baz = !
243
243
244 enabled extensions:
244 enabled extensions:
245
245
246 children command to display child changesets (DEPRECATED)
246 children command to display child changesets (DEPRECATED)
247 rebase command to move sets of revisions to a different ancestor
247 rebase command to move sets of revisions to a different ancestor
248
248
249 disabled extensions:
249 disabled extensions:
250
250
251 acl hooks for controlling repository access
251 acl hooks for controlling repository access
252 blackbox log repository events to a blackbox for debugging
252 blackbox log repository events to a blackbox for debugging
253 bugzilla hooks for integrating with the Bugzilla bug tracker
253 bugzilla hooks for integrating with the Bugzilla bug tracker
254 censor erase file content at a given revision
254 censor erase file content at a given revision
255 churn command to display statistics about repository history
255 churn command to display statistics about repository history
256 clonebundles advertise pre-generated bundles to seed clones
256 clonebundles advertise pre-generated bundles to seed clones
257 convert import revisions from foreign VCS repositories into
257 convert import revisions from foreign VCS repositories into
258 Mercurial
258 Mercurial
259 eol automatically manage newlines in repository files
259 eol automatically manage newlines in repository files
260 extdiff command to allow external programs to compare revisions
260 extdiff command to allow external programs to compare revisions
261 factotum http authentication with factotum
261 factotum http authentication with factotum
262 gpg commands to sign and verify changesets
262 gpg commands to sign and verify changesets
263 hgk browse the repository in a graphical way
263 hgk browse the repository in a graphical way
264 highlight syntax highlighting for hgweb (requires Pygments)
264 highlight syntax highlighting for hgweb (requires Pygments)
265 histedit interactive history editing
265 histedit interactive history editing
266 keyword expand keywords in tracked files
266 keyword expand keywords in tracked files
267 largefiles track large binary files
267 largefiles track large binary files
268 mq manage a stack of patches
268 mq manage a stack of patches
269 notify hooks for sending email push notifications
269 notify hooks for sending email push notifications
270 patchbomb command to send changesets as (a series of) patch emails
270 patchbomb command to send changesets as (a series of) patch emails
271 purge command to delete untracked files from the working
271 purge command to delete untracked files from the working
272 directory
272 directory
273 relink recreates hardlinks between repository clones
273 relink recreates hardlinks between repository clones
274 schemes extend schemes with shortcuts to repository swarms
274 schemes extend schemes with shortcuts to repository swarms
275 share share a common history between several working directories
275 share share a common history between several working directories
276 shelve save and restore changes to the working directory
276 shelve save and restore changes to the working directory
277 strip strip changesets and their descendants from history
277 strip strip changesets and their descendants from history
278 transplant command to transplant changesets from another branch
278 transplant command to transplant changesets from another branch
279 win32mbcs allow the use of MBCS paths with problematic encodings
279 win32mbcs allow the use of MBCS paths with problematic encodings
280 zeroconf discover and advertise repositories on the local network
280 zeroconf discover and advertise repositories on the local network
281
281
282 Verify that extension keywords appear in help templates
282 Verify that extension keywords appear in help templates
283
283
284 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
284 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
285
285
286 Test short command list with verbose option
286 Test short command list with verbose option
287
287
288 $ hg -v help shortlist
288 $ hg -v help shortlist
289 Mercurial Distributed SCM
289 Mercurial Distributed SCM
290
290
291 basic commands:
291 basic commands:
292
292
293 add add the specified files on the next commit
293 add add the specified files on the next commit
294 annotate, blame
294 annotate, blame
295 show changeset information by line for each file
295 show changeset information by line for each file
296 clone make a copy of an existing repository
296 clone make a copy of an existing repository
297 commit, ci commit the specified files or all outstanding changes
297 commit, ci commit the specified files or all outstanding changes
298 diff diff repository (or selected files)
298 diff diff repository (or selected files)
299 export dump the header and diffs for one or more changesets
299 export dump the header and diffs for one or more changesets
300 forget forget the specified files on the next commit
300 forget forget the specified files on the next commit
301 init create a new repository in the given directory
301 init create a new repository in the given directory
302 log, history show revision history of entire repository or files
302 log, history show revision history of entire repository or files
303 merge merge another revision into working directory
303 merge merge another revision into working directory
304 pull pull changes from the specified source
304 pull pull changes from the specified source
305 push push changes to the specified destination
305 push push changes to the specified destination
306 remove, rm remove the specified files on the next commit
306 remove, rm remove the specified files on the next commit
307 serve start stand-alone webserver
307 serve start stand-alone webserver
308 status, st show changed files in the working directory
308 status, st show changed files in the working directory
309 summary, sum summarize working directory state
309 summary, sum summarize working directory state
310 update, up, checkout, co
310 update, up, checkout, co
311 update working directory (or switch revisions)
311 update working directory (or switch revisions)
312
312
313 global options ([+] can be repeated):
313 global options ([+] can be repeated):
314
314
315 -R --repository REPO repository root directory or name of overlay bundle
315 -R --repository REPO repository root directory or name of overlay bundle
316 file
316 file
317 --cwd DIR change working directory
317 --cwd DIR change working directory
318 -y --noninteractive do not prompt, automatically pick the first choice for
318 -y --noninteractive do not prompt, automatically pick the first choice for
319 all prompts
319 all prompts
320 -q --quiet suppress output
320 -q --quiet suppress output
321 -v --verbose enable additional output
321 -v --verbose enable additional output
322 --color TYPE when to colorize (boolean, always, auto, never, or
322 --color TYPE when to colorize (boolean, always, auto, never, or
323 debug)
323 debug)
324 --config CONFIG [+] set/override config option (use 'section.name=value')
324 --config CONFIG [+] set/override config option (use 'section.name=value')
325 --debug enable debugging output
325 --debug enable debugging output
326 --debugger start debugger
326 --debugger start debugger
327 --encoding ENCODE set the charset encoding (default: ascii)
327 --encoding ENCODE set the charset encoding (default: ascii)
328 --encodingmode MODE set the charset encoding mode (default: strict)
328 --encodingmode MODE set the charset encoding mode (default: strict)
329 --traceback always print a traceback on exception
329 --traceback always print a traceback on exception
330 --time time how long the command takes
330 --time time how long the command takes
331 --profile print command execution profile
331 --profile print command execution profile
332 --version output version information and exit
332 --version output version information and exit
333 -h --help display help and exit
333 -h --help display help and exit
334 --hidden consider hidden changesets
334 --hidden consider hidden changesets
335 --pager TYPE when to paginate (boolean, always, auto, or never)
335 --pager TYPE when to paginate (boolean, always, auto, or never)
336 (default: auto)
336 (default: auto)
337
337
338 (use 'hg help' for the full list of commands)
338 (use 'hg help' for the full list of commands)
339
339
340 $ hg add -h
340 $ hg add -h
341 hg add [OPTION]... [FILE]...
341 hg add [OPTION]... [FILE]...
342
342
343 add the specified files on the next commit
343 add the specified files on the next commit
344
344
345 Schedule files to be version controlled and added to the repository.
345 Schedule files to be version controlled and added to the repository.
346
346
347 The files will be added to the repository at the next commit. To undo an
347 The files will be added to the repository at the next commit. To undo an
348 add before that, see 'hg forget'.
348 add before that, see 'hg forget'.
349
349
350 If no names are given, add all files to the repository (except files
350 If no names are given, add all files to the repository (except files
351 matching ".hgignore").
351 matching ".hgignore").
352
352
353 Returns 0 if all files are successfully added.
353 Returns 0 if all files are successfully added.
354
354
355 options ([+] can be repeated):
355 options ([+] can be repeated):
356
356
357 -I --include PATTERN [+] include names matching the given patterns
357 -I --include PATTERN [+] include names matching the given patterns
358 -X --exclude PATTERN [+] exclude names matching the given patterns
358 -X --exclude PATTERN [+] exclude names matching the given patterns
359 -S --subrepos recurse into subrepositories
359 -S --subrepos recurse into subrepositories
360 -n --dry-run do not perform actions, just print output
360 -n --dry-run do not perform actions, just print output
361
361
362 (some details hidden, use --verbose to show complete help)
362 (some details hidden, use --verbose to show complete help)
363
363
364 Verbose help for add
364 Verbose help for add
365
365
366 $ hg add -hv
366 $ hg add -hv
367 hg add [OPTION]... [FILE]...
367 hg add [OPTION]... [FILE]...
368
368
369 add the specified files on the next commit
369 add the specified files on the next commit
370
370
371 Schedule files to be version controlled and added to the repository.
371 Schedule files to be version controlled and added to the repository.
372
372
373 The files will be added to the repository at the next commit. To undo an
373 The files will be added to the repository at the next commit. To undo an
374 add before that, see 'hg forget'.
374 add before that, see 'hg forget'.
375
375
376 If no names are given, add all files to the repository (except files
376 If no names are given, add all files to the repository (except files
377 matching ".hgignore").
377 matching ".hgignore").
378
378
379 Examples:
379 Examples:
380
380
381 - New (unknown) files are added automatically by 'hg add':
381 - New (unknown) files are added automatically by 'hg add':
382
382
383 $ ls
383 $ ls
384 foo.c
384 foo.c
385 $ hg status
385 $ hg status
386 ? foo.c
386 ? foo.c
387 $ hg add
387 $ hg add
388 adding foo.c
388 adding foo.c
389 $ hg status
389 $ hg status
390 A foo.c
390 A foo.c
391
391
392 - Specific files to be added can be specified:
392 - Specific files to be added can be specified:
393
393
394 $ ls
394 $ ls
395 bar.c foo.c
395 bar.c foo.c
396 $ hg status
396 $ hg status
397 ? bar.c
397 ? bar.c
398 ? foo.c
398 ? foo.c
399 $ hg add bar.c
399 $ hg add bar.c
400 $ hg status
400 $ hg status
401 A bar.c
401 A bar.c
402 ? foo.c
402 ? foo.c
403
403
404 Returns 0 if all files are successfully added.
404 Returns 0 if all files are successfully added.
405
405
406 options ([+] can be repeated):
406 options ([+] can be repeated):
407
407
408 -I --include PATTERN [+] include names matching the given patterns
408 -I --include PATTERN [+] include names matching the given patterns
409 -X --exclude PATTERN [+] exclude names matching the given patterns
409 -X --exclude PATTERN [+] exclude names matching the given patterns
410 -S --subrepos recurse into subrepositories
410 -S --subrepos recurse into subrepositories
411 -n --dry-run do not perform actions, just print output
411 -n --dry-run do not perform actions, just print output
412
412
413 global options ([+] can be repeated):
413 global options ([+] can be repeated):
414
414
415 -R --repository REPO repository root directory or name of overlay bundle
415 -R --repository REPO repository root directory or name of overlay bundle
416 file
416 file
417 --cwd DIR change working directory
417 --cwd DIR change working directory
418 -y --noninteractive do not prompt, automatically pick the first choice for
418 -y --noninteractive do not prompt, automatically pick the first choice for
419 all prompts
419 all prompts
420 -q --quiet suppress output
420 -q --quiet suppress output
421 -v --verbose enable additional output
421 -v --verbose enable additional output
422 --color TYPE when to colorize (boolean, always, auto, never, or
422 --color TYPE when to colorize (boolean, always, auto, never, or
423 debug)
423 debug)
424 --config CONFIG [+] set/override config option (use 'section.name=value')
424 --config CONFIG [+] set/override config option (use 'section.name=value')
425 --debug enable debugging output
425 --debug enable debugging output
426 --debugger start debugger
426 --debugger start debugger
427 --encoding ENCODE set the charset encoding (default: ascii)
427 --encoding ENCODE set the charset encoding (default: ascii)
428 --encodingmode MODE set the charset encoding mode (default: strict)
428 --encodingmode MODE set the charset encoding mode (default: strict)
429 --traceback always print a traceback on exception
429 --traceback always print a traceback on exception
430 --time time how long the command takes
430 --time time how long the command takes
431 --profile print command execution profile
431 --profile print command execution profile
432 --version output version information and exit
432 --version output version information and exit
433 -h --help display help and exit
433 -h --help display help and exit
434 --hidden consider hidden changesets
434 --hidden consider hidden changesets
435 --pager TYPE when to paginate (boolean, always, auto, or never)
435 --pager TYPE when to paginate (boolean, always, auto, or never)
436 (default: auto)
436 (default: auto)
437
437
438 Test the textwidth config option
438 Test the textwidth config option
439
439
440 $ hg root -h --config ui.textwidth=50
440 $ hg root -h --config ui.textwidth=50
441 hg root
441 hg root
442
442
443 print the root (top) of the current working
443 print the root (top) of the current working
444 directory
444 directory
445
445
446 Print the root directory of the current
446 Print the root directory of the current
447 repository.
447 repository.
448
448
449 Returns 0 on success.
449 Returns 0 on success.
450
450
451 (some details hidden, use --verbose to show
451 (some details hidden, use --verbose to show
452 complete help)
452 complete help)
453
453
454 Test help option with version option
454 Test help option with version option
455
455
456 $ hg add -h --version
456 $ hg add -h --version
457 Mercurial Distributed SCM (version *) (glob)
457 Mercurial Distributed SCM (version *) (glob)
458 (see https://mercurial-scm.org for more information)
458 (see https://mercurial-scm.org for more information)
459
459
460 Copyright (C) 2005-* Matt Mackall and others (glob)
460 Copyright (C) 2005-* Matt Mackall and others (glob)
461 This is free software; see the source for copying conditions. There is NO
461 This is free software; see the source for copying conditions. There is NO
462 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
462 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
463
463
464 $ hg add --skjdfks
464 $ hg add --skjdfks
465 hg add: option --skjdfks not recognized
465 hg add: option --skjdfks not recognized
466 hg add [OPTION]... [FILE]...
466 hg add [OPTION]... [FILE]...
467
467
468 add the specified files on the next commit
468 add the specified files on the next commit
469
469
470 options ([+] can be repeated):
470 options ([+] can be repeated):
471
471
472 -I --include PATTERN [+] include names matching the given patterns
472 -I --include PATTERN [+] include names matching the given patterns
473 -X --exclude PATTERN [+] exclude names matching the given patterns
473 -X --exclude PATTERN [+] exclude names matching the given patterns
474 -S --subrepos recurse into subrepositories
474 -S --subrepos recurse into subrepositories
475 -n --dry-run do not perform actions, just print output
475 -n --dry-run do not perform actions, just print output
476
476
477 (use 'hg add -h' to show more help)
477 (use 'hg add -h' to show more help)
478 [255]
478 [255]
479
479
480 Test ambiguous command help
480 Test ambiguous command help
481
481
482 $ hg help ad
482 $ hg help ad
483 list of commands:
483 list of commands:
484
484
485 add add the specified files on the next commit
485 add add the specified files on the next commit
486 addremove add all new files, delete all missing files
486 addremove add all new files, delete all missing files
487
487
488 (use 'hg help -v ad' to show built-in aliases and global options)
488 (use 'hg help -v ad' to show built-in aliases and global options)
489
489
490 Test command without options
490 Test command without options
491
491
492 $ hg help verify
492 $ hg help verify
493 hg verify
493 hg verify
494
494
495 verify the integrity of the repository
495 verify the integrity of the repository
496
496
497 Verify the integrity of the current repository.
497 Verify the integrity of the current repository.
498
498
499 This will perform an extensive check of the repository's integrity,
499 This will perform an extensive check of the repository's integrity,
500 validating the hashes and checksums of each entry in the changelog,
500 validating the hashes and checksums of each entry in the changelog,
501 manifest, and tracked files, as well as the integrity of their crosslinks
501 manifest, and tracked files, as well as the integrity of their crosslinks
502 and indices.
502 and indices.
503
503
504 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
504 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
505 information about recovery from corruption of the repository.
505 information about recovery from corruption of the repository.
506
506
507 Returns 0 on success, 1 if errors are encountered.
507 Returns 0 on success, 1 if errors are encountered.
508
508
509 (some details hidden, use --verbose to show complete help)
509 (some details hidden, use --verbose to show complete help)
510
510
511 $ hg help diff
511 $ hg help diff
512 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
512 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
513
513
514 diff repository (or selected files)
514 diff repository (or selected files)
515
515
516 Show differences between revisions for the specified files.
516 Show differences between revisions for the specified files.
517
517
518 Differences between files are shown using the unified diff format.
518 Differences between files are shown using the unified diff format.
519
519
520 Note:
520 Note:
521 'hg diff' may generate unexpected results for merges, as it will
521 'hg diff' may generate unexpected results for merges, as it will
522 default to comparing against the working directory's first parent
522 default to comparing against the working directory's first parent
523 changeset if no revisions are specified.
523 changeset if no revisions are specified.
524
524
525 When two revision arguments are given, then changes are shown between
525 When two revision arguments are given, then changes are shown between
526 those revisions. If only one revision is specified then that revision is
526 those revisions. If only one revision is specified then that revision is
527 compared to the working directory, and, when no revisions are specified,
527 compared to the working directory, and, when no revisions are specified,
528 the working directory files are compared to its first parent.
528 the working directory files are compared to its first parent.
529
529
530 Alternatively you can specify -c/--change with a revision to see the
530 Alternatively you can specify -c/--change with a revision to see the
531 changes in that changeset relative to its first parent.
531 changes in that changeset relative to its first parent.
532
532
533 Without the -a/--text option, diff will avoid generating diffs of files it
533 Without the -a/--text option, diff will avoid generating diffs of files it
534 detects as binary. With -a, diff will generate a diff anyway, probably
534 detects as binary. With -a, diff will generate a diff anyway, probably
535 with undesirable results.
535 with undesirable results.
536
536
537 Use the -g/--git option to generate diffs in the git extended diff format.
537 Use the -g/--git option to generate diffs in the git extended diff format.
538 For more information, read 'hg help diffs'.
538 For more information, read 'hg help diffs'.
539
539
540 Returns 0 on success.
540 Returns 0 on success.
541
541
542 options ([+] can be repeated):
542 options ([+] can be repeated):
543
543
544 -r --rev REV [+] revision
544 -r --rev REV [+] revision
545 -c --change REV change made by revision
545 -c --change REV change made by revision
546 -a --text treat all files as text
546 -a --text treat all files as text
547 -g --git use git extended diff format
547 -g --git use git extended diff format
548 --binary generate binary diffs in git mode (default)
548 --binary generate binary diffs in git mode (default)
549 --nodates omit dates from diff headers
549 --nodates omit dates from diff headers
550 --noprefix omit a/ and b/ prefixes from filenames
550 --noprefix omit a/ and b/ prefixes from filenames
551 -p --show-function show which function each change is in
551 -p --show-function show which function each change is in
552 --reverse produce a diff that undoes the changes
552 --reverse produce a diff that undoes the changes
553 -w --ignore-all-space ignore white space when comparing lines
553 -w --ignore-all-space ignore white space when comparing lines
554 -b --ignore-space-change ignore changes in the amount of white space
554 -b --ignore-space-change ignore changes in the amount of white space
555 -B --ignore-blank-lines ignore changes whose lines are all blank
555 -B --ignore-blank-lines ignore changes whose lines are all blank
556 -U --unified NUM number of lines of context to show
556 -U --unified NUM number of lines of context to show
557 --stat output diffstat-style summary of changes
557 --stat output diffstat-style summary of changes
558 --root DIR produce diffs relative to subdirectory
558 --root DIR produce diffs relative to subdirectory
559 -I --include PATTERN [+] include names matching the given patterns
559 -I --include PATTERN [+] include names matching the given patterns
560 -X --exclude PATTERN [+] exclude names matching the given patterns
560 -X --exclude PATTERN [+] exclude names matching the given patterns
561 -S --subrepos recurse into subrepositories
561 -S --subrepos recurse into subrepositories
562
562
563 (some details hidden, use --verbose to show complete help)
563 (some details hidden, use --verbose to show complete help)
564
564
565 $ hg help status
565 $ hg help status
566 hg status [OPTION]... [FILE]...
566 hg status [OPTION]... [FILE]...
567
567
568 aliases: st
568 aliases: st
569
569
570 show changed files in the working directory
570 show changed files in the working directory
571
571
572 Show status of files in the repository. If names are given, only files
572 Show status of files in the repository. If names are given, only files
573 that match are shown. Files that are clean or ignored or the source of a
573 that match are shown. Files that are clean or ignored or the source of a
574 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
574 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
575 -C/--copies or -A/--all are given. Unless options described with "show
575 -C/--copies or -A/--all are given. Unless options described with "show
576 only ..." are given, the options -mardu are used.
576 only ..." are given, the options -mardu are used.
577
577
578 Option -q/--quiet hides untracked (unknown and ignored) files unless
578 Option -q/--quiet hides untracked (unknown and ignored) files unless
579 explicitly requested with -u/--unknown or -i/--ignored.
579 explicitly requested with -u/--unknown or -i/--ignored.
580
580
581 Note:
581 Note:
582 'hg status' may appear to disagree with diff if permissions have
582 'hg status' may appear to disagree with diff if permissions have
583 changed or a merge has occurred. The standard diff format does not
583 changed or a merge has occurred. The standard diff format does not
584 report permission changes and diff only reports changes relative to one
584 report permission changes and diff only reports changes relative to one
585 merge parent.
585 merge parent.
586
586
587 If one revision is given, it is used as the base revision. If two
587 If one revision is given, it is used as the base revision. If two
588 revisions are given, the differences between them are shown. The --change
588 revisions are given, the differences between them are shown. The --change
589 option can also be used as a shortcut to list the changed files of a
589 option can also be used as a shortcut to list the changed files of a
590 revision from its first parent.
590 revision from its first parent.
591
591
592 The codes used to show the status of files are:
592 The codes used to show the status of files are:
593
593
594 M = modified
594 M = modified
595 A = added
595 A = added
596 R = removed
596 R = removed
597 C = clean
597 C = clean
598 ! = missing (deleted by non-hg command, but still tracked)
598 ! = missing (deleted by non-hg command, but still tracked)
599 ? = not tracked
599 ? = not tracked
600 I = ignored
600 I = ignored
601 = origin of the previous file (with --copies)
601 = origin of the previous file (with --copies)
602
602
603 Returns 0 on success.
603 Returns 0 on success.
604
604
605 options ([+] can be repeated):
605 options ([+] can be repeated):
606
606
607 -A --all show status of all files
607 -A --all show status of all files
608 -m --modified show only modified files
608 -m --modified show only modified files
609 -a --added show only added files
609 -a --added show only added files
610 -r --removed show only removed files
610 -r --removed show only removed files
611 -d --deleted show only deleted (but tracked) files
611 -d --deleted show only deleted (but tracked) files
612 -c --clean show only files without changes
612 -c --clean show only files without changes
613 -u --unknown show only unknown (not tracked) files
613 -u --unknown show only unknown (not tracked) files
614 -i --ignored show only ignored files
614 -i --ignored show only ignored files
615 -n --no-status hide status prefix
615 -n --no-status hide status prefix
616 -C --copies show source of copied files
616 -C --copies show source of copied files
617 -0 --print0 end filenames with NUL, for use with xargs
617 -0 --print0 end filenames with NUL, for use with xargs
618 --rev REV [+] show difference from revision
618 --rev REV [+] show difference from revision
619 --change REV list the changed files of a revision
619 --change REV list the changed files of a revision
620 -I --include PATTERN [+] include names matching the given patterns
620 -I --include PATTERN [+] include names matching the given patterns
621 -X --exclude PATTERN [+] exclude names matching the given patterns
621 -X --exclude PATTERN [+] exclude names matching the given patterns
622 -S --subrepos recurse into subrepositories
622 -S --subrepos recurse into subrepositories
623
623
624 (some details hidden, use --verbose to show complete help)
624 (some details hidden, use --verbose to show complete help)
625
625
626 $ hg -q help status
626 $ hg -q help status
627 hg status [OPTION]... [FILE]...
627 hg status [OPTION]... [FILE]...
628
628
629 show changed files in the working directory
629 show changed files in the working directory
630
630
631 $ hg help foo
631 $ hg help foo
632 abort: no such help topic: foo
632 abort: no such help topic: foo
633 (try 'hg help --keyword foo')
633 (try 'hg help --keyword foo')
634 [255]
634 [255]
635
635
636 $ hg skjdfks
636 $ hg skjdfks
637 hg: unknown command 'skjdfks'
637 hg: unknown command 'skjdfks'
638 Mercurial Distributed SCM
638 Mercurial Distributed SCM
639
639
640 basic commands:
640 basic commands:
641
641
642 add add the specified files on the next commit
642 add add the specified files on the next commit
643 annotate show changeset information by line for each file
643 annotate show changeset information by line for each file
644 clone make a copy of an existing repository
644 clone make a copy of an existing repository
645 commit commit the specified files or all outstanding changes
645 commit commit the specified files or all outstanding changes
646 diff diff repository (or selected files)
646 diff diff repository (or selected files)
647 export dump the header and diffs for one or more changesets
647 export dump the header and diffs for one or more changesets
648 forget forget the specified files on the next commit
648 forget forget the specified files on the next commit
649 init create a new repository in the given directory
649 init create a new repository in the given directory
650 log show revision history of entire repository or files
650 log show revision history of entire repository or files
651 merge merge another revision into working directory
651 merge merge another revision into working directory
652 pull pull changes from the specified source
652 pull pull changes from the specified source
653 push push changes to the specified destination
653 push push changes to the specified destination
654 remove remove the specified files on the next commit
654 remove remove the specified files on the next commit
655 serve start stand-alone webserver
655 serve start stand-alone webserver
656 status show changed files in the working directory
656 status show changed files in the working directory
657 summary summarize working directory state
657 summary summarize working directory state
658 update update working directory (or switch revisions)
658 update update working directory (or switch revisions)
659
659
660 (use 'hg help' for the full list of commands or 'hg -v' for details)
660 (use 'hg help' for the full list of commands or 'hg -v' for details)
661 [255]
661 [255]
662
662
663 Typoed command gives suggestion
663 Typoed command gives suggestion
664 $ hg puls
664 $ hg puls
665 hg: unknown command 'puls'
665 hg: unknown command 'puls'
666 (did you mean one of pull, push?)
666 (did you mean one of pull, push?)
667 [255]
667 [255]
668
668
669 Not enabled extension gets suggested
669 Not enabled extension gets suggested
670
670
671 $ hg rebase
671 $ hg rebase
672 hg: unknown command 'rebase'
672 hg: unknown command 'rebase'
673 'rebase' is provided by the following extension:
673 'rebase' is provided by the following extension:
674
674
675 rebase command to move sets of revisions to a different ancestor
675 rebase command to move sets of revisions to a different ancestor
676
676
677 (use 'hg help extensions' for information on enabling extensions)
677 (use 'hg help extensions' for information on enabling extensions)
678 [255]
678 [255]
679
679
680 Disabled extension gets suggested
680 Disabled extension gets suggested
681 $ hg --config extensions.rebase=! rebase
681 $ hg --config extensions.rebase=! rebase
682 hg: unknown command 'rebase'
682 hg: unknown command 'rebase'
683 (did you mean one of rename, resolve?)
683 'rebase' is provided by the following extension:
684
685 rebase command to move sets of revisions to a different ancestor
686
687 (use 'hg help extensions' for information on enabling extensions)
684 [255]
688 [255]
685
689
686 Make sure that we don't run afoul of the help system thinking that
690 Make sure that we don't run afoul of the help system thinking that
687 this is a section and erroring out weirdly.
691 this is a section and erroring out weirdly.
688
692
689 $ hg .log
693 $ hg .log
690 hg: unknown command '.log'
694 hg: unknown command '.log'
691 (did you mean log?)
695 (did you mean log?)
692 [255]
696 [255]
693
697
694 $ hg log.
698 $ hg log.
695 hg: unknown command 'log.'
699 hg: unknown command 'log.'
696 (did you mean log?)
700 (did you mean log?)
697 [255]
701 [255]
698 $ hg pu.lh
702 $ hg pu.lh
699 hg: unknown command 'pu.lh'
703 hg: unknown command 'pu.lh'
700 (did you mean one of pull, push?)
704 (did you mean one of pull, push?)
701 [255]
705 [255]
702
706
703 $ cat > helpext.py <<EOF
707 $ cat > helpext.py <<EOF
704 > import os
708 > import os
705 > from mercurial import commands, registrar
709 > from mercurial import commands, registrar
706 >
710 >
707 > cmdtable = {}
711 > cmdtable = {}
708 > command = registrar.command(cmdtable)
712 > command = registrar.command(cmdtable)
709 >
713 >
710 > @command(b'nohelp',
714 > @command(b'nohelp',
711 > [(b'', b'longdesc', 3, b'x'*90),
715 > [(b'', b'longdesc', 3, b'x'*90),
712 > (b'n', b'', None, b'normal desc'),
716 > (b'n', b'', None, b'normal desc'),
713 > (b'', b'newline', b'', b'line1\nline2')],
717 > (b'', b'newline', b'', b'line1\nline2')],
714 > b'hg nohelp',
718 > b'hg nohelp',
715 > norepo=True)
719 > norepo=True)
716 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
720 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
717 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
721 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
718 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
722 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
719 > def nohelp(ui, *args, **kwargs):
723 > def nohelp(ui, *args, **kwargs):
720 > pass
724 > pass
721 >
725 >
722 > def uisetup(ui):
726 > def uisetup(ui):
723 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
727 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
724 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
728 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
725 >
729 >
726 > EOF
730 > EOF
727 $ echo '[extensions]' >> $HGRCPATH
731 $ echo '[extensions]' >> $HGRCPATH
728 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
732 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
729
733
730 Test for aliases
734 Test for aliases
731
735
732 $ hg help hgalias
736 $ hg help hgalias
733 hg hgalias [--remote]
737 hg hgalias [--remote]
734
738
735 alias for: hg summary
739 alias for: hg summary
736
740
737 summarize working directory state
741 summarize working directory state
738
742
739 This generates a brief summary of the working directory state, including
743 This generates a brief summary of the working directory state, including
740 parents, branch, commit status, phase and available updates.
744 parents, branch, commit status, phase and available updates.
741
745
742 With the --remote option, this will check the default paths for incoming
746 With the --remote option, this will check the default paths for incoming
743 and outgoing changes. This can be time-consuming.
747 and outgoing changes. This can be time-consuming.
744
748
745 Returns 0 on success.
749 Returns 0 on success.
746
750
747 defined by: helpext
751 defined by: helpext
748
752
749 options:
753 options:
750
754
751 --remote check for push and pull
755 --remote check for push and pull
752
756
753 (some details hidden, use --verbose to show complete help)
757 (some details hidden, use --verbose to show complete help)
754
758
755 $ hg help shellalias
759 $ hg help shellalias
756 hg shellalias
760 hg shellalias
757
761
758 shell alias for:
762 shell alias for:
759
763
760 echo hi
764 echo hi
761
765
762 defined by: helpext
766 defined by: helpext
763
767
764 (some details hidden, use --verbose to show complete help)
768 (some details hidden, use --verbose to show complete help)
765
769
766 Test command with no help text
770 Test command with no help text
767
771
768 $ hg help nohelp
772 $ hg help nohelp
769 hg nohelp
773 hg nohelp
770
774
771 (no help text available)
775 (no help text available)
772
776
773 options:
777 options:
774
778
775 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
779 --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
776 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
780 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
777 -n -- normal desc
781 -n -- normal desc
778 --newline VALUE line1 line2
782 --newline VALUE line1 line2
779
783
780 (some details hidden, use --verbose to show complete help)
784 (some details hidden, use --verbose to show complete help)
781
785
782 $ hg help -k nohelp
786 $ hg help -k nohelp
783 Commands:
787 Commands:
784
788
785 nohelp hg nohelp
789 nohelp hg nohelp
786
790
787 Extension Commands:
791 Extension Commands:
788
792
789 nohelp (no help text available)
793 nohelp (no help text available)
790
794
791 Test that default list of commands omits extension commands
795 Test that default list of commands omits extension commands
792
796
793 $ hg help
797 $ hg help
794 Mercurial Distributed SCM
798 Mercurial Distributed SCM
795
799
796 list of commands:
800 list of commands:
797
801
798 add add the specified files on the next commit
802 add add the specified files on the next commit
799 addremove add all new files, delete all missing files
803 addremove add all new files, delete all missing files
800 annotate show changeset information by line for each file
804 annotate show changeset information by line for each file
801 archive create an unversioned archive of a repository revision
805 archive create an unversioned archive of a repository revision
802 backout reverse effect of earlier changeset
806 backout reverse effect of earlier changeset
803 bisect subdivision search of changesets
807 bisect subdivision search of changesets
804 bookmarks create a new bookmark or list existing bookmarks
808 bookmarks create a new bookmark or list existing bookmarks
805 branch set or show the current branch name
809 branch set or show the current branch name
806 branches list repository named branches
810 branches list repository named branches
807 bundle create a bundle file
811 bundle create a bundle file
808 cat output the current or given revision of files
812 cat output the current or given revision of files
809 clone make a copy of an existing repository
813 clone make a copy of an existing repository
810 commit commit the specified files or all outstanding changes
814 commit commit the specified files or all outstanding changes
811 config show combined config settings from all hgrc files
815 config show combined config settings from all hgrc files
812 copy mark files as copied for the next commit
816 copy mark files as copied for the next commit
813 diff diff repository (or selected files)
817 diff diff repository (or selected files)
814 export dump the header and diffs for one or more changesets
818 export dump the header and diffs for one or more changesets
815 files list tracked files
819 files list tracked files
816 forget forget the specified files on the next commit
820 forget forget the specified files on the next commit
817 graft copy changes from other branches onto the current branch
821 graft copy changes from other branches onto the current branch
818 grep search revision history for a pattern in specified files
822 grep search revision history for a pattern in specified files
819 heads show branch heads
823 heads show branch heads
820 help show help for a given topic or a help overview
824 help show help for a given topic or a help overview
821 identify identify the working directory or specified revision
825 identify identify the working directory or specified revision
822 import import an ordered set of patches
826 import import an ordered set of patches
823 incoming show new changesets found in source
827 incoming show new changesets found in source
824 init create a new repository in the given directory
828 init create a new repository in the given directory
825 log show revision history of entire repository or files
829 log show revision history of entire repository or files
826 manifest output the current or given revision of the project manifest
830 manifest output the current or given revision of the project manifest
827 merge merge another revision into working directory
831 merge merge another revision into working directory
828 outgoing show changesets not found in the destination
832 outgoing show changesets not found in the destination
829 paths show aliases for remote repositories
833 paths show aliases for remote repositories
830 phase set or show the current phase name
834 phase set or show the current phase name
831 pull pull changes from the specified source
835 pull pull changes from the specified source
832 push push changes to the specified destination
836 push push changes to the specified destination
833 recover roll back an interrupted transaction
837 recover roll back an interrupted transaction
834 remove remove the specified files on the next commit
838 remove remove the specified files on the next commit
835 rename rename files; equivalent of copy + remove
839 rename rename files; equivalent of copy + remove
836 resolve redo merges or set/view the merge status of files
840 resolve redo merges or set/view the merge status of files
837 revert restore files to their checkout state
841 revert restore files to their checkout state
838 root print the root (top) of the current working directory
842 root print the root (top) of the current working directory
839 serve start stand-alone webserver
843 serve start stand-alone webserver
840 status show changed files in the working directory
844 status show changed files in the working directory
841 summary summarize working directory state
845 summary summarize working directory state
842 tag add one or more tags for the current or given revision
846 tag add one or more tags for the current or given revision
843 tags list repository tags
847 tags list repository tags
844 unbundle apply one or more bundle files
848 unbundle apply one or more bundle files
845 update update working directory (or switch revisions)
849 update update working directory (or switch revisions)
846 verify verify the integrity of the repository
850 verify verify the integrity of the repository
847 version output version and copyright information
851 version output version and copyright information
848
852
849 enabled extensions:
853 enabled extensions:
850
854
851 helpext (no help text available)
855 helpext (no help text available)
852
856
853 additional help topics:
857 additional help topics:
854
858
855 bundlespec Bundle File Formats
859 bundlespec Bundle File Formats
856 color Colorizing Outputs
860 color Colorizing Outputs
857 config Configuration Files
861 config Configuration Files
858 dates Date Formats
862 dates Date Formats
859 diffs Diff Formats
863 diffs Diff Formats
860 environment Environment Variables
864 environment Environment Variables
861 extensions Using Additional Features
865 extensions Using Additional Features
862 filesets Specifying File Sets
866 filesets Specifying File Sets
863 glossary Glossary
867 glossary Glossary
864 hgignore Syntax for Mercurial Ignore Files
868 hgignore Syntax for Mercurial Ignore Files
865 hgweb Configuring hgweb
869 hgweb Configuring hgweb
866 internals Technical implementation topics
870 internals Technical implementation topics
867 merge-tools Merge Tools
871 merge-tools Merge Tools
868 pager Pager Support
872 pager Pager Support
869 patterns File Name Patterns
873 patterns File Name Patterns
870 phases Working with Phases
874 phases Working with Phases
871 revisions Specifying Revisions
875 revisions Specifying Revisions
872 scripting Using Mercurial from scripts and automation
876 scripting Using Mercurial from scripts and automation
873 subrepos Subrepositories
877 subrepos Subrepositories
874 templating Template Usage
878 templating Template Usage
875 urls URL Paths
879 urls URL Paths
876
880
877 (use 'hg help -v' to show built-in aliases and global options)
881 (use 'hg help -v' to show built-in aliases and global options)
878
882
879
883
880 Test list of internal help commands
884 Test list of internal help commands
881
885
882 $ hg help debug
886 $ hg help debug
883 debug commands (internal and unsupported):
887 debug commands (internal and unsupported):
884
888
885 debugancestor
889 debugancestor
886 find the ancestor revision of two revisions in a given index
890 find the ancestor revision of two revisions in a given index
887 debugapplystreamclonebundle
891 debugapplystreamclonebundle
888 apply a stream clone bundle file
892 apply a stream clone bundle file
889 debugbuilddag
893 debugbuilddag
890 builds a repo with a given DAG from scratch in the current
894 builds a repo with a given DAG from scratch in the current
891 empty repo
895 empty repo
892 debugbundle lists the contents of a bundle
896 debugbundle lists the contents of a bundle
893 debugcheckstate
897 debugcheckstate
894 validate the correctness of the current dirstate
898 validate the correctness of the current dirstate
895 debugcolor show available color, effects or style
899 debugcolor show available color, effects or style
896 debugcommands
900 debugcommands
897 list all available commands and options
901 list all available commands and options
898 debugcomplete
902 debugcomplete
899 returns the completion list associated with the given command
903 returns the completion list associated with the given command
900 debugcreatestreamclonebundle
904 debugcreatestreamclonebundle
901 create a stream clone bundle file
905 create a stream clone bundle file
902 debugdag format the changelog or an index DAG as a concise textual
906 debugdag format the changelog or an index DAG as a concise textual
903 description
907 description
904 debugdata dump the contents of a data file revision
908 debugdata dump the contents of a data file revision
905 debugdate parse and display a date
909 debugdate parse and display a date
906 debugdeltachain
910 debugdeltachain
907 dump information about delta chains in a revlog
911 dump information about delta chains in a revlog
908 debugdirstate
912 debugdirstate
909 show the contents of the current dirstate
913 show the contents of the current dirstate
910 debugdiscovery
914 debugdiscovery
911 runs the changeset discovery protocol in isolation
915 runs the changeset discovery protocol in isolation
912 debugextensions
916 debugextensions
913 show information about active extensions
917 show information about active extensions
914 debugfileset parse and apply a fileset specification
918 debugfileset parse and apply a fileset specification
915 debugfsinfo show information detected about current filesystem
919 debugfsinfo show information detected about current filesystem
916 debuggetbundle
920 debuggetbundle
917 retrieves a bundle from a repo
921 retrieves a bundle from a repo
918 debugignore display the combined ignore pattern and information about
922 debugignore display the combined ignore pattern and information about
919 ignored files
923 ignored files
920 debugindex dump the contents of an index file
924 debugindex dump the contents of an index file
921 debugindexdot
925 debugindexdot
922 dump an index DAG as a graphviz dot file
926 dump an index DAG as a graphviz dot file
923 debuginstall test Mercurial installation
927 debuginstall test Mercurial installation
924 debugknown test whether node ids are known to a repo
928 debugknown test whether node ids are known to a repo
925 debuglocks show or modify state of locks
929 debuglocks show or modify state of locks
926 debugmergestate
930 debugmergestate
927 print merge state
931 print merge state
928 debugnamecomplete
932 debugnamecomplete
929 complete "names" - tags, open branch names, bookmark names
933 complete "names" - tags, open branch names, bookmark names
930 debugobsolete
934 debugobsolete
931 create arbitrary obsolete marker
935 create arbitrary obsolete marker
932 debugoptADV (no help text available)
936 debugoptADV (no help text available)
933 debugoptDEP (no help text available)
937 debugoptDEP (no help text available)
934 debugoptEXP (no help text available)
938 debugoptEXP (no help text available)
935 debugpathcomplete
939 debugpathcomplete
936 complete part or all of a tracked path
940 complete part or all of a tracked path
937 debugpickmergetool
941 debugpickmergetool
938 examine which merge tool is chosen for specified file
942 examine which merge tool is chosen for specified file
939 debugpushkey access the pushkey key/value protocol
943 debugpushkey access the pushkey key/value protocol
940 debugpvec (no help text available)
944 debugpvec (no help text available)
941 debugrebuilddirstate
945 debugrebuilddirstate
942 rebuild the dirstate as it would look like for the given
946 rebuild the dirstate as it would look like for the given
943 revision
947 revision
944 debugrebuildfncache
948 debugrebuildfncache
945 rebuild the fncache file
949 rebuild the fncache file
946 debugrename dump rename information
950 debugrename dump rename information
947 debugrevlog show data and statistics about a revlog
951 debugrevlog show data and statistics about a revlog
948 debugrevspec parse and apply a revision specification
952 debugrevspec parse and apply a revision specification
949 debugsetparents
953 debugsetparents
950 manually set the parents of the current working directory
954 manually set the parents of the current working directory
951 debugsub (no help text available)
955 debugsub (no help text available)
952 debugsuccessorssets
956 debugsuccessorssets
953 show set of successors for revision
957 show set of successors for revision
954 debugtemplate
958 debugtemplate
955 parse and apply a template
959 parse and apply a template
956 debugupdatecaches
960 debugupdatecaches
957 warm all known caches in the repository
961 warm all known caches in the repository
958 debugupgraderepo
962 debugupgraderepo
959 upgrade a repository to use different features
963 upgrade a repository to use different features
960 debugwalk show how files match on given patterns
964 debugwalk show how files match on given patterns
961 debugwireargs
965 debugwireargs
962 (no help text available)
966 (no help text available)
963
967
964 (use 'hg help -v debug' to show built-in aliases and global options)
968 (use 'hg help -v debug' to show built-in aliases and global options)
965
969
966 internals topic renders index of available sub-topics
970 internals topic renders index of available sub-topics
967
971
968 $ hg help internals
972 $ hg help internals
969 Technical implementation topics
973 Technical implementation topics
970 """""""""""""""""""""""""""""""
974 """""""""""""""""""""""""""""""
971
975
972 To access a subtopic, use "hg help internals.{subtopic-name}"
976 To access a subtopic, use "hg help internals.{subtopic-name}"
973
977
974 bundles Bundles
978 bundles Bundles
975 censor Censor
979 censor Censor
976 changegroups Changegroups
980 changegroups Changegroups
977 requirements Repository Requirements
981 requirements Repository Requirements
978 revlogs Revision Logs
982 revlogs Revision Logs
979 wireprotocol Wire Protocol
983 wireprotocol Wire Protocol
980
984
981 sub-topics can be accessed
985 sub-topics can be accessed
982
986
983 $ hg help internals.changegroups
987 $ hg help internals.changegroups
984 Changegroups
988 Changegroups
985 """"""""""""
989 """"""""""""
986
990
987 Changegroups are representations of repository revlog data, specifically
991 Changegroups are representations of repository revlog data, specifically
988 the changelog data, root/flat manifest data, treemanifest data, and
992 the changelog data, root/flat manifest data, treemanifest data, and
989 filelogs.
993 filelogs.
990
994
991 There are 3 versions of changegroups: "1", "2", and "3". From a high-
995 There are 3 versions of changegroups: "1", "2", and "3". From a high-
992 level, versions "1" and "2" are almost exactly the same, with the only
996 level, versions "1" and "2" are almost exactly the same, with the only
993 difference being an additional item in the *delta header*. Version "3"
997 difference being an additional item in the *delta header*. Version "3"
994 adds support for revlog flags in the *delta header* and optionally
998 adds support for revlog flags in the *delta header* and optionally
995 exchanging treemanifests (enabled by setting an option on the
999 exchanging treemanifests (enabled by setting an option on the
996 "changegroup" part in the bundle2).
1000 "changegroup" part in the bundle2).
997
1001
998 Changegroups when not exchanging treemanifests consist of 3 logical
1002 Changegroups when not exchanging treemanifests consist of 3 logical
999 segments:
1003 segments:
1000
1004
1001 +---------------------------------+
1005 +---------------------------------+
1002 | | | |
1006 | | | |
1003 | changeset | manifest | filelogs |
1007 | changeset | manifest | filelogs |
1004 | | | |
1008 | | | |
1005 | | | |
1009 | | | |
1006 +---------------------------------+
1010 +---------------------------------+
1007
1011
1008 When exchanging treemanifests, there are 4 logical segments:
1012 When exchanging treemanifests, there are 4 logical segments:
1009
1013
1010 +-------------------------------------------------+
1014 +-------------------------------------------------+
1011 | | | | |
1015 | | | | |
1012 | changeset | root | treemanifests | filelogs |
1016 | changeset | root | treemanifests | filelogs |
1013 | | manifest | | |
1017 | | manifest | | |
1014 | | | | |
1018 | | | | |
1015 +-------------------------------------------------+
1019 +-------------------------------------------------+
1016
1020
1017 The principle building block of each segment is a *chunk*. A *chunk* is a
1021 The principle building block of each segment is a *chunk*. A *chunk* is a
1018 framed piece of data:
1022 framed piece of data:
1019
1023
1020 +---------------------------------------+
1024 +---------------------------------------+
1021 | | |
1025 | | |
1022 | length | data |
1026 | length | data |
1023 | (4 bytes) | (<length - 4> bytes) |
1027 | (4 bytes) | (<length - 4> bytes) |
1024 | | |
1028 | | |
1025 +---------------------------------------+
1029 +---------------------------------------+
1026
1030
1027 All integers are big-endian signed integers. Each chunk starts with a
1031 All integers are big-endian signed integers. Each chunk starts with a
1028 32-bit integer indicating the length of the entire chunk (including the
1032 32-bit integer indicating the length of the entire chunk (including the
1029 length field itself).
1033 length field itself).
1030
1034
1031 There is a special case chunk that has a value of 0 for the length
1035 There is a special case chunk that has a value of 0 for the length
1032 ("0x00000000"). We call this an *empty chunk*.
1036 ("0x00000000"). We call this an *empty chunk*.
1033
1037
1034 Delta Groups
1038 Delta Groups
1035 ============
1039 ============
1036
1040
1037 A *delta group* expresses the content of a revlog as a series of deltas,
1041 A *delta group* expresses the content of a revlog as a series of deltas,
1038 or patches against previous revisions.
1042 or patches against previous revisions.
1039
1043
1040 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1044 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1041 to signal the end of the delta group:
1045 to signal the end of the delta group:
1042
1046
1043 +------------------------------------------------------------------------+
1047 +------------------------------------------------------------------------+
1044 | | | | | |
1048 | | | | | |
1045 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1049 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1046 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1050 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1047 | | | | | |
1051 | | | | | |
1048 +------------------------------------------------------------------------+
1052 +------------------------------------------------------------------------+
1049
1053
1050 Each *chunk*'s data consists of the following:
1054 Each *chunk*'s data consists of the following:
1051
1055
1052 +---------------------------------------+
1056 +---------------------------------------+
1053 | | |
1057 | | |
1054 | delta header | delta data |
1058 | delta header | delta data |
1055 | (various by version) | (various) |
1059 | (various by version) | (various) |
1056 | | |
1060 | | |
1057 +---------------------------------------+
1061 +---------------------------------------+
1058
1062
1059 The *delta data* is a series of *delta*s that describe a diff from an
1063 The *delta data* is a series of *delta*s that describe a diff from an
1060 existing entry (either that the recipient already has, or previously
1064 existing entry (either that the recipient already has, or previously
1061 specified in the bundle/changegroup).
1065 specified in the bundle/changegroup).
1062
1066
1063 The *delta header* is different between versions "1", "2", and "3" of the
1067 The *delta header* is different between versions "1", "2", and "3" of the
1064 changegroup format.
1068 changegroup format.
1065
1069
1066 Version 1 (headerlen=80):
1070 Version 1 (headerlen=80):
1067
1071
1068 +------------------------------------------------------+
1072 +------------------------------------------------------+
1069 | | | | |
1073 | | | | |
1070 | node | p1 node | p2 node | link node |
1074 | node | p1 node | p2 node | link node |
1071 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1075 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1072 | | | | |
1076 | | | | |
1073 +------------------------------------------------------+
1077 +------------------------------------------------------+
1074
1078
1075 Version 2 (headerlen=100):
1079 Version 2 (headerlen=100):
1076
1080
1077 +------------------------------------------------------------------+
1081 +------------------------------------------------------------------+
1078 | | | | | |
1082 | | | | | |
1079 | node | p1 node | p2 node | base node | link node |
1083 | node | p1 node | p2 node | base node | link node |
1080 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1084 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1081 | | | | | |
1085 | | | | | |
1082 +------------------------------------------------------------------+
1086 +------------------------------------------------------------------+
1083
1087
1084 Version 3 (headerlen=102):
1088 Version 3 (headerlen=102):
1085
1089
1086 +------------------------------------------------------------------------------+
1090 +------------------------------------------------------------------------------+
1087 | | | | | | |
1091 | | | | | | |
1088 | node | p1 node | p2 node | base node | link node | flags |
1092 | node | p1 node | p2 node | base node | link node | flags |
1089 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1093 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1090 | | | | | | |
1094 | | | | | | |
1091 +------------------------------------------------------------------------------+
1095 +------------------------------------------------------------------------------+
1092
1096
1093 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1097 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1094 contain a series of *delta*s, densely packed (no separators). These deltas
1098 contain a series of *delta*s, densely packed (no separators). These deltas
1095 describe a diff from an existing entry (either that the recipient already
1099 describe a diff from an existing entry (either that the recipient already
1096 has, or previously specified in the bundle/changegroup). The format is
1100 has, or previously specified in the bundle/changegroup). The format is
1097 described more fully in "hg help internals.bdiff", but briefly:
1101 described more fully in "hg help internals.bdiff", but briefly:
1098
1102
1099 +---------------------------------------------------------------+
1103 +---------------------------------------------------------------+
1100 | | | | |
1104 | | | | |
1101 | start offset | end offset | new length | content |
1105 | start offset | end offset | new length | content |
1102 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1106 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1103 | | | | |
1107 | | | | |
1104 +---------------------------------------------------------------+
1108 +---------------------------------------------------------------+
1105
1109
1106 Please note that the length field in the delta data does *not* include
1110 Please note that the length field in the delta data does *not* include
1107 itself.
1111 itself.
1108
1112
1109 In version 1, the delta is always applied against the previous node from
1113 In version 1, the delta is always applied against the previous node from
1110 the changegroup or the first parent if this is the first entry in the
1114 the changegroup or the first parent if this is the first entry in the
1111 changegroup.
1115 changegroup.
1112
1116
1113 In version 2 and up, the delta base node is encoded in the entry in the
1117 In version 2 and up, the delta base node is encoded in the entry in the
1114 changegroup. This allows the delta to be expressed against any parent,
1118 changegroup. This allows the delta to be expressed against any parent,
1115 which can result in smaller deltas and more efficient encoding of data.
1119 which can result in smaller deltas and more efficient encoding of data.
1116
1120
1117 Changeset Segment
1121 Changeset Segment
1118 =================
1122 =================
1119
1123
1120 The *changeset segment* consists of a single *delta group* holding
1124 The *changeset segment* consists of a single *delta group* holding
1121 changelog data. The *empty chunk* at the end of the *delta group* denotes
1125 changelog data. The *empty chunk* at the end of the *delta group* denotes
1122 the boundary to the *manifest segment*.
1126 the boundary to the *manifest segment*.
1123
1127
1124 Manifest Segment
1128 Manifest Segment
1125 ================
1129 ================
1126
1130
1127 The *manifest segment* consists of a single *delta group* holding manifest
1131 The *manifest segment* consists of a single *delta group* holding manifest
1128 data. If treemanifests are in use, it contains only the manifest for the
1132 data. If treemanifests are in use, it contains only the manifest for the
1129 root directory of the repository. Otherwise, it contains the entire
1133 root directory of the repository. Otherwise, it contains the entire
1130 manifest data. The *empty chunk* at the end of the *delta group* denotes
1134 manifest data. The *empty chunk* at the end of the *delta group* denotes
1131 the boundary to the next segment (either the *treemanifests segment* or
1135 the boundary to the next segment (either the *treemanifests segment* or
1132 the *filelogs segment*, depending on version and the request options).
1136 the *filelogs segment*, depending on version and the request options).
1133
1137
1134 Treemanifests Segment
1138 Treemanifests Segment
1135 ---------------------
1139 ---------------------
1136
1140
1137 The *treemanifests segment* only exists in changegroup version "3", and
1141 The *treemanifests segment* only exists in changegroup version "3", and
1138 only if the 'treemanifest' param is part of the bundle2 changegroup part
1142 only if the 'treemanifest' param is part of the bundle2 changegroup part
1139 (it is not possible to use changegroup version 3 outside of bundle2).
1143 (it is not possible to use changegroup version 3 outside of bundle2).
1140 Aside from the filenames in the *treemanifests segment* containing a
1144 Aside from the filenames in the *treemanifests segment* containing a
1141 trailing "/" character, it behaves identically to the *filelogs segment*
1145 trailing "/" character, it behaves identically to the *filelogs segment*
1142 (see below). The final sub-segment is followed by an *empty chunk*
1146 (see below). The final sub-segment is followed by an *empty chunk*
1143 (logically, a sub-segment with filename size 0). This denotes the boundary
1147 (logically, a sub-segment with filename size 0). This denotes the boundary
1144 to the *filelogs segment*.
1148 to the *filelogs segment*.
1145
1149
1146 Filelogs Segment
1150 Filelogs Segment
1147 ================
1151 ================
1148
1152
1149 The *filelogs segment* consists of multiple sub-segments, each
1153 The *filelogs segment* consists of multiple sub-segments, each
1150 corresponding to an individual file whose data is being described:
1154 corresponding to an individual file whose data is being described:
1151
1155
1152 +--------------------------------------------------+
1156 +--------------------------------------------------+
1153 | | | | | |
1157 | | | | | |
1154 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1158 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1155 | | | | | (4 bytes) |
1159 | | | | | (4 bytes) |
1156 | | | | | |
1160 | | | | | |
1157 +--------------------------------------------------+
1161 +--------------------------------------------------+
1158
1162
1159 The final filelog sub-segment is followed by an *empty chunk* (logically,
1163 The final filelog sub-segment is followed by an *empty chunk* (logically,
1160 a sub-segment with filename size 0). This denotes the end of the segment
1164 a sub-segment with filename size 0). This denotes the end of the segment
1161 and of the overall changegroup.
1165 and of the overall changegroup.
1162
1166
1163 Each filelog sub-segment consists of the following:
1167 Each filelog sub-segment consists of the following:
1164
1168
1165 +------------------------------------------------------+
1169 +------------------------------------------------------+
1166 | | | |
1170 | | | |
1167 | filename length | filename | delta group |
1171 | filename length | filename | delta group |
1168 | (4 bytes) | (<length - 4> bytes) | (various) |
1172 | (4 bytes) | (<length - 4> bytes) | (various) |
1169 | | | |
1173 | | | |
1170 +------------------------------------------------------+
1174 +------------------------------------------------------+
1171
1175
1172 That is, a *chunk* consisting of the filename (not terminated or padded)
1176 That is, a *chunk* consisting of the filename (not terminated or padded)
1173 followed by N chunks constituting the *delta group* for this file. The
1177 followed by N chunks constituting the *delta group* for this file. The
1174 *empty chunk* at the end of each *delta group* denotes the boundary to the
1178 *empty chunk* at the end of each *delta group* denotes the boundary to the
1175 next filelog sub-segment.
1179 next filelog sub-segment.
1176
1180
1177 Test list of commands with command with no help text
1181 Test list of commands with command with no help text
1178
1182
1179 $ hg help helpext
1183 $ hg help helpext
1180 helpext extension - no help text available
1184 helpext extension - no help text available
1181
1185
1182 list of commands:
1186 list of commands:
1183
1187
1184 nohelp (no help text available)
1188 nohelp (no help text available)
1185
1189
1186 (use 'hg help -v helpext' to show built-in aliases and global options)
1190 (use 'hg help -v helpext' to show built-in aliases and global options)
1187
1191
1188
1192
1189 test advanced, deprecated and experimental options are hidden in command help
1193 test advanced, deprecated and experimental options are hidden in command help
1190 $ hg help debugoptADV
1194 $ hg help debugoptADV
1191 hg debugoptADV
1195 hg debugoptADV
1192
1196
1193 (no help text available)
1197 (no help text available)
1194
1198
1195 options:
1199 options:
1196
1200
1197 (some details hidden, use --verbose to show complete help)
1201 (some details hidden, use --verbose to show complete help)
1198 $ hg help debugoptDEP
1202 $ hg help debugoptDEP
1199 hg debugoptDEP
1203 hg debugoptDEP
1200
1204
1201 (no help text available)
1205 (no help text available)
1202
1206
1203 options:
1207 options:
1204
1208
1205 (some details hidden, use --verbose to show complete help)
1209 (some details hidden, use --verbose to show complete help)
1206
1210
1207 $ hg help debugoptEXP
1211 $ hg help debugoptEXP
1208 hg debugoptEXP
1212 hg debugoptEXP
1209
1213
1210 (no help text available)
1214 (no help text available)
1211
1215
1212 options:
1216 options:
1213
1217
1214 (some details hidden, use --verbose to show complete help)
1218 (some details hidden, use --verbose to show complete help)
1215
1219
1216 test advanced, deprecated and experimental options are shown with -v
1220 test advanced, deprecated and experimental options are shown with -v
1217 $ hg help -v debugoptADV | grep aopt
1221 $ hg help -v debugoptADV | grep aopt
1218 --aopt option is (ADVANCED)
1222 --aopt option is (ADVANCED)
1219 $ hg help -v debugoptDEP | grep dopt
1223 $ hg help -v debugoptDEP | grep dopt
1220 --dopt option is (DEPRECATED)
1224 --dopt option is (DEPRECATED)
1221 $ hg help -v debugoptEXP | grep eopt
1225 $ hg help -v debugoptEXP | grep eopt
1222 --eopt option is (EXPERIMENTAL)
1226 --eopt option is (EXPERIMENTAL)
1223
1227
1224 #if gettext
1228 #if gettext
1225 test deprecated option is hidden with translation with untranslated description
1229 test deprecated option is hidden with translation with untranslated description
1226 (use many globy for not failing on changed transaction)
1230 (use many globy for not failing on changed transaction)
1227 $ LANGUAGE=sv hg help debugoptDEP
1231 $ LANGUAGE=sv hg help debugoptDEP
1228 hg debugoptDEP
1232 hg debugoptDEP
1229
1233
1230 (*) (glob)
1234 (*) (glob)
1231
1235
1232 options:
1236 options:
1233
1237
1234 (some details hidden, use --verbose to show complete help)
1238 (some details hidden, use --verbose to show complete help)
1235 #endif
1239 #endif
1236
1240
1237 Test commands that collide with topics (issue4240)
1241 Test commands that collide with topics (issue4240)
1238
1242
1239 $ hg config -hq
1243 $ hg config -hq
1240 hg config [-u] [NAME]...
1244 hg config [-u] [NAME]...
1241
1245
1242 show combined config settings from all hgrc files
1246 show combined config settings from all hgrc files
1243 $ hg showconfig -hq
1247 $ hg showconfig -hq
1244 hg config [-u] [NAME]...
1248 hg config [-u] [NAME]...
1245
1249
1246 show combined config settings from all hgrc files
1250 show combined config settings from all hgrc files
1247
1251
1248 Test a help topic
1252 Test a help topic
1249
1253
1250 $ hg help dates
1254 $ hg help dates
1251 Date Formats
1255 Date Formats
1252 """"""""""""
1256 """"""""""""
1253
1257
1254 Some commands allow the user to specify a date, e.g.:
1258 Some commands allow the user to specify a date, e.g.:
1255
1259
1256 - backout, commit, import, tag: Specify the commit date.
1260 - backout, commit, import, tag: Specify the commit date.
1257 - log, revert, update: Select revision(s) by date.
1261 - log, revert, update: Select revision(s) by date.
1258
1262
1259 Many date formats are valid. Here are some examples:
1263 Many date formats are valid. Here are some examples:
1260
1264
1261 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1265 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1262 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1266 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1263 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1267 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1264 - "Dec 6" (midnight)
1268 - "Dec 6" (midnight)
1265 - "13:18" (today assumed)
1269 - "13:18" (today assumed)
1266 - "3:39" (3:39AM assumed)
1270 - "3:39" (3:39AM assumed)
1267 - "3:39pm" (15:39)
1271 - "3:39pm" (15:39)
1268 - "2006-12-06 13:18:29" (ISO 8601 format)
1272 - "2006-12-06 13:18:29" (ISO 8601 format)
1269 - "2006-12-6 13:18"
1273 - "2006-12-6 13:18"
1270 - "2006-12-6"
1274 - "2006-12-6"
1271 - "12-6"
1275 - "12-6"
1272 - "12/6"
1276 - "12/6"
1273 - "12/6/6" (Dec 6 2006)
1277 - "12/6/6" (Dec 6 2006)
1274 - "today" (midnight)
1278 - "today" (midnight)
1275 - "yesterday" (midnight)
1279 - "yesterday" (midnight)
1276 - "now" - right now
1280 - "now" - right now
1277
1281
1278 Lastly, there is Mercurial's internal format:
1282 Lastly, there is Mercurial's internal format:
1279
1283
1280 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1284 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1281
1285
1282 This is the internal representation format for dates. The first number is
1286 This is the internal representation format for dates. The first number is
1283 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1287 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1284 is the offset of the local timezone, in seconds west of UTC (negative if
1288 is the offset of the local timezone, in seconds west of UTC (negative if
1285 the timezone is east of UTC).
1289 the timezone is east of UTC).
1286
1290
1287 The log command also accepts date ranges:
1291 The log command also accepts date ranges:
1288
1292
1289 - "<DATE" - at or before a given date/time
1293 - "<DATE" - at or before a given date/time
1290 - ">DATE" - on or after a given date/time
1294 - ">DATE" - on or after a given date/time
1291 - "DATE to DATE" - a date range, inclusive
1295 - "DATE to DATE" - a date range, inclusive
1292 - "-DAYS" - within a given number of days of today
1296 - "-DAYS" - within a given number of days of today
1293
1297
1294 Test repeated config section name
1298 Test repeated config section name
1295
1299
1296 $ hg help config.host
1300 $ hg help config.host
1297 "http_proxy.host"
1301 "http_proxy.host"
1298 Host name and (optional) port of the proxy server, for example
1302 Host name and (optional) port of the proxy server, for example
1299 "myproxy:8000".
1303 "myproxy:8000".
1300
1304
1301 "smtp.host"
1305 "smtp.host"
1302 Host name of mail server, e.g. "mail.example.com".
1306 Host name of mail server, e.g. "mail.example.com".
1303
1307
1304 Unrelated trailing paragraphs shouldn't be included
1308 Unrelated trailing paragraphs shouldn't be included
1305
1309
1306 $ hg help config.extramsg | grep '^$'
1310 $ hg help config.extramsg | grep '^$'
1307
1311
1308
1312
1309 Test capitalized section name
1313 Test capitalized section name
1310
1314
1311 $ hg help scripting.HGPLAIN > /dev/null
1315 $ hg help scripting.HGPLAIN > /dev/null
1312
1316
1313 Help subsection:
1317 Help subsection:
1314
1318
1315 $ hg help config.charsets |grep "Email example:" > /dev/null
1319 $ hg help config.charsets |grep "Email example:" > /dev/null
1316 [1]
1320 [1]
1317
1321
1318 Show nested definitions
1322 Show nested definitions
1319 ("profiling.type"[break]"ls"[break]"stat"[break])
1323 ("profiling.type"[break]"ls"[break]"stat"[break])
1320
1324
1321 $ hg help config.type | egrep '^$'|wc -l
1325 $ hg help config.type | egrep '^$'|wc -l
1322 \s*3 (re)
1326 \s*3 (re)
1323
1327
1324 Separate sections from subsections
1328 Separate sections from subsections
1325
1329
1326 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1330 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1327 "format"
1331 "format"
1328 --------
1332 --------
1329
1333
1330 "usegeneraldelta"
1334 "usegeneraldelta"
1331
1335
1332 "dotencode"
1336 "dotencode"
1333
1337
1334 "usefncache"
1338 "usefncache"
1335
1339
1336 "usestore"
1340 "usestore"
1337
1341
1338 "profiling"
1342 "profiling"
1339 -----------
1343 -----------
1340
1344
1341 "format"
1345 "format"
1342
1346
1343 "progress"
1347 "progress"
1344 ----------
1348 ----------
1345
1349
1346 "format"
1350 "format"
1347
1351
1348
1352
1349 Last item in help config.*:
1353 Last item in help config.*:
1350
1354
1351 $ hg help config.`hg help config|grep '^ "'| \
1355 $ hg help config.`hg help config|grep '^ "'| \
1352 > tail -1|sed 's![ "]*!!g'`| \
1356 > tail -1|sed 's![ "]*!!g'`| \
1353 > grep 'hg help -c config' > /dev/null
1357 > grep 'hg help -c config' > /dev/null
1354 [1]
1358 [1]
1355
1359
1356 note to use help -c for general hg help config:
1360 note to use help -c for general hg help config:
1357
1361
1358 $ hg help config |grep 'hg help -c config' > /dev/null
1362 $ hg help config |grep 'hg help -c config' > /dev/null
1359
1363
1360 Test templating help
1364 Test templating help
1361
1365
1362 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1366 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1363 desc String. The text of the changeset description.
1367 desc String. The text of the changeset description.
1364 diffstat String. Statistics of changes with the following format:
1368 diffstat String. Statistics of changes with the following format:
1365 firstline Any text. Returns the first line of text.
1369 firstline Any text. Returns the first line of text.
1366 nonempty Any text. Returns '(none)' if the string is empty.
1370 nonempty Any text. Returns '(none)' if the string is empty.
1367
1371
1368 Test deprecated items
1372 Test deprecated items
1369
1373
1370 $ hg help -v templating | grep currentbookmark
1374 $ hg help -v templating | grep currentbookmark
1371 currentbookmark
1375 currentbookmark
1372 $ hg help templating | (grep currentbookmark || true)
1376 $ hg help templating | (grep currentbookmark || true)
1373
1377
1374 Test help hooks
1378 Test help hooks
1375
1379
1376 $ cat > helphook1.py <<EOF
1380 $ cat > helphook1.py <<EOF
1377 > from mercurial import help
1381 > from mercurial import help
1378 >
1382 >
1379 > def rewrite(ui, topic, doc):
1383 > def rewrite(ui, topic, doc):
1380 > return doc + '\nhelphook1\n'
1384 > return doc + '\nhelphook1\n'
1381 >
1385 >
1382 > def extsetup(ui):
1386 > def extsetup(ui):
1383 > help.addtopichook('revisions', rewrite)
1387 > help.addtopichook('revisions', rewrite)
1384 > EOF
1388 > EOF
1385 $ cat > helphook2.py <<EOF
1389 $ cat > helphook2.py <<EOF
1386 > from mercurial import help
1390 > from mercurial import help
1387 >
1391 >
1388 > def rewrite(ui, topic, doc):
1392 > def rewrite(ui, topic, doc):
1389 > return doc + '\nhelphook2\n'
1393 > return doc + '\nhelphook2\n'
1390 >
1394 >
1391 > def extsetup(ui):
1395 > def extsetup(ui):
1392 > help.addtopichook('revisions', rewrite)
1396 > help.addtopichook('revisions', rewrite)
1393 > EOF
1397 > EOF
1394 $ echo '[extensions]' >> $HGRCPATH
1398 $ echo '[extensions]' >> $HGRCPATH
1395 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1399 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1396 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1400 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1397 $ hg help revsets | grep helphook
1401 $ hg help revsets | grep helphook
1398 helphook1
1402 helphook1
1399 helphook2
1403 helphook2
1400
1404
1401 help -c should only show debug --debug
1405 help -c should only show debug --debug
1402
1406
1403 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1407 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1404 [1]
1408 [1]
1405
1409
1406 help -c should only show deprecated for -v
1410 help -c should only show deprecated for -v
1407
1411
1408 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1412 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1409 [1]
1413 [1]
1410
1414
1411 Test -s / --system
1415 Test -s / --system
1412
1416
1413 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1417 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1414 > wc -l | sed -e 's/ //g'
1418 > wc -l | sed -e 's/ //g'
1415 0
1419 0
1416 $ hg help config.files --system unix | grep 'USER' | \
1420 $ hg help config.files --system unix | grep 'USER' | \
1417 > wc -l | sed -e 's/ //g'
1421 > wc -l | sed -e 's/ //g'
1418 0
1422 0
1419
1423
1420 Test -e / -c / -k combinations
1424 Test -e / -c / -k combinations
1421
1425
1422 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1426 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1423 Commands:
1427 Commands:
1424 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1428 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1425 Extensions:
1429 Extensions:
1426 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1430 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1427 Topics:
1431 Topics:
1428 Commands:
1432 Commands:
1429 Extensions:
1433 Extensions:
1430 Extension Commands:
1434 Extension Commands:
1431 $ hg help -c schemes
1435 $ hg help -c schemes
1432 abort: no such help topic: schemes
1436 abort: no such help topic: schemes
1433 (try 'hg help --keyword schemes')
1437 (try 'hg help --keyword schemes')
1434 [255]
1438 [255]
1435 $ hg help -e schemes |head -1
1439 $ hg help -e schemes |head -1
1436 schemes extension - extend schemes with shortcuts to repository swarms
1440 schemes extension - extend schemes with shortcuts to repository swarms
1437 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1441 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1438 Commands:
1442 Commands:
1439 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1443 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1440 Extensions:
1444 Extensions:
1441 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1445 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1442 Extensions:
1446 Extensions:
1443 Commands:
1447 Commands:
1444 $ hg help -c commit > /dev/null
1448 $ hg help -c commit > /dev/null
1445 $ hg help -e -c commit > /dev/null
1449 $ hg help -e -c commit > /dev/null
1446 $ hg help -e commit > /dev/null
1450 $ hg help -e commit > /dev/null
1447 abort: no such help topic: commit
1451 abort: no such help topic: commit
1448 (try 'hg help --keyword commit')
1452 (try 'hg help --keyword commit')
1449 [255]
1453 [255]
1450
1454
1451 Test keyword search help
1455 Test keyword search help
1452
1456
1453 $ cat > prefixedname.py <<EOF
1457 $ cat > prefixedname.py <<EOF
1454 > '''matched against word "clone"
1458 > '''matched against word "clone"
1455 > '''
1459 > '''
1456 > EOF
1460 > EOF
1457 $ echo '[extensions]' >> $HGRCPATH
1461 $ echo '[extensions]' >> $HGRCPATH
1458 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1462 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1459 $ hg help -k clone
1463 $ hg help -k clone
1460 Topics:
1464 Topics:
1461
1465
1462 config Configuration Files
1466 config Configuration Files
1463 extensions Using Additional Features
1467 extensions Using Additional Features
1464 glossary Glossary
1468 glossary Glossary
1465 phases Working with Phases
1469 phases Working with Phases
1466 subrepos Subrepositories
1470 subrepos Subrepositories
1467 urls URL Paths
1471 urls URL Paths
1468
1472
1469 Commands:
1473 Commands:
1470
1474
1471 bookmarks create a new bookmark or list existing bookmarks
1475 bookmarks create a new bookmark or list existing bookmarks
1472 clone make a copy of an existing repository
1476 clone make a copy of an existing repository
1473 paths show aliases for remote repositories
1477 paths show aliases for remote repositories
1474 update update working directory (or switch revisions)
1478 update update working directory (or switch revisions)
1475
1479
1476 Extensions:
1480 Extensions:
1477
1481
1478 clonebundles advertise pre-generated bundles to seed clones
1482 clonebundles advertise pre-generated bundles to seed clones
1479 prefixedname matched against word "clone"
1483 prefixedname matched against word "clone"
1480 relink recreates hardlinks between repository clones
1484 relink recreates hardlinks between repository clones
1481
1485
1482 Extension Commands:
1486 Extension Commands:
1483
1487
1484 qclone clone main and patch repository at same time
1488 qclone clone main and patch repository at same time
1485
1489
1486 Test unfound topic
1490 Test unfound topic
1487
1491
1488 $ hg help nonexistingtopicthatwillneverexisteverever
1492 $ hg help nonexistingtopicthatwillneverexisteverever
1489 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1493 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1490 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1494 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1491 [255]
1495 [255]
1492
1496
1493 Test unfound keyword
1497 Test unfound keyword
1494
1498
1495 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1499 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1496 abort: no matches
1500 abort: no matches
1497 (try 'hg help' for a list of topics)
1501 (try 'hg help' for a list of topics)
1498 [255]
1502 [255]
1499
1503
1500 Test omit indicating for help
1504 Test omit indicating for help
1501
1505
1502 $ cat > addverboseitems.py <<EOF
1506 $ cat > addverboseitems.py <<EOF
1503 > '''extension to test omit indicating.
1507 > '''extension to test omit indicating.
1504 >
1508 >
1505 > This paragraph is never omitted (for extension)
1509 > This paragraph is never omitted (for extension)
1506 >
1510 >
1507 > .. container:: verbose
1511 > .. container:: verbose
1508 >
1512 >
1509 > This paragraph is omitted,
1513 > This paragraph is omitted,
1510 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1514 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1511 >
1515 >
1512 > This paragraph is never omitted, too (for extension)
1516 > This paragraph is never omitted, too (for extension)
1513 > '''
1517 > '''
1514 >
1518 >
1515 > from mercurial import help, commands
1519 > from mercurial import help, commands
1516 > testtopic = """This paragraph is never omitted (for topic).
1520 > testtopic = """This paragraph is never omitted (for topic).
1517 >
1521 >
1518 > .. container:: verbose
1522 > .. container:: verbose
1519 >
1523 >
1520 > This paragraph is omitted,
1524 > This paragraph is omitted,
1521 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1525 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1522 >
1526 >
1523 > This paragraph is never omitted, too (for topic)
1527 > This paragraph is never omitted, too (for topic)
1524 > """
1528 > """
1525 > def extsetup(ui):
1529 > def extsetup(ui):
1526 > help.helptable.append((["topic-containing-verbose"],
1530 > help.helptable.append((["topic-containing-verbose"],
1527 > "This is the topic to test omit indicating.",
1531 > "This is the topic to test omit indicating.",
1528 > lambda ui: testtopic))
1532 > lambda ui: testtopic))
1529 > EOF
1533 > EOF
1530 $ echo '[extensions]' >> $HGRCPATH
1534 $ echo '[extensions]' >> $HGRCPATH
1531 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1535 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1532 $ hg help addverboseitems
1536 $ hg help addverboseitems
1533 addverboseitems extension - extension to test omit indicating.
1537 addverboseitems extension - extension to test omit indicating.
1534
1538
1535 This paragraph is never omitted (for extension)
1539 This paragraph is never omitted (for extension)
1536
1540
1537 This paragraph is never omitted, too (for extension)
1541 This paragraph is never omitted, too (for extension)
1538
1542
1539 (some details hidden, use --verbose to show complete help)
1543 (some details hidden, use --verbose to show complete help)
1540
1544
1541 no commands defined
1545 no commands defined
1542 $ hg help -v addverboseitems
1546 $ hg help -v addverboseitems
1543 addverboseitems extension - extension to test omit indicating.
1547 addverboseitems extension - extension to test omit indicating.
1544
1548
1545 This paragraph is never omitted (for extension)
1549 This paragraph is never omitted (for extension)
1546
1550
1547 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1551 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1548 extension)
1552 extension)
1549
1553
1550 This paragraph is never omitted, too (for extension)
1554 This paragraph is never omitted, too (for extension)
1551
1555
1552 no commands defined
1556 no commands defined
1553 $ hg help topic-containing-verbose
1557 $ hg help topic-containing-verbose
1554 This is the topic to test omit indicating.
1558 This is the topic to test omit indicating.
1555 """"""""""""""""""""""""""""""""""""""""""
1559 """"""""""""""""""""""""""""""""""""""""""
1556
1560
1557 This paragraph is never omitted (for topic).
1561 This paragraph is never omitted (for topic).
1558
1562
1559 This paragraph is never omitted, too (for topic)
1563 This paragraph is never omitted, too (for topic)
1560
1564
1561 (some details hidden, use --verbose to show complete help)
1565 (some details hidden, use --verbose to show complete help)
1562 $ hg help -v topic-containing-verbose
1566 $ hg help -v topic-containing-verbose
1563 This is the topic to test omit indicating.
1567 This is the topic to test omit indicating.
1564 """"""""""""""""""""""""""""""""""""""""""
1568 """"""""""""""""""""""""""""""""""""""""""
1565
1569
1566 This paragraph is never omitted (for topic).
1570 This paragraph is never omitted (for topic).
1567
1571
1568 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1572 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1569 topic)
1573 topic)
1570
1574
1571 This paragraph is never omitted, too (for topic)
1575 This paragraph is never omitted, too (for topic)
1572
1576
1573 Test section lookup
1577 Test section lookup
1574
1578
1575 $ hg help revset.merge
1579 $ hg help revset.merge
1576 "merge()"
1580 "merge()"
1577 Changeset is a merge changeset.
1581 Changeset is a merge changeset.
1578
1582
1579 $ hg help glossary.dag
1583 $ hg help glossary.dag
1580 DAG
1584 DAG
1581 The repository of changesets of a distributed version control system
1585 The repository of changesets of a distributed version control system
1582 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1586 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1583 of nodes and edges, where nodes correspond to changesets and edges
1587 of nodes and edges, where nodes correspond to changesets and edges
1584 imply a parent -> child relation. This graph can be visualized by
1588 imply a parent -> child relation. This graph can be visualized by
1585 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1589 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1586 limited by the requirement for children to have at most two parents.
1590 limited by the requirement for children to have at most two parents.
1587
1591
1588
1592
1589 $ hg help hgrc.paths
1593 $ hg help hgrc.paths
1590 "paths"
1594 "paths"
1591 -------
1595 -------
1592
1596
1593 Assigns symbolic names and behavior to repositories.
1597 Assigns symbolic names and behavior to repositories.
1594
1598
1595 Options are symbolic names defining the URL or directory that is the
1599 Options are symbolic names defining the URL or directory that is the
1596 location of the repository. Example:
1600 location of the repository. Example:
1597
1601
1598 [paths]
1602 [paths]
1599 my_server = https://example.com/my_repo
1603 my_server = https://example.com/my_repo
1600 local_path = /home/me/repo
1604 local_path = /home/me/repo
1601
1605
1602 These symbolic names can be used from the command line. To pull from
1606 These symbolic names can be used from the command line. To pull from
1603 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1607 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1604 local_path'.
1608 local_path'.
1605
1609
1606 Options containing colons (":") denote sub-options that can influence
1610 Options containing colons (":") denote sub-options that can influence
1607 behavior for that specific path. Example:
1611 behavior for that specific path. Example:
1608
1612
1609 [paths]
1613 [paths]
1610 my_server = https://example.com/my_path
1614 my_server = https://example.com/my_path
1611 my_server:pushurl = ssh://example.com/my_path
1615 my_server:pushurl = ssh://example.com/my_path
1612
1616
1613 The following sub-options can be defined:
1617 The following sub-options can be defined:
1614
1618
1615 "pushurl"
1619 "pushurl"
1616 The URL to use for push operations. If not defined, the location
1620 The URL to use for push operations. If not defined, the location
1617 defined by the path's main entry is used.
1621 defined by the path's main entry is used.
1618
1622
1619 "pushrev"
1623 "pushrev"
1620 A revset defining which revisions to push by default.
1624 A revset defining which revisions to push by default.
1621
1625
1622 When 'hg push' is executed without a "-r" argument, the revset defined
1626 When 'hg push' is executed without a "-r" argument, the revset defined
1623 by this sub-option is evaluated to determine what to push.
1627 by this sub-option is evaluated to determine what to push.
1624
1628
1625 For example, a value of "." will push the working directory's revision
1629 For example, a value of "." will push the working directory's revision
1626 by default.
1630 by default.
1627
1631
1628 Revsets specifying bookmarks will not result in the bookmark being
1632 Revsets specifying bookmarks will not result in the bookmark being
1629 pushed.
1633 pushed.
1630
1634
1631 The following special named paths exist:
1635 The following special named paths exist:
1632
1636
1633 "default"
1637 "default"
1634 The URL or directory to use when no source or remote is specified.
1638 The URL or directory to use when no source or remote is specified.
1635
1639
1636 'hg clone' will automatically define this path to the location the
1640 'hg clone' will automatically define this path to the location the
1637 repository was cloned from.
1641 repository was cloned from.
1638
1642
1639 "default-push"
1643 "default-push"
1640 (deprecated) The URL or directory for the default 'hg push' location.
1644 (deprecated) The URL or directory for the default 'hg push' location.
1641 "default:pushurl" should be used instead.
1645 "default:pushurl" should be used instead.
1642
1646
1643 $ hg help glossary.mcguffin
1647 $ hg help glossary.mcguffin
1644 abort: help section not found: glossary.mcguffin
1648 abort: help section not found: glossary.mcguffin
1645 [255]
1649 [255]
1646
1650
1647 $ hg help glossary.mc.guffin
1651 $ hg help glossary.mc.guffin
1648 abort: help section not found: glossary.mc.guffin
1652 abort: help section not found: glossary.mc.guffin
1649 [255]
1653 [255]
1650
1654
1651 $ hg help template.files
1655 $ hg help template.files
1652 files List of strings. All files modified, added, or removed by
1656 files List of strings. All files modified, added, or removed by
1653 this changeset.
1657 this changeset.
1654 files(pattern)
1658 files(pattern)
1655 All files of the current changeset matching the pattern. See
1659 All files of the current changeset matching the pattern. See
1656 'hg help patterns'.
1660 'hg help patterns'.
1657
1661
1658 Test section lookup by translated message
1662 Test section lookup by translated message
1659
1663
1660 str.lower() instead of encoding.lower(str) on translated message might
1664 str.lower() instead of encoding.lower(str) on translated message might
1661 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1665 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1662 as the second or later byte of multi-byte character.
1666 as the second or later byte of multi-byte character.
1663
1667
1664 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1668 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1665 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1669 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1666 replacement makes message meaningless.
1670 replacement makes message meaningless.
1667
1671
1668 This tests that section lookup by translated string isn't broken by
1672 This tests that section lookup by translated string isn't broken by
1669 such str.lower().
1673 such str.lower().
1670
1674
1671 $ $PYTHON <<EOF
1675 $ $PYTHON <<EOF
1672 > def escape(s):
1676 > def escape(s):
1673 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1677 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1674 > # translation of "record" in ja_JP.cp932
1678 > # translation of "record" in ja_JP.cp932
1675 > upper = "\x8bL\x98^"
1679 > upper = "\x8bL\x98^"
1676 > # str.lower()-ed section name should be treated as different one
1680 > # str.lower()-ed section name should be treated as different one
1677 > lower = "\x8bl\x98^"
1681 > lower = "\x8bl\x98^"
1678 > with open('ambiguous.py', 'w') as fp:
1682 > with open('ambiguous.py', 'w') as fp:
1679 > fp.write("""# ambiguous section names in ja_JP.cp932
1683 > fp.write("""# ambiguous section names in ja_JP.cp932
1680 > u'''summary of extension
1684 > u'''summary of extension
1681 >
1685 >
1682 > %s
1686 > %s
1683 > ----
1687 > ----
1684 >
1688 >
1685 > Upper name should show only this message
1689 > Upper name should show only this message
1686 >
1690 >
1687 > %s
1691 > %s
1688 > ----
1692 > ----
1689 >
1693 >
1690 > Lower name should show only this message
1694 > Lower name should show only this message
1691 >
1695 >
1692 > subsequent section
1696 > subsequent section
1693 > ------------------
1697 > ------------------
1694 >
1698 >
1695 > This should be hidden at 'hg help ambiguous' with section name.
1699 > This should be hidden at 'hg help ambiguous' with section name.
1696 > '''
1700 > '''
1697 > """ % (escape(upper), escape(lower)))
1701 > """ % (escape(upper), escape(lower)))
1698 > EOF
1702 > EOF
1699
1703
1700 $ cat >> $HGRCPATH <<EOF
1704 $ cat >> $HGRCPATH <<EOF
1701 > [extensions]
1705 > [extensions]
1702 > ambiguous = ./ambiguous.py
1706 > ambiguous = ./ambiguous.py
1703 > EOF
1707 > EOF
1704
1708
1705 $ $PYTHON <<EOF | sh
1709 $ $PYTHON <<EOF | sh
1706 > upper = "\x8bL\x98^"
1710 > upper = "\x8bL\x98^"
1707 > print "hg --encoding cp932 help -e ambiguous.%s" % upper
1711 > print "hg --encoding cp932 help -e ambiguous.%s" % upper
1708 > EOF
1712 > EOF
1709 \x8bL\x98^ (esc)
1713 \x8bL\x98^ (esc)
1710 ----
1714 ----
1711
1715
1712 Upper name should show only this message
1716 Upper name should show only this message
1713
1717
1714
1718
1715 $ $PYTHON <<EOF | sh
1719 $ $PYTHON <<EOF | sh
1716 > lower = "\x8bl\x98^"
1720 > lower = "\x8bl\x98^"
1717 > print "hg --encoding cp932 help -e ambiguous.%s" % lower
1721 > print "hg --encoding cp932 help -e ambiguous.%s" % lower
1718 > EOF
1722 > EOF
1719 \x8bl\x98^ (esc)
1723 \x8bl\x98^ (esc)
1720 ----
1724 ----
1721
1725
1722 Lower name should show only this message
1726 Lower name should show only this message
1723
1727
1724
1728
1725 $ cat >> $HGRCPATH <<EOF
1729 $ cat >> $HGRCPATH <<EOF
1726 > [extensions]
1730 > [extensions]
1727 > ambiguous = !
1731 > ambiguous = !
1728 > EOF
1732 > EOF
1729
1733
1730 Show help content of disabled extensions
1734 Show help content of disabled extensions
1731
1735
1732 $ cat >> $HGRCPATH <<EOF
1736 $ cat >> $HGRCPATH <<EOF
1733 > [extensions]
1737 > [extensions]
1734 > ambiguous = !./ambiguous.py
1738 > ambiguous = !./ambiguous.py
1735 > EOF
1739 > EOF
1736 $ hg help -e ambiguous
1740 $ hg help -e ambiguous
1737 ambiguous extension - (no help text available)
1741 ambiguous extension - (no help text available)
1738
1742
1739 (use 'hg help extensions' for information on enabling extensions)
1743 (use 'hg help extensions' for information on enabling extensions)
1740
1744
1741 Test dynamic list of merge tools only shows up once
1745 Test dynamic list of merge tools only shows up once
1742 $ hg help merge-tools
1746 $ hg help merge-tools
1743 Merge Tools
1747 Merge Tools
1744 """""""""""
1748 """""""""""
1745
1749
1746 To merge files Mercurial uses merge tools.
1750 To merge files Mercurial uses merge tools.
1747
1751
1748 A merge tool combines two different versions of a file into a merged file.
1752 A merge tool combines two different versions of a file into a merged file.
1749 Merge tools are given the two files and the greatest common ancestor of
1753 Merge tools are given the two files and the greatest common ancestor of
1750 the two file versions, so they can determine the changes made on both
1754 the two file versions, so they can determine the changes made on both
1751 branches.
1755 branches.
1752
1756
1753 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1757 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1754 backout' and in several extensions.
1758 backout' and in several extensions.
1755
1759
1756 Usually, the merge tool tries to automatically reconcile the files by
1760 Usually, the merge tool tries to automatically reconcile the files by
1757 combining all non-overlapping changes that occurred separately in the two
1761 combining all non-overlapping changes that occurred separately in the two
1758 different evolutions of the same initial base file. Furthermore, some
1762 different evolutions of the same initial base file. Furthermore, some
1759 interactive merge programs make it easier to manually resolve conflicting
1763 interactive merge programs make it easier to manually resolve conflicting
1760 merges, either in a graphical way, or by inserting some conflict markers.
1764 merges, either in a graphical way, or by inserting some conflict markers.
1761 Mercurial does not include any interactive merge programs but relies on
1765 Mercurial does not include any interactive merge programs but relies on
1762 external tools for that.
1766 external tools for that.
1763
1767
1764 Available merge tools
1768 Available merge tools
1765 =====================
1769 =====================
1766
1770
1767 External merge tools and their properties are configured in the merge-
1771 External merge tools and their properties are configured in the merge-
1768 tools configuration section - see hgrc(5) - but they can often just be
1772 tools configuration section - see hgrc(5) - but they can often just be
1769 named by their executable.
1773 named by their executable.
1770
1774
1771 A merge tool is generally usable if its executable can be found on the
1775 A merge tool is generally usable if its executable can be found on the
1772 system and if it can handle the merge. The executable is found if it is an
1776 system and if it can handle the merge. The executable is found if it is an
1773 absolute or relative executable path or the name of an application in the
1777 absolute or relative executable path or the name of an application in the
1774 executable search path. The tool is assumed to be able to handle the merge
1778 executable search path. The tool is assumed to be able to handle the merge
1775 if it can handle symlinks if the file is a symlink, if it can handle
1779 if it can handle symlinks if the file is a symlink, if it can handle
1776 binary files if the file is binary, and if a GUI is available if the tool
1780 binary files if the file is binary, and if a GUI is available if the tool
1777 requires a GUI.
1781 requires a GUI.
1778
1782
1779 There are some internal merge tools which can be used. The internal merge
1783 There are some internal merge tools which can be used. The internal merge
1780 tools are:
1784 tools are:
1781
1785
1782 ":dump"
1786 ":dump"
1783 Creates three versions of the files to merge, containing the contents of
1787 Creates three versions of the files to merge, containing the contents of
1784 local, other and base. These files can then be used to perform a merge
1788 local, other and base. These files can then be used to perform a merge
1785 manually. If the file to be merged is named "a.txt", these files will
1789 manually. If the file to be merged is named "a.txt", these files will
1786 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1790 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1787 they will be placed in the same directory as "a.txt".
1791 they will be placed in the same directory as "a.txt".
1788
1792
1789 This implies permerge. Therefore, files aren't dumped, if premerge runs
1793 This implies permerge. Therefore, files aren't dumped, if premerge runs
1790 successfully. Use :forcedump to forcibly write files out.
1794 successfully. Use :forcedump to forcibly write files out.
1791
1795
1792 ":fail"
1796 ":fail"
1793 Rather than attempting to merge files that were modified on both
1797 Rather than attempting to merge files that were modified on both
1794 branches, it marks them as unresolved. The resolve command must be used
1798 branches, it marks them as unresolved. The resolve command must be used
1795 to resolve these conflicts.
1799 to resolve these conflicts.
1796
1800
1797 ":forcedump"
1801 ":forcedump"
1798 Creates three versions of the files as same as :dump, but omits
1802 Creates three versions of the files as same as :dump, but omits
1799 premerge.
1803 premerge.
1800
1804
1801 ":local"
1805 ":local"
1802 Uses the local 'p1()' version of files as the merged version.
1806 Uses the local 'p1()' version of files as the merged version.
1803
1807
1804 ":merge"
1808 ":merge"
1805 Uses the internal non-interactive simple merge algorithm for merging
1809 Uses the internal non-interactive simple merge algorithm for merging
1806 files. It will fail if there are any conflicts and leave markers in the
1810 files. It will fail if there are any conflicts and leave markers in the
1807 partially merged file. Markers will have two sections, one for each side
1811 partially merged file. Markers will have two sections, one for each side
1808 of merge.
1812 of merge.
1809
1813
1810 ":merge-local"
1814 ":merge-local"
1811 Like :merge, but resolve all conflicts non-interactively in favor of the
1815 Like :merge, but resolve all conflicts non-interactively in favor of the
1812 local 'p1()' changes.
1816 local 'p1()' changes.
1813
1817
1814 ":merge-other"
1818 ":merge-other"
1815 Like :merge, but resolve all conflicts non-interactively in favor of the
1819 Like :merge, but resolve all conflicts non-interactively in favor of the
1816 other 'p2()' changes.
1820 other 'p2()' changes.
1817
1821
1818 ":merge3"
1822 ":merge3"
1819 Uses the internal non-interactive simple merge algorithm for merging
1823 Uses the internal non-interactive simple merge algorithm for merging
1820 files. It will fail if there are any conflicts and leave markers in the
1824 files. It will fail if there are any conflicts and leave markers in the
1821 partially merged file. Marker will have three sections, one from each
1825 partially merged file. Marker will have three sections, one from each
1822 side of the merge and one for the base content.
1826 side of the merge and one for the base content.
1823
1827
1824 ":other"
1828 ":other"
1825 Uses the other 'p2()' version of files as the merged version.
1829 Uses the other 'p2()' version of files as the merged version.
1826
1830
1827 ":prompt"
1831 ":prompt"
1828 Asks the user which of the local 'p1()' or the other 'p2()' version to
1832 Asks the user which of the local 'p1()' or the other 'p2()' version to
1829 keep as the merged version.
1833 keep as the merged version.
1830
1834
1831 ":tagmerge"
1835 ":tagmerge"
1832 Uses the internal tag merge algorithm (experimental).
1836 Uses the internal tag merge algorithm (experimental).
1833
1837
1834 ":union"
1838 ":union"
1835 Uses the internal non-interactive simple merge algorithm for merging
1839 Uses the internal non-interactive simple merge algorithm for merging
1836 files. It will use both left and right sides for conflict regions. No
1840 files. It will use both left and right sides for conflict regions. No
1837 markers are inserted.
1841 markers are inserted.
1838
1842
1839 Internal tools are always available and do not require a GUI but will by
1843 Internal tools are always available and do not require a GUI but will by
1840 default not handle symlinks or binary files.
1844 default not handle symlinks or binary files.
1841
1845
1842 Choosing a merge tool
1846 Choosing a merge tool
1843 =====================
1847 =====================
1844
1848
1845 Mercurial uses these rules when deciding which merge tool to use:
1849 Mercurial uses these rules when deciding which merge tool to use:
1846
1850
1847 1. If a tool has been specified with the --tool option to merge or
1851 1. If a tool has been specified with the --tool option to merge or
1848 resolve, it is used. If it is the name of a tool in the merge-tools
1852 resolve, it is used. If it is the name of a tool in the merge-tools
1849 configuration, its configuration is used. Otherwise the specified tool
1853 configuration, its configuration is used. Otherwise the specified tool
1850 must be executable by the shell.
1854 must be executable by the shell.
1851 2. If the "HGMERGE" environment variable is present, its value is used and
1855 2. If the "HGMERGE" environment variable is present, its value is used and
1852 must be executable by the shell.
1856 must be executable by the shell.
1853 3. If the filename of the file to be merged matches any of the patterns in
1857 3. If the filename of the file to be merged matches any of the patterns in
1854 the merge-patterns configuration section, the first usable merge tool
1858 the merge-patterns configuration section, the first usable merge tool
1855 corresponding to a matching pattern is used. Here, binary capabilities
1859 corresponding to a matching pattern is used. Here, binary capabilities
1856 of the merge tool are not considered.
1860 of the merge tool are not considered.
1857 4. If ui.merge is set it will be considered next. If the value is not the
1861 4. If ui.merge is set it will be considered next. If the value is not the
1858 name of a configured tool, the specified value is used and must be
1862 name of a configured tool, the specified value is used and must be
1859 executable by the shell. Otherwise the named tool is used if it is
1863 executable by the shell. Otherwise the named tool is used if it is
1860 usable.
1864 usable.
1861 5. If any usable merge tools are present in the merge-tools configuration
1865 5. If any usable merge tools are present in the merge-tools configuration
1862 section, the one with the highest priority is used.
1866 section, the one with the highest priority is used.
1863 6. If a program named "hgmerge" can be found on the system, it is used -
1867 6. If a program named "hgmerge" can be found on the system, it is used -
1864 but it will by default not be used for symlinks and binary files.
1868 but it will by default not be used for symlinks and binary files.
1865 7. If the file to be merged is not binary and is not a symlink, then
1869 7. If the file to be merged is not binary and is not a symlink, then
1866 internal ":merge" is used.
1870 internal ":merge" is used.
1867 8. Otherwise, ":prompt" is used.
1871 8. Otherwise, ":prompt" is used.
1868
1872
1869 Note:
1873 Note:
1870 After selecting a merge program, Mercurial will by default attempt to
1874 After selecting a merge program, Mercurial will by default attempt to
1871 merge the files using a simple merge algorithm first. Only if it
1875 merge the files using a simple merge algorithm first. Only if it
1872 doesn't succeed because of conflicting changes Mercurial will actually
1876 doesn't succeed because of conflicting changes Mercurial will actually
1873 execute the merge program. Whether to use the simple merge algorithm
1877 execute the merge program. Whether to use the simple merge algorithm
1874 first can be controlled by the premerge setting of the merge tool.
1878 first can be controlled by the premerge setting of the merge tool.
1875 Premerge is enabled by default unless the file is binary or a symlink.
1879 Premerge is enabled by default unless the file is binary or a symlink.
1876
1880
1877 See the merge-tools and ui sections of hgrc(5) for details on the
1881 See the merge-tools and ui sections of hgrc(5) for details on the
1878 configuration of merge tools.
1882 configuration of merge tools.
1879
1883
1880 Compression engines listed in `hg help bundlespec`
1884 Compression engines listed in `hg help bundlespec`
1881
1885
1882 $ hg help bundlespec | grep gzip
1886 $ hg help bundlespec | grep gzip
1883 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1887 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1884 An algorithm that produces smaller bundles than "gzip".
1888 An algorithm that produces smaller bundles than "gzip".
1885 This engine will likely produce smaller bundles than "gzip" but will be
1889 This engine will likely produce smaller bundles than "gzip" but will be
1886 "gzip"
1890 "gzip"
1887 better compression than "gzip". It also frequently yields better (?)
1891 better compression than "gzip". It also frequently yields better (?)
1888
1892
1889 Test usage of section marks in help documents
1893 Test usage of section marks in help documents
1890
1894
1891 $ cd "$TESTDIR"/../doc
1895 $ cd "$TESTDIR"/../doc
1892 $ $PYTHON check-seclevel.py
1896 $ $PYTHON check-seclevel.py
1893 $ cd $TESTTMP
1897 $ cd $TESTTMP
1894
1898
1895 #if serve
1899 #if serve
1896
1900
1897 Test the help pages in hgweb.
1901 Test the help pages in hgweb.
1898
1902
1899 Dish up an empty repo; serve it cold.
1903 Dish up an empty repo; serve it cold.
1900
1904
1901 $ hg init "$TESTTMP/test"
1905 $ hg init "$TESTTMP/test"
1902 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1906 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1903 $ cat hg.pid >> $DAEMON_PIDS
1907 $ cat hg.pid >> $DAEMON_PIDS
1904
1908
1905 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1909 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1906 200 Script output follows
1910 200 Script output follows
1907
1911
1908 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1912 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1909 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1913 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1910 <head>
1914 <head>
1911 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1915 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1912 <meta name="robots" content="index, nofollow" />
1916 <meta name="robots" content="index, nofollow" />
1913 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1917 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1914 <script type="text/javascript" src="/static/mercurial.js"></script>
1918 <script type="text/javascript" src="/static/mercurial.js"></script>
1915
1919
1916 <title>Help: Index</title>
1920 <title>Help: Index</title>
1917 </head>
1921 </head>
1918 <body>
1922 <body>
1919
1923
1920 <div class="container">
1924 <div class="container">
1921 <div class="menu">
1925 <div class="menu">
1922 <div class="logo">
1926 <div class="logo">
1923 <a href="https://mercurial-scm.org/">
1927 <a href="https://mercurial-scm.org/">
1924 <img src="/static/hglogo.png" alt="mercurial" /></a>
1928 <img src="/static/hglogo.png" alt="mercurial" /></a>
1925 </div>
1929 </div>
1926 <ul>
1930 <ul>
1927 <li><a href="/shortlog">log</a></li>
1931 <li><a href="/shortlog">log</a></li>
1928 <li><a href="/graph">graph</a></li>
1932 <li><a href="/graph">graph</a></li>
1929 <li><a href="/tags">tags</a></li>
1933 <li><a href="/tags">tags</a></li>
1930 <li><a href="/bookmarks">bookmarks</a></li>
1934 <li><a href="/bookmarks">bookmarks</a></li>
1931 <li><a href="/branches">branches</a></li>
1935 <li><a href="/branches">branches</a></li>
1932 </ul>
1936 </ul>
1933 <ul>
1937 <ul>
1934 <li class="active">help</li>
1938 <li class="active">help</li>
1935 </ul>
1939 </ul>
1936 </div>
1940 </div>
1937
1941
1938 <div class="main">
1942 <div class="main">
1939 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1943 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1940
1944
1941 <form class="search" action="/log">
1945 <form class="search" action="/log">
1942
1946
1943 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1947 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1944 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1948 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1945 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1949 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1946 </form>
1950 </form>
1947 <table class="bigtable">
1951 <table class="bigtable">
1948 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1952 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1949
1953
1950 <tr><td>
1954 <tr><td>
1951 <a href="/help/bundlespec">
1955 <a href="/help/bundlespec">
1952 bundlespec
1956 bundlespec
1953 </a>
1957 </a>
1954 </td><td>
1958 </td><td>
1955 Bundle File Formats
1959 Bundle File Formats
1956 </td></tr>
1960 </td></tr>
1957 <tr><td>
1961 <tr><td>
1958 <a href="/help/color">
1962 <a href="/help/color">
1959 color
1963 color
1960 </a>
1964 </a>
1961 </td><td>
1965 </td><td>
1962 Colorizing Outputs
1966 Colorizing Outputs
1963 </td></tr>
1967 </td></tr>
1964 <tr><td>
1968 <tr><td>
1965 <a href="/help/config">
1969 <a href="/help/config">
1966 config
1970 config
1967 </a>
1971 </a>
1968 </td><td>
1972 </td><td>
1969 Configuration Files
1973 Configuration Files
1970 </td></tr>
1974 </td></tr>
1971 <tr><td>
1975 <tr><td>
1972 <a href="/help/dates">
1976 <a href="/help/dates">
1973 dates
1977 dates
1974 </a>
1978 </a>
1975 </td><td>
1979 </td><td>
1976 Date Formats
1980 Date Formats
1977 </td></tr>
1981 </td></tr>
1978 <tr><td>
1982 <tr><td>
1979 <a href="/help/diffs">
1983 <a href="/help/diffs">
1980 diffs
1984 diffs
1981 </a>
1985 </a>
1982 </td><td>
1986 </td><td>
1983 Diff Formats
1987 Diff Formats
1984 </td></tr>
1988 </td></tr>
1985 <tr><td>
1989 <tr><td>
1986 <a href="/help/environment">
1990 <a href="/help/environment">
1987 environment
1991 environment
1988 </a>
1992 </a>
1989 </td><td>
1993 </td><td>
1990 Environment Variables
1994 Environment Variables
1991 </td></tr>
1995 </td></tr>
1992 <tr><td>
1996 <tr><td>
1993 <a href="/help/extensions">
1997 <a href="/help/extensions">
1994 extensions
1998 extensions
1995 </a>
1999 </a>
1996 </td><td>
2000 </td><td>
1997 Using Additional Features
2001 Using Additional Features
1998 </td></tr>
2002 </td></tr>
1999 <tr><td>
2003 <tr><td>
2000 <a href="/help/filesets">
2004 <a href="/help/filesets">
2001 filesets
2005 filesets
2002 </a>
2006 </a>
2003 </td><td>
2007 </td><td>
2004 Specifying File Sets
2008 Specifying File Sets
2005 </td></tr>
2009 </td></tr>
2006 <tr><td>
2010 <tr><td>
2007 <a href="/help/glossary">
2011 <a href="/help/glossary">
2008 glossary
2012 glossary
2009 </a>
2013 </a>
2010 </td><td>
2014 </td><td>
2011 Glossary
2015 Glossary
2012 </td></tr>
2016 </td></tr>
2013 <tr><td>
2017 <tr><td>
2014 <a href="/help/hgignore">
2018 <a href="/help/hgignore">
2015 hgignore
2019 hgignore
2016 </a>
2020 </a>
2017 </td><td>
2021 </td><td>
2018 Syntax for Mercurial Ignore Files
2022 Syntax for Mercurial Ignore Files
2019 </td></tr>
2023 </td></tr>
2020 <tr><td>
2024 <tr><td>
2021 <a href="/help/hgweb">
2025 <a href="/help/hgweb">
2022 hgweb
2026 hgweb
2023 </a>
2027 </a>
2024 </td><td>
2028 </td><td>
2025 Configuring hgweb
2029 Configuring hgweb
2026 </td></tr>
2030 </td></tr>
2027 <tr><td>
2031 <tr><td>
2028 <a href="/help/internals">
2032 <a href="/help/internals">
2029 internals
2033 internals
2030 </a>
2034 </a>
2031 </td><td>
2035 </td><td>
2032 Technical implementation topics
2036 Technical implementation topics
2033 </td></tr>
2037 </td></tr>
2034 <tr><td>
2038 <tr><td>
2035 <a href="/help/merge-tools">
2039 <a href="/help/merge-tools">
2036 merge-tools
2040 merge-tools
2037 </a>
2041 </a>
2038 </td><td>
2042 </td><td>
2039 Merge Tools
2043 Merge Tools
2040 </td></tr>
2044 </td></tr>
2041 <tr><td>
2045 <tr><td>
2042 <a href="/help/pager">
2046 <a href="/help/pager">
2043 pager
2047 pager
2044 </a>
2048 </a>
2045 </td><td>
2049 </td><td>
2046 Pager Support
2050 Pager Support
2047 </td></tr>
2051 </td></tr>
2048 <tr><td>
2052 <tr><td>
2049 <a href="/help/patterns">
2053 <a href="/help/patterns">
2050 patterns
2054 patterns
2051 </a>
2055 </a>
2052 </td><td>
2056 </td><td>
2053 File Name Patterns
2057 File Name Patterns
2054 </td></tr>
2058 </td></tr>
2055 <tr><td>
2059 <tr><td>
2056 <a href="/help/phases">
2060 <a href="/help/phases">
2057 phases
2061 phases
2058 </a>
2062 </a>
2059 </td><td>
2063 </td><td>
2060 Working with Phases
2064 Working with Phases
2061 </td></tr>
2065 </td></tr>
2062 <tr><td>
2066 <tr><td>
2063 <a href="/help/revisions">
2067 <a href="/help/revisions">
2064 revisions
2068 revisions
2065 </a>
2069 </a>
2066 </td><td>
2070 </td><td>
2067 Specifying Revisions
2071 Specifying Revisions
2068 </td></tr>
2072 </td></tr>
2069 <tr><td>
2073 <tr><td>
2070 <a href="/help/scripting">
2074 <a href="/help/scripting">
2071 scripting
2075 scripting
2072 </a>
2076 </a>
2073 </td><td>
2077 </td><td>
2074 Using Mercurial from scripts and automation
2078 Using Mercurial from scripts and automation
2075 </td></tr>
2079 </td></tr>
2076 <tr><td>
2080 <tr><td>
2077 <a href="/help/subrepos">
2081 <a href="/help/subrepos">
2078 subrepos
2082 subrepos
2079 </a>
2083 </a>
2080 </td><td>
2084 </td><td>
2081 Subrepositories
2085 Subrepositories
2082 </td></tr>
2086 </td></tr>
2083 <tr><td>
2087 <tr><td>
2084 <a href="/help/templating">
2088 <a href="/help/templating">
2085 templating
2089 templating
2086 </a>
2090 </a>
2087 </td><td>
2091 </td><td>
2088 Template Usage
2092 Template Usage
2089 </td></tr>
2093 </td></tr>
2090 <tr><td>
2094 <tr><td>
2091 <a href="/help/urls">
2095 <a href="/help/urls">
2092 urls
2096 urls
2093 </a>
2097 </a>
2094 </td><td>
2098 </td><td>
2095 URL Paths
2099 URL Paths
2096 </td></tr>
2100 </td></tr>
2097 <tr><td>
2101 <tr><td>
2098 <a href="/help/topic-containing-verbose">
2102 <a href="/help/topic-containing-verbose">
2099 topic-containing-verbose
2103 topic-containing-verbose
2100 </a>
2104 </a>
2101 </td><td>
2105 </td><td>
2102 This is the topic to test omit indicating.
2106 This is the topic to test omit indicating.
2103 </td></tr>
2107 </td></tr>
2104
2108
2105
2109
2106 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2110 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2107
2111
2108 <tr><td>
2112 <tr><td>
2109 <a href="/help/add">
2113 <a href="/help/add">
2110 add
2114 add
2111 </a>
2115 </a>
2112 </td><td>
2116 </td><td>
2113 add the specified files on the next commit
2117 add the specified files on the next commit
2114 </td></tr>
2118 </td></tr>
2115 <tr><td>
2119 <tr><td>
2116 <a href="/help/annotate">
2120 <a href="/help/annotate">
2117 annotate
2121 annotate
2118 </a>
2122 </a>
2119 </td><td>
2123 </td><td>
2120 show changeset information by line for each file
2124 show changeset information by line for each file
2121 </td></tr>
2125 </td></tr>
2122 <tr><td>
2126 <tr><td>
2123 <a href="/help/clone">
2127 <a href="/help/clone">
2124 clone
2128 clone
2125 </a>
2129 </a>
2126 </td><td>
2130 </td><td>
2127 make a copy of an existing repository
2131 make a copy of an existing repository
2128 </td></tr>
2132 </td></tr>
2129 <tr><td>
2133 <tr><td>
2130 <a href="/help/commit">
2134 <a href="/help/commit">
2131 commit
2135 commit
2132 </a>
2136 </a>
2133 </td><td>
2137 </td><td>
2134 commit the specified files or all outstanding changes
2138 commit the specified files or all outstanding changes
2135 </td></tr>
2139 </td></tr>
2136 <tr><td>
2140 <tr><td>
2137 <a href="/help/diff">
2141 <a href="/help/diff">
2138 diff
2142 diff
2139 </a>
2143 </a>
2140 </td><td>
2144 </td><td>
2141 diff repository (or selected files)
2145 diff repository (or selected files)
2142 </td></tr>
2146 </td></tr>
2143 <tr><td>
2147 <tr><td>
2144 <a href="/help/export">
2148 <a href="/help/export">
2145 export
2149 export
2146 </a>
2150 </a>
2147 </td><td>
2151 </td><td>
2148 dump the header and diffs for one or more changesets
2152 dump the header and diffs for one or more changesets
2149 </td></tr>
2153 </td></tr>
2150 <tr><td>
2154 <tr><td>
2151 <a href="/help/forget">
2155 <a href="/help/forget">
2152 forget
2156 forget
2153 </a>
2157 </a>
2154 </td><td>
2158 </td><td>
2155 forget the specified files on the next commit
2159 forget the specified files on the next commit
2156 </td></tr>
2160 </td></tr>
2157 <tr><td>
2161 <tr><td>
2158 <a href="/help/init">
2162 <a href="/help/init">
2159 init
2163 init
2160 </a>
2164 </a>
2161 </td><td>
2165 </td><td>
2162 create a new repository in the given directory
2166 create a new repository in the given directory
2163 </td></tr>
2167 </td></tr>
2164 <tr><td>
2168 <tr><td>
2165 <a href="/help/log">
2169 <a href="/help/log">
2166 log
2170 log
2167 </a>
2171 </a>
2168 </td><td>
2172 </td><td>
2169 show revision history of entire repository or files
2173 show revision history of entire repository or files
2170 </td></tr>
2174 </td></tr>
2171 <tr><td>
2175 <tr><td>
2172 <a href="/help/merge">
2176 <a href="/help/merge">
2173 merge
2177 merge
2174 </a>
2178 </a>
2175 </td><td>
2179 </td><td>
2176 merge another revision into working directory
2180 merge another revision into working directory
2177 </td></tr>
2181 </td></tr>
2178 <tr><td>
2182 <tr><td>
2179 <a href="/help/pull">
2183 <a href="/help/pull">
2180 pull
2184 pull
2181 </a>
2185 </a>
2182 </td><td>
2186 </td><td>
2183 pull changes from the specified source
2187 pull changes from the specified source
2184 </td></tr>
2188 </td></tr>
2185 <tr><td>
2189 <tr><td>
2186 <a href="/help/push">
2190 <a href="/help/push">
2187 push
2191 push
2188 </a>
2192 </a>
2189 </td><td>
2193 </td><td>
2190 push changes to the specified destination
2194 push changes to the specified destination
2191 </td></tr>
2195 </td></tr>
2192 <tr><td>
2196 <tr><td>
2193 <a href="/help/remove">
2197 <a href="/help/remove">
2194 remove
2198 remove
2195 </a>
2199 </a>
2196 </td><td>
2200 </td><td>
2197 remove the specified files on the next commit
2201 remove the specified files on the next commit
2198 </td></tr>
2202 </td></tr>
2199 <tr><td>
2203 <tr><td>
2200 <a href="/help/serve">
2204 <a href="/help/serve">
2201 serve
2205 serve
2202 </a>
2206 </a>
2203 </td><td>
2207 </td><td>
2204 start stand-alone webserver
2208 start stand-alone webserver
2205 </td></tr>
2209 </td></tr>
2206 <tr><td>
2210 <tr><td>
2207 <a href="/help/status">
2211 <a href="/help/status">
2208 status
2212 status
2209 </a>
2213 </a>
2210 </td><td>
2214 </td><td>
2211 show changed files in the working directory
2215 show changed files in the working directory
2212 </td></tr>
2216 </td></tr>
2213 <tr><td>
2217 <tr><td>
2214 <a href="/help/summary">
2218 <a href="/help/summary">
2215 summary
2219 summary
2216 </a>
2220 </a>
2217 </td><td>
2221 </td><td>
2218 summarize working directory state
2222 summarize working directory state
2219 </td></tr>
2223 </td></tr>
2220 <tr><td>
2224 <tr><td>
2221 <a href="/help/update">
2225 <a href="/help/update">
2222 update
2226 update
2223 </a>
2227 </a>
2224 </td><td>
2228 </td><td>
2225 update working directory (or switch revisions)
2229 update working directory (or switch revisions)
2226 </td></tr>
2230 </td></tr>
2227
2231
2228
2232
2229
2233
2230 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2234 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2231
2235
2232 <tr><td>
2236 <tr><td>
2233 <a href="/help/addremove">
2237 <a href="/help/addremove">
2234 addremove
2238 addremove
2235 </a>
2239 </a>
2236 </td><td>
2240 </td><td>
2237 add all new files, delete all missing files
2241 add all new files, delete all missing files
2238 </td></tr>
2242 </td></tr>
2239 <tr><td>
2243 <tr><td>
2240 <a href="/help/archive">
2244 <a href="/help/archive">
2241 archive
2245 archive
2242 </a>
2246 </a>
2243 </td><td>
2247 </td><td>
2244 create an unversioned archive of a repository revision
2248 create an unversioned archive of a repository revision
2245 </td></tr>
2249 </td></tr>
2246 <tr><td>
2250 <tr><td>
2247 <a href="/help/backout">
2251 <a href="/help/backout">
2248 backout
2252 backout
2249 </a>
2253 </a>
2250 </td><td>
2254 </td><td>
2251 reverse effect of earlier changeset
2255 reverse effect of earlier changeset
2252 </td></tr>
2256 </td></tr>
2253 <tr><td>
2257 <tr><td>
2254 <a href="/help/bisect">
2258 <a href="/help/bisect">
2255 bisect
2259 bisect
2256 </a>
2260 </a>
2257 </td><td>
2261 </td><td>
2258 subdivision search of changesets
2262 subdivision search of changesets
2259 </td></tr>
2263 </td></tr>
2260 <tr><td>
2264 <tr><td>
2261 <a href="/help/bookmarks">
2265 <a href="/help/bookmarks">
2262 bookmarks
2266 bookmarks
2263 </a>
2267 </a>
2264 </td><td>
2268 </td><td>
2265 create a new bookmark or list existing bookmarks
2269 create a new bookmark or list existing bookmarks
2266 </td></tr>
2270 </td></tr>
2267 <tr><td>
2271 <tr><td>
2268 <a href="/help/branch">
2272 <a href="/help/branch">
2269 branch
2273 branch
2270 </a>
2274 </a>
2271 </td><td>
2275 </td><td>
2272 set or show the current branch name
2276 set or show the current branch name
2273 </td></tr>
2277 </td></tr>
2274 <tr><td>
2278 <tr><td>
2275 <a href="/help/branches">
2279 <a href="/help/branches">
2276 branches
2280 branches
2277 </a>
2281 </a>
2278 </td><td>
2282 </td><td>
2279 list repository named branches
2283 list repository named branches
2280 </td></tr>
2284 </td></tr>
2281 <tr><td>
2285 <tr><td>
2282 <a href="/help/bundle">
2286 <a href="/help/bundle">
2283 bundle
2287 bundle
2284 </a>
2288 </a>
2285 </td><td>
2289 </td><td>
2286 create a bundle file
2290 create a bundle file
2287 </td></tr>
2291 </td></tr>
2288 <tr><td>
2292 <tr><td>
2289 <a href="/help/cat">
2293 <a href="/help/cat">
2290 cat
2294 cat
2291 </a>
2295 </a>
2292 </td><td>
2296 </td><td>
2293 output the current or given revision of files
2297 output the current or given revision of files
2294 </td></tr>
2298 </td></tr>
2295 <tr><td>
2299 <tr><td>
2296 <a href="/help/config">
2300 <a href="/help/config">
2297 config
2301 config
2298 </a>
2302 </a>
2299 </td><td>
2303 </td><td>
2300 show combined config settings from all hgrc files
2304 show combined config settings from all hgrc files
2301 </td></tr>
2305 </td></tr>
2302 <tr><td>
2306 <tr><td>
2303 <a href="/help/copy">
2307 <a href="/help/copy">
2304 copy
2308 copy
2305 </a>
2309 </a>
2306 </td><td>
2310 </td><td>
2307 mark files as copied for the next commit
2311 mark files as copied for the next commit
2308 </td></tr>
2312 </td></tr>
2309 <tr><td>
2313 <tr><td>
2310 <a href="/help/files">
2314 <a href="/help/files">
2311 files
2315 files
2312 </a>
2316 </a>
2313 </td><td>
2317 </td><td>
2314 list tracked files
2318 list tracked files
2315 </td></tr>
2319 </td></tr>
2316 <tr><td>
2320 <tr><td>
2317 <a href="/help/graft">
2321 <a href="/help/graft">
2318 graft
2322 graft
2319 </a>
2323 </a>
2320 </td><td>
2324 </td><td>
2321 copy changes from other branches onto the current branch
2325 copy changes from other branches onto the current branch
2322 </td></tr>
2326 </td></tr>
2323 <tr><td>
2327 <tr><td>
2324 <a href="/help/grep">
2328 <a href="/help/grep">
2325 grep
2329 grep
2326 </a>
2330 </a>
2327 </td><td>
2331 </td><td>
2328 search revision history for a pattern in specified files
2332 search revision history for a pattern in specified files
2329 </td></tr>
2333 </td></tr>
2330 <tr><td>
2334 <tr><td>
2331 <a href="/help/heads">
2335 <a href="/help/heads">
2332 heads
2336 heads
2333 </a>
2337 </a>
2334 </td><td>
2338 </td><td>
2335 show branch heads
2339 show branch heads
2336 </td></tr>
2340 </td></tr>
2337 <tr><td>
2341 <tr><td>
2338 <a href="/help/help">
2342 <a href="/help/help">
2339 help
2343 help
2340 </a>
2344 </a>
2341 </td><td>
2345 </td><td>
2342 show help for a given topic or a help overview
2346 show help for a given topic or a help overview
2343 </td></tr>
2347 </td></tr>
2344 <tr><td>
2348 <tr><td>
2345 <a href="/help/hgalias">
2349 <a href="/help/hgalias">
2346 hgalias
2350 hgalias
2347 </a>
2351 </a>
2348 </td><td>
2352 </td><td>
2349 summarize working directory state
2353 summarize working directory state
2350 </td></tr>
2354 </td></tr>
2351 <tr><td>
2355 <tr><td>
2352 <a href="/help/identify">
2356 <a href="/help/identify">
2353 identify
2357 identify
2354 </a>
2358 </a>
2355 </td><td>
2359 </td><td>
2356 identify the working directory or specified revision
2360 identify the working directory or specified revision
2357 </td></tr>
2361 </td></tr>
2358 <tr><td>
2362 <tr><td>
2359 <a href="/help/import">
2363 <a href="/help/import">
2360 import
2364 import
2361 </a>
2365 </a>
2362 </td><td>
2366 </td><td>
2363 import an ordered set of patches
2367 import an ordered set of patches
2364 </td></tr>
2368 </td></tr>
2365 <tr><td>
2369 <tr><td>
2366 <a href="/help/incoming">
2370 <a href="/help/incoming">
2367 incoming
2371 incoming
2368 </a>
2372 </a>
2369 </td><td>
2373 </td><td>
2370 show new changesets found in source
2374 show new changesets found in source
2371 </td></tr>
2375 </td></tr>
2372 <tr><td>
2376 <tr><td>
2373 <a href="/help/manifest">
2377 <a href="/help/manifest">
2374 manifest
2378 manifest
2375 </a>
2379 </a>
2376 </td><td>
2380 </td><td>
2377 output the current or given revision of the project manifest
2381 output the current or given revision of the project manifest
2378 </td></tr>
2382 </td></tr>
2379 <tr><td>
2383 <tr><td>
2380 <a href="/help/nohelp">
2384 <a href="/help/nohelp">
2381 nohelp
2385 nohelp
2382 </a>
2386 </a>
2383 </td><td>
2387 </td><td>
2384 (no help text available)
2388 (no help text available)
2385 </td></tr>
2389 </td></tr>
2386 <tr><td>
2390 <tr><td>
2387 <a href="/help/outgoing">
2391 <a href="/help/outgoing">
2388 outgoing
2392 outgoing
2389 </a>
2393 </a>
2390 </td><td>
2394 </td><td>
2391 show changesets not found in the destination
2395 show changesets not found in the destination
2392 </td></tr>
2396 </td></tr>
2393 <tr><td>
2397 <tr><td>
2394 <a href="/help/paths">
2398 <a href="/help/paths">
2395 paths
2399 paths
2396 </a>
2400 </a>
2397 </td><td>
2401 </td><td>
2398 show aliases for remote repositories
2402 show aliases for remote repositories
2399 </td></tr>
2403 </td></tr>
2400 <tr><td>
2404 <tr><td>
2401 <a href="/help/phase">
2405 <a href="/help/phase">
2402 phase
2406 phase
2403 </a>
2407 </a>
2404 </td><td>
2408 </td><td>
2405 set or show the current phase name
2409 set or show the current phase name
2406 </td></tr>
2410 </td></tr>
2407 <tr><td>
2411 <tr><td>
2408 <a href="/help/recover">
2412 <a href="/help/recover">
2409 recover
2413 recover
2410 </a>
2414 </a>
2411 </td><td>
2415 </td><td>
2412 roll back an interrupted transaction
2416 roll back an interrupted transaction
2413 </td></tr>
2417 </td></tr>
2414 <tr><td>
2418 <tr><td>
2415 <a href="/help/rename">
2419 <a href="/help/rename">
2416 rename
2420 rename
2417 </a>
2421 </a>
2418 </td><td>
2422 </td><td>
2419 rename files; equivalent of copy + remove
2423 rename files; equivalent of copy + remove
2420 </td></tr>
2424 </td></tr>
2421 <tr><td>
2425 <tr><td>
2422 <a href="/help/resolve">
2426 <a href="/help/resolve">
2423 resolve
2427 resolve
2424 </a>
2428 </a>
2425 </td><td>
2429 </td><td>
2426 redo merges or set/view the merge status of files
2430 redo merges or set/view the merge status of files
2427 </td></tr>
2431 </td></tr>
2428 <tr><td>
2432 <tr><td>
2429 <a href="/help/revert">
2433 <a href="/help/revert">
2430 revert
2434 revert
2431 </a>
2435 </a>
2432 </td><td>
2436 </td><td>
2433 restore files to their checkout state
2437 restore files to their checkout state
2434 </td></tr>
2438 </td></tr>
2435 <tr><td>
2439 <tr><td>
2436 <a href="/help/root">
2440 <a href="/help/root">
2437 root
2441 root
2438 </a>
2442 </a>
2439 </td><td>
2443 </td><td>
2440 print the root (top) of the current working directory
2444 print the root (top) of the current working directory
2441 </td></tr>
2445 </td></tr>
2442 <tr><td>
2446 <tr><td>
2443 <a href="/help/shellalias">
2447 <a href="/help/shellalias">
2444 shellalias
2448 shellalias
2445 </a>
2449 </a>
2446 </td><td>
2450 </td><td>
2447 (no help text available)
2451 (no help text available)
2448 </td></tr>
2452 </td></tr>
2449 <tr><td>
2453 <tr><td>
2450 <a href="/help/tag">
2454 <a href="/help/tag">
2451 tag
2455 tag
2452 </a>
2456 </a>
2453 </td><td>
2457 </td><td>
2454 add one or more tags for the current or given revision
2458 add one or more tags for the current or given revision
2455 </td></tr>
2459 </td></tr>
2456 <tr><td>
2460 <tr><td>
2457 <a href="/help/tags">
2461 <a href="/help/tags">
2458 tags
2462 tags
2459 </a>
2463 </a>
2460 </td><td>
2464 </td><td>
2461 list repository tags
2465 list repository tags
2462 </td></tr>
2466 </td></tr>
2463 <tr><td>
2467 <tr><td>
2464 <a href="/help/unbundle">
2468 <a href="/help/unbundle">
2465 unbundle
2469 unbundle
2466 </a>
2470 </a>
2467 </td><td>
2471 </td><td>
2468 apply one or more bundle files
2472 apply one or more bundle files
2469 </td></tr>
2473 </td></tr>
2470 <tr><td>
2474 <tr><td>
2471 <a href="/help/verify">
2475 <a href="/help/verify">
2472 verify
2476 verify
2473 </a>
2477 </a>
2474 </td><td>
2478 </td><td>
2475 verify the integrity of the repository
2479 verify the integrity of the repository
2476 </td></tr>
2480 </td></tr>
2477 <tr><td>
2481 <tr><td>
2478 <a href="/help/version">
2482 <a href="/help/version">
2479 version
2483 version
2480 </a>
2484 </a>
2481 </td><td>
2485 </td><td>
2482 output version and copyright information
2486 output version and copyright information
2483 </td></tr>
2487 </td></tr>
2484
2488
2485
2489
2486 </table>
2490 </table>
2487 </div>
2491 </div>
2488 </div>
2492 </div>
2489
2493
2490
2494
2491
2495
2492 </body>
2496 </body>
2493 </html>
2497 </html>
2494
2498
2495
2499
2496 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2500 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2497 200 Script output follows
2501 200 Script output follows
2498
2502
2499 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2503 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2500 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2504 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2501 <head>
2505 <head>
2502 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2506 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2503 <meta name="robots" content="index, nofollow" />
2507 <meta name="robots" content="index, nofollow" />
2504 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2508 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2505 <script type="text/javascript" src="/static/mercurial.js"></script>
2509 <script type="text/javascript" src="/static/mercurial.js"></script>
2506
2510
2507 <title>Help: add</title>
2511 <title>Help: add</title>
2508 </head>
2512 </head>
2509 <body>
2513 <body>
2510
2514
2511 <div class="container">
2515 <div class="container">
2512 <div class="menu">
2516 <div class="menu">
2513 <div class="logo">
2517 <div class="logo">
2514 <a href="https://mercurial-scm.org/">
2518 <a href="https://mercurial-scm.org/">
2515 <img src="/static/hglogo.png" alt="mercurial" /></a>
2519 <img src="/static/hglogo.png" alt="mercurial" /></a>
2516 </div>
2520 </div>
2517 <ul>
2521 <ul>
2518 <li><a href="/shortlog">log</a></li>
2522 <li><a href="/shortlog">log</a></li>
2519 <li><a href="/graph">graph</a></li>
2523 <li><a href="/graph">graph</a></li>
2520 <li><a href="/tags">tags</a></li>
2524 <li><a href="/tags">tags</a></li>
2521 <li><a href="/bookmarks">bookmarks</a></li>
2525 <li><a href="/bookmarks">bookmarks</a></li>
2522 <li><a href="/branches">branches</a></li>
2526 <li><a href="/branches">branches</a></li>
2523 </ul>
2527 </ul>
2524 <ul>
2528 <ul>
2525 <li class="active"><a href="/help">help</a></li>
2529 <li class="active"><a href="/help">help</a></li>
2526 </ul>
2530 </ul>
2527 </div>
2531 </div>
2528
2532
2529 <div class="main">
2533 <div class="main">
2530 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2534 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2531 <h3>Help: add</h3>
2535 <h3>Help: add</h3>
2532
2536
2533 <form class="search" action="/log">
2537 <form class="search" action="/log">
2534
2538
2535 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2539 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2536 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2540 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2537 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2541 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2538 </form>
2542 </form>
2539 <div id="doc">
2543 <div id="doc">
2540 <p>
2544 <p>
2541 hg add [OPTION]... [FILE]...
2545 hg add [OPTION]... [FILE]...
2542 </p>
2546 </p>
2543 <p>
2547 <p>
2544 add the specified files on the next commit
2548 add the specified files on the next commit
2545 </p>
2549 </p>
2546 <p>
2550 <p>
2547 Schedule files to be version controlled and added to the
2551 Schedule files to be version controlled and added to the
2548 repository.
2552 repository.
2549 </p>
2553 </p>
2550 <p>
2554 <p>
2551 The files will be added to the repository at the next commit. To
2555 The files will be added to the repository at the next commit. To
2552 undo an add before that, see 'hg forget'.
2556 undo an add before that, see 'hg forget'.
2553 </p>
2557 </p>
2554 <p>
2558 <p>
2555 If no names are given, add all files to the repository (except
2559 If no names are given, add all files to the repository (except
2556 files matching &quot;.hgignore&quot;).
2560 files matching &quot;.hgignore&quot;).
2557 </p>
2561 </p>
2558 <p>
2562 <p>
2559 Examples:
2563 Examples:
2560 </p>
2564 </p>
2561 <ul>
2565 <ul>
2562 <li> New (unknown) files are added automatically by 'hg add':
2566 <li> New (unknown) files are added automatically by 'hg add':
2563 <pre>
2567 <pre>
2564 \$ ls (re)
2568 \$ ls (re)
2565 foo.c
2569 foo.c
2566 \$ hg status (re)
2570 \$ hg status (re)
2567 ? foo.c
2571 ? foo.c
2568 \$ hg add (re)
2572 \$ hg add (re)
2569 adding foo.c
2573 adding foo.c
2570 \$ hg status (re)
2574 \$ hg status (re)
2571 A foo.c
2575 A foo.c
2572 </pre>
2576 </pre>
2573 <li> Specific files to be added can be specified:
2577 <li> Specific files to be added can be specified:
2574 <pre>
2578 <pre>
2575 \$ ls (re)
2579 \$ ls (re)
2576 bar.c foo.c
2580 bar.c foo.c
2577 \$ hg status (re)
2581 \$ hg status (re)
2578 ? bar.c
2582 ? bar.c
2579 ? foo.c
2583 ? foo.c
2580 \$ hg add bar.c (re)
2584 \$ hg add bar.c (re)
2581 \$ hg status (re)
2585 \$ hg status (re)
2582 A bar.c
2586 A bar.c
2583 ? foo.c
2587 ? foo.c
2584 </pre>
2588 </pre>
2585 </ul>
2589 </ul>
2586 <p>
2590 <p>
2587 Returns 0 if all files are successfully added.
2591 Returns 0 if all files are successfully added.
2588 </p>
2592 </p>
2589 <p>
2593 <p>
2590 options ([+] can be repeated):
2594 options ([+] can be repeated):
2591 </p>
2595 </p>
2592 <table>
2596 <table>
2593 <tr><td>-I</td>
2597 <tr><td>-I</td>
2594 <td>--include PATTERN [+]</td>
2598 <td>--include PATTERN [+]</td>
2595 <td>include names matching the given patterns</td></tr>
2599 <td>include names matching the given patterns</td></tr>
2596 <tr><td>-X</td>
2600 <tr><td>-X</td>
2597 <td>--exclude PATTERN [+]</td>
2601 <td>--exclude PATTERN [+]</td>
2598 <td>exclude names matching the given patterns</td></tr>
2602 <td>exclude names matching the given patterns</td></tr>
2599 <tr><td>-S</td>
2603 <tr><td>-S</td>
2600 <td>--subrepos</td>
2604 <td>--subrepos</td>
2601 <td>recurse into subrepositories</td></tr>
2605 <td>recurse into subrepositories</td></tr>
2602 <tr><td>-n</td>
2606 <tr><td>-n</td>
2603 <td>--dry-run</td>
2607 <td>--dry-run</td>
2604 <td>do not perform actions, just print output</td></tr>
2608 <td>do not perform actions, just print output</td></tr>
2605 </table>
2609 </table>
2606 <p>
2610 <p>
2607 global options ([+] can be repeated):
2611 global options ([+] can be repeated):
2608 </p>
2612 </p>
2609 <table>
2613 <table>
2610 <tr><td>-R</td>
2614 <tr><td>-R</td>
2611 <td>--repository REPO</td>
2615 <td>--repository REPO</td>
2612 <td>repository root directory or name of overlay bundle file</td></tr>
2616 <td>repository root directory or name of overlay bundle file</td></tr>
2613 <tr><td></td>
2617 <tr><td></td>
2614 <td>--cwd DIR</td>
2618 <td>--cwd DIR</td>
2615 <td>change working directory</td></tr>
2619 <td>change working directory</td></tr>
2616 <tr><td>-y</td>
2620 <tr><td>-y</td>
2617 <td>--noninteractive</td>
2621 <td>--noninteractive</td>
2618 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2622 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2619 <tr><td>-q</td>
2623 <tr><td>-q</td>
2620 <td>--quiet</td>
2624 <td>--quiet</td>
2621 <td>suppress output</td></tr>
2625 <td>suppress output</td></tr>
2622 <tr><td>-v</td>
2626 <tr><td>-v</td>
2623 <td>--verbose</td>
2627 <td>--verbose</td>
2624 <td>enable additional output</td></tr>
2628 <td>enable additional output</td></tr>
2625 <tr><td></td>
2629 <tr><td></td>
2626 <td>--color TYPE</td>
2630 <td>--color TYPE</td>
2627 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2631 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2628 <tr><td></td>
2632 <tr><td></td>
2629 <td>--config CONFIG [+]</td>
2633 <td>--config CONFIG [+]</td>
2630 <td>set/override config option (use 'section.name=value')</td></tr>
2634 <td>set/override config option (use 'section.name=value')</td></tr>
2631 <tr><td></td>
2635 <tr><td></td>
2632 <td>--debug</td>
2636 <td>--debug</td>
2633 <td>enable debugging output</td></tr>
2637 <td>enable debugging output</td></tr>
2634 <tr><td></td>
2638 <tr><td></td>
2635 <td>--debugger</td>
2639 <td>--debugger</td>
2636 <td>start debugger</td></tr>
2640 <td>start debugger</td></tr>
2637 <tr><td></td>
2641 <tr><td></td>
2638 <td>--encoding ENCODE</td>
2642 <td>--encoding ENCODE</td>
2639 <td>set the charset encoding (default: ascii)</td></tr>
2643 <td>set the charset encoding (default: ascii)</td></tr>
2640 <tr><td></td>
2644 <tr><td></td>
2641 <td>--encodingmode MODE</td>
2645 <td>--encodingmode MODE</td>
2642 <td>set the charset encoding mode (default: strict)</td></tr>
2646 <td>set the charset encoding mode (default: strict)</td></tr>
2643 <tr><td></td>
2647 <tr><td></td>
2644 <td>--traceback</td>
2648 <td>--traceback</td>
2645 <td>always print a traceback on exception</td></tr>
2649 <td>always print a traceback on exception</td></tr>
2646 <tr><td></td>
2650 <tr><td></td>
2647 <td>--time</td>
2651 <td>--time</td>
2648 <td>time how long the command takes</td></tr>
2652 <td>time how long the command takes</td></tr>
2649 <tr><td></td>
2653 <tr><td></td>
2650 <td>--profile</td>
2654 <td>--profile</td>
2651 <td>print command execution profile</td></tr>
2655 <td>print command execution profile</td></tr>
2652 <tr><td></td>
2656 <tr><td></td>
2653 <td>--version</td>
2657 <td>--version</td>
2654 <td>output version information and exit</td></tr>
2658 <td>output version information and exit</td></tr>
2655 <tr><td>-h</td>
2659 <tr><td>-h</td>
2656 <td>--help</td>
2660 <td>--help</td>
2657 <td>display help and exit</td></tr>
2661 <td>display help and exit</td></tr>
2658 <tr><td></td>
2662 <tr><td></td>
2659 <td>--hidden</td>
2663 <td>--hidden</td>
2660 <td>consider hidden changesets</td></tr>
2664 <td>consider hidden changesets</td></tr>
2661 <tr><td></td>
2665 <tr><td></td>
2662 <td>--pager TYPE</td>
2666 <td>--pager TYPE</td>
2663 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2667 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2664 </table>
2668 </table>
2665
2669
2666 </div>
2670 </div>
2667 </div>
2671 </div>
2668 </div>
2672 </div>
2669
2673
2670
2674
2671
2675
2672 </body>
2676 </body>
2673 </html>
2677 </html>
2674
2678
2675
2679
2676 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2680 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2677 200 Script output follows
2681 200 Script output follows
2678
2682
2679 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2683 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2680 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2684 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2681 <head>
2685 <head>
2682 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2686 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2683 <meta name="robots" content="index, nofollow" />
2687 <meta name="robots" content="index, nofollow" />
2684 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2688 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2685 <script type="text/javascript" src="/static/mercurial.js"></script>
2689 <script type="text/javascript" src="/static/mercurial.js"></script>
2686
2690
2687 <title>Help: remove</title>
2691 <title>Help: remove</title>
2688 </head>
2692 </head>
2689 <body>
2693 <body>
2690
2694
2691 <div class="container">
2695 <div class="container">
2692 <div class="menu">
2696 <div class="menu">
2693 <div class="logo">
2697 <div class="logo">
2694 <a href="https://mercurial-scm.org/">
2698 <a href="https://mercurial-scm.org/">
2695 <img src="/static/hglogo.png" alt="mercurial" /></a>
2699 <img src="/static/hglogo.png" alt="mercurial" /></a>
2696 </div>
2700 </div>
2697 <ul>
2701 <ul>
2698 <li><a href="/shortlog">log</a></li>
2702 <li><a href="/shortlog">log</a></li>
2699 <li><a href="/graph">graph</a></li>
2703 <li><a href="/graph">graph</a></li>
2700 <li><a href="/tags">tags</a></li>
2704 <li><a href="/tags">tags</a></li>
2701 <li><a href="/bookmarks">bookmarks</a></li>
2705 <li><a href="/bookmarks">bookmarks</a></li>
2702 <li><a href="/branches">branches</a></li>
2706 <li><a href="/branches">branches</a></li>
2703 </ul>
2707 </ul>
2704 <ul>
2708 <ul>
2705 <li class="active"><a href="/help">help</a></li>
2709 <li class="active"><a href="/help">help</a></li>
2706 </ul>
2710 </ul>
2707 </div>
2711 </div>
2708
2712
2709 <div class="main">
2713 <div class="main">
2710 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2714 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2711 <h3>Help: remove</h3>
2715 <h3>Help: remove</h3>
2712
2716
2713 <form class="search" action="/log">
2717 <form class="search" action="/log">
2714
2718
2715 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2719 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2716 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2720 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2717 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2721 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2718 </form>
2722 </form>
2719 <div id="doc">
2723 <div id="doc">
2720 <p>
2724 <p>
2721 hg remove [OPTION]... FILE...
2725 hg remove [OPTION]... FILE...
2722 </p>
2726 </p>
2723 <p>
2727 <p>
2724 aliases: rm
2728 aliases: rm
2725 </p>
2729 </p>
2726 <p>
2730 <p>
2727 remove the specified files on the next commit
2731 remove the specified files on the next commit
2728 </p>
2732 </p>
2729 <p>
2733 <p>
2730 Schedule the indicated files for removal from the current branch.
2734 Schedule the indicated files for removal from the current branch.
2731 </p>
2735 </p>
2732 <p>
2736 <p>
2733 This command schedules the files to be removed at the next commit.
2737 This command schedules the files to be removed at the next commit.
2734 To undo a remove before that, see 'hg revert'. To undo added
2738 To undo a remove before that, see 'hg revert'. To undo added
2735 files, see 'hg forget'.
2739 files, see 'hg forget'.
2736 </p>
2740 </p>
2737 <p>
2741 <p>
2738 -A/--after can be used to remove only files that have already
2742 -A/--after can be used to remove only files that have already
2739 been deleted, -f/--force can be used to force deletion, and -Af
2743 been deleted, -f/--force can be used to force deletion, and -Af
2740 can be used to remove files from the next revision without
2744 can be used to remove files from the next revision without
2741 deleting them from the working directory.
2745 deleting them from the working directory.
2742 </p>
2746 </p>
2743 <p>
2747 <p>
2744 The following table details the behavior of remove for different
2748 The following table details the behavior of remove for different
2745 file states (columns) and option combinations (rows). The file
2749 file states (columns) and option combinations (rows). The file
2746 states are Added [A], Clean [C], Modified [M] and Missing [!]
2750 states are Added [A], Clean [C], Modified [M] and Missing [!]
2747 (as reported by 'hg status'). The actions are Warn, Remove
2751 (as reported by 'hg status'). The actions are Warn, Remove
2748 (from branch) and Delete (from disk):
2752 (from branch) and Delete (from disk):
2749 </p>
2753 </p>
2750 <table>
2754 <table>
2751 <tr><td>opt/state</td>
2755 <tr><td>opt/state</td>
2752 <td>A</td>
2756 <td>A</td>
2753 <td>C</td>
2757 <td>C</td>
2754 <td>M</td>
2758 <td>M</td>
2755 <td>!</td></tr>
2759 <td>!</td></tr>
2756 <tr><td>none</td>
2760 <tr><td>none</td>
2757 <td>W</td>
2761 <td>W</td>
2758 <td>RD</td>
2762 <td>RD</td>
2759 <td>W</td>
2763 <td>W</td>
2760 <td>R</td></tr>
2764 <td>R</td></tr>
2761 <tr><td>-f</td>
2765 <tr><td>-f</td>
2762 <td>R</td>
2766 <td>R</td>
2763 <td>RD</td>
2767 <td>RD</td>
2764 <td>RD</td>
2768 <td>RD</td>
2765 <td>R</td></tr>
2769 <td>R</td></tr>
2766 <tr><td>-A</td>
2770 <tr><td>-A</td>
2767 <td>W</td>
2771 <td>W</td>
2768 <td>W</td>
2772 <td>W</td>
2769 <td>W</td>
2773 <td>W</td>
2770 <td>R</td></tr>
2774 <td>R</td></tr>
2771 <tr><td>-Af</td>
2775 <tr><td>-Af</td>
2772 <td>R</td>
2776 <td>R</td>
2773 <td>R</td>
2777 <td>R</td>
2774 <td>R</td>
2778 <td>R</td>
2775 <td>R</td></tr>
2779 <td>R</td></tr>
2776 </table>
2780 </table>
2777 <p>
2781 <p>
2778 <b>Note:</b>
2782 <b>Note:</b>
2779 </p>
2783 </p>
2780 <p>
2784 <p>
2781 'hg remove' never deletes files in Added [A] state from the
2785 'hg remove' never deletes files in Added [A] state from the
2782 working directory, not even if &quot;--force&quot; is specified.
2786 working directory, not even if &quot;--force&quot; is specified.
2783 </p>
2787 </p>
2784 <p>
2788 <p>
2785 Returns 0 on success, 1 if any warnings encountered.
2789 Returns 0 on success, 1 if any warnings encountered.
2786 </p>
2790 </p>
2787 <p>
2791 <p>
2788 options ([+] can be repeated):
2792 options ([+] can be repeated):
2789 </p>
2793 </p>
2790 <table>
2794 <table>
2791 <tr><td>-A</td>
2795 <tr><td>-A</td>
2792 <td>--after</td>
2796 <td>--after</td>
2793 <td>record delete for missing files</td></tr>
2797 <td>record delete for missing files</td></tr>
2794 <tr><td>-f</td>
2798 <tr><td>-f</td>
2795 <td>--force</td>
2799 <td>--force</td>
2796 <td>forget added files, delete modified files</td></tr>
2800 <td>forget added files, delete modified files</td></tr>
2797 <tr><td>-S</td>
2801 <tr><td>-S</td>
2798 <td>--subrepos</td>
2802 <td>--subrepos</td>
2799 <td>recurse into subrepositories</td></tr>
2803 <td>recurse into subrepositories</td></tr>
2800 <tr><td>-I</td>
2804 <tr><td>-I</td>
2801 <td>--include PATTERN [+]</td>
2805 <td>--include PATTERN [+]</td>
2802 <td>include names matching the given patterns</td></tr>
2806 <td>include names matching the given patterns</td></tr>
2803 <tr><td>-X</td>
2807 <tr><td>-X</td>
2804 <td>--exclude PATTERN [+]</td>
2808 <td>--exclude PATTERN [+]</td>
2805 <td>exclude names matching the given patterns</td></tr>
2809 <td>exclude names matching the given patterns</td></tr>
2806 </table>
2810 </table>
2807 <p>
2811 <p>
2808 global options ([+] can be repeated):
2812 global options ([+] can be repeated):
2809 </p>
2813 </p>
2810 <table>
2814 <table>
2811 <tr><td>-R</td>
2815 <tr><td>-R</td>
2812 <td>--repository REPO</td>
2816 <td>--repository REPO</td>
2813 <td>repository root directory or name of overlay bundle file</td></tr>
2817 <td>repository root directory or name of overlay bundle file</td></tr>
2814 <tr><td></td>
2818 <tr><td></td>
2815 <td>--cwd DIR</td>
2819 <td>--cwd DIR</td>
2816 <td>change working directory</td></tr>
2820 <td>change working directory</td></tr>
2817 <tr><td>-y</td>
2821 <tr><td>-y</td>
2818 <td>--noninteractive</td>
2822 <td>--noninteractive</td>
2819 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2823 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2820 <tr><td>-q</td>
2824 <tr><td>-q</td>
2821 <td>--quiet</td>
2825 <td>--quiet</td>
2822 <td>suppress output</td></tr>
2826 <td>suppress output</td></tr>
2823 <tr><td>-v</td>
2827 <tr><td>-v</td>
2824 <td>--verbose</td>
2828 <td>--verbose</td>
2825 <td>enable additional output</td></tr>
2829 <td>enable additional output</td></tr>
2826 <tr><td></td>
2830 <tr><td></td>
2827 <td>--color TYPE</td>
2831 <td>--color TYPE</td>
2828 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2832 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2829 <tr><td></td>
2833 <tr><td></td>
2830 <td>--config CONFIG [+]</td>
2834 <td>--config CONFIG [+]</td>
2831 <td>set/override config option (use 'section.name=value')</td></tr>
2835 <td>set/override config option (use 'section.name=value')</td></tr>
2832 <tr><td></td>
2836 <tr><td></td>
2833 <td>--debug</td>
2837 <td>--debug</td>
2834 <td>enable debugging output</td></tr>
2838 <td>enable debugging output</td></tr>
2835 <tr><td></td>
2839 <tr><td></td>
2836 <td>--debugger</td>
2840 <td>--debugger</td>
2837 <td>start debugger</td></tr>
2841 <td>start debugger</td></tr>
2838 <tr><td></td>
2842 <tr><td></td>
2839 <td>--encoding ENCODE</td>
2843 <td>--encoding ENCODE</td>
2840 <td>set the charset encoding (default: ascii)</td></tr>
2844 <td>set the charset encoding (default: ascii)</td></tr>
2841 <tr><td></td>
2845 <tr><td></td>
2842 <td>--encodingmode MODE</td>
2846 <td>--encodingmode MODE</td>
2843 <td>set the charset encoding mode (default: strict)</td></tr>
2847 <td>set the charset encoding mode (default: strict)</td></tr>
2844 <tr><td></td>
2848 <tr><td></td>
2845 <td>--traceback</td>
2849 <td>--traceback</td>
2846 <td>always print a traceback on exception</td></tr>
2850 <td>always print a traceback on exception</td></tr>
2847 <tr><td></td>
2851 <tr><td></td>
2848 <td>--time</td>
2852 <td>--time</td>
2849 <td>time how long the command takes</td></tr>
2853 <td>time how long the command takes</td></tr>
2850 <tr><td></td>
2854 <tr><td></td>
2851 <td>--profile</td>
2855 <td>--profile</td>
2852 <td>print command execution profile</td></tr>
2856 <td>print command execution profile</td></tr>
2853 <tr><td></td>
2857 <tr><td></td>
2854 <td>--version</td>
2858 <td>--version</td>
2855 <td>output version information and exit</td></tr>
2859 <td>output version information and exit</td></tr>
2856 <tr><td>-h</td>
2860 <tr><td>-h</td>
2857 <td>--help</td>
2861 <td>--help</td>
2858 <td>display help and exit</td></tr>
2862 <td>display help and exit</td></tr>
2859 <tr><td></td>
2863 <tr><td></td>
2860 <td>--hidden</td>
2864 <td>--hidden</td>
2861 <td>consider hidden changesets</td></tr>
2865 <td>consider hidden changesets</td></tr>
2862 <tr><td></td>
2866 <tr><td></td>
2863 <td>--pager TYPE</td>
2867 <td>--pager TYPE</td>
2864 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2868 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2865 </table>
2869 </table>
2866
2870
2867 </div>
2871 </div>
2868 </div>
2872 </div>
2869 </div>
2873 </div>
2870
2874
2871
2875
2872
2876
2873 </body>
2877 </body>
2874 </html>
2878 </html>
2875
2879
2876
2880
2877 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2881 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2878 200 Script output follows
2882 200 Script output follows
2879
2883
2880 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2884 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2881 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2885 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2882 <head>
2886 <head>
2883 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2887 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2884 <meta name="robots" content="index, nofollow" />
2888 <meta name="robots" content="index, nofollow" />
2885 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2889 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2886 <script type="text/javascript" src="/static/mercurial.js"></script>
2890 <script type="text/javascript" src="/static/mercurial.js"></script>
2887
2891
2888 <title>Help: dates</title>
2892 <title>Help: dates</title>
2889 </head>
2893 </head>
2890 <body>
2894 <body>
2891
2895
2892 <div class="container">
2896 <div class="container">
2893 <div class="menu">
2897 <div class="menu">
2894 <div class="logo">
2898 <div class="logo">
2895 <a href="https://mercurial-scm.org/">
2899 <a href="https://mercurial-scm.org/">
2896 <img src="/static/hglogo.png" alt="mercurial" /></a>
2900 <img src="/static/hglogo.png" alt="mercurial" /></a>
2897 </div>
2901 </div>
2898 <ul>
2902 <ul>
2899 <li><a href="/shortlog">log</a></li>
2903 <li><a href="/shortlog">log</a></li>
2900 <li><a href="/graph">graph</a></li>
2904 <li><a href="/graph">graph</a></li>
2901 <li><a href="/tags">tags</a></li>
2905 <li><a href="/tags">tags</a></li>
2902 <li><a href="/bookmarks">bookmarks</a></li>
2906 <li><a href="/bookmarks">bookmarks</a></li>
2903 <li><a href="/branches">branches</a></li>
2907 <li><a href="/branches">branches</a></li>
2904 </ul>
2908 </ul>
2905 <ul>
2909 <ul>
2906 <li class="active"><a href="/help">help</a></li>
2910 <li class="active"><a href="/help">help</a></li>
2907 </ul>
2911 </ul>
2908 </div>
2912 </div>
2909
2913
2910 <div class="main">
2914 <div class="main">
2911 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2915 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2912 <h3>Help: dates</h3>
2916 <h3>Help: dates</h3>
2913
2917
2914 <form class="search" action="/log">
2918 <form class="search" action="/log">
2915
2919
2916 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2920 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2917 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2921 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2918 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2922 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2919 </form>
2923 </form>
2920 <div id="doc">
2924 <div id="doc">
2921 <h1>Date Formats</h1>
2925 <h1>Date Formats</h1>
2922 <p>
2926 <p>
2923 Some commands allow the user to specify a date, e.g.:
2927 Some commands allow the user to specify a date, e.g.:
2924 </p>
2928 </p>
2925 <ul>
2929 <ul>
2926 <li> backout, commit, import, tag: Specify the commit date.
2930 <li> backout, commit, import, tag: Specify the commit date.
2927 <li> log, revert, update: Select revision(s) by date.
2931 <li> log, revert, update: Select revision(s) by date.
2928 </ul>
2932 </ul>
2929 <p>
2933 <p>
2930 Many date formats are valid. Here are some examples:
2934 Many date formats are valid. Here are some examples:
2931 </p>
2935 </p>
2932 <ul>
2936 <ul>
2933 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2937 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2934 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2938 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2935 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2939 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2936 <li> &quot;Dec 6&quot; (midnight)
2940 <li> &quot;Dec 6&quot; (midnight)
2937 <li> &quot;13:18&quot; (today assumed)
2941 <li> &quot;13:18&quot; (today assumed)
2938 <li> &quot;3:39&quot; (3:39AM assumed)
2942 <li> &quot;3:39&quot; (3:39AM assumed)
2939 <li> &quot;3:39pm&quot; (15:39)
2943 <li> &quot;3:39pm&quot; (15:39)
2940 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2944 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2941 <li> &quot;2006-12-6 13:18&quot;
2945 <li> &quot;2006-12-6 13:18&quot;
2942 <li> &quot;2006-12-6&quot;
2946 <li> &quot;2006-12-6&quot;
2943 <li> &quot;12-6&quot;
2947 <li> &quot;12-6&quot;
2944 <li> &quot;12/6&quot;
2948 <li> &quot;12/6&quot;
2945 <li> &quot;12/6/6&quot; (Dec 6 2006)
2949 <li> &quot;12/6/6&quot; (Dec 6 2006)
2946 <li> &quot;today&quot; (midnight)
2950 <li> &quot;today&quot; (midnight)
2947 <li> &quot;yesterday&quot; (midnight)
2951 <li> &quot;yesterday&quot; (midnight)
2948 <li> &quot;now&quot; - right now
2952 <li> &quot;now&quot; - right now
2949 </ul>
2953 </ul>
2950 <p>
2954 <p>
2951 Lastly, there is Mercurial's internal format:
2955 Lastly, there is Mercurial's internal format:
2952 </p>
2956 </p>
2953 <ul>
2957 <ul>
2954 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
2958 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
2955 </ul>
2959 </ul>
2956 <p>
2960 <p>
2957 This is the internal representation format for dates. The first number
2961 This is the internal representation format for dates. The first number
2958 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2962 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
2959 second is the offset of the local timezone, in seconds west of UTC
2963 second is the offset of the local timezone, in seconds west of UTC
2960 (negative if the timezone is east of UTC).
2964 (negative if the timezone is east of UTC).
2961 </p>
2965 </p>
2962 <p>
2966 <p>
2963 The log command also accepts date ranges:
2967 The log command also accepts date ranges:
2964 </p>
2968 </p>
2965 <ul>
2969 <ul>
2966 <li> &quot;&lt;DATE&quot; - at or before a given date/time
2970 <li> &quot;&lt;DATE&quot; - at or before a given date/time
2967 <li> &quot;&gt;DATE&quot; - on or after a given date/time
2971 <li> &quot;&gt;DATE&quot; - on or after a given date/time
2968 <li> &quot;DATE to DATE&quot; - a date range, inclusive
2972 <li> &quot;DATE to DATE&quot; - a date range, inclusive
2969 <li> &quot;-DAYS&quot; - within a given number of days of today
2973 <li> &quot;-DAYS&quot; - within a given number of days of today
2970 </ul>
2974 </ul>
2971
2975
2972 </div>
2976 </div>
2973 </div>
2977 </div>
2974 </div>
2978 </div>
2975
2979
2976
2980
2977
2981
2978 </body>
2982 </body>
2979 </html>
2983 </html>
2980
2984
2981
2985
2982 Sub-topic indexes rendered properly
2986 Sub-topic indexes rendered properly
2983
2987
2984 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
2988 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
2985 200 Script output follows
2989 200 Script output follows
2986
2990
2987 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2991 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2988 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2992 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2989 <head>
2993 <head>
2990 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2994 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2991 <meta name="robots" content="index, nofollow" />
2995 <meta name="robots" content="index, nofollow" />
2992 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2996 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2993 <script type="text/javascript" src="/static/mercurial.js"></script>
2997 <script type="text/javascript" src="/static/mercurial.js"></script>
2994
2998
2995 <title>Help: internals</title>
2999 <title>Help: internals</title>
2996 </head>
3000 </head>
2997 <body>
3001 <body>
2998
3002
2999 <div class="container">
3003 <div class="container">
3000 <div class="menu">
3004 <div class="menu">
3001 <div class="logo">
3005 <div class="logo">
3002 <a href="https://mercurial-scm.org/">
3006 <a href="https://mercurial-scm.org/">
3003 <img src="/static/hglogo.png" alt="mercurial" /></a>
3007 <img src="/static/hglogo.png" alt="mercurial" /></a>
3004 </div>
3008 </div>
3005 <ul>
3009 <ul>
3006 <li><a href="/shortlog">log</a></li>
3010 <li><a href="/shortlog">log</a></li>
3007 <li><a href="/graph">graph</a></li>
3011 <li><a href="/graph">graph</a></li>
3008 <li><a href="/tags">tags</a></li>
3012 <li><a href="/tags">tags</a></li>
3009 <li><a href="/bookmarks">bookmarks</a></li>
3013 <li><a href="/bookmarks">bookmarks</a></li>
3010 <li><a href="/branches">branches</a></li>
3014 <li><a href="/branches">branches</a></li>
3011 </ul>
3015 </ul>
3012 <ul>
3016 <ul>
3013 <li><a href="/help">help</a></li>
3017 <li><a href="/help">help</a></li>
3014 </ul>
3018 </ul>
3015 </div>
3019 </div>
3016
3020
3017 <div class="main">
3021 <div class="main">
3018 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3022 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3019
3023
3020 <form class="search" action="/log">
3024 <form class="search" action="/log">
3021
3025
3022 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3026 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3023 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3027 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3024 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3028 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3025 </form>
3029 </form>
3026 <table class="bigtable">
3030 <table class="bigtable">
3027 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3031 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3028
3032
3029 <tr><td>
3033 <tr><td>
3030 <a href="/help/internals.bundles">
3034 <a href="/help/internals.bundles">
3031 bundles
3035 bundles
3032 </a>
3036 </a>
3033 </td><td>
3037 </td><td>
3034 Bundles
3038 Bundles
3035 </td></tr>
3039 </td></tr>
3036 <tr><td>
3040 <tr><td>
3037 <a href="/help/internals.censor">
3041 <a href="/help/internals.censor">
3038 censor
3042 censor
3039 </a>
3043 </a>
3040 </td><td>
3044 </td><td>
3041 Censor
3045 Censor
3042 </td></tr>
3046 </td></tr>
3043 <tr><td>
3047 <tr><td>
3044 <a href="/help/internals.changegroups">
3048 <a href="/help/internals.changegroups">
3045 changegroups
3049 changegroups
3046 </a>
3050 </a>
3047 </td><td>
3051 </td><td>
3048 Changegroups
3052 Changegroups
3049 </td></tr>
3053 </td></tr>
3050 <tr><td>
3054 <tr><td>
3051 <a href="/help/internals.requirements">
3055 <a href="/help/internals.requirements">
3052 requirements
3056 requirements
3053 </a>
3057 </a>
3054 </td><td>
3058 </td><td>
3055 Repository Requirements
3059 Repository Requirements
3056 </td></tr>
3060 </td></tr>
3057 <tr><td>
3061 <tr><td>
3058 <a href="/help/internals.revlogs">
3062 <a href="/help/internals.revlogs">
3059 revlogs
3063 revlogs
3060 </a>
3064 </a>
3061 </td><td>
3065 </td><td>
3062 Revision Logs
3066 Revision Logs
3063 </td></tr>
3067 </td></tr>
3064 <tr><td>
3068 <tr><td>
3065 <a href="/help/internals.wireprotocol">
3069 <a href="/help/internals.wireprotocol">
3066 wireprotocol
3070 wireprotocol
3067 </a>
3071 </a>
3068 </td><td>
3072 </td><td>
3069 Wire Protocol
3073 Wire Protocol
3070 </td></tr>
3074 </td></tr>
3071
3075
3072
3076
3073
3077
3074
3078
3075
3079
3076 </table>
3080 </table>
3077 </div>
3081 </div>
3078 </div>
3082 </div>
3079
3083
3080
3084
3081
3085
3082 </body>
3086 </body>
3083 </html>
3087 </html>
3084
3088
3085
3089
3086 Sub-topic topics rendered properly
3090 Sub-topic topics rendered properly
3087
3091
3088 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3092 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3089 200 Script output follows
3093 200 Script output follows
3090
3094
3091 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3095 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3092 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3096 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3093 <head>
3097 <head>
3094 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3098 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3095 <meta name="robots" content="index, nofollow" />
3099 <meta name="robots" content="index, nofollow" />
3096 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3100 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3097 <script type="text/javascript" src="/static/mercurial.js"></script>
3101 <script type="text/javascript" src="/static/mercurial.js"></script>
3098
3102
3099 <title>Help: internals.changegroups</title>
3103 <title>Help: internals.changegroups</title>
3100 </head>
3104 </head>
3101 <body>
3105 <body>
3102
3106
3103 <div class="container">
3107 <div class="container">
3104 <div class="menu">
3108 <div class="menu">
3105 <div class="logo">
3109 <div class="logo">
3106 <a href="https://mercurial-scm.org/">
3110 <a href="https://mercurial-scm.org/">
3107 <img src="/static/hglogo.png" alt="mercurial" /></a>
3111 <img src="/static/hglogo.png" alt="mercurial" /></a>
3108 </div>
3112 </div>
3109 <ul>
3113 <ul>
3110 <li><a href="/shortlog">log</a></li>
3114 <li><a href="/shortlog">log</a></li>
3111 <li><a href="/graph">graph</a></li>
3115 <li><a href="/graph">graph</a></li>
3112 <li><a href="/tags">tags</a></li>
3116 <li><a href="/tags">tags</a></li>
3113 <li><a href="/bookmarks">bookmarks</a></li>
3117 <li><a href="/bookmarks">bookmarks</a></li>
3114 <li><a href="/branches">branches</a></li>
3118 <li><a href="/branches">branches</a></li>
3115 </ul>
3119 </ul>
3116 <ul>
3120 <ul>
3117 <li class="active"><a href="/help">help</a></li>
3121 <li class="active"><a href="/help">help</a></li>
3118 </ul>
3122 </ul>
3119 </div>
3123 </div>
3120
3124
3121 <div class="main">
3125 <div class="main">
3122 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3126 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3123 <h3>Help: internals.changegroups</h3>
3127 <h3>Help: internals.changegroups</h3>
3124
3128
3125 <form class="search" action="/log">
3129 <form class="search" action="/log">
3126
3130
3127 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3131 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3128 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3132 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3129 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3133 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3130 </form>
3134 </form>
3131 <div id="doc">
3135 <div id="doc">
3132 <h1>Changegroups</h1>
3136 <h1>Changegroups</h1>
3133 <p>
3137 <p>
3134 Changegroups are representations of repository revlog data, specifically
3138 Changegroups are representations of repository revlog data, specifically
3135 the changelog data, root/flat manifest data, treemanifest data, and
3139 the changelog data, root/flat manifest data, treemanifest data, and
3136 filelogs.
3140 filelogs.
3137 </p>
3141 </p>
3138 <p>
3142 <p>
3139 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3143 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3140 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3144 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3141 only difference being an additional item in the *delta header*. Version
3145 only difference being an additional item in the *delta header*. Version
3142 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3146 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3143 exchanging treemanifests (enabled by setting an option on the
3147 exchanging treemanifests (enabled by setting an option on the
3144 &quot;changegroup&quot; part in the bundle2).
3148 &quot;changegroup&quot; part in the bundle2).
3145 </p>
3149 </p>
3146 <p>
3150 <p>
3147 Changegroups when not exchanging treemanifests consist of 3 logical
3151 Changegroups when not exchanging treemanifests consist of 3 logical
3148 segments:
3152 segments:
3149 </p>
3153 </p>
3150 <pre>
3154 <pre>
3151 +---------------------------------+
3155 +---------------------------------+
3152 | | | |
3156 | | | |
3153 | changeset | manifest | filelogs |
3157 | changeset | manifest | filelogs |
3154 | | | |
3158 | | | |
3155 | | | |
3159 | | | |
3156 +---------------------------------+
3160 +---------------------------------+
3157 </pre>
3161 </pre>
3158 <p>
3162 <p>
3159 When exchanging treemanifests, there are 4 logical segments:
3163 When exchanging treemanifests, there are 4 logical segments:
3160 </p>
3164 </p>
3161 <pre>
3165 <pre>
3162 +-------------------------------------------------+
3166 +-------------------------------------------------+
3163 | | | | |
3167 | | | | |
3164 | changeset | root | treemanifests | filelogs |
3168 | changeset | root | treemanifests | filelogs |
3165 | | manifest | | |
3169 | | manifest | | |
3166 | | | | |
3170 | | | | |
3167 +-------------------------------------------------+
3171 +-------------------------------------------------+
3168 </pre>
3172 </pre>
3169 <p>
3173 <p>
3170 The principle building block of each segment is a *chunk*. A *chunk*
3174 The principle building block of each segment is a *chunk*. A *chunk*
3171 is a framed piece of data:
3175 is a framed piece of data:
3172 </p>
3176 </p>
3173 <pre>
3177 <pre>
3174 +---------------------------------------+
3178 +---------------------------------------+
3175 | | |
3179 | | |
3176 | length | data |
3180 | length | data |
3177 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3181 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3178 | | |
3182 | | |
3179 +---------------------------------------+
3183 +---------------------------------------+
3180 </pre>
3184 </pre>
3181 <p>
3185 <p>
3182 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3186 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3183 integer indicating the length of the entire chunk (including the length field
3187 integer indicating the length of the entire chunk (including the length field
3184 itself).
3188 itself).
3185 </p>
3189 </p>
3186 <p>
3190 <p>
3187 There is a special case chunk that has a value of 0 for the length
3191 There is a special case chunk that has a value of 0 for the length
3188 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3192 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3189 </p>
3193 </p>
3190 <h2>Delta Groups</h2>
3194 <h2>Delta Groups</h2>
3191 <p>
3195 <p>
3192 A *delta group* expresses the content of a revlog as a series of deltas,
3196 A *delta group* expresses the content of a revlog as a series of deltas,
3193 or patches against previous revisions.
3197 or patches against previous revisions.
3194 </p>
3198 </p>
3195 <p>
3199 <p>
3196 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3200 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3197 to signal the end of the delta group:
3201 to signal the end of the delta group:
3198 </p>
3202 </p>
3199 <pre>
3203 <pre>
3200 +------------------------------------------------------------------------+
3204 +------------------------------------------------------------------------+
3201 | | | | | |
3205 | | | | | |
3202 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3206 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3203 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3207 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3204 | | | | | |
3208 | | | | | |
3205 +------------------------------------------------------------------------+
3209 +------------------------------------------------------------------------+
3206 </pre>
3210 </pre>
3207 <p>
3211 <p>
3208 Each *chunk*'s data consists of the following:
3212 Each *chunk*'s data consists of the following:
3209 </p>
3213 </p>
3210 <pre>
3214 <pre>
3211 +---------------------------------------+
3215 +---------------------------------------+
3212 | | |
3216 | | |
3213 | delta header | delta data |
3217 | delta header | delta data |
3214 | (various by version) | (various) |
3218 | (various by version) | (various) |
3215 | | |
3219 | | |
3216 +---------------------------------------+
3220 +---------------------------------------+
3217 </pre>
3221 </pre>
3218 <p>
3222 <p>
3219 The *delta data* is a series of *delta*s that describe a diff from an existing
3223 The *delta data* is a series of *delta*s that describe a diff from an existing
3220 entry (either that the recipient already has, or previously specified in the
3224 entry (either that the recipient already has, or previously specified in the
3221 bundle/changegroup).
3225 bundle/changegroup).
3222 </p>
3226 </p>
3223 <p>
3227 <p>
3224 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3228 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3225 &quot;3&quot; of the changegroup format.
3229 &quot;3&quot; of the changegroup format.
3226 </p>
3230 </p>
3227 <p>
3231 <p>
3228 Version 1 (headerlen=80):
3232 Version 1 (headerlen=80):
3229 </p>
3233 </p>
3230 <pre>
3234 <pre>
3231 +------------------------------------------------------+
3235 +------------------------------------------------------+
3232 | | | | |
3236 | | | | |
3233 | node | p1 node | p2 node | link node |
3237 | node | p1 node | p2 node | link node |
3234 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3238 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3235 | | | | |
3239 | | | | |
3236 +------------------------------------------------------+
3240 +------------------------------------------------------+
3237 </pre>
3241 </pre>
3238 <p>
3242 <p>
3239 Version 2 (headerlen=100):
3243 Version 2 (headerlen=100):
3240 </p>
3244 </p>
3241 <pre>
3245 <pre>
3242 +------------------------------------------------------------------+
3246 +------------------------------------------------------------------+
3243 | | | | | |
3247 | | | | | |
3244 | node | p1 node | p2 node | base node | link node |
3248 | node | p1 node | p2 node | base node | link node |
3245 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3249 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3246 | | | | | |
3250 | | | | | |
3247 +------------------------------------------------------------------+
3251 +------------------------------------------------------------------+
3248 </pre>
3252 </pre>
3249 <p>
3253 <p>
3250 Version 3 (headerlen=102):
3254 Version 3 (headerlen=102):
3251 </p>
3255 </p>
3252 <pre>
3256 <pre>
3253 +------------------------------------------------------------------------------+
3257 +------------------------------------------------------------------------------+
3254 | | | | | | |
3258 | | | | | | |
3255 | node | p1 node | p2 node | base node | link node | flags |
3259 | node | p1 node | p2 node | base node | link node | flags |
3256 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3260 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3257 | | | | | | |
3261 | | | | | | |
3258 +------------------------------------------------------------------------------+
3262 +------------------------------------------------------------------------------+
3259 </pre>
3263 </pre>
3260 <p>
3264 <p>
3261 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3265 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3262 series of *delta*s, densely packed (no separators). These deltas describe a diff
3266 series of *delta*s, densely packed (no separators). These deltas describe a diff
3263 from an existing entry (either that the recipient already has, or previously
3267 from an existing entry (either that the recipient already has, or previously
3264 specified in the bundle/changegroup). The format is described more fully in
3268 specified in the bundle/changegroup). The format is described more fully in
3265 &quot;hg help internals.bdiff&quot;, but briefly:
3269 &quot;hg help internals.bdiff&quot;, but briefly:
3266 </p>
3270 </p>
3267 <pre>
3271 <pre>
3268 +---------------------------------------------------------------+
3272 +---------------------------------------------------------------+
3269 | | | | |
3273 | | | | |
3270 | start offset | end offset | new length | content |
3274 | start offset | end offset | new length | content |
3271 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3275 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3272 | | | | |
3276 | | | | |
3273 +---------------------------------------------------------------+
3277 +---------------------------------------------------------------+
3274 </pre>
3278 </pre>
3275 <p>
3279 <p>
3276 Please note that the length field in the delta data does *not* include itself.
3280 Please note that the length field in the delta data does *not* include itself.
3277 </p>
3281 </p>
3278 <p>
3282 <p>
3279 In version 1, the delta is always applied against the previous node from
3283 In version 1, the delta is always applied against the previous node from
3280 the changegroup or the first parent if this is the first entry in the
3284 the changegroup or the first parent if this is the first entry in the
3281 changegroup.
3285 changegroup.
3282 </p>
3286 </p>
3283 <p>
3287 <p>
3284 In version 2 and up, the delta base node is encoded in the entry in the
3288 In version 2 and up, the delta base node is encoded in the entry in the
3285 changegroup. This allows the delta to be expressed against any parent,
3289 changegroup. This allows the delta to be expressed against any parent,
3286 which can result in smaller deltas and more efficient encoding of data.
3290 which can result in smaller deltas and more efficient encoding of data.
3287 </p>
3291 </p>
3288 <h2>Changeset Segment</h2>
3292 <h2>Changeset Segment</h2>
3289 <p>
3293 <p>
3290 The *changeset segment* consists of a single *delta group* holding
3294 The *changeset segment* consists of a single *delta group* holding
3291 changelog data. The *empty chunk* at the end of the *delta group* denotes
3295 changelog data. The *empty chunk* at the end of the *delta group* denotes
3292 the boundary to the *manifest segment*.
3296 the boundary to the *manifest segment*.
3293 </p>
3297 </p>
3294 <h2>Manifest Segment</h2>
3298 <h2>Manifest Segment</h2>
3295 <p>
3299 <p>
3296 The *manifest segment* consists of a single *delta group* holding manifest
3300 The *manifest segment* consists of a single *delta group* holding manifest
3297 data. If treemanifests are in use, it contains only the manifest for the
3301 data. If treemanifests are in use, it contains only the manifest for the
3298 root directory of the repository. Otherwise, it contains the entire
3302 root directory of the repository. Otherwise, it contains the entire
3299 manifest data. The *empty chunk* at the end of the *delta group* denotes
3303 manifest data. The *empty chunk* at the end of the *delta group* denotes
3300 the boundary to the next segment (either the *treemanifests segment* or the
3304 the boundary to the next segment (either the *treemanifests segment* or the
3301 *filelogs segment*, depending on version and the request options).
3305 *filelogs segment*, depending on version and the request options).
3302 </p>
3306 </p>
3303 <h3>Treemanifests Segment</h3>
3307 <h3>Treemanifests Segment</h3>
3304 <p>
3308 <p>
3305 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3309 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3306 only if the 'treemanifest' param is part of the bundle2 changegroup part
3310 only if the 'treemanifest' param is part of the bundle2 changegroup part
3307 (it is not possible to use changegroup version 3 outside of bundle2).
3311 (it is not possible to use changegroup version 3 outside of bundle2).
3308 Aside from the filenames in the *treemanifests segment* containing a
3312 Aside from the filenames in the *treemanifests segment* containing a
3309 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3313 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3310 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3314 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3311 a sub-segment with filename size 0). This denotes the boundary to the
3315 a sub-segment with filename size 0). This denotes the boundary to the
3312 *filelogs segment*.
3316 *filelogs segment*.
3313 </p>
3317 </p>
3314 <h2>Filelogs Segment</h2>
3318 <h2>Filelogs Segment</h2>
3315 <p>
3319 <p>
3316 The *filelogs segment* consists of multiple sub-segments, each
3320 The *filelogs segment* consists of multiple sub-segments, each
3317 corresponding to an individual file whose data is being described:
3321 corresponding to an individual file whose data is being described:
3318 </p>
3322 </p>
3319 <pre>
3323 <pre>
3320 +--------------------------------------------------+
3324 +--------------------------------------------------+
3321 | | | | | |
3325 | | | | | |
3322 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3326 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3323 | | | | | (4 bytes) |
3327 | | | | | (4 bytes) |
3324 | | | | | |
3328 | | | | | |
3325 +--------------------------------------------------+
3329 +--------------------------------------------------+
3326 </pre>
3330 </pre>
3327 <p>
3331 <p>
3328 The final filelog sub-segment is followed by an *empty chunk* (logically,
3332 The final filelog sub-segment is followed by an *empty chunk* (logically,
3329 a sub-segment with filename size 0). This denotes the end of the segment
3333 a sub-segment with filename size 0). This denotes the end of the segment
3330 and of the overall changegroup.
3334 and of the overall changegroup.
3331 </p>
3335 </p>
3332 <p>
3336 <p>
3333 Each filelog sub-segment consists of the following:
3337 Each filelog sub-segment consists of the following:
3334 </p>
3338 </p>
3335 <pre>
3339 <pre>
3336 +------------------------------------------------------+
3340 +------------------------------------------------------+
3337 | | | |
3341 | | | |
3338 | filename length | filename | delta group |
3342 | filename length | filename | delta group |
3339 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3343 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3340 | | | |
3344 | | | |
3341 +------------------------------------------------------+
3345 +------------------------------------------------------+
3342 </pre>
3346 </pre>
3343 <p>
3347 <p>
3344 That is, a *chunk* consisting of the filename (not terminated or padded)
3348 That is, a *chunk* consisting of the filename (not terminated or padded)
3345 followed by N chunks constituting the *delta group* for this file. The
3349 followed by N chunks constituting the *delta group* for this file. The
3346 *empty chunk* at the end of each *delta group* denotes the boundary to the
3350 *empty chunk* at the end of each *delta group* denotes the boundary to the
3347 next filelog sub-segment.
3351 next filelog sub-segment.
3348 </p>
3352 </p>
3349
3353
3350 </div>
3354 </div>
3351 </div>
3355 </div>
3352 </div>
3356 </div>
3353
3357
3354
3358
3355
3359
3356 </body>
3360 </body>
3357 </html>
3361 </html>
3358
3362
3359
3363
3360 $ killdaemons.py
3364 $ killdaemons.py
3361
3365
3362 #endif
3366 #endif
General Comments 0
You need to be logged in to leave comments. Login now