##// END OF EJS Templates
dispatch: don't show list of commands on bogus command...
Martin von Zweigbergk -
r38823:5199c5b6 default
parent child Browse files
Show More
@@ -1,1066 +1,1065 b''
1 # dispatch.py - command dispatching for mercurial
1 # dispatch.py - command dispatching 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, print_function
8 from __future__ import absolute_import, print_function
9
9
10 import difflib
10 import difflib
11 import errno
11 import errno
12 import getopt
12 import getopt
13 import os
13 import os
14 import pdb
14 import pdb
15 import re
15 import re
16 import signal
16 import signal
17 import sys
17 import sys
18 import time
18 import time
19 import traceback
19 import traceback
20
20
21
21
22 from .i18n import _
22 from .i18n import _
23
23
24 from . import (
24 from . import (
25 cmdutil,
25 cmdutil,
26 color,
26 color,
27 commands,
27 commands,
28 demandimport,
28 demandimport,
29 encoding,
29 encoding,
30 error,
30 error,
31 extensions,
31 extensions,
32 fancyopts,
32 fancyopts,
33 help,
33 help,
34 hg,
34 hg,
35 hook,
35 hook,
36 profiling,
36 profiling,
37 pycompat,
37 pycompat,
38 scmutil,
38 scmutil,
39 ui as uimod,
39 ui as uimod,
40 util,
40 util,
41 )
41 )
42
42
43 from .utils import (
43 from .utils import (
44 procutil,
44 procutil,
45 stringutil,
45 stringutil,
46 )
46 )
47
47
48 class request(object):
48 class request(object):
49 def __init__(self, args, ui=None, repo=None, fin=None, fout=None,
49 def __init__(self, args, ui=None, repo=None, fin=None, fout=None,
50 ferr=None, prereposetups=None):
50 ferr=None, prereposetups=None):
51 self.args = args
51 self.args = args
52 self.ui = ui
52 self.ui = ui
53 self.repo = repo
53 self.repo = repo
54
54
55 # input/output/error streams
55 # input/output/error streams
56 self.fin = fin
56 self.fin = fin
57 self.fout = fout
57 self.fout = fout
58 self.ferr = ferr
58 self.ferr = ferr
59
59
60 # remember options pre-parsed by _earlyparseopts()
60 # remember options pre-parsed by _earlyparseopts()
61 self.earlyoptions = {}
61 self.earlyoptions = {}
62
62
63 # reposetups which run before extensions, useful for chg to pre-fill
63 # reposetups which run before extensions, useful for chg to pre-fill
64 # low-level repo state (for example, changelog) before extensions.
64 # low-level repo state (for example, changelog) before extensions.
65 self.prereposetups = prereposetups or []
65 self.prereposetups = prereposetups or []
66
66
67 def _runexithandlers(self):
67 def _runexithandlers(self):
68 exc = None
68 exc = None
69 handlers = self.ui._exithandlers
69 handlers = self.ui._exithandlers
70 try:
70 try:
71 while handlers:
71 while handlers:
72 func, args, kwargs = handlers.pop()
72 func, args, kwargs = handlers.pop()
73 try:
73 try:
74 func(*args, **kwargs)
74 func(*args, **kwargs)
75 except: # re-raises below
75 except: # re-raises below
76 if exc is None:
76 if exc is None:
77 exc = sys.exc_info()[1]
77 exc = sys.exc_info()[1]
78 self.ui.warn(('error in exit handlers:\n'))
78 self.ui.warn(('error in exit handlers:\n'))
79 self.ui.traceback(force=True)
79 self.ui.traceback(force=True)
80 finally:
80 finally:
81 if exc is not None:
81 if exc is not None:
82 raise exc
82 raise exc
83
83
84 def run():
84 def run():
85 "run the command in sys.argv"
85 "run the command in sys.argv"
86 initstdio()
86 initstdio()
87 req = request(pycompat.sysargv[1:])
87 req = request(pycompat.sysargv[1:])
88 err = None
88 err = None
89 try:
89 try:
90 status = dispatch(req)
90 status = dispatch(req)
91 except error.StdioError as e:
91 except error.StdioError as e:
92 err = e
92 err = e
93 status = -1
93 status = -1
94
94
95 # In all cases we try to flush stdio streams.
95 # In all cases we try to flush stdio streams.
96 if util.safehasattr(req.ui, 'fout'):
96 if util.safehasattr(req.ui, 'fout'):
97 try:
97 try:
98 req.ui.fout.flush()
98 req.ui.fout.flush()
99 except IOError as e:
99 except IOError as e:
100 err = e
100 err = e
101 status = -1
101 status = -1
102
102
103 if util.safehasattr(req.ui, 'ferr'):
103 if util.safehasattr(req.ui, 'ferr'):
104 try:
104 try:
105 if err is not None and err.errno != errno.EPIPE:
105 if err is not None and err.errno != errno.EPIPE:
106 req.ui.ferr.write('abort: %s\n' %
106 req.ui.ferr.write('abort: %s\n' %
107 encoding.strtolocal(err.strerror))
107 encoding.strtolocal(err.strerror))
108 req.ui.ferr.flush()
108 req.ui.ferr.flush()
109 # There's not much we can do about an I/O error here. So (possibly)
109 # There's not much we can do about an I/O error here. So (possibly)
110 # change the status code and move on.
110 # change the status code and move on.
111 except IOError:
111 except IOError:
112 status = -1
112 status = -1
113
113
114 _silencestdio()
114 _silencestdio()
115 sys.exit(status & 255)
115 sys.exit(status & 255)
116
116
117 if pycompat.ispy3:
117 if pycompat.ispy3:
118 def initstdio():
118 def initstdio():
119 pass
119 pass
120
120
121 def _silencestdio():
121 def _silencestdio():
122 for fp in (sys.stdout, sys.stderr):
122 for fp in (sys.stdout, sys.stderr):
123 # Check if the file is okay
123 # Check if the file is okay
124 try:
124 try:
125 fp.flush()
125 fp.flush()
126 continue
126 continue
127 except IOError:
127 except IOError:
128 pass
128 pass
129 # Otherwise mark it as closed to silence "Exception ignored in"
129 # Otherwise mark it as closed to silence "Exception ignored in"
130 # message emitted by the interpreter finalizer. Be careful to
130 # message emitted by the interpreter finalizer. Be careful to
131 # not close procutil.stdout, which may be a fdopen-ed file object
131 # not close procutil.stdout, which may be a fdopen-ed file object
132 # and its close() actually closes the underlying file descriptor.
132 # and its close() actually closes the underlying file descriptor.
133 try:
133 try:
134 fp.close()
134 fp.close()
135 except IOError:
135 except IOError:
136 pass
136 pass
137 else:
137 else:
138 def initstdio():
138 def initstdio():
139 for fp in (sys.stdin, sys.stdout, sys.stderr):
139 for fp in (sys.stdin, sys.stdout, sys.stderr):
140 procutil.setbinary(fp)
140 procutil.setbinary(fp)
141
141
142 def _silencestdio():
142 def _silencestdio():
143 pass
143 pass
144
144
145 def _getsimilar(symbols, value):
145 def _getsimilar(symbols, value):
146 sim = lambda x: difflib.SequenceMatcher(None, value, x).ratio()
146 sim = lambda x: difflib.SequenceMatcher(None, value, x).ratio()
147 # The cutoff for similarity here is pretty arbitrary. It should
147 # The cutoff for similarity here is pretty arbitrary. It should
148 # probably be investigated and tweaked.
148 # probably be investigated and tweaked.
149 return [s for s in symbols if sim(s) > 0.6]
149 return [s for s in symbols if sim(s) > 0.6]
150
150
151 def _reportsimilar(write, similar):
151 def _reportsimilar(write, similar):
152 if len(similar) == 1:
152 if len(similar) == 1:
153 write(_("(did you mean %s?)\n") % similar[0])
153 write(_("(did you mean %s?)\n") % similar[0])
154 elif similar:
154 elif similar:
155 ss = ", ".join(sorted(similar))
155 ss = ", ".join(sorted(similar))
156 write(_("(did you mean one of %s?)\n") % ss)
156 write(_("(did you mean one of %s?)\n") % ss)
157
157
158 def _formatparse(write, inst):
158 def _formatparse(write, inst):
159 similar = []
159 similar = []
160 if isinstance(inst, error.UnknownIdentifier):
160 if isinstance(inst, error.UnknownIdentifier):
161 # make sure to check fileset first, as revset can invoke fileset
161 # make sure to check fileset first, as revset can invoke fileset
162 similar = _getsimilar(inst.symbols, inst.function)
162 similar = _getsimilar(inst.symbols, inst.function)
163 if len(inst.args) > 1:
163 if len(inst.args) > 1:
164 write(_("hg: parse error at %s: %s\n") %
164 write(_("hg: parse error at %s: %s\n") %
165 (pycompat.bytestr(inst.args[1]), inst.args[0]))
165 (pycompat.bytestr(inst.args[1]), inst.args[0]))
166 if inst.args[0].startswith(' '):
166 if inst.args[0].startswith(' '):
167 write(_("unexpected leading whitespace\n"))
167 write(_("unexpected leading whitespace\n"))
168 else:
168 else:
169 write(_("hg: parse error: %s\n") % inst.args[0])
169 write(_("hg: parse error: %s\n") % inst.args[0])
170 _reportsimilar(write, similar)
170 _reportsimilar(write, similar)
171 if inst.hint:
171 if inst.hint:
172 write(_("(%s)\n") % inst.hint)
172 write(_("(%s)\n") % inst.hint)
173
173
174 def _formatargs(args):
174 def _formatargs(args):
175 return ' '.join(procutil.shellquote(a) for a in args)
175 return ' '.join(procutil.shellquote(a) for a in args)
176
176
177 def dispatch(req):
177 def dispatch(req):
178 """run the command specified in req.args; returns an integer status code"""
178 """run the command specified in req.args; returns an integer status code"""
179 if req.ferr:
179 if req.ferr:
180 ferr = req.ferr
180 ferr = req.ferr
181 elif req.ui:
181 elif req.ui:
182 ferr = req.ui.ferr
182 ferr = req.ui.ferr
183 else:
183 else:
184 ferr = procutil.stderr
184 ferr = procutil.stderr
185
185
186 try:
186 try:
187 if not req.ui:
187 if not req.ui:
188 req.ui = uimod.ui.load()
188 req.ui = uimod.ui.load()
189 req.earlyoptions.update(_earlyparseopts(req.ui, req.args))
189 req.earlyoptions.update(_earlyparseopts(req.ui, req.args))
190 if req.earlyoptions['traceback']:
190 if req.earlyoptions['traceback']:
191 req.ui.setconfig('ui', 'traceback', 'on', '--traceback')
191 req.ui.setconfig('ui', 'traceback', 'on', '--traceback')
192
192
193 # set ui streams from the request
193 # set ui streams from the request
194 if req.fin:
194 if req.fin:
195 req.ui.fin = req.fin
195 req.ui.fin = req.fin
196 if req.fout:
196 if req.fout:
197 req.ui.fout = req.fout
197 req.ui.fout = req.fout
198 if req.ferr:
198 if req.ferr:
199 req.ui.ferr = req.ferr
199 req.ui.ferr = req.ferr
200 except error.Abort as inst:
200 except error.Abort as inst:
201 ferr.write(_("abort: %s\n") % inst)
201 ferr.write(_("abort: %s\n") % inst)
202 if inst.hint:
202 if inst.hint:
203 ferr.write(_("(%s)\n") % inst.hint)
203 ferr.write(_("(%s)\n") % inst.hint)
204 return -1
204 return -1
205 except error.ParseError as inst:
205 except error.ParseError as inst:
206 _formatparse(ferr.write, inst)
206 _formatparse(ferr.write, inst)
207 return -1
207 return -1
208
208
209 msg = _formatargs(req.args)
209 msg = _formatargs(req.args)
210 starttime = util.timer()
210 starttime = util.timer()
211 ret = 1 # default of Python exit code on unhandled exception
211 ret = 1 # default of Python exit code on unhandled exception
212 try:
212 try:
213 ret = _runcatch(req) or 0
213 ret = _runcatch(req) or 0
214 except error.ProgrammingError as inst:
214 except error.ProgrammingError as inst:
215 req.ui.error(_('** ProgrammingError: %s\n') % inst)
215 req.ui.error(_('** ProgrammingError: %s\n') % inst)
216 if inst.hint:
216 if inst.hint:
217 req.ui.error(_('** (%s)\n') % inst.hint)
217 req.ui.error(_('** (%s)\n') % inst.hint)
218 raise
218 raise
219 except KeyboardInterrupt as inst:
219 except KeyboardInterrupt as inst:
220 try:
220 try:
221 if isinstance(inst, error.SignalInterrupt):
221 if isinstance(inst, error.SignalInterrupt):
222 msg = _("killed!\n")
222 msg = _("killed!\n")
223 else:
223 else:
224 msg = _("interrupted!\n")
224 msg = _("interrupted!\n")
225 req.ui.error(msg)
225 req.ui.error(msg)
226 except error.SignalInterrupt:
226 except error.SignalInterrupt:
227 # maybe pager would quit without consuming all the output, and
227 # maybe pager would quit without consuming all the output, and
228 # SIGPIPE was raised. we cannot print anything in this case.
228 # SIGPIPE was raised. we cannot print anything in this case.
229 pass
229 pass
230 except IOError as inst:
230 except IOError as inst:
231 if inst.errno != errno.EPIPE:
231 if inst.errno != errno.EPIPE:
232 raise
232 raise
233 ret = -1
233 ret = -1
234 finally:
234 finally:
235 duration = util.timer() - starttime
235 duration = util.timer() - starttime
236 req.ui.flush()
236 req.ui.flush()
237 if req.ui.logblockedtimes:
237 if req.ui.logblockedtimes:
238 req.ui._blockedtimes['command_duration'] = duration * 1000
238 req.ui._blockedtimes['command_duration'] = duration * 1000
239 req.ui.log('uiblocked', 'ui blocked ms',
239 req.ui.log('uiblocked', 'ui blocked ms',
240 **pycompat.strkwargs(req.ui._blockedtimes))
240 **pycompat.strkwargs(req.ui._blockedtimes))
241 req.ui.log("commandfinish", "%s exited %d after %0.2f seconds\n",
241 req.ui.log("commandfinish", "%s exited %d after %0.2f seconds\n",
242 msg, ret & 255, duration)
242 msg, ret & 255, duration)
243 try:
243 try:
244 req._runexithandlers()
244 req._runexithandlers()
245 except: # exiting, so no re-raises
245 except: # exiting, so no re-raises
246 ret = ret or -1
246 ret = ret or -1
247 return ret
247 return ret
248
248
249 def _runcatch(req):
249 def _runcatch(req):
250 def catchterm(*args):
250 def catchterm(*args):
251 raise error.SignalInterrupt
251 raise error.SignalInterrupt
252
252
253 ui = req.ui
253 ui = req.ui
254 try:
254 try:
255 for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM':
255 for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM':
256 num = getattr(signal, name, None)
256 num = getattr(signal, name, None)
257 if num:
257 if num:
258 signal.signal(num, catchterm)
258 signal.signal(num, catchterm)
259 except ValueError:
259 except ValueError:
260 pass # happens if called in a thread
260 pass # happens if called in a thread
261
261
262 def _runcatchfunc():
262 def _runcatchfunc():
263 realcmd = None
263 realcmd = None
264 try:
264 try:
265 cmdargs = fancyopts.fancyopts(req.args[:], commands.globalopts, {})
265 cmdargs = fancyopts.fancyopts(req.args[:], commands.globalopts, {})
266 cmd = cmdargs[0]
266 cmd = cmdargs[0]
267 aliases, entry = cmdutil.findcmd(cmd, commands.table, False)
267 aliases, entry = cmdutil.findcmd(cmd, commands.table, False)
268 realcmd = aliases[0]
268 realcmd = aliases[0]
269 except (error.UnknownCommand, error.AmbiguousCommand,
269 except (error.UnknownCommand, error.AmbiguousCommand,
270 IndexError, getopt.GetoptError):
270 IndexError, getopt.GetoptError):
271 # Don't handle this here. We know the command is
271 # Don't handle this here. We know the command is
272 # invalid, but all we're worried about for now is that
272 # invalid, but all we're worried about for now is that
273 # it's not a command that server operators expect to
273 # it's not a command that server operators expect to
274 # be safe to offer to users in a sandbox.
274 # be safe to offer to users in a sandbox.
275 pass
275 pass
276 if realcmd == 'serve' and '--stdio' in cmdargs:
276 if realcmd == 'serve' and '--stdio' in cmdargs:
277 # We want to constrain 'hg serve --stdio' instances pretty
277 # We want to constrain 'hg serve --stdio' instances pretty
278 # closely, as many shared-ssh access tools want to grant
278 # closely, as many shared-ssh access tools want to grant
279 # access to run *only* 'hg -R $repo serve --stdio'. We
279 # access to run *only* 'hg -R $repo serve --stdio'. We
280 # restrict to exactly that set of arguments, and prohibit
280 # restrict to exactly that set of arguments, and prohibit
281 # any repo name that starts with '--' to prevent
281 # any repo name that starts with '--' to prevent
282 # shenanigans wherein a user does something like pass
282 # shenanigans wherein a user does something like pass
283 # --debugger or --config=ui.debugger=1 as a repo
283 # --debugger or --config=ui.debugger=1 as a repo
284 # name. This used to actually run the debugger.
284 # name. This used to actually run the debugger.
285 if (len(req.args) != 4 or
285 if (len(req.args) != 4 or
286 req.args[0] != '-R' or
286 req.args[0] != '-R' or
287 req.args[1].startswith('--') or
287 req.args[1].startswith('--') or
288 req.args[2] != 'serve' or
288 req.args[2] != 'serve' or
289 req.args[3] != '--stdio'):
289 req.args[3] != '--stdio'):
290 raise error.Abort(
290 raise error.Abort(
291 _('potentially unsafe serve --stdio invocation: %s') %
291 _('potentially unsafe serve --stdio invocation: %s') %
292 (stringutil.pprint(req.args),))
292 (stringutil.pprint(req.args),))
293
293
294 try:
294 try:
295 debugger = 'pdb'
295 debugger = 'pdb'
296 debugtrace = {
296 debugtrace = {
297 'pdb': pdb.set_trace
297 'pdb': pdb.set_trace
298 }
298 }
299 debugmortem = {
299 debugmortem = {
300 'pdb': pdb.post_mortem
300 'pdb': pdb.post_mortem
301 }
301 }
302
302
303 # read --config before doing anything else
303 # read --config before doing anything else
304 # (e.g. to change trust settings for reading .hg/hgrc)
304 # (e.g. to change trust settings for reading .hg/hgrc)
305 cfgs = _parseconfig(req.ui, req.earlyoptions['config'])
305 cfgs = _parseconfig(req.ui, req.earlyoptions['config'])
306
306
307 if req.repo:
307 if req.repo:
308 # copy configs that were passed on the cmdline (--config) to
308 # copy configs that were passed on the cmdline (--config) to
309 # the repo ui
309 # the repo ui
310 for sec, name, val in cfgs:
310 for sec, name, val in cfgs:
311 req.repo.ui.setconfig(sec, name, val, source='--config')
311 req.repo.ui.setconfig(sec, name, val, source='--config')
312
312
313 # developer config: ui.debugger
313 # developer config: ui.debugger
314 debugger = ui.config("ui", "debugger")
314 debugger = ui.config("ui", "debugger")
315 debugmod = pdb
315 debugmod = pdb
316 if not debugger or ui.plain():
316 if not debugger or ui.plain():
317 # if we are in HGPLAIN mode, then disable custom debugging
317 # if we are in HGPLAIN mode, then disable custom debugging
318 debugger = 'pdb'
318 debugger = 'pdb'
319 elif req.earlyoptions['debugger']:
319 elif req.earlyoptions['debugger']:
320 # This import can be slow for fancy debuggers, so only
320 # This import can be slow for fancy debuggers, so only
321 # do it when absolutely necessary, i.e. when actual
321 # do it when absolutely necessary, i.e. when actual
322 # debugging has been requested
322 # debugging has been requested
323 with demandimport.deactivated():
323 with demandimport.deactivated():
324 try:
324 try:
325 debugmod = __import__(debugger)
325 debugmod = __import__(debugger)
326 except ImportError:
326 except ImportError:
327 pass # Leave debugmod = pdb
327 pass # Leave debugmod = pdb
328
328
329 debugtrace[debugger] = debugmod.set_trace
329 debugtrace[debugger] = debugmod.set_trace
330 debugmortem[debugger] = debugmod.post_mortem
330 debugmortem[debugger] = debugmod.post_mortem
331
331
332 # enter the debugger before command execution
332 # enter the debugger before command execution
333 if req.earlyoptions['debugger']:
333 if req.earlyoptions['debugger']:
334 ui.warn(_("entering debugger - "
334 ui.warn(_("entering debugger - "
335 "type c to continue starting hg or h for help\n"))
335 "type c to continue starting hg or h for help\n"))
336
336
337 if (debugger != 'pdb' and
337 if (debugger != 'pdb' and
338 debugtrace[debugger] == debugtrace['pdb']):
338 debugtrace[debugger] == debugtrace['pdb']):
339 ui.warn(_("%s debugger specified "
339 ui.warn(_("%s debugger specified "
340 "but its module was not found\n") % debugger)
340 "but its module was not found\n") % debugger)
341 with demandimport.deactivated():
341 with demandimport.deactivated():
342 debugtrace[debugger]()
342 debugtrace[debugger]()
343 try:
343 try:
344 return _dispatch(req)
344 return _dispatch(req)
345 finally:
345 finally:
346 ui.flush()
346 ui.flush()
347 except: # re-raises
347 except: # re-raises
348 # enter the debugger when we hit an exception
348 # enter the debugger when we hit an exception
349 if req.earlyoptions['debugger']:
349 if req.earlyoptions['debugger']:
350 traceback.print_exc()
350 traceback.print_exc()
351 debugmortem[debugger](sys.exc_info()[2])
351 debugmortem[debugger](sys.exc_info()[2])
352 raise
352 raise
353
353
354 return _callcatch(ui, _runcatchfunc)
354 return _callcatch(ui, _runcatchfunc)
355
355
356 def _callcatch(ui, func):
356 def _callcatch(ui, func):
357 """like scmutil.callcatch but handles more high-level exceptions about
357 """like scmutil.callcatch but handles more high-level exceptions about
358 config parsing and commands. besides, use handlecommandexception to handle
358 config parsing and commands. besides, use handlecommandexception to handle
359 uncaught exceptions.
359 uncaught exceptions.
360 """
360 """
361 try:
361 try:
362 return scmutil.callcatch(ui, func)
362 return scmutil.callcatch(ui, func)
363 except error.AmbiguousCommand as inst:
363 except error.AmbiguousCommand as inst:
364 ui.warn(_("hg: command '%s' is ambiguous:\n %s\n") %
364 ui.warn(_("hg: command '%s' is ambiguous:\n %s\n") %
365 (inst.args[0], " ".join(inst.args[1])))
365 (inst.args[0], " ".join(inst.args[1])))
366 except error.CommandError as inst:
366 except error.CommandError as inst:
367 if inst.args[0]:
367 if inst.args[0]:
368 ui.pager('help')
368 ui.pager('help')
369 msgbytes = pycompat.bytestr(inst.args[1])
369 msgbytes = pycompat.bytestr(inst.args[1])
370 ui.warn(_("hg %s: %s\n") % (inst.args[0], msgbytes))
370 ui.warn(_("hg %s: %s\n") % (inst.args[0], msgbytes))
371 commands.help_(ui, inst.args[0], full=False, command=True)
371 commands.help_(ui, inst.args[0], full=False, command=True)
372 else:
372 else:
373 ui.pager('help')
373 ui.pager('help')
374 ui.warn(_("hg: %s\n") % inst.args[1])
374 ui.warn(_("hg: %s\n") % inst.args[1])
375 commands.help_(ui, 'shortlist')
375 commands.help_(ui, 'shortlist')
376 except error.ParseError as inst:
376 except error.ParseError as inst:
377 _formatparse(ui.warn, inst)
377 _formatparse(ui.warn, inst)
378 return -1
378 return -1
379 except error.UnknownCommand as inst:
379 except error.UnknownCommand as inst:
380 nocmdmsg = _("hg: unknown command '%s'\n") % inst.args[0]
380 nocmdmsg = _("hg: unknown command '%s'\n") % inst.args[0]
381 try:
381 try:
382 # check if the command is in a disabled extension
382 # check if the command is in a disabled extension
383 # (but don't check for extensions themselves)
383 # (but don't check for extensions themselves)
384 formatted = help.formattedhelp(ui, commands, inst.args[0],
384 formatted = help.formattedhelp(ui, commands, inst.args[0],
385 unknowncmd=True)
385 unknowncmd=True)
386 ui.warn(nocmdmsg)
386 ui.warn(nocmdmsg)
387 ui.write(formatted)
387 ui.write(formatted)
388 except (error.UnknownCommand, error.Abort):
388 except (error.UnknownCommand, error.Abort):
389 suggested = False
389 suggested = False
390 if len(inst.args) == 2:
390 if len(inst.args) == 2:
391 sim = _getsimilar(inst.args[1], inst.args[0])
391 sim = _getsimilar(inst.args[1], inst.args[0])
392 if sim:
392 if sim:
393 ui.warn(nocmdmsg)
393 ui.warn(nocmdmsg)
394 _reportsimilar(ui.warn, sim)
394 _reportsimilar(ui.warn, sim)
395 suggested = True
395 suggested = True
396 if not suggested:
396 if not suggested:
397 ui.pager('help')
398 ui.warn(nocmdmsg)
397 ui.warn(nocmdmsg)
399 commands.help_(ui, 'shortlist')
398 ui.warn(_("(use 'hg help' for a list of commands)\n"))
400 except IOError:
399 except IOError:
401 raise
400 raise
402 except KeyboardInterrupt:
401 except KeyboardInterrupt:
403 raise
402 raise
404 except: # probably re-raises
403 except: # probably re-raises
405 if not handlecommandexception(ui):
404 if not handlecommandexception(ui):
406 raise
405 raise
407
406
408 return -1
407 return -1
409
408
410 def aliasargs(fn, givenargs):
409 def aliasargs(fn, givenargs):
411 args = []
410 args = []
412 # only care about alias 'args', ignore 'args' set by extensions.wrapfunction
411 # only care about alias 'args', ignore 'args' set by extensions.wrapfunction
413 if not util.safehasattr(fn, '_origfunc'):
412 if not util.safehasattr(fn, '_origfunc'):
414 args = getattr(fn, 'args', args)
413 args = getattr(fn, 'args', args)
415 if args:
414 if args:
416 cmd = ' '.join(map(procutil.shellquote, args))
415 cmd = ' '.join(map(procutil.shellquote, args))
417
416
418 nums = []
417 nums = []
419 def replacer(m):
418 def replacer(m):
420 num = int(m.group(1)) - 1
419 num = int(m.group(1)) - 1
421 nums.append(num)
420 nums.append(num)
422 if num < len(givenargs):
421 if num < len(givenargs):
423 return givenargs[num]
422 return givenargs[num]
424 raise error.Abort(_('too few arguments for command alias'))
423 raise error.Abort(_('too few arguments for command alias'))
425 cmd = re.sub(br'\$(\d+|\$)', replacer, cmd)
424 cmd = re.sub(br'\$(\d+|\$)', replacer, cmd)
426 givenargs = [x for i, x in enumerate(givenargs)
425 givenargs = [x for i, x in enumerate(givenargs)
427 if i not in nums]
426 if i not in nums]
428 args = pycompat.shlexsplit(cmd)
427 args = pycompat.shlexsplit(cmd)
429 return args + givenargs
428 return args + givenargs
430
429
431 def aliasinterpolate(name, args, cmd):
430 def aliasinterpolate(name, args, cmd):
432 '''interpolate args into cmd for shell aliases
431 '''interpolate args into cmd for shell aliases
433
432
434 This also handles $0, $@ and "$@".
433 This also handles $0, $@ and "$@".
435 '''
434 '''
436 # util.interpolate can't deal with "$@" (with quotes) because it's only
435 # util.interpolate can't deal with "$@" (with quotes) because it's only
437 # built to match prefix + patterns.
436 # built to match prefix + patterns.
438 replacemap = dict(('$%d' % (i + 1), arg) for i, arg in enumerate(args))
437 replacemap = dict(('$%d' % (i + 1), arg) for i, arg in enumerate(args))
439 replacemap['$0'] = name
438 replacemap['$0'] = name
440 replacemap['$$'] = '$'
439 replacemap['$$'] = '$'
441 replacemap['$@'] = ' '.join(args)
440 replacemap['$@'] = ' '.join(args)
442 # Typical Unix shells interpolate "$@" (with quotes) as all the positional
441 # Typical Unix shells interpolate "$@" (with quotes) as all the positional
443 # parameters, separated out into words. Emulate the same behavior here by
442 # parameters, separated out into words. Emulate the same behavior here by
444 # quoting the arguments individually. POSIX shells will then typically
443 # quoting the arguments individually. POSIX shells will then typically
445 # tokenize each argument into exactly one word.
444 # tokenize each argument into exactly one word.
446 replacemap['"$@"'] = ' '.join(procutil.shellquote(arg) for arg in args)
445 replacemap['"$@"'] = ' '.join(procutil.shellquote(arg) for arg in args)
447 # escape '\$' for regex
446 # escape '\$' for regex
448 regex = '|'.join(replacemap.keys()).replace('$', br'\$')
447 regex = '|'.join(replacemap.keys()).replace('$', br'\$')
449 r = re.compile(regex)
448 r = re.compile(regex)
450 return r.sub(lambda x: replacemap[x.group()], cmd)
449 return r.sub(lambda x: replacemap[x.group()], cmd)
451
450
452 class cmdalias(object):
451 class cmdalias(object):
453 def __init__(self, ui, name, definition, cmdtable, source):
452 def __init__(self, ui, name, definition, cmdtable, source):
454 self.name = self.cmd = name
453 self.name = self.cmd = name
455 self.cmdname = ''
454 self.cmdname = ''
456 self.definition = definition
455 self.definition = definition
457 self.fn = None
456 self.fn = None
458 self.givenargs = []
457 self.givenargs = []
459 self.opts = []
458 self.opts = []
460 self.help = ''
459 self.help = ''
461 self.badalias = None
460 self.badalias = None
462 self.unknowncmd = False
461 self.unknowncmd = False
463 self.source = source
462 self.source = source
464
463
465 try:
464 try:
466 aliases, entry = cmdutil.findcmd(self.name, cmdtable)
465 aliases, entry = cmdutil.findcmd(self.name, cmdtable)
467 for alias, e in cmdtable.iteritems():
466 for alias, e in cmdtable.iteritems():
468 if e is entry:
467 if e is entry:
469 self.cmd = alias
468 self.cmd = alias
470 break
469 break
471 self.shadows = True
470 self.shadows = True
472 except error.UnknownCommand:
471 except error.UnknownCommand:
473 self.shadows = False
472 self.shadows = False
474
473
475 if not self.definition:
474 if not self.definition:
476 self.badalias = _("no definition for alias '%s'") % self.name
475 self.badalias = _("no definition for alias '%s'") % self.name
477 return
476 return
478
477
479 if self.definition.startswith('!'):
478 if self.definition.startswith('!'):
480 shdef = self.definition[1:]
479 shdef = self.definition[1:]
481 self.shell = True
480 self.shell = True
482 def fn(ui, *args):
481 def fn(ui, *args):
483 env = {'HG_ARGS': ' '.join((self.name,) + args)}
482 env = {'HG_ARGS': ' '.join((self.name,) + args)}
484 def _checkvar(m):
483 def _checkvar(m):
485 if m.groups()[0] == '$':
484 if m.groups()[0] == '$':
486 return m.group()
485 return m.group()
487 elif int(m.groups()[0]) <= len(args):
486 elif int(m.groups()[0]) <= len(args):
488 return m.group()
487 return m.group()
489 else:
488 else:
490 ui.debug("No argument found for substitution "
489 ui.debug("No argument found for substitution "
491 "of %i variable in alias '%s' definition.\n"
490 "of %i variable in alias '%s' definition.\n"
492 % (int(m.groups()[0]), self.name))
491 % (int(m.groups()[0]), self.name))
493 return ''
492 return ''
494 cmd = re.sub(br'\$(\d+|\$)', _checkvar, shdef)
493 cmd = re.sub(br'\$(\d+|\$)', _checkvar, shdef)
495 cmd = aliasinterpolate(self.name, args, cmd)
494 cmd = aliasinterpolate(self.name, args, cmd)
496 return ui.system(cmd, environ=env,
495 return ui.system(cmd, environ=env,
497 blockedtag='alias_%s' % self.name)
496 blockedtag='alias_%s' % self.name)
498 self.fn = fn
497 self.fn = fn
499 self._populatehelp(ui, name, shdef, self.fn)
498 self._populatehelp(ui, name, shdef, self.fn)
500 return
499 return
501
500
502 try:
501 try:
503 args = pycompat.shlexsplit(self.definition)
502 args = pycompat.shlexsplit(self.definition)
504 except ValueError as inst:
503 except ValueError as inst:
505 self.badalias = (_("error in definition for alias '%s': %s")
504 self.badalias = (_("error in definition for alias '%s': %s")
506 % (self.name, stringutil.forcebytestr(inst)))
505 % (self.name, stringutil.forcebytestr(inst)))
507 return
506 return
508 earlyopts, args = _earlysplitopts(args)
507 earlyopts, args = _earlysplitopts(args)
509 if earlyopts:
508 if earlyopts:
510 self.badalias = (_("error in definition for alias '%s': %s may "
509 self.badalias = (_("error in definition for alias '%s': %s may "
511 "only be given on the command line")
510 "only be given on the command line")
512 % (self.name, '/'.join(pycompat.ziplist(*earlyopts)
511 % (self.name, '/'.join(pycompat.ziplist(*earlyopts)
513 [0])))
512 [0])))
514 return
513 return
515 self.cmdname = cmd = args.pop(0)
514 self.cmdname = cmd = args.pop(0)
516 self.givenargs = args
515 self.givenargs = args
517
516
518 try:
517 try:
519 tableentry = cmdutil.findcmd(cmd, cmdtable, False)[1]
518 tableentry = cmdutil.findcmd(cmd, cmdtable, False)[1]
520 if len(tableentry) > 2:
519 if len(tableentry) > 2:
521 self.fn, self.opts, cmdhelp = tableentry
520 self.fn, self.opts, cmdhelp = tableentry
522 else:
521 else:
523 self.fn, self.opts = tableentry
522 self.fn, self.opts = tableentry
524 cmdhelp = None
523 cmdhelp = None
525
524
526 self._populatehelp(ui, name, cmd, self.fn, cmdhelp)
525 self._populatehelp(ui, name, cmd, self.fn, cmdhelp)
527
526
528 except error.UnknownCommand:
527 except error.UnknownCommand:
529 self.badalias = (_("alias '%s' resolves to unknown command '%s'")
528 self.badalias = (_("alias '%s' resolves to unknown command '%s'")
530 % (self.name, cmd))
529 % (self.name, cmd))
531 self.unknowncmd = True
530 self.unknowncmd = True
532 except error.AmbiguousCommand:
531 except error.AmbiguousCommand:
533 self.badalias = (_("alias '%s' resolves to ambiguous command '%s'")
532 self.badalias = (_("alias '%s' resolves to ambiguous command '%s'")
534 % (self.name, cmd))
533 % (self.name, cmd))
535
534
536 def _populatehelp(self, ui, name, cmd, fn, defaulthelp=None):
535 def _populatehelp(self, ui, name, cmd, fn, defaulthelp=None):
537 # confine strings to be passed to i18n.gettext()
536 # confine strings to be passed to i18n.gettext()
538 cfg = {}
537 cfg = {}
539 for k in ('doc', 'help'):
538 for k in ('doc', 'help'):
540 v = ui.config('alias', '%s:%s' % (name, k), None)
539 v = ui.config('alias', '%s:%s' % (name, k), None)
541 if v is None:
540 if v is None:
542 continue
541 continue
543 if not encoding.isasciistr(v):
542 if not encoding.isasciistr(v):
544 self.badalias = (_("non-ASCII character in alias definition "
543 self.badalias = (_("non-ASCII character in alias definition "
545 "'%s:%s'") % (name, k))
544 "'%s:%s'") % (name, k))
546 return
545 return
547 cfg[k] = v
546 cfg[k] = v
548
547
549 self.help = cfg.get('help', defaulthelp or '')
548 self.help = cfg.get('help', defaulthelp or '')
550 if self.help and self.help.startswith("hg " + cmd):
549 if self.help and self.help.startswith("hg " + cmd):
551 # drop prefix in old-style help lines so hg shows the alias
550 # drop prefix in old-style help lines so hg shows the alias
552 self.help = self.help[4 + len(cmd):]
551 self.help = self.help[4 + len(cmd):]
553
552
554 doc = cfg.get('doc', pycompat.getdoc(fn))
553 doc = cfg.get('doc', pycompat.getdoc(fn))
555 if doc is not None:
554 if doc is not None:
556 doc = pycompat.sysstr(doc)
555 doc = pycompat.sysstr(doc)
557 self.__doc__ = doc
556 self.__doc__ = doc
558
557
559 @property
558 @property
560 def args(self):
559 def args(self):
561 args = pycompat.maplist(util.expandpath, self.givenargs)
560 args = pycompat.maplist(util.expandpath, self.givenargs)
562 return aliasargs(self.fn, args)
561 return aliasargs(self.fn, args)
563
562
564 def __getattr__(self, name):
563 def __getattr__(self, name):
565 adefaults = {r'norepo': True, r'intents': set(),
564 adefaults = {r'norepo': True, r'intents': set(),
566 r'optionalrepo': False, r'inferrepo': False}
565 r'optionalrepo': False, r'inferrepo': False}
567 if name not in adefaults:
566 if name not in adefaults:
568 raise AttributeError(name)
567 raise AttributeError(name)
569 if self.badalias or util.safehasattr(self, 'shell'):
568 if self.badalias or util.safehasattr(self, 'shell'):
570 return adefaults[name]
569 return adefaults[name]
571 return getattr(self.fn, name)
570 return getattr(self.fn, name)
572
571
573 def __call__(self, ui, *args, **opts):
572 def __call__(self, ui, *args, **opts):
574 if self.badalias:
573 if self.badalias:
575 hint = None
574 hint = None
576 if self.unknowncmd:
575 if self.unknowncmd:
577 try:
576 try:
578 # check if the command is in a disabled extension
577 # check if the command is in a disabled extension
579 cmd, ext = extensions.disabledcmd(ui, self.cmdname)[:2]
578 cmd, ext = extensions.disabledcmd(ui, self.cmdname)[:2]
580 hint = _("'%s' is provided by '%s' extension") % (cmd, ext)
579 hint = _("'%s' is provided by '%s' extension") % (cmd, ext)
581 except error.UnknownCommand:
580 except error.UnknownCommand:
582 pass
581 pass
583 raise error.Abort(self.badalias, hint=hint)
582 raise error.Abort(self.badalias, hint=hint)
584 if self.shadows:
583 if self.shadows:
585 ui.debug("alias '%s' shadows command '%s'\n" %
584 ui.debug("alias '%s' shadows command '%s'\n" %
586 (self.name, self.cmdname))
585 (self.name, self.cmdname))
587
586
588 ui.log('commandalias', "alias '%s' expands to '%s'\n",
587 ui.log('commandalias', "alias '%s' expands to '%s'\n",
589 self.name, self.definition)
588 self.name, self.definition)
590 if util.safehasattr(self, 'shell'):
589 if util.safehasattr(self, 'shell'):
591 return self.fn(ui, *args, **opts)
590 return self.fn(ui, *args, **opts)
592 else:
591 else:
593 try:
592 try:
594 return util.checksignature(self.fn)(ui, *args, **opts)
593 return util.checksignature(self.fn)(ui, *args, **opts)
595 except error.SignatureError:
594 except error.SignatureError:
596 args = ' '.join([self.cmdname] + self.args)
595 args = ' '.join([self.cmdname] + self.args)
597 ui.debug("alias '%s' expands to '%s'\n" % (self.name, args))
596 ui.debug("alias '%s' expands to '%s'\n" % (self.name, args))
598 raise
597 raise
599
598
600 class lazyaliasentry(object):
599 class lazyaliasentry(object):
601 """like a typical command entry (func, opts, help), but is lazy"""
600 """like a typical command entry (func, opts, help), but is lazy"""
602
601
603 def __init__(self, ui, name, definition, cmdtable, source):
602 def __init__(self, ui, name, definition, cmdtable, source):
604 self.ui = ui
603 self.ui = ui
605 self.name = name
604 self.name = name
606 self.definition = definition
605 self.definition = definition
607 self.cmdtable = cmdtable.copy()
606 self.cmdtable = cmdtable.copy()
608 self.source = source
607 self.source = source
609
608
610 @util.propertycache
609 @util.propertycache
611 def _aliasdef(self):
610 def _aliasdef(self):
612 return cmdalias(self.ui, self.name, self.definition, self.cmdtable,
611 return cmdalias(self.ui, self.name, self.definition, self.cmdtable,
613 self.source)
612 self.source)
614
613
615 def __getitem__(self, n):
614 def __getitem__(self, n):
616 aliasdef = self._aliasdef
615 aliasdef = self._aliasdef
617 if n == 0:
616 if n == 0:
618 return aliasdef
617 return aliasdef
619 elif n == 1:
618 elif n == 1:
620 return aliasdef.opts
619 return aliasdef.opts
621 elif n == 2:
620 elif n == 2:
622 return aliasdef.help
621 return aliasdef.help
623 else:
622 else:
624 raise IndexError
623 raise IndexError
625
624
626 def __iter__(self):
625 def __iter__(self):
627 for i in range(3):
626 for i in range(3):
628 yield self[i]
627 yield self[i]
629
628
630 def __len__(self):
629 def __len__(self):
631 return 3
630 return 3
632
631
633 def addaliases(ui, cmdtable):
632 def addaliases(ui, cmdtable):
634 # aliases are processed after extensions have been loaded, so they
633 # aliases are processed after extensions have been loaded, so they
635 # may use extension commands. Aliases can also use other alias definitions,
634 # may use extension commands. Aliases can also use other alias definitions,
636 # but only if they have been defined prior to the current definition.
635 # but only if they have been defined prior to the current definition.
637 for alias, definition in ui.configitems('alias', ignoresub=True):
636 for alias, definition in ui.configitems('alias', ignoresub=True):
638 try:
637 try:
639 if cmdtable[alias].definition == definition:
638 if cmdtable[alias].definition == definition:
640 continue
639 continue
641 except (KeyError, AttributeError):
640 except (KeyError, AttributeError):
642 # definition might not exist or it might not be a cmdalias
641 # definition might not exist or it might not be a cmdalias
643 pass
642 pass
644
643
645 source = ui.configsource('alias', alias)
644 source = ui.configsource('alias', alias)
646 entry = lazyaliasentry(ui, alias, definition, cmdtable, source)
645 entry = lazyaliasentry(ui, alias, definition, cmdtable, source)
647 cmdtable[alias] = entry
646 cmdtable[alias] = entry
648
647
649 def _parse(ui, args):
648 def _parse(ui, args):
650 options = {}
649 options = {}
651 cmdoptions = {}
650 cmdoptions = {}
652
651
653 try:
652 try:
654 args = fancyopts.fancyopts(args, commands.globalopts, options)
653 args = fancyopts.fancyopts(args, commands.globalopts, options)
655 except getopt.GetoptError as inst:
654 except getopt.GetoptError as inst:
656 raise error.CommandError(None, stringutil.forcebytestr(inst))
655 raise error.CommandError(None, stringutil.forcebytestr(inst))
657
656
658 if args:
657 if args:
659 cmd, args = args[0], args[1:]
658 cmd, args = args[0], args[1:]
660 aliases, entry = cmdutil.findcmd(cmd, commands.table,
659 aliases, entry = cmdutil.findcmd(cmd, commands.table,
661 ui.configbool("ui", "strict"))
660 ui.configbool("ui", "strict"))
662 cmd = aliases[0]
661 cmd = aliases[0]
663 args = aliasargs(entry[0], args)
662 args = aliasargs(entry[0], args)
664 defaults = ui.config("defaults", cmd)
663 defaults = ui.config("defaults", cmd)
665 if defaults:
664 if defaults:
666 args = pycompat.maplist(
665 args = pycompat.maplist(
667 util.expandpath, pycompat.shlexsplit(defaults)) + args
666 util.expandpath, pycompat.shlexsplit(defaults)) + args
668 c = list(entry[1])
667 c = list(entry[1])
669 else:
668 else:
670 cmd = None
669 cmd = None
671 c = []
670 c = []
672
671
673 # combine global options into local
672 # combine global options into local
674 for o in commands.globalopts:
673 for o in commands.globalopts:
675 c.append((o[0], o[1], options[o[1]], o[3]))
674 c.append((o[0], o[1], options[o[1]], o[3]))
676
675
677 try:
676 try:
678 args = fancyopts.fancyopts(args, c, cmdoptions, gnu=True)
677 args = fancyopts.fancyopts(args, c, cmdoptions, gnu=True)
679 except getopt.GetoptError as inst:
678 except getopt.GetoptError as inst:
680 raise error.CommandError(cmd, stringutil.forcebytestr(inst))
679 raise error.CommandError(cmd, stringutil.forcebytestr(inst))
681
680
682 # separate global options back out
681 # separate global options back out
683 for o in commands.globalopts:
682 for o in commands.globalopts:
684 n = o[1]
683 n = o[1]
685 options[n] = cmdoptions[n]
684 options[n] = cmdoptions[n]
686 del cmdoptions[n]
685 del cmdoptions[n]
687
686
688 return (cmd, cmd and entry[0] or None, args, options, cmdoptions)
687 return (cmd, cmd and entry[0] or None, args, options, cmdoptions)
689
688
690 def _parseconfig(ui, config):
689 def _parseconfig(ui, config):
691 """parse the --config options from the command line"""
690 """parse the --config options from the command line"""
692 configs = []
691 configs = []
693
692
694 for cfg in config:
693 for cfg in config:
695 try:
694 try:
696 name, value = [cfgelem.strip()
695 name, value = [cfgelem.strip()
697 for cfgelem in cfg.split('=', 1)]
696 for cfgelem in cfg.split('=', 1)]
698 section, name = name.split('.', 1)
697 section, name = name.split('.', 1)
699 if not section or not name:
698 if not section or not name:
700 raise IndexError
699 raise IndexError
701 ui.setconfig(section, name, value, '--config')
700 ui.setconfig(section, name, value, '--config')
702 configs.append((section, name, value))
701 configs.append((section, name, value))
703 except (IndexError, ValueError):
702 except (IndexError, ValueError):
704 raise error.Abort(_('malformed --config option: %r '
703 raise error.Abort(_('malformed --config option: %r '
705 '(use --config section.name=value)')
704 '(use --config section.name=value)')
706 % pycompat.bytestr(cfg))
705 % pycompat.bytestr(cfg))
707
706
708 return configs
707 return configs
709
708
710 def _earlyparseopts(ui, args):
709 def _earlyparseopts(ui, args):
711 options = {}
710 options = {}
712 fancyopts.fancyopts(args, commands.globalopts, options,
711 fancyopts.fancyopts(args, commands.globalopts, options,
713 gnu=not ui.plain('strictflags'), early=True,
712 gnu=not ui.plain('strictflags'), early=True,
714 optaliases={'repository': ['repo']})
713 optaliases={'repository': ['repo']})
715 return options
714 return options
716
715
717 def _earlysplitopts(args):
716 def _earlysplitopts(args):
718 """Split args into a list of possible early options and remainder args"""
717 """Split args into a list of possible early options and remainder args"""
719 shortoptions = 'R:'
718 shortoptions = 'R:'
720 # TODO: perhaps 'debugger' should be included
719 # TODO: perhaps 'debugger' should be included
721 longoptions = ['cwd=', 'repository=', 'repo=', 'config=']
720 longoptions = ['cwd=', 'repository=', 'repo=', 'config=']
722 return fancyopts.earlygetopt(args, shortoptions, longoptions,
721 return fancyopts.earlygetopt(args, shortoptions, longoptions,
723 gnu=True, keepsep=True)
722 gnu=True, keepsep=True)
724
723
725 def runcommand(lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions):
724 def runcommand(lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions):
726 # run pre-hook, and abort if it fails
725 # run pre-hook, and abort if it fails
727 hook.hook(lui, repo, "pre-%s" % cmd, True, args=" ".join(fullargs),
726 hook.hook(lui, repo, "pre-%s" % cmd, True, args=" ".join(fullargs),
728 pats=cmdpats, opts=cmdoptions)
727 pats=cmdpats, opts=cmdoptions)
729 try:
728 try:
730 ret = _runcommand(ui, options, cmd, d)
729 ret = _runcommand(ui, options, cmd, d)
731 # run post-hook, passing command result
730 # run post-hook, passing command result
732 hook.hook(lui, repo, "post-%s" % cmd, False, args=" ".join(fullargs),
731 hook.hook(lui, repo, "post-%s" % cmd, False, args=" ".join(fullargs),
733 result=ret, pats=cmdpats, opts=cmdoptions)
732 result=ret, pats=cmdpats, opts=cmdoptions)
734 except Exception:
733 except Exception:
735 # run failure hook and re-raise
734 # run failure hook and re-raise
736 hook.hook(lui, repo, "fail-%s" % cmd, False, args=" ".join(fullargs),
735 hook.hook(lui, repo, "fail-%s" % cmd, False, args=" ".join(fullargs),
737 pats=cmdpats, opts=cmdoptions)
736 pats=cmdpats, opts=cmdoptions)
738 raise
737 raise
739 return ret
738 return ret
740
739
741 def _getlocal(ui, rpath, wd=None):
740 def _getlocal(ui, rpath, wd=None):
742 """Return (path, local ui object) for the given target path.
741 """Return (path, local ui object) for the given target path.
743
742
744 Takes paths in [cwd]/.hg/hgrc into account."
743 Takes paths in [cwd]/.hg/hgrc into account."
745 """
744 """
746 if wd is None:
745 if wd is None:
747 try:
746 try:
748 wd = pycompat.getcwd()
747 wd = pycompat.getcwd()
749 except OSError as e:
748 except OSError as e:
750 raise error.Abort(_("error getting current working directory: %s") %
749 raise error.Abort(_("error getting current working directory: %s") %
751 encoding.strtolocal(e.strerror))
750 encoding.strtolocal(e.strerror))
752 path = cmdutil.findrepo(wd) or ""
751 path = cmdutil.findrepo(wd) or ""
753 if not path:
752 if not path:
754 lui = ui
753 lui = ui
755 else:
754 else:
756 lui = ui.copy()
755 lui = ui.copy()
757 lui.readconfig(os.path.join(path, ".hg", "hgrc"), path)
756 lui.readconfig(os.path.join(path, ".hg", "hgrc"), path)
758
757
759 if rpath:
758 if rpath:
760 path = lui.expandpath(rpath)
759 path = lui.expandpath(rpath)
761 lui = ui.copy()
760 lui = ui.copy()
762 lui.readconfig(os.path.join(path, ".hg", "hgrc"), path)
761 lui.readconfig(os.path.join(path, ".hg", "hgrc"), path)
763
762
764 return path, lui
763 return path, lui
765
764
766 def _checkshellalias(lui, ui, args):
765 def _checkshellalias(lui, ui, args):
767 """Return the function to run the shell alias, if it is required"""
766 """Return the function to run the shell alias, if it is required"""
768 options = {}
767 options = {}
769
768
770 try:
769 try:
771 args = fancyopts.fancyopts(args, commands.globalopts, options)
770 args = fancyopts.fancyopts(args, commands.globalopts, options)
772 except getopt.GetoptError:
771 except getopt.GetoptError:
773 return
772 return
774
773
775 if not args:
774 if not args:
776 return
775 return
777
776
778 cmdtable = commands.table
777 cmdtable = commands.table
779
778
780 cmd = args[0]
779 cmd = args[0]
781 try:
780 try:
782 strict = ui.configbool("ui", "strict")
781 strict = ui.configbool("ui", "strict")
783 aliases, entry = cmdutil.findcmd(cmd, cmdtable, strict)
782 aliases, entry = cmdutil.findcmd(cmd, cmdtable, strict)
784 except (error.AmbiguousCommand, error.UnknownCommand):
783 except (error.AmbiguousCommand, error.UnknownCommand):
785 return
784 return
786
785
787 cmd = aliases[0]
786 cmd = aliases[0]
788 fn = entry[0]
787 fn = entry[0]
789
788
790 if cmd and util.safehasattr(fn, 'shell'):
789 if cmd and util.safehasattr(fn, 'shell'):
791 # shell alias shouldn't receive early options which are consumed by hg
790 # shell alias shouldn't receive early options which are consumed by hg
792 _earlyopts, args = _earlysplitopts(args)
791 _earlyopts, args = _earlysplitopts(args)
793 d = lambda: fn(ui, *args[1:])
792 d = lambda: fn(ui, *args[1:])
794 return lambda: runcommand(lui, None, cmd, args[:1], ui, options, d,
793 return lambda: runcommand(lui, None, cmd, args[:1], ui, options, d,
795 [], {})
794 [], {})
796
795
797 def _dispatch(req):
796 def _dispatch(req):
798 args = req.args
797 args = req.args
799 ui = req.ui
798 ui = req.ui
800
799
801 # check for cwd
800 # check for cwd
802 cwd = req.earlyoptions['cwd']
801 cwd = req.earlyoptions['cwd']
803 if cwd:
802 if cwd:
804 os.chdir(cwd)
803 os.chdir(cwd)
805
804
806 rpath = req.earlyoptions['repository']
805 rpath = req.earlyoptions['repository']
807 path, lui = _getlocal(ui, rpath)
806 path, lui = _getlocal(ui, rpath)
808
807
809 uis = {ui, lui}
808 uis = {ui, lui}
810
809
811 if req.repo:
810 if req.repo:
812 uis.add(req.repo.ui)
811 uis.add(req.repo.ui)
813
812
814 if (req.earlyoptions['verbose'] or req.earlyoptions['debug']
813 if (req.earlyoptions['verbose'] or req.earlyoptions['debug']
815 or req.earlyoptions['quiet']):
814 or req.earlyoptions['quiet']):
816 for opt in ('verbose', 'debug', 'quiet'):
815 for opt in ('verbose', 'debug', 'quiet'):
817 val = pycompat.bytestr(bool(req.earlyoptions[opt]))
816 val = pycompat.bytestr(bool(req.earlyoptions[opt]))
818 for ui_ in uis:
817 for ui_ in uis:
819 ui_.setconfig('ui', opt, val, '--' + opt)
818 ui_.setconfig('ui', opt, val, '--' + opt)
820
819
821 if req.earlyoptions['profile']:
820 if req.earlyoptions['profile']:
822 for ui_ in uis:
821 for ui_ in uis:
823 ui_.setconfig('profiling', 'enabled', 'true', '--profile')
822 ui_.setconfig('profiling', 'enabled', 'true', '--profile')
824
823
825 profile = lui.configbool('profiling', 'enabled')
824 profile = lui.configbool('profiling', 'enabled')
826 with profiling.profile(lui, enabled=profile) as profiler:
825 with profiling.profile(lui, enabled=profile) as profiler:
827 # Configure extensions in phases: uisetup, extsetup, cmdtable, and
826 # Configure extensions in phases: uisetup, extsetup, cmdtable, and
828 # reposetup
827 # reposetup
829 extensions.loadall(lui)
828 extensions.loadall(lui)
830 # Propagate any changes to lui.__class__ by extensions
829 # Propagate any changes to lui.__class__ by extensions
831 ui.__class__ = lui.__class__
830 ui.__class__ = lui.__class__
832
831
833 # (uisetup and extsetup are handled in extensions.loadall)
832 # (uisetup and extsetup are handled in extensions.loadall)
834
833
835 # (reposetup is handled in hg.repository)
834 # (reposetup is handled in hg.repository)
836
835
837 addaliases(lui, commands.table)
836 addaliases(lui, commands.table)
838
837
839 # All aliases and commands are completely defined, now.
838 # All aliases and commands are completely defined, now.
840 # Check abbreviation/ambiguity of shell alias.
839 # Check abbreviation/ambiguity of shell alias.
841 shellaliasfn = _checkshellalias(lui, ui, args)
840 shellaliasfn = _checkshellalias(lui, ui, args)
842 if shellaliasfn:
841 if shellaliasfn:
843 return shellaliasfn()
842 return shellaliasfn()
844
843
845 # check for fallback encoding
844 # check for fallback encoding
846 fallback = lui.config('ui', 'fallbackencoding')
845 fallback = lui.config('ui', 'fallbackencoding')
847 if fallback:
846 if fallback:
848 encoding.fallbackencoding = fallback
847 encoding.fallbackencoding = fallback
849
848
850 fullargs = args
849 fullargs = args
851 cmd, func, args, options, cmdoptions = _parse(lui, args)
850 cmd, func, args, options, cmdoptions = _parse(lui, args)
852
851
853 if options["config"] != req.earlyoptions["config"]:
852 if options["config"] != req.earlyoptions["config"]:
854 raise error.Abort(_("option --config may not be abbreviated!"))
853 raise error.Abort(_("option --config may not be abbreviated!"))
855 if options["cwd"] != req.earlyoptions["cwd"]:
854 if options["cwd"] != req.earlyoptions["cwd"]:
856 raise error.Abort(_("option --cwd may not be abbreviated!"))
855 raise error.Abort(_("option --cwd may not be abbreviated!"))
857 if options["repository"] != req.earlyoptions["repository"]:
856 if options["repository"] != req.earlyoptions["repository"]:
858 raise error.Abort(_(
857 raise error.Abort(_(
859 "option -R has to be separated from other options (e.g. not "
858 "option -R has to be separated from other options (e.g. not "
860 "-qR) and --repository may only be abbreviated as --repo!"))
859 "-qR) and --repository may only be abbreviated as --repo!"))
861 if options["debugger"] != req.earlyoptions["debugger"]:
860 if options["debugger"] != req.earlyoptions["debugger"]:
862 raise error.Abort(_("option --debugger may not be abbreviated!"))
861 raise error.Abort(_("option --debugger may not be abbreviated!"))
863 # don't validate --profile/--traceback, which can be enabled from now
862 # don't validate --profile/--traceback, which can be enabled from now
864
863
865 if options["encoding"]:
864 if options["encoding"]:
866 encoding.encoding = options["encoding"]
865 encoding.encoding = options["encoding"]
867 if options["encodingmode"]:
866 if options["encodingmode"]:
868 encoding.encodingmode = options["encodingmode"]
867 encoding.encodingmode = options["encodingmode"]
869 if options["time"]:
868 if options["time"]:
870 def get_times():
869 def get_times():
871 t = os.times()
870 t = os.times()
872 if t[4] == 0.0:
871 if t[4] == 0.0:
873 # Windows leaves this as zero, so use time.clock()
872 # Windows leaves this as zero, so use time.clock()
874 t = (t[0], t[1], t[2], t[3], time.clock())
873 t = (t[0], t[1], t[2], t[3], time.clock())
875 return t
874 return t
876 s = get_times()
875 s = get_times()
877 def print_time():
876 def print_time():
878 t = get_times()
877 t = get_times()
879 ui.warn(
878 ui.warn(
880 _("time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") %
879 _("time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") %
881 (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3]))
880 (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3]))
882 ui.atexit(print_time)
881 ui.atexit(print_time)
883 if options["profile"]:
882 if options["profile"]:
884 profiler.start()
883 profiler.start()
885
884
886 # if abbreviated version of this were used, take them in account, now
885 # if abbreviated version of this were used, take them in account, now
887 if options['verbose'] or options['debug'] or options['quiet']:
886 if options['verbose'] or options['debug'] or options['quiet']:
888 for opt in ('verbose', 'debug', 'quiet'):
887 for opt in ('verbose', 'debug', 'quiet'):
889 if options[opt] == req.earlyoptions[opt]:
888 if options[opt] == req.earlyoptions[opt]:
890 continue
889 continue
891 val = pycompat.bytestr(bool(options[opt]))
890 val = pycompat.bytestr(bool(options[opt]))
892 for ui_ in uis:
891 for ui_ in uis:
893 ui_.setconfig('ui', opt, val, '--' + opt)
892 ui_.setconfig('ui', opt, val, '--' + opt)
894
893
895 if options['traceback']:
894 if options['traceback']:
896 for ui_ in uis:
895 for ui_ in uis:
897 ui_.setconfig('ui', 'traceback', 'on', '--traceback')
896 ui_.setconfig('ui', 'traceback', 'on', '--traceback')
898
897
899 if options['noninteractive']:
898 if options['noninteractive']:
900 for ui_ in uis:
899 for ui_ in uis:
901 ui_.setconfig('ui', 'interactive', 'off', '-y')
900 ui_.setconfig('ui', 'interactive', 'off', '-y')
902
901
903 if cmdoptions.get('insecure', False):
902 if cmdoptions.get('insecure', False):
904 for ui_ in uis:
903 for ui_ in uis:
905 ui_.insecureconnections = True
904 ui_.insecureconnections = True
906
905
907 # setup color handling before pager, because setting up pager
906 # setup color handling before pager, because setting up pager
908 # might cause incorrect console information
907 # might cause incorrect console information
909 coloropt = options['color']
908 coloropt = options['color']
910 for ui_ in uis:
909 for ui_ in uis:
911 if coloropt:
910 if coloropt:
912 ui_.setconfig('ui', 'color', coloropt, '--color')
911 ui_.setconfig('ui', 'color', coloropt, '--color')
913 color.setup(ui_)
912 color.setup(ui_)
914
913
915 if stringutil.parsebool(options['pager']):
914 if stringutil.parsebool(options['pager']):
916 # ui.pager() expects 'internal-always-' prefix in this case
915 # ui.pager() expects 'internal-always-' prefix in this case
917 ui.pager('internal-always-' + cmd)
916 ui.pager('internal-always-' + cmd)
918 elif options['pager'] != 'auto':
917 elif options['pager'] != 'auto':
919 for ui_ in uis:
918 for ui_ in uis:
920 ui_.disablepager()
919 ui_.disablepager()
921
920
922 if options['version']:
921 if options['version']:
923 return commands.version_(ui)
922 return commands.version_(ui)
924 if options['help']:
923 if options['help']:
925 return commands.help_(ui, cmd, command=cmd is not None)
924 return commands.help_(ui, cmd, command=cmd is not None)
926 elif not cmd:
925 elif not cmd:
927 return commands.help_(ui, 'shortlist')
926 return commands.help_(ui, 'shortlist')
928
927
929 repo = None
928 repo = None
930 cmdpats = args[:]
929 cmdpats = args[:]
931 if not func.norepo:
930 if not func.norepo:
932 # use the repo from the request only if we don't have -R
931 # use the repo from the request only if we don't have -R
933 if not rpath and not cwd:
932 if not rpath and not cwd:
934 repo = req.repo
933 repo = req.repo
935
934
936 if repo:
935 if repo:
937 # set the descriptors of the repo ui to those of ui
936 # set the descriptors of the repo ui to those of ui
938 repo.ui.fin = ui.fin
937 repo.ui.fin = ui.fin
939 repo.ui.fout = ui.fout
938 repo.ui.fout = ui.fout
940 repo.ui.ferr = ui.ferr
939 repo.ui.ferr = ui.ferr
941 else:
940 else:
942 try:
941 try:
943 repo = hg.repository(ui, path=path,
942 repo = hg.repository(ui, path=path,
944 presetupfuncs=req.prereposetups,
943 presetupfuncs=req.prereposetups,
945 intents=func.intents)
944 intents=func.intents)
946 if not repo.local():
945 if not repo.local():
947 raise error.Abort(_("repository '%s' is not local")
946 raise error.Abort(_("repository '%s' is not local")
948 % path)
947 % path)
949 repo.ui.setconfig("bundle", "mainreporoot", repo.root,
948 repo.ui.setconfig("bundle", "mainreporoot", repo.root,
950 'repo')
949 'repo')
951 except error.RequirementError:
950 except error.RequirementError:
952 raise
951 raise
953 except error.RepoError:
952 except error.RepoError:
954 if rpath: # invalid -R path
953 if rpath: # invalid -R path
955 raise
954 raise
956 if not func.optionalrepo:
955 if not func.optionalrepo:
957 if func.inferrepo and args and not path:
956 if func.inferrepo and args and not path:
958 # try to infer -R from command args
957 # try to infer -R from command args
959 repos = pycompat.maplist(cmdutil.findrepo, args)
958 repos = pycompat.maplist(cmdutil.findrepo, args)
960 guess = repos[0]
959 guess = repos[0]
961 if guess and repos.count(guess) == len(repos):
960 if guess and repos.count(guess) == len(repos):
962 req.args = ['--repository', guess] + fullargs
961 req.args = ['--repository', guess] + fullargs
963 req.earlyoptions['repository'] = guess
962 req.earlyoptions['repository'] = guess
964 return _dispatch(req)
963 return _dispatch(req)
965 if not path:
964 if not path:
966 raise error.RepoError(_("no repository found in"
965 raise error.RepoError(_("no repository found in"
967 " '%s' (.hg not found)")
966 " '%s' (.hg not found)")
968 % pycompat.getcwd())
967 % pycompat.getcwd())
969 raise
968 raise
970 if repo:
969 if repo:
971 ui = repo.ui
970 ui = repo.ui
972 if options['hidden']:
971 if options['hidden']:
973 repo = repo.unfiltered()
972 repo = repo.unfiltered()
974 args.insert(0, repo)
973 args.insert(0, repo)
975 elif rpath:
974 elif rpath:
976 ui.warn(_("warning: --repository ignored\n"))
975 ui.warn(_("warning: --repository ignored\n"))
977
976
978 msg = _formatargs(fullargs)
977 msg = _formatargs(fullargs)
979 ui.log("command", '%s\n', msg)
978 ui.log("command", '%s\n', msg)
980 strcmdopt = pycompat.strkwargs(cmdoptions)
979 strcmdopt = pycompat.strkwargs(cmdoptions)
981 d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
980 d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
982 try:
981 try:
983 return runcommand(lui, repo, cmd, fullargs, ui, options, d,
982 return runcommand(lui, repo, cmd, fullargs, ui, options, d,
984 cmdpats, cmdoptions)
983 cmdpats, cmdoptions)
985 finally:
984 finally:
986 if repo and repo != req.repo:
985 if repo and repo != req.repo:
987 repo.close()
986 repo.close()
988
987
989 def _runcommand(ui, options, cmd, cmdfunc):
988 def _runcommand(ui, options, cmd, cmdfunc):
990 """Run a command function, possibly with profiling enabled."""
989 """Run a command function, possibly with profiling enabled."""
991 try:
990 try:
992 return cmdfunc()
991 return cmdfunc()
993 except error.SignatureError:
992 except error.SignatureError:
994 raise error.CommandError(cmd, _('invalid arguments'))
993 raise error.CommandError(cmd, _('invalid arguments'))
995
994
996 def _exceptionwarning(ui):
995 def _exceptionwarning(ui):
997 """Produce a warning message for the current active exception"""
996 """Produce a warning message for the current active exception"""
998
997
999 # For compatibility checking, we discard the portion of the hg
998 # For compatibility checking, we discard the portion of the hg
1000 # version after the + on the assumption that if a "normal
999 # version after the + on the assumption that if a "normal
1001 # user" is running a build with a + in it the packager
1000 # user" is running a build with a + in it the packager
1002 # probably built from fairly close to a tag and anyone with a
1001 # probably built from fairly close to a tag and anyone with a
1003 # 'make local' copy of hg (where the version number can be out
1002 # 'make local' copy of hg (where the version number can be out
1004 # of date) will be clueful enough to notice the implausible
1003 # of date) will be clueful enough to notice the implausible
1005 # version number and try updating.
1004 # version number and try updating.
1006 ct = util.versiontuple(n=2)
1005 ct = util.versiontuple(n=2)
1007 worst = None, ct, ''
1006 worst = None, ct, ''
1008 if ui.config('ui', 'supportcontact') is None:
1007 if ui.config('ui', 'supportcontact') is None:
1009 for name, mod in extensions.extensions():
1008 for name, mod in extensions.extensions():
1010 # 'testedwith' should be bytes, but not all extensions are ported
1009 # 'testedwith' should be bytes, but not all extensions are ported
1011 # to py3 and we don't want UnicodeException because of that.
1010 # to py3 and we don't want UnicodeException because of that.
1012 testedwith = stringutil.forcebytestr(getattr(mod, 'testedwith', ''))
1011 testedwith = stringutil.forcebytestr(getattr(mod, 'testedwith', ''))
1013 report = getattr(mod, 'buglink', _('the extension author.'))
1012 report = getattr(mod, 'buglink', _('the extension author.'))
1014 if not testedwith.strip():
1013 if not testedwith.strip():
1015 # We found an untested extension. It's likely the culprit.
1014 # We found an untested extension. It's likely the culprit.
1016 worst = name, 'unknown', report
1015 worst = name, 'unknown', report
1017 break
1016 break
1018
1017
1019 # Never blame on extensions bundled with Mercurial.
1018 # Never blame on extensions bundled with Mercurial.
1020 if extensions.ismoduleinternal(mod):
1019 if extensions.ismoduleinternal(mod):
1021 continue
1020 continue
1022
1021
1023 tested = [util.versiontuple(t, 2) for t in testedwith.split()]
1022 tested = [util.versiontuple(t, 2) for t in testedwith.split()]
1024 if ct in tested:
1023 if ct in tested:
1025 continue
1024 continue
1026
1025
1027 lower = [t for t in tested if t < ct]
1026 lower = [t for t in tested if t < ct]
1028 nearest = max(lower or tested)
1027 nearest = max(lower or tested)
1029 if worst[0] is None or nearest < worst[1]:
1028 if worst[0] is None or nearest < worst[1]:
1030 worst = name, nearest, report
1029 worst = name, nearest, report
1031 if worst[0] is not None:
1030 if worst[0] is not None:
1032 name, testedwith, report = worst
1031 name, testedwith, report = worst
1033 if not isinstance(testedwith, (bytes, str)):
1032 if not isinstance(testedwith, (bytes, str)):
1034 testedwith = '.'.join([stringutil.forcebytestr(c)
1033 testedwith = '.'.join([stringutil.forcebytestr(c)
1035 for c in testedwith])
1034 for c in testedwith])
1036 warning = (_('** Unknown exception encountered with '
1035 warning = (_('** Unknown exception encountered with '
1037 'possibly-broken third-party extension %s\n'
1036 'possibly-broken third-party extension %s\n'
1038 '** which supports versions %s of Mercurial.\n'
1037 '** which supports versions %s of Mercurial.\n'
1039 '** Please disable %s and try your action again.\n'
1038 '** Please disable %s and try your action again.\n'
1040 '** If that fixes the bug please report it to %s\n')
1039 '** If that fixes the bug please report it to %s\n')
1041 % (name, testedwith, name, stringutil.forcebytestr(report)))
1040 % (name, testedwith, name, stringutil.forcebytestr(report)))
1042 else:
1041 else:
1043 bugtracker = ui.config('ui', 'supportcontact')
1042 bugtracker = ui.config('ui', 'supportcontact')
1044 if bugtracker is None:
1043 if bugtracker is None:
1045 bugtracker = _("https://mercurial-scm.org/wiki/BugTracker")
1044 bugtracker = _("https://mercurial-scm.org/wiki/BugTracker")
1046 warning = (_("** unknown exception encountered, "
1045 warning = (_("** unknown exception encountered, "
1047 "please report by visiting\n** ") + bugtracker + '\n')
1046 "please report by visiting\n** ") + bugtracker + '\n')
1048 sysversion = pycompat.sysbytes(sys.version).replace('\n', '')
1047 sysversion = pycompat.sysbytes(sys.version).replace('\n', '')
1049 warning += ((_("** Python %s\n") % sysversion) +
1048 warning += ((_("** Python %s\n") % sysversion) +
1050 (_("** Mercurial Distributed SCM (version %s)\n") %
1049 (_("** Mercurial Distributed SCM (version %s)\n") %
1051 util.version()) +
1050 util.version()) +
1052 (_("** Extensions loaded: %s\n") %
1051 (_("** Extensions loaded: %s\n") %
1053 ", ".join([x[0] for x in extensions.extensions()])))
1052 ", ".join([x[0] for x in extensions.extensions()])))
1054 return warning
1053 return warning
1055
1054
1056 def handlecommandexception(ui):
1055 def handlecommandexception(ui):
1057 """Produce a warning message for broken commands
1056 """Produce a warning message for broken commands
1058
1057
1059 Called when handling an exception; the exception is reraised if
1058 Called when handling an exception; the exception is reraised if
1060 this function returns False, ignored otherwise.
1059 this function returns False, ignored otherwise.
1061 """
1060 """
1062 warning = _exceptionwarning(ui)
1061 warning = _exceptionwarning(ui)
1063 ui.log("commandexception", "%s\n%s\n", warning,
1062 ui.log("commandexception", "%s\n%s\n", warning,
1064 pycompat.sysbytes(traceback.format_exc()))
1063 pycompat.sysbytes(traceback.format_exc()))
1065 ui.warn(warning)
1064 ui.warn(warning)
1066 return False # re-raise the exception
1065 return False # re-raise the exception
@@ -1,1752 +1,1753 b''
1 Test basic extension support
1 Test basic extension support
2
2
3 $ cat > foobar.py <<EOF
3 $ cat > foobar.py <<EOF
4 > import os
4 > import os
5 > from mercurial import commands, registrar
5 > from mercurial import commands, registrar
6 > cmdtable = {}
6 > cmdtable = {}
7 > command = registrar.command(cmdtable)
7 > command = registrar.command(cmdtable)
8 > configtable = {}
8 > configtable = {}
9 > configitem = registrar.configitem(configtable)
9 > configitem = registrar.configitem(configtable)
10 > configitem(b'tests', b'foo', default=b"Foo")
10 > configitem(b'tests', b'foo', default=b"Foo")
11 > def uisetup(ui):
11 > def uisetup(ui):
12 > ui.debug(b"uisetup called [debug]\\n")
12 > ui.debug(b"uisetup called [debug]\\n")
13 > ui.write(b"uisetup called\\n")
13 > ui.write(b"uisetup called\\n")
14 > ui.status(b"uisetup called [status]\\n")
14 > ui.status(b"uisetup called [status]\\n")
15 > ui.flush()
15 > ui.flush()
16 > def reposetup(ui, repo):
16 > def reposetup(ui, repo):
17 > ui.write(b"reposetup called for %s\\n" % os.path.basename(repo.root))
17 > ui.write(b"reposetup called for %s\\n" % os.path.basename(repo.root))
18 > ui.write(b"ui %s= repo.ui\\n" % (ui == repo.ui and b"=" or b"!"))
18 > ui.write(b"ui %s= repo.ui\\n" % (ui == repo.ui and b"=" or b"!"))
19 > ui.flush()
19 > ui.flush()
20 > @command(b'foo', [], b'hg foo')
20 > @command(b'foo', [], b'hg foo')
21 > def foo(ui, *args, **kwargs):
21 > def foo(ui, *args, **kwargs):
22 > foo = ui.config(b'tests', b'foo')
22 > foo = ui.config(b'tests', b'foo')
23 > ui.write(foo)
23 > ui.write(foo)
24 > ui.write(b"\\n")
24 > ui.write(b"\\n")
25 > @command(b'bar', [], b'hg bar', norepo=True)
25 > @command(b'bar', [], b'hg bar', norepo=True)
26 > def bar(ui, *args, **kwargs):
26 > def bar(ui, *args, **kwargs):
27 > ui.write(b"Bar\\n")
27 > ui.write(b"Bar\\n")
28 > EOF
28 > EOF
29 $ abspath=`pwd`/foobar.py
29 $ abspath=`pwd`/foobar.py
30
30
31 $ mkdir barfoo
31 $ mkdir barfoo
32 $ cp foobar.py barfoo/__init__.py
32 $ cp foobar.py barfoo/__init__.py
33 $ barfoopath=`pwd`/barfoo
33 $ barfoopath=`pwd`/barfoo
34
34
35 $ hg init a
35 $ hg init a
36 $ cd a
36 $ cd a
37 $ echo foo > file
37 $ echo foo > file
38 $ hg add file
38 $ hg add file
39 $ hg commit -m 'add file'
39 $ hg commit -m 'add file'
40
40
41 $ echo '[extensions]' >> $HGRCPATH
41 $ echo '[extensions]' >> $HGRCPATH
42 $ echo "foobar = $abspath" >> $HGRCPATH
42 $ echo "foobar = $abspath" >> $HGRCPATH
43 $ hg foo
43 $ hg foo
44 uisetup called
44 uisetup called
45 uisetup called [status]
45 uisetup called [status]
46 reposetup called for a
46 reposetup called for a
47 ui == repo.ui
47 ui == repo.ui
48 reposetup called for a (chg !)
48 reposetup called for a (chg !)
49 ui == repo.ui (chg !)
49 ui == repo.ui (chg !)
50 Foo
50 Foo
51 $ hg foo --quiet
51 $ hg foo --quiet
52 uisetup called (no-chg !)
52 uisetup called (no-chg !)
53 reposetup called for a (chg !)
53 reposetup called for a (chg !)
54 ui == repo.ui
54 ui == repo.ui
55 Foo
55 Foo
56 $ hg foo --debug
56 $ hg foo --debug
57 uisetup called [debug] (no-chg !)
57 uisetup called [debug] (no-chg !)
58 uisetup called (no-chg !)
58 uisetup called (no-chg !)
59 uisetup called [status] (no-chg !)
59 uisetup called [status] (no-chg !)
60 reposetup called for a (chg !)
60 reposetup called for a (chg !)
61 ui == repo.ui
61 ui == repo.ui
62 Foo
62 Foo
63
63
64 $ cd ..
64 $ cd ..
65 $ hg clone a b
65 $ hg clone a b
66 uisetup called (no-chg !)
66 uisetup called (no-chg !)
67 uisetup called [status] (no-chg !)
67 uisetup called [status] (no-chg !)
68 reposetup called for a
68 reposetup called for a
69 ui == repo.ui
69 ui == repo.ui
70 reposetup called for b
70 reposetup called for b
71 ui == repo.ui
71 ui == repo.ui
72 updating to branch default
72 updating to branch default
73 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
74
74
75 $ hg bar
75 $ hg bar
76 uisetup called (no-chg !)
76 uisetup called (no-chg !)
77 uisetup called [status] (no-chg !)
77 uisetup called [status] (no-chg !)
78 Bar
78 Bar
79 $ echo 'foobar = !' >> $HGRCPATH
79 $ echo 'foobar = !' >> $HGRCPATH
80
80
81 module/__init__.py-style
81 module/__init__.py-style
82
82
83 $ echo "barfoo = $barfoopath" >> $HGRCPATH
83 $ echo "barfoo = $barfoopath" >> $HGRCPATH
84 $ cd a
84 $ cd a
85 $ hg foo
85 $ hg foo
86 uisetup called
86 uisetup called
87 uisetup called [status]
87 uisetup called [status]
88 reposetup called for a
88 reposetup called for a
89 ui == repo.ui
89 ui == repo.ui
90 reposetup called for a (chg !)
90 reposetup called for a (chg !)
91 ui == repo.ui (chg !)
91 ui == repo.ui (chg !)
92 Foo
92 Foo
93 $ echo 'barfoo = !' >> $HGRCPATH
93 $ echo 'barfoo = !' >> $HGRCPATH
94
94
95 Check that extensions are loaded in phases:
95 Check that extensions are loaded in phases:
96
96
97 $ cat > foo.py <<EOF
97 $ cat > foo.py <<EOF
98 > import os
98 > import os
99 > name = os.path.basename(__file__).rsplit('.', 1)[0]
99 > name = os.path.basename(__file__).rsplit('.', 1)[0]
100 > print("1) %s imported" % name)
100 > print("1) %s imported" % name)
101 > def uisetup(ui):
101 > def uisetup(ui):
102 > print("2) %s uisetup" % name)
102 > print("2) %s uisetup" % name)
103 > def extsetup():
103 > def extsetup():
104 > print("3) %s extsetup" % name)
104 > print("3) %s extsetup" % name)
105 > def reposetup(ui, repo):
105 > def reposetup(ui, repo):
106 > print("4) %s reposetup" % name)
106 > print("4) %s reposetup" % name)
107 >
107 >
108 > # custom predicate to check registration of functions at loading
108 > # custom predicate to check registration of functions at loading
109 > from mercurial import (
109 > from mercurial import (
110 > registrar,
110 > registrar,
111 > smartset,
111 > smartset,
112 > )
112 > )
113 > revsetpredicate = registrar.revsetpredicate()
113 > revsetpredicate = registrar.revsetpredicate()
114 > @revsetpredicate(name, safe=True) # safe=True for query via hgweb
114 > @revsetpredicate(name, safe=True) # safe=True for query via hgweb
115 > def custompredicate(repo, subset, x):
115 > def custompredicate(repo, subset, x):
116 > return smartset.baseset([r for r in subset if r in {0}])
116 > return smartset.baseset([r for r in subset if r in {0}])
117 > EOF
117 > EOF
118
118
119 $ cp foo.py bar.py
119 $ cp foo.py bar.py
120 $ echo 'foo = foo.py' >> $HGRCPATH
120 $ echo 'foo = foo.py' >> $HGRCPATH
121 $ echo 'bar = bar.py' >> $HGRCPATH
121 $ echo 'bar = bar.py' >> $HGRCPATH
122
122
123 Check normal command's load order of extensions and registration of functions
123 Check normal command's load order of extensions and registration of functions
124
124
125 $ hg log -r "foo() and bar()" -q
125 $ hg log -r "foo() and bar()" -q
126 1) foo imported
126 1) foo imported
127 1) bar imported
127 1) bar imported
128 2) foo uisetup
128 2) foo uisetup
129 2) bar uisetup
129 2) bar uisetup
130 3) foo extsetup
130 3) foo extsetup
131 3) bar extsetup
131 3) bar extsetup
132 4) foo reposetup
132 4) foo reposetup
133 4) bar reposetup
133 4) bar reposetup
134 0:c24b9ac61126
134 0:c24b9ac61126
135
135
136 Check hgweb's load order of extensions and registration of functions
136 Check hgweb's load order of extensions and registration of functions
137
137
138 $ cat > hgweb.cgi <<EOF
138 $ cat > hgweb.cgi <<EOF
139 > #!$PYTHON
139 > #!$PYTHON
140 > from mercurial import demandimport; demandimport.enable()
140 > from mercurial import demandimport; demandimport.enable()
141 > from mercurial.hgweb import hgweb
141 > from mercurial.hgweb import hgweb
142 > from mercurial.hgweb import wsgicgi
142 > from mercurial.hgweb import wsgicgi
143 > application = hgweb('.', 'test repo')
143 > application = hgweb('.', 'test repo')
144 > wsgicgi.launch(application)
144 > wsgicgi.launch(application)
145 > EOF
145 > EOF
146 $ . "$TESTDIR/cgienv"
146 $ . "$TESTDIR/cgienv"
147
147
148 $ PATH_INFO='/' SCRIPT_NAME='' $PYTHON hgweb.cgi \
148 $ PATH_INFO='/' SCRIPT_NAME='' $PYTHON hgweb.cgi \
149 > | grep '^[0-9]) ' # ignores HTML output
149 > | grep '^[0-9]) ' # ignores HTML output
150 1) foo imported
150 1) foo imported
151 1) bar imported
151 1) bar imported
152 2) foo uisetup
152 2) foo uisetup
153 2) bar uisetup
153 2) bar uisetup
154 3) foo extsetup
154 3) foo extsetup
155 3) bar extsetup
155 3) bar extsetup
156 4) foo reposetup
156 4) foo reposetup
157 4) bar reposetup
157 4) bar reposetup
158
158
159 (check that revset predicate foo() and bar() are available)
159 (check that revset predicate foo() and bar() are available)
160
160
161 #if msys
161 #if msys
162 $ PATH_INFO='//shortlog'
162 $ PATH_INFO='//shortlog'
163 #else
163 #else
164 $ PATH_INFO='/shortlog'
164 $ PATH_INFO='/shortlog'
165 #endif
165 #endif
166 $ export PATH_INFO
166 $ export PATH_INFO
167 $ SCRIPT_NAME='' QUERY_STRING='rev=foo() and bar()' $PYTHON hgweb.cgi \
167 $ SCRIPT_NAME='' QUERY_STRING='rev=foo() and bar()' $PYTHON hgweb.cgi \
168 > | grep '<a href="/rev/[0-9a-z]*">'
168 > | grep '<a href="/rev/[0-9a-z]*">'
169 <a href="/rev/c24b9ac61126">add file</a>
169 <a href="/rev/c24b9ac61126">add file</a>
170
170
171 $ echo 'foo = !' >> $HGRCPATH
171 $ echo 'foo = !' >> $HGRCPATH
172 $ echo 'bar = !' >> $HGRCPATH
172 $ echo 'bar = !' >> $HGRCPATH
173
173
174 Check "from __future__ import absolute_import" support for external libraries
174 Check "from __future__ import absolute_import" support for external libraries
175
175
176 #if windows
176 #if windows
177 $ PATHSEP=";"
177 $ PATHSEP=";"
178 #else
178 #else
179 $ PATHSEP=":"
179 $ PATHSEP=":"
180 #endif
180 #endif
181 $ export PATHSEP
181 $ export PATHSEP
182
182
183 $ mkdir $TESTTMP/libroot
183 $ mkdir $TESTTMP/libroot
184 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
184 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
185 $ mkdir $TESTTMP/libroot/mod
185 $ mkdir $TESTTMP/libroot/mod
186 $ touch $TESTTMP/libroot/mod/__init__.py
186 $ touch $TESTTMP/libroot/mod/__init__.py
187 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
187 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
188
188
189 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<EOF
189 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<EOF
190 > from __future__ import absolute_import
190 > from __future__ import absolute_import
191 > import ambig # should load "libroot/ambig.py"
191 > import ambig # should load "libroot/ambig.py"
192 > s = ambig.s
192 > s = ambig.s
193 > EOF
193 > EOF
194 $ cat > loadabs.py <<EOF
194 $ cat > loadabs.py <<EOF
195 > import mod.ambigabs as ambigabs
195 > import mod.ambigabs as ambigabs
196 > def extsetup():
196 > def extsetup():
197 > print('ambigabs.s=%s' % ambigabs.s)
197 > print('ambigabs.s=%s' % ambigabs.s)
198 > EOF
198 > EOF
199 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
199 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
200 ambigabs.s=libroot/ambig.py
200 ambigabs.s=libroot/ambig.py
201 $TESTTMP/a
201 $TESTTMP/a
202
202
203 #if no-py3k
203 #if no-py3k
204 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF
204 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<EOF
205 > import ambig # should load "libroot/mod/ambig.py"
205 > import ambig # should load "libroot/mod/ambig.py"
206 > s = ambig.s
206 > s = ambig.s
207 > EOF
207 > EOF
208 $ cat > loadrel.py <<EOF
208 $ cat > loadrel.py <<EOF
209 > import mod.ambigrel as ambigrel
209 > import mod.ambigrel as ambigrel
210 > def extsetup():
210 > def extsetup():
211 > print('ambigrel.s=%s' % ambigrel.s)
211 > print('ambigrel.s=%s' % ambigrel.s)
212 > EOF
212 > EOF
213 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
213 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
214 ambigrel.s=libroot/mod/ambig.py
214 ambigrel.s=libroot/mod/ambig.py
215 $TESTTMP/a
215 $TESTTMP/a
216 #endif
216 #endif
217
217
218 Check absolute/relative import of extension specific modules
218 Check absolute/relative import of extension specific modules
219
219
220 $ mkdir $TESTTMP/extroot
220 $ mkdir $TESTTMP/extroot
221 $ cat > $TESTTMP/extroot/bar.py <<EOF
221 $ cat > $TESTTMP/extroot/bar.py <<EOF
222 > s = 'this is extroot.bar'
222 > s = 'this is extroot.bar'
223 > EOF
223 > EOF
224 $ mkdir $TESTTMP/extroot/sub1
224 $ mkdir $TESTTMP/extroot/sub1
225 $ cat > $TESTTMP/extroot/sub1/__init__.py <<EOF
225 $ cat > $TESTTMP/extroot/sub1/__init__.py <<EOF
226 > s = 'this is extroot.sub1.__init__'
226 > s = 'this is extroot.sub1.__init__'
227 > EOF
227 > EOF
228 $ cat > $TESTTMP/extroot/sub1/baz.py <<EOF
228 $ cat > $TESTTMP/extroot/sub1/baz.py <<EOF
229 > s = 'this is extroot.sub1.baz'
229 > s = 'this is extroot.sub1.baz'
230 > EOF
230 > EOF
231 $ cat > $TESTTMP/extroot/__init__.py <<EOF
231 $ cat > $TESTTMP/extroot/__init__.py <<EOF
232 > s = 'this is extroot.__init__'
232 > s = 'this is extroot.__init__'
233 > import foo
233 > import foo
234 > def extsetup(ui):
234 > def extsetup(ui):
235 > ui.write('(extroot) ', foo.func(), '\n')
235 > ui.write('(extroot) ', foo.func(), '\n')
236 > ui.flush()
236 > ui.flush()
237 > EOF
237 > EOF
238
238
239 $ cat > $TESTTMP/extroot/foo.py <<EOF
239 $ cat > $TESTTMP/extroot/foo.py <<EOF
240 > # test absolute import
240 > # test absolute import
241 > buf = []
241 > buf = []
242 > def func():
242 > def func():
243 > # "not locals" case
243 > # "not locals" case
244 > import extroot.bar
244 > import extroot.bar
245 > buf.append('import extroot.bar in func(): %s' % extroot.bar.s)
245 > buf.append('import extroot.bar in func(): %s' % extroot.bar.s)
246 > return '\n(extroot) '.join(buf)
246 > return '\n(extroot) '.join(buf)
247 > # "fromlist == ('*',)" case
247 > # "fromlist == ('*',)" case
248 > from extroot.bar import *
248 > from extroot.bar import *
249 > buf.append('from extroot.bar import *: %s' % s)
249 > buf.append('from extroot.bar import *: %s' % s)
250 > # "not fromlist" and "if '.' in name" case
250 > # "not fromlist" and "if '.' in name" case
251 > import extroot.sub1.baz
251 > import extroot.sub1.baz
252 > buf.append('import extroot.sub1.baz: %s' % extroot.sub1.baz.s)
252 > buf.append('import extroot.sub1.baz: %s' % extroot.sub1.baz.s)
253 > # "not fromlist" and NOT "if '.' in name" case
253 > # "not fromlist" and NOT "if '.' in name" case
254 > import extroot
254 > import extroot
255 > buf.append('import extroot: %s' % extroot.s)
255 > buf.append('import extroot: %s' % extroot.s)
256 > # NOT "not fromlist" and NOT "level != -1" case
256 > # NOT "not fromlist" and NOT "level != -1" case
257 > from extroot.bar import s
257 > from extroot.bar import s
258 > buf.append('from extroot.bar import s: %s' % s)
258 > buf.append('from extroot.bar import s: %s' % s)
259 > EOF
259 > EOF
260 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.extroot=$TESTTMP/extroot root)
260 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.extroot=$TESTTMP/extroot root)
261 (extroot) from extroot.bar import *: this is extroot.bar
261 (extroot) from extroot.bar import *: this is extroot.bar
262 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
262 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
263 (extroot) import extroot: this is extroot.__init__
263 (extroot) import extroot: this is extroot.__init__
264 (extroot) from extroot.bar import s: this is extroot.bar
264 (extroot) from extroot.bar import s: this is extroot.bar
265 (extroot) import extroot.bar in func(): this is extroot.bar
265 (extroot) import extroot.bar in func(): this is extroot.bar
266 $TESTTMP/a
266 $TESTTMP/a
267
267
268 #if no-py3k
268 #if no-py3k
269 $ rm "$TESTTMP"/extroot/foo.*
269 $ rm "$TESTTMP"/extroot/foo.*
270 $ rm -Rf "$TESTTMP/extroot/__pycache__"
270 $ rm -Rf "$TESTTMP/extroot/__pycache__"
271 $ cat > $TESTTMP/extroot/foo.py <<EOF
271 $ cat > $TESTTMP/extroot/foo.py <<EOF
272 > # test relative import
272 > # test relative import
273 > buf = []
273 > buf = []
274 > def func():
274 > def func():
275 > # "not locals" case
275 > # "not locals" case
276 > import bar
276 > import bar
277 > buf.append('import bar in func(): %s' % bar.s)
277 > buf.append('import bar in func(): %s' % bar.s)
278 > return '\n(extroot) '.join(buf)
278 > return '\n(extroot) '.join(buf)
279 > # "fromlist == ('*',)" case
279 > # "fromlist == ('*',)" case
280 > from bar import *
280 > from bar import *
281 > buf.append('from bar import *: %s' % s)
281 > buf.append('from bar import *: %s' % s)
282 > # "not fromlist" and "if '.' in name" case
282 > # "not fromlist" and "if '.' in name" case
283 > import sub1.baz
283 > import sub1.baz
284 > buf.append('import sub1.baz: %s' % sub1.baz.s)
284 > buf.append('import sub1.baz: %s' % sub1.baz.s)
285 > # "not fromlist" and NOT "if '.' in name" case
285 > # "not fromlist" and NOT "if '.' in name" case
286 > import sub1
286 > import sub1
287 > buf.append('import sub1: %s' % sub1.s)
287 > buf.append('import sub1: %s' % sub1.s)
288 > # NOT "not fromlist" and NOT "level != -1" case
288 > # NOT "not fromlist" and NOT "level != -1" case
289 > from bar import s
289 > from bar import s
290 > buf.append('from bar import s: %s' % s)
290 > buf.append('from bar import s: %s' % s)
291 > EOF
291 > EOF
292 $ hg --config extensions.extroot=$TESTTMP/extroot root
292 $ hg --config extensions.extroot=$TESTTMP/extroot root
293 (extroot) from bar import *: this is extroot.bar
293 (extroot) from bar import *: this is extroot.bar
294 (extroot) import sub1.baz: this is extroot.sub1.baz
294 (extroot) import sub1.baz: this is extroot.sub1.baz
295 (extroot) import sub1: this is extroot.sub1.__init__
295 (extroot) import sub1: this is extroot.sub1.__init__
296 (extroot) from bar import s: this is extroot.bar
296 (extroot) from bar import s: this is extroot.bar
297 (extroot) import bar in func(): this is extroot.bar
297 (extroot) import bar in func(): this is extroot.bar
298 $TESTTMP/a
298 $TESTTMP/a
299 #endif
299 #endif
300
300
301 #if demandimport
301 #if demandimport
302
302
303 Examine whether module loading is delayed until actual referring, even
303 Examine whether module loading is delayed until actual referring, even
304 though module is imported with "absolute_import" feature.
304 though module is imported with "absolute_import" feature.
305
305
306 Files below in each packages are used for described purpose:
306 Files below in each packages are used for described purpose:
307
307
308 - "called": examine whether "from MODULE import ATTR" works correctly
308 - "called": examine whether "from MODULE import ATTR" works correctly
309 - "unused": examine whether loading is delayed correctly
309 - "unused": examine whether loading is delayed correctly
310 - "used": examine whether "from PACKAGE import MODULE" works correctly
310 - "used": examine whether "from PACKAGE import MODULE" works correctly
311
311
312 Package hierarchy is needed to examine whether demand importing works
312 Package hierarchy is needed to examine whether demand importing works
313 as expected for "from SUB.PACK.AGE import MODULE".
313 as expected for "from SUB.PACK.AGE import MODULE".
314
314
315 Setup "external library" to be imported with "absolute_import"
315 Setup "external library" to be imported with "absolute_import"
316 feature.
316 feature.
317
317
318 $ mkdir -p $TESTTMP/extlibroot/lsub1/lsub2
318 $ mkdir -p $TESTTMP/extlibroot/lsub1/lsub2
319 $ touch $TESTTMP/extlibroot/__init__.py
319 $ touch $TESTTMP/extlibroot/__init__.py
320 $ touch $TESTTMP/extlibroot/lsub1/__init__.py
320 $ touch $TESTTMP/extlibroot/lsub1/__init__.py
321 $ touch $TESTTMP/extlibroot/lsub1/lsub2/__init__.py
321 $ touch $TESTTMP/extlibroot/lsub1/lsub2/__init__.py
322
322
323 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/called.py <<EOF
323 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/called.py <<EOF
324 > def func():
324 > def func():
325 > return "this is extlibroot.lsub1.lsub2.called.func()"
325 > return "this is extlibroot.lsub1.lsub2.called.func()"
326 > EOF
326 > EOF
327 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/unused.py <<EOF
327 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/unused.py <<EOF
328 > raise Exception("extlibroot.lsub1.lsub2.unused is loaded unintentionally")
328 > raise Exception("extlibroot.lsub1.lsub2.unused is loaded unintentionally")
329 > EOF
329 > EOF
330 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/used.py <<EOF
330 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/used.py <<EOF
331 > detail = "this is extlibroot.lsub1.lsub2.used"
331 > detail = "this is extlibroot.lsub1.lsub2.used"
332 > EOF
332 > EOF
333
333
334 Setup sub-package of "external library", which causes instantiation of
334 Setup sub-package of "external library", which causes instantiation of
335 demandmod in "recurse down the module chain" code path. Relative
335 demandmod in "recurse down the module chain" code path. Relative
336 importing with "absolute_import" feature isn't tested, because "level
336 importing with "absolute_import" feature isn't tested, because "level
337 >=1 " doesn't cause instantiation of demandmod.
337 >=1 " doesn't cause instantiation of demandmod.
338
338
339 $ mkdir -p $TESTTMP/extlibroot/recursedown/abs
339 $ mkdir -p $TESTTMP/extlibroot/recursedown/abs
340 $ cat > $TESTTMP/extlibroot/recursedown/abs/used.py <<EOF
340 $ cat > $TESTTMP/extlibroot/recursedown/abs/used.py <<EOF
341 > detail = "this is extlibroot.recursedown.abs.used"
341 > detail = "this is extlibroot.recursedown.abs.used"
342 > EOF
342 > EOF
343 $ cat > $TESTTMP/extlibroot/recursedown/abs/__init__.py <<EOF
343 $ cat > $TESTTMP/extlibroot/recursedown/abs/__init__.py <<EOF
344 > from __future__ import absolute_import
344 > from __future__ import absolute_import
345 > from extlibroot.recursedown.abs.used import detail
345 > from extlibroot.recursedown.abs.used import detail
346 > EOF
346 > EOF
347
347
348 $ mkdir -p $TESTTMP/extlibroot/recursedown/legacy
348 $ mkdir -p $TESTTMP/extlibroot/recursedown/legacy
349 $ cat > $TESTTMP/extlibroot/recursedown/legacy/used.py <<EOF
349 $ cat > $TESTTMP/extlibroot/recursedown/legacy/used.py <<EOF
350 > detail = "this is extlibroot.recursedown.legacy.used"
350 > detail = "this is extlibroot.recursedown.legacy.used"
351 > EOF
351 > EOF
352 $ cat > $TESTTMP/extlibroot/recursedown/legacy/__init__.py <<EOF
352 $ cat > $TESTTMP/extlibroot/recursedown/legacy/__init__.py <<EOF
353 > # legacy style (level == -1) import
353 > # legacy style (level == -1) import
354 > from extlibroot.recursedown.legacy.used import detail
354 > from extlibroot.recursedown.legacy.used import detail
355 > EOF
355 > EOF
356
356
357 $ cat > $TESTTMP/extlibroot/recursedown/__init__.py <<EOF
357 $ cat > $TESTTMP/extlibroot/recursedown/__init__.py <<EOF
358 > from __future__ import absolute_import
358 > from __future__ import absolute_import
359 > from extlibroot.recursedown.abs import detail as absdetail
359 > from extlibroot.recursedown.abs import detail as absdetail
360 > from .legacy import detail as legacydetail
360 > from .legacy import detail as legacydetail
361 > EOF
361 > EOF
362
362
363 Setup package that re-exports an attribute of its submodule as the same
363 Setup package that re-exports an attribute of its submodule as the same
364 name. This leaves 'shadowing.used' pointing to 'used.detail', but still
364 name. This leaves 'shadowing.used' pointing to 'used.detail', but still
365 the submodule 'used' should be somehow accessible. (issue5617)
365 the submodule 'used' should be somehow accessible. (issue5617)
366
366
367 $ mkdir -p $TESTTMP/extlibroot/shadowing
367 $ mkdir -p $TESTTMP/extlibroot/shadowing
368 $ cat > $TESTTMP/extlibroot/shadowing/used.py <<EOF
368 $ cat > $TESTTMP/extlibroot/shadowing/used.py <<EOF
369 > detail = "this is extlibroot.shadowing.used"
369 > detail = "this is extlibroot.shadowing.used"
370 > EOF
370 > EOF
371 $ cat > $TESTTMP/extlibroot/shadowing/proxied.py <<EOF
371 $ cat > $TESTTMP/extlibroot/shadowing/proxied.py <<EOF
372 > from __future__ import absolute_import
372 > from __future__ import absolute_import
373 > from extlibroot.shadowing.used import detail
373 > from extlibroot.shadowing.used import detail
374 > EOF
374 > EOF
375 $ cat > $TESTTMP/extlibroot/shadowing/__init__.py <<EOF
375 $ cat > $TESTTMP/extlibroot/shadowing/__init__.py <<EOF
376 > from __future__ import absolute_import
376 > from __future__ import absolute_import
377 > from .used import detail as used
377 > from .used import detail as used
378 > EOF
378 > EOF
379
379
380 Setup extension local modules to be imported with "absolute_import"
380 Setup extension local modules to be imported with "absolute_import"
381 feature.
381 feature.
382
382
383 $ mkdir -p $TESTTMP/absextroot/xsub1/xsub2
383 $ mkdir -p $TESTTMP/absextroot/xsub1/xsub2
384 $ touch $TESTTMP/absextroot/xsub1/__init__.py
384 $ touch $TESTTMP/absextroot/xsub1/__init__.py
385 $ touch $TESTTMP/absextroot/xsub1/xsub2/__init__.py
385 $ touch $TESTTMP/absextroot/xsub1/xsub2/__init__.py
386
386
387 $ cat > $TESTTMP/absextroot/xsub1/xsub2/called.py <<EOF
387 $ cat > $TESTTMP/absextroot/xsub1/xsub2/called.py <<EOF
388 > def func():
388 > def func():
389 > return "this is absextroot.xsub1.xsub2.called.func()"
389 > return "this is absextroot.xsub1.xsub2.called.func()"
390 > EOF
390 > EOF
391 $ cat > $TESTTMP/absextroot/xsub1/xsub2/unused.py <<EOF
391 $ cat > $TESTTMP/absextroot/xsub1/xsub2/unused.py <<EOF
392 > raise Exception("absextroot.xsub1.xsub2.unused is loaded unintentionally")
392 > raise Exception("absextroot.xsub1.xsub2.unused is loaded unintentionally")
393 > EOF
393 > EOF
394 $ cat > $TESTTMP/absextroot/xsub1/xsub2/used.py <<EOF
394 $ cat > $TESTTMP/absextroot/xsub1/xsub2/used.py <<EOF
395 > detail = "this is absextroot.xsub1.xsub2.used"
395 > detail = "this is absextroot.xsub1.xsub2.used"
396 > EOF
396 > EOF
397
397
398 Setup extension local modules to examine whether demand importing
398 Setup extension local modules to examine whether demand importing
399 works as expected in "level > 1" case.
399 works as expected in "level > 1" case.
400
400
401 $ cat > $TESTTMP/absextroot/relimportee.py <<EOF
401 $ cat > $TESTTMP/absextroot/relimportee.py <<EOF
402 > detail = "this is absextroot.relimportee"
402 > detail = "this is absextroot.relimportee"
403 > EOF
403 > EOF
404 $ cat > $TESTTMP/absextroot/xsub1/xsub2/relimporter.py <<EOF
404 $ cat > $TESTTMP/absextroot/xsub1/xsub2/relimporter.py <<EOF
405 > from __future__ import absolute_import
405 > from __future__ import absolute_import
406 > from ... import relimportee
406 > from ... import relimportee
407 > detail = "this relimporter imports %r" % (relimportee.detail)
407 > detail = "this relimporter imports %r" % (relimportee.detail)
408 > EOF
408 > EOF
409
409
410 Setup modules, which actually import extension local modules at
410 Setup modules, which actually import extension local modules at
411 runtime.
411 runtime.
412
412
413 $ cat > $TESTTMP/absextroot/absolute.py << EOF
413 $ cat > $TESTTMP/absextroot/absolute.py << EOF
414 > from __future__ import absolute_import
414 > from __future__ import absolute_import
415 >
415 >
416 > # import extension local modules absolutely (level = 0)
416 > # import extension local modules absolutely (level = 0)
417 > from absextroot.xsub1.xsub2 import used, unused
417 > from absextroot.xsub1.xsub2 import used, unused
418 > from absextroot.xsub1.xsub2.called import func
418 > from absextroot.xsub1.xsub2.called import func
419 >
419 >
420 > def getresult():
420 > def getresult():
421 > result = []
421 > result = []
422 > result.append(used.detail)
422 > result.append(used.detail)
423 > result.append(func())
423 > result.append(func())
424 > return result
424 > return result
425 > EOF
425 > EOF
426
426
427 $ cat > $TESTTMP/absextroot/relative.py << EOF
427 $ cat > $TESTTMP/absextroot/relative.py << EOF
428 > from __future__ import absolute_import
428 > from __future__ import absolute_import
429 >
429 >
430 > # import extension local modules relatively (level == 1)
430 > # import extension local modules relatively (level == 1)
431 > from .xsub1.xsub2 import used, unused
431 > from .xsub1.xsub2 import used, unused
432 > from .xsub1.xsub2.called import func
432 > from .xsub1.xsub2.called import func
433 >
433 >
434 > # import a module, which implies "importing with level > 1"
434 > # import a module, which implies "importing with level > 1"
435 > from .xsub1.xsub2 import relimporter
435 > from .xsub1.xsub2 import relimporter
436 >
436 >
437 > def getresult():
437 > def getresult():
438 > result = []
438 > result = []
439 > result.append(used.detail)
439 > result.append(used.detail)
440 > result.append(func())
440 > result.append(func())
441 > result.append(relimporter.detail)
441 > result.append(relimporter.detail)
442 > return result
442 > return result
443 > EOF
443 > EOF
444
444
445 Setup main procedure of extension.
445 Setup main procedure of extension.
446
446
447 $ cat > $TESTTMP/absextroot/__init__.py <<EOF
447 $ cat > $TESTTMP/absextroot/__init__.py <<EOF
448 > from __future__ import absolute_import
448 > from __future__ import absolute_import
449 > from mercurial import registrar
449 > from mercurial import registrar
450 > cmdtable = {}
450 > cmdtable = {}
451 > command = registrar.command(cmdtable)
451 > command = registrar.command(cmdtable)
452 >
452 >
453 > # "absolute" and "relative" shouldn't be imported before actual
453 > # "absolute" and "relative" shouldn't be imported before actual
454 > # command execution, because (1) they import same modules, and (2)
454 > # command execution, because (1) they import same modules, and (2)
455 > # preceding import (= instantiate "demandmod" object instead of
455 > # preceding import (= instantiate "demandmod" object instead of
456 > # real "module" object) might hide problem of succeeding import.
456 > # real "module" object) might hide problem of succeeding import.
457 >
457 >
458 > @command(b'showabsolute', [], norepo=True)
458 > @command(b'showabsolute', [], norepo=True)
459 > def showabsolute(ui, *args, **opts):
459 > def showabsolute(ui, *args, **opts):
460 > from absextroot import absolute
460 > from absextroot import absolute
461 > ui.write(b'ABS: %s\n' % '\nABS: '.join(absolute.getresult()))
461 > ui.write(b'ABS: %s\n' % '\nABS: '.join(absolute.getresult()))
462 >
462 >
463 > @command(b'showrelative', [], norepo=True)
463 > @command(b'showrelative', [], norepo=True)
464 > def showrelative(ui, *args, **opts):
464 > def showrelative(ui, *args, **opts):
465 > from . import relative
465 > from . import relative
466 > ui.write(b'REL: %s\n' % '\nREL: '.join(relative.getresult()))
466 > ui.write(b'REL: %s\n' % '\nREL: '.join(relative.getresult()))
467 >
467 >
468 > # import modules from external library
468 > # import modules from external library
469 > from extlibroot.lsub1.lsub2 import used as lused, unused as lunused
469 > from extlibroot.lsub1.lsub2 import used as lused, unused as lunused
470 > from extlibroot.lsub1.lsub2.called import func as lfunc
470 > from extlibroot.lsub1.lsub2.called import func as lfunc
471 > from extlibroot.recursedown import absdetail, legacydetail
471 > from extlibroot.recursedown import absdetail, legacydetail
472 > from extlibroot.shadowing import proxied
472 > from extlibroot.shadowing import proxied
473 >
473 >
474 > def uisetup(ui):
474 > def uisetup(ui):
475 > result = []
475 > result = []
476 > result.append(lused.detail)
476 > result.append(lused.detail)
477 > result.append(lfunc())
477 > result.append(lfunc())
478 > result.append(absdetail)
478 > result.append(absdetail)
479 > result.append(legacydetail)
479 > result.append(legacydetail)
480 > result.append(proxied.detail)
480 > result.append(proxied.detail)
481 > ui.write(b'LIB: %s\n' % '\nLIB: '.join(result))
481 > ui.write(b'LIB: %s\n' % '\nLIB: '.join(result))
482 > EOF
482 > EOF
483
483
484 Examine module importing.
484 Examine module importing.
485
485
486 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showabsolute)
486 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showabsolute)
487 LIB: this is extlibroot.lsub1.lsub2.used
487 LIB: this is extlibroot.lsub1.lsub2.used
488 LIB: this is extlibroot.lsub1.lsub2.called.func()
488 LIB: this is extlibroot.lsub1.lsub2.called.func()
489 LIB: this is extlibroot.recursedown.abs.used
489 LIB: this is extlibroot.recursedown.abs.used
490 LIB: this is extlibroot.recursedown.legacy.used
490 LIB: this is extlibroot.recursedown.legacy.used
491 LIB: this is extlibroot.shadowing.used
491 LIB: this is extlibroot.shadowing.used
492 ABS: this is absextroot.xsub1.xsub2.used
492 ABS: this is absextroot.xsub1.xsub2.used
493 ABS: this is absextroot.xsub1.xsub2.called.func()
493 ABS: this is absextroot.xsub1.xsub2.called.func()
494
494
495 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showrelative)
495 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showrelative)
496 LIB: this is extlibroot.lsub1.lsub2.used
496 LIB: this is extlibroot.lsub1.lsub2.used
497 LIB: this is extlibroot.lsub1.lsub2.called.func()
497 LIB: this is extlibroot.lsub1.lsub2.called.func()
498 LIB: this is extlibroot.recursedown.abs.used
498 LIB: this is extlibroot.recursedown.abs.used
499 LIB: this is extlibroot.recursedown.legacy.used
499 LIB: this is extlibroot.recursedown.legacy.used
500 LIB: this is extlibroot.shadowing.used
500 LIB: this is extlibroot.shadowing.used
501 REL: this is absextroot.xsub1.xsub2.used
501 REL: this is absextroot.xsub1.xsub2.used
502 REL: this is absextroot.xsub1.xsub2.called.func()
502 REL: this is absextroot.xsub1.xsub2.called.func()
503 REL: this relimporter imports 'this is absextroot.relimportee'
503 REL: this relimporter imports 'this is absextroot.relimportee'
504
504
505 Examine whether sub-module is imported relatively as expected.
505 Examine whether sub-module is imported relatively as expected.
506
506
507 See also issue5208 for detail about example case on Python 3.x.
507 See also issue5208 for detail about example case on Python 3.x.
508
508
509 $ f -q $TESTTMP/extlibroot/lsub1/lsub2/notexist.py
509 $ f -q $TESTTMP/extlibroot/lsub1/lsub2/notexist.py
510 $TESTTMP/extlibroot/lsub1/lsub2/notexist.py: file not found
510 $TESTTMP/extlibroot/lsub1/lsub2/notexist.py: file not found
511
511
512 $ cat > $TESTTMP/notexist.py <<EOF
512 $ cat > $TESTTMP/notexist.py <<EOF
513 > text = 'notexist.py at root is loaded unintentionally\n'
513 > text = 'notexist.py at root is loaded unintentionally\n'
514 > EOF
514 > EOF
515
515
516 $ cat > $TESTTMP/checkrelativity.py <<EOF
516 $ cat > $TESTTMP/checkrelativity.py <<EOF
517 > from mercurial import registrar
517 > from mercurial import registrar
518 > cmdtable = {}
518 > cmdtable = {}
519 > command = registrar.command(cmdtable)
519 > command = registrar.command(cmdtable)
520 >
520 >
521 > # demand import avoids failure of importing notexist here
521 > # demand import avoids failure of importing notexist here
522 > import extlibroot.lsub1.lsub2.notexist
522 > import extlibroot.lsub1.lsub2.notexist
523 >
523 >
524 > @command(b'checkrelativity', [], norepo=True)
524 > @command(b'checkrelativity', [], norepo=True)
525 > def checkrelativity(ui, *args, **opts):
525 > def checkrelativity(ui, *args, **opts):
526 > try:
526 > try:
527 > ui.write(extlibroot.lsub1.lsub2.notexist.text)
527 > ui.write(extlibroot.lsub1.lsub2.notexist.text)
528 > return 1 # unintentional success
528 > return 1 # unintentional success
529 > except ImportError:
529 > except ImportError:
530 > pass # intentional failure
530 > pass # intentional failure
531 > EOF
531 > EOF
532
532
533 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity)
533 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity)
534
534
535 #endif
535 #endif
536
536
537 Make sure a broken uisetup doesn't globally break hg:
537 Make sure a broken uisetup doesn't globally break hg:
538 $ cat > $TESTTMP/baduisetup.py <<EOF
538 $ cat > $TESTTMP/baduisetup.py <<EOF
539 > def uisetup(ui):
539 > def uisetup(ui):
540 > 1/0
540 > 1/0
541 > EOF
541 > EOF
542
542
543 Even though the extension fails during uisetup, hg is still basically usable:
543 Even though the extension fails during uisetup, hg is still basically usable:
544 $ hg --config extensions.baduisetup=$TESTTMP/baduisetup.py version
544 $ hg --config extensions.baduisetup=$TESTTMP/baduisetup.py version
545 Traceback (most recent call last):
545 Traceback (most recent call last):
546 File "*/mercurial/extensions.py", line *, in _runuisetup (glob)
546 File "*/mercurial/extensions.py", line *, in _runuisetup (glob)
547 uisetup(ui)
547 uisetup(ui)
548 File "$TESTTMP/baduisetup.py", line 2, in uisetup
548 File "$TESTTMP/baduisetup.py", line 2, in uisetup
549 1/0
549 1/0
550 ZeroDivisionError: integer division or modulo by zero
550 ZeroDivisionError: integer division or modulo by zero
551 *** failed to set up extension baduisetup: integer division or modulo by zero
551 *** failed to set up extension baduisetup: integer division or modulo by zero
552 Mercurial Distributed SCM (version *) (glob)
552 Mercurial Distributed SCM (version *) (glob)
553 (see https://mercurial-scm.org for more information)
553 (see https://mercurial-scm.org for more information)
554
554
555 Copyright (C) 2005-* Matt Mackall and others (glob)
555 Copyright (C) 2005-* Matt Mackall and others (glob)
556 This is free software; see the source for copying conditions. There is NO
556 This is free software; see the source for copying conditions. There is NO
557 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
557 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
558
558
559 $ cd ..
559 $ cd ..
560
560
561 hide outer repo
561 hide outer repo
562 $ hg init
562 $ hg init
563
563
564 $ cat > empty.py <<EOF
564 $ cat > empty.py <<EOF
565 > '''empty cmdtable
565 > '''empty cmdtable
566 > '''
566 > '''
567 > cmdtable = {}
567 > cmdtable = {}
568 > EOF
568 > EOF
569 $ emptypath=`pwd`/empty.py
569 $ emptypath=`pwd`/empty.py
570 $ echo "empty = $emptypath" >> $HGRCPATH
570 $ echo "empty = $emptypath" >> $HGRCPATH
571 $ hg help empty
571 $ hg help empty
572 empty extension - empty cmdtable
572 empty extension - empty cmdtable
573
573
574 no commands defined
574 no commands defined
575
575
576
576
577 $ echo 'empty = !' >> $HGRCPATH
577 $ echo 'empty = !' >> $HGRCPATH
578
578
579 $ cat > debugextension.py <<EOF
579 $ cat > debugextension.py <<EOF
580 > '''only debugcommands
580 > '''only debugcommands
581 > '''
581 > '''
582 > from mercurial import registrar
582 > from mercurial import registrar
583 > cmdtable = {}
583 > cmdtable = {}
584 > command = registrar.command(cmdtable)
584 > command = registrar.command(cmdtable)
585 > @command(b'debugfoobar', [], b'hg debugfoobar')
585 > @command(b'debugfoobar', [], b'hg debugfoobar')
586 > def debugfoobar(ui, repo, *args, **opts):
586 > def debugfoobar(ui, repo, *args, **opts):
587 > "yet another debug command"
587 > "yet another debug command"
588 > pass
588 > pass
589 > @command(b'foo', [], b'hg foo')
589 > @command(b'foo', [], b'hg foo')
590 > def foo(ui, repo, *args, **opts):
590 > def foo(ui, repo, *args, **opts):
591 > """yet another foo command
591 > """yet another foo command
592 > This command has been DEPRECATED since forever.
592 > This command has been DEPRECATED since forever.
593 > """
593 > """
594 > pass
594 > pass
595 > EOF
595 > EOF
596 $ debugpath=`pwd`/debugextension.py
596 $ debugpath=`pwd`/debugextension.py
597 $ echo "debugextension = $debugpath" >> $HGRCPATH
597 $ echo "debugextension = $debugpath" >> $HGRCPATH
598
598
599 $ hg help debugextension
599 $ hg help debugextension
600 hg debugextensions
600 hg debugextensions
601
601
602 show information about active extensions
602 show information about active extensions
603
603
604 options:
604 options:
605
605
606 (some details hidden, use --verbose to show complete help)
606 (some details hidden, use --verbose to show complete help)
607
607
608
608
609 $ hg --verbose help debugextension
609 $ hg --verbose help debugextension
610 hg debugextensions
610 hg debugextensions
611
611
612 show information about active extensions
612 show information about active extensions
613
613
614 options:
614 options:
615
615
616 -T --template TEMPLATE display with template (EXPERIMENTAL)
616 -T --template TEMPLATE display with template (EXPERIMENTAL)
617
617
618 global options ([+] can be repeated):
618 global options ([+] can be repeated):
619
619
620 -R --repository REPO repository root directory or name of overlay bundle
620 -R --repository REPO repository root directory or name of overlay bundle
621 file
621 file
622 --cwd DIR change working directory
622 --cwd DIR change working directory
623 -y --noninteractive do not prompt, automatically pick the first choice for
623 -y --noninteractive do not prompt, automatically pick the first choice for
624 all prompts
624 all prompts
625 -q --quiet suppress output
625 -q --quiet suppress output
626 -v --verbose enable additional output
626 -v --verbose enable additional output
627 --color TYPE when to colorize (boolean, always, auto, never, or
627 --color TYPE when to colorize (boolean, always, auto, never, or
628 debug)
628 debug)
629 --config CONFIG [+] set/override config option (use 'section.name=value')
629 --config CONFIG [+] set/override config option (use 'section.name=value')
630 --debug enable debugging output
630 --debug enable debugging output
631 --debugger start debugger
631 --debugger start debugger
632 --encoding ENCODE set the charset encoding (default: ascii)
632 --encoding ENCODE set the charset encoding (default: ascii)
633 --encodingmode MODE set the charset encoding mode (default: strict)
633 --encodingmode MODE set the charset encoding mode (default: strict)
634 --traceback always print a traceback on exception
634 --traceback always print a traceback on exception
635 --time time how long the command takes
635 --time time how long the command takes
636 --profile print command execution profile
636 --profile print command execution profile
637 --version output version information and exit
637 --version output version information and exit
638 -h --help display help and exit
638 -h --help display help and exit
639 --hidden consider hidden changesets
639 --hidden consider hidden changesets
640 --pager TYPE when to paginate (boolean, always, auto, or never)
640 --pager TYPE when to paginate (boolean, always, auto, or never)
641 (default: auto)
641 (default: auto)
642
642
643
643
644
644
645
645
646
646
647
647
648 $ hg --debug help debugextension
648 $ hg --debug help debugextension
649 hg debugextensions
649 hg debugextensions
650
650
651 show information about active extensions
651 show information about active extensions
652
652
653 options:
653 options:
654
654
655 -T --template TEMPLATE display with template (EXPERIMENTAL)
655 -T --template TEMPLATE display with template (EXPERIMENTAL)
656
656
657 global options ([+] can be repeated):
657 global options ([+] can be repeated):
658
658
659 -R --repository REPO repository root directory or name of overlay bundle
659 -R --repository REPO repository root directory or name of overlay bundle
660 file
660 file
661 --cwd DIR change working directory
661 --cwd DIR change working directory
662 -y --noninteractive do not prompt, automatically pick the first choice for
662 -y --noninteractive do not prompt, automatically pick the first choice for
663 all prompts
663 all prompts
664 -q --quiet suppress output
664 -q --quiet suppress output
665 -v --verbose enable additional output
665 -v --verbose enable additional output
666 --color TYPE when to colorize (boolean, always, auto, never, or
666 --color TYPE when to colorize (boolean, always, auto, never, or
667 debug)
667 debug)
668 --config CONFIG [+] set/override config option (use 'section.name=value')
668 --config CONFIG [+] set/override config option (use 'section.name=value')
669 --debug enable debugging output
669 --debug enable debugging output
670 --debugger start debugger
670 --debugger start debugger
671 --encoding ENCODE set the charset encoding (default: ascii)
671 --encoding ENCODE set the charset encoding (default: ascii)
672 --encodingmode MODE set the charset encoding mode (default: strict)
672 --encodingmode MODE set the charset encoding mode (default: strict)
673 --traceback always print a traceback on exception
673 --traceback always print a traceback on exception
674 --time time how long the command takes
674 --time time how long the command takes
675 --profile print command execution profile
675 --profile print command execution profile
676 --version output version information and exit
676 --version output version information and exit
677 -h --help display help and exit
677 -h --help display help and exit
678 --hidden consider hidden changesets
678 --hidden consider hidden changesets
679 --pager TYPE when to paginate (boolean, always, auto, or never)
679 --pager TYPE when to paginate (boolean, always, auto, or never)
680 (default: auto)
680 (default: auto)
681
681
682
682
683
683
684
684
685
685
686 $ echo 'debugextension = !' >> $HGRCPATH
686 $ echo 'debugextension = !' >> $HGRCPATH
687
687
688 Asking for help about a deprecated extension should do something useful:
688 Asking for help about a deprecated extension should do something useful:
689
689
690 $ hg help glog
690 $ hg help glog
691 'glog' is provided by the following extension:
691 'glog' is provided by the following extension:
692
692
693 graphlog command to view revision graphs from a shell (DEPRECATED)
693 graphlog command to view revision graphs from a shell (DEPRECATED)
694
694
695 (use 'hg help extensions' for information on enabling extensions)
695 (use 'hg help extensions' for information on enabling extensions)
696
696
697 Extension module help vs command help:
697 Extension module help vs command help:
698
698
699 $ echo 'extdiff =' >> $HGRCPATH
699 $ echo 'extdiff =' >> $HGRCPATH
700 $ hg help extdiff
700 $ hg help extdiff
701 hg extdiff [OPT]... [FILE]...
701 hg extdiff [OPT]... [FILE]...
702
702
703 use external program to diff repository (or selected files)
703 use external program to diff repository (or selected files)
704
704
705 Show differences between revisions for the specified files, using an
705 Show differences between revisions for the specified files, using an
706 external program. The default program used is diff, with default options
706 external program. The default program used is diff, with default options
707 "-Npru".
707 "-Npru".
708
708
709 To select a different program, use the -p/--program option. The program
709 To select a different program, use the -p/--program option. The program
710 will be passed the names of two directories to compare. To pass additional
710 will be passed the names of two directories to compare. To pass additional
711 options to the program, use -o/--option. These will be passed before the
711 options to the program, use -o/--option. These will be passed before the
712 names of the directories to compare.
712 names of the directories to compare.
713
713
714 When two revision arguments are given, then changes are shown between
714 When two revision arguments are given, then changes are shown between
715 those revisions. If only one revision is specified then that revision is
715 those revisions. If only one revision is specified then that revision is
716 compared to the working directory, and, when no revisions are specified,
716 compared to the working directory, and, when no revisions are specified,
717 the working directory files are compared to its parent.
717 the working directory files are compared to its parent.
718
718
719 (use 'hg help -e extdiff' to show help for the extdiff extension)
719 (use 'hg help -e extdiff' to show help for the extdiff extension)
720
720
721 options ([+] can be repeated):
721 options ([+] can be repeated):
722
722
723 -p --program CMD comparison program to run
723 -p --program CMD comparison program to run
724 -o --option OPT [+] pass option to comparison program
724 -o --option OPT [+] pass option to comparison program
725 -r --rev REV [+] revision
725 -r --rev REV [+] revision
726 -c --change REV change made by revision
726 -c --change REV change made by revision
727 --patch compare patches for two revisions
727 --patch compare patches for two revisions
728 -I --include PATTERN [+] include names matching the given patterns
728 -I --include PATTERN [+] include names matching the given patterns
729 -X --exclude PATTERN [+] exclude names matching the given patterns
729 -X --exclude PATTERN [+] exclude names matching the given patterns
730 -S --subrepos recurse into subrepositories
730 -S --subrepos recurse into subrepositories
731
731
732 (some details hidden, use --verbose to show complete help)
732 (some details hidden, use --verbose to show complete help)
733
733
734
734
735
735
736
736
737
737
738
738
739
739
740
740
741
741
742
742
743 $ hg help --extension extdiff
743 $ hg help --extension extdiff
744 extdiff extension - command to allow external programs to compare revisions
744 extdiff extension - command to allow external programs to compare revisions
745
745
746 The extdiff Mercurial extension allows you to use external programs to compare
746 The extdiff Mercurial extension allows you to use external programs to compare
747 revisions, or revision with working directory. The external diff programs are
747 revisions, or revision with working directory. The external diff programs are
748 called with a configurable set of options and two non-option arguments: paths
748 called with a configurable set of options and two non-option arguments: paths
749 to directories containing snapshots of files to compare.
749 to directories containing snapshots of files to compare.
750
750
751 If there is more than one file being compared and the "child" revision is the
751 If there is more than one file being compared and the "child" revision is the
752 working directory, any modifications made in the external diff program will be
752 working directory, any modifications made in the external diff program will be
753 copied back to the working directory from the temporary directory.
753 copied back to the working directory from the temporary directory.
754
754
755 The extdiff extension also allows you to configure new diff commands, so you
755 The extdiff extension also allows you to configure new diff commands, so you
756 do not need to type 'hg extdiff -p kdiff3' always.
756 do not need to type 'hg extdiff -p kdiff3' always.
757
757
758 [extdiff]
758 [extdiff]
759 # add new command that runs GNU diff(1) in 'context diff' mode
759 # add new command that runs GNU diff(1) in 'context diff' mode
760 cdiff = gdiff -Nprc5
760 cdiff = gdiff -Nprc5
761 ## or the old way:
761 ## or the old way:
762 #cmd.cdiff = gdiff
762 #cmd.cdiff = gdiff
763 #opts.cdiff = -Nprc5
763 #opts.cdiff = -Nprc5
764
764
765 # add new command called meld, runs meld (no need to name twice). If
765 # add new command called meld, runs meld (no need to name twice). If
766 # the meld executable is not available, the meld tool in [merge-tools]
766 # the meld executable is not available, the meld tool in [merge-tools]
767 # will be used, if available
767 # will be used, if available
768 meld =
768 meld =
769
769
770 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
770 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
771 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
771 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
772 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
772 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
773 # your .vimrc
773 # your .vimrc
774 vimdiff = gvim -f "+next" \
774 vimdiff = gvim -f "+next" \
775 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
775 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
776
776
777 Tool arguments can include variables that are expanded at runtime:
777 Tool arguments can include variables that are expanded at runtime:
778
778
779 $parent1, $plabel1 - filename, descriptive label of first parent
779 $parent1, $plabel1 - filename, descriptive label of first parent
780 $child, $clabel - filename, descriptive label of child revision
780 $child, $clabel - filename, descriptive label of child revision
781 $parent2, $plabel2 - filename, descriptive label of second parent
781 $parent2, $plabel2 - filename, descriptive label of second parent
782 $root - repository root
782 $root - repository root
783 $parent is an alias for $parent1.
783 $parent is an alias for $parent1.
784
784
785 The extdiff extension will look in your [diff-tools] and [merge-tools]
785 The extdiff extension will look in your [diff-tools] and [merge-tools]
786 sections for diff tool arguments, when none are specified in [extdiff].
786 sections for diff tool arguments, when none are specified in [extdiff].
787
787
788 [extdiff]
788 [extdiff]
789 kdiff3 =
789 kdiff3 =
790
790
791 [diff-tools]
791 [diff-tools]
792 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
792 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
793
793
794 You can use -I/-X and list of file or directory names like normal 'hg diff'
794 You can use -I/-X and list of file or directory names like normal 'hg diff'
795 command. The extdiff extension makes snapshots of only needed files, so
795 command. The extdiff extension makes snapshots of only needed files, so
796 running the external diff program will actually be pretty fast (at least
796 running the external diff program will actually be pretty fast (at least
797 faster than having to compare the entire tree).
797 faster than having to compare the entire tree).
798
798
799 list of commands:
799 list of commands:
800
800
801 extdiff use external program to diff repository (or selected files)
801 extdiff use external program to diff repository (or selected files)
802
802
803 (use 'hg help -v -e extdiff' to show built-in aliases and global options)
803 (use 'hg help -v -e extdiff' to show built-in aliases and global options)
804
804
805
805
806
806
807
807
808
808
809
809
810
810
811
811
812
812
813
813
814
814
815
815
816
816
817
817
818
818
819
819
820 $ echo 'extdiff = !' >> $HGRCPATH
820 $ echo 'extdiff = !' >> $HGRCPATH
821
821
822 Test help topic with same name as extension
822 Test help topic with same name as extension
823
823
824 $ cat > multirevs.py <<EOF
824 $ cat > multirevs.py <<EOF
825 > from mercurial import commands, registrar
825 > from mercurial import commands, registrar
826 > cmdtable = {}
826 > cmdtable = {}
827 > command = registrar.command(cmdtable)
827 > command = registrar.command(cmdtable)
828 > """multirevs extension
828 > """multirevs extension
829 > Big multi-line module docstring."""
829 > Big multi-line module docstring."""
830 > @command(b'multirevs', [], b'ARG', norepo=True)
830 > @command(b'multirevs', [], b'ARG', norepo=True)
831 > def multirevs(ui, repo, arg, *args, **opts):
831 > def multirevs(ui, repo, arg, *args, **opts):
832 > """multirevs command"""
832 > """multirevs command"""
833 > pass
833 > pass
834 > EOF
834 > EOF
835 $ echo "multirevs = multirevs.py" >> $HGRCPATH
835 $ echo "multirevs = multirevs.py" >> $HGRCPATH
836
836
837 $ hg help multirevs | tail
837 $ hg help multirevs | tail
838 used):
838 used):
839
839
840 hg update :@
840 hg update :@
841
841
842 - Show diff between tags 1.3 and 1.5 (this works because the first and the
842 - Show diff between tags 1.3 and 1.5 (this works because the first and the
843 last revisions of the revset are used):
843 last revisions of the revset are used):
844
844
845 hg diff -r 1.3::1.5
845 hg diff -r 1.3::1.5
846
846
847 use 'hg help -c multirevs' to see help for the multirevs command
847 use 'hg help -c multirevs' to see help for the multirevs command
848
848
849
849
850
850
851
851
852
852
853
853
854 $ hg help -c multirevs
854 $ hg help -c multirevs
855 hg multirevs ARG
855 hg multirevs ARG
856
856
857 multirevs command
857 multirevs command
858
858
859 (some details hidden, use --verbose to show complete help)
859 (some details hidden, use --verbose to show complete help)
860
860
861
861
862
862
863 $ hg multirevs
863 $ hg multirevs
864 hg multirevs: invalid arguments
864 hg multirevs: invalid arguments
865 hg multirevs ARG
865 hg multirevs ARG
866
866
867 multirevs command
867 multirevs command
868
868
869 (use 'hg multirevs -h' to show more help)
869 (use 'hg multirevs -h' to show more help)
870 [255]
870 [255]
871
871
872
872
873
873
874 $ echo "multirevs = !" >> $HGRCPATH
874 $ echo "multirevs = !" >> $HGRCPATH
875
875
876 Issue811: Problem loading extensions twice (by site and by user)
876 Issue811: Problem loading extensions twice (by site and by user)
877
877
878 $ cat <<EOF >> $HGRCPATH
878 $ cat <<EOF >> $HGRCPATH
879 > mq =
879 > mq =
880 > strip =
880 > strip =
881 > hgext.mq =
881 > hgext.mq =
882 > hgext/mq =
882 > hgext/mq =
883 > EOF
883 > EOF
884
884
885 Show extensions:
885 Show extensions:
886 (note that mq force load strip, also checking it's not loaded twice)
886 (note that mq force load strip, also checking it's not loaded twice)
887
887
888 #if no-extraextensions
888 #if no-extraextensions
889 $ hg debugextensions
889 $ hg debugextensions
890 mq
890 mq
891 strip
891 strip
892 #endif
892 #endif
893
893
894 For extensions, which name matches one of its commands, help
894 For extensions, which name matches one of its commands, help
895 message should ask '-v -e' to get list of built-in aliases
895 message should ask '-v -e' to get list of built-in aliases
896 along with extension help itself
896 along with extension help itself
897
897
898 $ mkdir $TESTTMP/d
898 $ mkdir $TESTTMP/d
899 $ cat > $TESTTMP/d/dodo.py <<EOF
899 $ cat > $TESTTMP/d/dodo.py <<EOF
900 > """
900 > """
901 > This is an awesome 'dodo' extension. It does nothing and
901 > This is an awesome 'dodo' extension. It does nothing and
902 > writes 'Foo foo'
902 > writes 'Foo foo'
903 > """
903 > """
904 > from mercurial import commands, registrar
904 > from mercurial import commands, registrar
905 > cmdtable = {}
905 > cmdtable = {}
906 > command = registrar.command(cmdtable)
906 > command = registrar.command(cmdtable)
907 > @command(b'dodo', [], b'hg dodo')
907 > @command(b'dodo', [], b'hg dodo')
908 > def dodo(ui, *args, **kwargs):
908 > def dodo(ui, *args, **kwargs):
909 > """Does nothing"""
909 > """Does nothing"""
910 > ui.write(b"I do nothing. Yay\\n")
910 > ui.write(b"I do nothing. Yay\\n")
911 > @command(b'foofoo', [], b'hg foofoo')
911 > @command(b'foofoo', [], b'hg foofoo')
912 > def foofoo(ui, *args, **kwargs):
912 > def foofoo(ui, *args, **kwargs):
913 > """Writes 'Foo foo'"""
913 > """Writes 'Foo foo'"""
914 > ui.write(b"Foo foo\\n")
914 > ui.write(b"Foo foo\\n")
915 > EOF
915 > EOF
916 $ dodopath=$TESTTMP/d/dodo.py
916 $ dodopath=$TESTTMP/d/dodo.py
917
917
918 $ echo "dodo = $dodopath" >> $HGRCPATH
918 $ echo "dodo = $dodopath" >> $HGRCPATH
919
919
920 Make sure that user is asked to enter '-v -e' to get list of built-in aliases
920 Make sure that user is asked to enter '-v -e' to get list of built-in aliases
921 $ hg help -e dodo
921 $ hg help -e dodo
922 dodo extension -
922 dodo extension -
923
923
924 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
924 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
925
925
926 list of commands:
926 list of commands:
927
927
928 dodo Does nothing
928 dodo Does nothing
929 foofoo Writes 'Foo foo'
929 foofoo Writes 'Foo foo'
930
930
931 (use 'hg help -v -e dodo' to show built-in aliases and global options)
931 (use 'hg help -v -e dodo' to show built-in aliases and global options)
932
932
933 Make sure that '-v -e' prints list of built-in aliases along with
933 Make sure that '-v -e' prints list of built-in aliases along with
934 extension help itself
934 extension help itself
935 $ hg help -v -e dodo
935 $ hg help -v -e dodo
936 dodo extension -
936 dodo extension -
937
937
938 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
938 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
939
939
940 list of commands:
940 list of commands:
941
941
942 dodo Does nothing
942 dodo Does nothing
943 foofoo Writes 'Foo foo'
943 foofoo Writes 'Foo foo'
944
944
945 global options ([+] can be repeated):
945 global options ([+] can be repeated):
946
946
947 -R --repository REPO repository root directory or name of overlay bundle
947 -R --repository REPO repository root directory or name of overlay bundle
948 file
948 file
949 --cwd DIR change working directory
949 --cwd DIR change working directory
950 -y --noninteractive do not prompt, automatically pick the first choice for
950 -y --noninteractive do not prompt, automatically pick the first choice for
951 all prompts
951 all prompts
952 -q --quiet suppress output
952 -q --quiet suppress output
953 -v --verbose enable additional output
953 -v --verbose enable additional output
954 --color TYPE when to colorize (boolean, always, auto, never, or
954 --color TYPE when to colorize (boolean, always, auto, never, or
955 debug)
955 debug)
956 --config CONFIG [+] set/override config option (use 'section.name=value')
956 --config CONFIG [+] set/override config option (use 'section.name=value')
957 --debug enable debugging output
957 --debug enable debugging output
958 --debugger start debugger
958 --debugger start debugger
959 --encoding ENCODE set the charset encoding (default: ascii)
959 --encoding ENCODE set the charset encoding (default: ascii)
960 --encodingmode MODE set the charset encoding mode (default: strict)
960 --encodingmode MODE set the charset encoding mode (default: strict)
961 --traceback always print a traceback on exception
961 --traceback always print a traceback on exception
962 --time time how long the command takes
962 --time time how long the command takes
963 --profile print command execution profile
963 --profile print command execution profile
964 --version output version information and exit
964 --version output version information and exit
965 -h --help display help and exit
965 -h --help display help and exit
966 --hidden consider hidden changesets
966 --hidden consider hidden changesets
967 --pager TYPE when to paginate (boolean, always, auto, or never)
967 --pager TYPE when to paginate (boolean, always, auto, or never)
968 (default: auto)
968 (default: auto)
969
969
970 Make sure that single '-v' option shows help and built-ins only for 'dodo' command
970 Make sure that single '-v' option shows help and built-ins only for 'dodo' command
971 $ hg help -v dodo
971 $ hg help -v dodo
972 hg dodo
972 hg dodo
973
973
974 Does nothing
974 Does nothing
975
975
976 (use 'hg help -e dodo' to show help for the dodo extension)
976 (use 'hg help -e dodo' to show help for the dodo extension)
977
977
978 options:
978 options:
979
979
980 --mq operate on patch repository
980 --mq operate on patch repository
981
981
982 global options ([+] can be repeated):
982 global options ([+] can be repeated):
983
983
984 -R --repository REPO repository root directory or name of overlay bundle
984 -R --repository REPO repository root directory or name of overlay bundle
985 file
985 file
986 --cwd DIR change working directory
986 --cwd DIR change working directory
987 -y --noninteractive do not prompt, automatically pick the first choice for
987 -y --noninteractive do not prompt, automatically pick the first choice for
988 all prompts
988 all prompts
989 -q --quiet suppress output
989 -q --quiet suppress output
990 -v --verbose enable additional output
990 -v --verbose enable additional output
991 --color TYPE when to colorize (boolean, always, auto, never, or
991 --color TYPE when to colorize (boolean, always, auto, never, or
992 debug)
992 debug)
993 --config CONFIG [+] set/override config option (use 'section.name=value')
993 --config CONFIG [+] set/override config option (use 'section.name=value')
994 --debug enable debugging output
994 --debug enable debugging output
995 --debugger start debugger
995 --debugger start debugger
996 --encoding ENCODE set the charset encoding (default: ascii)
996 --encoding ENCODE set the charset encoding (default: ascii)
997 --encodingmode MODE set the charset encoding mode (default: strict)
997 --encodingmode MODE set the charset encoding mode (default: strict)
998 --traceback always print a traceback on exception
998 --traceback always print a traceback on exception
999 --time time how long the command takes
999 --time time how long the command takes
1000 --profile print command execution profile
1000 --profile print command execution profile
1001 --version output version information and exit
1001 --version output version information and exit
1002 -h --help display help and exit
1002 -h --help display help and exit
1003 --hidden consider hidden changesets
1003 --hidden consider hidden changesets
1004 --pager TYPE when to paginate (boolean, always, auto, or never)
1004 --pager TYPE when to paginate (boolean, always, auto, or never)
1005 (default: auto)
1005 (default: auto)
1006
1006
1007 In case when extension name doesn't match any of its commands,
1007 In case when extension name doesn't match any of its commands,
1008 help message should ask for '-v' to get list of built-in aliases
1008 help message should ask for '-v' to get list of built-in aliases
1009 along with extension help
1009 along with extension help
1010 $ cat > $TESTTMP/d/dudu.py <<EOF
1010 $ cat > $TESTTMP/d/dudu.py <<EOF
1011 > """
1011 > """
1012 > This is an awesome 'dudu' extension. It does something and
1012 > This is an awesome 'dudu' extension. It does something and
1013 > also writes 'Beep beep'
1013 > also writes 'Beep beep'
1014 > """
1014 > """
1015 > from mercurial import commands, registrar
1015 > from mercurial import commands, registrar
1016 > cmdtable = {}
1016 > cmdtable = {}
1017 > command = registrar.command(cmdtable)
1017 > command = registrar.command(cmdtable)
1018 > @command(b'something', [], b'hg something')
1018 > @command(b'something', [], b'hg something')
1019 > def something(ui, *args, **kwargs):
1019 > def something(ui, *args, **kwargs):
1020 > """Does something"""
1020 > """Does something"""
1021 > ui.write(b"I do something. Yaaay\\n")
1021 > ui.write(b"I do something. Yaaay\\n")
1022 > @command(b'beep', [], b'hg beep')
1022 > @command(b'beep', [], b'hg beep')
1023 > def beep(ui, *args, **kwargs):
1023 > def beep(ui, *args, **kwargs):
1024 > """Writes 'Beep beep'"""
1024 > """Writes 'Beep beep'"""
1025 > ui.write(b"Beep beep\\n")
1025 > ui.write(b"Beep beep\\n")
1026 > EOF
1026 > EOF
1027 $ dudupath=$TESTTMP/d/dudu.py
1027 $ dudupath=$TESTTMP/d/dudu.py
1028
1028
1029 $ echo "dudu = $dudupath" >> $HGRCPATH
1029 $ echo "dudu = $dudupath" >> $HGRCPATH
1030
1030
1031 $ hg help -e dudu
1031 $ hg help -e dudu
1032 dudu extension -
1032 dudu extension -
1033
1033
1034 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1034 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1035 beep'
1035 beep'
1036
1036
1037 list of commands:
1037 list of commands:
1038
1038
1039 beep Writes 'Beep beep'
1039 beep Writes 'Beep beep'
1040 something Does something
1040 something Does something
1041
1041
1042 (use 'hg help -v dudu' to show built-in aliases and global options)
1042 (use 'hg help -v dudu' to show built-in aliases and global options)
1043
1043
1044 In case when extension name doesn't match any of its commands,
1044 In case when extension name doesn't match any of its commands,
1045 help options '-v' and '-v -e' should be equivalent
1045 help options '-v' and '-v -e' should be equivalent
1046 $ hg help -v dudu
1046 $ hg help -v dudu
1047 dudu extension -
1047 dudu extension -
1048
1048
1049 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1049 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1050 beep'
1050 beep'
1051
1051
1052 list of commands:
1052 list of commands:
1053
1053
1054 beep Writes 'Beep beep'
1054 beep Writes 'Beep beep'
1055 something Does something
1055 something Does something
1056
1056
1057 global options ([+] can be repeated):
1057 global options ([+] can be repeated):
1058
1058
1059 -R --repository REPO repository root directory or name of overlay bundle
1059 -R --repository REPO repository root directory or name of overlay bundle
1060 file
1060 file
1061 --cwd DIR change working directory
1061 --cwd DIR change working directory
1062 -y --noninteractive do not prompt, automatically pick the first choice for
1062 -y --noninteractive do not prompt, automatically pick the first choice for
1063 all prompts
1063 all prompts
1064 -q --quiet suppress output
1064 -q --quiet suppress output
1065 -v --verbose enable additional output
1065 -v --verbose enable additional output
1066 --color TYPE when to colorize (boolean, always, auto, never, or
1066 --color TYPE when to colorize (boolean, always, auto, never, or
1067 debug)
1067 debug)
1068 --config CONFIG [+] set/override config option (use 'section.name=value')
1068 --config CONFIG [+] set/override config option (use 'section.name=value')
1069 --debug enable debugging output
1069 --debug enable debugging output
1070 --debugger start debugger
1070 --debugger start debugger
1071 --encoding ENCODE set the charset encoding (default: ascii)
1071 --encoding ENCODE set the charset encoding (default: ascii)
1072 --encodingmode MODE set the charset encoding mode (default: strict)
1072 --encodingmode MODE set the charset encoding mode (default: strict)
1073 --traceback always print a traceback on exception
1073 --traceback always print a traceback on exception
1074 --time time how long the command takes
1074 --time time how long the command takes
1075 --profile print command execution profile
1075 --profile print command execution profile
1076 --version output version information and exit
1076 --version output version information and exit
1077 -h --help display help and exit
1077 -h --help display help and exit
1078 --hidden consider hidden changesets
1078 --hidden consider hidden changesets
1079 --pager TYPE when to paginate (boolean, always, auto, or never)
1079 --pager TYPE when to paginate (boolean, always, auto, or never)
1080 (default: auto)
1080 (default: auto)
1081
1081
1082 $ hg help -v -e dudu
1082 $ hg help -v -e dudu
1083 dudu extension -
1083 dudu extension -
1084
1084
1085 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1085 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1086 beep'
1086 beep'
1087
1087
1088 list of commands:
1088 list of commands:
1089
1089
1090 beep Writes 'Beep beep'
1090 beep Writes 'Beep beep'
1091 something Does something
1091 something Does something
1092
1092
1093 global options ([+] can be repeated):
1093 global options ([+] can be repeated):
1094
1094
1095 -R --repository REPO repository root directory or name of overlay bundle
1095 -R --repository REPO repository root directory or name of overlay bundle
1096 file
1096 file
1097 --cwd DIR change working directory
1097 --cwd DIR change working directory
1098 -y --noninteractive do not prompt, automatically pick the first choice for
1098 -y --noninteractive do not prompt, automatically pick the first choice for
1099 all prompts
1099 all prompts
1100 -q --quiet suppress output
1100 -q --quiet suppress output
1101 -v --verbose enable additional output
1101 -v --verbose enable additional output
1102 --color TYPE when to colorize (boolean, always, auto, never, or
1102 --color TYPE when to colorize (boolean, always, auto, never, or
1103 debug)
1103 debug)
1104 --config CONFIG [+] set/override config option (use 'section.name=value')
1104 --config CONFIG [+] set/override config option (use 'section.name=value')
1105 --debug enable debugging output
1105 --debug enable debugging output
1106 --debugger start debugger
1106 --debugger start debugger
1107 --encoding ENCODE set the charset encoding (default: ascii)
1107 --encoding ENCODE set the charset encoding (default: ascii)
1108 --encodingmode MODE set the charset encoding mode (default: strict)
1108 --encodingmode MODE set the charset encoding mode (default: strict)
1109 --traceback always print a traceback on exception
1109 --traceback always print a traceback on exception
1110 --time time how long the command takes
1110 --time time how long the command takes
1111 --profile print command execution profile
1111 --profile print command execution profile
1112 --version output version information and exit
1112 --version output version information and exit
1113 -h --help display help and exit
1113 -h --help display help and exit
1114 --hidden consider hidden changesets
1114 --hidden consider hidden changesets
1115 --pager TYPE when to paginate (boolean, always, auto, or never)
1115 --pager TYPE when to paginate (boolean, always, auto, or never)
1116 (default: auto)
1116 (default: auto)
1117
1117
1118 Disabled extension commands:
1118 Disabled extension commands:
1119
1119
1120 $ ORGHGRCPATH=$HGRCPATH
1120 $ ORGHGRCPATH=$HGRCPATH
1121 $ HGRCPATH=
1121 $ HGRCPATH=
1122 $ export HGRCPATH
1122 $ export HGRCPATH
1123 $ hg help email
1123 $ hg help email
1124 'email' is provided by the following extension:
1124 'email' is provided by the following extension:
1125
1125
1126 patchbomb command to send changesets as (a series of) patch emails
1126 patchbomb command to send changesets as (a series of) patch emails
1127
1127
1128 (use 'hg help extensions' for information on enabling extensions)
1128 (use 'hg help extensions' for information on enabling extensions)
1129
1129
1130
1130
1131 $ hg qdel
1131 $ hg qdel
1132 hg: unknown command 'qdel'
1132 hg: unknown command 'qdel'
1133 'qdelete' is provided by the following extension:
1133 'qdelete' is provided by the following extension:
1134
1134
1135 mq manage a stack of patches
1135 mq manage a stack of patches
1136
1136
1137 (use 'hg help extensions' for information on enabling extensions)
1137 (use 'hg help extensions' for information on enabling extensions)
1138 [255]
1138 [255]
1139
1139
1140
1140
1141 $ hg churn
1141 $ hg churn
1142 hg: unknown command 'churn'
1142 hg: unknown command 'churn'
1143 'churn' is provided by the following extension:
1143 'churn' is provided by the following extension:
1144
1144
1145 churn command to display statistics about repository history
1145 churn command to display statistics about repository history
1146
1146
1147 (use 'hg help extensions' for information on enabling extensions)
1147 (use 'hg help extensions' for information on enabling extensions)
1148 [255]
1148 [255]
1149
1149
1150
1150
1151
1151
1152 Disabled extensions:
1152 Disabled extensions:
1153
1153
1154 $ hg help churn
1154 $ hg help churn
1155 churn extension - command to display statistics about repository history
1155 churn extension - command to display statistics about repository history
1156
1156
1157 (use 'hg help extensions' for information on enabling extensions)
1157 (use 'hg help extensions' for information on enabling extensions)
1158
1158
1159 $ hg help patchbomb
1159 $ hg help patchbomb
1160 patchbomb extension - command to send changesets as (a series of) patch emails
1160 patchbomb extension - command to send changesets as (a series of) patch emails
1161
1161
1162 The series is started off with a "[PATCH 0 of N]" introduction, which
1162 The series is started off with a "[PATCH 0 of N]" introduction, which
1163 describes the series as a whole.
1163 describes the series as a whole.
1164
1164
1165 Each patch email has a Subject line of "[PATCH M of N] ...", using the first
1165 Each patch email has a Subject line of "[PATCH M of N] ...", using the first
1166 line of the changeset description as the subject text. The message contains
1166 line of the changeset description as the subject text. The message contains
1167 two or three body parts:
1167 two or three body parts:
1168
1168
1169 - The changeset description.
1169 - The changeset description.
1170 - [Optional] The result of running diffstat on the patch.
1170 - [Optional] The result of running diffstat on the patch.
1171 - The patch itself, as generated by 'hg export'.
1171 - The patch itself, as generated by 'hg export'.
1172
1172
1173 Each message refers to the first in the series using the In-Reply-To and
1173 Each message refers to the first in the series using the In-Reply-To and
1174 References headers, so they will show up as a sequence in threaded mail and
1174 References headers, so they will show up as a sequence in threaded mail and
1175 news readers, and in mail archives.
1175 news readers, and in mail archives.
1176
1176
1177 To configure other defaults, add a section like this to your configuration
1177 To configure other defaults, add a section like this to your configuration
1178 file:
1178 file:
1179
1179
1180 [email]
1180 [email]
1181 from = My Name <my@email>
1181 from = My Name <my@email>
1182 to = recipient1, recipient2, ...
1182 to = recipient1, recipient2, ...
1183 cc = cc1, cc2, ...
1183 cc = cc1, cc2, ...
1184 bcc = bcc1, bcc2, ...
1184 bcc = bcc1, bcc2, ...
1185 reply-to = address1, address2, ...
1185 reply-to = address1, address2, ...
1186
1186
1187 Use "[patchbomb]" as configuration section name if you need to override global
1187 Use "[patchbomb]" as configuration section name if you need to override global
1188 "[email]" address settings.
1188 "[email]" address settings.
1189
1189
1190 Then you can use the 'hg email' command to mail a series of changesets as a
1190 Then you can use the 'hg email' command to mail a series of changesets as a
1191 patchbomb.
1191 patchbomb.
1192
1192
1193 You can also either configure the method option in the email section to be a
1193 You can also either configure the method option in the email section to be a
1194 sendmail compatible mailer or fill out the [smtp] section so that the
1194 sendmail compatible mailer or fill out the [smtp] section so that the
1195 patchbomb extension can automatically send patchbombs directly from the
1195 patchbomb extension can automatically send patchbombs directly from the
1196 commandline. See the [email] and [smtp] sections in hgrc(5) for details.
1196 commandline. See the [email] and [smtp] sections in hgrc(5) for details.
1197
1197
1198 By default, 'hg email' will prompt for a "To" or "CC" header if you do not
1198 By default, 'hg email' will prompt for a "To" or "CC" header if you do not
1199 supply one via configuration or the command line. You can override this to
1199 supply one via configuration or the command line. You can override this to
1200 never prompt by configuring an empty value:
1200 never prompt by configuring an empty value:
1201
1201
1202 [email]
1202 [email]
1203 cc =
1203 cc =
1204
1204
1205 You can control the default inclusion of an introduction message with the
1205 You can control the default inclusion of an introduction message with the
1206 "patchbomb.intro" configuration option. The configuration is always
1206 "patchbomb.intro" configuration option. The configuration is always
1207 overwritten by command line flags like --intro and --desc:
1207 overwritten by command line flags like --intro and --desc:
1208
1208
1209 [patchbomb]
1209 [patchbomb]
1210 intro=auto # include introduction message if more than 1 patch (default)
1210 intro=auto # include introduction message if more than 1 patch (default)
1211 intro=never # never include an introduction message
1211 intro=never # never include an introduction message
1212 intro=always # always include an introduction message
1212 intro=always # always include an introduction message
1213
1213
1214 You can specify a template for flags to be added in subject prefixes. Flags
1214 You can specify a template for flags to be added in subject prefixes. Flags
1215 specified by --flag option are exported as "{flags}" keyword:
1215 specified by --flag option are exported as "{flags}" keyword:
1216
1216
1217 [patchbomb]
1217 [patchbomb]
1218 flagtemplate = "{separate(' ',
1218 flagtemplate = "{separate(' ',
1219 ifeq(branch, 'default', '', branch|upper),
1219 ifeq(branch, 'default', '', branch|upper),
1220 flags)}"
1220 flags)}"
1221
1221
1222 You can set patchbomb to always ask for confirmation by setting
1222 You can set patchbomb to always ask for confirmation by setting
1223 "patchbomb.confirm" to true.
1223 "patchbomb.confirm" to true.
1224
1224
1225 (use 'hg help extensions' for information on enabling extensions)
1225 (use 'hg help extensions' for information on enabling extensions)
1226
1226
1227
1227
1228 Broken disabled extension and command:
1228 Broken disabled extension and command:
1229
1229
1230 $ mkdir hgext
1230 $ mkdir hgext
1231 $ echo > hgext/__init__.py
1231 $ echo > hgext/__init__.py
1232 $ cat > hgext/broken.py <<EOF
1232 $ cat > hgext/broken.py <<EOF
1233 > "broken extension'
1233 > "broken extension'
1234 > EOF
1234 > EOF
1235 $ cat > path.py <<EOF
1235 $ cat > path.py <<EOF
1236 > import os, sys
1236 > import os, sys
1237 > sys.path.insert(0, os.environ['HGEXTPATH'])
1237 > sys.path.insert(0, os.environ['HGEXTPATH'])
1238 > EOF
1238 > EOF
1239 $ HGEXTPATH=`pwd`
1239 $ HGEXTPATH=`pwd`
1240 $ export HGEXTPATH
1240 $ export HGEXTPATH
1241
1241
1242 $ hg --config extensions.path=./path.py help broken
1242 $ hg --config extensions.path=./path.py help broken
1243 broken extension - (no help text available)
1243 broken extension - (no help text available)
1244
1244
1245 (use 'hg help extensions' for information on enabling extensions)
1245 (use 'hg help extensions' for information on enabling extensions)
1246
1246
1247
1247
1248 $ cat > hgext/forest.py <<EOF
1248 $ cat > hgext/forest.py <<EOF
1249 > cmdtable = None
1249 > cmdtable = None
1250 > @command()
1250 > @command()
1251 > def f():
1251 > def f():
1252 > pass
1252 > pass
1253 > @command(123)
1253 > @command(123)
1254 > def g():
1254 > def g():
1255 > pass
1255 > pass
1256 > EOF
1256 > EOF
1257 $ hg --config extensions.path=./path.py help foo > /dev/null
1257 $ hg --config extensions.path=./path.py help foo > /dev/null
1258 abort: no such help topic: foo
1258 abort: no such help topic: foo
1259 (try 'hg help --keyword foo')
1259 (try 'hg help --keyword foo')
1260 [255]
1260 [255]
1261
1261
1262 $ cat > throw.py <<EOF
1262 $ cat > throw.py <<EOF
1263 > from mercurial import commands, registrar, util
1263 > from mercurial import commands, registrar, util
1264 > cmdtable = {}
1264 > cmdtable = {}
1265 > command = registrar.command(cmdtable)
1265 > command = registrar.command(cmdtable)
1266 > class Bogon(Exception): pass
1266 > class Bogon(Exception): pass
1267 > @command(b'throw', [], b'hg throw', norepo=True)
1267 > @command(b'throw', [], b'hg throw', norepo=True)
1268 > def throw(ui, **opts):
1268 > def throw(ui, **opts):
1269 > """throws an exception"""
1269 > """throws an exception"""
1270 > raise Bogon()
1270 > raise Bogon()
1271 > EOF
1271 > EOF
1272
1272
1273 No declared supported version, extension complains:
1273 No declared supported version, extension complains:
1274 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1274 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1275 ** Unknown exception encountered with possibly-broken third-party extension throw
1275 ** Unknown exception encountered with possibly-broken third-party extension throw
1276 ** which supports versions unknown of Mercurial.
1276 ** which supports versions unknown of Mercurial.
1277 ** Please disable throw and try your action again.
1277 ** Please disable throw and try your action again.
1278 ** If that fixes the bug please report it to the extension author.
1278 ** If that fixes the bug please report it to the extension author.
1279 ** Python * (glob)
1279 ** Python * (glob)
1280 ** Mercurial Distributed SCM * (glob)
1280 ** Mercurial Distributed SCM * (glob)
1281 ** Extensions loaded: throw
1281 ** Extensions loaded: throw
1282
1282
1283 empty declaration of supported version, extension complains:
1283 empty declaration of supported version, extension complains:
1284 $ echo "testedwith = ''" >> throw.py
1284 $ echo "testedwith = ''" >> throw.py
1285 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1285 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1286 ** Unknown exception encountered with possibly-broken third-party extension throw
1286 ** Unknown exception encountered with possibly-broken third-party extension throw
1287 ** which supports versions unknown of Mercurial.
1287 ** which supports versions unknown of Mercurial.
1288 ** Please disable throw and try your action again.
1288 ** Please disable throw and try your action again.
1289 ** If that fixes the bug please report it to the extension author.
1289 ** If that fixes the bug please report it to the extension author.
1290 ** Python * (glob)
1290 ** Python * (glob)
1291 ** Mercurial Distributed SCM (*) (glob)
1291 ** Mercurial Distributed SCM (*) (glob)
1292 ** Extensions loaded: throw
1292 ** Extensions loaded: throw
1293
1293
1294 If the extension specifies a buglink, show that:
1294 If the extension specifies a buglink, show that:
1295 $ echo 'buglink = "http://example.com/bts"' >> throw.py
1295 $ echo 'buglink = "http://example.com/bts"' >> throw.py
1296 $ rm -f throw.pyc throw.pyo
1296 $ rm -f throw.pyc throw.pyo
1297 $ rm -Rf __pycache__
1297 $ rm -Rf __pycache__
1298 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1298 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1299 ** Unknown exception encountered with possibly-broken third-party extension throw
1299 ** Unknown exception encountered with possibly-broken third-party extension throw
1300 ** which supports versions unknown of Mercurial.
1300 ** which supports versions unknown of Mercurial.
1301 ** Please disable throw and try your action again.
1301 ** Please disable throw and try your action again.
1302 ** If that fixes the bug please report it to http://example.com/bts
1302 ** If that fixes the bug please report it to http://example.com/bts
1303 ** Python * (glob)
1303 ** Python * (glob)
1304 ** Mercurial Distributed SCM (*) (glob)
1304 ** Mercurial Distributed SCM (*) (glob)
1305 ** Extensions loaded: throw
1305 ** Extensions loaded: throw
1306
1306
1307 If the extensions declare outdated versions, accuse the older extension first:
1307 If the extensions declare outdated versions, accuse the older extension first:
1308 $ echo "from mercurial import util" >> older.py
1308 $ echo "from mercurial import util" >> older.py
1309 $ echo "util.version = lambda:b'2.2'" >> older.py
1309 $ echo "util.version = lambda:b'2.2'" >> older.py
1310 $ echo "testedwith = b'1.9.3'" >> older.py
1310 $ echo "testedwith = b'1.9.3'" >> older.py
1311 $ echo "testedwith = b'2.1.1'" >> throw.py
1311 $ echo "testedwith = b'2.1.1'" >> throw.py
1312 $ rm -f throw.pyc throw.pyo
1312 $ rm -f throw.pyc throw.pyo
1313 $ rm -Rf __pycache__
1313 $ rm -Rf __pycache__
1314 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1314 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1315 > throw 2>&1 | egrep '^\*\*'
1315 > throw 2>&1 | egrep '^\*\*'
1316 ** Unknown exception encountered with possibly-broken third-party extension older
1316 ** Unknown exception encountered with possibly-broken third-party extension older
1317 ** which supports versions 1.9 of Mercurial.
1317 ** which supports versions 1.9 of Mercurial.
1318 ** Please disable older and try your action again.
1318 ** Please disable older and try your action again.
1319 ** If that fixes the bug please report it to the extension author.
1319 ** If that fixes the bug please report it to the extension author.
1320 ** Python * (glob)
1320 ** Python * (glob)
1321 ** Mercurial Distributed SCM (version 2.2)
1321 ** Mercurial Distributed SCM (version 2.2)
1322 ** Extensions loaded: throw, older
1322 ** Extensions loaded: throw, older
1323
1323
1324 One extension only tested with older, one only with newer versions:
1324 One extension only tested with older, one only with newer versions:
1325 $ echo "util.version = lambda:b'2.1'" >> older.py
1325 $ echo "util.version = lambda:b'2.1'" >> older.py
1326 $ rm -f older.pyc older.pyo
1326 $ rm -f older.pyc older.pyo
1327 $ rm -Rf __pycache__
1327 $ rm -Rf __pycache__
1328 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1328 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1329 > throw 2>&1 | egrep '^\*\*'
1329 > throw 2>&1 | egrep '^\*\*'
1330 ** Unknown exception encountered with possibly-broken third-party extension older
1330 ** Unknown exception encountered with possibly-broken third-party extension older
1331 ** which supports versions 1.9 of Mercurial.
1331 ** which supports versions 1.9 of Mercurial.
1332 ** Please disable older and try your action again.
1332 ** Please disable older and try your action again.
1333 ** If that fixes the bug please report it to the extension author.
1333 ** If that fixes the bug please report it to the extension author.
1334 ** Python * (glob)
1334 ** Python * (glob)
1335 ** Mercurial Distributed SCM (version 2.1)
1335 ** Mercurial Distributed SCM (version 2.1)
1336 ** Extensions loaded: throw, older
1336 ** Extensions loaded: throw, older
1337
1337
1338 Older extension is tested with current version, the other only with newer:
1338 Older extension is tested with current version, the other only with newer:
1339 $ echo "util.version = lambda:b'1.9.3'" >> older.py
1339 $ echo "util.version = lambda:b'1.9.3'" >> older.py
1340 $ rm -f older.pyc older.pyo
1340 $ rm -f older.pyc older.pyo
1341 $ rm -Rf __pycache__
1341 $ rm -Rf __pycache__
1342 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1342 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1343 > throw 2>&1 | egrep '^\*\*'
1343 > throw 2>&1 | egrep '^\*\*'
1344 ** Unknown exception encountered with possibly-broken third-party extension throw
1344 ** Unknown exception encountered with possibly-broken third-party extension throw
1345 ** which supports versions 2.1 of Mercurial.
1345 ** which supports versions 2.1 of Mercurial.
1346 ** Please disable throw and try your action again.
1346 ** Please disable throw and try your action again.
1347 ** If that fixes the bug please report it to http://example.com/bts
1347 ** If that fixes the bug please report it to http://example.com/bts
1348 ** Python * (glob)
1348 ** Python * (glob)
1349 ** Mercurial Distributed SCM (version 1.9.3)
1349 ** Mercurial Distributed SCM (version 1.9.3)
1350 ** Extensions loaded: throw, older
1350 ** Extensions loaded: throw, older
1351
1351
1352 Ability to point to a different point
1352 Ability to point to a different point
1353 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1353 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1354 > --config ui.supportcontact='Your Local Goat Lenders' throw 2>&1 | egrep '^\*\*'
1354 > --config ui.supportcontact='Your Local Goat Lenders' throw 2>&1 | egrep '^\*\*'
1355 ** unknown exception encountered, please report by visiting
1355 ** unknown exception encountered, please report by visiting
1356 ** Your Local Goat Lenders
1356 ** Your Local Goat Lenders
1357 ** Python * (glob)
1357 ** Python * (glob)
1358 ** Mercurial Distributed SCM (*) (glob)
1358 ** Mercurial Distributed SCM (*) (glob)
1359 ** Extensions loaded: throw, older
1359 ** Extensions loaded: throw, older
1360
1360
1361 Declare the version as supporting this hg version, show regular bts link:
1361 Declare the version as supporting this hg version, show regular bts link:
1362 $ hgver=`hg debuginstall -T '{hgver}'`
1362 $ hgver=`hg debuginstall -T '{hgver}'`
1363 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
1363 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
1364 $ if [ -z "$hgver" ]; then
1364 $ if [ -z "$hgver" ]; then
1365 > echo "unable to fetch a mercurial version. Make sure __version__ is correct";
1365 > echo "unable to fetch a mercurial version. Make sure __version__ is correct";
1366 > fi
1366 > fi
1367 $ rm -f throw.pyc throw.pyo
1367 $ rm -f throw.pyc throw.pyo
1368 $ rm -Rf __pycache__
1368 $ rm -Rf __pycache__
1369 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1369 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1370 ** unknown exception encountered, please report by visiting
1370 ** unknown exception encountered, please report by visiting
1371 ** https://mercurial-scm.org/wiki/BugTracker
1371 ** https://mercurial-scm.org/wiki/BugTracker
1372 ** Python * (glob)
1372 ** Python * (glob)
1373 ** Mercurial Distributed SCM (*) (glob)
1373 ** Mercurial Distributed SCM (*) (glob)
1374 ** Extensions loaded: throw
1374 ** Extensions loaded: throw
1375
1375
1376 Patch version is ignored during compatibility check
1376 Patch version is ignored during compatibility check
1377 $ echo "testedwith = b'3.2'" >> throw.py
1377 $ echo "testedwith = b'3.2'" >> throw.py
1378 $ echo "util.version = lambda:b'3.2.2'" >> throw.py
1378 $ echo "util.version = lambda:b'3.2.2'" >> throw.py
1379 $ rm -f throw.pyc throw.pyo
1379 $ rm -f throw.pyc throw.pyo
1380 $ rm -Rf __pycache__
1380 $ rm -Rf __pycache__
1381 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1381 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1382 ** unknown exception encountered, please report by visiting
1382 ** unknown exception encountered, please report by visiting
1383 ** https://mercurial-scm.org/wiki/BugTracker
1383 ** https://mercurial-scm.org/wiki/BugTracker
1384 ** Python * (glob)
1384 ** Python * (glob)
1385 ** Mercurial Distributed SCM (*) (glob)
1385 ** Mercurial Distributed SCM (*) (glob)
1386 ** Extensions loaded: throw
1386 ** Extensions loaded: throw
1387
1387
1388 Test version number support in 'hg version':
1388 Test version number support in 'hg version':
1389 $ echo '__version__ = (1, 2, 3)' >> throw.py
1389 $ echo '__version__ = (1, 2, 3)' >> throw.py
1390 $ rm -f throw.pyc throw.pyo
1390 $ rm -f throw.pyc throw.pyo
1391 $ rm -Rf __pycache__
1391 $ rm -Rf __pycache__
1392 $ hg version -v
1392 $ hg version -v
1393 Mercurial Distributed SCM (version *) (glob)
1393 Mercurial Distributed SCM (version *) (glob)
1394 (see https://mercurial-scm.org for more information)
1394 (see https://mercurial-scm.org for more information)
1395
1395
1396 Copyright (C) 2005-* Matt Mackall and others (glob)
1396 Copyright (C) 2005-* Matt Mackall and others (glob)
1397 This is free software; see the source for copying conditions. There is NO
1397 This is free software; see the source for copying conditions. There is NO
1398 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1398 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1399
1399
1400 Enabled extensions:
1400 Enabled extensions:
1401
1401
1402
1402
1403 $ hg version -v --config extensions.throw=throw.py
1403 $ hg version -v --config extensions.throw=throw.py
1404 Mercurial Distributed SCM (version *) (glob)
1404 Mercurial Distributed SCM (version *) (glob)
1405 (see https://mercurial-scm.org for more information)
1405 (see https://mercurial-scm.org for more information)
1406
1406
1407 Copyright (C) 2005-* Matt Mackall and others (glob)
1407 Copyright (C) 2005-* Matt Mackall and others (glob)
1408 This is free software; see the source for copying conditions. There is NO
1408 This is free software; see the source for copying conditions. There is NO
1409 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1409 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1410
1410
1411 Enabled extensions:
1411 Enabled extensions:
1412
1412
1413 throw external 1.2.3
1413 throw external 1.2.3
1414 $ echo 'getversion = lambda: b"1.twentythree"' >> throw.py
1414 $ echo 'getversion = lambda: b"1.twentythree"' >> throw.py
1415 $ rm -f throw.pyc throw.pyo
1415 $ rm -f throw.pyc throw.pyo
1416 $ rm -Rf __pycache__
1416 $ rm -Rf __pycache__
1417 $ hg version -v --config extensions.throw=throw.py --config extensions.strip=
1417 $ hg version -v --config extensions.throw=throw.py --config extensions.strip=
1418 Mercurial Distributed SCM (version *) (glob)
1418 Mercurial Distributed SCM (version *) (glob)
1419 (see https://mercurial-scm.org for more information)
1419 (see https://mercurial-scm.org for more information)
1420
1420
1421 Copyright (C) 2005-* Matt Mackall and others (glob)
1421 Copyright (C) 2005-* Matt Mackall and others (glob)
1422 This is free software; see the source for copying conditions. There is NO
1422 This is free software; see the source for copying conditions. There is NO
1423 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1423 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1424
1424
1425 Enabled extensions:
1425 Enabled extensions:
1426
1426
1427 throw external 1.twentythree
1427 throw external 1.twentythree
1428 strip internal
1428 strip internal
1429
1429
1430 $ hg version -q --config extensions.throw=throw.py
1430 $ hg version -q --config extensions.throw=throw.py
1431 Mercurial Distributed SCM (version *) (glob)
1431 Mercurial Distributed SCM (version *) (glob)
1432
1432
1433 Test template output:
1433 Test template output:
1434
1434
1435 $ hg version --config extensions.strip= -T'{extensions}'
1435 $ hg version --config extensions.strip= -T'{extensions}'
1436 strip
1436 strip
1437
1437
1438 Test JSON output of version:
1438 Test JSON output of version:
1439
1439
1440 $ hg version -Tjson
1440 $ hg version -Tjson
1441 [
1441 [
1442 {
1442 {
1443 "extensions": [],
1443 "extensions": [],
1444 "ver": "*" (glob)
1444 "ver": "*" (glob)
1445 }
1445 }
1446 ]
1446 ]
1447
1447
1448 $ hg version --config extensions.throw=throw.py -Tjson
1448 $ hg version --config extensions.throw=throw.py -Tjson
1449 [
1449 [
1450 {
1450 {
1451 "extensions": [{"bundled": false, "name": "throw", "ver": "1.twentythree"}],
1451 "extensions": [{"bundled": false, "name": "throw", "ver": "1.twentythree"}],
1452 "ver": "3.2.2"
1452 "ver": "3.2.2"
1453 }
1453 }
1454 ]
1454 ]
1455
1455
1456 $ hg version --config extensions.strip= -Tjson
1456 $ hg version --config extensions.strip= -Tjson
1457 [
1457 [
1458 {
1458 {
1459 "extensions": [{"bundled": true, "name": "strip", "ver": null}],
1459 "extensions": [{"bundled": true, "name": "strip", "ver": null}],
1460 "ver": "*" (glob)
1460 "ver": "*" (glob)
1461 }
1461 }
1462 ]
1462 ]
1463
1463
1464 Test template output of version:
1464 Test template output of version:
1465
1465
1466 $ hg version --config extensions.throw=throw.py --config extensions.strip= \
1466 $ hg version --config extensions.throw=throw.py --config extensions.strip= \
1467 > -T'{extensions % "{name} {pad(ver, 16)} ({if(bundled, "internal", "external")})\n"}'
1467 > -T'{extensions % "{name} {pad(ver, 16)} ({if(bundled, "internal", "external")})\n"}'
1468 throw 1.twentythree (external)
1468 throw 1.twentythree (external)
1469 strip (internal)
1469 strip (internal)
1470
1470
1471 Refuse to load extensions with minimum version requirements
1471 Refuse to load extensions with minimum version requirements
1472
1472
1473 $ cat > minversion1.py << EOF
1473 $ cat > minversion1.py << EOF
1474 > from mercurial import util
1474 > from mercurial import util
1475 > util.version = lambda: b'3.5.2'
1475 > util.version = lambda: b'3.5.2'
1476 > minimumhgversion = b'3.6'
1476 > minimumhgversion = b'3.6'
1477 > EOF
1477 > EOF
1478 $ hg --config extensions.minversion=minversion1.py version
1478 $ hg --config extensions.minversion=minversion1.py version
1479 (third party extension minversion requires version 3.6 or newer of Mercurial; disabling)
1479 (third party extension minversion requires version 3.6 or newer of Mercurial; disabling)
1480 Mercurial Distributed SCM (version 3.5.2)
1480 Mercurial Distributed SCM (version 3.5.2)
1481 (see https://mercurial-scm.org for more information)
1481 (see https://mercurial-scm.org for more information)
1482
1482
1483 Copyright (C) 2005-* Matt Mackall and others (glob)
1483 Copyright (C) 2005-* Matt Mackall and others (glob)
1484 This is free software; see the source for copying conditions. There is NO
1484 This is free software; see the source for copying conditions. There is NO
1485 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1485 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1486
1486
1487 $ cat > minversion2.py << EOF
1487 $ cat > minversion2.py << EOF
1488 > from mercurial import util
1488 > from mercurial import util
1489 > util.version = lambda: b'3.6'
1489 > util.version = lambda: b'3.6'
1490 > minimumhgversion = b'3.7'
1490 > minimumhgversion = b'3.7'
1491 > EOF
1491 > EOF
1492 $ hg --config extensions.minversion=minversion2.py version 2>&1 | egrep '\(third'
1492 $ hg --config extensions.minversion=minversion2.py version 2>&1 | egrep '\(third'
1493 (third party extension minversion requires version 3.7 or newer of Mercurial; disabling)
1493 (third party extension minversion requires version 3.7 or newer of Mercurial; disabling)
1494
1494
1495 Can load version that is only off by point release
1495 Can load version that is only off by point release
1496
1496
1497 $ cat > minversion2.py << EOF
1497 $ cat > minversion2.py << EOF
1498 > from mercurial import util
1498 > from mercurial import util
1499 > util.version = lambda: b'3.6.1'
1499 > util.version = lambda: b'3.6.1'
1500 > minimumhgversion = b'3.6'
1500 > minimumhgversion = b'3.6'
1501 > EOF
1501 > EOF
1502 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1502 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1503 [1]
1503 [1]
1504
1504
1505 Can load minimum version identical to current
1505 Can load minimum version identical to current
1506
1506
1507 $ cat > minversion3.py << EOF
1507 $ cat > minversion3.py << EOF
1508 > from mercurial import util
1508 > from mercurial import util
1509 > util.version = lambda: b'3.5'
1509 > util.version = lambda: b'3.5'
1510 > minimumhgversion = b'3.5'
1510 > minimumhgversion = b'3.5'
1511 > EOF
1511 > EOF
1512 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1512 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1513 [1]
1513 [1]
1514
1514
1515 Restore HGRCPATH
1515 Restore HGRCPATH
1516
1516
1517 $ HGRCPATH=$ORGHGRCPATH
1517 $ HGRCPATH=$ORGHGRCPATH
1518 $ export HGRCPATH
1518 $ export HGRCPATH
1519
1519
1520 Commands handling multiple repositories at a time should invoke only
1520 Commands handling multiple repositories at a time should invoke only
1521 "reposetup()" of extensions enabling in the target repository.
1521 "reposetup()" of extensions enabling in the target repository.
1522
1522
1523 $ mkdir reposetup-test
1523 $ mkdir reposetup-test
1524 $ cd reposetup-test
1524 $ cd reposetup-test
1525
1525
1526 $ cat > $TESTTMP/reposetuptest.py <<EOF
1526 $ cat > $TESTTMP/reposetuptest.py <<EOF
1527 > from mercurial import extensions
1527 > from mercurial import extensions
1528 > def reposetup(ui, repo):
1528 > def reposetup(ui, repo):
1529 > ui.write(b'reposetup() for %s\n' % (repo.root))
1529 > ui.write(b'reposetup() for %s\n' % (repo.root))
1530 > ui.flush()
1530 > ui.flush()
1531 > EOF
1531 > EOF
1532 $ hg init src
1532 $ hg init src
1533 $ echo a > src/a
1533 $ echo a > src/a
1534 $ hg -R src commit -Am '#0 at src/a'
1534 $ hg -R src commit -Am '#0 at src/a'
1535 adding a
1535 adding a
1536 $ echo '[extensions]' >> src/.hg/hgrc
1536 $ echo '[extensions]' >> src/.hg/hgrc
1537 $ echo '# enable extension locally' >> src/.hg/hgrc
1537 $ echo '# enable extension locally' >> src/.hg/hgrc
1538 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
1538 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
1539 $ hg -R src status
1539 $ hg -R src status
1540 reposetup() for $TESTTMP/reposetup-test/src
1540 reposetup() for $TESTTMP/reposetup-test/src
1541 reposetup() for $TESTTMP/reposetup-test/src (chg !)
1541 reposetup() for $TESTTMP/reposetup-test/src (chg !)
1542
1542
1543 $ hg --cwd src debugextensions
1543 $ hg --cwd src debugextensions
1544 reposetup() for $TESTTMP/reposetup-test/src
1544 reposetup() for $TESTTMP/reposetup-test/src
1545 dodo (untested!)
1545 dodo (untested!)
1546 dudu (untested!)
1546 dudu (untested!)
1547 mq
1547 mq
1548 reposetuptest (untested!)
1548 reposetuptest (untested!)
1549 strip
1549 strip
1550
1550
1551 $ hg clone -U src clone-dst1
1551 $ hg clone -U src clone-dst1
1552 reposetup() for $TESTTMP/reposetup-test/src
1552 reposetup() for $TESTTMP/reposetup-test/src
1553 $ hg init push-dst1
1553 $ hg init push-dst1
1554 $ hg -q -R src push push-dst1
1554 $ hg -q -R src push push-dst1
1555 reposetup() for $TESTTMP/reposetup-test/src
1555 reposetup() for $TESTTMP/reposetup-test/src
1556 $ hg init pull-src1
1556 $ hg init pull-src1
1557 $ hg -q -R pull-src1 pull src
1557 $ hg -q -R pull-src1 pull src
1558 reposetup() for $TESTTMP/reposetup-test/src
1558 reposetup() for $TESTTMP/reposetup-test/src
1559
1559
1560 $ cat <<EOF >> $HGRCPATH
1560 $ cat <<EOF >> $HGRCPATH
1561 > [extensions]
1561 > [extensions]
1562 > # disable extension globally and explicitly
1562 > # disable extension globally and explicitly
1563 > reposetuptest = !
1563 > reposetuptest = !
1564 > EOF
1564 > EOF
1565 $ hg clone -U src clone-dst2
1565 $ hg clone -U src clone-dst2
1566 reposetup() for $TESTTMP/reposetup-test/src
1566 reposetup() for $TESTTMP/reposetup-test/src
1567 $ hg init push-dst2
1567 $ hg init push-dst2
1568 $ hg -q -R src push push-dst2
1568 $ hg -q -R src push push-dst2
1569 reposetup() for $TESTTMP/reposetup-test/src
1569 reposetup() for $TESTTMP/reposetup-test/src
1570 $ hg init pull-src2
1570 $ hg init pull-src2
1571 $ hg -q -R pull-src2 pull src
1571 $ hg -q -R pull-src2 pull src
1572 reposetup() for $TESTTMP/reposetup-test/src
1572 reposetup() for $TESTTMP/reposetup-test/src
1573
1573
1574 $ cat <<EOF >> $HGRCPATH
1574 $ cat <<EOF >> $HGRCPATH
1575 > [extensions]
1575 > [extensions]
1576 > # enable extension globally
1576 > # enable extension globally
1577 > reposetuptest = $TESTTMP/reposetuptest.py
1577 > reposetuptest = $TESTTMP/reposetuptest.py
1578 > EOF
1578 > EOF
1579 $ hg clone -U src clone-dst3
1579 $ hg clone -U src clone-dst3
1580 reposetup() for $TESTTMP/reposetup-test/src
1580 reposetup() for $TESTTMP/reposetup-test/src
1581 reposetup() for $TESTTMP/reposetup-test/clone-dst3
1581 reposetup() for $TESTTMP/reposetup-test/clone-dst3
1582 $ hg init push-dst3
1582 $ hg init push-dst3
1583 reposetup() for $TESTTMP/reposetup-test/push-dst3
1583 reposetup() for $TESTTMP/reposetup-test/push-dst3
1584 $ hg -q -R src push push-dst3
1584 $ hg -q -R src push push-dst3
1585 reposetup() for $TESTTMP/reposetup-test/src
1585 reposetup() for $TESTTMP/reposetup-test/src
1586 reposetup() for $TESTTMP/reposetup-test/push-dst3
1586 reposetup() for $TESTTMP/reposetup-test/push-dst3
1587 $ hg init pull-src3
1587 $ hg init pull-src3
1588 reposetup() for $TESTTMP/reposetup-test/pull-src3
1588 reposetup() for $TESTTMP/reposetup-test/pull-src3
1589 $ hg -q -R pull-src3 pull src
1589 $ hg -q -R pull-src3 pull src
1590 reposetup() for $TESTTMP/reposetup-test/pull-src3
1590 reposetup() for $TESTTMP/reposetup-test/pull-src3
1591 reposetup() for $TESTTMP/reposetup-test/src
1591 reposetup() for $TESTTMP/reposetup-test/src
1592
1592
1593 $ echo '[extensions]' >> src/.hg/hgrc
1593 $ echo '[extensions]' >> src/.hg/hgrc
1594 $ echo '# disable extension locally' >> src/.hg/hgrc
1594 $ echo '# disable extension locally' >> src/.hg/hgrc
1595 $ echo 'reposetuptest = !' >> src/.hg/hgrc
1595 $ echo 'reposetuptest = !' >> src/.hg/hgrc
1596 $ hg clone -U src clone-dst4
1596 $ hg clone -U src clone-dst4
1597 reposetup() for $TESTTMP/reposetup-test/clone-dst4
1597 reposetup() for $TESTTMP/reposetup-test/clone-dst4
1598 $ hg init push-dst4
1598 $ hg init push-dst4
1599 reposetup() for $TESTTMP/reposetup-test/push-dst4
1599 reposetup() for $TESTTMP/reposetup-test/push-dst4
1600 $ hg -q -R src push push-dst4
1600 $ hg -q -R src push push-dst4
1601 reposetup() for $TESTTMP/reposetup-test/push-dst4
1601 reposetup() for $TESTTMP/reposetup-test/push-dst4
1602 $ hg init pull-src4
1602 $ hg init pull-src4
1603 reposetup() for $TESTTMP/reposetup-test/pull-src4
1603 reposetup() for $TESTTMP/reposetup-test/pull-src4
1604 $ hg -q -R pull-src4 pull src
1604 $ hg -q -R pull-src4 pull src
1605 reposetup() for $TESTTMP/reposetup-test/pull-src4
1605 reposetup() for $TESTTMP/reposetup-test/pull-src4
1606
1606
1607 disabling in command line overlays with all configuration
1607 disabling in command line overlays with all configuration
1608 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
1608 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
1609 $ hg --config extensions.reposetuptest=! init push-dst5
1609 $ hg --config extensions.reposetuptest=! init push-dst5
1610 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
1610 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
1611 $ hg --config extensions.reposetuptest=! init pull-src5
1611 $ hg --config extensions.reposetuptest=! init pull-src5
1612 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
1612 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
1613
1613
1614 $ cat <<EOF >> $HGRCPATH
1614 $ cat <<EOF >> $HGRCPATH
1615 > [extensions]
1615 > [extensions]
1616 > # disable extension globally and explicitly
1616 > # disable extension globally and explicitly
1617 > reposetuptest = !
1617 > reposetuptest = !
1618 > EOF
1618 > EOF
1619 $ hg init parent
1619 $ hg init parent
1620 $ hg init parent/sub1
1620 $ hg init parent/sub1
1621 $ echo 1 > parent/sub1/1
1621 $ echo 1 > parent/sub1/1
1622 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1'
1622 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1'
1623 adding 1
1623 adding 1
1624 $ hg init parent/sub2
1624 $ hg init parent/sub2
1625 $ hg init parent/sub2/sub21
1625 $ hg init parent/sub2/sub21
1626 $ echo 21 > parent/sub2/sub21/21
1626 $ echo 21 > parent/sub2/sub21/21
1627 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21'
1627 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21'
1628 adding 21
1628 adding 21
1629 $ cat > parent/sub2/.hgsub <<EOF
1629 $ cat > parent/sub2/.hgsub <<EOF
1630 > sub21 = sub21
1630 > sub21 = sub21
1631 > EOF
1631 > EOF
1632 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2'
1632 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2'
1633 adding .hgsub
1633 adding .hgsub
1634 $ hg init parent/sub3
1634 $ hg init parent/sub3
1635 $ echo 3 > parent/sub3/3
1635 $ echo 3 > parent/sub3/3
1636 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3'
1636 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3'
1637 adding 3
1637 adding 3
1638 $ cat > parent/.hgsub <<EOF
1638 $ cat > parent/.hgsub <<EOF
1639 > sub1 = sub1
1639 > sub1 = sub1
1640 > sub2 = sub2
1640 > sub2 = sub2
1641 > sub3 = sub3
1641 > sub3 = sub3
1642 > EOF
1642 > EOF
1643 $ hg -R parent commit -Am '#0 at parent'
1643 $ hg -R parent commit -Am '#0 at parent'
1644 adding .hgsub
1644 adding .hgsub
1645 $ echo '[extensions]' >> parent/.hg/hgrc
1645 $ echo '[extensions]' >> parent/.hg/hgrc
1646 $ echo '# enable extension locally' >> parent/.hg/hgrc
1646 $ echo '# enable extension locally' >> parent/.hg/hgrc
1647 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
1647 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
1648 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
1648 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
1649 $ hg -R parent status -S -A
1649 $ hg -R parent status -S -A
1650 reposetup() for $TESTTMP/reposetup-test/parent
1650 reposetup() for $TESTTMP/reposetup-test/parent
1651 reposetup() for $TESTTMP/reposetup-test/parent/sub2
1651 reposetup() for $TESTTMP/reposetup-test/parent/sub2
1652 C .hgsub
1652 C .hgsub
1653 C .hgsubstate
1653 C .hgsubstate
1654 C sub1/1
1654 C sub1/1
1655 C sub2/.hgsub
1655 C sub2/.hgsub
1656 C sub2/.hgsubstate
1656 C sub2/.hgsubstate
1657 C sub2/sub21/21
1657 C sub2/sub21/21
1658 C sub3/3
1658 C sub3/3
1659
1659
1660 $ cd ..
1660 $ cd ..
1661
1661
1662 Prohibit registration of commands that don't use @command (issue5137)
1662 Prohibit registration of commands that don't use @command (issue5137)
1663
1663
1664 $ hg init deprecated
1664 $ hg init deprecated
1665 $ cd deprecated
1665 $ cd deprecated
1666
1666
1667 $ cat <<EOF > deprecatedcmd.py
1667 $ cat <<EOF > deprecatedcmd.py
1668 > def deprecatedcmd(repo, ui):
1668 > def deprecatedcmd(repo, ui):
1669 > pass
1669 > pass
1670 > cmdtable = {
1670 > cmdtable = {
1671 > b'deprecatedcmd': (deprecatedcmd, [], b''),
1671 > b'deprecatedcmd': (deprecatedcmd, [], b''),
1672 > }
1672 > }
1673 > EOF
1673 > EOF
1674 $ cat <<EOF > .hg/hgrc
1674 $ cat <<EOF > .hg/hgrc
1675 > [extensions]
1675 > [extensions]
1676 > deprecatedcmd = `pwd`/deprecatedcmd.py
1676 > deprecatedcmd = `pwd`/deprecatedcmd.py
1677 > mq = !
1677 > mq = !
1678 > hgext.mq = !
1678 > hgext.mq = !
1679 > hgext/mq = !
1679 > hgext/mq = !
1680 > EOF
1680 > EOF
1681
1681
1682 $ hg deprecatedcmd > /dev/null
1682 $ hg deprecatedcmd > /dev/null
1683 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1683 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1684 *** (use @command decorator to register 'deprecatedcmd')
1684 *** (use @command decorator to register 'deprecatedcmd')
1685 hg: unknown command 'deprecatedcmd'
1685 hg: unknown command 'deprecatedcmd'
1686 (use 'hg help' for a list of commands)
1686 [255]
1687 [255]
1687
1688
1688 the extension shouldn't be loaded at all so the mq works:
1689 the extension shouldn't be loaded at all so the mq works:
1689
1690
1690 $ hg qseries --config extensions.mq= > /dev/null
1691 $ hg qseries --config extensions.mq= > /dev/null
1691 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1692 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1692 *** (use @command decorator to register 'deprecatedcmd')
1693 *** (use @command decorator to register 'deprecatedcmd')
1693
1694
1694 $ cd ..
1695 $ cd ..
1695
1696
1696 Test synopsis and docstring extending
1697 Test synopsis and docstring extending
1697
1698
1698 $ hg init exthelp
1699 $ hg init exthelp
1699 $ cat > exthelp.py <<EOF
1700 $ cat > exthelp.py <<EOF
1700 > from mercurial import commands, extensions
1701 > from mercurial import commands, extensions
1701 > def exbookmarks(orig, *args, **opts):
1702 > def exbookmarks(orig, *args, **opts):
1702 > return orig(*args, **opts)
1703 > return orig(*args, **opts)
1703 > def uisetup(ui):
1704 > def uisetup(ui):
1704 > synopsis = b' GREPME [--foo] [-x]'
1705 > synopsis = b' GREPME [--foo] [-x]'
1705 > docstring = '''
1706 > docstring = '''
1706 > GREPME make sure that this is in the help!
1707 > GREPME make sure that this is in the help!
1707 > '''
1708 > '''
1708 > extensions.wrapcommand(commands.table, b'bookmarks', exbookmarks,
1709 > extensions.wrapcommand(commands.table, b'bookmarks', exbookmarks,
1709 > synopsis, docstring)
1710 > synopsis, docstring)
1710 > EOF
1711 > EOF
1711 $ abspath=`pwd`/exthelp.py
1712 $ abspath=`pwd`/exthelp.py
1712 $ echo '[extensions]' >> $HGRCPATH
1713 $ echo '[extensions]' >> $HGRCPATH
1713 $ echo "exthelp = $abspath" >> $HGRCPATH
1714 $ echo "exthelp = $abspath" >> $HGRCPATH
1714 $ cd exthelp
1715 $ cd exthelp
1715 $ hg help bookmarks | grep GREPME
1716 $ hg help bookmarks | grep GREPME
1716 hg bookmarks [OPTIONS]... [NAME]... GREPME [--foo] [-x]
1717 hg bookmarks [OPTIONS]... [NAME]... GREPME [--foo] [-x]
1717 GREPME make sure that this is in the help!
1718 GREPME make sure that this is in the help!
1718 $ cd ..
1719 $ cd ..
1719
1720
1720 Show deprecation warning for the use of cmdutil.command
1721 Show deprecation warning for the use of cmdutil.command
1721
1722
1722 $ cat > nonregistrar.py <<EOF
1723 $ cat > nonregistrar.py <<EOF
1723 > from mercurial import cmdutil
1724 > from mercurial import cmdutil
1724 > cmdtable = {}
1725 > cmdtable = {}
1725 > command = cmdutil.command(cmdtable)
1726 > command = cmdutil.command(cmdtable)
1726 > @command(b'foo', [], norepo=True)
1727 > @command(b'foo', [], norepo=True)
1727 > def foo(ui):
1728 > def foo(ui):
1728 > pass
1729 > pass
1729 > EOF
1730 > EOF
1730
1731
1731 Prohibit the use of unicode strings as the default value of options
1732 Prohibit the use of unicode strings as the default value of options
1732
1733
1733 $ hg init $TESTTMP/opt-unicode-default
1734 $ hg init $TESTTMP/opt-unicode-default
1734
1735
1735 $ cat > $TESTTMP/test_unicode_default_value.py << EOF
1736 $ cat > $TESTTMP/test_unicode_default_value.py << EOF
1736 > from mercurial import registrar
1737 > from mercurial import registrar
1737 > cmdtable = {}
1738 > cmdtable = {}
1738 > command = registrar.command(cmdtable)
1739 > command = registrar.command(cmdtable)
1739 > @command(b'dummy', [(b'', b'opt', u'value', u'help')], 'ext [OPTIONS]')
1740 > @command(b'dummy', [(b'', b'opt', u'value', u'help')], 'ext [OPTIONS]')
1740 > def ext(*args, **opts):
1741 > def ext(*args, **opts):
1741 > print(opts[b'opt'])
1742 > print(opts[b'opt'])
1742 > EOF
1743 > EOF
1743 $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF
1744 $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF
1744 > [extensions]
1745 > [extensions]
1745 > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py
1746 > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py
1746 > EOF
1747 > EOF
1747 $ hg -R $TESTTMP/opt-unicode-default dummy
1748 $ hg -R $TESTTMP/opt-unicode-default dummy
1748 *** failed to import extension test_unicode_default_value from $TESTTMP/test_unicode_default_value.py: unicode u'value' found in cmdtable.dummy
1749 *** failed to import extension test_unicode_default_value from $TESTTMP/test_unicode_default_value.py: unicode u'value' found in cmdtable.dummy
1749 *** (use b'' to make it byte string)
1750 *** (use b'' to make it byte string)
1750 hg: unknown command 'dummy'
1751 hg: unknown command 'dummy'
1751 (did you mean summary?)
1752 (did you mean summary?)
1752 [255]
1753 [255]
@@ -1,3623 +1,3601 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 Extra extensions will be printed in help output in a non-reliable order since
47 Extra extensions will be printed in help output in a non-reliable order since
48 the extension is unknown.
48 the extension is unknown.
49 #if no-extraextensions
49 #if no-extraextensions
50
50
51 $ hg help
51 $ hg help
52 Mercurial Distributed SCM
52 Mercurial Distributed SCM
53
53
54 list of commands:
54 list of commands:
55
55
56 add add the specified files on the next commit
56 add add the specified files on the next commit
57 addremove add all new files, delete all missing files
57 addremove add all new files, delete all missing files
58 annotate show changeset information by line for each file
58 annotate show changeset information by line for each file
59 archive create an unversioned archive of a repository revision
59 archive create an unversioned archive of a repository revision
60 backout reverse effect of earlier changeset
60 backout reverse effect of earlier changeset
61 bisect subdivision search of changesets
61 bisect subdivision search of changesets
62 bookmarks create a new bookmark or list existing bookmarks
62 bookmarks create a new bookmark or list existing bookmarks
63 branch set or show the current branch name
63 branch set or show the current branch name
64 branches list repository named branches
64 branches list repository named branches
65 bundle create a bundle file
65 bundle create a bundle file
66 cat output the current or given revision of files
66 cat output the current or given revision of files
67 clone make a copy of an existing repository
67 clone make a copy of an existing repository
68 commit commit the specified files or all outstanding changes
68 commit commit the specified files or all outstanding changes
69 config show combined config settings from all hgrc files
69 config show combined config settings from all hgrc files
70 copy mark files as copied for the next commit
70 copy mark files as copied for the next commit
71 diff diff repository (or selected files)
71 diff diff repository (or selected files)
72 export dump the header and diffs for one or more changesets
72 export dump the header and diffs for one or more changesets
73 files list tracked files
73 files list tracked files
74 forget forget the specified files on the next commit
74 forget forget the specified files on the next commit
75 graft copy changes from other branches onto the current branch
75 graft copy changes from other branches onto the current branch
76 grep search revision history for a pattern in specified files
76 grep search revision history for a pattern in specified files
77 heads show branch heads
77 heads show branch heads
78 help show help for a given topic or a help overview
78 help show help for a given topic or a help overview
79 identify identify the working directory or specified revision
79 identify identify the working directory or specified revision
80 import import an ordered set of patches
80 import import an ordered set of patches
81 incoming show new changesets found in source
81 incoming show new changesets found in source
82 init create a new repository in the given directory
82 init create a new repository in the given directory
83 log show revision history of entire repository or files
83 log show revision history of entire repository or files
84 manifest output the current or given revision of the project manifest
84 manifest output the current or given revision of the project manifest
85 merge merge another revision into working directory
85 merge merge another revision into working directory
86 outgoing show changesets not found in the destination
86 outgoing show changesets not found in the destination
87 paths show aliases for remote repositories
87 paths show aliases for remote repositories
88 phase set or show the current phase name
88 phase set or show the current phase name
89 pull pull changes from the specified source
89 pull pull changes from the specified source
90 push push changes to the specified destination
90 push push changes to the specified destination
91 recover roll back an interrupted transaction
91 recover roll back an interrupted transaction
92 remove remove the specified files on the next commit
92 remove remove the specified files on the next commit
93 rename rename files; equivalent of copy + remove
93 rename rename files; equivalent of copy + remove
94 resolve redo merges or set/view the merge status of files
94 resolve redo merges or set/view the merge status of files
95 revert restore files to their checkout state
95 revert restore files to their checkout state
96 root print the root (top) of the current working directory
96 root print the root (top) of the current working directory
97 serve start stand-alone webserver
97 serve start stand-alone webserver
98 status show changed files in the working directory
98 status show changed files in the working directory
99 summary summarize working directory state
99 summary summarize working directory state
100 tag add one or more tags for the current or given revision
100 tag add one or more tags for the current or given revision
101 tags list repository tags
101 tags list repository tags
102 unbundle apply one or more bundle files
102 unbundle apply one or more bundle files
103 update update working directory (or switch revisions)
103 update update working directory (or switch revisions)
104 verify verify the integrity of the repository
104 verify verify the integrity of the repository
105 version output version and copyright information
105 version output version and copyright information
106
106
107 additional help topics:
107 additional help topics:
108
108
109 bundlespec Bundle File Formats
109 bundlespec Bundle File Formats
110 color Colorizing Outputs
110 color Colorizing Outputs
111 config Configuration Files
111 config Configuration Files
112 dates Date Formats
112 dates Date Formats
113 deprecated Deprecated Features
113 deprecated Deprecated Features
114 diffs Diff Formats
114 diffs Diff Formats
115 environment Environment Variables
115 environment Environment Variables
116 extensions Using Additional Features
116 extensions Using Additional Features
117 filesets Specifying File Sets
117 filesets Specifying File Sets
118 flags Command-line flags
118 flags Command-line flags
119 glossary Glossary
119 glossary Glossary
120 hgignore Syntax for Mercurial Ignore Files
120 hgignore Syntax for Mercurial Ignore Files
121 hgweb Configuring hgweb
121 hgweb Configuring hgweb
122 internals Technical implementation topics
122 internals Technical implementation topics
123 merge-tools Merge Tools
123 merge-tools Merge Tools
124 pager Pager Support
124 pager Pager Support
125 patterns File Name Patterns
125 patterns File Name Patterns
126 phases Working with Phases
126 phases Working with Phases
127 revisions Specifying Revisions
127 revisions Specifying Revisions
128 scripting Using Mercurial from scripts and automation
128 scripting Using Mercurial from scripts and automation
129 subrepos Subrepositories
129 subrepos Subrepositories
130 templating Template Usage
130 templating Template Usage
131 urls URL Paths
131 urls URL Paths
132
132
133 (use 'hg help -v' to show built-in aliases and global options)
133 (use 'hg help -v' to show built-in aliases and global options)
134
134
135 $ hg -q help
135 $ hg -q help
136 add add the specified files on the next commit
136 add add the specified files on the next commit
137 addremove add all new files, delete all missing files
137 addremove add all new files, delete all missing files
138 annotate show changeset information by line for each file
138 annotate show changeset information by line for each file
139 archive create an unversioned archive of a repository revision
139 archive create an unversioned archive of a repository revision
140 backout reverse effect of earlier changeset
140 backout reverse effect of earlier changeset
141 bisect subdivision search of changesets
141 bisect subdivision search of changesets
142 bookmarks create a new bookmark or list existing bookmarks
142 bookmarks create a new bookmark or list existing bookmarks
143 branch set or show the current branch name
143 branch set or show the current branch name
144 branches list repository named branches
144 branches list repository named branches
145 bundle create a bundle file
145 bundle create a bundle file
146 cat output the current or given revision of files
146 cat output the current or given revision of files
147 clone make a copy of an existing repository
147 clone make a copy of an existing repository
148 commit commit the specified files or all outstanding changes
148 commit commit the specified files or all outstanding changes
149 config show combined config settings from all hgrc files
149 config show combined config settings from all hgrc files
150 copy mark files as copied for the next commit
150 copy mark files as copied for the next commit
151 diff diff repository (or selected files)
151 diff diff repository (or selected files)
152 export dump the header and diffs for one or more changesets
152 export dump the header and diffs for one or more changesets
153 files list tracked files
153 files list tracked files
154 forget forget the specified files on the next commit
154 forget forget the specified files on the next commit
155 graft copy changes from other branches onto the current branch
155 graft copy changes from other branches onto the current branch
156 grep search revision history for a pattern in specified files
156 grep search revision history for a pattern in specified files
157 heads show branch heads
157 heads show branch heads
158 help show help for a given topic or a help overview
158 help show help for a given topic or a help overview
159 identify identify the working directory or specified revision
159 identify identify the working directory or specified revision
160 import import an ordered set of patches
160 import import an ordered set of patches
161 incoming show new changesets found in source
161 incoming show new changesets found in source
162 init create a new repository in the given directory
162 init create a new repository in the given directory
163 log show revision history of entire repository or files
163 log show revision history of entire repository or files
164 manifest output the current or given revision of the project manifest
164 manifest output the current or given revision of the project manifest
165 merge merge another revision into working directory
165 merge merge another revision into working directory
166 outgoing show changesets not found in the destination
166 outgoing show changesets not found in the destination
167 paths show aliases for remote repositories
167 paths show aliases for remote repositories
168 phase set or show the current phase name
168 phase set or show the current phase name
169 pull pull changes from the specified source
169 pull pull changes from the specified source
170 push push changes to the specified destination
170 push push changes to the specified destination
171 recover roll back an interrupted transaction
171 recover roll back an interrupted transaction
172 remove remove the specified files on the next commit
172 remove remove the specified files on the next commit
173 rename rename files; equivalent of copy + remove
173 rename rename files; equivalent of copy + remove
174 resolve redo merges or set/view the merge status of files
174 resolve redo merges or set/view the merge status of files
175 revert restore files to their checkout state
175 revert restore files to their checkout state
176 root print the root (top) of the current working directory
176 root print the root (top) of the current working directory
177 serve start stand-alone webserver
177 serve start stand-alone webserver
178 status show changed files in the working directory
178 status show changed files in the working directory
179 summary summarize working directory state
179 summary summarize working directory state
180 tag add one or more tags for the current or given revision
180 tag add one or more tags for the current or given revision
181 tags list repository tags
181 tags list repository tags
182 unbundle apply one or more bundle files
182 unbundle apply one or more bundle files
183 update update working directory (or switch revisions)
183 update update working directory (or switch revisions)
184 verify verify the integrity of the repository
184 verify verify the integrity of the repository
185 version output version and copyright information
185 version output version and copyright information
186
186
187 additional help topics:
187 additional help topics:
188
188
189 bundlespec Bundle File Formats
189 bundlespec Bundle File Formats
190 color Colorizing Outputs
190 color Colorizing Outputs
191 config Configuration Files
191 config Configuration Files
192 dates Date Formats
192 dates Date Formats
193 deprecated Deprecated Features
193 deprecated Deprecated Features
194 diffs Diff Formats
194 diffs Diff Formats
195 environment Environment Variables
195 environment Environment Variables
196 extensions Using Additional Features
196 extensions Using Additional Features
197 filesets Specifying File Sets
197 filesets Specifying File Sets
198 flags Command-line flags
198 flags Command-line flags
199 glossary Glossary
199 glossary Glossary
200 hgignore Syntax for Mercurial Ignore Files
200 hgignore Syntax for Mercurial Ignore Files
201 hgweb Configuring hgweb
201 hgweb Configuring hgweb
202 internals Technical implementation topics
202 internals Technical implementation topics
203 merge-tools Merge Tools
203 merge-tools Merge Tools
204 pager Pager Support
204 pager Pager Support
205 patterns File Name Patterns
205 patterns File Name Patterns
206 phases Working with Phases
206 phases Working with Phases
207 revisions Specifying Revisions
207 revisions Specifying Revisions
208 scripting Using Mercurial from scripts and automation
208 scripting Using Mercurial from scripts and automation
209 subrepos Subrepositories
209 subrepos Subrepositories
210 templating Template Usage
210 templating Template Usage
211 urls URL Paths
211 urls URL Paths
212
212
213 Test extension help:
213 Test extension help:
214 $ hg help extensions --config extensions.rebase= --config extensions.children=
214 $ hg help extensions --config extensions.rebase= --config extensions.children=
215 Using Additional Features
215 Using Additional Features
216 """""""""""""""""""""""""
216 """""""""""""""""""""""""
217
217
218 Mercurial has the ability to add new features through the use of
218 Mercurial has the ability to add new features through the use of
219 extensions. Extensions may add new commands, add options to existing
219 extensions. Extensions may add new commands, add options to existing
220 commands, change the default behavior of commands, or implement hooks.
220 commands, change the default behavior of commands, or implement hooks.
221
221
222 To enable the "foo" extension, either shipped with Mercurial or in the
222 To enable the "foo" extension, either shipped with Mercurial or in the
223 Python search path, create an entry for it in your configuration file,
223 Python search path, create an entry for it in your configuration file,
224 like this:
224 like this:
225
225
226 [extensions]
226 [extensions]
227 foo =
227 foo =
228
228
229 You may also specify the full path to an extension:
229 You may also specify the full path to an extension:
230
230
231 [extensions]
231 [extensions]
232 myfeature = ~/.hgext/myfeature.py
232 myfeature = ~/.hgext/myfeature.py
233
233
234 See 'hg help config' for more information on configuration files.
234 See 'hg help config' for more information on configuration files.
235
235
236 Extensions are not loaded by default for a variety of reasons: they can
236 Extensions are not loaded by default for a variety of reasons: they can
237 increase startup overhead; they may be meant for advanced usage only; they
237 increase startup overhead; they may be meant for advanced usage only; they
238 may provide potentially dangerous abilities (such as letting you destroy
238 may provide potentially dangerous abilities (such as letting you destroy
239 or modify history); they might not be ready for prime time; or they may
239 or modify history); they might not be ready for prime time; or they may
240 alter some usual behaviors of stock Mercurial. It is thus up to the user
240 alter some usual behaviors of stock Mercurial. It is thus up to the user
241 to activate extensions as needed.
241 to activate extensions as needed.
242
242
243 To explicitly disable an extension enabled in a configuration file of
243 To explicitly disable an extension enabled in a configuration file of
244 broader scope, prepend its path with !:
244 broader scope, prepend its path with !:
245
245
246 [extensions]
246 [extensions]
247 # disabling extension bar residing in /path/to/extension/bar.py
247 # disabling extension bar residing in /path/to/extension/bar.py
248 bar = !/path/to/extension/bar.py
248 bar = !/path/to/extension/bar.py
249 # ditto, but no path was supplied for extension baz
249 # ditto, but no path was supplied for extension baz
250 baz = !
250 baz = !
251
251
252 enabled extensions:
252 enabled extensions:
253
253
254 children command to display child changesets (DEPRECATED)
254 children command to display child changesets (DEPRECATED)
255 rebase command to move sets of revisions to a different ancestor
255 rebase command to move sets of revisions to a different ancestor
256
256
257 disabled extensions:
257 disabled extensions:
258
258
259 acl hooks for controlling repository access
259 acl hooks for controlling repository access
260 blackbox log repository events to a blackbox for debugging
260 blackbox log repository events to a blackbox for debugging
261 bugzilla hooks for integrating with the Bugzilla bug tracker
261 bugzilla hooks for integrating with the Bugzilla bug tracker
262 censor erase file content at a given revision
262 censor erase file content at a given revision
263 churn command to display statistics about repository history
263 churn command to display statistics about repository history
264 clonebundles advertise pre-generated bundles to seed clones
264 clonebundles advertise pre-generated bundles to seed clones
265 convert import revisions from foreign VCS repositories into
265 convert import revisions from foreign VCS repositories into
266 Mercurial
266 Mercurial
267 eol automatically manage newlines in repository files
267 eol automatically manage newlines in repository files
268 extdiff command to allow external programs to compare revisions
268 extdiff command to allow external programs to compare revisions
269 factotum http authentication with factotum
269 factotum http authentication with factotum
270 githelp try mapping git commands to Mercurial commands
270 githelp try mapping git commands to Mercurial commands
271 gpg commands to sign and verify changesets
271 gpg commands to sign and verify changesets
272 hgk browse the repository in a graphical way
272 hgk browse the repository in a graphical way
273 highlight syntax highlighting for hgweb (requires Pygments)
273 highlight syntax highlighting for hgweb (requires Pygments)
274 histedit interactive history editing
274 histedit interactive history editing
275 keyword expand keywords in tracked files
275 keyword expand keywords in tracked files
276 largefiles track large binary files
276 largefiles track large binary files
277 mq manage a stack of patches
277 mq manage a stack of patches
278 notify hooks for sending email push notifications
278 notify hooks for sending email push notifications
279 patchbomb command to send changesets as (a series of) patch emails
279 patchbomb command to send changesets as (a series of) patch emails
280 purge command to delete untracked files from the working
280 purge command to delete untracked files from the working
281 directory
281 directory
282 relink recreates hardlinks between repository clones
282 relink recreates hardlinks between repository clones
283 schemes extend schemes with shortcuts to repository swarms
283 schemes extend schemes with shortcuts to repository swarms
284 share share a common history between several working directories
284 share share a common history between several working directories
285 shelve save and restore changes to the working directory
285 shelve save and restore changes to the working directory
286 strip strip changesets and their descendants from history
286 strip strip changesets and their descendants from history
287 transplant command to transplant changesets from another branch
287 transplant command to transplant changesets from another branch
288 win32mbcs allow the use of MBCS paths with problematic encodings
288 win32mbcs allow the use of MBCS paths with problematic encodings
289 zeroconf discover and advertise repositories on the local network
289 zeroconf discover and advertise repositories on the local network
290
290
291 #endif
291 #endif
292
292
293 Verify that deprecated extensions are included if --verbose:
293 Verify that deprecated extensions are included if --verbose:
294
294
295 $ hg -v help extensions | grep children
295 $ hg -v help extensions | grep children
296 children command to display child changesets (DEPRECATED)
296 children command to display child changesets (DEPRECATED)
297
297
298 Verify that extension keywords appear in help templates
298 Verify that extension keywords appear in help templates
299
299
300 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
300 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
301
301
302 Test short command list with verbose option
302 Test short command list with verbose option
303
303
304 $ hg -v help shortlist
304 $ hg -v help shortlist
305 Mercurial Distributed SCM
305 Mercurial Distributed SCM
306
306
307 basic commands:
307 basic commands:
308
308
309 add add the specified files on the next commit
309 add add the specified files on the next commit
310 annotate, blame
310 annotate, blame
311 show changeset information by line for each file
311 show changeset information by line for each file
312 clone make a copy of an existing repository
312 clone make a copy of an existing repository
313 commit, ci commit the specified files or all outstanding changes
313 commit, ci commit the specified files or all outstanding changes
314 diff diff repository (or selected files)
314 diff diff repository (or selected files)
315 export dump the header and diffs for one or more changesets
315 export dump the header and diffs for one or more changesets
316 forget forget the specified files on the next commit
316 forget forget the specified files on the next commit
317 init create a new repository in the given directory
317 init create a new repository in the given directory
318 log, history show revision history of entire repository or files
318 log, history show revision history of entire repository or files
319 merge merge another revision into working directory
319 merge merge another revision into working directory
320 pull pull changes from the specified source
320 pull pull changes from the specified source
321 push push changes to the specified destination
321 push push changes to the specified destination
322 remove, rm remove the specified files on the next commit
322 remove, rm remove the specified files on the next commit
323 serve start stand-alone webserver
323 serve start stand-alone webserver
324 status, st show changed files in the working directory
324 status, st show changed files in the working directory
325 summary, sum summarize working directory state
325 summary, sum summarize working directory state
326 update, up, checkout, co
326 update, up, checkout, co
327 update working directory (or switch revisions)
327 update working directory (or switch revisions)
328
328
329 global options ([+] can be repeated):
329 global options ([+] can be repeated):
330
330
331 -R --repository REPO repository root directory or name of overlay bundle
331 -R --repository REPO repository root directory or name of overlay bundle
332 file
332 file
333 --cwd DIR change working directory
333 --cwd DIR change working directory
334 -y --noninteractive do not prompt, automatically pick the first choice for
334 -y --noninteractive do not prompt, automatically pick the first choice for
335 all prompts
335 all prompts
336 -q --quiet suppress output
336 -q --quiet suppress output
337 -v --verbose enable additional output
337 -v --verbose enable additional output
338 --color TYPE when to colorize (boolean, always, auto, never, or
338 --color TYPE when to colorize (boolean, always, auto, never, or
339 debug)
339 debug)
340 --config CONFIG [+] set/override config option (use 'section.name=value')
340 --config CONFIG [+] set/override config option (use 'section.name=value')
341 --debug enable debugging output
341 --debug enable debugging output
342 --debugger start debugger
342 --debugger start debugger
343 --encoding ENCODE set the charset encoding (default: ascii)
343 --encoding ENCODE set the charset encoding (default: ascii)
344 --encodingmode MODE set the charset encoding mode (default: strict)
344 --encodingmode MODE set the charset encoding mode (default: strict)
345 --traceback always print a traceback on exception
345 --traceback always print a traceback on exception
346 --time time how long the command takes
346 --time time how long the command takes
347 --profile print command execution profile
347 --profile print command execution profile
348 --version output version information and exit
348 --version output version information and exit
349 -h --help display help and exit
349 -h --help display help and exit
350 --hidden consider hidden changesets
350 --hidden consider hidden changesets
351 --pager TYPE when to paginate (boolean, always, auto, or never)
351 --pager TYPE when to paginate (boolean, always, auto, or never)
352 (default: auto)
352 (default: auto)
353
353
354 (use 'hg help' for the full list of commands)
354 (use 'hg help' for the full list of commands)
355
355
356 $ hg add -h
356 $ hg add -h
357 hg add [OPTION]... [FILE]...
357 hg add [OPTION]... [FILE]...
358
358
359 add the specified files on the next commit
359 add the specified files on the next commit
360
360
361 Schedule files to be version controlled and added to the repository.
361 Schedule files to be version controlled and added to the repository.
362
362
363 The files will be added to the repository at the next commit. To undo an
363 The files will be added to the repository at the next commit. To undo an
364 add before that, see 'hg forget'.
364 add before that, see 'hg forget'.
365
365
366 If no names are given, add all files to the repository (except files
366 If no names are given, add all files to the repository (except files
367 matching ".hgignore").
367 matching ".hgignore").
368
368
369 Returns 0 if all files are successfully added.
369 Returns 0 if all files are successfully added.
370
370
371 options ([+] can be repeated):
371 options ([+] can be repeated):
372
372
373 -I --include PATTERN [+] include names matching the given patterns
373 -I --include PATTERN [+] include names matching the given patterns
374 -X --exclude PATTERN [+] exclude names matching the given patterns
374 -X --exclude PATTERN [+] exclude names matching the given patterns
375 -S --subrepos recurse into subrepositories
375 -S --subrepos recurse into subrepositories
376 -n --dry-run do not perform actions, just print output
376 -n --dry-run do not perform actions, just print output
377
377
378 (some details hidden, use --verbose to show complete help)
378 (some details hidden, use --verbose to show complete help)
379
379
380 Verbose help for add
380 Verbose help for add
381
381
382 $ hg add -hv
382 $ hg add -hv
383 hg add [OPTION]... [FILE]...
383 hg add [OPTION]... [FILE]...
384
384
385 add the specified files on the next commit
385 add the specified files on the next commit
386
386
387 Schedule files to be version controlled and added to the repository.
387 Schedule files to be version controlled and added to the repository.
388
388
389 The files will be added to the repository at the next commit. To undo an
389 The files will be added to the repository at the next commit. To undo an
390 add before that, see 'hg forget'.
390 add before that, see 'hg forget'.
391
391
392 If no names are given, add all files to the repository (except files
392 If no names are given, add all files to the repository (except files
393 matching ".hgignore").
393 matching ".hgignore").
394
394
395 Examples:
395 Examples:
396
396
397 - New (unknown) files are added automatically by 'hg add':
397 - New (unknown) files are added automatically by 'hg add':
398
398
399 $ ls
399 $ ls
400 foo.c
400 foo.c
401 $ hg status
401 $ hg status
402 ? foo.c
402 ? foo.c
403 $ hg add
403 $ hg add
404 adding foo.c
404 adding foo.c
405 $ hg status
405 $ hg status
406 A foo.c
406 A foo.c
407
407
408 - Specific files to be added can be specified:
408 - Specific files to be added can be specified:
409
409
410 $ ls
410 $ ls
411 bar.c foo.c
411 bar.c foo.c
412 $ hg status
412 $ hg status
413 ? bar.c
413 ? bar.c
414 ? foo.c
414 ? foo.c
415 $ hg add bar.c
415 $ hg add bar.c
416 $ hg status
416 $ hg status
417 A bar.c
417 A bar.c
418 ? foo.c
418 ? foo.c
419
419
420 Returns 0 if all files are successfully added.
420 Returns 0 if all files are successfully added.
421
421
422 options ([+] can be repeated):
422 options ([+] can be repeated):
423
423
424 -I --include PATTERN [+] include names matching the given patterns
424 -I --include PATTERN [+] include names matching the given patterns
425 -X --exclude PATTERN [+] exclude names matching the given patterns
425 -X --exclude PATTERN [+] exclude names matching the given patterns
426 -S --subrepos recurse into subrepositories
426 -S --subrepos recurse into subrepositories
427 -n --dry-run do not perform actions, just print output
427 -n --dry-run do not perform actions, just print output
428
428
429 global options ([+] can be repeated):
429 global options ([+] can be repeated):
430
430
431 -R --repository REPO repository root directory or name of overlay bundle
431 -R --repository REPO repository root directory or name of overlay bundle
432 file
432 file
433 --cwd DIR change working directory
433 --cwd DIR change working directory
434 -y --noninteractive do not prompt, automatically pick the first choice for
434 -y --noninteractive do not prompt, automatically pick the first choice for
435 all prompts
435 all prompts
436 -q --quiet suppress output
436 -q --quiet suppress output
437 -v --verbose enable additional output
437 -v --verbose enable additional output
438 --color TYPE when to colorize (boolean, always, auto, never, or
438 --color TYPE when to colorize (boolean, always, auto, never, or
439 debug)
439 debug)
440 --config CONFIG [+] set/override config option (use 'section.name=value')
440 --config CONFIG [+] set/override config option (use 'section.name=value')
441 --debug enable debugging output
441 --debug enable debugging output
442 --debugger start debugger
442 --debugger start debugger
443 --encoding ENCODE set the charset encoding (default: ascii)
443 --encoding ENCODE set the charset encoding (default: ascii)
444 --encodingmode MODE set the charset encoding mode (default: strict)
444 --encodingmode MODE set the charset encoding mode (default: strict)
445 --traceback always print a traceback on exception
445 --traceback always print a traceback on exception
446 --time time how long the command takes
446 --time time how long the command takes
447 --profile print command execution profile
447 --profile print command execution profile
448 --version output version information and exit
448 --version output version information and exit
449 -h --help display help and exit
449 -h --help display help and exit
450 --hidden consider hidden changesets
450 --hidden consider hidden changesets
451 --pager TYPE when to paginate (boolean, always, auto, or never)
451 --pager TYPE when to paginate (boolean, always, auto, or never)
452 (default: auto)
452 (default: auto)
453
453
454 Test the textwidth config option
454 Test the textwidth config option
455
455
456 $ hg root -h --config ui.textwidth=50
456 $ hg root -h --config ui.textwidth=50
457 hg root
457 hg root
458
458
459 print the root (top) of the current working
459 print the root (top) of the current working
460 directory
460 directory
461
461
462 Print the root directory of the current
462 Print the root directory of the current
463 repository.
463 repository.
464
464
465 Returns 0 on success.
465 Returns 0 on success.
466
466
467 (some details hidden, use --verbose to show
467 (some details hidden, use --verbose to show
468 complete help)
468 complete help)
469
469
470 Test help option with version option
470 Test help option with version option
471
471
472 $ hg add -h --version
472 $ hg add -h --version
473 Mercurial Distributed SCM (version *) (glob)
473 Mercurial Distributed SCM (version *) (glob)
474 (see https://mercurial-scm.org for more information)
474 (see https://mercurial-scm.org for more information)
475
475
476 Copyright (C) 2005-* Matt Mackall and others (glob)
476 Copyright (C) 2005-* Matt Mackall and others (glob)
477 This is free software; see the source for copying conditions. There is NO
477 This is free software; see the source for copying conditions. There is NO
478 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
478 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
479
479
480 $ hg add --skjdfks
480 $ hg add --skjdfks
481 hg add: option --skjdfks not recognized
481 hg add: option --skjdfks not recognized
482 hg add [OPTION]... [FILE]...
482 hg add [OPTION]... [FILE]...
483
483
484 add the specified files on the next commit
484 add the specified files on the next commit
485
485
486 options ([+] can be repeated):
486 options ([+] can be repeated):
487
487
488 -I --include PATTERN [+] include names matching the given patterns
488 -I --include PATTERN [+] include names matching the given patterns
489 -X --exclude PATTERN [+] exclude names matching the given patterns
489 -X --exclude PATTERN [+] exclude names matching the given patterns
490 -S --subrepos recurse into subrepositories
490 -S --subrepos recurse into subrepositories
491 -n --dry-run do not perform actions, just print output
491 -n --dry-run do not perform actions, just print output
492
492
493 (use 'hg add -h' to show more help)
493 (use 'hg add -h' to show more help)
494 [255]
494 [255]
495
495
496 Test ambiguous command help
496 Test ambiguous command help
497
497
498 $ hg help ad
498 $ hg help ad
499 list of commands:
499 list of commands:
500
500
501 add add the specified files on the next commit
501 add add the specified files on the next commit
502 addremove add all new files, delete all missing files
502 addremove add all new files, delete all missing files
503
503
504 (use 'hg help -v ad' to show built-in aliases and global options)
504 (use 'hg help -v ad' to show built-in aliases and global options)
505
505
506 Test command without options
506 Test command without options
507
507
508 $ hg help verify
508 $ hg help verify
509 hg verify
509 hg verify
510
510
511 verify the integrity of the repository
511 verify the integrity of the repository
512
512
513 Verify the integrity of the current repository.
513 Verify the integrity of the current repository.
514
514
515 This will perform an extensive check of the repository's integrity,
515 This will perform an extensive check of the repository's integrity,
516 validating the hashes and checksums of each entry in the changelog,
516 validating the hashes and checksums of each entry in the changelog,
517 manifest, and tracked files, as well as the integrity of their crosslinks
517 manifest, and tracked files, as well as the integrity of their crosslinks
518 and indices.
518 and indices.
519
519
520 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
520 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
521 information about recovery from corruption of the repository.
521 information about recovery from corruption of the repository.
522
522
523 Returns 0 on success, 1 if errors are encountered.
523 Returns 0 on success, 1 if errors are encountered.
524
524
525 (some details hidden, use --verbose to show complete help)
525 (some details hidden, use --verbose to show complete help)
526
526
527 $ hg help diff
527 $ hg help diff
528 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
528 hg diff [OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...
529
529
530 diff repository (or selected files)
530 diff repository (or selected files)
531
531
532 Show differences between revisions for the specified files.
532 Show differences between revisions for the specified files.
533
533
534 Differences between files are shown using the unified diff format.
534 Differences between files are shown using the unified diff format.
535
535
536 Note:
536 Note:
537 'hg diff' may generate unexpected results for merges, as it will
537 'hg diff' may generate unexpected results for merges, as it will
538 default to comparing against the working directory's first parent
538 default to comparing against the working directory's first parent
539 changeset if no revisions are specified.
539 changeset if no revisions are specified.
540
540
541 When two revision arguments are given, then changes are shown between
541 When two revision arguments are given, then changes are shown between
542 those revisions. If only one revision is specified then that revision is
542 those revisions. If only one revision is specified then that revision is
543 compared to the working directory, and, when no revisions are specified,
543 compared to the working directory, and, when no revisions are specified,
544 the working directory files are compared to its first parent.
544 the working directory files are compared to its first parent.
545
545
546 Alternatively you can specify -c/--change with a revision to see the
546 Alternatively you can specify -c/--change with a revision to see the
547 changes in that changeset relative to its first parent.
547 changes in that changeset relative to its first parent.
548
548
549 Without the -a/--text option, diff will avoid generating diffs of files it
549 Without the -a/--text option, diff will avoid generating diffs of files it
550 detects as binary. With -a, diff will generate a diff anyway, probably
550 detects as binary. With -a, diff will generate a diff anyway, probably
551 with undesirable results.
551 with undesirable results.
552
552
553 Use the -g/--git option to generate diffs in the git extended diff format.
553 Use the -g/--git option to generate diffs in the git extended diff format.
554 For more information, read 'hg help diffs'.
554 For more information, read 'hg help diffs'.
555
555
556 Returns 0 on success.
556 Returns 0 on success.
557
557
558 options ([+] can be repeated):
558 options ([+] can be repeated):
559
559
560 -r --rev REV [+] revision
560 -r --rev REV [+] revision
561 -c --change REV change made by revision
561 -c --change REV change made by revision
562 -a --text treat all files as text
562 -a --text treat all files as text
563 -g --git use git extended diff format
563 -g --git use git extended diff format
564 --binary generate binary diffs in git mode (default)
564 --binary generate binary diffs in git mode (default)
565 --nodates omit dates from diff headers
565 --nodates omit dates from diff headers
566 --noprefix omit a/ and b/ prefixes from filenames
566 --noprefix omit a/ and b/ prefixes from filenames
567 -p --show-function show which function each change is in
567 -p --show-function show which function each change is in
568 --reverse produce a diff that undoes the changes
568 --reverse produce a diff that undoes the changes
569 -w --ignore-all-space ignore white space when comparing lines
569 -w --ignore-all-space ignore white space when comparing lines
570 -b --ignore-space-change ignore changes in the amount of white space
570 -b --ignore-space-change ignore changes in the amount of white space
571 -B --ignore-blank-lines ignore changes whose lines are all blank
571 -B --ignore-blank-lines ignore changes whose lines are all blank
572 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
572 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
573 -U --unified NUM number of lines of context to show
573 -U --unified NUM number of lines of context to show
574 --stat output diffstat-style summary of changes
574 --stat output diffstat-style summary of changes
575 --root DIR produce diffs relative to subdirectory
575 --root DIR produce diffs relative to subdirectory
576 -I --include PATTERN [+] include names matching the given patterns
576 -I --include PATTERN [+] include names matching the given patterns
577 -X --exclude PATTERN [+] exclude names matching the given patterns
577 -X --exclude PATTERN [+] exclude names matching the given patterns
578 -S --subrepos recurse into subrepositories
578 -S --subrepos recurse into subrepositories
579
579
580 (some details hidden, use --verbose to show complete help)
580 (some details hidden, use --verbose to show complete help)
581
581
582 $ hg help status
582 $ hg help status
583 hg status [OPTION]... [FILE]...
583 hg status [OPTION]... [FILE]...
584
584
585 aliases: st
585 aliases: st
586
586
587 show changed files in the working directory
587 show changed files in the working directory
588
588
589 Show status of files in the repository. If names are given, only files
589 Show status of files in the repository. If names are given, only files
590 that match are shown. Files that are clean or ignored or the source of a
590 that match are shown. Files that are clean or ignored or the source of a
591 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
591 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
592 -C/--copies or -A/--all are given. Unless options described with "show
592 -C/--copies or -A/--all are given. Unless options described with "show
593 only ..." are given, the options -mardu are used.
593 only ..." are given, the options -mardu are used.
594
594
595 Option -q/--quiet hides untracked (unknown and ignored) files unless
595 Option -q/--quiet hides untracked (unknown and ignored) files unless
596 explicitly requested with -u/--unknown or -i/--ignored.
596 explicitly requested with -u/--unknown or -i/--ignored.
597
597
598 Note:
598 Note:
599 'hg status' may appear to disagree with diff if permissions have
599 'hg status' may appear to disagree with diff if permissions have
600 changed or a merge has occurred. The standard diff format does not
600 changed or a merge has occurred. The standard diff format does not
601 report permission changes and diff only reports changes relative to one
601 report permission changes and diff only reports changes relative to one
602 merge parent.
602 merge parent.
603
603
604 If one revision is given, it is used as the base revision. If two
604 If one revision is given, it is used as the base revision. If two
605 revisions are given, the differences between them are shown. The --change
605 revisions are given, the differences between them are shown. The --change
606 option can also be used as a shortcut to list the changed files of a
606 option can also be used as a shortcut to list the changed files of a
607 revision from its first parent.
607 revision from its first parent.
608
608
609 The codes used to show the status of files are:
609 The codes used to show the status of files are:
610
610
611 M = modified
611 M = modified
612 A = added
612 A = added
613 R = removed
613 R = removed
614 C = clean
614 C = clean
615 ! = missing (deleted by non-hg command, but still tracked)
615 ! = missing (deleted by non-hg command, but still tracked)
616 ? = not tracked
616 ? = not tracked
617 I = ignored
617 I = ignored
618 = origin of the previous file (with --copies)
618 = origin of the previous file (with --copies)
619
619
620 Returns 0 on success.
620 Returns 0 on success.
621
621
622 options ([+] can be repeated):
622 options ([+] can be repeated):
623
623
624 -A --all show status of all files
624 -A --all show status of all files
625 -m --modified show only modified files
625 -m --modified show only modified files
626 -a --added show only added files
626 -a --added show only added files
627 -r --removed show only removed files
627 -r --removed show only removed files
628 -d --deleted show only deleted (but tracked) files
628 -d --deleted show only deleted (but tracked) files
629 -c --clean show only files without changes
629 -c --clean show only files without changes
630 -u --unknown show only unknown (not tracked) files
630 -u --unknown show only unknown (not tracked) files
631 -i --ignored show only ignored files
631 -i --ignored show only ignored files
632 -n --no-status hide status prefix
632 -n --no-status hide status prefix
633 -C --copies show source of copied files
633 -C --copies show source of copied files
634 -0 --print0 end filenames with NUL, for use with xargs
634 -0 --print0 end filenames with NUL, for use with xargs
635 --rev REV [+] show difference from revision
635 --rev REV [+] show difference from revision
636 --change REV list the changed files of a revision
636 --change REV list the changed files of a revision
637 -I --include PATTERN [+] include names matching the given patterns
637 -I --include PATTERN [+] include names matching the given patterns
638 -X --exclude PATTERN [+] exclude names matching the given patterns
638 -X --exclude PATTERN [+] exclude names matching the given patterns
639 -S --subrepos recurse into subrepositories
639 -S --subrepos recurse into subrepositories
640
640
641 (some details hidden, use --verbose to show complete help)
641 (some details hidden, use --verbose to show complete help)
642
642
643 $ hg -q help status
643 $ hg -q help status
644 hg status [OPTION]... [FILE]...
644 hg status [OPTION]... [FILE]...
645
645
646 show changed files in the working directory
646 show changed files in the working directory
647
647
648 $ hg help foo
648 $ hg help foo
649 abort: no such help topic: foo
649 abort: no such help topic: foo
650 (try 'hg help --keyword foo')
650 (try 'hg help --keyword foo')
651 [255]
651 [255]
652
652
653 $ hg skjdfks
653 $ hg skjdfks
654 hg: unknown command 'skjdfks'
654 hg: unknown command 'skjdfks'
655 Mercurial Distributed SCM
655 (use 'hg help' for a list of commands)
656
657 basic commands:
658
659 add add the specified files on the next commit
660 annotate show changeset information by line for each file
661 clone make a copy of an existing repository
662 commit commit the specified files or all outstanding changes
663 diff diff repository (or selected files)
664 export dump the header and diffs for one or more changesets
665 forget forget the specified files on the next commit
666 init create a new repository in the given directory
667 log show revision history of entire repository or files
668 merge merge another revision into working directory
669 pull pull changes from the specified source
670 push push changes to the specified destination
671 remove remove the specified files on the next commit
672 serve start stand-alone webserver
673 status show changed files in the working directory
674 summary summarize working directory state
675 update update working directory (or switch revisions)
676
677 (use 'hg help' for the full list of commands or 'hg -v' for details)
678 [255]
656 [255]
679
657
680 Typoed command gives suggestion
658 Typoed command gives suggestion
681 $ hg puls
659 $ hg puls
682 hg: unknown command 'puls'
660 hg: unknown command 'puls'
683 (did you mean one of pull, push?)
661 (did you mean one of pull, push?)
684 [255]
662 [255]
685
663
686 Not enabled extension gets suggested
664 Not enabled extension gets suggested
687
665
688 $ hg rebase
666 $ hg rebase
689 hg: unknown command 'rebase'
667 hg: unknown command 'rebase'
690 'rebase' is provided by the following extension:
668 'rebase' is provided by the following extension:
691
669
692 rebase command to move sets of revisions to a different ancestor
670 rebase command to move sets of revisions to a different ancestor
693
671
694 (use 'hg help extensions' for information on enabling extensions)
672 (use 'hg help extensions' for information on enabling extensions)
695 [255]
673 [255]
696
674
697 Disabled extension gets suggested
675 Disabled extension gets suggested
698 $ hg --config extensions.rebase=! rebase
676 $ hg --config extensions.rebase=! rebase
699 hg: unknown command 'rebase'
677 hg: unknown command 'rebase'
700 'rebase' is provided by the following extension:
678 'rebase' is provided by the following extension:
701
679
702 rebase command to move sets of revisions to a different ancestor
680 rebase command to move sets of revisions to a different ancestor
703
681
704 (use 'hg help extensions' for information on enabling extensions)
682 (use 'hg help extensions' for information on enabling extensions)
705 [255]
683 [255]
706
684
707 Make sure that we don't run afoul of the help system thinking that
685 Make sure that we don't run afoul of the help system thinking that
708 this is a section and erroring out weirdly.
686 this is a section and erroring out weirdly.
709
687
710 $ hg .log
688 $ hg .log
711 hg: unknown command '.log'
689 hg: unknown command '.log'
712 (did you mean log?)
690 (did you mean log?)
713 [255]
691 [255]
714
692
715 $ hg log.
693 $ hg log.
716 hg: unknown command 'log.'
694 hg: unknown command 'log.'
717 (did you mean log?)
695 (did you mean log?)
718 [255]
696 [255]
719 $ hg pu.lh
697 $ hg pu.lh
720 hg: unknown command 'pu.lh'
698 hg: unknown command 'pu.lh'
721 (did you mean one of pull, push?)
699 (did you mean one of pull, push?)
722 [255]
700 [255]
723
701
724 $ cat > helpext.py <<EOF
702 $ cat > helpext.py <<EOF
725 > import os
703 > import os
726 > from mercurial import commands, fancyopts, registrar
704 > from mercurial import commands, fancyopts, registrar
727 >
705 >
728 > def func(arg):
706 > def func(arg):
729 > return '%sfoo' % arg
707 > return '%sfoo' % arg
730 > class customopt(fancyopts.customopt):
708 > class customopt(fancyopts.customopt):
731 > def newstate(self, oldstate, newparam, abort):
709 > def newstate(self, oldstate, newparam, abort):
732 > return '%sbar' % oldstate
710 > return '%sbar' % oldstate
733 > cmdtable = {}
711 > cmdtable = {}
734 > command = registrar.command(cmdtable)
712 > command = registrar.command(cmdtable)
735 >
713 >
736 > @command(b'nohelp',
714 > @command(b'nohelp',
737 > [(b'', b'longdesc', 3, b'x'*67),
715 > [(b'', b'longdesc', 3, b'x'*67),
738 > (b'n', b'', None, b'normal desc'),
716 > (b'n', b'', None, b'normal desc'),
739 > (b'', b'newline', b'', b'line1\nline2'),
717 > (b'', b'newline', b'', b'line1\nline2'),
740 > (b'', b'callableopt', func, b'adds foo'),
718 > (b'', b'callableopt', func, b'adds foo'),
741 > (b'', b'customopt', customopt(''), b'adds bar'),
719 > (b'', b'customopt', customopt(''), b'adds bar'),
742 > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')],
720 > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')],
743 > b'hg nohelp',
721 > b'hg nohelp',
744 > norepo=True)
722 > norepo=True)
745 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
723 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
746 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
724 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
747 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
725 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
748 > def nohelp(ui, *args, **kwargs):
726 > def nohelp(ui, *args, **kwargs):
749 > pass
727 > pass
750 >
728 >
751 > def uisetup(ui):
729 > def uisetup(ui):
752 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
730 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
753 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
731 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
754 >
732 >
755 > EOF
733 > EOF
756 $ echo '[extensions]' >> $HGRCPATH
734 $ echo '[extensions]' >> $HGRCPATH
757 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
735 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
758
736
759 Test for aliases
737 Test for aliases
760
738
761 $ hg help hgalias
739 $ hg help hgalias
762 hg hgalias [--remote]
740 hg hgalias [--remote]
763
741
764 alias for: hg summary
742 alias for: hg summary
765
743
766 summarize working directory state
744 summarize working directory state
767
745
768 This generates a brief summary of the working directory state, including
746 This generates a brief summary of the working directory state, including
769 parents, branch, commit status, phase and available updates.
747 parents, branch, commit status, phase and available updates.
770
748
771 With the --remote option, this will check the default paths for incoming
749 With the --remote option, this will check the default paths for incoming
772 and outgoing changes. This can be time-consuming.
750 and outgoing changes. This can be time-consuming.
773
751
774 Returns 0 on success.
752 Returns 0 on success.
775
753
776 defined by: helpext
754 defined by: helpext
777
755
778 options:
756 options:
779
757
780 --remote check for push and pull
758 --remote check for push and pull
781
759
782 (some details hidden, use --verbose to show complete help)
760 (some details hidden, use --verbose to show complete help)
783
761
784 $ hg help shellalias
762 $ hg help shellalias
785 hg shellalias
763 hg shellalias
786
764
787 shell alias for: echo hi
765 shell alias for: echo hi
788
766
789 (no help text available)
767 (no help text available)
790
768
791 defined by: helpext
769 defined by: helpext
792
770
793 (some details hidden, use --verbose to show complete help)
771 (some details hidden, use --verbose to show complete help)
794
772
795 Test command with no help text
773 Test command with no help text
796
774
797 $ hg help nohelp
775 $ hg help nohelp
798 hg nohelp
776 hg nohelp
799
777
800 (no help text available)
778 (no help text available)
801
779
802 options:
780 options:
803
781
804 --longdesc VALUE
782 --longdesc VALUE
805 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
783 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
806 xxxxxxxxxxxxxxxxxxxxxxx (default: 3)
784 xxxxxxxxxxxxxxxxxxxxxxx (default: 3)
807 -n -- normal desc
785 -n -- normal desc
808 --newline VALUE line1 line2
786 --newline VALUE line1 line2
809 --callableopt VALUE adds foo
787 --callableopt VALUE adds foo
810 --customopt VALUE adds bar
788 --customopt VALUE adds bar
811 --customopt-withdefault VALUE adds bar (default: foo)
789 --customopt-withdefault VALUE adds bar (default: foo)
812
790
813 (some details hidden, use --verbose to show complete help)
791 (some details hidden, use --verbose to show complete help)
814
792
815 $ hg help -k nohelp
793 $ hg help -k nohelp
816 Commands:
794 Commands:
817
795
818 nohelp hg nohelp
796 nohelp hg nohelp
819
797
820 Extension Commands:
798 Extension Commands:
821
799
822 nohelp (no help text available)
800 nohelp (no help text available)
823
801
824 Test that default list of commands omits extension commands
802 Test that default list of commands omits extension commands
825
803
826 #if no-extraextensions
804 #if no-extraextensions
827
805
828 $ hg help
806 $ hg help
829 Mercurial Distributed SCM
807 Mercurial Distributed SCM
830
808
831 list of commands:
809 list of commands:
832
810
833 add add the specified files on the next commit
811 add add the specified files on the next commit
834 addremove add all new files, delete all missing files
812 addremove add all new files, delete all missing files
835 annotate show changeset information by line for each file
813 annotate show changeset information by line for each file
836 archive create an unversioned archive of a repository revision
814 archive create an unversioned archive of a repository revision
837 backout reverse effect of earlier changeset
815 backout reverse effect of earlier changeset
838 bisect subdivision search of changesets
816 bisect subdivision search of changesets
839 bookmarks create a new bookmark or list existing bookmarks
817 bookmarks create a new bookmark or list existing bookmarks
840 branch set or show the current branch name
818 branch set or show the current branch name
841 branches list repository named branches
819 branches list repository named branches
842 bundle create a bundle file
820 bundle create a bundle file
843 cat output the current or given revision of files
821 cat output the current or given revision of files
844 clone make a copy of an existing repository
822 clone make a copy of an existing repository
845 commit commit the specified files or all outstanding changes
823 commit commit the specified files or all outstanding changes
846 config show combined config settings from all hgrc files
824 config show combined config settings from all hgrc files
847 copy mark files as copied for the next commit
825 copy mark files as copied for the next commit
848 diff diff repository (or selected files)
826 diff diff repository (or selected files)
849 export dump the header and diffs for one or more changesets
827 export dump the header and diffs for one or more changesets
850 files list tracked files
828 files list tracked files
851 forget forget the specified files on the next commit
829 forget forget the specified files on the next commit
852 graft copy changes from other branches onto the current branch
830 graft copy changes from other branches onto the current branch
853 grep search revision history for a pattern in specified files
831 grep search revision history for a pattern in specified files
854 heads show branch heads
832 heads show branch heads
855 help show help for a given topic or a help overview
833 help show help for a given topic or a help overview
856 identify identify the working directory or specified revision
834 identify identify the working directory or specified revision
857 import import an ordered set of patches
835 import import an ordered set of patches
858 incoming show new changesets found in source
836 incoming show new changesets found in source
859 init create a new repository in the given directory
837 init create a new repository in the given directory
860 log show revision history of entire repository or files
838 log show revision history of entire repository or files
861 manifest output the current or given revision of the project manifest
839 manifest output the current or given revision of the project manifest
862 merge merge another revision into working directory
840 merge merge another revision into working directory
863 outgoing show changesets not found in the destination
841 outgoing show changesets not found in the destination
864 paths show aliases for remote repositories
842 paths show aliases for remote repositories
865 phase set or show the current phase name
843 phase set or show the current phase name
866 pull pull changes from the specified source
844 pull pull changes from the specified source
867 push push changes to the specified destination
845 push push changes to the specified destination
868 recover roll back an interrupted transaction
846 recover roll back an interrupted transaction
869 remove remove the specified files on the next commit
847 remove remove the specified files on the next commit
870 rename rename files; equivalent of copy + remove
848 rename rename files; equivalent of copy + remove
871 resolve redo merges or set/view the merge status of files
849 resolve redo merges or set/view the merge status of files
872 revert restore files to their checkout state
850 revert restore files to their checkout state
873 root print the root (top) of the current working directory
851 root print the root (top) of the current working directory
874 serve start stand-alone webserver
852 serve start stand-alone webserver
875 status show changed files in the working directory
853 status show changed files in the working directory
876 summary summarize working directory state
854 summary summarize working directory state
877 tag add one or more tags for the current or given revision
855 tag add one or more tags for the current or given revision
878 tags list repository tags
856 tags list repository tags
879 unbundle apply one or more bundle files
857 unbundle apply one or more bundle files
880 update update working directory (or switch revisions)
858 update update working directory (or switch revisions)
881 verify verify the integrity of the repository
859 verify verify the integrity of the repository
882 version output version and copyright information
860 version output version and copyright information
883
861
884 enabled extensions:
862 enabled extensions:
885
863
886 helpext (no help text available)
864 helpext (no help text available)
887
865
888 additional help topics:
866 additional help topics:
889
867
890 bundlespec Bundle File Formats
868 bundlespec Bundle File Formats
891 color Colorizing Outputs
869 color Colorizing Outputs
892 config Configuration Files
870 config Configuration Files
893 dates Date Formats
871 dates Date Formats
894 deprecated Deprecated Features
872 deprecated Deprecated Features
895 diffs Diff Formats
873 diffs Diff Formats
896 environment Environment Variables
874 environment Environment Variables
897 extensions Using Additional Features
875 extensions Using Additional Features
898 filesets Specifying File Sets
876 filesets Specifying File Sets
899 flags Command-line flags
877 flags Command-line flags
900 glossary Glossary
878 glossary Glossary
901 hgignore Syntax for Mercurial Ignore Files
879 hgignore Syntax for Mercurial Ignore Files
902 hgweb Configuring hgweb
880 hgweb Configuring hgweb
903 internals Technical implementation topics
881 internals Technical implementation topics
904 merge-tools Merge Tools
882 merge-tools Merge Tools
905 pager Pager Support
883 pager Pager Support
906 patterns File Name Patterns
884 patterns File Name Patterns
907 phases Working with Phases
885 phases Working with Phases
908 revisions Specifying Revisions
886 revisions Specifying Revisions
909 scripting Using Mercurial from scripts and automation
887 scripting Using Mercurial from scripts and automation
910 subrepos Subrepositories
888 subrepos Subrepositories
911 templating Template Usage
889 templating Template Usage
912 urls URL Paths
890 urls URL Paths
913
891
914 (use 'hg help -v' to show built-in aliases and global options)
892 (use 'hg help -v' to show built-in aliases and global options)
915
893
916 #endif
894 #endif
917
895
918 Test list of internal help commands
896 Test list of internal help commands
919
897
920 $ hg help debug
898 $ hg help debug
921 debug commands (internal and unsupported):
899 debug commands (internal and unsupported):
922
900
923 debugancestor
901 debugancestor
924 find the ancestor revision of two revisions in a given index
902 find the ancestor revision of two revisions in a given index
925 debugapplystreamclonebundle
903 debugapplystreamclonebundle
926 apply a stream clone bundle file
904 apply a stream clone bundle file
927 debugbuilddag
905 debugbuilddag
928 builds a repo with a given DAG from scratch in the current
906 builds a repo with a given DAG from scratch in the current
929 empty repo
907 empty repo
930 debugbundle lists the contents of a bundle
908 debugbundle lists the contents of a bundle
931 debugcapabilities
909 debugcapabilities
932 lists the capabilities of a remote peer
910 lists the capabilities of a remote peer
933 debugcheckstate
911 debugcheckstate
934 validate the correctness of the current dirstate
912 validate the correctness of the current dirstate
935 debugcolor show available color, effects or style
913 debugcolor show available color, effects or style
936 debugcommands
914 debugcommands
937 list all available commands and options
915 list all available commands and options
938 debugcomplete
916 debugcomplete
939 returns the completion list associated with the given command
917 returns the completion list associated with the given command
940 debugcreatestreamclonebundle
918 debugcreatestreamclonebundle
941 create a stream clone bundle file
919 create a stream clone bundle file
942 debugdag format the changelog or an index DAG as a concise textual
920 debugdag format the changelog or an index DAG as a concise textual
943 description
921 description
944 debugdata dump the contents of a data file revision
922 debugdata dump the contents of a data file revision
945 debugdate parse and display a date
923 debugdate parse and display a date
946 debugdeltachain
924 debugdeltachain
947 dump information about delta chains in a revlog
925 dump information about delta chains in a revlog
948 debugdirstate
926 debugdirstate
949 show the contents of the current dirstate
927 show the contents of the current dirstate
950 debugdiscovery
928 debugdiscovery
951 runs the changeset discovery protocol in isolation
929 runs the changeset discovery protocol in isolation
952 debugdownload
930 debugdownload
953 download a resource using Mercurial logic and config
931 download a resource using Mercurial logic and config
954 debugextensions
932 debugextensions
955 show information about active extensions
933 show information about active extensions
956 debugfileset parse and apply a fileset specification
934 debugfileset parse and apply a fileset specification
957 debugformat display format information about the current repository
935 debugformat display format information about the current repository
958 debugfsinfo show information detected about current filesystem
936 debugfsinfo show information detected about current filesystem
959 debuggetbundle
937 debuggetbundle
960 retrieves a bundle from a repo
938 retrieves a bundle from a repo
961 debugignore display the combined ignore pattern and information about
939 debugignore display the combined ignore pattern and information about
962 ignored files
940 ignored files
963 debugindex dump the contents of an index file
941 debugindex dump the contents of an index file
964 debugindexdot
942 debugindexdot
965 dump an index DAG as a graphviz dot file
943 dump an index DAG as a graphviz dot file
966 debuginstall test Mercurial installation
944 debuginstall test Mercurial installation
967 debugknown test whether node ids are known to a repo
945 debugknown test whether node ids are known to a repo
968 debuglocks show or modify state of locks
946 debuglocks show or modify state of locks
969 debugmanifestfulltextcache
947 debugmanifestfulltextcache
970 show, clear or amend the contents of the manifest fulltext
948 show, clear or amend the contents of the manifest fulltext
971 cache
949 cache
972 debugmergestate
950 debugmergestate
973 print merge state
951 print merge state
974 debugnamecomplete
952 debugnamecomplete
975 complete "names" - tags, open branch names, bookmark names
953 complete "names" - tags, open branch names, bookmark names
976 debugobsolete
954 debugobsolete
977 create arbitrary obsolete marker
955 create arbitrary obsolete marker
978 debugoptADV (no help text available)
956 debugoptADV (no help text available)
979 debugoptDEP (no help text available)
957 debugoptDEP (no help text available)
980 debugoptEXP (no help text available)
958 debugoptEXP (no help text available)
981 debugpathcomplete
959 debugpathcomplete
982 complete part or all of a tracked path
960 complete part or all of a tracked path
983 debugpeer establish a connection to a peer repository
961 debugpeer establish a connection to a peer repository
984 debugpickmergetool
962 debugpickmergetool
985 examine which merge tool is chosen for specified file
963 examine which merge tool is chosen for specified file
986 debugpushkey access the pushkey key/value protocol
964 debugpushkey access the pushkey key/value protocol
987 debugpvec (no help text available)
965 debugpvec (no help text available)
988 debugrebuilddirstate
966 debugrebuilddirstate
989 rebuild the dirstate as it would look like for the given
967 rebuild the dirstate as it would look like for the given
990 revision
968 revision
991 debugrebuildfncache
969 debugrebuildfncache
992 rebuild the fncache file
970 rebuild the fncache file
993 debugrename dump rename information
971 debugrename dump rename information
994 debugrevlog show data and statistics about a revlog
972 debugrevlog show data and statistics about a revlog
995 debugrevspec parse and apply a revision specification
973 debugrevspec parse and apply a revision specification
996 debugserve run a server with advanced settings
974 debugserve run a server with advanced settings
997 debugsetparents
975 debugsetparents
998 manually set the parents of the current working directory
976 manually set the parents of the current working directory
999 debugssl test a secure connection to a server
977 debugssl test a secure connection to a server
1000 debugsub (no help text available)
978 debugsub (no help text available)
1001 debugsuccessorssets
979 debugsuccessorssets
1002 show set of successors for revision
980 show set of successors for revision
1003 debugtemplate
981 debugtemplate
1004 parse and apply a template
982 parse and apply a template
1005 debuguigetpass
983 debuguigetpass
1006 show prompt to type password
984 show prompt to type password
1007 debuguiprompt
985 debuguiprompt
1008 show plain prompt
986 show plain prompt
1009 debugupdatecaches
987 debugupdatecaches
1010 warm all known caches in the repository
988 warm all known caches in the repository
1011 debugupgraderepo
989 debugupgraderepo
1012 upgrade a repository to use different features
990 upgrade a repository to use different features
1013 debugwalk show how files match on given patterns
991 debugwalk show how files match on given patterns
1014 debugwhyunstable
992 debugwhyunstable
1015 explain instabilities of a changeset
993 explain instabilities of a changeset
1016 debugwireargs
994 debugwireargs
1017 (no help text available)
995 (no help text available)
1018 debugwireproto
996 debugwireproto
1019 send wire protocol commands to a server
997 send wire protocol commands to a server
1020
998
1021 (use 'hg help -v debug' to show built-in aliases and global options)
999 (use 'hg help -v debug' to show built-in aliases and global options)
1022
1000
1023 internals topic renders index of available sub-topics
1001 internals topic renders index of available sub-topics
1024
1002
1025 $ hg help internals
1003 $ hg help internals
1026 Technical implementation topics
1004 Technical implementation topics
1027 """""""""""""""""""""""""""""""
1005 """""""""""""""""""""""""""""""
1028
1006
1029 To access a subtopic, use "hg help internals.{subtopic-name}"
1007 To access a subtopic, use "hg help internals.{subtopic-name}"
1030
1008
1031 bundle2 Bundle2
1009 bundle2 Bundle2
1032 bundles Bundles
1010 bundles Bundles
1033 censor Censor
1011 censor Censor
1034 changegroups Changegroups
1012 changegroups Changegroups
1035 config Config Registrar
1013 config Config Registrar
1036 requirements Repository Requirements
1014 requirements Repository Requirements
1037 revlogs Revision Logs
1015 revlogs Revision Logs
1038 wireprotocol Wire Protocol
1016 wireprotocol Wire Protocol
1039
1017
1040 sub-topics can be accessed
1018 sub-topics can be accessed
1041
1019
1042 $ hg help internals.changegroups
1020 $ hg help internals.changegroups
1043 Changegroups
1021 Changegroups
1044 """"""""""""
1022 """"""""""""
1045
1023
1046 Changegroups are representations of repository revlog data, specifically
1024 Changegroups are representations of repository revlog data, specifically
1047 the changelog data, root/flat manifest data, treemanifest data, and
1025 the changelog data, root/flat manifest data, treemanifest data, and
1048 filelogs.
1026 filelogs.
1049
1027
1050 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1028 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1051 level, versions "1" and "2" are almost exactly the same, with the only
1029 level, versions "1" and "2" are almost exactly the same, with the only
1052 difference being an additional item in the *delta header*. Version "3"
1030 difference being an additional item in the *delta header*. Version "3"
1053 adds support for revlog flags in the *delta header* and optionally
1031 adds support for revlog flags in the *delta header* and optionally
1054 exchanging treemanifests (enabled by setting an option on the
1032 exchanging treemanifests (enabled by setting an option on the
1055 "changegroup" part in the bundle2).
1033 "changegroup" part in the bundle2).
1056
1034
1057 Changegroups when not exchanging treemanifests consist of 3 logical
1035 Changegroups when not exchanging treemanifests consist of 3 logical
1058 segments:
1036 segments:
1059
1037
1060 +---------------------------------+
1038 +---------------------------------+
1061 | | | |
1039 | | | |
1062 | changeset | manifest | filelogs |
1040 | changeset | manifest | filelogs |
1063 | | | |
1041 | | | |
1064 | | | |
1042 | | | |
1065 +---------------------------------+
1043 +---------------------------------+
1066
1044
1067 When exchanging treemanifests, there are 4 logical segments:
1045 When exchanging treemanifests, there are 4 logical segments:
1068
1046
1069 +-------------------------------------------------+
1047 +-------------------------------------------------+
1070 | | | | |
1048 | | | | |
1071 | changeset | root | treemanifests | filelogs |
1049 | changeset | root | treemanifests | filelogs |
1072 | | manifest | | |
1050 | | manifest | | |
1073 | | | | |
1051 | | | | |
1074 +-------------------------------------------------+
1052 +-------------------------------------------------+
1075
1053
1076 The principle building block of each segment is a *chunk*. A *chunk* is a
1054 The principle building block of each segment is a *chunk*. A *chunk* is a
1077 framed piece of data:
1055 framed piece of data:
1078
1056
1079 +---------------------------------------+
1057 +---------------------------------------+
1080 | | |
1058 | | |
1081 | length | data |
1059 | length | data |
1082 | (4 bytes) | (<length - 4> bytes) |
1060 | (4 bytes) | (<length - 4> bytes) |
1083 | | |
1061 | | |
1084 +---------------------------------------+
1062 +---------------------------------------+
1085
1063
1086 All integers are big-endian signed integers. Each chunk starts with a
1064 All integers are big-endian signed integers. Each chunk starts with a
1087 32-bit integer indicating the length of the entire chunk (including the
1065 32-bit integer indicating the length of the entire chunk (including the
1088 length field itself).
1066 length field itself).
1089
1067
1090 There is a special case chunk that has a value of 0 for the length
1068 There is a special case chunk that has a value of 0 for the length
1091 ("0x00000000"). We call this an *empty chunk*.
1069 ("0x00000000"). We call this an *empty chunk*.
1092
1070
1093 Delta Groups
1071 Delta Groups
1094 ============
1072 ============
1095
1073
1096 A *delta group* expresses the content of a revlog as a series of deltas,
1074 A *delta group* expresses the content of a revlog as a series of deltas,
1097 or patches against previous revisions.
1075 or patches against previous revisions.
1098
1076
1099 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1077 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1100 to signal the end of the delta group:
1078 to signal the end of the delta group:
1101
1079
1102 +------------------------------------------------------------------------+
1080 +------------------------------------------------------------------------+
1103 | | | | | |
1081 | | | | | |
1104 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1082 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1105 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1083 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1106 | | | | | |
1084 | | | | | |
1107 +------------------------------------------------------------------------+
1085 +------------------------------------------------------------------------+
1108
1086
1109 Each *chunk*'s data consists of the following:
1087 Each *chunk*'s data consists of the following:
1110
1088
1111 +---------------------------------------+
1089 +---------------------------------------+
1112 | | |
1090 | | |
1113 | delta header | delta data |
1091 | delta header | delta data |
1114 | (various by version) | (various) |
1092 | (various by version) | (various) |
1115 | | |
1093 | | |
1116 +---------------------------------------+
1094 +---------------------------------------+
1117
1095
1118 The *delta data* is a series of *delta*s that describe a diff from an
1096 The *delta data* is a series of *delta*s that describe a diff from an
1119 existing entry (either that the recipient already has, or previously
1097 existing entry (either that the recipient already has, or previously
1120 specified in the bundle/changegroup).
1098 specified in the bundle/changegroup).
1121
1099
1122 The *delta header* is different between versions "1", "2", and "3" of the
1100 The *delta header* is different between versions "1", "2", and "3" of the
1123 changegroup format.
1101 changegroup format.
1124
1102
1125 Version 1 (headerlen=80):
1103 Version 1 (headerlen=80):
1126
1104
1127 +------------------------------------------------------+
1105 +------------------------------------------------------+
1128 | | | | |
1106 | | | | |
1129 | node | p1 node | p2 node | link node |
1107 | node | p1 node | p2 node | link node |
1130 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1108 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1131 | | | | |
1109 | | | | |
1132 +------------------------------------------------------+
1110 +------------------------------------------------------+
1133
1111
1134 Version 2 (headerlen=100):
1112 Version 2 (headerlen=100):
1135
1113
1136 +------------------------------------------------------------------+
1114 +------------------------------------------------------------------+
1137 | | | | | |
1115 | | | | | |
1138 | node | p1 node | p2 node | base node | link node |
1116 | node | p1 node | p2 node | base node | link node |
1139 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1117 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1140 | | | | | |
1118 | | | | | |
1141 +------------------------------------------------------------------+
1119 +------------------------------------------------------------------+
1142
1120
1143 Version 3 (headerlen=102):
1121 Version 3 (headerlen=102):
1144
1122
1145 +------------------------------------------------------------------------------+
1123 +------------------------------------------------------------------------------+
1146 | | | | | | |
1124 | | | | | | |
1147 | node | p1 node | p2 node | base node | link node | flags |
1125 | node | p1 node | p2 node | base node | link node | flags |
1148 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1126 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1149 | | | | | | |
1127 | | | | | | |
1150 +------------------------------------------------------------------------------+
1128 +------------------------------------------------------------------------------+
1151
1129
1152 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1130 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1153 contain a series of *delta*s, densely packed (no separators). These deltas
1131 contain a series of *delta*s, densely packed (no separators). These deltas
1154 describe a diff from an existing entry (either that the recipient already
1132 describe a diff from an existing entry (either that the recipient already
1155 has, or previously specified in the bundle/changegroup). The format is
1133 has, or previously specified in the bundle/changegroup). The format is
1156 described more fully in "hg help internals.bdiff", but briefly:
1134 described more fully in "hg help internals.bdiff", but briefly:
1157
1135
1158 +---------------------------------------------------------------+
1136 +---------------------------------------------------------------+
1159 | | | | |
1137 | | | | |
1160 | start offset | end offset | new length | content |
1138 | start offset | end offset | new length | content |
1161 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1139 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1162 | | | | |
1140 | | | | |
1163 +---------------------------------------------------------------+
1141 +---------------------------------------------------------------+
1164
1142
1165 Please note that the length field in the delta data does *not* include
1143 Please note that the length field in the delta data does *not* include
1166 itself.
1144 itself.
1167
1145
1168 In version 1, the delta is always applied against the previous node from
1146 In version 1, the delta is always applied against the previous node from
1169 the changegroup or the first parent if this is the first entry in the
1147 the changegroup or the first parent if this is the first entry in the
1170 changegroup.
1148 changegroup.
1171
1149
1172 In version 2 and up, the delta base node is encoded in the entry in the
1150 In version 2 and up, the delta base node is encoded in the entry in the
1173 changegroup. This allows the delta to be expressed against any parent,
1151 changegroup. This allows the delta to be expressed against any parent,
1174 which can result in smaller deltas and more efficient encoding of data.
1152 which can result in smaller deltas and more efficient encoding of data.
1175
1153
1176 Changeset Segment
1154 Changeset Segment
1177 =================
1155 =================
1178
1156
1179 The *changeset segment* consists of a single *delta group* holding
1157 The *changeset segment* consists of a single *delta group* holding
1180 changelog data. The *empty chunk* at the end of the *delta group* denotes
1158 changelog data. The *empty chunk* at the end of the *delta group* denotes
1181 the boundary to the *manifest segment*.
1159 the boundary to the *manifest segment*.
1182
1160
1183 Manifest Segment
1161 Manifest Segment
1184 ================
1162 ================
1185
1163
1186 The *manifest segment* consists of a single *delta group* holding manifest
1164 The *manifest segment* consists of a single *delta group* holding manifest
1187 data. If treemanifests are in use, it contains only the manifest for the
1165 data. If treemanifests are in use, it contains only the manifest for the
1188 root directory of the repository. Otherwise, it contains the entire
1166 root directory of the repository. Otherwise, it contains the entire
1189 manifest data. The *empty chunk* at the end of the *delta group* denotes
1167 manifest data. The *empty chunk* at the end of the *delta group* denotes
1190 the boundary to the next segment (either the *treemanifests segment* or
1168 the boundary to the next segment (either the *treemanifests segment* or
1191 the *filelogs segment*, depending on version and the request options).
1169 the *filelogs segment*, depending on version and the request options).
1192
1170
1193 Treemanifests Segment
1171 Treemanifests Segment
1194 ---------------------
1172 ---------------------
1195
1173
1196 The *treemanifests segment* only exists in changegroup version "3", and
1174 The *treemanifests segment* only exists in changegroup version "3", and
1197 only if the 'treemanifest' param is part of the bundle2 changegroup part
1175 only if the 'treemanifest' param is part of the bundle2 changegroup part
1198 (it is not possible to use changegroup version 3 outside of bundle2).
1176 (it is not possible to use changegroup version 3 outside of bundle2).
1199 Aside from the filenames in the *treemanifests segment* containing a
1177 Aside from the filenames in the *treemanifests segment* containing a
1200 trailing "/" character, it behaves identically to the *filelogs segment*
1178 trailing "/" character, it behaves identically to the *filelogs segment*
1201 (see below). The final sub-segment is followed by an *empty chunk*
1179 (see below). The final sub-segment is followed by an *empty chunk*
1202 (logically, a sub-segment with filename size 0). This denotes the boundary
1180 (logically, a sub-segment with filename size 0). This denotes the boundary
1203 to the *filelogs segment*.
1181 to the *filelogs segment*.
1204
1182
1205 Filelogs Segment
1183 Filelogs Segment
1206 ================
1184 ================
1207
1185
1208 The *filelogs segment* consists of multiple sub-segments, each
1186 The *filelogs segment* consists of multiple sub-segments, each
1209 corresponding to an individual file whose data is being described:
1187 corresponding to an individual file whose data is being described:
1210
1188
1211 +--------------------------------------------------+
1189 +--------------------------------------------------+
1212 | | | | | |
1190 | | | | | |
1213 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1191 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1214 | | | | | (4 bytes) |
1192 | | | | | (4 bytes) |
1215 | | | | | |
1193 | | | | | |
1216 +--------------------------------------------------+
1194 +--------------------------------------------------+
1217
1195
1218 The final filelog sub-segment is followed by an *empty chunk* (logically,
1196 The final filelog sub-segment is followed by an *empty chunk* (logically,
1219 a sub-segment with filename size 0). This denotes the end of the segment
1197 a sub-segment with filename size 0). This denotes the end of the segment
1220 and of the overall changegroup.
1198 and of the overall changegroup.
1221
1199
1222 Each filelog sub-segment consists of the following:
1200 Each filelog sub-segment consists of the following:
1223
1201
1224 +------------------------------------------------------+
1202 +------------------------------------------------------+
1225 | | | |
1203 | | | |
1226 | filename length | filename | delta group |
1204 | filename length | filename | delta group |
1227 | (4 bytes) | (<length - 4> bytes) | (various) |
1205 | (4 bytes) | (<length - 4> bytes) | (various) |
1228 | | | |
1206 | | | |
1229 +------------------------------------------------------+
1207 +------------------------------------------------------+
1230
1208
1231 That is, a *chunk* consisting of the filename (not terminated or padded)
1209 That is, a *chunk* consisting of the filename (not terminated or padded)
1232 followed by N chunks constituting the *delta group* for this file. The
1210 followed by N chunks constituting the *delta group* for this file. The
1233 *empty chunk* at the end of each *delta group* denotes the boundary to the
1211 *empty chunk* at the end of each *delta group* denotes the boundary to the
1234 next filelog sub-segment.
1212 next filelog sub-segment.
1235
1213
1236 Test list of commands with command with no help text
1214 Test list of commands with command with no help text
1237
1215
1238 $ hg help helpext
1216 $ hg help helpext
1239 helpext extension - no help text available
1217 helpext extension - no help text available
1240
1218
1241 list of commands:
1219 list of commands:
1242
1220
1243 nohelp (no help text available)
1221 nohelp (no help text available)
1244
1222
1245 (use 'hg help -v helpext' to show built-in aliases and global options)
1223 (use 'hg help -v helpext' to show built-in aliases and global options)
1246
1224
1247
1225
1248 test advanced, deprecated and experimental options are hidden in command help
1226 test advanced, deprecated and experimental options are hidden in command help
1249 $ hg help debugoptADV
1227 $ hg help debugoptADV
1250 hg debugoptADV
1228 hg debugoptADV
1251
1229
1252 (no help text available)
1230 (no help text available)
1253
1231
1254 options:
1232 options:
1255
1233
1256 (some details hidden, use --verbose to show complete help)
1234 (some details hidden, use --verbose to show complete help)
1257 $ hg help debugoptDEP
1235 $ hg help debugoptDEP
1258 hg debugoptDEP
1236 hg debugoptDEP
1259
1237
1260 (no help text available)
1238 (no help text available)
1261
1239
1262 options:
1240 options:
1263
1241
1264 (some details hidden, use --verbose to show complete help)
1242 (some details hidden, use --verbose to show complete help)
1265
1243
1266 $ hg help debugoptEXP
1244 $ hg help debugoptEXP
1267 hg debugoptEXP
1245 hg debugoptEXP
1268
1246
1269 (no help text available)
1247 (no help text available)
1270
1248
1271 options:
1249 options:
1272
1250
1273 (some details hidden, use --verbose to show complete help)
1251 (some details hidden, use --verbose to show complete help)
1274
1252
1275 test advanced, deprecated and experimental options are shown with -v
1253 test advanced, deprecated and experimental options are shown with -v
1276 $ hg help -v debugoptADV | grep aopt
1254 $ hg help -v debugoptADV | grep aopt
1277 --aopt option is (ADVANCED)
1255 --aopt option is (ADVANCED)
1278 $ hg help -v debugoptDEP | grep dopt
1256 $ hg help -v debugoptDEP | grep dopt
1279 --dopt option is (DEPRECATED)
1257 --dopt option is (DEPRECATED)
1280 $ hg help -v debugoptEXP | grep eopt
1258 $ hg help -v debugoptEXP | grep eopt
1281 --eopt option is (EXPERIMENTAL)
1259 --eopt option is (EXPERIMENTAL)
1282
1260
1283 #if gettext
1261 #if gettext
1284 test deprecated option is hidden with translation with untranslated description
1262 test deprecated option is hidden with translation with untranslated description
1285 (use many globy for not failing on changed transaction)
1263 (use many globy for not failing on changed transaction)
1286 $ LANGUAGE=sv hg help debugoptDEP
1264 $ LANGUAGE=sv hg help debugoptDEP
1287 hg debugoptDEP
1265 hg debugoptDEP
1288
1266
1289 (*) (glob)
1267 (*) (glob)
1290
1268
1291 options:
1269 options:
1292
1270
1293 (some details hidden, use --verbose to show complete help)
1271 (some details hidden, use --verbose to show complete help)
1294 #endif
1272 #endif
1295
1273
1296 Test commands that collide with topics (issue4240)
1274 Test commands that collide with topics (issue4240)
1297
1275
1298 $ hg config -hq
1276 $ hg config -hq
1299 hg config [-u] [NAME]...
1277 hg config [-u] [NAME]...
1300
1278
1301 show combined config settings from all hgrc files
1279 show combined config settings from all hgrc files
1302 $ hg showconfig -hq
1280 $ hg showconfig -hq
1303 hg config [-u] [NAME]...
1281 hg config [-u] [NAME]...
1304
1282
1305 show combined config settings from all hgrc files
1283 show combined config settings from all hgrc files
1306
1284
1307 Test a help topic
1285 Test a help topic
1308
1286
1309 $ hg help dates
1287 $ hg help dates
1310 Date Formats
1288 Date Formats
1311 """"""""""""
1289 """"""""""""
1312
1290
1313 Some commands allow the user to specify a date, e.g.:
1291 Some commands allow the user to specify a date, e.g.:
1314
1292
1315 - backout, commit, import, tag: Specify the commit date.
1293 - backout, commit, import, tag: Specify the commit date.
1316 - log, revert, update: Select revision(s) by date.
1294 - log, revert, update: Select revision(s) by date.
1317
1295
1318 Many date formats are valid. Here are some examples:
1296 Many date formats are valid. Here are some examples:
1319
1297
1320 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1298 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1321 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1299 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1322 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1300 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1323 - "Dec 6" (midnight)
1301 - "Dec 6" (midnight)
1324 - "13:18" (today assumed)
1302 - "13:18" (today assumed)
1325 - "3:39" (3:39AM assumed)
1303 - "3:39" (3:39AM assumed)
1326 - "3:39pm" (15:39)
1304 - "3:39pm" (15:39)
1327 - "2006-12-06 13:18:29" (ISO 8601 format)
1305 - "2006-12-06 13:18:29" (ISO 8601 format)
1328 - "2006-12-6 13:18"
1306 - "2006-12-6 13:18"
1329 - "2006-12-6"
1307 - "2006-12-6"
1330 - "12-6"
1308 - "12-6"
1331 - "12/6"
1309 - "12/6"
1332 - "12/6/6" (Dec 6 2006)
1310 - "12/6/6" (Dec 6 2006)
1333 - "today" (midnight)
1311 - "today" (midnight)
1334 - "yesterday" (midnight)
1312 - "yesterday" (midnight)
1335 - "now" - right now
1313 - "now" - right now
1336
1314
1337 Lastly, there is Mercurial's internal format:
1315 Lastly, there is Mercurial's internal format:
1338
1316
1339 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1317 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1340
1318
1341 This is the internal representation format for dates. The first number is
1319 This is the internal representation format for dates. The first number is
1342 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1320 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1343 is the offset of the local timezone, in seconds west of UTC (negative if
1321 is the offset of the local timezone, in seconds west of UTC (negative if
1344 the timezone is east of UTC).
1322 the timezone is east of UTC).
1345
1323
1346 The log command also accepts date ranges:
1324 The log command also accepts date ranges:
1347
1325
1348 - "<DATE" - at or before a given date/time
1326 - "<DATE" - at or before a given date/time
1349 - ">DATE" - on or after a given date/time
1327 - ">DATE" - on or after a given date/time
1350 - "DATE to DATE" - a date range, inclusive
1328 - "DATE to DATE" - a date range, inclusive
1351 - "-DAYS" - within a given number of days of today
1329 - "-DAYS" - within a given number of days of today
1352
1330
1353 Test repeated config section name
1331 Test repeated config section name
1354
1332
1355 $ hg help config.host
1333 $ hg help config.host
1356 "http_proxy.host"
1334 "http_proxy.host"
1357 Host name and (optional) port of the proxy server, for example
1335 Host name and (optional) port of the proxy server, for example
1358 "myproxy:8000".
1336 "myproxy:8000".
1359
1337
1360 "smtp.host"
1338 "smtp.host"
1361 Host name of mail server, e.g. "mail.example.com".
1339 Host name of mail server, e.g. "mail.example.com".
1362
1340
1363 Unrelated trailing paragraphs shouldn't be included
1341 Unrelated trailing paragraphs shouldn't be included
1364
1342
1365 $ hg help config.extramsg | grep '^$'
1343 $ hg help config.extramsg | grep '^$'
1366
1344
1367
1345
1368 Test capitalized section name
1346 Test capitalized section name
1369
1347
1370 $ hg help scripting.HGPLAIN > /dev/null
1348 $ hg help scripting.HGPLAIN > /dev/null
1371
1349
1372 Help subsection:
1350 Help subsection:
1373
1351
1374 $ hg help config.charsets |grep "Email example:" > /dev/null
1352 $ hg help config.charsets |grep "Email example:" > /dev/null
1375 [1]
1353 [1]
1376
1354
1377 Show nested definitions
1355 Show nested definitions
1378 ("profiling.type"[break]"ls"[break]"stat"[break])
1356 ("profiling.type"[break]"ls"[break]"stat"[break])
1379
1357
1380 $ hg help config.type | egrep '^$'|wc -l
1358 $ hg help config.type | egrep '^$'|wc -l
1381 \s*3 (re)
1359 \s*3 (re)
1382
1360
1383 Separate sections from subsections
1361 Separate sections from subsections
1384
1362
1385 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1363 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1386 "format"
1364 "format"
1387 --------
1365 --------
1388
1366
1389 "usegeneraldelta"
1367 "usegeneraldelta"
1390
1368
1391 "dotencode"
1369 "dotencode"
1392
1370
1393 "usefncache"
1371 "usefncache"
1394
1372
1395 "usestore"
1373 "usestore"
1396
1374
1397 "profiling"
1375 "profiling"
1398 -----------
1376 -----------
1399
1377
1400 "format"
1378 "format"
1401
1379
1402 "progress"
1380 "progress"
1403 ----------
1381 ----------
1404
1382
1405 "format"
1383 "format"
1406
1384
1407
1385
1408 Last item in help config.*:
1386 Last item in help config.*:
1409
1387
1410 $ hg help config.`hg help config|grep '^ "'| \
1388 $ hg help config.`hg help config|grep '^ "'| \
1411 > tail -1|sed 's![ "]*!!g'`| \
1389 > tail -1|sed 's![ "]*!!g'`| \
1412 > grep 'hg help -c config' > /dev/null
1390 > grep 'hg help -c config' > /dev/null
1413 [1]
1391 [1]
1414
1392
1415 note to use help -c for general hg help config:
1393 note to use help -c for general hg help config:
1416
1394
1417 $ hg help config |grep 'hg help -c config' > /dev/null
1395 $ hg help config |grep 'hg help -c config' > /dev/null
1418
1396
1419 Test templating help
1397 Test templating help
1420
1398
1421 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1399 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1422 desc String. The text of the changeset description.
1400 desc String. The text of the changeset description.
1423 diffstat String. Statistics of changes with the following format:
1401 diffstat String. Statistics of changes with the following format:
1424 firstline Any text. Returns the first line of text.
1402 firstline Any text. Returns the first line of text.
1425 nonempty Any text. Returns '(none)' if the string is empty.
1403 nonempty Any text. Returns '(none)' if the string is empty.
1426
1404
1427 Test deprecated items
1405 Test deprecated items
1428
1406
1429 $ hg help -v templating | grep currentbookmark
1407 $ hg help -v templating | grep currentbookmark
1430 currentbookmark
1408 currentbookmark
1431 $ hg help templating | (grep currentbookmark || true)
1409 $ hg help templating | (grep currentbookmark || true)
1432
1410
1433 Test help hooks
1411 Test help hooks
1434
1412
1435 $ cat > helphook1.py <<EOF
1413 $ cat > helphook1.py <<EOF
1436 > from mercurial import help
1414 > from mercurial import help
1437 >
1415 >
1438 > def rewrite(ui, topic, doc):
1416 > def rewrite(ui, topic, doc):
1439 > return doc + '\nhelphook1\n'
1417 > return doc + '\nhelphook1\n'
1440 >
1418 >
1441 > def extsetup(ui):
1419 > def extsetup(ui):
1442 > help.addtopichook('revisions', rewrite)
1420 > help.addtopichook('revisions', rewrite)
1443 > EOF
1421 > EOF
1444 $ cat > helphook2.py <<EOF
1422 $ cat > helphook2.py <<EOF
1445 > from mercurial import help
1423 > from mercurial import help
1446 >
1424 >
1447 > def rewrite(ui, topic, doc):
1425 > def rewrite(ui, topic, doc):
1448 > return doc + '\nhelphook2\n'
1426 > return doc + '\nhelphook2\n'
1449 >
1427 >
1450 > def extsetup(ui):
1428 > def extsetup(ui):
1451 > help.addtopichook('revisions', rewrite)
1429 > help.addtopichook('revisions', rewrite)
1452 > EOF
1430 > EOF
1453 $ echo '[extensions]' >> $HGRCPATH
1431 $ echo '[extensions]' >> $HGRCPATH
1454 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1432 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1455 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1433 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1456 $ hg help revsets | grep helphook
1434 $ hg help revsets | grep helphook
1457 helphook1
1435 helphook1
1458 helphook2
1436 helphook2
1459
1437
1460 help -c should only show debug --debug
1438 help -c should only show debug --debug
1461
1439
1462 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1440 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1463 [1]
1441 [1]
1464
1442
1465 help -c should only show deprecated for -v
1443 help -c should only show deprecated for -v
1466
1444
1467 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1445 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1468 [1]
1446 [1]
1469
1447
1470 Test -s / --system
1448 Test -s / --system
1471
1449
1472 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1450 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1473 > wc -l | sed -e 's/ //g'
1451 > wc -l | sed -e 's/ //g'
1474 0
1452 0
1475 $ hg help config.files --system unix | grep 'USER' | \
1453 $ hg help config.files --system unix | grep 'USER' | \
1476 > wc -l | sed -e 's/ //g'
1454 > wc -l | sed -e 's/ //g'
1477 0
1455 0
1478
1456
1479 Test -e / -c / -k combinations
1457 Test -e / -c / -k combinations
1480
1458
1481 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1459 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1482 Commands:
1460 Commands:
1483 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1461 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1484 Extensions:
1462 Extensions:
1485 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1463 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1486 Topics:
1464 Topics:
1487 Commands:
1465 Commands:
1488 Extensions:
1466 Extensions:
1489 Extension Commands:
1467 Extension Commands:
1490 $ hg help -c schemes
1468 $ hg help -c schemes
1491 abort: no such help topic: schemes
1469 abort: no such help topic: schemes
1492 (try 'hg help --keyword schemes')
1470 (try 'hg help --keyword schemes')
1493 [255]
1471 [255]
1494 $ hg help -e schemes |head -1
1472 $ hg help -e schemes |head -1
1495 schemes extension - extend schemes with shortcuts to repository swarms
1473 schemes extension - extend schemes with shortcuts to repository swarms
1496 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1474 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1497 Commands:
1475 Commands:
1498 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1476 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1499 Extensions:
1477 Extensions:
1500 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1478 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1501 Extensions:
1479 Extensions:
1502 Commands:
1480 Commands:
1503 $ hg help -c commit > /dev/null
1481 $ hg help -c commit > /dev/null
1504 $ hg help -e -c commit > /dev/null
1482 $ hg help -e -c commit > /dev/null
1505 $ hg help -e commit > /dev/null
1483 $ hg help -e commit > /dev/null
1506 abort: no such help topic: commit
1484 abort: no such help topic: commit
1507 (try 'hg help --keyword commit')
1485 (try 'hg help --keyword commit')
1508 [255]
1486 [255]
1509
1487
1510 Test keyword search help
1488 Test keyword search help
1511
1489
1512 $ cat > prefixedname.py <<EOF
1490 $ cat > prefixedname.py <<EOF
1513 > '''matched against word "clone"
1491 > '''matched against word "clone"
1514 > '''
1492 > '''
1515 > EOF
1493 > EOF
1516 $ echo '[extensions]' >> $HGRCPATH
1494 $ echo '[extensions]' >> $HGRCPATH
1517 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1495 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1518 $ hg help -k clone
1496 $ hg help -k clone
1519 Topics:
1497 Topics:
1520
1498
1521 config Configuration Files
1499 config Configuration Files
1522 extensions Using Additional Features
1500 extensions Using Additional Features
1523 glossary Glossary
1501 glossary Glossary
1524 phases Working with Phases
1502 phases Working with Phases
1525 subrepos Subrepositories
1503 subrepos Subrepositories
1526 urls URL Paths
1504 urls URL Paths
1527
1505
1528 Commands:
1506 Commands:
1529
1507
1530 bookmarks create a new bookmark or list existing bookmarks
1508 bookmarks create a new bookmark or list existing bookmarks
1531 clone make a copy of an existing repository
1509 clone make a copy of an existing repository
1532 paths show aliases for remote repositories
1510 paths show aliases for remote repositories
1533 pull pull changes from the specified source
1511 pull pull changes from the specified source
1534 update update working directory (or switch revisions)
1512 update update working directory (or switch revisions)
1535
1513
1536 Extensions:
1514 Extensions:
1537
1515
1538 clonebundles advertise pre-generated bundles to seed clones
1516 clonebundles advertise pre-generated bundles to seed clones
1539 narrow create clones which fetch history data for subset of files
1517 narrow create clones which fetch history data for subset of files
1540 (EXPERIMENTAL)
1518 (EXPERIMENTAL)
1541 prefixedname matched against word "clone"
1519 prefixedname matched against word "clone"
1542 relink recreates hardlinks between repository clones
1520 relink recreates hardlinks between repository clones
1543
1521
1544 Extension Commands:
1522 Extension Commands:
1545
1523
1546 qclone clone main and patch repository at same time
1524 qclone clone main and patch repository at same time
1547
1525
1548 Test unfound topic
1526 Test unfound topic
1549
1527
1550 $ hg help nonexistingtopicthatwillneverexisteverever
1528 $ hg help nonexistingtopicthatwillneverexisteverever
1551 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1529 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1552 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1530 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1553 [255]
1531 [255]
1554
1532
1555 Test unfound keyword
1533 Test unfound keyword
1556
1534
1557 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1535 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1558 abort: no matches
1536 abort: no matches
1559 (try 'hg help' for a list of topics)
1537 (try 'hg help' for a list of topics)
1560 [255]
1538 [255]
1561
1539
1562 Test omit indicating for help
1540 Test omit indicating for help
1563
1541
1564 $ cat > addverboseitems.py <<EOF
1542 $ cat > addverboseitems.py <<EOF
1565 > '''extension to test omit indicating.
1543 > '''extension to test omit indicating.
1566 >
1544 >
1567 > This paragraph is never omitted (for extension)
1545 > This paragraph is never omitted (for extension)
1568 >
1546 >
1569 > .. container:: verbose
1547 > .. container:: verbose
1570 >
1548 >
1571 > This paragraph is omitted,
1549 > This paragraph is omitted,
1572 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1550 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1573 >
1551 >
1574 > This paragraph is never omitted, too (for extension)
1552 > This paragraph is never omitted, too (for extension)
1575 > '''
1553 > '''
1576 > from __future__ import absolute_import
1554 > from __future__ import absolute_import
1577 > from mercurial import commands, help
1555 > from mercurial import commands, help
1578 > testtopic = """This paragraph is never omitted (for topic).
1556 > testtopic = """This paragraph is never omitted (for topic).
1579 >
1557 >
1580 > .. container:: verbose
1558 > .. container:: verbose
1581 >
1559 >
1582 > This paragraph is omitted,
1560 > This paragraph is omitted,
1583 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1561 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1584 >
1562 >
1585 > This paragraph is never omitted, too (for topic)
1563 > This paragraph is never omitted, too (for topic)
1586 > """
1564 > """
1587 > def extsetup(ui):
1565 > def extsetup(ui):
1588 > help.helptable.append((["topic-containing-verbose"],
1566 > help.helptable.append((["topic-containing-verbose"],
1589 > "This is the topic to test omit indicating.",
1567 > "This is the topic to test omit indicating.",
1590 > lambda ui: testtopic))
1568 > lambda ui: testtopic))
1591 > EOF
1569 > EOF
1592 $ echo '[extensions]' >> $HGRCPATH
1570 $ echo '[extensions]' >> $HGRCPATH
1593 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1571 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1594 $ hg help addverboseitems
1572 $ hg help addverboseitems
1595 addverboseitems extension - extension to test omit indicating.
1573 addverboseitems extension - extension to test omit indicating.
1596
1574
1597 This paragraph is never omitted (for extension)
1575 This paragraph is never omitted (for extension)
1598
1576
1599 This paragraph is never omitted, too (for extension)
1577 This paragraph is never omitted, too (for extension)
1600
1578
1601 (some details hidden, use --verbose to show complete help)
1579 (some details hidden, use --verbose to show complete help)
1602
1580
1603 no commands defined
1581 no commands defined
1604 $ hg help -v addverboseitems
1582 $ hg help -v addverboseitems
1605 addverboseitems extension - extension to test omit indicating.
1583 addverboseitems extension - extension to test omit indicating.
1606
1584
1607 This paragraph is never omitted (for extension)
1585 This paragraph is never omitted (for extension)
1608
1586
1609 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1587 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1610 extension)
1588 extension)
1611
1589
1612 This paragraph is never omitted, too (for extension)
1590 This paragraph is never omitted, too (for extension)
1613
1591
1614 no commands defined
1592 no commands defined
1615 $ hg help topic-containing-verbose
1593 $ hg help topic-containing-verbose
1616 This is the topic to test omit indicating.
1594 This is the topic to test omit indicating.
1617 """"""""""""""""""""""""""""""""""""""""""
1595 """"""""""""""""""""""""""""""""""""""""""
1618
1596
1619 This paragraph is never omitted (for topic).
1597 This paragraph is never omitted (for topic).
1620
1598
1621 This paragraph is never omitted, too (for topic)
1599 This paragraph is never omitted, too (for topic)
1622
1600
1623 (some details hidden, use --verbose to show complete help)
1601 (some details hidden, use --verbose to show complete help)
1624 $ hg help -v topic-containing-verbose
1602 $ hg help -v topic-containing-verbose
1625 This is the topic to test omit indicating.
1603 This is the topic to test omit indicating.
1626 """"""""""""""""""""""""""""""""""""""""""
1604 """"""""""""""""""""""""""""""""""""""""""
1627
1605
1628 This paragraph is never omitted (for topic).
1606 This paragraph is never omitted (for topic).
1629
1607
1630 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1608 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1631 topic)
1609 topic)
1632
1610
1633 This paragraph is never omitted, too (for topic)
1611 This paragraph is never omitted, too (for topic)
1634
1612
1635 Test section lookup
1613 Test section lookup
1636
1614
1637 $ hg help revset.merge
1615 $ hg help revset.merge
1638 "merge()"
1616 "merge()"
1639 Changeset is a merge changeset.
1617 Changeset is a merge changeset.
1640
1618
1641 $ hg help glossary.dag
1619 $ hg help glossary.dag
1642 DAG
1620 DAG
1643 The repository of changesets of a distributed version control system
1621 The repository of changesets of a distributed version control system
1644 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1622 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1645 of nodes and edges, where nodes correspond to changesets and edges
1623 of nodes and edges, where nodes correspond to changesets and edges
1646 imply a parent -> child relation. This graph can be visualized by
1624 imply a parent -> child relation. This graph can be visualized by
1647 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1625 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1648 limited by the requirement for children to have at most two parents.
1626 limited by the requirement for children to have at most two parents.
1649
1627
1650
1628
1651 $ hg help hgrc.paths
1629 $ hg help hgrc.paths
1652 "paths"
1630 "paths"
1653 -------
1631 -------
1654
1632
1655 Assigns symbolic names and behavior to repositories.
1633 Assigns symbolic names and behavior to repositories.
1656
1634
1657 Options are symbolic names defining the URL or directory that is the
1635 Options are symbolic names defining the URL or directory that is the
1658 location of the repository. Example:
1636 location of the repository. Example:
1659
1637
1660 [paths]
1638 [paths]
1661 my_server = https://example.com/my_repo
1639 my_server = https://example.com/my_repo
1662 local_path = /home/me/repo
1640 local_path = /home/me/repo
1663
1641
1664 These symbolic names can be used from the command line. To pull from
1642 These symbolic names can be used from the command line. To pull from
1665 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1643 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1666 local_path'.
1644 local_path'.
1667
1645
1668 Options containing colons (":") denote sub-options that can influence
1646 Options containing colons (":") denote sub-options that can influence
1669 behavior for that specific path. Example:
1647 behavior for that specific path. Example:
1670
1648
1671 [paths]
1649 [paths]
1672 my_server = https://example.com/my_path
1650 my_server = https://example.com/my_path
1673 my_server:pushurl = ssh://example.com/my_path
1651 my_server:pushurl = ssh://example.com/my_path
1674
1652
1675 The following sub-options can be defined:
1653 The following sub-options can be defined:
1676
1654
1677 "pushurl"
1655 "pushurl"
1678 The URL to use for push operations. If not defined, the location
1656 The URL to use for push operations. If not defined, the location
1679 defined by the path's main entry is used.
1657 defined by the path's main entry is used.
1680
1658
1681 "pushrev"
1659 "pushrev"
1682 A revset defining which revisions to push by default.
1660 A revset defining which revisions to push by default.
1683
1661
1684 When 'hg push' is executed without a "-r" argument, the revset defined
1662 When 'hg push' is executed without a "-r" argument, the revset defined
1685 by this sub-option is evaluated to determine what to push.
1663 by this sub-option is evaluated to determine what to push.
1686
1664
1687 For example, a value of "." will push the working directory's revision
1665 For example, a value of "." will push the working directory's revision
1688 by default.
1666 by default.
1689
1667
1690 Revsets specifying bookmarks will not result in the bookmark being
1668 Revsets specifying bookmarks will not result in the bookmark being
1691 pushed.
1669 pushed.
1692
1670
1693 The following special named paths exist:
1671 The following special named paths exist:
1694
1672
1695 "default"
1673 "default"
1696 The URL or directory to use when no source or remote is specified.
1674 The URL or directory to use when no source or remote is specified.
1697
1675
1698 'hg clone' will automatically define this path to the location the
1676 'hg clone' will automatically define this path to the location the
1699 repository was cloned from.
1677 repository was cloned from.
1700
1678
1701 "default-push"
1679 "default-push"
1702 (deprecated) The URL or directory for the default 'hg push' location.
1680 (deprecated) The URL or directory for the default 'hg push' location.
1703 "default:pushurl" should be used instead.
1681 "default:pushurl" should be used instead.
1704
1682
1705 $ hg help glossary.mcguffin
1683 $ hg help glossary.mcguffin
1706 abort: help section not found: glossary.mcguffin
1684 abort: help section not found: glossary.mcguffin
1707 [255]
1685 [255]
1708
1686
1709 $ hg help glossary.mc.guffin
1687 $ hg help glossary.mc.guffin
1710 abort: help section not found: glossary.mc.guffin
1688 abort: help section not found: glossary.mc.guffin
1711 [255]
1689 [255]
1712
1690
1713 $ hg help template.files
1691 $ hg help template.files
1714 files List of strings. All files modified, added, or removed by
1692 files List of strings. All files modified, added, or removed by
1715 this changeset.
1693 this changeset.
1716 files(pattern)
1694 files(pattern)
1717 All files of the current changeset matching the pattern. See
1695 All files of the current changeset matching the pattern. See
1718 'hg help patterns'.
1696 'hg help patterns'.
1719
1697
1720 Test section lookup by translated message
1698 Test section lookup by translated message
1721
1699
1722 str.lower() instead of encoding.lower(str) on translated message might
1700 str.lower() instead of encoding.lower(str) on translated message might
1723 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1701 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1724 as the second or later byte of multi-byte character.
1702 as the second or later byte of multi-byte character.
1725
1703
1726 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1704 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1727 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1705 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1728 replacement makes message meaningless.
1706 replacement makes message meaningless.
1729
1707
1730 This tests that section lookup by translated string isn't broken by
1708 This tests that section lookup by translated string isn't broken by
1731 such str.lower().
1709 such str.lower().
1732
1710
1733 $ $PYTHON <<EOF
1711 $ $PYTHON <<EOF
1734 > def escape(s):
1712 > def escape(s):
1735 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1713 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932'))
1736 > # translation of "record" in ja_JP.cp932
1714 > # translation of "record" in ja_JP.cp932
1737 > upper = "\x8bL\x98^"
1715 > upper = "\x8bL\x98^"
1738 > # str.lower()-ed section name should be treated as different one
1716 > # str.lower()-ed section name should be treated as different one
1739 > lower = "\x8bl\x98^"
1717 > lower = "\x8bl\x98^"
1740 > with open('ambiguous.py', 'w') as fp:
1718 > with open('ambiguous.py', 'w') as fp:
1741 > fp.write("""# ambiguous section names in ja_JP.cp932
1719 > fp.write("""# ambiguous section names in ja_JP.cp932
1742 > u'''summary of extension
1720 > u'''summary of extension
1743 >
1721 >
1744 > %s
1722 > %s
1745 > ----
1723 > ----
1746 >
1724 >
1747 > Upper name should show only this message
1725 > Upper name should show only this message
1748 >
1726 >
1749 > %s
1727 > %s
1750 > ----
1728 > ----
1751 >
1729 >
1752 > Lower name should show only this message
1730 > Lower name should show only this message
1753 >
1731 >
1754 > subsequent section
1732 > subsequent section
1755 > ------------------
1733 > ------------------
1756 >
1734 >
1757 > This should be hidden at 'hg help ambiguous' with section name.
1735 > This should be hidden at 'hg help ambiguous' with section name.
1758 > '''
1736 > '''
1759 > """ % (escape(upper), escape(lower)))
1737 > """ % (escape(upper), escape(lower)))
1760 > EOF
1738 > EOF
1761
1739
1762 $ cat >> $HGRCPATH <<EOF
1740 $ cat >> $HGRCPATH <<EOF
1763 > [extensions]
1741 > [extensions]
1764 > ambiguous = ./ambiguous.py
1742 > ambiguous = ./ambiguous.py
1765 > EOF
1743 > EOF
1766
1744
1767 $ $PYTHON <<EOF | sh
1745 $ $PYTHON <<EOF | sh
1768 > upper = "\x8bL\x98^"
1746 > upper = "\x8bL\x98^"
1769 > print("hg --encoding cp932 help -e ambiguous.%s" % upper)
1747 > print("hg --encoding cp932 help -e ambiguous.%s" % upper)
1770 > EOF
1748 > EOF
1771 \x8bL\x98^ (esc)
1749 \x8bL\x98^ (esc)
1772 ----
1750 ----
1773
1751
1774 Upper name should show only this message
1752 Upper name should show only this message
1775
1753
1776
1754
1777 $ $PYTHON <<EOF | sh
1755 $ $PYTHON <<EOF | sh
1778 > lower = "\x8bl\x98^"
1756 > lower = "\x8bl\x98^"
1779 > print("hg --encoding cp932 help -e ambiguous.%s" % lower)
1757 > print("hg --encoding cp932 help -e ambiguous.%s" % lower)
1780 > EOF
1758 > EOF
1781 \x8bl\x98^ (esc)
1759 \x8bl\x98^ (esc)
1782 ----
1760 ----
1783
1761
1784 Lower name should show only this message
1762 Lower name should show only this message
1785
1763
1786
1764
1787 $ cat >> $HGRCPATH <<EOF
1765 $ cat >> $HGRCPATH <<EOF
1788 > [extensions]
1766 > [extensions]
1789 > ambiguous = !
1767 > ambiguous = !
1790 > EOF
1768 > EOF
1791
1769
1792 Show help content of disabled extensions
1770 Show help content of disabled extensions
1793
1771
1794 $ cat >> $HGRCPATH <<EOF
1772 $ cat >> $HGRCPATH <<EOF
1795 > [extensions]
1773 > [extensions]
1796 > ambiguous = !./ambiguous.py
1774 > ambiguous = !./ambiguous.py
1797 > EOF
1775 > EOF
1798 $ hg help -e ambiguous
1776 $ hg help -e ambiguous
1799 ambiguous extension - (no help text available)
1777 ambiguous extension - (no help text available)
1800
1778
1801 (use 'hg help extensions' for information on enabling extensions)
1779 (use 'hg help extensions' for information on enabling extensions)
1802
1780
1803 Test dynamic list of merge tools only shows up once
1781 Test dynamic list of merge tools only shows up once
1804 $ hg help merge-tools
1782 $ hg help merge-tools
1805 Merge Tools
1783 Merge Tools
1806 """""""""""
1784 """""""""""
1807
1785
1808 To merge files Mercurial uses merge tools.
1786 To merge files Mercurial uses merge tools.
1809
1787
1810 A merge tool combines two different versions of a file into a merged file.
1788 A merge tool combines two different versions of a file into a merged file.
1811 Merge tools are given the two files and the greatest common ancestor of
1789 Merge tools are given the two files and the greatest common ancestor of
1812 the two file versions, so they can determine the changes made on both
1790 the two file versions, so they can determine the changes made on both
1813 branches.
1791 branches.
1814
1792
1815 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1793 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1816 backout' and in several extensions.
1794 backout' and in several extensions.
1817
1795
1818 Usually, the merge tool tries to automatically reconcile the files by
1796 Usually, the merge tool tries to automatically reconcile the files by
1819 combining all non-overlapping changes that occurred separately in the two
1797 combining all non-overlapping changes that occurred separately in the two
1820 different evolutions of the same initial base file. Furthermore, some
1798 different evolutions of the same initial base file. Furthermore, some
1821 interactive merge programs make it easier to manually resolve conflicting
1799 interactive merge programs make it easier to manually resolve conflicting
1822 merges, either in a graphical way, or by inserting some conflict markers.
1800 merges, either in a graphical way, or by inserting some conflict markers.
1823 Mercurial does not include any interactive merge programs but relies on
1801 Mercurial does not include any interactive merge programs but relies on
1824 external tools for that.
1802 external tools for that.
1825
1803
1826 Available merge tools
1804 Available merge tools
1827 =====================
1805 =====================
1828
1806
1829 External merge tools and their properties are configured in the merge-
1807 External merge tools and their properties are configured in the merge-
1830 tools configuration section - see hgrc(5) - but they can often just be
1808 tools configuration section - see hgrc(5) - but they can often just be
1831 named by their executable.
1809 named by their executable.
1832
1810
1833 A merge tool is generally usable if its executable can be found on the
1811 A merge tool is generally usable if its executable can be found on the
1834 system and if it can handle the merge. The executable is found if it is an
1812 system and if it can handle the merge. The executable is found if it is an
1835 absolute or relative executable path or the name of an application in the
1813 absolute or relative executable path or the name of an application in the
1836 executable search path. The tool is assumed to be able to handle the merge
1814 executable search path. The tool is assumed to be able to handle the merge
1837 if it can handle symlinks if the file is a symlink, if it can handle
1815 if it can handle symlinks if the file is a symlink, if it can handle
1838 binary files if the file is binary, and if a GUI is available if the tool
1816 binary files if the file is binary, and if a GUI is available if the tool
1839 requires a GUI.
1817 requires a GUI.
1840
1818
1841 There are some internal merge tools which can be used. The internal merge
1819 There are some internal merge tools which can be used. The internal merge
1842 tools are:
1820 tools are:
1843
1821
1844 ":dump"
1822 ":dump"
1845 Creates three versions of the files to merge, containing the contents of
1823 Creates three versions of the files to merge, containing the contents of
1846 local, other and base. These files can then be used to perform a merge
1824 local, other and base. These files can then be used to perform a merge
1847 manually. If the file to be merged is named "a.txt", these files will
1825 manually. If the file to be merged is named "a.txt", these files will
1848 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1826 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
1849 they will be placed in the same directory as "a.txt".
1827 they will be placed in the same directory as "a.txt".
1850
1828
1851 This implies premerge. Therefore, files aren't dumped, if premerge runs
1829 This implies premerge. Therefore, files aren't dumped, if premerge runs
1852 successfully. Use :forcedump to forcibly write files out.
1830 successfully. Use :forcedump to forcibly write files out.
1853
1831
1854 ":fail"
1832 ":fail"
1855 Rather than attempting to merge files that were modified on both
1833 Rather than attempting to merge files that were modified on both
1856 branches, it marks them as unresolved. The resolve command must be used
1834 branches, it marks them as unresolved. The resolve command must be used
1857 to resolve these conflicts.
1835 to resolve these conflicts.
1858
1836
1859 ":forcedump"
1837 ":forcedump"
1860 Creates three versions of the files as same as :dump, but omits
1838 Creates three versions of the files as same as :dump, but omits
1861 premerge.
1839 premerge.
1862
1840
1863 ":local"
1841 ":local"
1864 Uses the local 'p1()' version of files as the merged version.
1842 Uses the local 'p1()' version of files as the merged version.
1865
1843
1866 ":merge"
1844 ":merge"
1867 Uses the internal non-interactive simple merge algorithm for merging
1845 Uses the internal non-interactive simple merge algorithm for merging
1868 files. It will fail if there are any conflicts and leave markers in the
1846 files. It will fail if there are any conflicts and leave markers in the
1869 partially merged file. Markers will have two sections, one for each side
1847 partially merged file. Markers will have two sections, one for each side
1870 of merge.
1848 of merge.
1871
1849
1872 ":merge-local"
1850 ":merge-local"
1873 Like :merge, but resolve all conflicts non-interactively in favor of the
1851 Like :merge, but resolve all conflicts non-interactively in favor of the
1874 local 'p1()' changes.
1852 local 'p1()' changes.
1875
1853
1876 ":merge-other"
1854 ":merge-other"
1877 Like :merge, but resolve all conflicts non-interactively in favor of the
1855 Like :merge, but resolve all conflicts non-interactively in favor of the
1878 other 'p2()' changes.
1856 other 'p2()' changes.
1879
1857
1880 ":merge3"
1858 ":merge3"
1881 Uses the internal non-interactive simple merge algorithm for merging
1859 Uses the internal non-interactive simple merge algorithm for merging
1882 files. It will fail if there are any conflicts and leave markers in the
1860 files. It will fail if there are any conflicts and leave markers in the
1883 partially merged file. Marker will have three sections, one from each
1861 partially merged file. Marker will have three sections, one from each
1884 side of the merge and one for the base content.
1862 side of the merge and one for the base content.
1885
1863
1886 ":other"
1864 ":other"
1887 Uses the other 'p2()' version of files as the merged version.
1865 Uses the other 'p2()' version of files as the merged version.
1888
1866
1889 ":prompt"
1867 ":prompt"
1890 Asks the user which of the local 'p1()' or the other 'p2()' version to
1868 Asks the user which of the local 'p1()' or the other 'p2()' version to
1891 keep as the merged version.
1869 keep as the merged version.
1892
1870
1893 ":tagmerge"
1871 ":tagmerge"
1894 Uses the internal tag merge algorithm (experimental).
1872 Uses the internal tag merge algorithm (experimental).
1895
1873
1896 ":union"
1874 ":union"
1897 Uses the internal non-interactive simple merge algorithm for merging
1875 Uses the internal non-interactive simple merge algorithm for merging
1898 files. It will use both left and right sides for conflict regions. No
1876 files. It will use both left and right sides for conflict regions. No
1899 markers are inserted.
1877 markers are inserted.
1900
1878
1901 Internal tools are always available and do not require a GUI but will by
1879 Internal tools are always available and do not require a GUI but will by
1902 default not handle symlinks or binary files.
1880 default not handle symlinks or binary files.
1903
1881
1904 Choosing a merge tool
1882 Choosing a merge tool
1905 =====================
1883 =====================
1906
1884
1907 Mercurial uses these rules when deciding which merge tool to use:
1885 Mercurial uses these rules when deciding which merge tool to use:
1908
1886
1909 1. If a tool has been specified with the --tool option to merge or
1887 1. If a tool has been specified with the --tool option to merge or
1910 resolve, it is used. If it is the name of a tool in the merge-tools
1888 resolve, it is used. If it is the name of a tool in the merge-tools
1911 configuration, its configuration is used. Otherwise the specified tool
1889 configuration, its configuration is used. Otherwise the specified tool
1912 must be executable by the shell.
1890 must be executable by the shell.
1913 2. If the "HGMERGE" environment variable is present, its value is used and
1891 2. If the "HGMERGE" environment variable is present, its value is used and
1914 must be executable by the shell.
1892 must be executable by the shell.
1915 3. If the filename of the file to be merged matches any of the patterns in
1893 3. If the filename of the file to be merged matches any of the patterns in
1916 the merge-patterns configuration section, the first usable merge tool
1894 the merge-patterns configuration section, the first usable merge tool
1917 corresponding to a matching pattern is used. Here, binary capabilities
1895 corresponding to a matching pattern is used. Here, binary capabilities
1918 of the merge tool are not considered.
1896 of the merge tool are not considered.
1919 4. If ui.merge is set it will be considered next. If the value is not the
1897 4. If ui.merge is set it will be considered next. If the value is not the
1920 name of a configured tool, the specified value is used and must be
1898 name of a configured tool, the specified value is used and must be
1921 executable by the shell. Otherwise the named tool is used if it is
1899 executable by the shell. Otherwise the named tool is used if it is
1922 usable.
1900 usable.
1923 5. If any usable merge tools are present in the merge-tools configuration
1901 5. If any usable merge tools are present in the merge-tools configuration
1924 section, the one with the highest priority is used.
1902 section, the one with the highest priority is used.
1925 6. If a program named "hgmerge" can be found on the system, it is used -
1903 6. If a program named "hgmerge" can be found on the system, it is used -
1926 but it will by default not be used for symlinks and binary files.
1904 but it will by default not be used for symlinks and binary files.
1927 7. If the file to be merged is not binary and is not a symlink, then
1905 7. If the file to be merged is not binary and is not a symlink, then
1928 internal ":merge" is used.
1906 internal ":merge" is used.
1929 8. Otherwise, ":prompt" is used.
1907 8. Otherwise, ":prompt" is used.
1930
1908
1931 Note:
1909 Note:
1932 After selecting a merge program, Mercurial will by default attempt to
1910 After selecting a merge program, Mercurial will by default attempt to
1933 merge the files using a simple merge algorithm first. Only if it
1911 merge the files using a simple merge algorithm first. Only if it
1934 doesn't succeed because of conflicting changes will Mercurial actually
1912 doesn't succeed because of conflicting changes will Mercurial actually
1935 execute the merge program. Whether to use the simple merge algorithm
1913 execute the merge program. Whether to use the simple merge algorithm
1936 first can be controlled by the premerge setting of the merge tool.
1914 first can be controlled by the premerge setting of the merge tool.
1937 Premerge is enabled by default unless the file is binary or a symlink.
1915 Premerge is enabled by default unless the file is binary or a symlink.
1938
1916
1939 See the merge-tools and ui sections of hgrc(5) for details on the
1917 See the merge-tools and ui sections of hgrc(5) for details on the
1940 configuration of merge tools.
1918 configuration of merge tools.
1941
1919
1942 Compression engines listed in `hg help bundlespec`
1920 Compression engines listed in `hg help bundlespec`
1943
1921
1944 $ hg help bundlespec | grep gzip
1922 $ hg help bundlespec | grep gzip
1945 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1923 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
1946 An algorithm that produces smaller bundles than "gzip".
1924 An algorithm that produces smaller bundles than "gzip".
1947 This engine will likely produce smaller bundles than "gzip" but will be
1925 This engine will likely produce smaller bundles than "gzip" but will be
1948 "gzip"
1926 "gzip"
1949 better compression than "gzip". It also frequently yields better (?)
1927 better compression than "gzip". It also frequently yields better (?)
1950
1928
1951 Test usage of section marks in help documents
1929 Test usage of section marks in help documents
1952
1930
1953 $ cd "$TESTDIR"/../doc
1931 $ cd "$TESTDIR"/../doc
1954 $ $PYTHON check-seclevel.py
1932 $ $PYTHON check-seclevel.py
1955 $ cd $TESTTMP
1933 $ cd $TESTTMP
1956
1934
1957 #if serve
1935 #if serve
1958
1936
1959 Test the help pages in hgweb.
1937 Test the help pages in hgweb.
1960
1938
1961 Dish up an empty repo; serve it cold.
1939 Dish up an empty repo; serve it cold.
1962
1940
1963 $ hg init "$TESTTMP/test"
1941 $ hg init "$TESTTMP/test"
1964 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1942 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
1965 $ cat hg.pid >> $DAEMON_PIDS
1943 $ cat hg.pid >> $DAEMON_PIDS
1966
1944
1967 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1945 $ get-with-headers.py $LOCALIP:$HGPORT "help"
1968 200 Script output follows
1946 200 Script output follows
1969
1947
1970 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1948 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1971 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1949 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
1972 <head>
1950 <head>
1973 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1951 <link rel="icon" href="/static/hgicon.png" type="image/png" />
1974 <meta name="robots" content="index, nofollow" />
1952 <meta name="robots" content="index, nofollow" />
1975 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1953 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
1976 <script type="text/javascript" src="/static/mercurial.js"></script>
1954 <script type="text/javascript" src="/static/mercurial.js"></script>
1977
1955
1978 <title>Help: Index</title>
1956 <title>Help: Index</title>
1979 </head>
1957 </head>
1980 <body>
1958 <body>
1981
1959
1982 <div class="container">
1960 <div class="container">
1983 <div class="menu">
1961 <div class="menu">
1984 <div class="logo">
1962 <div class="logo">
1985 <a href="https://mercurial-scm.org/">
1963 <a href="https://mercurial-scm.org/">
1986 <img src="/static/hglogo.png" alt="mercurial" /></a>
1964 <img src="/static/hglogo.png" alt="mercurial" /></a>
1987 </div>
1965 </div>
1988 <ul>
1966 <ul>
1989 <li><a href="/shortlog">log</a></li>
1967 <li><a href="/shortlog">log</a></li>
1990 <li><a href="/graph">graph</a></li>
1968 <li><a href="/graph">graph</a></li>
1991 <li><a href="/tags">tags</a></li>
1969 <li><a href="/tags">tags</a></li>
1992 <li><a href="/bookmarks">bookmarks</a></li>
1970 <li><a href="/bookmarks">bookmarks</a></li>
1993 <li><a href="/branches">branches</a></li>
1971 <li><a href="/branches">branches</a></li>
1994 </ul>
1972 </ul>
1995 <ul>
1973 <ul>
1996 <li class="active">help</li>
1974 <li class="active">help</li>
1997 </ul>
1975 </ul>
1998 </div>
1976 </div>
1999
1977
2000 <div class="main">
1978 <div class="main">
2001 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
1979 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2002
1980
2003 <form class="search" action="/log">
1981 <form class="search" action="/log">
2004
1982
2005 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
1983 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2006 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
1984 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2007 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
1985 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2008 </form>
1986 </form>
2009 <table class="bigtable">
1987 <table class="bigtable">
2010 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
1988 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2011
1989
2012 <tr><td>
1990 <tr><td>
2013 <a href="/help/bundlespec">
1991 <a href="/help/bundlespec">
2014 bundlespec
1992 bundlespec
2015 </a>
1993 </a>
2016 </td><td>
1994 </td><td>
2017 Bundle File Formats
1995 Bundle File Formats
2018 </td></tr>
1996 </td></tr>
2019 <tr><td>
1997 <tr><td>
2020 <a href="/help/color">
1998 <a href="/help/color">
2021 color
1999 color
2022 </a>
2000 </a>
2023 </td><td>
2001 </td><td>
2024 Colorizing Outputs
2002 Colorizing Outputs
2025 </td></tr>
2003 </td></tr>
2026 <tr><td>
2004 <tr><td>
2027 <a href="/help/config">
2005 <a href="/help/config">
2028 config
2006 config
2029 </a>
2007 </a>
2030 </td><td>
2008 </td><td>
2031 Configuration Files
2009 Configuration Files
2032 </td></tr>
2010 </td></tr>
2033 <tr><td>
2011 <tr><td>
2034 <a href="/help/dates">
2012 <a href="/help/dates">
2035 dates
2013 dates
2036 </a>
2014 </a>
2037 </td><td>
2015 </td><td>
2038 Date Formats
2016 Date Formats
2039 </td></tr>
2017 </td></tr>
2040 <tr><td>
2018 <tr><td>
2041 <a href="/help/deprecated">
2019 <a href="/help/deprecated">
2042 deprecated
2020 deprecated
2043 </a>
2021 </a>
2044 </td><td>
2022 </td><td>
2045 Deprecated Features
2023 Deprecated Features
2046 </td></tr>
2024 </td></tr>
2047 <tr><td>
2025 <tr><td>
2048 <a href="/help/diffs">
2026 <a href="/help/diffs">
2049 diffs
2027 diffs
2050 </a>
2028 </a>
2051 </td><td>
2029 </td><td>
2052 Diff Formats
2030 Diff Formats
2053 </td></tr>
2031 </td></tr>
2054 <tr><td>
2032 <tr><td>
2055 <a href="/help/environment">
2033 <a href="/help/environment">
2056 environment
2034 environment
2057 </a>
2035 </a>
2058 </td><td>
2036 </td><td>
2059 Environment Variables
2037 Environment Variables
2060 </td></tr>
2038 </td></tr>
2061 <tr><td>
2039 <tr><td>
2062 <a href="/help/extensions">
2040 <a href="/help/extensions">
2063 extensions
2041 extensions
2064 </a>
2042 </a>
2065 </td><td>
2043 </td><td>
2066 Using Additional Features
2044 Using Additional Features
2067 </td></tr>
2045 </td></tr>
2068 <tr><td>
2046 <tr><td>
2069 <a href="/help/filesets">
2047 <a href="/help/filesets">
2070 filesets
2048 filesets
2071 </a>
2049 </a>
2072 </td><td>
2050 </td><td>
2073 Specifying File Sets
2051 Specifying File Sets
2074 </td></tr>
2052 </td></tr>
2075 <tr><td>
2053 <tr><td>
2076 <a href="/help/flags">
2054 <a href="/help/flags">
2077 flags
2055 flags
2078 </a>
2056 </a>
2079 </td><td>
2057 </td><td>
2080 Command-line flags
2058 Command-line flags
2081 </td></tr>
2059 </td></tr>
2082 <tr><td>
2060 <tr><td>
2083 <a href="/help/glossary">
2061 <a href="/help/glossary">
2084 glossary
2062 glossary
2085 </a>
2063 </a>
2086 </td><td>
2064 </td><td>
2087 Glossary
2065 Glossary
2088 </td></tr>
2066 </td></tr>
2089 <tr><td>
2067 <tr><td>
2090 <a href="/help/hgignore">
2068 <a href="/help/hgignore">
2091 hgignore
2069 hgignore
2092 </a>
2070 </a>
2093 </td><td>
2071 </td><td>
2094 Syntax for Mercurial Ignore Files
2072 Syntax for Mercurial Ignore Files
2095 </td></tr>
2073 </td></tr>
2096 <tr><td>
2074 <tr><td>
2097 <a href="/help/hgweb">
2075 <a href="/help/hgweb">
2098 hgweb
2076 hgweb
2099 </a>
2077 </a>
2100 </td><td>
2078 </td><td>
2101 Configuring hgweb
2079 Configuring hgweb
2102 </td></tr>
2080 </td></tr>
2103 <tr><td>
2081 <tr><td>
2104 <a href="/help/internals">
2082 <a href="/help/internals">
2105 internals
2083 internals
2106 </a>
2084 </a>
2107 </td><td>
2085 </td><td>
2108 Technical implementation topics
2086 Technical implementation topics
2109 </td></tr>
2087 </td></tr>
2110 <tr><td>
2088 <tr><td>
2111 <a href="/help/merge-tools">
2089 <a href="/help/merge-tools">
2112 merge-tools
2090 merge-tools
2113 </a>
2091 </a>
2114 </td><td>
2092 </td><td>
2115 Merge Tools
2093 Merge Tools
2116 </td></tr>
2094 </td></tr>
2117 <tr><td>
2095 <tr><td>
2118 <a href="/help/pager">
2096 <a href="/help/pager">
2119 pager
2097 pager
2120 </a>
2098 </a>
2121 </td><td>
2099 </td><td>
2122 Pager Support
2100 Pager Support
2123 </td></tr>
2101 </td></tr>
2124 <tr><td>
2102 <tr><td>
2125 <a href="/help/patterns">
2103 <a href="/help/patterns">
2126 patterns
2104 patterns
2127 </a>
2105 </a>
2128 </td><td>
2106 </td><td>
2129 File Name Patterns
2107 File Name Patterns
2130 </td></tr>
2108 </td></tr>
2131 <tr><td>
2109 <tr><td>
2132 <a href="/help/phases">
2110 <a href="/help/phases">
2133 phases
2111 phases
2134 </a>
2112 </a>
2135 </td><td>
2113 </td><td>
2136 Working with Phases
2114 Working with Phases
2137 </td></tr>
2115 </td></tr>
2138 <tr><td>
2116 <tr><td>
2139 <a href="/help/revisions">
2117 <a href="/help/revisions">
2140 revisions
2118 revisions
2141 </a>
2119 </a>
2142 </td><td>
2120 </td><td>
2143 Specifying Revisions
2121 Specifying Revisions
2144 </td></tr>
2122 </td></tr>
2145 <tr><td>
2123 <tr><td>
2146 <a href="/help/scripting">
2124 <a href="/help/scripting">
2147 scripting
2125 scripting
2148 </a>
2126 </a>
2149 </td><td>
2127 </td><td>
2150 Using Mercurial from scripts and automation
2128 Using Mercurial from scripts and automation
2151 </td></tr>
2129 </td></tr>
2152 <tr><td>
2130 <tr><td>
2153 <a href="/help/subrepos">
2131 <a href="/help/subrepos">
2154 subrepos
2132 subrepos
2155 </a>
2133 </a>
2156 </td><td>
2134 </td><td>
2157 Subrepositories
2135 Subrepositories
2158 </td></tr>
2136 </td></tr>
2159 <tr><td>
2137 <tr><td>
2160 <a href="/help/templating">
2138 <a href="/help/templating">
2161 templating
2139 templating
2162 </a>
2140 </a>
2163 </td><td>
2141 </td><td>
2164 Template Usage
2142 Template Usage
2165 </td></tr>
2143 </td></tr>
2166 <tr><td>
2144 <tr><td>
2167 <a href="/help/urls">
2145 <a href="/help/urls">
2168 urls
2146 urls
2169 </a>
2147 </a>
2170 </td><td>
2148 </td><td>
2171 URL Paths
2149 URL Paths
2172 </td></tr>
2150 </td></tr>
2173 <tr><td>
2151 <tr><td>
2174 <a href="/help/topic-containing-verbose">
2152 <a href="/help/topic-containing-verbose">
2175 topic-containing-verbose
2153 topic-containing-verbose
2176 </a>
2154 </a>
2177 </td><td>
2155 </td><td>
2178 This is the topic to test omit indicating.
2156 This is the topic to test omit indicating.
2179 </td></tr>
2157 </td></tr>
2180
2158
2181
2159
2182 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2160 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2183
2161
2184 <tr><td>
2162 <tr><td>
2185 <a href="/help/add">
2163 <a href="/help/add">
2186 add
2164 add
2187 </a>
2165 </a>
2188 </td><td>
2166 </td><td>
2189 add the specified files on the next commit
2167 add the specified files on the next commit
2190 </td></tr>
2168 </td></tr>
2191 <tr><td>
2169 <tr><td>
2192 <a href="/help/annotate">
2170 <a href="/help/annotate">
2193 annotate
2171 annotate
2194 </a>
2172 </a>
2195 </td><td>
2173 </td><td>
2196 show changeset information by line for each file
2174 show changeset information by line for each file
2197 </td></tr>
2175 </td></tr>
2198 <tr><td>
2176 <tr><td>
2199 <a href="/help/clone">
2177 <a href="/help/clone">
2200 clone
2178 clone
2201 </a>
2179 </a>
2202 </td><td>
2180 </td><td>
2203 make a copy of an existing repository
2181 make a copy of an existing repository
2204 </td></tr>
2182 </td></tr>
2205 <tr><td>
2183 <tr><td>
2206 <a href="/help/commit">
2184 <a href="/help/commit">
2207 commit
2185 commit
2208 </a>
2186 </a>
2209 </td><td>
2187 </td><td>
2210 commit the specified files or all outstanding changes
2188 commit the specified files or all outstanding changes
2211 </td></tr>
2189 </td></tr>
2212 <tr><td>
2190 <tr><td>
2213 <a href="/help/diff">
2191 <a href="/help/diff">
2214 diff
2192 diff
2215 </a>
2193 </a>
2216 </td><td>
2194 </td><td>
2217 diff repository (or selected files)
2195 diff repository (or selected files)
2218 </td></tr>
2196 </td></tr>
2219 <tr><td>
2197 <tr><td>
2220 <a href="/help/export">
2198 <a href="/help/export">
2221 export
2199 export
2222 </a>
2200 </a>
2223 </td><td>
2201 </td><td>
2224 dump the header and diffs for one or more changesets
2202 dump the header and diffs for one or more changesets
2225 </td></tr>
2203 </td></tr>
2226 <tr><td>
2204 <tr><td>
2227 <a href="/help/forget">
2205 <a href="/help/forget">
2228 forget
2206 forget
2229 </a>
2207 </a>
2230 </td><td>
2208 </td><td>
2231 forget the specified files on the next commit
2209 forget the specified files on the next commit
2232 </td></tr>
2210 </td></tr>
2233 <tr><td>
2211 <tr><td>
2234 <a href="/help/init">
2212 <a href="/help/init">
2235 init
2213 init
2236 </a>
2214 </a>
2237 </td><td>
2215 </td><td>
2238 create a new repository in the given directory
2216 create a new repository in the given directory
2239 </td></tr>
2217 </td></tr>
2240 <tr><td>
2218 <tr><td>
2241 <a href="/help/log">
2219 <a href="/help/log">
2242 log
2220 log
2243 </a>
2221 </a>
2244 </td><td>
2222 </td><td>
2245 show revision history of entire repository or files
2223 show revision history of entire repository or files
2246 </td></tr>
2224 </td></tr>
2247 <tr><td>
2225 <tr><td>
2248 <a href="/help/merge">
2226 <a href="/help/merge">
2249 merge
2227 merge
2250 </a>
2228 </a>
2251 </td><td>
2229 </td><td>
2252 merge another revision into working directory
2230 merge another revision into working directory
2253 </td></tr>
2231 </td></tr>
2254 <tr><td>
2232 <tr><td>
2255 <a href="/help/pull">
2233 <a href="/help/pull">
2256 pull
2234 pull
2257 </a>
2235 </a>
2258 </td><td>
2236 </td><td>
2259 pull changes from the specified source
2237 pull changes from the specified source
2260 </td></tr>
2238 </td></tr>
2261 <tr><td>
2239 <tr><td>
2262 <a href="/help/push">
2240 <a href="/help/push">
2263 push
2241 push
2264 </a>
2242 </a>
2265 </td><td>
2243 </td><td>
2266 push changes to the specified destination
2244 push changes to the specified destination
2267 </td></tr>
2245 </td></tr>
2268 <tr><td>
2246 <tr><td>
2269 <a href="/help/remove">
2247 <a href="/help/remove">
2270 remove
2248 remove
2271 </a>
2249 </a>
2272 </td><td>
2250 </td><td>
2273 remove the specified files on the next commit
2251 remove the specified files on the next commit
2274 </td></tr>
2252 </td></tr>
2275 <tr><td>
2253 <tr><td>
2276 <a href="/help/serve">
2254 <a href="/help/serve">
2277 serve
2255 serve
2278 </a>
2256 </a>
2279 </td><td>
2257 </td><td>
2280 start stand-alone webserver
2258 start stand-alone webserver
2281 </td></tr>
2259 </td></tr>
2282 <tr><td>
2260 <tr><td>
2283 <a href="/help/status">
2261 <a href="/help/status">
2284 status
2262 status
2285 </a>
2263 </a>
2286 </td><td>
2264 </td><td>
2287 show changed files in the working directory
2265 show changed files in the working directory
2288 </td></tr>
2266 </td></tr>
2289 <tr><td>
2267 <tr><td>
2290 <a href="/help/summary">
2268 <a href="/help/summary">
2291 summary
2269 summary
2292 </a>
2270 </a>
2293 </td><td>
2271 </td><td>
2294 summarize working directory state
2272 summarize working directory state
2295 </td></tr>
2273 </td></tr>
2296 <tr><td>
2274 <tr><td>
2297 <a href="/help/update">
2275 <a href="/help/update">
2298 update
2276 update
2299 </a>
2277 </a>
2300 </td><td>
2278 </td><td>
2301 update working directory (or switch revisions)
2279 update working directory (or switch revisions)
2302 </td></tr>
2280 </td></tr>
2303
2281
2304
2282
2305
2283
2306 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2284 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2307
2285
2308 <tr><td>
2286 <tr><td>
2309 <a href="/help/addremove">
2287 <a href="/help/addremove">
2310 addremove
2288 addremove
2311 </a>
2289 </a>
2312 </td><td>
2290 </td><td>
2313 add all new files, delete all missing files
2291 add all new files, delete all missing files
2314 </td></tr>
2292 </td></tr>
2315 <tr><td>
2293 <tr><td>
2316 <a href="/help/archive">
2294 <a href="/help/archive">
2317 archive
2295 archive
2318 </a>
2296 </a>
2319 </td><td>
2297 </td><td>
2320 create an unversioned archive of a repository revision
2298 create an unversioned archive of a repository revision
2321 </td></tr>
2299 </td></tr>
2322 <tr><td>
2300 <tr><td>
2323 <a href="/help/backout">
2301 <a href="/help/backout">
2324 backout
2302 backout
2325 </a>
2303 </a>
2326 </td><td>
2304 </td><td>
2327 reverse effect of earlier changeset
2305 reverse effect of earlier changeset
2328 </td></tr>
2306 </td></tr>
2329 <tr><td>
2307 <tr><td>
2330 <a href="/help/bisect">
2308 <a href="/help/bisect">
2331 bisect
2309 bisect
2332 </a>
2310 </a>
2333 </td><td>
2311 </td><td>
2334 subdivision search of changesets
2312 subdivision search of changesets
2335 </td></tr>
2313 </td></tr>
2336 <tr><td>
2314 <tr><td>
2337 <a href="/help/bookmarks">
2315 <a href="/help/bookmarks">
2338 bookmarks
2316 bookmarks
2339 </a>
2317 </a>
2340 </td><td>
2318 </td><td>
2341 create a new bookmark or list existing bookmarks
2319 create a new bookmark or list existing bookmarks
2342 </td></tr>
2320 </td></tr>
2343 <tr><td>
2321 <tr><td>
2344 <a href="/help/branch">
2322 <a href="/help/branch">
2345 branch
2323 branch
2346 </a>
2324 </a>
2347 </td><td>
2325 </td><td>
2348 set or show the current branch name
2326 set or show the current branch name
2349 </td></tr>
2327 </td></tr>
2350 <tr><td>
2328 <tr><td>
2351 <a href="/help/branches">
2329 <a href="/help/branches">
2352 branches
2330 branches
2353 </a>
2331 </a>
2354 </td><td>
2332 </td><td>
2355 list repository named branches
2333 list repository named branches
2356 </td></tr>
2334 </td></tr>
2357 <tr><td>
2335 <tr><td>
2358 <a href="/help/bundle">
2336 <a href="/help/bundle">
2359 bundle
2337 bundle
2360 </a>
2338 </a>
2361 </td><td>
2339 </td><td>
2362 create a bundle file
2340 create a bundle file
2363 </td></tr>
2341 </td></tr>
2364 <tr><td>
2342 <tr><td>
2365 <a href="/help/cat">
2343 <a href="/help/cat">
2366 cat
2344 cat
2367 </a>
2345 </a>
2368 </td><td>
2346 </td><td>
2369 output the current or given revision of files
2347 output the current or given revision of files
2370 </td></tr>
2348 </td></tr>
2371 <tr><td>
2349 <tr><td>
2372 <a href="/help/config">
2350 <a href="/help/config">
2373 config
2351 config
2374 </a>
2352 </a>
2375 </td><td>
2353 </td><td>
2376 show combined config settings from all hgrc files
2354 show combined config settings from all hgrc files
2377 </td></tr>
2355 </td></tr>
2378 <tr><td>
2356 <tr><td>
2379 <a href="/help/copy">
2357 <a href="/help/copy">
2380 copy
2358 copy
2381 </a>
2359 </a>
2382 </td><td>
2360 </td><td>
2383 mark files as copied for the next commit
2361 mark files as copied for the next commit
2384 </td></tr>
2362 </td></tr>
2385 <tr><td>
2363 <tr><td>
2386 <a href="/help/files">
2364 <a href="/help/files">
2387 files
2365 files
2388 </a>
2366 </a>
2389 </td><td>
2367 </td><td>
2390 list tracked files
2368 list tracked files
2391 </td></tr>
2369 </td></tr>
2392 <tr><td>
2370 <tr><td>
2393 <a href="/help/graft">
2371 <a href="/help/graft">
2394 graft
2372 graft
2395 </a>
2373 </a>
2396 </td><td>
2374 </td><td>
2397 copy changes from other branches onto the current branch
2375 copy changes from other branches onto the current branch
2398 </td></tr>
2376 </td></tr>
2399 <tr><td>
2377 <tr><td>
2400 <a href="/help/grep">
2378 <a href="/help/grep">
2401 grep
2379 grep
2402 </a>
2380 </a>
2403 </td><td>
2381 </td><td>
2404 search revision history for a pattern in specified files
2382 search revision history for a pattern in specified files
2405 </td></tr>
2383 </td></tr>
2406 <tr><td>
2384 <tr><td>
2407 <a href="/help/heads">
2385 <a href="/help/heads">
2408 heads
2386 heads
2409 </a>
2387 </a>
2410 </td><td>
2388 </td><td>
2411 show branch heads
2389 show branch heads
2412 </td></tr>
2390 </td></tr>
2413 <tr><td>
2391 <tr><td>
2414 <a href="/help/help">
2392 <a href="/help/help">
2415 help
2393 help
2416 </a>
2394 </a>
2417 </td><td>
2395 </td><td>
2418 show help for a given topic or a help overview
2396 show help for a given topic or a help overview
2419 </td></tr>
2397 </td></tr>
2420 <tr><td>
2398 <tr><td>
2421 <a href="/help/hgalias">
2399 <a href="/help/hgalias">
2422 hgalias
2400 hgalias
2423 </a>
2401 </a>
2424 </td><td>
2402 </td><td>
2425 summarize working directory state
2403 summarize working directory state
2426 </td></tr>
2404 </td></tr>
2427 <tr><td>
2405 <tr><td>
2428 <a href="/help/identify">
2406 <a href="/help/identify">
2429 identify
2407 identify
2430 </a>
2408 </a>
2431 </td><td>
2409 </td><td>
2432 identify the working directory or specified revision
2410 identify the working directory or specified revision
2433 </td></tr>
2411 </td></tr>
2434 <tr><td>
2412 <tr><td>
2435 <a href="/help/import">
2413 <a href="/help/import">
2436 import
2414 import
2437 </a>
2415 </a>
2438 </td><td>
2416 </td><td>
2439 import an ordered set of patches
2417 import an ordered set of patches
2440 </td></tr>
2418 </td></tr>
2441 <tr><td>
2419 <tr><td>
2442 <a href="/help/incoming">
2420 <a href="/help/incoming">
2443 incoming
2421 incoming
2444 </a>
2422 </a>
2445 </td><td>
2423 </td><td>
2446 show new changesets found in source
2424 show new changesets found in source
2447 </td></tr>
2425 </td></tr>
2448 <tr><td>
2426 <tr><td>
2449 <a href="/help/manifest">
2427 <a href="/help/manifest">
2450 manifest
2428 manifest
2451 </a>
2429 </a>
2452 </td><td>
2430 </td><td>
2453 output the current or given revision of the project manifest
2431 output the current or given revision of the project manifest
2454 </td></tr>
2432 </td></tr>
2455 <tr><td>
2433 <tr><td>
2456 <a href="/help/nohelp">
2434 <a href="/help/nohelp">
2457 nohelp
2435 nohelp
2458 </a>
2436 </a>
2459 </td><td>
2437 </td><td>
2460 (no help text available)
2438 (no help text available)
2461 </td></tr>
2439 </td></tr>
2462 <tr><td>
2440 <tr><td>
2463 <a href="/help/outgoing">
2441 <a href="/help/outgoing">
2464 outgoing
2442 outgoing
2465 </a>
2443 </a>
2466 </td><td>
2444 </td><td>
2467 show changesets not found in the destination
2445 show changesets not found in the destination
2468 </td></tr>
2446 </td></tr>
2469 <tr><td>
2447 <tr><td>
2470 <a href="/help/paths">
2448 <a href="/help/paths">
2471 paths
2449 paths
2472 </a>
2450 </a>
2473 </td><td>
2451 </td><td>
2474 show aliases for remote repositories
2452 show aliases for remote repositories
2475 </td></tr>
2453 </td></tr>
2476 <tr><td>
2454 <tr><td>
2477 <a href="/help/phase">
2455 <a href="/help/phase">
2478 phase
2456 phase
2479 </a>
2457 </a>
2480 </td><td>
2458 </td><td>
2481 set or show the current phase name
2459 set or show the current phase name
2482 </td></tr>
2460 </td></tr>
2483 <tr><td>
2461 <tr><td>
2484 <a href="/help/recover">
2462 <a href="/help/recover">
2485 recover
2463 recover
2486 </a>
2464 </a>
2487 </td><td>
2465 </td><td>
2488 roll back an interrupted transaction
2466 roll back an interrupted transaction
2489 </td></tr>
2467 </td></tr>
2490 <tr><td>
2468 <tr><td>
2491 <a href="/help/rename">
2469 <a href="/help/rename">
2492 rename
2470 rename
2493 </a>
2471 </a>
2494 </td><td>
2472 </td><td>
2495 rename files; equivalent of copy + remove
2473 rename files; equivalent of copy + remove
2496 </td></tr>
2474 </td></tr>
2497 <tr><td>
2475 <tr><td>
2498 <a href="/help/resolve">
2476 <a href="/help/resolve">
2499 resolve
2477 resolve
2500 </a>
2478 </a>
2501 </td><td>
2479 </td><td>
2502 redo merges or set/view the merge status of files
2480 redo merges or set/view the merge status of files
2503 </td></tr>
2481 </td></tr>
2504 <tr><td>
2482 <tr><td>
2505 <a href="/help/revert">
2483 <a href="/help/revert">
2506 revert
2484 revert
2507 </a>
2485 </a>
2508 </td><td>
2486 </td><td>
2509 restore files to their checkout state
2487 restore files to their checkout state
2510 </td></tr>
2488 </td></tr>
2511 <tr><td>
2489 <tr><td>
2512 <a href="/help/root">
2490 <a href="/help/root">
2513 root
2491 root
2514 </a>
2492 </a>
2515 </td><td>
2493 </td><td>
2516 print the root (top) of the current working directory
2494 print the root (top) of the current working directory
2517 </td></tr>
2495 </td></tr>
2518 <tr><td>
2496 <tr><td>
2519 <a href="/help/shellalias">
2497 <a href="/help/shellalias">
2520 shellalias
2498 shellalias
2521 </a>
2499 </a>
2522 </td><td>
2500 </td><td>
2523 (no help text available)
2501 (no help text available)
2524 </td></tr>
2502 </td></tr>
2525 <tr><td>
2503 <tr><td>
2526 <a href="/help/tag">
2504 <a href="/help/tag">
2527 tag
2505 tag
2528 </a>
2506 </a>
2529 </td><td>
2507 </td><td>
2530 add one or more tags for the current or given revision
2508 add one or more tags for the current or given revision
2531 </td></tr>
2509 </td></tr>
2532 <tr><td>
2510 <tr><td>
2533 <a href="/help/tags">
2511 <a href="/help/tags">
2534 tags
2512 tags
2535 </a>
2513 </a>
2536 </td><td>
2514 </td><td>
2537 list repository tags
2515 list repository tags
2538 </td></tr>
2516 </td></tr>
2539 <tr><td>
2517 <tr><td>
2540 <a href="/help/unbundle">
2518 <a href="/help/unbundle">
2541 unbundle
2519 unbundle
2542 </a>
2520 </a>
2543 </td><td>
2521 </td><td>
2544 apply one or more bundle files
2522 apply one or more bundle files
2545 </td></tr>
2523 </td></tr>
2546 <tr><td>
2524 <tr><td>
2547 <a href="/help/verify">
2525 <a href="/help/verify">
2548 verify
2526 verify
2549 </a>
2527 </a>
2550 </td><td>
2528 </td><td>
2551 verify the integrity of the repository
2529 verify the integrity of the repository
2552 </td></tr>
2530 </td></tr>
2553 <tr><td>
2531 <tr><td>
2554 <a href="/help/version">
2532 <a href="/help/version">
2555 version
2533 version
2556 </a>
2534 </a>
2557 </td><td>
2535 </td><td>
2558 output version and copyright information
2536 output version and copyright information
2559 </td></tr>
2537 </td></tr>
2560
2538
2561
2539
2562 </table>
2540 </table>
2563 </div>
2541 </div>
2564 </div>
2542 </div>
2565
2543
2566
2544
2567
2545
2568 </body>
2546 </body>
2569 </html>
2547 </html>
2570
2548
2571
2549
2572 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2550 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2573 200 Script output follows
2551 200 Script output follows
2574
2552
2575 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2553 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2576 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2554 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2577 <head>
2555 <head>
2578 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2556 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2579 <meta name="robots" content="index, nofollow" />
2557 <meta name="robots" content="index, nofollow" />
2580 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2558 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2581 <script type="text/javascript" src="/static/mercurial.js"></script>
2559 <script type="text/javascript" src="/static/mercurial.js"></script>
2582
2560
2583 <title>Help: add</title>
2561 <title>Help: add</title>
2584 </head>
2562 </head>
2585 <body>
2563 <body>
2586
2564
2587 <div class="container">
2565 <div class="container">
2588 <div class="menu">
2566 <div class="menu">
2589 <div class="logo">
2567 <div class="logo">
2590 <a href="https://mercurial-scm.org/">
2568 <a href="https://mercurial-scm.org/">
2591 <img src="/static/hglogo.png" alt="mercurial" /></a>
2569 <img src="/static/hglogo.png" alt="mercurial" /></a>
2592 </div>
2570 </div>
2593 <ul>
2571 <ul>
2594 <li><a href="/shortlog">log</a></li>
2572 <li><a href="/shortlog">log</a></li>
2595 <li><a href="/graph">graph</a></li>
2573 <li><a href="/graph">graph</a></li>
2596 <li><a href="/tags">tags</a></li>
2574 <li><a href="/tags">tags</a></li>
2597 <li><a href="/bookmarks">bookmarks</a></li>
2575 <li><a href="/bookmarks">bookmarks</a></li>
2598 <li><a href="/branches">branches</a></li>
2576 <li><a href="/branches">branches</a></li>
2599 </ul>
2577 </ul>
2600 <ul>
2578 <ul>
2601 <li class="active"><a href="/help">help</a></li>
2579 <li class="active"><a href="/help">help</a></li>
2602 </ul>
2580 </ul>
2603 </div>
2581 </div>
2604
2582
2605 <div class="main">
2583 <div class="main">
2606 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2584 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2607 <h3>Help: add</h3>
2585 <h3>Help: add</h3>
2608
2586
2609 <form class="search" action="/log">
2587 <form class="search" action="/log">
2610
2588
2611 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2589 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2612 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2590 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2613 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2591 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2614 </form>
2592 </form>
2615 <div id="doc">
2593 <div id="doc">
2616 <p>
2594 <p>
2617 hg add [OPTION]... [FILE]...
2595 hg add [OPTION]... [FILE]...
2618 </p>
2596 </p>
2619 <p>
2597 <p>
2620 add the specified files on the next commit
2598 add the specified files on the next commit
2621 </p>
2599 </p>
2622 <p>
2600 <p>
2623 Schedule files to be version controlled and added to the
2601 Schedule files to be version controlled and added to the
2624 repository.
2602 repository.
2625 </p>
2603 </p>
2626 <p>
2604 <p>
2627 The files will be added to the repository at the next commit. To
2605 The files will be added to the repository at the next commit. To
2628 undo an add before that, see 'hg forget'.
2606 undo an add before that, see 'hg forget'.
2629 </p>
2607 </p>
2630 <p>
2608 <p>
2631 If no names are given, add all files to the repository (except
2609 If no names are given, add all files to the repository (except
2632 files matching &quot;.hgignore&quot;).
2610 files matching &quot;.hgignore&quot;).
2633 </p>
2611 </p>
2634 <p>
2612 <p>
2635 Examples:
2613 Examples:
2636 </p>
2614 </p>
2637 <ul>
2615 <ul>
2638 <li> New (unknown) files are added automatically by 'hg add':
2616 <li> New (unknown) files are added automatically by 'hg add':
2639 <pre>
2617 <pre>
2640 \$ ls (re)
2618 \$ ls (re)
2641 foo.c
2619 foo.c
2642 \$ hg status (re)
2620 \$ hg status (re)
2643 ? foo.c
2621 ? foo.c
2644 \$ hg add (re)
2622 \$ hg add (re)
2645 adding foo.c
2623 adding foo.c
2646 \$ hg status (re)
2624 \$ hg status (re)
2647 A foo.c
2625 A foo.c
2648 </pre>
2626 </pre>
2649 <li> Specific files to be added can be specified:
2627 <li> Specific files to be added can be specified:
2650 <pre>
2628 <pre>
2651 \$ ls (re)
2629 \$ ls (re)
2652 bar.c foo.c
2630 bar.c foo.c
2653 \$ hg status (re)
2631 \$ hg status (re)
2654 ? bar.c
2632 ? bar.c
2655 ? foo.c
2633 ? foo.c
2656 \$ hg add bar.c (re)
2634 \$ hg add bar.c (re)
2657 \$ hg status (re)
2635 \$ hg status (re)
2658 A bar.c
2636 A bar.c
2659 ? foo.c
2637 ? foo.c
2660 </pre>
2638 </pre>
2661 </ul>
2639 </ul>
2662 <p>
2640 <p>
2663 Returns 0 if all files are successfully added.
2641 Returns 0 if all files are successfully added.
2664 </p>
2642 </p>
2665 <p>
2643 <p>
2666 options ([+] can be repeated):
2644 options ([+] can be repeated):
2667 </p>
2645 </p>
2668 <table>
2646 <table>
2669 <tr><td>-I</td>
2647 <tr><td>-I</td>
2670 <td>--include PATTERN [+]</td>
2648 <td>--include PATTERN [+]</td>
2671 <td>include names matching the given patterns</td></tr>
2649 <td>include names matching the given patterns</td></tr>
2672 <tr><td>-X</td>
2650 <tr><td>-X</td>
2673 <td>--exclude PATTERN [+]</td>
2651 <td>--exclude PATTERN [+]</td>
2674 <td>exclude names matching the given patterns</td></tr>
2652 <td>exclude names matching the given patterns</td></tr>
2675 <tr><td>-S</td>
2653 <tr><td>-S</td>
2676 <td>--subrepos</td>
2654 <td>--subrepos</td>
2677 <td>recurse into subrepositories</td></tr>
2655 <td>recurse into subrepositories</td></tr>
2678 <tr><td>-n</td>
2656 <tr><td>-n</td>
2679 <td>--dry-run</td>
2657 <td>--dry-run</td>
2680 <td>do not perform actions, just print output</td></tr>
2658 <td>do not perform actions, just print output</td></tr>
2681 </table>
2659 </table>
2682 <p>
2660 <p>
2683 global options ([+] can be repeated):
2661 global options ([+] can be repeated):
2684 </p>
2662 </p>
2685 <table>
2663 <table>
2686 <tr><td>-R</td>
2664 <tr><td>-R</td>
2687 <td>--repository REPO</td>
2665 <td>--repository REPO</td>
2688 <td>repository root directory or name of overlay bundle file</td></tr>
2666 <td>repository root directory or name of overlay bundle file</td></tr>
2689 <tr><td></td>
2667 <tr><td></td>
2690 <td>--cwd DIR</td>
2668 <td>--cwd DIR</td>
2691 <td>change working directory</td></tr>
2669 <td>change working directory</td></tr>
2692 <tr><td>-y</td>
2670 <tr><td>-y</td>
2693 <td>--noninteractive</td>
2671 <td>--noninteractive</td>
2694 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2672 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2695 <tr><td>-q</td>
2673 <tr><td>-q</td>
2696 <td>--quiet</td>
2674 <td>--quiet</td>
2697 <td>suppress output</td></tr>
2675 <td>suppress output</td></tr>
2698 <tr><td>-v</td>
2676 <tr><td>-v</td>
2699 <td>--verbose</td>
2677 <td>--verbose</td>
2700 <td>enable additional output</td></tr>
2678 <td>enable additional output</td></tr>
2701 <tr><td></td>
2679 <tr><td></td>
2702 <td>--color TYPE</td>
2680 <td>--color TYPE</td>
2703 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2681 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2704 <tr><td></td>
2682 <tr><td></td>
2705 <td>--config CONFIG [+]</td>
2683 <td>--config CONFIG [+]</td>
2706 <td>set/override config option (use 'section.name=value')</td></tr>
2684 <td>set/override config option (use 'section.name=value')</td></tr>
2707 <tr><td></td>
2685 <tr><td></td>
2708 <td>--debug</td>
2686 <td>--debug</td>
2709 <td>enable debugging output</td></tr>
2687 <td>enable debugging output</td></tr>
2710 <tr><td></td>
2688 <tr><td></td>
2711 <td>--debugger</td>
2689 <td>--debugger</td>
2712 <td>start debugger</td></tr>
2690 <td>start debugger</td></tr>
2713 <tr><td></td>
2691 <tr><td></td>
2714 <td>--encoding ENCODE</td>
2692 <td>--encoding ENCODE</td>
2715 <td>set the charset encoding (default: ascii)</td></tr>
2693 <td>set the charset encoding (default: ascii)</td></tr>
2716 <tr><td></td>
2694 <tr><td></td>
2717 <td>--encodingmode MODE</td>
2695 <td>--encodingmode MODE</td>
2718 <td>set the charset encoding mode (default: strict)</td></tr>
2696 <td>set the charset encoding mode (default: strict)</td></tr>
2719 <tr><td></td>
2697 <tr><td></td>
2720 <td>--traceback</td>
2698 <td>--traceback</td>
2721 <td>always print a traceback on exception</td></tr>
2699 <td>always print a traceback on exception</td></tr>
2722 <tr><td></td>
2700 <tr><td></td>
2723 <td>--time</td>
2701 <td>--time</td>
2724 <td>time how long the command takes</td></tr>
2702 <td>time how long the command takes</td></tr>
2725 <tr><td></td>
2703 <tr><td></td>
2726 <td>--profile</td>
2704 <td>--profile</td>
2727 <td>print command execution profile</td></tr>
2705 <td>print command execution profile</td></tr>
2728 <tr><td></td>
2706 <tr><td></td>
2729 <td>--version</td>
2707 <td>--version</td>
2730 <td>output version information and exit</td></tr>
2708 <td>output version information and exit</td></tr>
2731 <tr><td>-h</td>
2709 <tr><td>-h</td>
2732 <td>--help</td>
2710 <td>--help</td>
2733 <td>display help and exit</td></tr>
2711 <td>display help and exit</td></tr>
2734 <tr><td></td>
2712 <tr><td></td>
2735 <td>--hidden</td>
2713 <td>--hidden</td>
2736 <td>consider hidden changesets</td></tr>
2714 <td>consider hidden changesets</td></tr>
2737 <tr><td></td>
2715 <tr><td></td>
2738 <td>--pager TYPE</td>
2716 <td>--pager TYPE</td>
2739 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2717 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2740 </table>
2718 </table>
2741
2719
2742 </div>
2720 </div>
2743 </div>
2721 </div>
2744 </div>
2722 </div>
2745
2723
2746
2724
2747
2725
2748 </body>
2726 </body>
2749 </html>
2727 </html>
2750
2728
2751
2729
2752 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2730 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
2753 200 Script output follows
2731 200 Script output follows
2754
2732
2755 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2733 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2756 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2734 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2757 <head>
2735 <head>
2758 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2736 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2759 <meta name="robots" content="index, nofollow" />
2737 <meta name="robots" content="index, nofollow" />
2760 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2738 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2761 <script type="text/javascript" src="/static/mercurial.js"></script>
2739 <script type="text/javascript" src="/static/mercurial.js"></script>
2762
2740
2763 <title>Help: remove</title>
2741 <title>Help: remove</title>
2764 </head>
2742 </head>
2765 <body>
2743 <body>
2766
2744
2767 <div class="container">
2745 <div class="container">
2768 <div class="menu">
2746 <div class="menu">
2769 <div class="logo">
2747 <div class="logo">
2770 <a href="https://mercurial-scm.org/">
2748 <a href="https://mercurial-scm.org/">
2771 <img src="/static/hglogo.png" alt="mercurial" /></a>
2749 <img src="/static/hglogo.png" alt="mercurial" /></a>
2772 </div>
2750 </div>
2773 <ul>
2751 <ul>
2774 <li><a href="/shortlog">log</a></li>
2752 <li><a href="/shortlog">log</a></li>
2775 <li><a href="/graph">graph</a></li>
2753 <li><a href="/graph">graph</a></li>
2776 <li><a href="/tags">tags</a></li>
2754 <li><a href="/tags">tags</a></li>
2777 <li><a href="/bookmarks">bookmarks</a></li>
2755 <li><a href="/bookmarks">bookmarks</a></li>
2778 <li><a href="/branches">branches</a></li>
2756 <li><a href="/branches">branches</a></li>
2779 </ul>
2757 </ul>
2780 <ul>
2758 <ul>
2781 <li class="active"><a href="/help">help</a></li>
2759 <li class="active"><a href="/help">help</a></li>
2782 </ul>
2760 </ul>
2783 </div>
2761 </div>
2784
2762
2785 <div class="main">
2763 <div class="main">
2786 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2764 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2787 <h3>Help: remove</h3>
2765 <h3>Help: remove</h3>
2788
2766
2789 <form class="search" action="/log">
2767 <form class="search" action="/log">
2790
2768
2791 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2769 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2792 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2770 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2793 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2771 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2794 </form>
2772 </form>
2795 <div id="doc">
2773 <div id="doc">
2796 <p>
2774 <p>
2797 hg remove [OPTION]... FILE...
2775 hg remove [OPTION]... FILE...
2798 </p>
2776 </p>
2799 <p>
2777 <p>
2800 aliases: rm
2778 aliases: rm
2801 </p>
2779 </p>
2802 <p>
2780 <p>
2803 remove the specified files on the next commit
2781 remove the specified files on the next commit
2804 </p>
2782 </p>
2805 <p>
2783 <p>
2806 Schedule the indicated files for removal from the current branch.
2784 Schedule the indicated files for removal from the current branch.
2807 </p>
2785 </p>
2808 <p>
2786 <p>
2809 This command schedules the files to be removed at the next commit.
2787 This command schedules the files to be removed at the next commit.
2810 To undo a remove before that, see 'hg revert'. To undo added
2788 To undo a remove before that, see 'hg revert'. To undo added
2811 files, see 'hg forget'.
2789 files, see 'hg forget'.
2812 </p>
2790 </p>
2813 <p>
2791 <p>
2814 -A/--after can be used to remove only files that have already
2792 -A/--after can be used to remove only files that have already
2815 been deleted, -f/--force can be used to force deletion, and -Af
2793 been deleted, -f/--force can be used to force deletion, and -Af
2816 can be used to remove files from the next revision without
2794 can be used to remove files from the next revision without
2817 deleting them from the working directory.
2795 deleting them from the working directory.
2818 </p>
2796 </p>
2819 <p>
2797 <p>
2820 The following table details the behavior of remove for different
2798 The following table details the behavior of remove for different
2821 file states (columns) and option combinations (rows). The file
2799 file states (columns) and option combinations (rows). The file
2822 states are Added [A], Clean [C], Modified [M] and Missing [!]
2800 states are Added [A], Clean [C], Modified [M] and Missing [!]
2823 (as reported by 'hg status'). The actions are Warn, Remove
2801 (as reported by 'hg status'). The actions are Warn, Remove
2824 (from branch) and Delete (from disk):
2802 (from branch) and Delete (from disk):
2825 </p>
2803 </p>
2826 <table>
2804 <table>
2827 <tr><td>opt/state</td>
2805 <tr><td>opt/state</td>
2828 <td>A</td>
2806 <td>A</td>
2829 <td>C</td>
2807 <td>C</td>
2830 <td>M</td>
2808 <td>M</td>
2831 <td>!</td></tr>
2809 <td>!</td></tr>
2832 <tr><td>none</td>
2810 <tr><td>none</td>
2833 <td>W</td>
2811 <td>W</td>
2834 <td>RD</td>
2812 <td>RD</td>
2835 <td>W</td>
2813 <td>W</td>
2836 <td>R</td></tr>
2814 <td>R</td></tr>
2837 <tr><td>-f</td>
2815 <tr><td>-f</td>
2838 <td>R</td>
2816 <td>R</td>
2839 <td>RD</td>
2817 <td>RD</td>
2840 <td>RD</td>
2818 <td>RD</td>
2841 <td>R</td></tr>
2819 <td>R</td></tr>
2842 <tr><td>-A</td>
2820 <tr><td>-A</td>
2843 <td>W</td>
2821 <td>W</td>
2844 <td>W</td>
2822 <td>W</td>
2845 <td>W</td>
2823 <td>W</td>
2846 <td>R</td></tr>
2824 <td>R</td></tr>
2847 <tr><td>-Af</td>
2825 <tr><td>-Af</td>
2848 <td>R</td>
2826 <td>R</td>
2849 <td>R</td>
2827 <td>R</td>
2850 <td>R</td>
2828 <td>R</td>
2851 <td>R</td></tr>
2829 <td>R</td></tr>
2852 </table>
2830 </table>
2853 <p>
2831 <p>
2854 <b>Note:</b>
2832 <b>Note:</b>
2855 </p>
2833 </p>
2856 <p>
2834 <p>
2857 'hg remove' never deletes files in Added [A] state from the
2835 'hg remove' never deletes files in Added [A] state from the
2858 working directory, not even if &quot;--force&quot; is specified.
2836 working directory, not even if &quot;--force&quot; is specified.
2859 </p>
2837 </p>
2860 <p>
2838 <p>
2861 Returns 0 on success, 1 if any warnings encountered.
2839 Returns 0 on success, 1 if any warnings encountered.
2862 </p>
2840 </p>
2863 <p>
2841 <p>
2864 options ([+] can be repeated):
2842 options ([+] can be repeated):
2865 </p>
2843 </p>
2866 <table>
2844 <table>
2867 <tr><td>-A</td>
2845 <tr><td>-A</td>
2868 <td>--after</td>
2846 <td>--after</td>
2869 <td>record delete for missing files</td></tr>
2847 <td>record delete for missing files</td></tr>
2870 <tr><td>-f</td>
2848 <tr><td>-f</td>
2871 <td>--force</td>
2849 <td>--force</td>
2872 <td>forget added files, delete modified files</td></tr>
2850 <td>forget added files, delete modified files</td></tr>
2873 <tr><td>-S</td>
2851 <tr><td>-S</td>
2874 <td>--subrepos</td>
2852 <td>--subrepos</td>
2875 <td>recurse into subrepositories</td></tr>
2853 <td>recurse into subrepositories</td></tr>
2876 <tr><td>-I</td>
2854 <tr><td>-I</td>
2877 <td>--include PATTERN [+]</td>
2855 <td>--include PATTERN [+]</td>
2878 <td>include names matching the given patterns</td></tr>
2856 <td>include names matching the given patterns</td></tr>
2879 <tr><td>-X</td>
2857 <tr><td>-X</td>
2880 <td>--exclude PATTERN [+]</td>
2858 <td>--exclude PATTERN [+]</td>
2881 <td>exclude names matching the given patterns</td></tr>
2859 <td>exclude names matching the given patterns</td></tr>
2882 <tr><td>-n</td>
2860 <tr><td>-n</td>
2883 <td>--dry-run</td>
2861 <td>--dry-run</td>
2884 <td>do not perform actions, just print output</td></tr>
2862 <td>do not perform actions, just print output</td></tr>
2885 </table>
2863 </table>
2886 <p>
2864 <p>
2887 global options ([+] can be repeated):
2865 global options ([+] can be repeated):
2888 </p>
2866 </p>
2889 <table>
2867 <table>
2890 <tr><td>-R</td>
2868 <tr><td>-R</td>
2891 <td>--repository REPO</td>
2869 <td>--repository REPO</td>
2892 <td>repository root directory or name of overlay bundle file</td></tr>
2870 <td>repository root directory or name of overlay bundle file</td></tr>
2893 <tr><td></td>
2871 <tr><td></td>
2894 <td>--cwd DIR</td>
2872 <td>--cwd DIR</td>
2895 <td>change working directory</td></tr>
2873 <td>change working directory</td></tr>
2896 <tr><td>-y</td>
2874 <tr><td>-y</td>
2897 <td>--noninteractive</td>
2875 <td>--noninteractive</td>
2898 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2876 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2899 <tr><td>-q</td>
2877 <tr><td>-q</td>
2900 <td>--quiet</td>
2878 <td>--quiet</td>
2901 <td>suppress output</td></tr>
2879 <td>suppress output</td></tr>
2902 <tr><td>-v</td>
2880 <tr><td>-v</td>
2903 <td>--verbose</td>
2881 <td>--verbose</td>
2904 <td>enable additional output</td></tr>
2882 <td>enable additional output</td></tr>
2905 <tr><td></td>
2883 <tr><td></td>
2906 <td>--color TYPE</td>
2884 <td>--color TYPE</td>
2907 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2885 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2908 <tr><td></td>
2886 <tr><td></td>
2909 <td>--config CONFIG [+]</td>
2887 <td>--config CONFIG [+]</td>
2910 <td>set/override config option (use 'section.name=value')</td></tr>
2888 <td>set/override config option (use 'section.name=value')</td></tr>
2911 <tr><td></td>
2889 <tr><td></td>
2912 <td>--debug</td>
2890 <td>--debug</td>
2913 <td>enable debugging output</td></tr>
2891 <td>enable debugging output</td></tr>
2914 <tr><td></td>
2892 <tr><td></td>
2915 <td>--debugger</td>
2893 <td>--debugger</td>
2916 <td>start debugger</td></tr>
2894 <td>start debugger</td></tr>
2917 <tr><td></td>
2895 <tr><td></td>
2918 <td>--encoding ENCODE</td>
2896 <td>--encoding ENCODE</td>
2919 <td>set the charset encoding (default: ascii)</td></tr>
2897 <td>set the charset encoding (default: ascii)</td></tr>
2920 <tr><td></td>
2898 <tr><td></td>
2921 <td>--encodingmode MODE</td>
2899 <td>--encodingmode MODE</td>
2922 <td>set the charset encoding mode (default: strict)</td></tr>
2900 <td>set the charset encoding mode (default: strict)</td></tr>
2923 <tr><td></td>
2901 <tr><td></td>
2924 <td>--traceback</td>
2902 <td>--traceback</td>
2925 <td>always print a traceback on exception</td></tr>
2903 <td>always print a traceback on exception</td></tr>
2926 <tr><td></td>
2904 <tr><td></td>
2927 <td>--time</td>
2905 <td>--time</td>
2928 <td>time how long the command takes</td></tr>
2906 <td>time how long the command takes</td></tr>
2929 <tr><td></td>
2907 <tr><td></td>
2930 <td>--profile</td>
2908 <td>--profile</td>
2931 <td>print command execution profile</td></tr>
2909 <td>print command execution profile</td></tr>
2932 <tr><td></td>
2910 <tr><td></td>
2933 <td>--version</td>
2911 <td>--version</td>
2934 <td>output version information and exit</td></tr>
2912 <td>output version information and exit</td></tr>
2935 <tr><td>-h</td>
2913 <tr><td>-h</td>
2936 <td>--help</td>
2914 <td>--help</td>
2937 <td>display help and exit</td></tr>
2915 <td>display help and exit</td></tr>
2938 <tr><td></td>
2916 <tr><td></td>
2939 <td>--hidden</td>
2917 <td>--hidden</td>
2940 <td>consider hidden changesets</td></tr>
2918 <td>consider hidden changesets</td></tr>
2941 <tr><td></td>
2919 <tr><td></td>
2942 <td>--pager TYPE</td>
2920 <td>--pager TYPE</td>
2943 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2921 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2944 </table>
2922 </table>
2945
2923
2946 </div>
2924 </div>
2947 </div>
2925 </div>
2948 </div>
2926 </div>
2949
2927
2950
2928
2951
2929
2952 </body>
2930 </body>
2953 </html>
2931 </html>
2954
2932
2955
2933
2956 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2934 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
2957 200 Script output follows
2935 200 Script output follows
2958
2936
2959 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2937 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2960 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2938 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2961 <head>
2939 <head>
2962 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2940 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2963 <meta name="robots" content="index, nofollow" />
2941 <meta name="robots" content="index, nofollow" />
2964 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2942 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2965 <script type="text/javascript" src="/static/mercurial.js"></script>
2943 <script type="text/javascript" src="/static/mercurial.js"></script>
2966
2944
2967 <title>Help: dates</title>
2945 <title>Help: dates</title>
2968 </head>
2946 </head>
2969 <body>
2947 <body>
2970
2948
2971 <div class="container">
2949 <div class="container">
2972 <div class="menu">
2950 <div class="menu">
2973 <div class="logo">
2951 <div class="logo">
2974 <a href="https://mercurial-scm.org/">
2952 <a href="https://mercurial-scm.org/">
2975 <img src="/static/hglogo.png" alt="mercurial" /></a>
2953 <img src="/static/hglogo.png" alt="mercurial" /></a>
2976 </div>
2954 </div>
2977 <ul>
2955 <ul>
2978 <li><a href="/shortlog">log</a></li>
2956 <li><a href="/shortlog">log</a></li>
2979 <li><a href="/graph">graph</a></li>
2957 <li><a href="/graph">graph</a></li>
2980 <li><a href="/tags">tags</a></li>
2958 <li><a href="/tags">tags</a></li>
2981 <li><a href="/bookmarks">bookmarks</a></li>
2959 <li><a href="/bookmarks">bookmarks</a></li>
2982 <li><a href="/branches">branches</a></li>
2960 <li><a href="/branches">branches</a></li>
2983 </ul>
2961 </ul>
2984 <ul>
2962 <ul>
2985 <li class="active"><a href="/help">help</a></li>
2963 <li class="active"><a href="/help">help</a></li>
2986 </ul>
2964 </ul>
2987 </div>
2965 </div>
2988
2966
2989 <div class="main">
2967 <div class="main">
2990 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2968 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2991 <h3>Help: dates</h3>
2969 <h3>Help: dates</h3>
2992
2970
2993 <form class="search" action="/log">
2971 <form class="search" action="/log">
2994
2972
2995 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2973 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2996 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2974 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2997 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2975 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2998 </form>
2976 </form>
2999 <div id="doc">
2977 <div id="doc">
3000 <h1>Date Formats</h1>
2978 <h1>Date Formats</h1>
3001 <p>
2979 <p>
3002 Some commands allow the user to specify a date, e.g.:
2980 Some commands allow the user to specify a date, e.g.:
3003 </p>
2981 </p>
3004 <ul>
2982 <ul>
3005 <li> backout, commit, import, tag: Specify the commit date.
2983 <li> backout, commit, import, tag: Specify the commit date.
3006 <li> log, revert, update: Select revision(s) by date.
2984 <li> log, revert, update: Select revision(s) by date.
3007 </ul>
2985 </ul>
3008 <p>
2986 <p>
3009 Many date formats are valid. Here are some examples:
2987 Many date formats are valid. Here are some examples:
3010 </p>
2988 </p>
3011 <ul>
2989 <ul>
3012 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
2990 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
3013 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
2991 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
3014 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
2992 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
3015 <li> &quot;Dec 6&quot; (midnight)
2993 <li> &quot;Dec 6&quot; (midnight)
3016 <li> &quot;13:18&quot; (today assumed)
2994 <li> &quot;13:18&quot; (today assumed)
3017 <li> &quot;3:39&quot; (3:39AM assumed)
2995 <li> &quot;3:39&quot; (3:39AM assumed)
3018 <li> &quot;3:39pm&quot; (15:39)
2996 <li> &quot;3:39pm&quot; (15:39)
3019 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
2997 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
3020 <li> &quot;2006-12-6 13:18&quot;
2998 <li> &quot;2006-12-6 13:18&quot;
3021 <li> &quot;2006-12-6&quot;
2999 <li> &quot;2006-12-6&quot;
3022 <li> &quot;12-6&quot;
3000 <li> &quot;12-6&quot;
3023 <li> &quot;12/6&quot;
3001 <li> &quot;12/6&quot;
3024 <li> &quot;12/6/6&quot; (Dec 6 2006)
3002 <li> &quot;12/6/6&quot; (Dec 6 2006)
3025 <li> &quot;today&quot; (midnight)
3003 <li> &quot;today&quot; (midnight)
3026 <li> &quot;yesterday&quot; (midnight)
3004 <li> &quot;yesterday&quot; (midnight)
3027 <li> &quot;now&quot; - right now
3005 <li> &quot;now&quot; - right now
3028 </ul>
3006 </ul>
3029 <p>
3007 <p>
3030 Lastly, there is Mercurial's internal format:
3008 Lastly, there is Mercurial's internal format:
3031 </p>
3009 </p>
3032 <ul>
3010 <ul>
3033 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
3011 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
3034 </ul>
3012 </ul>
3035 <p>
3013 <p>
3036 This is the internal representation format for dates. The first number
3014 This is the internal representation format for dates. The first number
3037 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
3015 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
3038 second is the offset of the local timezone, in seconds west of UTC
3016 second is the offset of the local timezone, in seconds west of UTC
3039 (negative if the timezone is east of UTC).
3017 (negative if the timezone is east of UTC).
3040 </p>
3018 </p>
3041 <p>
3019 <p>
3042 The log command also accepts date ranges:
3020 The log command also accepts date ranges:
3043 </p>
3021 </p>
3044 <ul>
3022 <ul>
3045 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3023 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3046 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3024 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3047 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3025 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3048 <li> &quot;-DAYS&quot; - within a given number of days of today
3026 <li> &quot;-DAYS&quot; - within a given number of days of today
3049 </ul>
3027 </ul>
3050
3028
3051 </div>
3029 </div>
3052 </div>
3030 </div>
3053 </div>
3031 </div>
3054
3032
3055
3033
3056
3034
3057 </body>
3035 </body>
3058 </html>
3036 </html>
3059
3037
3060
3038
3061 $ get-with-headers.py $LOCALIP:$HGPORT "help/pager"
3039 $ get-with-headers.py $LOCALIP:$HGPORT "help/pager"
3062 200 Script output follows
3040 200 Script output follows
3063
3041
3064 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3042 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3065 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3043 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3066 <head>
3044 <head>
3067 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3045 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3068 <meta name="robots" content="index, nofollow" />
3046 <meta name="robots" content="index, nofollow" />
3069 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3047 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3070 <script type="text/javascript" src="/static/mercurial.js"></script>
3048 <script type="text/javascript" src="/static/mercurial.js"></script>
3071
3049
3072 <title>Help: pager</title>
3050 <title>Help: pager</title>
3073 </head>
3051 </head>
3074 <body>
3052 <body>
3075
3053
3076 <div class="container">
3054 <div class="container">
3077 <div class="menu">
3055 <div class="menu">
3078 <div class="logo">
3056 <div class="logo">
3079 <a href="https://mercurial-scm.org/">
3057 <a href="https://mercurial-scm.org/">
3080 <img src="/static/hglogo.png" alt="mercurial" /></a>
3058 <img src="/static/hglogo.png" alt="mercurial" /></a>
3081 </div>
3059 </div>
3082 <ul>
3060 <ul>
3083 <li><a href="/shortlog">log</a></li>
3061 <li><a href="/shortlog">log</a></li>
3084 <li><a href="/graph">graph</a></li>
3062 <li><a href="/graph">graph</a></li>
3085 <li><a href="/tags">tags</a></li>
3063 <li><a href="/tags">tags</a></li>
3086 <li><a href="/bookmarks">bookmarks</a></li>
3064 <li><a href="/bookmarks">bookmarks</a></li>
3087 <li><a href="/branches">branches</a></li>
3065 <li><a href="/branches">branches</a></li>
3088 </ul>
3066 </ul>
3089 <ul>
3067 <ul>
3090 <li class="active"><a href="/help">help</a></li>
3068 <li class="active"><a href="/help">help</a></li>
3091 </ul>
3069 </ul>
3092 </div>
3070 </div>
3093
3071
3094 <div class="main">
3072 <div class="main">
3095 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3073 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3096 <h3>Help: pager</h3>
3074 <h3>Help: pager</h3>
3097
3075
3098 <form class="search" action="/log">
3076 <form class="search" action="/log">
3099
3077
3100 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3078 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3101 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3079 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3102 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3080 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3103 </form>
3081 </form>
3104 <div id="doc">
3082 <div id="doc">
3105 <h1>Pager Support</h1>
3083 <h1>Pager Support</h1>
3106 <p>
3084 <p>
3107 Some Mercurial commands can produce a lot of output, and Mercurial will
3085 Some Mercurial commands can produce a lot of output, and Mercurial will
3108 attempt to use a pager to make those commands more pleasant.
3086 attempt to use a pager to make those commands more pleasant.
3109 </p>
3087 </p>
3110 <p>
3088 <p>
3111 To set the pager that should be used, set the application variable:
3089 To set the pager that should be used, set the application variable:
3112 </p>
3090 </p>
3113 <pre>
3091 <pre>
3114 [pager]
3092 [pager]
3115 pager = less -FRX
3093 pager = less -FRX
3116 </pre>
3094 </pre>
3117 <p>
3095 <p>
3118 If no pager is set in the user or repository configuration, Mercurial uses the
3096 If no pager is set in the user or repository configuration, Mercurial uses the
3119 environment variable $PAGER. If $PAGER is not set, pager.pager from the default
3097 environment variable $PAGER. If $PAGER is not set, pager.pager from the default
3120 or system configuration is used. If none of these are set, a default pager will
3098 or system configuration is used. If none of these are set, a default pager will
3121 be used, typically 'less' on Unix and 'more' on Windows.
3099 be used, typically 'less' on Unix and 'more' on Windows.
3122 </p>
3100 </p>
3123 <p>
3101 <p>
3124 You can disable the pager for certain commands by adding them to the
3102 You can disable the pager for certain commands by adding them to the
3125 pager.ignore list:
3103 pager.ignore list:
3126 </p>
3104 </p>
3127 <pre>
3105 <pre>
3128 [pager]
3106 [pager]
3129 ignore = version, help, update
3107 ignore = version, help, update
3130 </pre>
3108 </pre>
3131 <p>
3109 <p>
3132 To ignore global commands like 'hg version' or 'hg help', you have
3110 To ignore global commands like 'hg version' or 'hg help', you have
3133 to specify them in your user configuration file.
3111 to specify them in your user configuration file.
3134 </p>
3112 </p>
3135 <p>
3113 <p>
3136 To control whether the pager is used at all for an individual command,
3114 To control whether the pager is used at all for an individual command,
3137 you can use --pager=&lt;value&gt;:
3115 you can use --pager=&lt;value&gt;:
3138 </p>
3116 </p>
3139 <ul>
3117 <ul>
3140 <li> use as needed: 'auto'.
3118 <li> use as needed: 'auto'.
3141 <li> require the pager: 'yes' or 'on'.
3119 <li> require the pager: 'yes' or 'on'.
3142 <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work).
3120 <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work).
3143 </ul>
3121 </ul>
3144 <p>
3122 <p>
3145 To globally turn off all attempts to use a pager, set:
3123 To globally turn off all attempts to use a pager, set:
3146 </p>
3124 </p>
3147 <pre>
3125 <pre>
3148 [ui]
3126 [ui]
3149 paginate = never
3127 paginate = never
3150 </pre>
3128 </pre>
3151 <p>
3129 <p>
3152 which will prevent the pager from running.
3130 which will prevent the pager from running.
3153 </p>
3131 </p>
3154
3132
3155 </div>
3133 </div>
3156 </div>
3134 </div>
3157 </div>
3135 </div>
3158
3136
3159
3137
3160
3138
3161 </body>
3139 </body>
3162 </html>
3140 </html>
3163
3141
3164
3142
3165 Sub-topic indexes rendered properly
3143 Sub-topic indexes rendered properly
3166
3144
3167 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3145 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3168 200 Script output follows
3146 200 Script output follows
3169
3147
3170 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3148 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3171 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3149 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3172 <head>
3150 <head>
3173 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3151 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3174 <meta name="robots" content="index, nofollow" />
3152 <meta name="robots" content="index, nofollow" />
3175 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3153 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3176 <script type="text/javascript" src="/static/mercurial.js"></script>
3154 <script type="text/javascript" src="/static/mercurial.js"></script>
3177
3155
3178 <title>Help: internals</title>
3156 <title>Help: internals</title>
3179 </head>
3157 </head>
3180 <body>
3158 <body>
3181
3159
3182 <div class="container">
3160 <div class="container">
3183 <div class="menu">
3161 <div class="menu">
3184 <div class="logo">
3162 <div class="logo">
3185 <a href="https://mercurial-scm.org/">
3163 <a href="https://mercurial-scm.org/">
3186 <img src="/static/hglogo.png" alt="mercurial" /></a>
3164 <img src="/static/hglogo.png" alt="mercurial" /></a>
3187 </div>
3165 </div>
3188 <ul>
3166 <ul>
3189 <li><a href="/shortlog">log</a></li>
3167 <li><a href="/shortlog">log</a></li>
3190 <li><a href="/graph">graph</a></li>
3168 <li><a href="/graph">graph</a></li>
3191 <li><a href="/tags">tags</a></li>
3169 <li><a href="/tags">tags</a></li>
3192 <li><a href="/bookmarks">bookmarks</a></li>
3170 <li><a href="/bookmarks">bookmarks</a></li>
3193 <li><a href="/branches">branches</a></li>
3171 <li><a href="/branches">branches</a></li>
3194 </ul>
3172 </ul>
3195 <ul>
3173 <ul>
3196 <li><a href="/help">help</a></li>
3174 <li><a href="/help">help</a></li>
3197 </ul>
3175 </ul>
3198 </div>
3176 </div>
3199
3177
3200 <div class="main">
3178 <div class="main">
3201 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3179 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3202
3180
3203 <form class="search" action="/log">
3181 <form class="search" action="/log">
3204
3182
3205 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3183 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3206 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3184 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3207 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3185 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3208 </form>
3186 </form>
3209 <table class="bigtable">
3187 <table class="bigtable">
3210 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3188 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3211
3189
3212 <tr><td>
3190 <tr><td>
3213 <a href="/help/internals.bundle2">
3191 <a href="/help/internals.bundle2">
3214 bundle2
3192 bundle2
3215 </a>
3193 </a>
3216 </td><td>
3194 </td><td>
3217 Bundle2
3195 Bundle2
3218 </td></tr>
3196 </td></tr>
3219 <tr><td>
3197 <tr><td>
3220 <a href="/help/internals.bundles">
3198 <a href="/help/internals.bundles">
3221 bundles
3199 bundles
3222 </a>
3200 </a>
3223 </td><td>
3201 </td><td>
3224 Bundles
3202 Bundles
3225 </td></tr>
3203 </td></tr>
3226 <tr><td>
3204 <tr><td>
3227 <a href="/help/internals.censor">
3205 <a href="/help/internals.censor">
3228 censor
3206 censor
3229 </a>
3207 </a>
3230 </td><td>
3208 </td><td>
3231 Censor
3209 Censor
3232 </td></tr>
3210 </td></tr>
3233 <tr><td>
3211 <tr><td>
3234 <a href="/help/internals.changegroups">
3212 <a href="/help/internals.changegroups">
3235 changegroups
3213 changegroups
3236 </a>
3214 </a>
3237 </td><td>
3215 </td><td>
3238 Changegroups
3216 Changegroups
3239 </td></tr>
3217 </td></tr>
3240 <tr><td>
3218 <tr><td>
3241 <a href="/help/internals.config">
3219 <a href="/help/internals.config">
3242 config
3220 config
3243 </a>
3221 </a>
3244 </td><td>
3222 </td><td>
3245 Config Registrar
3223 Config Registrar
3246 </td></tr>
3224 </td></tr>
3247 <tr><td>
3225 <tr><td>
3248 <a href="/help/internals.requirements">
3226 <a href="/help/internals.requirements">
3249 requirements
3227 requirements
3250 </a>
3228 </a>
3251 </td><td>
3229 </td><td>
3252 Repository Requirements
3230 Repository Requirements
3253 </td></tr>
3231 </td></tr>
3254 <tr><td>
3232 <tr><td>
3255 <a href="/help/internals.revlogs">
3233 <a href="/help/internals.revlogs">
3256 revlogs
3234 revlogs
3257 </a>
3235 </a>
3258 </td><td>
3236 </td><td>
3259 Revision Logs
3237 Revision Logs
3260 </td></tr>
3238 </td></tr>
3261 <tr><td>
3239 <tr><td>
3262 <a href="/help/internals.wireprotocol">
3240 <a href="/help/internals.wireprotocol">
3263 wireprotocol
3241 wireprotocol
3264 </a>
3242 </a>
3265 </td><td>
3243 </td><td>
3266 Wire Protocol
3244 Wire Protocol
3267 </td></tr>
3245 </td></tr>
3268
3246
3269
3247
3270
3248
3271
3249
3272
3250
3273 </table>
3251 </table>
3274 </div>
3252 </div>
3275 </div>
3253 </div>
3276
3254
3277
3255
3278
3256
3279 </body>
3257 </body>
3280 </html>
3258 </html>
3281
3259
3282
3260
3283 Sub-topic topics rendered properly
3261 Sub-topic topics rendered properly
3284
3262
3285 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3263 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3286 200 Script output follows
3264 200 Script output follows
3287
3265
3288 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3266 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3289 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3267 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3290 <head>
3268 <head>
3291 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3269 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3292 <meta name="robots" content="index, nofollow" />
3270 <meta name="robots" content="index, nofollow" />
3293 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3271 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3294 <script type="text/javascript" src="/static/mercurial.js"></script>
3272 <script type="text/javascript" src="/static/mercurial.js"></script>
3295
3273
3296 <title>Help: internals.changegroups</title>
3274 <title>Help: internals.changegroups</title>
3297 </head>
3275 </head>
3298 <body>
3276 <body>
3299
3277
3300 <div class="container">
3278 <div class="container">
3301 <div class="menu">
3279 <div class="menu">
3302 <div class="logo">
3280 <div class="logo">
3303 <a href="https://mercurial-scm.org/">
3281 <a href="https://mercurial-scm.org/">
3304 <img src="/static/hglogo.png" alt="mercurial" /></a>
3282 <img src="/static/hglogo.png" alt="mercurial" /></a>
3305 </div>
3283 </div>
3306 <ul>
3284 <ul>
3307 <li><a href="/shortlog">log</a></li>
3285 <li><a href="/shortlog">log</a></li>
3308 <li><a href="/graph">graph</a></li>
3286 <li><a href="/graph">graph</a></li>
3309 <li><a href="/tags">tags</a></li>
3287 <li><a href="/tags">tags</a></li>
3310 <li><a href="/bookmarks">bookmarks</a></li>
3288 <li><a href="/bookmarks">bookmarks</a></li>
3311 <li><a href="/branches">branches</a></li>
3289 <li><a href="/branches">branches</a></li>
3312 </ul>
3290 </ul>
3313 <ul>
3291 <ul>
3314 <li class="active"><a href="/help">help</a></li>
3292 <li class="active"><a href="/help">help</a></li>
3315 </ul>
3293 </ul>
3316 </div>
3294 </div>
3317
3295
3318 <div class="main">
3296 <div class="main">
3319 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3297 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3320 <h3>Help: internals.changegroups</h3>
3298 <h3>Help: internals.changegroups</h3>
3321
3299
3322 <form class="search" action="/log">
3300 <form class="search" action="/log">
3323
3301
3324 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3302 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3325 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3303 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3326 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3304 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3327 </form>
3305 </form>
3328 <div id="doc">
3306 <div id="doc">
3329 <h1>Changegroups</h1>
3307 <h1>Changegroups</h1>
3330 <p>
3308 <p>
3331 Changegroups are representations of repository revlog data, specifically
3309 Changegroups are representations of repository revlog data, specifically
3332 the changelog data, root/flat manifest data, treemanifest data, and
3310 the changelog data, root/flat manifest data, treemanifest data, and
3333 filelogs.
3311 filelogs.
3334 </p>
3312 </p>
3335 <p>
3313 <p>
3336 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3314 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3337 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3315 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3338 only difference being an additional item in the *delta header*. Version
3316 only difference being an additional item in the *delta header*. Version
3339 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3317 &quot;3&quot; adds support for revlog flags in the *delta header* and optionally
3340 exchanging treemanifests (enabled by setting an option on the
3318 exchanging treemanifests (enabled by setting an option on the
3341 &quot;changegroup&quot; part in the bundle2).
3319 &quot;changegroup&quot; part in the bundle2).
3342 </p>
3320 </p>
3343 <p>
3321 <p>
3344 Changegroups when not exchanging treemanifests consist of 3 logical
3322 Changegroups when not exchanging treemanifests consist of 3 logical
3345 segments:
3323 segments:
3346 </p>
3324 </p>
3347 <pre>
3325 <pre>
3348 +---------------------------------+
3326 +---------------------------------+
3349 | | | |
3327 | | | |
3350 | changeset | manifest | filelogs |
3328 | changeset | manifest | filelogs |
3351 | | | |
3329 | | | |
3352 | | | |
3330 | | | |
3353 +---------------------------------+
3331 +---------------------------------+
3354 </pre>
3332 </pre>
3355 <p>
3333 <p>
3356 When exchanging treemanifests, there are 4 logical segments:
3334 When exchanging treemanifests, there are 4 logical segments:
3357 </p>
3335 </p>
3358 <pre>
3336 <pre>
3359 +-------------------------------------------------+
3337 +-------------------------------------------------+
3360 | | | | |
3338 | | | | |
3361 | changeset | root | treemanifests | filelogs |
3339 | changeset | root | treemanifests | filelogs |
3362 | | manifest | | |
3340 | | manifest | | |
3363 | | | | |
3341 | | | | |
3364 +-------------------------------------------------+
3342 +-------------------------------------------------+
3365 </pre>
3343 </pre>
3366 <p>
3344 <p>
3367 The principle building block of each segment is a *chunk*. A *chunk*
3345 The principle building block of each segment is a *chunk*. A *chunk*
3368 is a framed piece of data:
3346 is a framed piece of data:
3369 </p>
3347 </p>
3370 <pre>
3348 <pre>
3371 +---------------------------------------+
3349 +---------------------------------------+
3372 | | |
3350 | | |
3373 | length | data |
3351 | length | data |
3374 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3352 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3375 | | |
3353 | | |
3376 +---------------------------------------+
3354 +---------------------------------------+
3377 </pre>
3355 </pre>
3378 <p>
3356 <p>
3379 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3357 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3380 integer indicating the length of the entire chunk (including the length field
3358 integer indicating the length of the entire chunk (including the length field
3381 itself).
3359 itself).
3382 </p>
3360 </p>
3383 <p>
3361 <p>
3384 There is a special case chunk that has a value of 0 for the length
3362 There is a special case chunk that has a value of 0 for the length
3385 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3363 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3386 </p>
3364 </p>
3387 <h2>Delta Groups</h2>
3365 <h2>Delta Groups</h2>
3388 <p>
3366 <p>
3389 A *delta group* expresses the content of a revlog as a series of deltas,
3367 A *delta group* expresses the content of a revlog as a series of deltas,
3390 or patches against previous revisions.
3368 or patches against previous revisions.
3391 </p>
3369 </p>
3392 <p>
3370 <p>
3393 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3371 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3394 to signal the end of the delta group:
3372 to signal the end of the delta group:
3395 </p>
3373 </p>
3396 <pre>
3374 <pre>
3397 +------------------------------------------------------------------------+
3375 +------------------------------------------------------------------------+
3398 | | | | | |
3376 | | | | | |
3399 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3377 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3400 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3378 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3401 | | | | | |
3379 | | | | | |
3402 +------------------------------------------------------------------------+
3380 +------------------------------------------------------------------------+
3403 </pre>
3381 </pre>
3404 <p>
3382 <p>
3405 Each *chunk*'s data consists of the following:
3383 Each *chunk*'s data consists of the following:
3406 </p>
3384 </p>
3407 <pre>
3385 <pre>
3408 +---------------------------------------+
3386 +---------------------------------------+
3409 | | |
3387 | | |
3410 | delta header | delta data |
3388 | delta header | delta data |
3411 | (various by version) | (various) |
3389 | (various by version) | (various) |
3412 | | |
3390 | | |
3413 +---------------------------------------+
3391 +---------------------------------------+
3414 </pre>
3392 </pre>
3415 <p>
3393 <p>
3416 The *delta data* is a series of *delta*s that describe a diff from an existing
3394 The *delta data* is a series of *delta*s that describe a diff from an existing
3417 entry (either that the recipient already has, or previously specified in the
3395 entry (either that the recipient already has, or previously specified in the
3418 bundle/changegroup).
3396 bundle/changegroup).
3419 </p>
3397 </p>
3420 <p>
3398 <p>
3421 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3399 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3422 &quot;3&quot; of the changegroup format.
3400 &quot;3&quot; of the changegroup format.
3423 </p>
3401 </p>
3424 <p>
3402 <p>
3425 Version 1 (headerlen=80):
3403 Version 1 (headerlen=80):
3426 </p>
3404 </p>
3427 <pre>
3405 <pre>
3428 +------------------------------------------------------+
3406 +------------------------------------------------------+
3429 | | | | |
3407 | | | | |
3430 | node | p1 node | p2 node | link node |
3408 | node | p1 node | p2 node | link node |
3431 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3409 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3432 | | | | |
3410 | | | | |
3433 +------------------------------------------------------+
3411 +------------------------------------------------------+
3434 </pre>
3412 </pre>
3435 <p>
3413 <p>
3436 Version 2 (headerlen=100):
3414 Version 2 (headerlen=100):
3437 </p>
3415 </p>
3438 <pre>
3416 <pre>
3439 +------------------------------------------------------------------+
3417 +------------------------------------------------------------------+
3440 | | | | | |
3418 | | | | | |
3441 | node | p1 node | p2 node | base node | link node |
3419 | node | p1 node | p2 node | base node | link node |
3442 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3420 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3443 | | | | | |
3421 | | | | | |
3444 +------------------------------------------------------------------+
3422 +------------------------------------------------------------------+
3445 </pre>
3423 </pre>
3446 <p>
3424 <p>
3447 Version 3 (headerlen=102):
3425 Version 3 (headerlen=102):
3448 </p>
3426 </p>
3449 <pre>
3427 <pre>
3450 +------------------------------------------------------------------------------+
3428 +------------------------------------------------------------------------------+
3451 | | | | | | |
3429 | | | | | | |
3452 | node | p1 node | p2 node | base node | link node | flags |
3430 | node | p1 node | p2 node | base node | link node | flags |
3453 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3431 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3454 | | | | | | |
3432 | | | | | | |
3455 +------------------------------------------------------------------------------+
3433 +------------------------------------------------------------------------------+
3456 </pre>
3434 </pre>
3457 <p>
3435 <p>
3458 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3436 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3459 series of *delta*s, densely packed (no separators). These deltas describe a diff
3437 series of *delta*s, densely packed (no separators). These deltas describe a diff
3460 from an existing entry (either that the recipient already has, or previously
3438 from an existing entry (either that the recipient already has, or previously
3461 specified in the bundle/changegroup). The format is described more fully in
3439 specified in the bundle/changegroup). The format is described more fully in
3462 &quot;hg help internals.bdiff&quot;, but briefly:
3440 &quot;hg help internals.bdiff&quot;, but briefly:
3463 </p>
3441 </p>
3464 <pre>
3442 <pre>
3465 +---------------------------------------------------------------+
3443 +---------------------------------------------------------------+
3466 | | | | |
3444 | | | | |
3467 | start offset | end offset | new length | content |
3445 | start offset | end offset | new length | content |
3468 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3446 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3469 | | | | |
3447 | | | | |
3470 +---------------------------------------------------------------+
3448 +---------------------------------------------------------------+
3471 </pre>
3449 </pre>
3472 <p>
3450 <p>
3473 Please note that the length field in the delta data does *not* include itself.
3451 Please note that the length field in the delta data does *not* include itself.
3474 </p>
3452 </p>
3475 <p>
3453 <p>
3476 In version 1, the delta is always applied against the previous node from
3454 In version 1, the delta is always applied against the previous node from
3477 the changegroup or the first parent if this is the first entry in the
3455 the changegroup or the first parent if this is the first entry in the
3478 changegroup.
3456 changegroup.
3479 </p>
3457 </p>
3480 <p>
3458 <p>
3481 In version 2 and up, the delta base node is encoded in the entry in the
3459 In version 2 and up, the delta base node is encoded in the entry in the
3482 changegroup. This allows the delta to be expressed against any parent,
3460 changegroup. This allows the delta to be expressed against any parent,
3483 which can result in smaller deltas and more efficient encoding of data.
3461 which can result in smaller deltas and more efficient encoding of data.
3484 </p>
3462 </p>
3485 <h2>Changeset Segment</h2>
3463 <h2>Changeset Segment</h2>
3486 <p>
3464 <p>
3487 The *changeset segment* consists of a single *delta group* holding
3465 The *changeset segment* consists of a single *delta group* holding
3488 changelog data. The *empty chunk* at the end of the *delta group* denotes
3466 changelog data. The *empty chunk* at the end of the *delta group* denotes
3489 the boundary to the *manifest segment*.
3467 the boundary to the *manifest segment*.
3490 </p>
3468 </p>
3491 <h2>Manifest Segment</h2>
3469 <h2>Manifest Segment</h2>
3492 <p>
3470 <p>
3493 The *manifest segment* consists of a single *delta group* holding manifest
3471 The *manifest segment* consists of a single *delta group* holding manifest
3494 data. If treemanifests are in use, it contains only the manifest for the
3472 data. If treemanifests are in use, it contains only the manifest for the
3495 root directory of the repository. Otherwise, it contains the entire
3473 root directory of the repository. Otherwise, it contains the entire
3496 manifest data. The *empty chunk* at the end of the *delta group* denotes
3474 manifest data. The *empty chunk* at the end of the *delta group* denotes
3497 the boundary to the next segment (either the *treemanifests segment* or the
3475 the boundary to the next segment (either the *treemanifests segment* or the
3498 *filelogs segment*, depending on version and the request options).
3476 *filelogs segment*, depending on version and the request options).
3499 </p>
3477 </p>
3500 <h3>Treemanifests Segment</h3>
3478 <h3>Treemanifests Segment</h3>
3501 <p>
3479 <p>
3502 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3480 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3503 only if the 'treemanifest' param is part of the bundle2 changegroup part
3481 only if the 'treemanifest' param is part of the bundle2 changegroup part
3504 (it is not possible to use changegroup version 3 outside of bundle2).
3482 (it is not possible to use changegroup version 3 outside of bundle2).
3505 Aside from the filenames in the *treemanifests segment* containing a
3483 Aside from the filenames in the *treemanifests segment* containing a
3506 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3484 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3507 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3485 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3508 a sub-segment with filename size 0). This denotes the boundary to the
3486 a sub-segment with filename size 0). This denotes the boundary to the
3509 *filelogs segment*.
3487 *filelogs segment*.
3510 </p>
3488 </p>
3511 <h2>Filelogs Segment</h2>
3489 <h2>Filelogs Segment</h2>
3512 <p>
3490 <p>
3513 The *filelogs segment* consists of multiple sub-segments, each
3491 The *filelogs segment* consists of multiple sub-segments, each
3514 corresponding to an individual file whose data is being described:
3492 corresponding to an individual file whose data is being described:
3515 </p>
3493 </p>
3516 <pre>
3494 <pre>
3517 +--------------------------------------------------+
3495 +--------------------------------------------------+
3518 | | | | | |
3496 | | | | | |
3519 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3497 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3520 | | | | | (4 bytes) |
3498 | | | | | (4 bytes) |
3521 | | | | | |
3499 | | | | | |
3522 +--------------------------------------------------+
3500 +--------------------------------------------------+
3523 </pre>
3501 </pre>
3524 <p>
3502 <p>
3525 The final filelog sub-segment is followed by an *empty chunk* (logically,
3503 The final filelog sub-segment is followed by an *empty chunk* (logically,
3526 a sub-segment with filename size 0). This denotes the end of the segment
3504 a sub-segment with filename size 0). This denotes the end of the segment
3527 and of the overall changegroup.
3505 and of the overall changegroup.
3528 </p>
3506 </p>
3529 <p>
3507 <p>
3530 Each filelog sub-segment consists of the following:
3508 Each filelog sub-segment consists of the following:
3531 </p>
3509 </p>
3532 <pre>
3510 <pre>
3533 +------------------------------------------------------+
3511 +------------------------------------------------------+
3534 | | | |
3512 | | | |
3535 | filename length | filename | delta group |
3513 | filename length | filename | delta group |
3536 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3514 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3537 | | | |
3515 | | | |
3538 +------------------------------------------------------+
3516 +------------------------------------------------------+
3539 </pre>
3517 </pre>
3540 <p>
3518 <p>
3541 That is, a *chunk* consisting of the filename (not terminated or padded)
3519 That is, a *chunk* consisting of the filename (not terminated or padded)
3542 followed by N chunks constituting the *delta group* for this file. The
3520 followed by N chunks constituting the *delta group* for this file. The
3543 *empty chunk* at the end of each *delta group* denotes the boundary to the
3521 *empty chunk* at the end of each *delta group* denotes the boundary to the
3544 next filelog sub-segment.
3522 next filelog sub-segment.
3545 </p>
3523 </p>
3546
3524
3547 </div>
3525 </div>
3548 </div>
3526 </div>
3549 </div>
3527 </div>
3550
3528
3551
3529
3552
3530
3553 </body>
3531 </body>
3554 </html>
3532 </html>
3555
3533
3556
3534
3557 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
3535 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
3558 404 Not Found
3536 404 Not Found
3559
3537
3560 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3538 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3561 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3539 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3562 <head>
3540 <head>
3563 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3541 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3564 <meta name="robots" content="index, nofollow" />
3542 <meta name="robots" content="index, nofollow" />
3565 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3543 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3566 <script type="text/javascript" src="/static/mercurial.js"></script>
3544 <script type="text/javascript" src="/static/mercurial.js"></script>
3567
3545
3568 <title>test: error</title>
3546 <title>test: error</title>
3569 </head>
3547 </head>
3570 <body>
3548 <body>
3571
3549
3572 <div class="container">
3550 <div class="container">
3573 <div class="menu">
3551 <div class="menu">
3574 <div class="logo">
3552 <div class="logo">
3575 <a href="https://mercurial-scm.org/">
3553 <a href="https://mercurial-scm.org/">
3576 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
3554 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
3577 </div>
3555 </div>
3578 <ul>
3556 <ul>
3579 <li><a href="/shortlog">log</a></li>
3557 <li><a href="/shortlog">log</a></li>
3580 <li><a href="/graph">graph</a></li>
3558 <li><a href="/graph">graph</a></li>
3581 <li><a href="/tags">tags</a></li>
3559 <li><a href="/tags">tags</a></li>
3582 <li><a href="/bookmarks">bookmarks</a></li>
3560 <li><a href="/bookmarks">bookmarks</a></li>
3583 <li><a href="/branches">branches</a></li>
3561 <li><a href="/branches">branches</a></li>
3584 </ul>
3562 </ul>
3585 <ul>
3563 <ul>
3586 <li><a href="/help">help</a></li>
3564 <li><a href="/help">help</a></li>
3587 </ul>
3565 </ul>
3588 </div>
3566 </div>
3589
3567
3590 <div class="main">
3568 <div class="main">
3591
3569
3592 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3570 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3593 <h3>error</h3>
3571 <h3>error</h3>
3594
3572
3595
3573
3596 <form class="search" action="/log">
3574 <form class="search" action="/log">
3597
3575
3598 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3576 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3599 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3577 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3600 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3578 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3601 </form>
3579 </form>
3602
3580
3603 <div class="description">
3581 <div class="description">
3604 <p>
3582 <p>
3605 An error occurred while processing your request:
3583 An error occurred while processing your request:
3606 </p>
3584 </p>
3607 <p>
3585 <p>
3608 Not Found
3586 Not Found
3609 </p>
3587 </p>
3610 </div>
3588 </div>
3611 </div>
3589 </div>
3612 </div>
3590 </div>
3613
3591
3614
3592
3615
3593
3616 </body>
3594 </body>
3617 </html>
3595 </html>
3618
3596
3619 [1]
3597 [1]
3620
3598
3621 $ killdaemons.py
3599 $ killdaemons.py
3622
3600
3623 #endif
3601 #endif
@@ -1,405 +1,407 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [ui]
2 > [ui]
3 > color = always
3 > color = always
4 > [color]
4 > [color]
5 > mode = ansi
5 > mode = ansi
6 > EOF
6 > EOF
7 Terminfo codes compatibility fix
7 Terminfo codes compatibility fix
8 $ echo "color.none=0" >> $HGRCPATH
8 $ echo "color.none=0" >> $HGRCPATH
9
9
10 $ hg init repo1
10 $ hg init repo1
11 $ cd repo1
11 $ cd repo1
12 $ mkdir a b a/1 b/1 b/2
12 $ mkdir a b a/1 b/1 b/2
13 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
13 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
14
14
15 hg status in repo root:
15 hg status in repo root:
16
16
17 $ hg status
17 $ hg status
18 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
18 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
19 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
19 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
20 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
20 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
21 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
21 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
22 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
22 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
23 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
23 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
24
24
25 $ hg status --color=debug
25 $ hg status --color=debug
26 [status.unknown|? ][status.unknown|a/1/in_a_1]
26 [status.unknown|? ][status.unknown|a/1/in_a_1]
27 [status.unknown|? ][status.unknown|a/in_a]
27 [status.unknown|? ][status.unknown|a/in_a]
28 [status.unknown|? ][status.unknown|b/1/in_b_1]
28 [status.unknown|? ][status.unknown|b/1/in_b_1]
29 [status.unknown|? ][status.unknown|b/2/in_b_2]
29 [status.unknown|? ][status.unknown|b/2/in_b_2]
30 [status.unknown|? ][status.unknown|b/in_b]
30 [status.unknown|? ][status.unknown|b/in_b]
31 [status.unknown|? ][status.unknown|in_root]
31 [status.unknown|? ][status.unknown|in_root]
32 HGPLAIN disables color
32 HGPLAIN disables color
33 $ HGPLAIN=1 hg status --color=debug
33 $ HGPLAIN=1 hg status --color=debug
34 ? a/1/in_a_1 (glob)
34 ? a/1/in_a_1 (glob)
35 ? a/in_a (glob)
35 ? a/in_a (glob)
36 ? b/1/in_b_1 (glob)
36 ? b/1/in_b_1 (glob)
37 ? b/2/in_b_2 (glob)
37 ? b/2/in_b_2 (glob)
38 ? b/in_b (glob)
38 ? b/in_b (glob)
39 ? in_root
39 ? in_root
40 HGPLAINEXCEPT=color does not disable color
40 HGPLAINEXCEPT=color does not disable color
41 $ HGPLAINEXCEPT=color hg status --color=debug
41 $ HGPLAINEXCEPT=color hg status --color=debug
42 [status.unknown|? ][status.unknown|a/1/in_a_1] (glob)
42 [status.unknown|? ][status.unknown|a/1/in_a_1] (glob)
43 [status.unknown|? ][status.unknown|a/in_a] (glob)
43 [status.unknown|? ][status.unknown|a/in_a] (glob)
44 [status.unknown|? ][status.unknown|b/1/in_b_1] (glob)
44 [status.unknown|? ][status.unknown|b/1/in_b_1] (glob)
45 [status.unknown|? ][status.unknown|b/2/in_b_2] (glob)
45 [status.unknown|? ][status.unknown|b/2/in_b_2] (glob)
46 [status.unknown|? ][status.unknown|b/in_b] (glob)
46 [status.unknown|? ][status.unknown|b/in_b] (glob)
47 [status.unknown|? ][status.unknown|in_root]
47 [status.unknown|? ][status.unknown|in_root]
48
48
49 hg status with template
49 hg status with template
50 $ hg status -T "{label('red', path)}\n" --color=debug
50 $ hg status -T "{label('red', path)}\n" --color=debug
51 [red|a/1/in_a_1]
51 [red|a/1/in_a_1]
52 [red|a/in_a]
52 [red|a/in_a]
53 [red|b/1/in_b_1]
53 [red|b/1/in_b_1]
54 [red|b/2/in_b_2]
54 [red|b/2/in_b_2]
55 [red|b/in_b]
55 [red|b/in_b]
56 [red|in_root]
56 [red|in_root]
57
57
58 hg status . in repo root:
58 hg status . in repo root:
59
59
60 $ hg status .
60 $ hg status .
61 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
61 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
62 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
62 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
63 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
63 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
64 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
64 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
65 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
65 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
66 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
66 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
67
67
68 $ hg status --cwd a
68 $ hg status --cwd a
69 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
69 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
70 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
70 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
71 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
71 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
72 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
72 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
73 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
74 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
74 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
75 $ hg status --cwd a .
75 $ hg status --cwd a .
76 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
76 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
77 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
77 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
78 $ hg status --cwd a ..
78 $ hg status --cwd a ..
79 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
79 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_a_1\x1b[0m (esc)
80 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
80 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a\x1b[0m (esc)
81 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc)
81 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/1/in_b_1\x1b[0m (esc)
82 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/2/in_b_2\x1b[0m (esc)
82 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/2/in_b_2\x1b[0m (esc)
83 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc)
83 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../b/in_b\x1b[0m (esc)
84 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
84 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
85
85
86 $ hg status --cwd b
86 $ hg status --cwd b
87 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
87 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
88 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
88 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
89 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
89 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
90 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
90 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
91 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
91 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
92 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
92 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
93 $ hg status --cwd b .
93 $ hg status --cwd b .
94 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
94 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
95 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
95 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
96 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
96 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
97 $ hg status --cwd b ..
97 $ hg status --cwd b ..
98 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc)
98 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/1/in_a_1\x1b[0m (esc)
99 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc)
99 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../a/in_a\x1b[0m (esc)
100 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
100 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m1/in_b_1\x1b[0m (esc)
101 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
101 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m2/in_b_2\x1b[0m (esc)
102 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
102 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b\x1b[0m (esc)
103 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
103 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_root\x1b[0m (esc)
104
104
105 $ hg status --cwd a/1
105 $ hg status --cwd a/1
106 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
106 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
107 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
107 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
108 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
108 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
109 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
109 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
110 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
110 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
111 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
111 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
112 $ hg status --cwd a/1 .
112 $ hg status --cwd a/1 .
113 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
113 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
114 $ hg status --cwd a/1 ..
114 $ hg status --cwd a/1 ..
115 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
115 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_a_1\x1b[0m (esc)
116 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc)
116 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_a\x1b[0m (esc)
117
117
118 $ hg status --cwd b/1
118 $ hg status --cwd b/1
119 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
119 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
120 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
120 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
121 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
121 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
122 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
122 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
123 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
123 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
124 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
124 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
125 $ hg status --cwd b/1 .
125 $ hg status --cwd b/1 .
126 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
126 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
127 $ hg status --cwd b/1 ..
127 $ hg status --cwd b/1 ..
128 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
128 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_1\x1b[0m (esc)
129 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc)
129 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../2/in_b_2\x1b[0m (esc)
130 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
130 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
131
131
132 $ hg status --cwd b/2
132 $ hg status --cwd b/2
133 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
133 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/1/in_a_1\x1b[0m (esc)
134 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
134 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4ma/in_a\x1b[0m (esc)
135 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
135 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/1/in_b_1\x1b[0m (esc)
136 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
136 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/2/in_b_2\x1b[0m (esc)
137 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
137 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4mb/in_b\x1b[0m (esc)
138 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
138 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_root\x1b[0m (esc)
139 $ hg status --cwd b/2 .
139 $ hg status --cwd b/2 .
140 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
140 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
141 $ hg status --cwd b/2 ..
141 $ hg status --cwd b/2 ..
142 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc)
142 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../1/in_b_1\x1b[0m (esc)
143 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
143 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4min_b_2\x1b[0m (esc)
144 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
144 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4m../in_b\x1b[0m (esc)
145
145
146 Make sure --color=never works
146 Make sure --color=never works
147 $ hg status --color=never
147 $ hg status --color=never
148 ? a/1/in_a_1
148 ? a/1/in_a_1
149 ? a/in_a
149 ? a/in_a
150 ? b/1/in_b_1
150 ? b/1/in_b_1
151 ? b/2/in_b_2
151 ? b/2/in_b_2
152 ? b/in_b
152 ? b/in_b
153 ? in_root
153 ? in_root
154
154
155 Make sure ui.formatted=False works
155 Make sure ui.formatted=False works
156 $ hg status --color=auto --config ui.formatted=False
156 $ hg status --color=auto --config ui.formatted=False
157 ? a/1/in_a_1
157 ? a/1/in_a_1
158 ? a/in_a
158 ? a/in_a
159 ? b/1/in_b_1
159 ? b/1/in_b_1
160 ? b/2/in_b_2
160 ? b/2/in_b_2
161 ? b/in_b
161 ? b/in_b
162 ? in_root
162 ? in_root
163
163
164 $ cd ..
164 $ cd ..
165
165
166 $ hg init repo2
166 $ hg init repo2
167 $ cd repo2
167 $ cd repo2
168 $ touch modified removed deleted ignored
168 $ touch modified removed deleted ignored
169 $ echo "^ignored$" > .hgignore
169 $ echo "^ignored$" > .hgignore
170 $ hg ci -A -m 'initial checkin'
170 $ hg ci -A -m 'initial checkin'
171 adding .hgignore
171 adding .hgignore
172 adding deleted
172 adding deleted
173 adding modified
173 adding modified
174 adding removed
174 adding removed
175 $ hg log --color=debug
175 $ hg log --color=debug
176 [log.changeset changeset.draft|changeset: 0:389aef86a55e]
176 [log.changeset changeset.draft|changeset: 0:389aef86a55e]
177 [log.tag|tag: tip]
177 [log.tag|tag: tip]
178 [log.user|user: test]
178 [log.user|user: test]
179 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
179 [log.date|date: Thu Jan 01 00:00:00 1970 +0000]
180 [log.summary|summary: initial checkin]
180 [log.summary|summary: initial checkin]
181
181
182 $ hg log -Tcompact --color=debug
182 $ hg log -Tcompact --color=debug
183 [log.changeset changeset.draft|0][tip] [log.node|389aef86a55e] [log.date|1970-01-01 00:00 +0000] [log.user|test]
183 [log.changeset changeset.draft|0][tip] [log.node|389aef86a55e] [log.date|1970-01-01 00:00 +0000] [log.user|test]
184 [ui.note log.description|initial checkin]
184 [ui.note log.description|initial checkin]
185
185
186 Labels on empty strings should not be displayed, labels on custom
186 Labels on empty strings should not be displayed, labels on custom
187 templates should be.
187 templates should be.
188
188
189 $ hg log --color=debug -T '{label("my.label",author)}\n{label("skipped.label","")}'
189 $ hg log --color=debug -T '{label("my.label",author)}\n{label("skipped.label","")}'
190 [my.label|test]
190 [my.label|test]
191 $ touch modified added unknown ignored
191 $ touch modified added unknown ignored
192 $ hg add added
192 $ hg add added
193 $ hg remove removed
193 $ hg remove removed
194 $ rm deleted
194 $ rm deleted
195
195
196 hg status:
196 hg status:
197
197
198 $ hg status
198 $ hg status
199 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
199 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
200 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
200 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
201 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
201 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
202 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
202 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
203
203
204 hg status modified added removed deleted unknown never-existed ignored:
204 hg status modified added removed deleted unknown never-existed ignored:
205
205
206 $ hg status modified added removed deleted unknown never-existed ignored
206 $ hg status modified added removed deleted unknown never-existed ignored
207 never-existed: * (glob)
207 never-existed: * (glob)
208 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
208 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
209 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
209 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
210 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
210 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
211 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
211 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
212
212
213 $ hg copy modified copied
213 $ hg copy modified copied
214
214
215 hg status -C:
215 hg status -C:
216
216
217 $ hg status -C
217 $ hg status -C
218 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
218 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
219 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
219 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
220 \x1b[0;0m modified\x1b[0m (esc)
220 \x1b[0;0m modified\x1b[0m (esc)
221 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
221 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
222 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
222 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
223 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
223 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
224
224
225 hg status -A:
225 hg status -A:
226
226
227 $ hg status -A
227 $ hg status -A
228 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
228 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
229 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
229 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
230 \x1b[0;0m modified\x1b[0m (esc)
230 \x1b[0;0m modified\x1b[0m (esc)
231 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
231 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
232 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
232 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
233 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
233 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
234 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc)
234 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignored\x1b[0m (esc)
235 \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc)
235 \x1b[0;0mC \x1b[0m\x1b[0;0m.hgignore\x1b[0m (esc)
236 \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc)
236 \x1b[0;0mC \x1b[0m\x1b[0;0mmodified\x1b[0m (esc)
237
237
238
238
239 hg status -A (with terminfo color):
239 hg status -A (with terminfo color):
240
240
241 #if tic
241 #if tic
242
242
243 $ mkdir "$TESTTMP/terminfo"
243 $ mkdir "$TESTTMP/terminfo"
244 $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti"
244 $ TERMINFO="$TESTTMP/terminfo" tic "$TESTDIR/hgterm.ti"
245 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo -A
245 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo -A
246 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc)
246 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1madded\x1b[30m (esc)
247 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc)
247 \x1b[30m\x1b[32m\x1b[1mA \x1b[30m\x1b[30m\x1b[32m\x1b[1mcopied\x1b[30m (esc)
248 \x1b[30m\x1b[30m modified\x1b[30m (esc)
248 \x1b[30m\x1b[30m modified\x1b[30m (esc)
249 \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m (esc)
249 \x1b[30m\x1b[31m\x1b[1mR \x1b[30m\x1b[30m\x1b[31m\x1b[1mremoved\x1b[30m (esc)
250 \x1b[30m\x1b[36m\x1b[1m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc)
250 \x1b[30m\x1b[36m\x1b[1m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[1m\x1b[4mdeleted\x1b[30m (esc)
251 \x1b[30m\x1b[35m\x1b[1m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc)
251 \x1b[30m\x1b[35m\x1b[1m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[1m\x1b[4munknown\x1b[30m (esc)
252 \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m (esc)
252 \x1b[30m\x1b[30m\x1b[1mI \x1b[30m\x1b[30m\x1b[30m\x1b[1mignored\x1b[30m (esc)
253 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc)
253 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30m.hgignore\x1b[30m (esc)
254 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc)
254 \x1b[30m\x1b[30mC \x1b[30m\x1b[30m\x1b[30mmodified\x1b[30m (esc)
255
255
256 The user can define effects with raw terminfo codes:
256 The user can define effects with raw terminfo codes:
257
257
258 $ cat <<EOF >> $HGRCPATH
258 $ cat <<EOF >> $HGRCPATH
259 > # Completely bogus code for dim
259 > # Completely bogus code for dim
260 > terminfo.dim = \E[88m
260 > terminfo.dim = \E[88m
261 > # We can override what's in the terminfo database, too
261 > # We can override what's in the terminfo database, too
262 > terminfo.bold = \E[2m
262 > terminfo.bold = \E[2m
263 > EOF
263 > EOF
264 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --config color.status.clean=dim -A
264 $ TERM=hgterm TERMINFO="$TESTTMP/terminfo" hg status --config color.mode=terminfo --config color.status.clean=dim -A
265 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2madded\x1b[30m (esc)
265 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2madded\x1b[30m (esc)
266 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2mcopied\x1b[30m (esc)
266 \x1b[30m\x1b[32m\x1b[2mA \x1b[30m\x1b[30m\x1b[32m\x1b[2mcopied\x1b[30m (esc)
267 \x1b[30m\x1b[30m modified\x1b[30m (esc)
267 \x1b[30m\x1b[30m modified\x1b[30m (esc)
268 \x1b[30m\x1b[31m\x1b[2mR \x1b[30m\x1b[30m\x1b[31m\x1b[2mremoved\x1b[30m (esc)
268 \x1b[30m\x1b[31m\x1b[2mR \x1b[30m\x1b[30m\x1b[31m\x1b[2mremoved\x1b[30m (esc)
269 \x1b[30m\x1b[36m\x1b[2m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[2m\x1b[4mdeleted\x1b[30m (esc)
269 \x1b[30m\x1b[36m\x1b[2m\x1b[4m! \x1b[30m\x1b[30m\x1b[36m\x1b[2m\x1b[4mdeleted\x1b[30m (esc)
270 \x1b[30m\x1b[35m\x1b[2m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[2m\x1b[4munknown\x1b[30m (esc)
270 \x1b[30m\x1b[35m\x1b[2m\x1b[4m? \x1b[30m\x1b[30m\x1b[35m\x1b[2m\x1b[4munknown\x1b[30m (esc)
271 \x1b[30m\x1b[30m\x1b[2mI \x1b[30m\x1b[30m\x1b[30m\x1b[2mignored\x1b[30m (esc)
271 \x1b[30m\x1b[30m\x1b[2mI \x1b[30m\x1b[30m\x1b[30m\x1b[2mignored\x1b[30m (esc)
272 \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88m.hgignore\x1b[30m (esc)
272 \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88m.hgignore\x1b[30m (esc)
273 \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88mmodified\x1b[30m (esc)
273 \x1b[30m\x1b[88mC \x1b[30m\x1b[30m\x1b[88mmodified\x1b[30m (esc)
274
274
275 #endif
275 #endif
276
276
277
277
278 $ echo "^ignoreddir$" > .hgignore
278 $ echo "^ignoreddir$" > .hgignore
279 $ mkdir ignoreddir
279 $ mkdir ignoreddir
280 $ touch ignoreddir/file
280 $ touch ignoreddir/file
281
281
282 hg status ignoreddir/file:
282 hg status ignoreddir/file:
283
283
284 $ hg status ignoreddir/file
284 $ hg status ignoreddir/file
285
285
286 hg status -i ignoreddir/file:
286 hg status -i ignoreddir/file:
287
287
288 $ hg status -i ignoreddir/file
288 $ hg status -i ignoreddir/file
289 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc)
289 \x1b[0;30;1mI \x1b[0m\x1b[0;30;1mignoreddir/file\x1b[0m (esc)
290 $ cd ..
290 $ cd ..
291
291
292 check 'status -q' and some combinations
292 check 'status -q' and some combinations
293
293
294 $ hg init repo3
294 $ hg init repo3
295 $ cd repo3
295 $ cd repo3
296 $ touch modified removed deleted ignored
296 $ touch modified removed deleted ignored
297 $ echo "^ignored$" > .hgignore
297 $ echo "^ignored$" > .hgignore
298 $ hg commit -A -m 'initial checkin'
298 $ hg commit -A -m 'initial checkin'
299 adding .hgignore
299 adding .hgignore
300 adding deleted
300 adding deleted
301 adding modified
301 adding modified
302 adding removed
302 adding removed
303 $ touch added unknown ignored
303 $ touch added unknown ignored
304 $ hg add added
304 $ hg add added
305 $ echo "test" >> modified
305 $ echo "test" >> modified
306 $ hg remove removed
306 $ hg remove removed
307 $ rm deleted
307 $ rm deleted
308 $ hg copy modified copied
308 $ hg copy modified copied
309
309
310 test unknown color
310 test unknown color
311
311
312 $ hg --config color.status.modified=periwinkle status
312 $ hg --config color.status.modified=periwinkle status
313 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
313 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
314 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
314 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
315 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
315 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
316 M modified
316 M modified
317 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
317 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
318 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
318 \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
319 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
319 \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
320 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
320 \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
321 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
321 \x1b[0;35;1;4m? \x1b[0m\x1b[0;35;1;4munknown\x1b[0m (esc)
322
322
323 Run status with 2 different flags.
323 Run status with 2 different flags.
324 Check if result is the same or different.
324 Check if result is the same or different.
325 If result is not as expected, raise error
325 If result is not as expected, raise error
326
326
327 $ assert() {
327 $ assert() {
328 > hg status $1 > ../a
328 > hg status $1 > ../a
329 > hg status $2 > ../b
329 > hg status $2 > ../b
330 > if diff ../a ../b > /dev/null; then
330 > if diff ../a ../b > /dev/null; then
331 > out=0
331 > out=0
332 > else
332 > else
333 > out=1
333 > out=1
334 > fi
334 > fi
335 > if [ $3 -eq 0 ]; then
335 > if [ $3 -eq 0 ]; then
336 > df="same"
336 > df="same"
337 > else
337 > else
338 > df="different"
338 > df="different"
339 > fi
339 > fi
340 > if [ $out -ne $3 ]; then
340 > if [ $out -ne $3 ]; then
341 > echo "Error on $1 and $2, should be $df."
341 > echo "Error on $1 and $2, should be $df."
342 > fi
342 > fi
343 > }
343 > }
344
344
345 assert flag1 flag2 [0-same | 1-different]
345 assert flag1 flag2 [0-same | 1-different]
346
346
347 $ assert "-q" "-mard" 0
347 $ assert "-q" "-mard" 0
348 $ assert "-A" "-marduicC" 0
348 $ assert "-A" "-marduicC" 0
349 $ assert "-qA" "-mardcC" 0
349 $ assert "-qA" "-mardcC" 0
350 $ assert "-qAui" "-A" 0
350 $ assert "-qAui" "-A" 0
351 $ assert "-qAu" "-marducC" 0
351 $ assert "-qAu" "-marducC" 0
352 $ assert "-qAi" "-mardicC" 0
352 $ assert "-qAi" "-mardicC" 0
353 $ assert "-qu" "-u" 0
353 $ assert "-qu" "-u" 0
354 $ assert "-q" "-u" 1
354 $ assert "-q" "-u" 1
355 $ assert "-m" "-a" 1
355 $ assert "-m" "-a" 1
356 $ assert "-r" "-d" 1
356 $ assert "-r" "-d" 1
357 $ cd ..
357 $ cd ..
358
358
359 test 'resolve -l'
359 test 'resolve -l'
360
360
361 $ hg init repo4
361 $ hg init repo4
362 $ cd repo4
362 $ cd repo4
363 $ echo "file a" > a
363 $ echo "file a" > a
364 $ echo "file b" > b
364 $ echo "file b" > b
365 $ hg add a b
365 $ hg add a b
366 $ hg commit -m "initial"
366 $ hg commit -m "initial"
367 $ echo "file a change 1" > a
367 $ echo "file a change 1" > a
368 $ echo "file b change 1" > b
368 $ echo "file b change 1" > b
369 $ hg commit -m "head 1"
369 $ hg commit -m "head 1"
370 $ hg update 0
370 $ hg update 0
371 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
371 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
372 $ echo "file a change 2" > a
372 $ echo "file a change 2" > a
373 $ echo "file b change 2" > b
373 $ echo "file b change 2" > b
374 $ hg commit -m "head 2"
374 $ hg commit -m "head 2"
375 created new head
375 created new head
376 $ hg merge
376 $ hg merge
377 merging a
377 merging a
378 merging b
378 merging b
379 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
379 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
380 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
380 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
381 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
381 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
382 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
382 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
383 [1]
383 [1]
384 $ hg resolve -m b
384 $ hg resolve -m b
385
385
386 hg resolve with one unresolved, one resolved:
386 hg resolve with one unresolved, one resolved:
387
387
388 $ hg resolve -l
388 $ hg resolve -l
389 \x1b[0;31;1mU \x1b[0m\x1b[0;31;1ma\x1b[0m (esc)
389 \x1b[0;31;1mU \x1b[0m\x1b[0;31;1ma\x1b[0m (esc)
390 \x1b[0;32;1mR \x1b[0m\x1b[0;32;1mb\x1b[0m (esc)
390 \x1b[0;32;1mR \x1b[0m\x1b[0;32;1mb\x1b[0m (esc)
391
391
392 color coding of error message with current availability of curses
392 color coding of error message with current availability of curses
393
393
394 $ hg unknowncommand > /dev/null
394 $ hg unknowncommand > /dev/null
395 hg: unknown command 'unknowncommand'
395 hg: unknown command 'unknowncommand'
396 (use 'hg help' for a list of commands)
396 [255]
397 [255]
397
398
398 color coding of error message without curses
399 color coding of error message without curses
399
400
400 $ echo 'raise ImportError' > curses.py
401 $ echo 'raise ImportError' > curses.py
401 $ PYTHONPATH=`pwd`:$PYTHONPATH hg unknowncommand > /dev/null
402 $ PYTHONPATH=`pwd`:$PYTHONPATH hg unknowncommand > /dev/null
402 hg: unknown command 'unknowncommand'
403 hg: unknown command 'unknowncommand'
404 (use 'hg help' for a list of commands)
403 [255]
405 [255]
404
406
405 $ cd ..
407 $ cd ..
@@ -1,48 +1,26 b''
1 $ hg init
1 $ hg init
2
2
3 $ echo a > a
3 $ echo a > a
4 $ hg ci -Ama
4 $ hg ci -Ama
5 adding a
5 adding a
6
6
7 $ hg an a
7 $ hg an a
8 0: a
8 0: a
9
9
10 $ hg --config ui.strict=False an a
10 $ hg --config ui.strict=False an a
11 0: a
11 0: a
12
12
13 $ echo "[ui]" >> $HGRCPATH
13 $ echo "[ui]" >> $HGRCPATH
14 $ echo "strict=True" >> $HGRCPATH
14 $ echo "strict=True" >> $HGRCPATH
15
15
16 $ hg an a
16 $ hg an a
17 hg: unknown command 'an'
17 hg: unknown command 'an'
18 Mercurial Distributed SCM
18 (use 'hg help' for a list of commands)
19
20 basic commands:
21
22 add add the specified files on the next commit
23 annotate show changeset information by line for each file
24 clone make a copy of an existing repository
25 commit commit the specified files or all outstanding changes
26 diff diff repository (or selected files)
27 export dump the header and diffs for one or more changesets
28 forget forget the specified files on the next commit
29 init create a new repository in the given directory
30 log show revision history of entire repository or files
31 merge merge another revision into working directory
32 pull pull changes from the specified source
33 push push changes to the specified destination
34 remove remove the specified files on the next commit
35 serve start stand-alone webserver
36 status show changed files in the working directory
37 summary summarize working directory state
38 update update working directory (or switch revisions)
39
40 (use 'hg help' for the full list of commands or 'hg -v' for details)
41 [255]
19 [255]
42 $ hg annotate a
20 $ hg annotate a
43 0: a
21 0: a
44
22
45 should succeed - up is an alias, not an abbreviation
23 should succeed - up is an alias, not an abbreviation
46
24
47 $ hg up
25 $ hg up
48 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now