##// END OF EJS Templates
error: use detailed exit code 10 for command errors...
Martin von Zweigbergk -
r46888:9c9e0b4b default
parent child Browse files
Show More
@@ -1,1368 +1,1375 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 errno
10 import errno
11 import getopt
11 import getopt
12 import io
12 import io
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 traceback
18 import traceback
19
19
20
20
21 from .i18n import _
21 from .i18n import _
22 from .pycompat import getattr
22 from .pycompat import getattr
23
23
24 from hgdemandimport import tracing
24 from hgdemandimport import tracing
25
25
26 from . import (
26 from . import (
27 cmdutil,
27 cmdutil,
28 color,
28 color,
29 commands,
29 commands,
30 demandimport,
30 demandimport,
31 encoding,
31 encoding,
32 error,
32 error,
33 extensions,
33 extensions,
34 fancyopts,
34 fancyopts,
35 help,
35 help,
36 hg,
36 hg,
37 hook,
37 hook,
38 localrepo,
38 localrepo,
39 profiling,
39 profiling,
40 pycompat,
40 pycompat,
41 rcutil,
41 rcutil,
42 registrar,
42 registrar,
43 requirements as requirementsmod,
43 requirements as requirementsmod,
44 scmutil,
44 scmutil,
45 ui as uimod,
45 ui as uimod,
46 util,
46 util,
47 vfs,
47 vfs,
48 )
48 )
49
49
50 from .utils import (
50 from .utils import (
51 procutil,
51 procutil,
52 stringutil,
52 stringutil,
53 )
53 )
54
54
55
55
56 class request(object):
56 class request(object):
57 def __init__(
57 def __init__(
58 self,
58 self,
59 args,
59 args,
60 ui=None,
60 ui=None,
61 repo=None,
61 repo=None,
62 fin=None,
62 fin=None,
63 fout=None,
63 fout=None,
64 ferr=None,
64 ferr=None,
65 fmsg=None,
65 fmsg=None,
66 prereposetups=None,
66 prereposetups=None,
67 ):
67 ):
68 self.args = args
68 self.args = args
69 self.ui = ui
69 self.ui = ui
70 self.repo = repo
70 self.repo = repo
71
71
72 # input/output/error streams
72 # input/output/error streams
73 self.fin = fin
73 self.fin = fin
74 self.fout = fout
74 self.fout = fout
75 self.ferr = ferr
75 self.ferr = ferr
76 # separate stream for status/error messages
76 # separate stream for status/error messages
77 self.fmsg = fmsg
77 self.fmsg = fmsg
78
78
79 # remember options pre-parsed by _earlyparseopts()
79 # remember options pre-parsed by _earlyparseopts()
80 self.earlyoptions = {}
80 self.earlyoptions = {}
81
81
82 # reposetups which run before extensions, useful for chg to pre-fill
82 # reposetups which run before extensions, useful for chg to pre-fill
83 # low-level repo state (for example, changelog) before extensions.
83 # low-level repo state (for example, changelog) before extensions.
84 self.prereposetups = prereposetups or []
84 self.prereposetups = prereposetups or []
85
85
86 # store the parsed and canonical command
86 # store the parsed and canonical command
87 self.canonical_command = None
87 self.canonical_command = None
88
88
89 def _runexithandlers(self):
89 def _runexithandlers(self):
90 exc = None
90 exc = None
91 handlers = self.ui._exithandlers
91 handlers = self.ui._exithandlers
92 try:
92 try:
93 while handlers:
93 while handlers:
94 func, args, kwargs = handlers.pop()
94 func, args, kwargs = handlers.pop()
95 try:
95 try:
96 func(*args, **kwargs)
96 func(*args, **kwargs)
97 except: # re-raises below
97 except: # re-raises below
98 if exc is None:
98 if exc is None:
99 exc = sys.exc_info()[1]
99 exc = sys.exc_info()[1]
100 self.ui.warnnoi18n(b'error in exit handlers:\n')
100 self.ui.warnnoi18n(b'error in exit handlers:\n')
101 self.ui.traceback(force=True)
101 self.ui.traceback(force=True)
102 finally:
102 finally:
103 if exc is not None:
103 if exc is not None:
104 raise exc
104 raise exc
105
105
106
106
107 def _flushstdio(ui, err):
107 def _flushstdio(ui, err):
108 status = None
108 status = None
109 # In all cases we try to flush stdio streams.
109 # In all cases we try to flush stdio streams.
110 if util.safehasattr(ui, b'fout'):
110 if util.safehasattr(ui, b'fout'):
111 assert ui is not None # help pytype
111 assert ui is not None # help pytype
112 assert ui.fout is not None # help pytype
112 assert ui.fout is not None # help pytype
113 try:
113 try:
114 ui.fout.flush()
114 ui.fout.flush()
115 except IOError as e:
115 except IOError as e:
116 err = e
116 err = e
117 status = -1
117 status = -1
118
118
119 if util.safehasattr(ui, b'ferr'):
119 if util.safehasattr(ui, b'ferr'):
120 assert ui is not None # help pytype
120 assert ui is not None # help pytype
121 assert ui.ferr is not None # help pytype
121 assert ui.ferr is not None # help pytype
122 try:
122 try:
123 if err is not None and err.errno != errno.EPIPE:
123 if err is not None and err.errno != errno.EPIPE:
124 ui.ferr.write(
124 ui.ferr.write(
125 b'abort: %s\n' % encoding.strtolocal(err.strerror)
125 b'abort: %s\n' % encoding.strtolocal(err.strerror)
126 )
126 )
127 ui.ferr.flush()
127 ui.ferr.flush()
128 # There's not much we can do about an I/O error here. So (possibly)
128 # There's not much we can do about an I/O error here. So (possibly)
129 # change the status code and move on.
129 # change the status code and move on.
130 except IOError:
130 except IOError:
131 status = -1
131 status = -1
132
132
133 return status
133 return status
134
134
135
135
136 def run():
136 def run():
137 """run the command in sys.argv"""
137 """run the command in sys.argv"""
138 try:
138 try:
139 initstdio()
139 initstdio()
140 with tracing.log('parse args into request'):
140 with tracing.log('parse args into request'):
141 req = request(pycompat.sysargv[1:])
141 req = request(pycompat.sysargv[1:])
142
142
143 status = dispatch(req)
143 status = dispatch(req)
144 _silencestdio()
144 _silencestdio()
145 except KeyboardInterrupt:
145 except KeyboardInterrupt:
146 # Catch early/late KeyboardInterrupt as last ditch. Here nothing will
146 # Catch early/late KeyboardInterrupt as last ditch. Here nothing will
147 # be printed to console to avoid another IOError/KeyboardInterrupt.
147 # be printed to console to avoid another IOError/KeyboardInterrupt.
148 status = -1
148 status = -1
149 sys.exit(status & 255)
149 sys.exit(status & 255)
150
150
151
151
152 if pycompat.ispy3:
152 if pycompat.ispy3:
153
153
154 def initstdio():
154 def initstdio():
155 # stdio streams on Python 3 are io.TextIOWrapper instances proxying another
155 # stdio streams on Python 3 are io.TextIOWrapper instances proxying another
156 # buffer. These streams will normalize \n to \r\n by default. Mercurial's
156 # buffer. These streams will normalize \n to \r\n by default. Mercurial's
157 # preferred mechanism for writing output (ui.write()) uses io.BufferedWriter
157 # preferred mechanism for writing output (ui.write()) uses io.BufferedWriter
158 # instances, which write to the underlying stdio file descriptor in binary
158 # instances, which write to the underlying stdio file descriptor in binary
159 # mode. ui.write() uses \n for line endings and no line ending normalization
159 # mode. ui.write() uses \n for line endings and no line ending normalization
160 # is attempted through this interface. This "just works," even if the system
160 # is attempted through this interface. This "just works," even if the system
161 # preferred line ending is not \n.
161 # preferred line ending is not \n.
162 #
162 #
163 # But some parts of Mercurial (e.g. hooks) can still send data to sys.stdout
163 # But some parts of Mercurial (e.g. hooks) can still send data to sys.stdout
164 # and sys.stderr. They will inherit the line ending normalization settings,
164 # and sys.stderr. They will inherit the line ending normalization settings,
165 # potentially causing e.g. \r\n to be emitted. Since emitting \n should
165 # potentially causing e.g. \r\n to be emitted. Since emitting \n should
166 # "just work," here we change the sys.* streams to disable line ending
166 # "just work," here we change the sys.* streams to disable line ending
167 # normalization, ensuring compatibility with our ui type.
167 # normalization, ensuring compatibility with our ui type.
168
168
169 if sys.stdout is not None:
169 if sys.stdout is not None:
170 # write_through is new in Python 3.7.
170 # write_through is new in Python 3.7.
171 kwargs = {
171 kwargs = {
172 "newline": "\n",
172 "newline": "\n",
173 "line_buffering": sys.stdout.line_buffering,
173 "line_buffering": sys.stdout.line_buffering,
174 }
174 }
175 if util.safehasattr(sys.stdout, "write_through"):
175 if util.safehasattr(sys.stdout, "write_through"):
176 kwargs["write_through"] = sys.stdout.write_through
176 kwargs["write_through"] = sys.stdout.write_through
177 sys.stdout = io.TextIOWrapper(
177 sys.stdout = io.TextIOWrapper(
178 sys.stdout.buffer,
178 sys.stdout.buffer,
179 sys.stdout.encoding,
179 sys.stdout.encoding,
180 sys.stdout.errors,
180 sys.stdout.errors,
181 **kwargs
181 **kwargs
182 )
182 )
183
183
184 if sys.stderr is not None:
184 if sys.stderr is not None:
185 kwargs = {
185 kwargs = {
186 "newline": "\n",
186 "newline": "\n",
187 "line_buffering": sys.stderr.line_buffering,
187 "line_buffering": sys.stderr.line_buffering,
188 }
188 }
189 if util.safehasattr(sys.stderr, "write_through"):
189 if util.safehasattr(sys.stderr, "write_through"):
190 kwargs["write_through"] = sys.stderr.write_through
190 kwargs["write_through"] = sys.stderr.write_through
191 sys.stderr = io.TextIOWrapper(
191 sys.stderr = io.TextIOWrapper(
192 sys.stderr.buffer,
192 sys.stderr.buffer,
193 sys.stderr.encoding,
193 sys.stderr.encoding,
194 sys.stderr.errors,
194 sys.stderr.errors,
195 **kwargs
195 **kwargs
196 )
196 )
197
197
198 if sys.stdin is not None:
198 if sys.stdin is not None:
199 # No write_through on read-only stream.
199 # No write_through on read-only stream.
200 sys.stdin = io.TextIOWrapper(
200 sys.stdin = io.TextIOWrapper(
201 sys.stdin.buffer,
201 sys.stdin.buffer,
202 sys.stdin.encoding,
202 sys.stdin.encoding,
203 sys.stdin.errors,
203 sys.stdin.errors,
204 # None is universal newlines mode.
204 # None is universal newlines mode.
205 newline=None,
205 newline=None,
206 line_buffering=sys.stdin.line_buffering,
206 line_buffering=sys.stdin.line_buffering,
207 )
207 )
208
208
209 def _silencestdio():
209 def _silencestdio():
210 for fp in (sys.stdout, sys.stderr):
210 for fp in (sys.stdout, sys.stderr):
211 if fp is None:
211 if fp is None:
212 continue
212 continue
213 # Check if the file is okay
213 # Check if the file is okay
214 try:
214 try:
215 fp.flush()
215 fp.flush()
216 continue
216 continue
217 except IOError:
217 except IOError:
218 pass
218 pass
219 # Otherwise mark it as closed to silence "Exception ignored in"
219 # Otherwise mark it as closed to silence "Exception ignored in"
220 # message emitted by the interpreter finalizer.
220 # message emitted by the interpreter finalizer.
221 try:
221 try:
222 fp.close()
222 fp.close()
223 except IOError:
223 except IOError:
224 pass
224 pass
225
225
226
226
227 else:
227 else:
228
228
229 def initstdio():
229 def initstdio():
230 for fp in (sys.stdin, sys.stdout, sys.stderr):
230 for fp in (sys.stdin, sys.stdout, sys.stderr):
231 procutil.setbinary(fp)
231 procutil.setbinary(fp)
232
232
233 def _silencestdio():
233 def _silencestdio():
234 pass
234 pass
235
235
236
236
237 def _formatargs(args):
237 def _formatargs(args):
238 return b' '.join(procutil.shellquote(a) for a in args)
238 return b' '.join(procutil.shellquote(a) for a in args)
239
239
240
240
241 def dispatch(req):
241 def dispatch(req):
242 """run the command specified in req.args; returns an integer status code"""
242 """run the command specified in req.args; returns an integer status code"""
243 err = None
243 err = None
244 try:
244 try:
245 status = _rundispatch(req)
245 status = _rundispatch(req)
246 except error.StdioError as e:
246 except error.StdioError as e:
247 err = e
247 err = e
248 status = -1
248 status = -1
249
249
250 ret = _flushstdio(req.ui, err)
250 ret = _flushstdio(req.ui, err)
251 if ret:
251 if ret:
252 status = ret
252 status = ret
253 return status
253 return status
254
254
255
255
256 def _rundispatch(req):
256 def _rundispatch(req):
257 with tracing.log('dispatch._rundispatch'):
257 with tracing.log('dispatch._rundispatch'):
258 if req.ferr:
258 if req.ferr:
259 ferr = req.ferr
259 ferr = req.ferr
260 elif req.ui:
260 elif req.ui:
261 ferr = req.ui.ferr
261 ferr = req.ui.ferr
262 else:
262 else:
263 ferr = procutil.stderr
263 ferr = procutil.stderr
264
264
265 try:
265 try:
266 if not req.ui:
266 if not req.ui:
267 req.ui = uimod.ui.load()
267 req.ui = uimod.ui.load()
268 req.earlyoptions.update(_earlyparseopts(req.ui, req.args))
268 req.earlyoptions.update(_earlyparseopts(req.ui, req.args))
269 if req.earlyoptions[b'traceback']:
269 if req.earlyoptions[b'traceback']:
270 req.ui.setconfig(b'ui', b'traceback', b'on', b'--traceback')
270 req.ui.setconfig(b'ui', b'traceback', b'on', b'--traceback')
271
271
272 # set ui streams from the request
272 # set ui streams from the request
273 if req.fin:
273 if req.fin:
274 req.ui.fin = req.fin
274 req.ui.fin = req.fin
275 if req.fout:
275 if req.fout:
276 req.ui.fout = req.fout
276 req.ui.fout = req.fout
277 if req.ferr:
277 if req.ferr:
278 req.ui.ferr = req.ferr
278 req.ui.ferr = req.ferr
279 if req.fmsg:
279 if req.fmsg:
280 req.ui.fmsg = req.fmsg
280 req.ui.fmsg = req.fmsg
281 except error.Abort as inst:
281 except error.Abort as inst:
282 ferr.write(inst.format())
282 ferr.write(inst.format())
283 return -1
283 return -1
284
284
285 msg = _formatargs(req.args)
285 msg = _formatargs(req.args)
286 starttime = util.timer()
286 starttime = util.timer()
287 ret = 1 # default of Python exit code on unhandled exception
287 ret = 1 # default of Python exit code on unhandled exception
288 try:
288 try:
289 ret = _runcatch(req) or 0
289 ret = _runcatch(req) or 0
290 except error.ProgrammingError as inst:
290 except error.ProgrammingError as inst:
291 req.ui.error(_(b'** ProgrammingError: %s\n') % inst)
291 req.ui.error(_(b'** ProgrammingError: %s\n') % inst)
292 if inst.hint:
292 if inst.hint:
293 req.ui.error(_(b'** (%s)\n') % inst.hint)
293 req.ui.error(_(b'** (%s)\n') % inst.hint)
294 raise
294 raise
295 except KeyboardInterrupt as inst:
295 except KeyboardInterrupt as inst:
296 try:
296 try:
297 if isinstance(inst, error.SignalInterrupt):
297 if isinstance(inst, error.SignalInterrupt):
298 msg = _(b"killed!\n")
298 msg = _(b"killed!\n")
299 else:
299 else:
300 msg = _(b"interrupted!\n")
300 msg = _(b"interrupted!\n")
301 req.ui.error(msg)
301 req.ui.error(msg)
302 except error.SignalInterrupt:
302 except error.SignalInterrupt:
303 # maybe pager would quit without consuming all the output, and
303 # maybe pager would quit without consuming all the output, and
304 # SIGPIPE was raised. we cannot print anything in this case.
304 # SIGPIPE was raised. we cannot print anything in this case.
305 pass
305 pass
306 except IOError as inst:
306 except IOError as inst:
307 if inst.errno != errno.EPIPE:
307 if inst.errno != errno.EPIPE:
308 raise
308 raise
309 ret = -1
309 ret = -1
310 finally:
310 finally:
311 duration = util.timer() - starttime
311 duration = util.timer() - starttime
312 req.ui.flush() # record blocked times
312 req.ui.flush() # record blocked times
313 if req.ui.logblockedtimes:
313 if req.ui.logblockedtimes:
314 req.ui._blockedtimes[b'command_duration'] = duration * 1000
314 req.ui._blockedtimes[b'command_duration'] = duration * 1000
315 req.ui.log(
315 req.ui.log(
316 b'uiblocked',
316 b'uiblocked',
317 b'ui blocked ms\n',
317 b'ui blocked ms\n',
318 **pycompat.strkwargs(req.ui._blockedtimes)
318 **pycompat.strkwargs(req.ui._blockedtimes)
319 )
319 )
320 return_code = ret & 255
320 return_code = ret & 255
321 req.ui.log(
321 req.ui.log(
322 b"commandfinish",
322 b"commandfinish",
323 b"%s exited %d after %0.2f seconds\n",
323 b"%s exited %d after %0.2f seconds\n",
324 msg,
324 msg,
325 return_code,
325 return_code,
326 duration,
326 duration,
327 return_code=return_code,
327 return_code=return_code,
328 duration=duration,
328 duration=duration,
329 canonical_command=req.canonical_command,
329 canonical_command=req.canonical_command,
330 )
330 )
331 try:
331 try:
332 req._runexithandlers()
332 req._runexithandlers()
333 except: # exiting, so no re-raises
333 except: # exiting, so no re-raises
334 ret = ret or -1
334 ret = ret or -1
335 # do flush again since ui.log() and exit handlers may write to ui
335 # do flush again since ui.log() and exit handlers may write to ui
336 req.ui.flush()
336 req.ui.flush()
337 return ret
337 return ret
338
338
339
339
340 def _runcatch(req):
340 def _runcatch(req):
341 with tracing.log('dispatch._runcatch'):
341 with tracing.log('dispatch._runcatch'):
342
342
343 def catchterm(*args):
343 def catchterm(*args):
344 raise error.SignalInterrupt
344 raise error.SignalInterrupt
345
345
346 ui = req.ui
346 ui = req.ui
347 try:
347 try:
348 for name in b'SIGBREAK', b'SIGHUP', b'SIGTERM':
348 for name in b'SIGBREAK', b'SIGHUP', b'SIGTERM':
349 num = getattr(signal, name, None)
349 num = getattr(signal, name, None)
350 if num:
350 if num:
351 signal.signal(num, catchterm)
351 signal.signal(num, catchterm)
352 except ValueError:
352 except ValueError:
353 pass # happens if called in a thread
353 pass # happens if called in a thread
354
354
355 def _runcatchfunc():
355 def _runcatchfunc():
356 realcmd = None
356 realcmd = None
357 try:
357 try:
358 cmdargs = fancyopts.fancyopts(
358 cmdargs = fancyopts.fancyopts(
359 req.args[:], commands.globalopts, {}
359 req.args[:], commands.globalopts, {}
360 )
360 )
361 cmd = cmdargs[0]
361 cmd = cmdargs[0]
362 aliases, entry = cmdutil.findcmd(cmd, commands.table, False)
362 aliases, entry = cmdutil.findcmd(cmd, commands.table, False)
363 realcmd = aliases[0]
363 realcmd = aliases[0]
364 except (
364 except (
365 error.UnknownCommand,
365 error.UnknownCommand,
366 error.AmbiguousCommand,
366 error.AmbiguousCommand,
367 IndexError,
367 IndexError,
368 getopt.GetoptError,
368 getopt.GetoptError,
369 ):
369 ):
370 # Don't handle this here. We know the command is
370 # Don't handle this here. We know the command is
371 # invalid, but all we're worried about for now is that
371 # invalid, but all we're worried about for now is that
372 # it's not a command that server operators expect to
372 # it's not a command that server operators expect to
373 # be safe to offer to users in a sandbox.
373 # be safe to offer to users in a sandbox.
374 pass
374 pass
375 if realcmd == b'serve' and b'--stdio' in cmdargs:
375 if realcmd == b'serve' and b'--stdio' in cmdargs:
376 # We want to constrain 'hg serve --stdio' instances pretty
376 # We want to constrain 'hg serve --stdio' instances pretty
377 # closely, as many shared-ssh access tools want to grant
377 # closely, as many shared-ssh access tools want to grant
378 # access to run *only* 'hg -R $repo serve --stdio'. We
378 # access to run *only* 'hg -R $repo serve --stdio'. We
379 # restrict to exactly that set of arguments, and prohibit
379 # restrict to exactly that set of arguments, and prohibit
380 # any repo name that starts with '--' to prevent
380 # any repo name that starts with '--' to prevent
381 # shenanigans wherein a user does something like pass
381 # shenanigans wherein a user does something like pass
382 # --debugger or --config=ui.debugger=1 as a repo
382 # --debugger or --config=ui.debugger=1 as a repo
383 # name. This used to actually run the debugger.
383 # name. This used to actually run the debugger.
384 if (
384 if (
385 len(req.args) != 4
385 len(req.args) != 4
386 or req.args[0] != b'-R'
386 or req.args[0] != b'-R'
387 or req.args[1].startswith(b'--')
387 or req.args[1].startswith(b'--')
388 or req.args[2] != b'serve'
388 or req.args[2] != b'serve'
389 or req.args[3] != b'--stdio'
389 or req.args[3] != b'--stdio'
390 ):
390 ):
391 raise error.Abort(
391 raise error.Abort(
392 _(b'potentially unsafe serve --stdio invocation: %s')
392 _(b'potentially unsafe serve --stdio invocation: %s')
393 % (stringutil.pprint(req.args),)
393 % (stringutil.pprint(req.args),)
394 )
394 )
395
395
396 try:
396 try:
397 debugger = b'pdb'
397 debugger = b'pdb'
398 debugtrace = {b'pdb': pdb.set_trace}
398 debugtrace = {b'pdb': pdb.set_trace}
399 debugmortem = {b'pdb': pdb.post_mortem}
399 debugmortem = {b'pdb': pdb.post_mortem}
400
400
401 # read --config before doing anything else
401 # read --config before doing anything else
402 # (e.g. to change trust settings for reading .hg/hgrc)
402 # (e.g. to change trust settings for reading .hg/hgrc)
403 cfgs = _parseconfig(req.ui, req.earlyoptions[b'config'])
403 cfgs = _parseconfig(req.ui, req.earlyoptions[b'config'])
404
404
405 if req.repo:
405 if req.repo:
406 # copy configs that were passed on the cmdline (--config) to
406 # copy configs that were passed on the cmdline (--config) to
407 # the repo ui
407 # the repo ui
408 for sec, name, val in cfgs:
408 for sec, name, val in cfgs:
409 req.repo.ui.setconfig(
409 req.repo.ui.setconfig(
410 sec, name, val, source=b'--config'
410 sec, name, val, source=b'--config'
411 )
411 )
412
412
413 # developer config: ui.debugger
413 # developer config: ui.debugger
414 debugger = ui.config(b"ui", b"debugger")
414 debugger = ui.config(b"ui", b"debugger")
415 debugmod = pdb
415 debugmod = pdb
416 if not debugger or ui.plain():
416 if not debugger or ui.plain():
417 # if we are in HGPLAIN mode, then disable custom debugging
417 # if we are in HGPLAIN mode, then disable custom debugging
418 debugger = b'pdb'
418 debugger = b'pdb'
419 elif req.earlyoptions[b'debugger']:
419 elif req.earlyoptions[b'debugger']:
420 # This import can be slow for fancy debuggers, so only
420 # This import can be slow for fancy debuggers, so only
421 # do it when absolutely necessary, i.e. when actual
421 # do it when absolutely necessary, i.e. when actual
422 # debugging has been requested
422 # debugging has been requested
423 with demandimport.deactivated():
423 with demandimport.deactivated():
424 try:
424 try:
425 debugmod = __import__(debugger)
425 debugmod = __import__(debugger)
426 except ImportError:
426 except ImportError:
427 pass # Leave debugmod = pdb
427 pass # Leave debugmod = pdb
428
428
429 debugtrace[debugger] = debugmod.set_trace
429 debugtrace[debugger] = debugmod.set_trace
430 debugmortem[debugger] = debugmod.post_mortem
430 debugmortem[debugger] = debugmod.post_mortem
431
431
432 # enter the debugger before command execution
432 # enter the debugger before command execution
433 if req.earlyoptions[b'debugger']:
433 if req.earlyoptions[b'debugger']:
434 ui.warn(
434 ui.warn(
435 _(
435 _(
436 b"entering debugger - "
436 b"entering debugger - "
437 b"type c to continue starting hg or h for help\n"
437 b"type c to continue starting hg or h for help\n"
438 )
438 )
439 )
439 )
440
440
441 if (
441 if (
442 debugger != b'pdb'
442 debugger != b'pdb'
443 and debugtrace[debugger] == debugtrace[b'pdb']
443 and debugtrace[debugger] == debugtrace[b'pdb']
444 ):
444 ):
445 ui.warn(
445 ui.warn(
446 _(
446 _(
447 b"%s debugger specified "
447 b"%s debugger specified "
448 b"but its module was not found\n"
448 b"but its module was not found\n"
449 )
449 )
450 % debugger
450 % debugger
451 )
451 )
452 with demandimport.deactivated():
452 with demandimport.deactivated():
453 debugtrace[debugger]()
453 debugtrace[debugger]()
454 try:
454 try:
455 return _dispatch(req)
455 return _dispatch(req)
456 finally:
456 finally:
457 ui.flush()
457 ui.flush()
458 except: # re-raises
458 except: # re-raises
459 # enter the debugger when we hit an exception
459 # enter the debugger when we hit an exception
460 if req.earlyoptions[b'debugger']:
460 if req.earlyoptions[b'debugger']:
461 traceback.print_exc()
461 traceback.print_exc()
462 debugmortem[debugger](sys.exc_info()[2])
462 debugmortem[debugger](sys.exc_info()[2])
463 raise
463 raise
464
464
465 return _callcatch(ui, _runcatchfunc)
465 return _callcatch(ui, _runcatchfunc)
466
466
467
467
468 def _callcatch(ui, func):
468 def _callcatch(ui, func):
469 """like scmutil.callcatch but handles more high-level exceptions about
469 """like scmutil.callcatch but handles more high-level exceptions about
470 config parsing and commands. besides, use handlecommandexception to handle
470 config parsing and commands. besides, use handlecommandexception to handle
471 uncaught exceptions.
471 uncaught exceptions.
472 """
472 """
473 detailed_exit_code = -1
473 try:
474 try:
474 return scmutil.callcatch(ui, func)
475 return scmutil.callcatch(ui, func)
475 except error.AmbiguousCommand as inst:
476 except error.AmbiguousCommand as inst:
477 detailed_exit_code = 10
476 ui.warn(
478 ui.warn(
477 _(b"hg: command '%s' is ambiguous:\n %s\n")
479 _(b"hg: command '%s' is ambiguous:\n %s\n")
478 % (inst.prefix, b" ".join(inst.matches))
480 % (inst.prefix, b" ".join(inst.matches))
479 )
481 )
480 except error.CommandError as inst:
482 except error.CommandError as inst:
483 detailed_exit_code = 10
481 if inst.command:
484 if inst.command:
482 ui.pager(b'help')
485 ui.pager(b'help')
483 msgbytes = pycompat.bytestr(inst.message)
486 msgbytes = pycompat.bytestr(inst.message)
484 ui.warn(_(b"hg %s: %s\n") % (inst.command, msgbytes))
487 ui.warn(_(b"hg %s: %s\n") % (inst.command, msgbytes))
485 commands.help_(ui, inst.command, full=False, command=True)
488 commands.help_(ui, inst.command, full=False, command=True)
486 else:
489 else:
487 ui.warn(_(b"hg: %s\n") % inst.message)
490 ui.warn(_(b"hg: %s\n") % inst.message)
488 ui.warn(_(b"(use 'hg help -v' for a list of global options)\n"))
491 ui.warn(_(b"(use 'hg help -v' for a list of global options)\n"))
489 except error.UnknownCommand as inst:
492 except error.UnknownCommand as inst:
493 detailed_exit_code = 10
490 nocmdmsg = _(b"hg: unknown command '%s'\n") % inst.command
494 nocmdmsg = _(b"hg: unknown command '%s'\n") % inst.command
491 try:
495 try:
492 # check if the command is in a disabled extension
496 # check if the command is in a disabled extension
493 # (but don't check for extensions themselves)
497 # (but don't check for extensions themselves)
494 formatted = help.formattedhelp(
498 formatted = help.formattedhelp(
495 ui, commands, inst.command, unknowncmd=True
499 ui, commands, inst.command, unknowncmd=True
496 )
500 )
497 ui.warn(nocmdmsg)
501 ui.warn(nocmdmsg)
498 ui.write(formatted)
502 ui.write(formatted)
499 except (error.UnknownCommand, error.Abort):
503 except (error.UnknownCommand, error.Abort):
500 suggested = False
504 suggested = False
501 if inst.all_commands:
505 if inst.all_commands:
502 sim = error.getsimilar(inst.all_commands, inst.command)
506 sim = error.getsimilar(inst.all_commands, inst.command)
503 if sim:
507 if sim:
504 ui.warn(nocmdmsg)
508 ui.warn(nocmdmsg)
505 ui.warn(b"(%s)\n" % error.similarity_hint(sim))
509 ui.warn(b"(%s)\n" % error.similarity_hint(sim))
506 suggested = True
510 suggested = True
507 if not suggested:
511 if not suggested:
508 ui.warn(nocmdmsg)
512 ui.warn(nocmdmsg)
509 ui.warn(_(b"(use 'hg help' for a list of commands)\n"))
513 ui.warn(_(b"(use 'hg help' for a list of commands)\n"))
510 except IOError:
514 except IOError:
511 raise
515 raise
512 except KeyboardInterrupt:
516 except KeyboardInterrupt:
513 raise
517 raise
514 except: # probably re-raises
518 except: # probably re-raises
515 if not handlecommandexception(ui):
519 if not handlecommandexception(ui):
516 raise
520 raise
517
521
518 return -1
522 if ui.configbool(b'ui', b'detailed-exit-code'):
523 return detailed_exit_code
524 else:
525 return -1
519
526
520
527
521 def aliasargs(fn, givenargs):
528 def aliasargs(fn, givenargs):
522 args = []
529 args = []
523 # only care about alias 'args', ignore 'args' set by extensions.wrapfunction
530 # only care about alias 'args', ignore 'args' set by extensions.wrapfunction
524 if not util.safehasattr(fn, b'_origfunc'):
531 if not util.safehasattr(fn, b'_origfunc'):
525 args = getattr(fn, 'args', args)
532 args = getattr(fn, 'args', args)
526 if args:
533 if args:
527 cmd = b' '.join(map(procutil.shellquote, args))
534 cmd = b' '.join(map(procutil.shellquote, args))
528
535
529 nums = []
536 nums = []
530
537
531 def replacer(m):
538 def replacer(m):
532 num = int(m.group(1)) - 1
539 num = int(m.group(1)) - 1
533 nums.append(num)
540 nums.append(num)
534 if num < len(givenargs):
541 if num < len(givenargs):
535 return givenargs[num]
542 return givenargs[num]
536 raise error.InputError(_(b'too few arguments for command alias'))
543 raise error.InputError(_(b'too few arguments for command alias'))
537
544
538 cmd = re.sub(br'\$(\d+|\$)', replacer, cmd)
545 cmd = re.sub(br'\$(\d+|\$)', replacer, cmd)
539 givenargs = [x for i, x in enumerate(givenargs) if i not in nums]
546 givenargs = [x for i, x in enumerate(givenargs) if i not in nums]
540 args = pycompat.shlexsplit(cmd)
547 args = pycompat.shlexsplit(cmd)
541 return args + givenargs
548 return args + givenargs
542
549
543
550
544 def aliasinterpolate(name, args, cmd):
551 def aliasinterpolate(name, args, cmd):
545 """interpolate args into cmd for shell aliases
552 """interpolate args into cmd for shell aliases
546
553
547 This also handles $0, $@ and "$@".
554 This also handles $0, $@ and "$@".
548 """
555 """
549 # util.interpolate can't deal with "$@" (with quotes) because it's only
556 # util.interpolate can't deal with "$@" (with quotes) because it's only
550 # built to match prefix + patterns.
557 # built to match prefix + patterns.
551 replacemap = {b'$%d' % (i + 1): arg for i, arg in enumerate(args)}
558 replacemap = {b'$%d' % (i + 1): arg for i, arg in enumerate(args)}
552 replacemap[b'$0'] = name
559 replacemap[b'$0'] = name
553 replacemap[b'$$'] = b'$'
560 replacemap[b'$$'] = b'$'
554 replacemap[b'$@'] = b' '.join(args)
561 replacemap[b'$@'] = b' '.join(args)
555 # Typical Unix shells interpolate "$@" (with quotes) as all the positional
562 # Typical Unix shells interpolate "$@" (with quotes) as all the positional
556 # parameters, separated out into words. Emulate the same behavior here by
563 # parameters, separated out into words. Emulate the same behavior here by
557 # quoting the arguments individually. POSIX shells will then typically
564 # quoting the arguments individually. POSIX shells will then typically
558 # tokenize each argument into exactly one word.
565 # tokenize each argument into exactly one word.
559 replacemap[b'"$@"'] = b' '.join(procutil.shellquote(arg) for arg in args)
566 replacemap[b'"$@"'] = b' '.join(procutil.shellquote(arg) for arg in args)
560 # escape '\$' for regex
567 # escape '\$' for regex
561 regex = b'|'.join(replacemap.keys()).replace(b'$', br'\$')
568 regex = b'|'.join(replacemap.keys()).replace(b'$', br'\$')
562 r = re.compile(regex)
569 r = re.compile(regex)
563 return r.sub(lambda x: replacemap[x.group()], cmd)
570 return r.sub(lambda x: replacemap[x.group()], cmd)
564
571
565
572
566 class cmdalias(object):
573 class cmdalias(object):
567 def __init__(self, ui, name, definition, cmdtable, source):
574 def __init__(self, ui, name, definition, cmdtable, source):
568 self.name = self.cmd = name
575 self.name = self.cmd = name
569 self.cmdname = b''
576 self.cmdname = b''
570 self.definition = definition
577 self.definition = definition
571 self.fn = None
578 self.fn = None
572 self.givenargs = []
579 self.givenargs = []
573 self.opts = []
580 self.opts = []
574 self.help = b''
581 self.help = b''
575 self.badalias = None
582 self.badalias = None
576 self.unknowncmd = False
583 self.unknowncmd = False
577 self.source = source
584 self.source = source
578
585
579 try:
586 try:
580 aliases, entry = cmdutil.findcmd(self.name, cmdtable)
587 aliases, entry = cmdutil.findcmd(self.name, cmdtable)
581 for alias, e in pycompat.iteritems(cmdtable):
588 for alias, e in pycompat.iteritems(cmdtable):
582 if e is entry:
589 if e is entry:
583 self.cmd = alias
590 self.cmd = alias
584 break
591 break
585 self.shadows = True
592 self.shadows = True
586 except error.UnknownCommand:
593 except error.UnknownCommand:
587 self.shadows = False
594 self.shadows = False
588
595
589 if not self.definition:
596 if not self.definition:
590 self.badalias = _(b"no definition for alias '%s'") % self.name
597 self.badalias = _(b"no definition for alias '%s'") % self.name
591 return
598 return
592
599
593 if self.definition.startswith(b'!'):
600 if self.definition.startswith(b'!'):
594 shdef = self.definition[1:]
601 shdef = self.definition[1:]
595 self.shell = True
602 self.shell = True
596
603
597 def fn(ui, *args):
604 def fn(ui, *args):
598 env = {b'HG_ARGS': b' '.join((self.name,) + args)}
605 env = {b'HG_ARGS': b' '.join((self.name,) + args)}
599
606
600 def _checkvar(m):
607 def _checkvar(m):
601 if m.groups()[0] == b'$':
608 if m.groups()[0] == b'$':
602 return m.group()
609 return m.group()
603 elif int(m.groups()[0]) <= len(args):
610 elif int(m.groups()[0]) <= len(args):
604 return m.group()
611 return m.group()
605 else:
612 else:
606 ui.debug(
613 ui.debug(
607 b"No argument found for substitution "
614 b"No argument found for substitution "
608 b"of %i variable in alias '%s' definition.\n"
615 b"of %i variable in alias '%s' definition.\n"
609 % (int(m.groups()[0]), self.name)
616 % (int(m.groups()[0]), self.name)
610 )
617 )
611 return b''
618 return b''
612
619
613 cmd = re.sub(br'\$(\d+|\$)', _checkvar, shdef)
620 cmd = re.sub(br'\$(\d+|\$)', _checkvar, shdef)
614 cmd = aliasinterpolate(self.name, args, cmd)
621 cmd = aliasinterpolate(self.name, args, cmd)
615 return ui.system(
622 return ui.system(
616 cmd, environ=env, blockedtag=b'alias_%s' % self.name
623 cmd, environ=env, blockedtag=b'alias_%s' % self.name
617 )
624 )
618
625
619 self.fn = fn
626 self.fn = fn
620 self.alias = True
627 self.alias = True
621 self._populatehelp(ui, name, shdef, self.fn)
628 self._populatehelp(ui, name, shdef, self.fn)
622 return
629 return
623
630
624 try:
631 try:
625 args = pycompat.shlexsplit(self.definition)
632 args = pycompat.shlexsplit(self.definition)
626 except ValueError as inst:
633 except ValueError as inst:
627 self.badalias = _(b"error in definition for alias '%s': %s") % (
634 self.badalias = _(b"error in definition for alias '%s': %s") % (
628 self.name,
635 self.name,
629 stringutil.forcebytestr(inst),
636 stringutil.forcebytestr(inst),
630 )
637 )
631 return
638 return
632 earlyopts, args = _earlysplitopts(args)
639 earlyopts, args = _earlysplitopts(args)
633 if earlyopts:
640 if earlyopts:
634 self.badalias = _(
641 self.badalias = _(
635 b"error in definition for alias '%s': %s may "
642 b"error in definition for alias '%s': %s may "
636 b"only be given on the command line"
643 b"only be given on the command line"
637 ) % (self.name, b'/'.join(pycompat.ziplist(*earlyopts)[0]))
644 ) % (self.name, b'/'.join(pycompat.ziplist(*earlyopts)[0]))
638 return
645 return
639 self.cmdname = cmd = args.pop(0)
646 self.cmdname = cmd = args.pop(0)
640 self.givenargs = args
647 self.givenargs = args
641
648
642 try:
649 try:
643 tableentry = cmdutil.findcmd(cmd, cmdtable, False)[1]
650 tableentry = cmdutil.findcmd(cmd, cmdtable, False)[1]
644 if len(tableentry) > 2:
651 if len(tableentry) > 2:
645 self.fn, self.opts, cmdhelp = tableentry
652 self.fn, self.opts, cmdhelp = tableentry
646 else:
653 else:
647 self.fn, self.opts = tableentry
654 self.fn, self.opts = tableentry
648 cmdhelp = None
655 cmdhelp = None
649
656
650 self.alias = True
657 self.alias = True
651 self._populatehelp(ui, name, cmd, self.fn, cmdhelp)
658 self._populatehelp(ui, name, cmd, self.fn, cmdhelp)
652
659
653 except error.UnknownCommand:
660 except error.UnknownCommand:
654 self.badalias = _(
661 self.badalias = _(
655 b"alias '%s' resolves to unknown command '%s'"
662 b"alias '%s' resolves to unknown command '%s'"
656 ) % (
663 ) % (
657 self.name,
664 self.name,
658 cmd,
665 cmd,
659 )
666 )
660 self.unknowncmd = True
667 self.unknowncmd = True
661 except error.AmbiguousCommand:
668 except error.AmbiguousCommand:
662 self.badalias = _(
669 self.badalias = _(
663 b"alias '%s' resolves to ambiguous command '%s'"
670 b"alias '%s' resolves to ambiguous command '%s'"
664 ) % (
671 ) % (
665 self.name,
672 self.name,
666 cmd,
673 cmd,
667 )
674 )
668
675
669 def _populatehelp(self, ui, name, cmd, fn, defaulthelp=None):
676 def _populatehelp(self, ui, name, cmd, fn, defaulthelp=None):
670 # confine strings to be passed to i18n.gettext()
677 # confine strings to be passed to i18n.gettext()
671 cfg = {}
678 cfg = {}
672 for k in (b'doc', b'help', b'category'):
679 for k in (b'doc', b'help', b'category'):
673 v = ui.config(b'alias', b'%s:%s' % (name, k), None)
680 v = ui.config(b'alias', b'%s:%s' % (name, k), None)
674 if v is None:
681 if v is None:
675 continue
682 continue
676 if not encoding.isasciistr(v):
683 if not encoding.isasciistr(v):
677 self.badalias = _(
684 self.badalias = _(
678 b"non-ASCII character in alias definition '%s:%s'"
685 b"non-ASCII character in alias definition '%s:%s'"
679 ) % (name, k)
686 ) % (name, k)
680 return
687 return
681 cfg[k] = v
688 cfg[k] = v
682
689
683 self.help = cfg.get(b'help', defaulthelp or b'')
690 self.help = cfg.get(b'help', defaulthelp or b'')
684 if self.help and self.help.startswith(b"hg " + cmd):
691 if self.help and self.help.startswith(b"hg " + cmd):
685 # drop prefix in old-style help lines so hg shows the alias
692 # drop prefix in old-style help lines so hg shows the alias
686 self.help = self.help[4 + len(cmd) :]
693 self.help = self.help[4 + len(cmd) :]
687
694
688 self.owndoc = b'doc' in cfg
695 self.owndoc = b'doc' in cfg
689 doc = cfg.get(b'doc', pycompat.getdoc(fn))
696 doc = cfg.get(b'doc', pycompat.getdoc(fn))
690 if doc is not None:
697 if doc is not None:
691 doc = pycompat.sysstr(doc)
698 doc = pycompat.sysstr(doc)
692 self.__doc__ = doc
699 self.__doc__ = doc
693
700
694 self.helpcategory = cfg.get(
701 self.helpcategory = cfg.get(
695 b'category', registrar.command.CATEGORY_NONE
702 b'category', registrar.command.CATEGORY_NONE
696 )
703 )
697
704
698 @property
705 @property
699 def args(self):
706 def args(self):
700 args = pycompat.maplist(util.expandpath, self.givenargs)
707 args = pycompat.maplist(util.expandpath, self.givenargs)
701 return aliasargs(self.fn, args)
708 return aliasargs(self.fn, args)
702
709
703 def __getattr__(self, name):
710 def __getattr__(self, name):
704 adefaults = {
711 adefaults = {
705 'norepo': True,
712 'norepo': True,
706 'intents': set(),
713 'intents': set(),
707 'optionalrepo': False,
714 'optionalrepo': False,
708 'inferrepo': False,
715 'inferrepo': False,
709 }
716 }
710 if name not in adefaults:
717 if name not in adefaults:
711 raise AttributeError(name)
718 raise AttributeError(name)
712 if self.badalias or util.safehasattr(self, b'shell'):
719 if self.badalias or util.safehasattr(self, b'shell'):
713 return adefaults[name]
720 return adefaults[name]
714 return getattr(self.fn, name)
721 return getattr(self.fn, name)
715
722
716 def __call__(self, ui, *args, **opts):
723 def __call__(self, ui, *args, **opts):
717 if self.badalias:
724 if self.badalias:
718 hint = None
725 hint = None
719 if self.unknowncmd:
726 if self.unknowncmd:
720 try:
727 try:
721 # check if the command is in a disabled extension
728 # check if the command is in a disabled extension
722 cmd, ext = extensions.disabledcmd(ui, self.cmdname)[:2]
729 cmd, ext = extensions.disabledcmd(ui, self.cmdname)[:2]
723 hint = _(b"'%s' is provided by '%s' extension") % (cmd, ext)
730 hint = _(b"'%s' is provided by '%s' extension") % (cmd, ext)
724 except error.UnknownCommand:
731 except error.UnknownCommand:
725 pass
732 pass
726 raise error.ConfigError(self.badalias, hint=hint)
733 raise error.ConfigError(self.badalias, hint=hint)
727 if self.shadows:
734 if self.shadows:
728 ui.debug(
735 ui.debug(
729 b"alias '%s' shadows command '%s'\n" % (self.name, self.cmdname)
736 b"alias '%s' shadows command '%s'\n" % (self.name, self.cmdname)
730 )
737 )
731
738
732 ui.log(
739 ui.log(
733 b'commandalias',
740 b'commandalias',
734 b"alias '%s' expands to '%s'\n",
741 b"alias '%s' expands to '%s'\n",
735 self.name,
742 self.name,
736 self.definition,
743 self.definition,
737 )
744 )
738 if util.safehasattr(self, b'shell'):
745 if util.safehasattr(self, b'shell'):
739 return self.fn(ui, *args, **opts)
746 return self.fn(ui, *args, **opts)
740 else:
747 else:
741 try:
748 try:
742 return util.checksignature(self.fn)(ui, *args, **opts)
749 return util.checksignature(self.fn)(ui, *args, **opts)
743 except error.SignatureError:
750 except error.SignatureError:
744 args = b' '.join([self.cmdname] + self.args)
751 args = b' '.join([self.cmdname] + self.args)
745 ui.debug(b"alias '%s' expands to '%s'\n" % (self.name, args))
752 ui.debug(b"alias '%s' expands to '%s'\n" % (self.name, args))
746 raise
753 raise
747
754
748
755
749 class lazyaliasentry(object):
756 class lazyaliasentry(object):
750 """like a typical command entry (func, opts, help), but is lazy"""
757 """like a typical command entry (func, opts, help), but is lazy"""
751
758
752 def __init__(self, ui, name, definition, cmdtable, source):
759 def __init__(self, ui, name, definition, cmdtable, source):
753 self.ui = ui
760 self.ui = ui
754 self.name = name
761 self.name = name
755 self.definition = definition
762 self.definition = definition
756 self.cmdtable = cmdtable.copy()
763 self.cmdtable = cmdtable.copy()
757 self.source = source
764 self.source = source
758 self.alias = True
765 self.alias = True
759
766
760 @util.propertycache
767 @util.propertycache
761 def _aliasdef(self):
768 def _aliasdef(self):
762 return cmdalias(
769 return cmdalias(
763 self.ui, self.name, self.definition, self.cmdtable, self.source
770 self.ui, self.name, self.definition, self.cmdtable, self.source
764 )
771 )
765
772
766 def __getitem__(self, n):
773 def __getitem__(self, n):
767 aliasdef = self._aliasdef
774 aliasdef = self._aliasdef
768 if n == 0:
775 if n == 0:
769 return aliasdef
776 return aliasdef
770 elif n == 1:
777 elif n == 1:
771 return aliasdef.opts
778 return aliasdef.opts
772 elif n == 2:
779 elif n == 2:
773 return aliasdef.help
780 return aliasdef.help
774 else:
781 else:
775 raise IndexError
782 raise IndexError
776
783
777 def __iter__(self):
784 def __iter__(self):
778 for i in range(3):
785 for i in range(3):
779 yield self[i]
786 yield self[i]
780
787
781 def __len__(self):
788 def __len__(self):
782 return 3
789 return 3
783
790
784
791
785 def addaliases(ui, cmdtable):
792 def addaliases(ui, cmdtable):
786 # aliases are processed after extensions have been loaded, so they
793 # aliases are processed after extensions have been loaded, so they
787 # may use extension commands. Aliases can also use other alias definitions,
794 # may use extension commands. Aliases can also use other alias definitions,
788 # but only if they have been defined prior to the current definition.
795 # but only if they have been defined prior to the current definition.
789 for alias, definition in ui.configitems(b'alias', ignoresub=True):
796 for alias, definition in ui.configitems(b'alias', ignoresub=True):
790 try:
797 try:
791 if cmdtable[alias].definition == definition:
798 if cmdtable[alias].definition == definition:
792 continue
799 continue
793 except (KeyError, AttributeError):
800 except (KeyError, AttributeError):
794 # definition might not exist or it might not be a cmdalias
801 # definition might not exist or it might not be a cmdalias
795 pass
802 pass
796
803
797 source = ui.configsource(b'alias', alias)
804 source = ui.configsource(b'alias', alias)
798 entry = lazyaliasentry(ui, alias, definition, cmdtable, source)
805 entry = lazyaliasentry(ui, alias, definition, cmdtable, source)
799 cmdtable[alias] = entry
806 cmdtable[alias] = entry
800
807
801
808
802 def _parse(ui, args):
809 def _parse(ui, args):
803 options = {}
810 options = {}
804 cmdoptions = {}
811 cmdoptions = {}
805
812
806 try:
813 try:
807 args = fancyopts.fancyopts(args, commands.globalopts, options)
814 args = fancyopts.fancyopts(args, commands.globalopts, options)
808 except getopt.GetoptError as inst:
815 except getopt.GetoptError as inst:
809 raise error.CommandError(None, stringutil.forcebytestr(inst))
816 raise error.CommandError(None, stringutil.forcebytestr(inst))
810
817
811 if args:
818 if args:
812 cmd, args = args[0], args[1:]
819 cmd, args = args[0], args[1:]
813 aliases, entry = cmdutil.findcmd(
820 aliases, entry = cmdutil.findcmd(
814 cmd, commands.table, ui.configbool(b"ui", b"strict")
821 cmd, commands.table, ui.configbool(b"ui", b"strict")
815 )
822 )
816 cmd = aliases[0]
823 cmd = aliases[0]
817 args = aliasargs(entry[0], args)
824 args = aliasargs(entry[0], args)
818 defaults = ui.config(b"defaults", cmd)
825 defaults = ui.config(b"defaults", cmd)
819 if defaults:
826 if defaults:
820 args = (
827 args = (
821 pycompat.maplist(util.expandpath, pycompat.shlexsplit(defaults))
828 pycompat.maplist(util.expandpath, pycompat.shlexsplit(defaults))
822 + args
829 + args
823 )
830 )
824 c = list(entry[1])
831 c = list(entry[1])
825 else:
832 else:
826 cmd = None
833 cmd = None
827 c = []
834 c = []
828
835
829 # combine global options into local
836 # combine global options into local
830 for o in commands.globalopts:
837 for o in commands.globalopts:
831 c.append((o[0], o[1], options[o[1]], o[3]))
838 c.append((o[0], o[1], options[o[1]], o[3]))
832
839
833 try:
840 try:
834 args = fancyopts.fancyopts(args, c, cmdoptions, gnu=True)
841 args = fancyopts.fancyopts(args, c, cmdoptions, gnu=True)
835 except getopt.GetoptError as inst:
842 except getopt.GetoptError as inst:
836 raise error.CommandError(cmd, stringutil.forcebytestr(inst))
843 raise error.CommandError(cmd, stringutil.forcebytestr(inst))
837
844
838 # separate global options back out
845 # separate global options back out
839 for o in commands.globalopts:
846 for o in commands.globalopts:
840 n = o[1]
847 n = o[1]
841 options[n] = cmdoptions[n]
848 options[n] = cmdoptions[n]
842 del cmdoptions[n]
849 del cmdoptions[n]
843
850
844 return (cmd, cmd and entry[0] or None, args, options, cmdoptions)
851 return (cmd, cmd and entry[0] or None, args, options, cmdoptions)
845
852
846
853
847 def _parseconfig(ui, config):
854 def _parseconfig(ui, config):
848 """parse the --config options from the command line"""
855 """parse the --config options from the command line"""
849 configs = []
856 configs = []
850
857
851 for cfg in config:
858 for cfg in config:
852 try:
859 try:
853 name, value = [cfgelem.strip() for cfgelem in cfg.split(b'=', 1)]
860 name, value = [cfgelem.strip() for cfgelem in cfg.split(b'=', 1)]
854 section, name = name.split(b'.', 1)
861 section, name = name.split(b'.', 1)
855 if not section or not name:
862 if not section or not name:
856 raise IndexError
863 raise IndexError
857 ui.setconfig(section, name, value, b'--config')
864 ui.setconfig(section, name, value, b'--config')
858 configs.append((section, name, value))
865 configs.append((section, name, value))
859 except (IndexError, ValueError):
866 except (IndexError, ValueError):
860 raise error.InputError(
867 raise error.InputError(
861 _(
868 _(
862 b'malformed --config option: %r '
869 b'malformed --config option: %r '
863 b'(use --config section.name=value)'
870 b'(use --config section.name=value)'
864 )
871 )
865 % pycompat.bytestr(cfg)
872 % pycompat.bytestr(cfg)
866 )
873 )
867
874
868 return configs
875 return configs
869
876
870
877
871 def _earlyparseopts(ui, args):
878 def _earlyparseopts(ui, args):
872 options = {}
879 options = {}
873 fancyopts.fancyopts(
880 fancyopts.fancyopts(
874 args,
881 args,
875 commands.globalopts,
882 commands.globalopts,
876 options,
883 options,
877 gnu=not ui.plain(b'strictflags'),
884 gnu=not ui.plain(b'strictflags'),
878 early=True,
885 early=True,
879 optaliases={b'repository': [b'repo']},
886 optaliases={b'repository': [b'repo']},
880 )
887 )
881 return options
888 return options
882
889
883
890
884 def _earlysplitopts(args):
891 def _earlysplitopts(args):
885 """Split args into a list of possible early options and remainder args"""
892 """Split args into a list of possible early options and remainder args"""
886 shortoptions = b'R:'
893 shortoptions = b'R:'
887 # TODO: perhaps 'debugger' should be included
894 # TODO: perhaps 'debugger' should be included
888 longoptions = [b'cwd=', b'repository=', b'repo=', b'config=']
895 longoptions = [b'cwd=', b'repository=', b'repo=', b'config=']
889 return fancyopts.earlygetopt(
896 return fancyopts.earlygetopt(
890 args, shortoptions, longoptions, gnu=True, keepsep=True
897 args, shortoptions, longoptions, gnu=True, keepsep=True
891 )
898 )
892
899
893
900
894 def runcommand(lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions):
901 def runcommand(lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions):
895 # run pre-hook, and abort if it fails
902 # run pre-hook, and abort if it fails
896 hook.hook(
903 hook.hook(
897 lui,
904 lui,
898 repo,
905 repo,
899 b"pre-%s" % cmd,
906 b"pre-%s" % cmd,
900 True,
907 True,
901 args=b" ".join(fullargs),
908 args=b" ".join(fullargs),
902 pats=cmdpats,
909 pats=cmdpats,
903 opts=cmdoptions,
910 opts=cmdoptions,
904 )
911 )
905 try:
912 try:
906 ret = _runcommand(ui, options, cmd, d)
913 ret = _runcommand(ui, options, cmd, d)
907 # run post-hook, passing command result
914 # run post-hook, passing command result
908 hook.hook(
915 hook.hook(
909 lui,
916 lui,
910 repo,
917 repo,
911 b"post-%s" % cmd,
918 b"post-%s" % cmd,
912 False,
919 False,
913 args=b" ".join(fullargs),
920 args=b" ".join(fullargs),
914 result=ret,
921 result=ret,
915 pats=cmdpats,
922 pats=cmdpats,
916 opts=cmdoptions,
923 opts=cmdoptions,
917 )
924 )
918 except Exception:
925 except Exception:
919 # run failure hook and re-raise
926 # run failure hook and re-raise
920 hook.hook(
927 hook.hook(
921 lui,
928 lui,
922 repo,
929 repo,
923 b"fail-%s" % cmd,
930 b"fail-%s" % cmd,
924 False,
931 False,
925 args=b" ".join(fullargs),
932 args=b" ".join(fullargs),
926 pats=cmdpats,
933 pats=cmdpats,
927 opts=cmdoptions,
934 opts=cmdoptions,
928 )
935 )
929 raise
936 raise
930 return ret
937 return ret
931
938
932
939
933 def _readsharedsourceconfig(ui, path):
940 def _readsharedsourceconfig(ui, path):
934 """if the current repository is shared one, this tries to read
941 """if the current repository is shared one, this tries to read
935 .hg/hgrc of shared source if we are in share-safe mode
942 .hg/hgrc of shared source if we are in share-safe mode
936
943
937 Config read is loaded into the ui object passed
944 Config read is loaded into the ui object passed
938
945
939 This should be called before reading .hg/hgrc or the main repo
946 This should be called before reading .hg/hgrc or the main repo
940 as that overrides config set in shared source"""
947 as that overrides config set in shared source"""
941 try:
948 try:
942 with open(os.path.join(path, b".hg", b"requires"), "rb") as fp:
949 with open(os.path.join(path, b".hg", b"requires"), "rb") as fp:
943 requirements = set(fp.read().splitlines())
950 requirements = set(fp.read().splitlines())
944 if not (
951 if not (
945 requirementsmod.SHARESAFE_REQUIREMENT in requirements
952 requirementsmod.SHARESAFE_REQUIREMENT in requirements
946 and requirementsmod.SHARED_REQUIREMENT in requirements
953 and requirementsmod.SHARED_REQUIREMENT in requirements
947 ):
954 ):
948 return
955 return
949 hgvfs = vfs.vfs(os.path.join(path, b".hg"))
956 hgvfs = vfs.vfs(os.path.join(path, b".hg"))
950 sharedvfs = localrepo._getsharedvfs(hgvfs, requirements)
957 sharedvfs = localrepo._getsharedvfs(hgvfs, requirements)
951 root = sharedvfs.base
958 root = sharedvfs.base
952 ui.readconfig(sharedvfs.join(b"hgrc"), root)
959 ui.readconfig(sharedvfs.join(b"hgrc"), root)
953 except IOError:
960 except IOError:
954 pass
961 pass
955
962
956
963
957 def _getlocal(ui, rpath, wd=None):
964 def _getlocal(ui, rpath, wd=None):
958 """Return (path, local ui object) for the given target path.
965 """Return (path, local ui object) for the given target path.
959
966
960 Takes paths in [cwd]/.hg/hgrc into account."
967 Takes paths in [cwd]/.hg/hgrc into account."
961 """
968 """
962 if wd is None:
969 if wd is None:
963 try:
970 try:
964 wd = encoding.getcwd()
971 wd = encoding.getcwd()
965 except OSError as e:
972 except OSError as e:
966 raise error.Abort(
973 raise error.Abort(
967 _(b"error getting current working directory: %s")
974 _(b"error getting current working directory: %s")
968 % encoding.strtolocal(e.strerror)
975 % encoding.strtolocal(e.strerror)
969 )
976 )
970
977
971 path = cmdutil.findrepo(wd) or b""
978 path = cmdutil.findrepo(wd) or b""
972 if not path:
979 if not path:
973 lui = ui
980 lui = ui
974 else:
981 else:
975 lui = ui.copy()
982 lui = ui.copy()
976 if rcutil.use_repo_hgrc():
983 if rcutil.use_repo_hgrc():
977 _readsharedsourceconfig(lui, path)
984 _readsharedsourceconfig(lui, path)
978 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path)
985 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path)
979 lui.readconfig(os.path.join(path, b".hg", b"hgrc-not-shared"), path)
986 lui.readconfig(os.path.join(path, b".hg", b"hgrc-not-shared"), path)
980
987
981 if rpath:
988 if rpath:
982 path = lui.expandpath(rpath)
989 path = lui.expandpath(rpath)
983 lui = ui.copy()
990 lui = ui.copy()
984 if rcutil.use_repo_hgrc():
991 if rcutil.use_repo_hgrc():
985 _readsharedsourceconfig(lui, path)
992 _readsharedsourceconfig(lui, path)
986 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path)
993 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path)
987 lui.readconfig(os.path.join(path, b".hg", b"hgrc-not-shared"), path)
994 lui.readconfig(os.path.join(path, b".hg", b"hgrc-not-shared"), path)
988
995
989 return path, lui
996 return path, lui
990
997
991
998
992 def _checkshellalias(lui, ui, args):
999 def _checkshellalias(lui, ui, args):
993 """Return the function to run the shell alias, if it is required"""
1000 """Return the function to run the shell alias, if it is required"""
994 options = {}
1001 options = {}
995
1002
996 try:
1003 try:
997 args = fancyopts.fancyopts(args, commands.globalopts, options)
1004 args = fancyopts.fancyopts(args, commands.globalopts, options)
998 except getopt.GetoptError:
1005 except getopt.GetoptError:
999 return
1006 return
1000
1007
1001 if not args:
1008 if not args:
1002 return
1009 return
1003
1010
1004 cmdtable = commands.table
1011 cmdtable = commands.table
1005
1012
1006 cmd = args[0]
1013 cmd = args[0]
1007 try:
1014 try:
1008 strict = ui.configbool(b"ui", b"strict")
1015 strict = ui.configbool(b"ui", b"strict")
1009 aliases, entry = cmdutil.findcmd(cmd, cmdtable, strict)
1016 aliases, entry = cmdutil.findcmd(cmd, cmdtable, strict)
1010 except (error.AmbiguousCommand, error.UnknownCommand):
1017 except (error.AmbiguousCommand, error.UnknownCommand):
1011 return
1018 return
1012
1019
1013 cmd = aliases[0]
1020 cmd = aliases[0]
1014 fn = entry[0]
1021 fn = entry[0]
1015
1022
1016 if cmd and util.safehasattr(fn, b'shell'):
1023 if cmd and util.safehasattr(fn, b'shell'):
1017 # shell alias shouldn't receive early options which are consumed by hg
1024 # shell alias shouldn't receive early options which are consumed by hg
1018 _earlyopts, args = _earlysplitopts(args)
1025 _earlyopts, args = _earlysplitopts(args)
1019 d = lambda: fn(ui, *args[1:])
1026 d = lambda: fn(ui, *args[1:])
1020 return lambda: runcommand(
1027 return lambda: runcommand(
1021 lui, None, cmd, args[:1], ui, options, d, [], {}
1028 lui, None, cmd, args[:1], ui, options, d, [], {}
1022 )
1029 )
1023
1030
1024
1031
1025 def _dispatch(req):
1032 def _dispatch(req):
1026 args = req.args
1033 args = req.args
1027 ui = req.ui
1034 ui = req.ui
1028
1035
1029 # check for cwd
1036 # check for cwd
1030 cwd = req.earlyoptions[b'cwd']
1037 cwd = req.earlyoptions[b'cwd']
1031 if cwd:
1038 if cwd:
1032 os.chdir(cwd)
1039 os.chdir(cwd)
1033
1040
1034 rpath = req.earlyoptions[b'repository']
1041 rpath = req.earlyoptions[b'repository']
1035 path, lui = _getlocal(ui, rpath)
1042 path, lui = _getlocal(ui, rpath)
1036
1043
1037 uis = {ui, lui}
1044 uis = {ui, lui}
1038
1045
1039 if req.repo:
1046 if req.repo:
1040 uis.add(req.repo.ui)
1047 uis.add(req.repo.ui)
1041
1048
1042 if (
1049 if (
1043 req.earlyoptions[b'verbose']
1050 req.earlyoptions[b'verbose']
1044 or req.earlyoptions[b'debug']
1051 or req.earlyoptions[b'debug']
1045 or req.earlyoptions[b'quiet']
1052 or req.earlyoptions[b'quiet']
1046 ):
1053 ):
1047 for opt in (b'verbose', b'debug', b'quiet'):
1054 for opt in (b'verbose', b'debug', b'quiet'):
1048 val = pycompat.bytestr(bool(req.earlyoptions[opt]))
1055 val = pycompat.bytestr(bool(req.earlyoptions[opt]))
1049 for ui_ in uis:
1056 for ui_ in uis:
1050 ui_.setconfig(b'ui', opt, val, b'--' + opt)
1057 ui_.setconfig(b'ui', opt, val, b'--' + opt)
1051
1058
1052 if req.earlyoptions[b'profile']:
1059 if req.earlyoptions[b'profile']:
1053 for ui_ in uis:
1060 for ui_ in uis:
1054 ui_.setconfig(b'profiling', b'enabled', b'true', b'--profile')
1061 ui_.setconfig(b'profiling', b'enabled', b'true', b'--profile')
1055
1062
1056 profile = lui.configbool(b'profiling', b'enabled')
1063 profile = lui.configbool(b'profiling', b'enabled')
1057 with profiling.profile(lui, enabled=profile) as profiler:
1064 with profiling.profile(lui, enabled=profile) as profiler:
1058 # Configure extensions in phases: uisetup, extsetup, cmdtable, and
1065 # Configure extensions in phases: uisetup, extsetup, cmdtable, and
1059 # reposetup
1066 # reposetup
1060 extensions.loadall(lui)
1067 extensions.loadall(lui)
1061 # Propagate any changes to lui.__class__ by extensions
1068 # Propagate any changes to lui.__class__ by extensions
1062 ui.__class__ = lui.__class__
1069 ui.__class__ = lui.__class__
1063
1070
1064 # (uisetup and extsetup are handled in extensions.loadall)
1071 # (uisetup and extsetup are handled in extensions.loadall)
1065
1072
1066 # (reposetup is handled in hg.repository)
1073 # (reposetup is handled in hg.repository)
1067
1074
1068 addaliases(lui, commands.table)
1075 addaliases(lui, commands.table)
1069
1076
1070 # All aliases and commands are completely defined, now.
1077 # All aliases and commands are completely defined, now.
1071 # Check abbreviation/ambiguity of shell alias.
1078 # Check abbreviation/ambiguity of shell alias.
1072 shellaliasfn = _checkshellalias(lui, ui, args)
1079 shellaliasfn = _checkshellalias(lui, ui, args)
1073 if shellaliasfn:
1080 if shellaliasfn:
1074 # no additional configs will be set, set up the ui instances
1081 # no additional configs will be set, set up the ui instances
1075 for ui_ in uis:
1082 for ui_ in uis:
1076 extensions.populateui(ui_)
1083 extensions.populateui(ui_)
1077 return shellaliasfn()
1084 return shellaliasfn()
1078
1085
1079 # check for fallback encoding
1086 # check for fallback encoding
1080 fallback = lui.config(b'ui', b'fallbackencoding')
1087 fallback = lui.config(b'ui', b'fallbackencoding')
1081 if fallback:
1088 if fallback:
1082 encoding.fallbackencoding = fallback
1089 encoding.fallbackencoding = fallback
1083
1090
1084 fullargs = args
1091 fullargs = args
1085 cmd, func, args, options, cmdoptions = _parse(lui, args)
1092 cmd, func, args, options, cmdoptions = _parse(lui, args)
1086
1093
1087 # store the canonical command name in request object for later access
1094 # store the canonical command name in request object for later access
1088 req.canonical_command = cmd
1095 req.canonical_command = cmd
1089
1096
1090 if options[b"config"] != req.earlyoptions[b"config"]:
1097 if options[b"config"] != req.earlyoptions[b"config"]:
1091 raise error.InputError(_(b"option --config may not be abbreviated"))
1098 raise error.InputError(_(b"option --config may not be abbreviated"))
1092 if options[b"cwd"] != req.earlyoptions[b"cwd"]:
1099 if options[b"cwd"] != req.earlyoptions[b"cwd"]:
1093 raise error.InputError(_(b"option --cwd may not be abbreviated"))
1100 raise error.InputError(_(b"option --cwd may not be abbreviated"))
1094 if options[b"repository"] != req.earlyoptions[b"repository"]:
1101 if options[b"repository"] != req.earlyoptions[b"repository"]:
1095 raise error.InputError(
1102 raise error.InputError(
1096 _(
1103 _(
1097 b"option -R has to be separated from other options (e.g. not "
1104 b"option -R has to be separated from other options (e.g. not "
1098 b"-qR) and --repository may only be abbreviated as --repo"
1105 b"-qR) and --repository may only be abbreviated as --repo"
1099 )
1106 )
1100 )
1107 )
1101 if options[b"debugger"] != req.earlyoptions[b"debugger"]:
1108 if options[b"debugger"] != req.earlyoptions[b"debugger"]:
1102 raise error.InputError(
1109 raise error.InputError(
1103 _(b"option --debugger may not be abbreviated")
1110 _(b"option --debugger may not be abbreviated")
1104 )
1111 )
1105 # don't validate --profile/--traceback, which can be enabled from now
1112 # don't validate --profile/--traceback, which can be enabled from now
1106
1113
1107 if options[b"encoding"]:
1114 if options[b"encoding"]:
1108 encoding.encoding = options[b"encoding"]
1115 encoding.encoding = options[b"encoding"]
1109 if options[b"encodingmode"]:
1116 if options[b"encodingmode"]:
1110 encoding.encodingmode = options[b"encodingmode"]
1117 encoding.encodingmode = options[b"encodingmode"]
1111 if options[b"time"]:
1118 if options[b"time"]:
1112
1119
1113 def get_times():
1120 def get_times():
1114 t = os.times()
1121 t = os.times()
1115 if t[4] == 0.0:
1122 if t[4] == 0.0:
1116 # Windows leaves this as zero, so use time.perf_counter()
1123 # Windows leaves this as zero, so use time.perf_counter()
1117 t = (t[0], t[1], t[2], t[3], util.timer())
1124 t = (t[0], t[1], t[2], t[3], util.timer())
1118 return t
1125 return t
1119
1126
1120 s = get_times()
1127 s = get_times()
1121
1128
1122 def print_time():
1129 def print_time():
1123 t = get_times()
1130 t = get_times()
1124 ui.warn(
1131 ui.warn(
1125 _(b"time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n")
1132 _(b"time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n")
1126 % (
1133 % (
1127 t[4] - s[4],
1134 t[4] - s[4],
1128 t[0] - s[0],
1135 t[0] - s[0],
1129 t[2] - s[2],
1136 t[2] - s[2],
1130 t[1] - s[1],
1137 t[1] - s[1],
1131 t[3] - s[3],
1138 t[3] - s[3],
1132 )
1139 )
1133 )
1140 )
1134
1141
1135 ui.atexit(print_time)
1142 ui.atexit(print_time)
1136 if options[b"profile"]:
1143 if options[b"profile"]:
1137 profiler.start()
1144 profiler.start()
1138
1145
1139 # if abbreviated version of this were used, take them in account, now
1146 # if abbreviated version of this were used, take them in account, now
1140 if options[b'verbose'] or options[b'debug'] or options[b'quiet']:
1147 if options[b'verbose'] or options[b'debug'] or options[b'quiet']:
1141 for opt in (b'verbose', b'debug', b'quiet'):
1148 for opt in (b'verbose', b'debug', b'quiet'):
1142 if options[opt] == req.earlyoptions[opt]:
1149 if options[opt] == req.earlyoptions[opt]:
1143 continue
1150 continue
1144 val = pycompat.bytestr(bool(options[opt]))
1151 val = pycompat.bytestr(bool(options[opt]))
1145 for ui_ in uis:
1152 for ui_ in uis:
1146 ui_.setconfig(b'ui', opt, val, b'--' + opt)
1153 ui_.setconfig(b'ui', opt, val, b'--' + opt)
1147
1154
1148 if options[b'traceback']:
1155 if options[b'traceback']:
1149 for ui_ in uis:
1156 for ui_ in uis:
1150 ui_.setconfig(b'ui', b'traceback', b'on', b'--traceback')
1157 ui_.setconfig(b'ui', b'traceback', b'on', b'--traceback')
1151
1158
1152 if options[b'noninteractive']:
1159 if options[b'noninteractive']:
1153 for ui_ in uis:
1160 for ui_ in uis:
1154 ui_.setconfig(b'ui', b'interactive', b'off', b'-y')
1161 ui_.setconfig(b'ui', b'interactive', b'off', b'-y')
1155
1162
1156 if cmdoptions.get(b'insecure', False):
1163 if cmdoptions.get(b'insecure', False):
1157 for ui_ in uis:
1164 for ui_ in uis:
1158 ui_.insecureconnections = True
1165 ui_.insecureconnections = True
1159
1166
1160 # setup color handling before pager, because setting up pager
1167 # setup color handling before pager, because setting up pager
1161 # might cause incorrect console information
1168 # might cause incorrect console information
1162 coloropt = options[b'color']
1169 coloropt = options[b'color']
1163 for ui_ in uis:
1170 for ui_ in uis:
1164 if coloropt:
1171 if coloropt:
1165 ui_.setconfig(b'ui', b'color', coloropt, b'--color')
1172 ui_.setconfig(b'ui', b'color', coloropt, b'--color')
1166 color.setup(ui_)
1173 color.setup(ui_)
1167
1174
1168 if stringutil.parsebool(options[b'pager']):
1175 if stringutil.parsebool(options[b'pager']):
1169 # ui.pager() expects 'internal-always-' prefix in this case
1176 # ui.pager() expects 'internal-always-' prefix in this case
1170 ui.pager(b'internal-always-' + cmd)
1177 ui.pager(b'internal-always-' + cmd)
1171 elif options[b'pager'] != b'auto':
1178 elif options[b'pager'] != b'auto':
1172 for ui_ in uis:
1179 for ui_ in uis:
1173 ui_.disablepager()
1180 ui_.disablepager()
1174
1181
1175 # configs are fully loaded, set up the ui instances
1182 # configs are fully loaded, set up the ui instances
1176 for ui_ in uis:
1183 for ui_ in uis:
1177 extensions.populateui(ui_)
1184 extensions.populateui(ui_)
1178
1185
1179 if options[b'version']:
1186 if options[b'version']:
1180 return commands.version_(ui)
1187 return commands.version_(ui)
1181 if options[b'help']:
1188 if options[b'help']:
1182 return commands.help_(ui, cmd, command=cmd is not None)
1189 return commands.help_(ui, cmd, command=cmd is not None)
1183 elif not cmd:
1190 elif not cmd:
1184 return commands.help_(ui, b'shortlist')
1191 return commands.help_(ui, b'shortlist')
1185
1192
1186 repo = None
1193 repo = None
1187 cmdpats = args[:]
1194 cmdpats = args[:]
1188 assert func is not None # help out pytype
1195 assert func is not None # help out pytype
1189 if not func.norepo:
1196 if not func.norepo:
1190 # use the repo from the request only if we don't have -R
1197 # use the repo from the request only if we don't have -R
1191 if not rpath and not cwd:
1198 if not rpath and not cwd:
1192 repo = req.repo
1199 repo = req.repo
1193
1200
1194 if repo:
1201 if repo:
1195 # set the descriptors of the repo ui to those of ui
1202 # set the descriptors of the repo ui to those of ui
1196 repo.ui.fin = ui.fin
1203 repo.ui.fin = ui.fin
1197 repo.ui.fout = ui.fout
1204 repo.ui.fout = ui.fout
1198 repo.ui.ferr = ui.ferr
1205 repo.ui.ferr = ui.ferr
1199 repo.ui.fmsg = ui.fmsg
1206 repo.ui.fmsg = ui.fmsg
1200 else:
1207 else:
1201 try:
1208 try:
1202 repo = hg.repository(
1209 repo = hg.repository(
1203 ui,
1210 ui,
1204 path=path,
1211 path=path,
1205 presetupfuncs=req.prereposetups,
1212 presetupfuncs=req.prereposetups,
1206 intents=func.intents,
1213 intents=func.intents,
1207 )
1214 )
1208 if not repo.local():
1215 if not repo.local():
1209 raise error.InputError(
1216 raise error.InputError(
1210 _(b"repository '%s' is not local") % path
1217 _(b"repository '%s' is not local") % path
1211 )
1218 )
1212 repo.ui.setconfig(
1219 repo.ui.setconfig(
1213 b"bundle", b"mainreporoot", repo.root, b'repo'
1220 b"bundle", b"mainreporoot", repo.root, b'repo'
1214 )
1221 )
1215 except error.RequirementError:
1222 except error.RequirementError:
1216 raise
1223 raise
1217 except error.RepoError:
1224 except error.RepoError:
1218 if rpath: # invalid -R path
1225 if rpath: # invalid -R path
1219 raise
1226 raise
1220 if not func.optionalrepo:
1227 if not func.optionalrepo:
1221 if func.inferrepo and args and not path:
1228 if func.inferrepo and args and not path:
1222 # try to infer -R from command args
1229 # try to infer -R from command args
1223 repos = pycompat.maplist(cmdutil.findrepo, args)
1230 repos = pycompat.maplist(cmdutil.findrepo, args)
1224 guess = repos[0]
1231 guess = repos[0]
1225 if guess and repos.count(guess) == len(repos):
1232 if guess and repos.count(guess) == len(repos):
1226 req.args = [b'--repository', guess] + fullargs
1233 req.args = [b'--repository', guess] + fullargs
1227 req.earlyoptions[b'repository'] = guess
1234 req.earlyoptions[b'repository'] = guess
1228 return _dispatch(req)
1235 return _dispatch(req)
1229 if not path:
1236 if not path:
1230 raise error.InputError(
1237 raise error.InputError(
1231 _(
1238 _(
1232 b"no repository found in"
1239 b"no repository found in"
1233 b" '%s' (.hg not found)"
1240 b" '%s' (.hg not found)"
1234 )
1241 )
1235 % encoding.getcwd()
1242 % encoding.getcwd()
1236 )
1243 )
1237 raise
1244 raise
1238 if repo:
1245 if repo:
1239 ui = repo.ui
1246 ui = repo.ui
1240 if options[b'hidden']:
1247 if options[b'hidden']:
1241 repo = repo.unfiltered()
1248 repo = repo.unfiltered()
1242 args.insert(0, repo)
1249 args.insert(0, repo)
1243 elif rpath:
1250 elif rpath:
1244 ui.warn(_(b"warning: --repository ignored\n"))
1251 ui.warn(_(b"warning: --repository ignored\n"))
1245
1252
1246 msg = _formatargs(fullargs)
1253 msg = _formatargs(fullargs)
1247 ui.log(b"command", b'%s\n', msg)
1254 ui.log(b"command", b'%s\n', msg)
1248 strcmdopt = pycompat.strkwargs(cmdoptions)
1255 strcmdopt = pycompat.strkwargs(cmdoptions)
1249 d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
1256 d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
1250 try:
1257 try:
1251 return runcommand(
1258 return runcommand(
1252 lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
1259 lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
1253 )
1260 )
1254 finally:
1261 finally:
1255 if repo and repo != req.repo:
1262 if repo and repo != req.repo:
1256 repo.close()
1263 repo.close()
1257
1264
1258
1265
1259 def _runcommand(ui, options, cmd, cmdfunc):
1266 def _runcommand(ui, options, cmd, cmdfunc):
1260 """Run a command function, possibly with profiling enabled."""
1267 """Run a command function, possibly with profiling enabled."""
1261 try:
1268 try:
1262 with tracing.log("Running %s command" % cmd):
1269 with tracing.log("Running %s command" % cmd):
1263 return cmdfunc()
1270 return cmdfunc()
1264 except error.SignatureError:
1271 except error.SignatureError:
1265 raise error.CommandError(cmd, _(b'invalid arguments'))
1272 raise error.CommandError(cmd, _(b'invalid arguments'))
1266
1273
1267
1274
1268 def _exceptionwarning(ui):
1275 def _exceptionwarning(ui):
1269 """Produce a warning message for the current active exception"""
1276 """Produce a warning message for the current active exception"""
1270
1277
1271 # For compatibility checking, we discard the portion of the hg
1278 # For compatibility checking, we discard the portion of the hg
1272 # version after the + on the assumption that if a "normal
1279 # version after the + on the assumption that if a "normal
1273 # user" is running a build with a + in it the packager
1280 # user" is running a build with a + in it the packager
1274 # probably built from fairly close to a tag and anyone with a
1281 # probably built from fairly close to a tag and anyone with a
1275 # 'make local' copy of hg (where the version number can be out
1282 # 'make local' copy of hg (where the version number can be out
1276 # of date) will be clueful enough to notice the implausible
1283 # of date) will be clueful enough to notice the implausible
1277 # version number and try updating.
1284 # version number and try updating.
1278 ct = util.versiontuple(n=2)
1285 ct = util.versiontuple(n=2)
1279 worst = None, ct, b'', b''
1286 worst = None, ct, b'', b''
1280 if ui.config(b'ui', b'supportcontact') is None:
1287 if ui.config(b'ui', b'supportcontact') is None:
1281 for name, mod in extensions.extensions():
1288 for name, mod in extensions.extensions():
1282 # 'testedwith' should be bytes, but not all extensions are ported
1289 # 'testedwith' should be bytes, but not all extensions are ported
1283 # to py3 and we don't want UnicodeException because of that.
1290 # to py3 and we don't want UnicodeException because of that.
1284 testedwith = stringutil.forcebytestr(
1291 testedwith = stringutil.forcebytestr(
1285 getattr(mod, 'testedwith', b'')
1292 getattr(mod, 'testedwith', b'')
1286 )
1293 )
1287 version = extensions.moduleversion(mod)
1294 version = extensions.moduleversion(mod)
1288 report = getattr(mod, 'buglink', _(b'the extension author.'))
1295 report = getattr(mod, 'buglink', _(b'the extension author.'))
1289 if not testedwith.strip():
1296 if not testedwith.strip():
1290 # We found an untested extension. It's likely the culprit.
1297 # We found an untested extension. It's likely the culprit.
1291 worst = name, b'unknown', report, version
1298 worst = name, b'unknown', report, version
1292 break
1299 break
1293
1300
1294 # Never blame on extensions bundled with Mercurial.
1301 # Never blame on extensions bundled with Mercurial.
1295 if extensions.ismoduleinternal(mod):
1302 if extensions.ismoduleinternal(mod):
1296 continue
1303 continue
1297
1304
1298 tested = [util.versiontuple(t, 2) for t in testedwith.split()]
1305 tested = [util.versiontuple(t, 2) for t in testedwith.split()]
1299 if ct in tested:
1306 if ct in tested:
1300 continue
1307 continue
1301
1308
1302 lower = [t for t in tested if t < ct]
1309 lower = [t for t in tested if t < ct]
1303 nearest = max(lower or tested)
1310 nearest = max(lower or tested)
1304 if worst[0] is None or nearest < worst[1]:
1311 if worst[0] is None or nearest < worst[1]:
1305 worst = name, nearest, report, version
1312 worst = name, nearest, report, version
1306 if worst[0] is not None:
1313 if worst[0] is not None:
1307 name, testedwith, report, version = worst
1314 name, testedwith, report, version = worst
1308 if not isinstance(testedwith, (bytes, str)):
1315 if not isinstance(testedwith, (bytes, str)):
1309 testedwith = b'.'.join(
1316 testedwith = b'.'.join(
1310 [stringutil.forcebytestr(c) for c in testedwith]
1317 [stringutil.forcebytestr(c) for c in testedwith]
1311 )
1318 )
1312 extver = version or _(b"(version N/A)")
1319 extver = version or _(b"(version N/A)")
1313 warning = _(
1320 warning = _(
1314 b'** Unknown exception encountered with '
1321 b'** Unknown exception encountered with '
1315 b'possibly-broken third-party extension "%s" %s\n'
1322 b'possibly-broken third-party extension "%s" %s\n'
1316 b'** which supports versions %s of Mercurial.\n'
1323 b'** which supports versions %s of Mercurial.\n'
1317 b'** Please disable "%s" and try your action again.\n'
1324 b'** Please disable "%s" and try your action again.\n'
1318 b'** If that fixes the bug please report it to %s\n'
1325 b'** If that fixes the bug please report it to %s\n'
1319 ) % (name, extver, testedwith, name, stringutil.forcebytestr(report))
1326 ) % (name, extver, testedwith, name, stringutil.forcebytestr(report))
1320 else:
1327 else:
1321 bugtracker = ui.config(b'ui', b'supportcontact')
1328 bugtracker = ui.config(b'ui', b'supportcontact')
1322 if bugtracker is None:
1329 if bugtracker is None:
1323 bugtracker = _(b"https://mercurial-scm.org/wiki/BugTracker")
1330 bugtracker = _(b"https://mercurial-scm.org/wiki/BugTracker")
1324 warning = (
1331 warning = (
1325 _(
1332 _(
1326 b"** unknown exception encountered, "
1333 b"** unknown exception encountered, "
1327 b"please report by visiting\n** "
1334 b"please report by visiting\n** "
1328 )
1335 )
1329 + bugtracker
1336 + bugtracker
1330 + b'\n'
1337 + b'\n'
1331 )
1338 )
1332 sysversion = pycompat.sysbytes(sys.version).replace(b'\n', b'')
1339 sysversion = pycompat.sysbytes(sys.version).replace(b'\n', b'')
1333
1340
1334 def ext_with_ver(x):
1341 def ext_with_ver(x):
1335 ext = x[0]
1342 ext = x[0]
1336 ver = extensions.moduleversion(x[1])
1343 ver = extensions.moduleversion(x[1])
1337 if ver:
1344 if ver:
1338 ext += b' ' + ver
1345 ext += b' ' + ver
1339 return ext
1346 return ext
1340
1347
1341 warning += (
1348 warning += (
1342 (_(b"** Python %s\n") % sysversion)
1349 (_(b"** Python %s\n") % sysversion)
1343 + (_(b"** Mercurial Distributed SCM (version %s)\n") % util.version())
1350 + (_(b"** Mercurial Distributed SCM (version %s)\n") % util.version())
1344 + (
1351 + (
1345 _(b"** Extensions loaded: %s\n")
1352 _(b"** Extensions loaded: %s\n")
1346 % b", ".join(
1353 % b", ".join(
1347 [ext_with_ver(x) for x in sorted(extensions.extensions())]
1354 [ext_with_ver(x) for x in sorted(extensions.extensions())]
1348 )
1355 )
1349 )
1356 )
1350 )
1357 )
1351 return warning
1358 return warning
1352
1359
1353
1360
1354 def handlecommandexception(ui):
1361 def handlecommandexception(ui):
1355 """Produce a warning message for broken commands
1362 """Produce a warning message for broken commands
1356
1363
1357 Called when handling an exception; the exception is reraised if
1364 Called when handling an exception; the exception is reraised if
1358 this function returns False, ignored otherwise.
1365 this function returns False, ignored otherwise.
1359 """
1366 """
1360 warning = _exceptionwarning(ui)
1367 warning = _exceptionwarning(ui)
1361 ui.log(
1368 ui.log(
1362 b"commandexception",
1369 b"commandexception",
1363 b"%s\n%s\n",
1370 b"%s\n%s\n",
1364 warning,
1371 warning,
1365 pycompat.sysbytes(traceback.format_exc()),
1372 pycompat.sysbytes(traceback.format_exc()),
1366 )
1373 )
1367 ui.warn(warning)
1374 ui.warn(warning)
1368 return False # re-raise the exception
1375 return False # re-raise the exception
@@ -1,722 +1,722 b''
1 $ HGFOO=BAR; export HGFOO
1 $ HGFOO=BAR; export HGFOO
2 $ cat >> $HGRCPATH <<EOF
2 $ cat >> $HGRCPATH <<EOF
3 > [alias]
3 > [alias]
4 > # should clobber ci but not commit (issue2993)
4 > # should clobber ci but not commit (issue2993)
5 > ci = version
5 > ci = version
6 > myinit = init
6 > myinit = init
7 > myinit:doc = This is my documented alias for init.
7 > myinit:doc = This is my documented alias for init.
8 > myinit:help = [OPTIONS] [BLA] [BLE]
8 > myinit:help = [OPTIONS] [BLA] [BLE]
9 > mycommit = commit
9 > mycommit = commit
10 > mycommit:doc = This is my alias with only doc.
10 > mycommit:doc = This is my alias with only doc.
11 > optionalrepo = showconfig alias.myinit
11 > optionalrepo = showconfig alias.myinit
12 > cleanstatus = status -c
12 > cleanstatus = status -c
13 > cleanstatus:help = [ONLYHELPHERE]
13 > cleanstatus:help = [ONLYHELPHERE]
14 > unknown = bargle
14 > unknown = bargle
15 > ambiguous = s
15 > ambiguous = s
16 > recursive = recursive
16 > recursive = recursive
17 > disabled = email
17 > disabled = email
18 > nodefinition =
18 > nodefinition =
19 > noclosingquotation = '
19 > noclosingquotation = '
20 > no--cwd = status --cwd elsewhere
20 > no--cwd = status --cwd elsewhere
21 > no-R = status -R elsewhere
21 > no-R = status -R elsewhere
22 > no--repo = status --repo elsewhere
22 > no--repo = status --repo elsewhere
23 > no--repository = status --repository elsewhere
23 > no--repository = status --repository elsewhere
24 > no--config = status --config a.config=1
24 > no--config = status --config a.config=1
25 > mylog = log
25 > mylog = log
26 > lognull = log -r null
26 > lognull = log -r null
27 > lognull:doc = Logs the null rev
27 > lognull:doc = Logs the null rev
28 > lognull:help = foo bar baz
28 > lognull:help = foo bar baz
29 > shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
29 > shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
30 > positional = log --template '{\$2} {\$1} | {date|isodate}\n'
30 > positional = log --template '{\$2} {\$1} | {date|isodate}\n'
31 > dln = lognull --debug
31 > dln = lognull --debug
32 > recursivedoc = dln
32 > recursivedoc = dln
33 > recursivedoc:doc = Logs the null rev in debug mode
33 > recursivedoc:doc = Logs the null rev in debug mode
34 > nousage = rollback
34 > nousage = rollback
35 > put = export -r 0 -o "\$FOO/%R.diff"
35 > put = export -r 0 -o "\$FOO/%R.diff"
36 > blank = !printf '\n'
36 > blank = !printf '\n'
37 > self = !printf '\$0\n'
37 > self = !printf '\$0\n'
38 > echoall = !printf '\$@\n'
38 > echoall = !printf '\$@\n'
39 > echo1 = !printf '\$1\n'
39 > echo1 = !printf '\$1\n'
40 > echo2 = !printf '\$2\n'
40 > echo2 = !printf '\$2\n'
41 > echo13 = !printf '\$1 \$3\n'
41 > echo13 = !printf '\$1 \$3\n'
42 > echotokens = !printf "%s\n" "\$@"
42 > echotokens = !printf "%s\n" "\$@"
43 > count = !hg log -r "\$@" --template=. | wc -c | sed -e 's/ //g'
43 > count = !hg log -r "\$@" --template=. | wc -c | sed -e 's/ //g'
44 > mcount = !hg log \$@ --template=. | wc -c | sed -e 's/ //g'
44 > mcount = !hg log \$@ --template=. | wc -c | sed -e 's/ //g'
45 > rt = root
45 > rt = root
46 > tglog = log -G --template "{rev}:{node|short}: '{desc}' {branches}\n"
46 > tglog = log -G --template "{rev}:{node|short}: '{desc}' {branches}\n"
47 > idalias = id
47 > idalias = id
48 > idaliaslong = id
48 > idaliaslong = id
49 > idaliasshell = !echo test
49 > idaliasshell = !echo test
50 > parentsshell1 = !echo one
50 > parentsshell1 = !echo one
51 > parentsshell2 = !echo two
51 > parentsshell2 = !echo two
52 > escaped1 = !printf 'test\$\$test\n'
52 > escaped1 = !printf 'test\$\$test\n'
53 > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
53 > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
54 > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
54 > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
55 > escaped4 = !printf '\$\$0 \$\$@\n'
55 > escaped4 = !printf '\$\$0 \$\$@\n'
56 > exit1 = !sh -c 'exit 1'
56 > exit1 = !sh -c 'exit 1'
57 >
57 >
58 > [defaults]
58 > [defaults]
59 > mylog = -q
59 > mylog = -q
60 > lognull = -q
60 > lognull = -q
61 > log = -v
61 > log = -v
62 > EOF
62 > EOF
63
63
64 basic
64 basic
65
65
66 $ hg myinit alias
66 $ hg myinit alias
67
67
68 help
68 help
69
69
70 $ hg help -c | grep myinit
70 $ hg help -c | grep myinit
71 myinit This is my documented alias for init.
71 myinit This is my documented alias for init.
72 $ hg help -c | grep mycommit
72 $ hg help -c | grep mycommit
73 mycommit This is my alias with only doc.
73 mycommit This is my alias with only doc.
74 $ hg help -c | grep cleanstatus
74 $ hg help -c | grep cleanstatus
75 [1]
75 [1]
76 $ hg help -c | grep lognull
76 $ hg help -c | grep lognull
77 lognull Logs the null rev
77 lognull Logs the null rev
78 $ hg help -c | grep dln
78 $ hg help -c | grep dln
79 [1]
79 [1]
80 $ hg help -c | grep recursivedoc
80 $ hg help -c | grep recursivedoc
81 recursivedoc Logs the null rev in debug mode
81 recursivedoc Logs the null rev in debug mode
82 $ hg help myinit
82 $ hg help myinit
83 hg myinit [OPTIONS] [BLA] [BLE]
83 hg myinit [OPTIONS] [BLA] [BLE]
84
84
85 alias for: hg init
85 alias for: hg init
86
86
87 This is my documented alias for init.
87 This is my documented alias for init.
88
88
89 defined by: * (glob)
89 defined by: * (glob)
90 */* (glob) (?)
90 */* (glob) (?)
91 */* (glob) (?)
91 */* (glob) (?)
92 */* (glob) (?)
92 */* (glob) (?)
93
93
94 options:
94 options:
95
95
96 -e --ssh CMD specify ssh command to use
96 -e --ssh CMD specify ssh command to use
97 --remotecmd CMD specify hg command to run on the remote side
97 --remotecmd CMD specify hg command to run on the remote side
98 --insecure do not verify server certificate (ignoring web.cacerts
98 --insecure do not verify server certificate (ignoring web.cacerts
99 config)
99 config)
100
100
101 (some details hidden, use --verbose to show complete help)
101 (some details hidden, use --verbose to show complete help)
102
102
103 $ hg help mycommit
103 $ hg help mycommit
104 hg mycommit [OPTION]... [FILE]...
104 hg mycommit [OPTION]... [FILE]...
105
105
106 alias for: hg commit
106 alias for: hg commit
107
107
108 This is my alias with only doc.
108 This is my alias with only doc.
109
109
110 defined by: * (glob)
110 defined by: * (glob)
111 */* (glob) (?)
111 */* (glob) (?)
112 */* (glob) (?)
112 */* (glob) (?)
113 */* (glob) (?)
113 */* (glob) (?)
114
114
115 options ([+] can be repeated):
115 options ([+] can be repeated):
116
116
117 -A --addremove mark new/missing files as added/removed before
117 -A --addremove mark new/missing files as added/removed before
118 committing
118 committing
119 --close-branch mark a branch head as closed
119 --close-branch mark a branch head as closed
120 --amend amend the parent of the working directory
120 --amend amend the parent of the working directory
121 -s --secret use the secret phase for committing
121 -s --secret use the secret phase for committing
122 -e --edit invoke editor on commit messages
122 -e --edit invoke editor on commit messages
123 -i --interactive use interactive mode
123 -i --interactive use interactive mode
124 -I --include PATTERN [+] include names matching the given patterns
124 -I --include PATTERN [+] include names matching the given patterns
125 -X --exclude PATTERN [+] exclude names matching the given patterns
125 -X --exclude PATTERN [+] exclude names matching the given patterns
126 -m --message TEXT use text as commit message
126 -m --message TEXT use text as commit message
127 -l --logfile FILE read commit message from file
127 -l --logfile FILE read commit message from file
128 -d --date DATE record the specified date as commit date
128 -d --date DATE record the specified date as commit date
129 -u --user USER record the specified user as committer
129 -u --user USER record the specified user as committer
130 -S --subrepos recurse into subrepositories
130 -S --subrepos recurse into subrepositories
131
131
132 (some details hidden, use --verbose to show complete help)
132 (some details hidden, use --verbose to show complete help)
133
133
134 $ hg help cleanstatus
134 $ hg help cleanstatus
135 hg cleanstatus [ONLYHELPHERE]
135 hg cleanstatus [ONLYHELPHERE]
136
136
137 alias for: hg status -c
137 alias for: hg status -c
138
138
139 show changed files in the working directory
139 show changed files in the working directory
140
140
141 Show status of files in the repository. If names are given, only files
141 Show status of files in the repository. If names are given, only files
142 that match are shown. Files that are clean or ignored or the source of a
142 that match are shown. Files that are clean or ignored or the source of a
143 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
143 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
144 -C/--copies or -A/--all are given. Unless options described with "show
144 -C/--copies or -A/--all are given. Unless options described with "show
145 only ..." are given, the options -mardu are used.
145 only ..." are given, the options -mardu are used.
146
146
147 Option -q/--quiet hides untracked (unknown and ignored) files unless
147 Option -q/--quiet hides untracked (unknown and ignored) files unless
148 explicitly requested with -u/--unknown or -i/--ignored.
148 explicitly requested with -u/--unknown or -i/--ignored.
149
149
150 Note:
150 Note:
151 'hg status' may appear to disagree with diff if permissions have
151 'hg status' may appear to disagree with diff if permissions have
152 changed or a merge has occurred. The standard diff format does not
152 changed or a merge has occurred. The standard diff format does not
153 report permission changes and diff only reports changes relative to one
153 report permission changes and diff only reports changes relative to one
154 merge parent.
154 merge parent.
155
155
156 If one revision is given, it is used as the base revision. If two
156 If one revision is given, it is used as the base revision. If two
157 revisions are given, the differences between them are shown. The --change
157 revisions are given, the differences between them are shown. The --change
158 option can also be used as a shortcut to list the changed files of a
158 option can also be used as a shortcut to list the changed files of a
159 revision from its first parent.
159 revision from its first parent.
160
160
161 The codes used to show the status of files are:
161 The codes used to show the status of files are:
162
162
163 M = modified
163 M = modified
164 A = added
164 A = added
165 R = removed
165 R = removed
166 C = clean
166 C = clean
167 ! = missing (deleted by non-hg command, but still tracked)
167 ! = missing (deleted by non-hg command, but still tracked)
168 ? = not tracked
168 ? = not tracked
169 I = ignored
169 I = ignored
170 = origin of the previous file (with --copies)
170 = origin of the previous file (with --copies)
171
171
172 Returns 0 on success.
172 Returns 0 on success.
173
173
174 defined by: * (glob)
174 defined by: * (glob)
175 */* (glob) (?)
175 */* (glob) (?)
176 */* (glob) (?)
176 */* (glob) (?)
177 */* (glob) (?)
177 */* (glob) (?)
178
178
179 options ([+] can be repeated):
179 options ([+] can be repeated):
180
180
181 -A --all show status of all files
181 -A --all show status of all files
182 -m --modified show only modified files
182 -m --modified show only modified files
183 -a --added show only added files
183 -a --added show only added files
184 -r --removed show only removed files
184 -r --removed show only removed files
185 -d --deleted show only missing files
185 -d --deleted show only missing files
186 -c --clean show only files without changes
186 -c --clean show only files without changes
187 -u --unknown show only unknown (not tracked) files
187 -u --unknown show only unknown (not tracked) files
188 -i --ignored show only ignored files
188 -i --ignored show only ignored files
189 -n --no-status hide status prefix
189 -n --no-status hide status prefix
190 -C --copies show source of copied files
190 -C --copies show source of copied files
191 -0 --print0 end filenames with NUL, for use with xargs
191 -0 --print0 end filenames with NUL, for use with xargs
192 --rev REV [+] show difference from revision
192 --rev REV [+] show difference from revision
193 --change REV list the changed files of a revision
193 --change REV list the changed files of a revision
194 -I --include PATTERN [+] include names matching the given patterns
194 -I --include PATTERN [+] include names matching the given patterns
195 -X --exclude PATTERN [+] exclude names matching the given patterns
195 -X --exclude PATTERN [+] exclude names matching the given patterns
196 -S --subrepos recurse into subrepositories
196 -S --subrepos recurse into subrepositories
197 -T --template TEMPLATE display with template
197 -T --template TEMPLATE display with template
198
198
199 (some details hidden, use --verbose to show complete help)
199 (some details hidden, use --verbose to show complete help)
200
200
201 $ hg help recursivedoc | head -n 5
201 $ hg help recursivedoc | head -n 5
202 hg recursivedoc foo bar baz
202 hg recursivedoc foo bar baz
203
203
204 alias for: hg dln
204 alias for: hg dln
205
205
206 Logs the null rev in debug mode
206 Logs the null rev in debug mode
207
207
208 unknown
208 unknown
209
209
210 $ hg unknown
210 $ hg unknown
211 config error: alias 'unknown' resolves to unknown command 'bargle'
211 config error: alias 'unknown' resolves to unknown command 'bargle'
212 [30]
212 [30]
213 $ hg help unknown
213 $ hg help unknown
214 alias 'unknown' resolves to unknown command 'bargle'
214 alias 'unknown' resolves to unknown command 'bargle'
215
215
216
216
217 ambiguous
217 ambiguous
218
218
219 $ hg ambiguous
219 $ hg ambiguous
220 config error: alias 'ambiguous' resolves to ambiguous command 's'
220 config error: alias 'ambiguous' resolves to ambiguous command 's'
221 [30]
221 [30]
222 $ hg help ambiguous
222 $ hg help ambiguous
223 alias 'ambiguous' resolves to ambiguous command 's'
223 alias 'ambiguous' resolves to ambiguous command 's'
224
224
225
225
226 recursive
226 recursive
227
227
228 $ hg recursive
228 $ hg recursive
229 config error: alias 'recursive' resolves to unknown command 'recursive'
229 config error: alias 'recursive' resolves to unknown command 'recursive'
230 [30]
230 [30]
231 $ hg help recursive
231 $ hg help recursive
232 alias 'recursive' resolves to unknown command 'recursive'
232 alias 'recursive' resolves to unknown command 'recursive'
233
233
234
234
235 disabled
235 disabled
236
236
237 $ hg disabled
237 $ hg disabled
238 config error: alias 'disabled' resolves to unknown command 'email'
238 config error: alias 'disabled' resolves to unknown command 'email'
239 ('email' is provided by 'patchbomb' extension)
239 ('email' is provided by 'patchbomb' extension)
240 [30]
240 [30]
241 $ hg help disabled
241 $ hg help disabled
242 alias 'disabled' resolves to unknown command 'email'
242 alias 'disabled' resolves to unknown command 'email'
243
243
244 'email' is provided by the following extension:
244 'email' is provided by the following extension:
245
245
246 patchbomb command to send changesets as (a series of) patch emails
246 patchbomb command to send changesets as (a series of) patch emails
247
247
248 (use 'hg help extensions' for information on enabling extensions)
248 (use 'hg help extensions' for information on enabling extensions)
249
249
250
250
251 no definition
251 no definition
252
252
253 $ hg nodef
253 $ hg nodef
254 config error: no definition for alias 'nodefinition'
254 config error: no definition for alias 'nodefinition'
255 [30]
255 [30]
256 $ hg help nodef
256 $ hg help nodef
257 no definition for alias 'nodefinition'
257 no definition for alias 'nodefinition'
258
258
259
259
260 no closing quotation
260 no closing quotation
261
261
262 $ hg noclosing
262 $ hg noclosing
263 config error: error in definition for alias 'noclosingquotation': No closing quotation
263 config error: error in definition for alias 'noclosingquotation': No closing quotation
264 [30]
264 [30]
265 $ hg help noclosing
265 $ hg help noclosing
266 error in definition for alias 'noclosingquotation': No closing quotation
266 error in definition for alias 'noclosingquotation': No closing quotation
267
267
268 "--" in alias definition should be preserved
268 "--" in alias definition should be preserved
269
269
270 $ hg --config alias.dash='cat --' -R alias dash -r0
270 $ hg --config alias.dash='cat --' -R alias dash -r0
271 abort: -r0 not under root '$TESTTMP/alias'
271 abort: -r0 not under root '$TESTTMP/alias'
272 (consider using '--cwd alias')
272 (consider using '--cwd alias')
273 [255]
273 [255]
274
274
275 invalid options
275 invalid options
276
276
277 $ hg no--cwd
277 $ hg no--cwd
278 config error: error in definition for alias 'no--cwd': --cwd may only be given on the command line
278 config error: error in definition for alias 'no--cwd': --cwd may only be given on the command line
279 [30]
279 [30]
280 $ hg help no--cwd
280 $ hg help no--cwd
281 error in definition for alias 'no--cwd': --cwd may only be given on the
281 error in definition for alias 'no--cwd': --cwd may only be given on the
282 command line
282 command line
283 $ hg no-R
283 $ hg no-R
284 config error: error in definition for alias 'no-R': -R may only be given on the command line
284 config error: error in definition for alias 'no-R': -R may only be given on the command line
285 [30]
285 [30]
286 $ hg help no-R
286 $ hg help no-R
287 error in definition for alias 'no-R': -R may only be given on the command line
287 error in definition for alias 'no-R': -R may only be given on the command line
288 $ hg no--repo
288 $ hg no--repo
289 config error: error in definition for alias 'no--repo': --repo may only be given on the command line
289 config error: error in definition for alias 'no--repo': --repo may only be given on the command line
290 [30]
290 [30]
291 $ hg help no--repo
291 $ hg help no--repo
292 error in definition for alias 'no--repo': --repo may only be given on the
292 error in definition for alias 'no--repo': --repo may only be given on the
293 command line
293 command line
294 $ hg no--repository
294 $ hg no--repository
295 config error: error in definition for alias 'no--repository': --repository may only be given on the command line
295 config error: error in definition for alias 'no--repository': --repository may only be given on the command line
296 [30]
296 [30]
297 $ hg help no--repository
297 $ hg help no--repository
298 error in definition for alias 'no--repository': --repository may only be given
298 error in definition for alias 'no--repository': --repository may only be given
299 on the command line
299 on the command line
300 $ hg no--config
300 $ hg no--config
301 config error: error in definition for alias 'no--config': --config may only be given on the command line
301 config error: error in definition for alias 'no--config': --config may only be given on the command line
302 [30]
302 [30]
303 $ hg no --config alias.no='--repo elsewhere --cwd elsewhere status'
303 $ hg no --config alias.no='--repo elsewhere --cwd elsewhere status'
304 config error: error in definition for alias 'no': --repo/--cwd may only be given on the command line
304 config error: error in definition for alias 'no': --repo/--cwd may only be given on the command line
305 [30]
305 [30]
306 $ hg no --config alias.no='--repo elsewhere'
306 $ hg no --config alias.no='--repo elsewhere'
307 config error: error in definition for alias 'no': --repo may only be given on the command line
307 config error: error in definition for alias 'no': --repo may only be given on the command line
308 [30]
308 [30]
309
309
310 optional repository
310 optional repository
311
311
312 #if no-outer-repo
312 #if no-outer-repo
313 $ hg optionalrepo
313 $ hg optionalrepo
314 init
314 init
315 #endif
315 #endif
316 $ cd alias
316 $ cd alias
317 $ cat > .hg/hgrc <<EOF
317 $ cat > .hg/hgrc <<EOF
318 > [alias]
318 > [alias]
319 > myinit = init -q
319 > myinit = init -q
320 > EOF
320 > EOF
321 $ hg optionalrepo
321 $ hg optionalrepo
322 init -q
322 init -q
323
323
324 no usage
324 no usage
325
325
326 $ hg nousage
326 $ hg nousage
327 no rollback information available
327 no rollback information available
328 [1]
328 [1]
329
329
330 $ echo foo > foo
330 $ echo foo > foo
331 $ hg commit -Amfoo
331 $ hg commit -Amfoo
332 adding foo
332 adding foo
333
333
334 infer repository
334 infer repository
335
335
336 $ cd ..
336 $ cd ..
337
337
338 #if no-outer-repo
338 #if no-outer-repo
339 $ hg shortlog alias/foo
339 $ hg shortlog alias/foo
340 0 e63c23eaa88a | 1970-01-01 00:00 +0000
340 0 e63c23eaa88a | 1970-01-01 00:00 +0000
341 #endif
341 #endif
342
342
343 $ cd alias
343 $ cd alias
344
344
345 with opts
345 with opts
346
346
347 $ hg cleanst
347 $ hg cleanst
348 C foo
348 C foo
349
349
350
350
351 with opts and whitespace
351 with opts and whitespace
352
352
353 $ hg shortlog
353 $ hg shortlog
354 0 e63c23eaa88a | 1970-01-01 00:00 +0000
354 0 e63c23eaa88a | 1970-01-01 00:00 +0000
355
355
356 positional arguments
356 positional arguments
357
357
358 $ hg positional
358 $ hg positional
359 abort: too few arguments for command alias
359 abort: too few arguments for command alias
360 [10]
360 [10]
361 $ hg positional a
361 $ hg positional a
362 abort: too few arguments for command alias
362 abort: too few arguments for command alias
363 [10]
363 [10]
364 $ hg positional 'node|short' rev
364 $ hg positional 'node|short' rev
365 0 e63c23eaa88a | 1970-01-01 00:00 +0000
365 0 e63c23eaa88a | 1970-01-01 00:00 +0000
366
366
367 interaction with defaults
367 interaction with defaults
368
368
369 $ hg mylog
369 $ hg mylog
370 0:e63c23eaa88a
370 0:e63c23eaa88a
371 $ hg lognull
371 $ hg lognull
372 -1:000000000000
372 -1:000000000000
373
373
374
374
375 properly recursive
375 properly recursive
376
376
377 $ hg dln
377 $ hg dln
378 changeset: -1:0000000000000000000000000000000000000000
378 changeset: -1:0000000000000000000000000000000000000000
379 phase: public
379 phase: public
380 parent: -1:0000000000000000000000000000000000000000
380 parent: -1:0000000000000000000000000000000000000000
381 parent: -1:0000000000000000000000000000000000000000
381 parent: -1:0000000000000000000000000000000000000000
382 manifest: -1:0000000000000000000000000000000000000000
382 manifest: -1:0000000000000000000000000000000000000000
383 user:
383 user:
384 date: Thu Jan 01 00:00:00 1970 +0000
384 date: Thu Jan 01 00:00:00 1970 +0000
385 extra: branch=default
385 extra: branch=default
386
386
387
387
388
388
389 path expanding
389 path expanding
390
390
391 $ FOO=`pwd` hg put
391 $ FOO=`pwd` hg put
392 $ cat 0.diff
392 $ cat 0.diff
393 # HG changeset patch
393 # HG changeset patch
394 # User test
394 # User test
395 # Date 0 0
395 # Date 0 0
396 # Thu Jan 01 00:00:00 1970 +0000
396 # Thu Jan 01 00:00:00 1970 +0000
397 # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0
397 # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0
398 # Parent 0000000000000000000000000000000000000000
398 # Parent 0000000000000000000000000000000000000000
399 foo
399 foo
400
400
401 diff -r 000000000000 -r e63c23eaa88a foo
401 diff -r 000000000000 -r e63c23eaa88a foo
402 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
402 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
403 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
403 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
404 @@ -0,0 +1,1 @@
404 @@ -0,0 +1,1 @@
405 +foo
405 +foo
406
406
407
407
408 simple shell aliases
408 simple shell aliases
409
409
410 $ hg blank
410 $ hg blank
411
411
412 $ hg blank foo
412 $ hg blank foo
413
413
414 $ hg self
414 $ hg self
415 self
415 self
416 $ hg echoall
416 $ hg echoall
417
417
418 $ hg echoall foo
418 $ hg echoall foo
419 foo
419 foo
420 $ hg echoall 'test $2' foo
420 $ hg echoall 'test $2' foo
421 test $2 foo
421 test $2 foo
422 $ hg echoall 'test $@' foo '$@'
422 $ hg echoall 'test $@' foo '$@'
423 test $@ foo $@
423 test $@ foo $@
424 $ hg echoall 'test "$@"' foo '"$@"'
424 $ hg echoall 'test "$@"' foo '"$@"'
425 test "$@" foo "$@"
425 test "$@" foo "$@"
426 $ hg echo1 foo bar baz
426 $ hg echo1 foo bar baz
427 foo
427 foo
428 $ hg echo2 foo bar baz
428 $ hg echo2 foo bar baz
429 bar
429 bar
430 $ hg echo13 foo bar baz test
430 $ hg echo13 foo bar baz test
431 foo baz
431 foo baz
432 $ hg echo2 foo
432 $ hg echo2 foo
433
433
434 $ hg echotokens
434 $ hg echotokens
435
435
436 $ hg echotokens foo 'bar $1 baz'
436 $ hg echotokens foo 'bar $1 baz'
437 foo
437 foo
438 bar $1 baz
438 bar $1 baz
439 $ hg echotokens 'test $2' foo
439 $ hg echotokens 'test $2' foo
440 test $2
440 test $2
441 foo
441 foo
442 $ hg echotokens 'test $@' foo '$@'
442 $ hg echotokens 'test $@' foo '$@'
443 test $@
443 test $@
444 foo
444 foo
445 $@
445 $@
446 $ hg echotokens 'test "$@"' foo '"$@"'
446 $ hg echotokens 'test "$@"' foo '"$@"'
447 test "$@"
447 test "$@"
448 foo
448 foo
449 "$@"
449 "$@"
450 $ echo bar > bar
450 $ echo bar > bar
451 $ hg commit -qA -m bar
451 $ hg commit -qA -m bar
452 $ hg count .
452 $ hg count .
453 1
453 1
454 $ hg count 'branch(default)'
454 $ hg count 'branch(default)'
455 2
455 2
456 $ hg mcount -r '"branch(default)"'
456 $ hg mcount -r '"branch(default)"'
457 2
457 2
458
458
459 $ hg tglog
459 $ hg tglog
460 @ 1:042423737847: 'bar'
460 @ 1:042423737847: 'bar'
461 |
461 |
462 o 0:e63c23eaa88a: 'foo'
462 o 0:e63c23eaa88a: 'foo'
463
463
464
464
465
465
466 shadowing
466 shadowing
467
467
468 $ hg i
468 $ hg i
469 hg: command 'i' is ambiguous:
469 hg: command 'i' is ambiguous:
470 idalias idaliaslong idaliasshell identify import incoming init
470 idalias idaliaslong idaliasshell identify import incoming init
471 [255]
471 [10]
472 $ hg id
472 $ hg id
473 042423737847 tip
473 042423737847 tip
474 $ hg ida
474 $ hg ida
475 hg: command 'ida' is ambiguous:
475 hg: command 'ida' is ambiguous:
476 idalias idaliaslong idaliasshell
476 idalias idaliaslong idaliasshell
477 [255]
477 [10]
478 $ hg idalias
478 $ hg idalias
479 042423737847 tip
479 042423737847 tip
480 $ hg idaliasl
480 $ hg idaliasl
481 042423737847 tip
481 042423737847 tip
482 $ hg idaliass
482 $ hg idaliass
483 test
483 test
484 $ hg parentsshell
484 $ hg parentsshell
485 hg: command 'parentsshell' is ambiguous:
485 hg: command 'parentsshell' is ambiguous:
486 parentsshell1 parentsshell2
486 parentsshell1 parentsshell2
487 [255]
487 [10]
488 $ hg parentsshell1
488 $ hg parentsshell1
489 one
489 one
490 $ hg parentsshell2
490 $ hg parentsshell2
491 two
491 two
492
492
493
493
494 shell aliases with global options
494 shell aliases with global options
495
495
496 $ hg init sub
496 $ hg init sub
497 $ cd sub
497 $ cd sub
498 $ hg count 'branch(default)'
498 $ hg count 'branch(default)'
499 abort: unknown revision 'default'
499 abort: unknown revision 'default'
500 0
500 0
501 $ hg -v count 'branch(default)'
501 $ hg -v count 'branch(default)'
502 abort: unknown revision 'default'
502 abort: unknown revision 'default'
503 0
503 0
504 $ hg -R .. count 'branch(default)'
504 $ hg -R .. count 'branch(default)'
505 abort: unknown revision 'default'
505 abort: unknown revision 'default'
506 0
506 0
507 $ hg --cwd .. count 'branch(default)'
507 $ hg --cwd .. count 'branch(default)'
508 2
508 2
509 $ hg echoall --cwd ..
509 $ hg echoall --cwd ..
510
510
511
511
512 "--" passed to shell alias should be preserved
512 "--" passed to shell alias should be preserved
513
513
514 $ hg --config alias.printf='!printf "$@"' printf '%s %s %s\n' -- --cwd ..
514 $ hg --config alias.printf='!printf "$@"' printf '%s %s %s\n' -- --cwd ..
515 -- --cwd ..
515 -- --cwd ..
516
516
517 repo specific shell aliases
517 repo specific shell aliases
518
518
519 $ cat >> .hg/hgrc <<EOF
519 $ cat >> .hg/hgrc <<EOF
520 > [alias]
520 > [alias]
521 > subalias = !echo sub
521 > subalias = !echo sub
522 > EOF
522 > EOF
523 $ cat >> ../.hg/hgrc <<EOF
523 $ cat >> ../.hg/hgrc <<EOF
524 > [alias]
524 > [alias]
525 > mainalias = !echo main
525 > mainalias = !echo main
526 > EOF
526 > EOF
527
527
528
528
529 shell alias defined in current repo
529 shell alias defined in current repo
530
530
531 $ hg subalias
531 $ hg subalias
532 sub
532 sub
533 $ hg --cwd .. subalias > /dev/null
533 $ hg --cwd .. subalias > /dev/null
534 hg: unknown command 'subalias'
534 hg: unknown command 'subalias'
535 (did you mean idalias?)
535 (did you mean idalias?)
536 [255]
536 [10]
537 $ hg -R .. subalias > /dev/null
537 $ hg -R .. subalias > /dev/null
538 hg: unknown command 'subalias'
538 hg: unknown command 'subalias'
539 (did you mean idalias?)
539 (did you mean idalias?)
540 [255]
540 [10]
541
541
542
542
543 shell alias defined in other repo
543 shell alias defined in other repo
544
544
545 $ hg mainalias > /dev/null
545 $ hg mainalias > /dev/null
546 hg: unknown command 'mainalias'
546 hg: unknown command 'mainalias'
547 (did you mean idalias?)
547 (did you mean idalias?)
548 [255]
548 [10]
549 $ hg -R .. mainalias
549 $ hg -R .. mainalias
550 main
550 main
551 $ hg --cwd .. mainalias
551 $ hg --cwd .. mainalias
552 main
552 main
553
553
554 typos get useful suggestions
554 typos get useful suggestions
555 $ hg --cwd .. manalias
555 $ hg --cwd .. manalias
556 hg: unknown command 'manalias'
556 hg: unknown command 'manalias'
557 (did you mean one of idalias, mainalias, manifest?)
557 (did you mean one of idalias, mainalias, manifest?)
558 [255]
558 [10]
559
559
560 shell aliases with escaped $ chars
560 shell aliases with escaped $ chars
561
561
562 $ hg escaped1
562 $ hg escaped1
563 test$test
563 test$test
564 $ hg escaped2
564 $ hg escaped2
565 HGFOO is BAR
565 HGFOO is BAR
566 $ hg escaped3 HGFOO
566 $ hg escaped3 HGFOO
567 HGFOO is BAR
567 HGFOO is BAR
568 $ hg escaped4 test
568 $ hg escaped4 test
569 $0 $@
569 $0 $@
570
570
571 abbreviated name, which matches against both shell alias and the
571 abbreviated name, which matches against both shell alias and the
572 command provided extension, should be aborted.
572 command provided extension, should be aborted.
573
573
574 $ cat >> .hg/hgrc <<EOF
574 $ cat >> .hg/hgrc <<EOF
575 > [extensions]
575 > [extensions]
576 > hgext.rebase =
576 > hgext.rebase =
577 > EOF
577 > EOF
578 #if windows
578 #if windows
579 $ cat >> .hg/hgrc <<EOF
579 $ cat >> .hg/hgrc <<EOF
580 > [alias]
580 > [alias]
581 > rebate = !echo this is %HG_ARGS%
581 > rebate = !echo this is %HG_ARGS%
582 > EOF
582 > EOF
583 #else
583 #else
584 $ cat >> .hg/hgrc <<EOF
584 $ cat >> .hg/hgrc <<EOF
585 > [alias]
585 > [alias]
586 > rebate = !echo this is \$HG_ARGS
586 > rebate = !echo this is \$HG_ARGS
587 > EOF
587 > EOF
588 #endif
588 #endif
589 $ cat >> .hg/hgrc <<EOF
589 $ cat >> .hg/hgrc <<EOF
590 > rebate:doc = This is my alias which just prints something.
590 > rebate:doc = This is my alias which just prints something.
591 > rebate:help = [MYARGS]
591 > rebate:help = [MYARGS]
592 > EOF
592 > EOF
593 $ hg reba
593 $ hg reba
594 hg: command 'reba' is ambiguous:
594 hg: command 'reba' is ambiguous:
595 rebase rebate
595 rebase rebate
596 [255]
596 [10]
597 $ hg rebat
597 $ hg rebat
598 this is rebate
598 this is rebate
599 $ hg rebat --foo-bar
599 $ hg rebat --foo-bar
600 this is rebate --foo-bar
600 this is rebate --foo-bar
601
601
602 help for a shell alias
602 help for a shell alias
603
603
604 $ hg help -c | grep rebate
604 $ hg help -c | grep rebate
605 rebate This is my alias which just prints something.
605 rebate This is my alias which just prints something.
606 $ hg help rebate
606 $ hg help rebate
607 hg rebate [MYARGS]
607 hg rebate [MYARGS]
608
608
609 shell alias for: echo this is %HG_ARGS% (windows !)
609 shell alias for: echo this is %HG_ARGS% (windows !)
610 shell alias for: echo this is $HG_ARGS (no-windows !)
610 shell alias for: echo this is $HG_ARGS (no-windows !)
611
611
612 This is my alias which just prints something.
612 This is my alias which just prints something.
613
613
614 defined by:* (glob)
614 defined by:* (glob)
615 */* (glob) (?)
615 */* (glob) (?)
616 */* (glob) (?)
616 */* (glob) (?)
617 */* (glob) (?)
617 */* (glob) (?)
618
618
619 (some details hidden, use --verbose to show complete help)
619 (some details hidden, use --verbose to show complete help)
620
620
621 invalid character in user-specified help
621 invalid character in user-specified help
622
622
623 >>> with open('.hg/hgrc', 'ab') as f:
623 >>> with open('.hg/hgrc', 'ab') as f:
624 ... f.write(b'[alias]\n'
624 ... f.write(b'[alias]\n'
625 ... b'invaliddoc = log\n'
625 ... b'invaliddoc = log\n'
626 ... b'invaliddoc:doc = \xc3\xa9\n'
626 ... b'invaliddoc:doc = \xc3\xa9\n'
627 ... b'invalidhelp = log\n'
627 ... b'invalidhelp = log\n'
628 ... b'invalidhelp:help = \xc3\xa9\n') and None
628 ... b'invalidhelp:help = \xc3\xa9\n') and None
629 $ hg help invaliddoc
629 $ hg help invaliddoc
630 non-ASCII character in alias definition 'invaliddoc:doc'
630 non-ASCII character in alias definition 'invaliddoc:doc'
631 $ hg help invalidhelp
631 $ hg help invalidhelp
632 non-ASCII character in alias definition 'invalidhelp:help'
632 non-ASCII character in alias definition 'invalidhelp:help'
633 $ hg invaliddoc
633 $ hg invaliddoc
634 config error: non-ASCII character in alias definition 'invaliddoc:doc'
634 config error: non-ASCII character in alias definition 'invaliddoc:doc'
635 [30]
635 [30]
636 $ hg invalidhelp
636 $ hg invalidhelp
637 config error: non-ASCII character in alias definition 'invalidhelp:help'
637 config error: non-ASCII character in alias definition 'invalidhelp:help'
638 [30]
638 [30]
639
639
640 invalid arguments
640 invalid arguments
641
641
642 $ hg rt foo
642 $ hg rt foo
643 hg rt: invalid arguments
643 hg rt: invalid arguments
644 hg rt
644 hg rt
645
645
646 alias for: hg root
646 alias for: hg root
647
647
648 options:
648 options:
649
649
650 -T --template TEMPLATE display with template
650 -T --template TEMPLATE display with template
651
651
652 (use 'hg rt -h' to show more help)
652 (use 'hg rt -h' to show more help)
653 [255]
653 [10]
654
654
655 invalid global arguments for normal commands, aliases, and shell aliases
655 invalid global arguments for normal commands, aliases, and shell aliases
656
656
657 $ hg --invalid root
657 $ hg --invalid root
658 hg: option --invalid not recognized
658 hg: option --invalid not recognized
659 (use 'hg help -v' for a list of global options)
659 (use 'hg help -v' for a list of global options)
660 [255]
660 [10]
661 $ hg --invalid mylog
661 $ hg --invalid mylog
662 hg: option --invalid not recognized
662 hg: option --invalid not recognized
663 (use 'hg help -v' for a list of global options)
663 (use 'hg help -v' for a list of global options)
664 [255]
664 [10]
665 $ hg --invalid blank
665 $ hg --invalid blank
666 hg: option --invalid not recognized
666 hg: option --invalid not recognized
667 (use 'hg help -v' for a list of global options)
667 (use 'hg help -v' for a list of global options)
668 [255]
668 [10]
669
669
670 environment variable changes in alias commands
670 environment variable changes in alias commands
671
671
672 $ cat > $TESTTMP/expandalias.py <<EOF
672 $ cat > $TESTTMP/expandalias.py <<EOF
673 > import os
673 > import os
674 > from mercurial import cmdutil, commands, registrar
674 > from mercurial import cmdutil, commands, registrar
675 > cmdtable = {}
675 > cmdtable = {}
676 > command = registrar.command(cmdtable)
676 > command = registrar.command(cmdtable)
677 > @command(b'expandalias')
677 > @command(b'expandalias')
678 > def expandalias(ui, repo, name):
678 > def expandalias(ui, repo, name):
679 > alias = cmdutil.findcmd(name, commands.table)[1][0]
679 > alias = cmdutil.findcmd(name, commands.table)[1][0]
680 > ui.write(b'%s args: %s\n' % (name, b' '.join(alias.args)))
680 > ui.write(b'%s args: %s\n' % (name, b' '.join(alias.args)))
681 > os.environ['COUNT'] = '2'
681 > os.environ['COUNT'] = '2'
682 > ui.write(b'%s args: %s (with COUNT=2)\n' % (name, b' '.join(alias.args)))
682 > ui.write(b'%s args: %s (with COUNT=2)\n' % (name, b' '.join(alias.args)))
683 > EOF
683 > EOF
684
684
685 $ cat >> $HGRCPATH <<'EOF'
685 $ cat >> $HGRCPATH <<'EOF'
686 > [extensions]
686 > [extensions]
687 > expandalias = $TESTTMP/expandalias.py
687 > expandalias = $TESTTMP/expandalias.py
688 > [alias]
688 > [alias]
689 > showcount = log -T "$COUNT" -r .
689 > showcount = log -T "$COUNT" -r .
690 > EOF
690 > EOF
691
691
692 $ COUNT=1 hg expandalias showcount
692 $ COUNT=1 hg expandalias showcount
693 showcount args: -T 1 -r .
693 showcount args: -T 1 -r .
694 showcount args: -T 2 -r . (with COUNT=2)
694 showcount args: -T 2 -r . (with COUNT=2)
695
695
696 This should show id:
696 This should show id:
697
697
698 $ hg --config alias.log='id' log
698 $ hg --config alias.log='id' log
699 000000000000 tip
699 000000000000 tip
700
700
701 This shouldn't:
701 This shouldn't:
702
702
703 $ hg --config alias.log='id' history
703 $ hg --config alias.log='id' history
704
704
705 $ cd ../..
705 $ cd ../..
706
706
707 return code of command and shell aliases:
707 return code of command and shell aliases:
708
708
709 $ hg mycommit -R alias
709 $ hg mycommit -R alias
710 nothing changed
710 nothing changed
711 [1]
711 [1]
712 $ hg exit1
712 $ hg exit1
713 [1]
713 [1]
714
714
715 #if no-outer-repo
715 #if no-outer-repo
716 $ hg root
716 $ hg root
717 abort: no repository found in '$TESTTMP' (.hg not found)
717 abort: no repository found in '$TESTTMP' (.hg not found)
718 [10]
718 [10]
719 $ hg --config alias.hgroot='!hg root' hgroot
719 $ hg --config alias.hgroot='!hg root' hgroot
720 abort: no repository found in '$TESTTMP' (.hg not found)
720 abort: no repository found in '$TESTTMP' (.hg not found)
721 [10]
721 [10]
722 #endif
722 #endif
@@ -1,254 +1,254 b''
1 Create a repository:
1 Create a repository:
2
2
3 #if no-extraextensions
3 #if no-extraextensions
4 $ hg config
4 $ hg config
5 devel.all-warnings=true
5 devel.all-warnings=true
6 devel.default-date=0 0
6 devel.default-date=0 0
7 extensions.fsmonitor= (fsmonitor !)
7 extensions.fsmonitor= (fsmonitor !)
8 largefiles.usercache=$TESTTMP/.cache/largefiles
8 largefiles.usercache=$TESTTMP/.cache/largefiles
9 lfs.usercache=$TESTTMP/.cache/lfs
9 lfs.usercache=$TESTTMP/.cache/lfs
10 ui.slash=True
10 ui.slash=True
11 ui.interactive=False
11 ui.interactive=False
12 ui.detailed-exit-code=True
12 ui.detailed-exit-code=True
13 ui.merge=internal:merge
13 ui.merge=internal:merge
14 ui.mergemarkers=detailed
14 ui.mergemarkers=detailed
15 ui.promptecho=True
15 ui.promptecho=True
16 ui.timeout.warn=15
16 ui.timeout.warn=15
17 web.address=localhost
17 web.address=localhost
18 web\.ipv6=(?:True|False) (re)
18 web\.ipv6=(?:True|False) (re)
19 web.server-header=testing stub value
19 web.server-header=testing stub value
20 #endif
20 #endif
21
21
22 $ hg init t
22 $ hg init t
23 $ cd t
23 $ cd t
24
24
25 Prepare a changeset:
25 Prepare a changeset:
26
26
27 $ echo a > a
27 $ echo a > a
28 $ hg add a
28 $ hg add a
29
29
30 $ hg status
30 $ hg status
31 A a
31 A a
32
32
33 Writes to stdio succeed and fail appropriately
33 Writes to stdio succeed and fail appropriately
34
34
35 #if devfull
35 #if devfull
36 $ hg status 2>/dev/full
36 $ hg status 2>/dev/full
37 A a
37 A a
38
38
39 $ hg status >/dev/full
39 $ hg status >/dev/full
40 abort: No space left on device
40 abort: No space left on device
41 [255]
41 [255]
42 #endif
42 #endif
43
43
44 #if devfull
44 #if devfull
45 $ hg status >/dev/full 2>&1
45 $ hg status >/dev/full 2>&1
46 [255]
46 [255]
47
47
48 $ hg status ENOENT 2>/dev/full
48 $ hg status ENOENT 2>/dev/full
49 [255]
49 [255]
50 #endif
50 #endif
51
51
52 On Python 3, stdio may be None:
52 On Python 3, stdio may be None:
53
53
54 $ hg debuguiprompt --config ui.interactive=true 0<&-
54 $ hg debuguiprompt --config ui.interactive=true 0<&-
55 abort: Bad file descriptor
55 abort: Bad file descriptor
56 [255]
56 [255]
57 $ hg version -q 0<&-
57 $ hg version -q 0<&-
58 Mercurial Distributed SCM * (glob)
58 Mercurial Distributed SCM * (glob)
59
59
60 #if py3
60 #if py3
61 $ hg version -q 1>&-
61 $ hg version -q 1>&-
62 abort: Bad file descriptor
62 abort: Bad file descriptor
63 [255]
63 [255]
64 #else
64 #else
65 $ hg version -q 1>&-
65 $ hg version -q 1>&-
66 #endif
66 #endif
67 $ hg unknown -q 1>&-
67 $ hg unknown -q 1>&-
68 hg: unknown command 'unknown'
68 hg: unknown command 'unknown'
69 (did you mean debugknown?)
69 (did you mean debugknown?)
70 [255]
70 [10]
71
71
72 $ hg version -q 2>&-
72 $ hg version -q 2>&-
73 Mercurial Distributed SCM * (glob)
73 Mercurial Distributed SCM * (glob)
74 $ hg unknown -q 2>&-
74 $ hg unknown -q 2>&-
75 [255]
75 [10]
76
76
77 $ hg commit -m test
77 $ hg commit -m test
78
78
79 This command is ancient:
79 This command is ancient:
80
80
81 $ hg history
81 $ hg history
82 changeset: 0:acb14030fe0a
82 changeset: 0:acb14030fe0a
83 tag: tip
83 tag: tip
84 user: test
84 user: test
85 date: Thu Jan 01 00:00:00 1970 +0000
85 date: Thu Jan 01 00:00:00 1970 +0000
86 summary: test
86 summary: test
87
87
88
88
89 Verify that updating to revision 0 via commands.update() works properly
89 Verify that updating to revision 0 via commands.update() works properly
90
90
91 $ cat <<EOF > update_to_rev0.py
91 $ cat <<EOF > update_to_rev0.py
92 > from mercurial import commands, hg, ui as uimod
92 > from mercurial import commands, hg, ui as uimod
93 > myui = uimod.ui.load()
93 > myui = uimod.ui.load()
94 > repo = hg.repository(myui, path=b'.')
94 > repo = hg.repository(myui, path=b'.')
95 > commands.update(myui, repo, rev=b"0")
95 > commands.update(myui, repo, rev=b"0")
96 > EOF
96 > EOF
97 $ hg up null
97 $ hg up null
98 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
98 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
99 $ "$PYTHON" ./update_to_rev0.py
99 $ "$PYTHON" ./update_to_rev0.py
100 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 $ hg identify -n
101 $ hg identify -n
102 0
102 0
103
103
104
104
105 Poke around at hashes:
105 Poke around at hashes:
106
106
107 $ hg manifest --debug
107 $ hg manifest --debug
108 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
108 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
109
109
110 $ hg cat a
110 $ hg cat a
111 a
111 a
112
112
113 Verify should succeed:
113 Verify should succeed:
114
114
115 $ hg verify
115 $ hg verify
116 checking changesets
116 checking changesets
117 checking manifests
117 checking manifests
118 crosschecking files in changesets and manifests
118 crosschecking files in changesets and manifests
119 checking files
119 checking files
120 checked 1 changesets with 1 changes to 1 files
120 checked 1 changesets with 1 changes to 1 files
121
121
122 Repository root:
122 Repository root:
123
123
124 $ hg root
124 $ hg root
125 $TESTTMP/t
125 $TESTTMP/t
126 $ hg log -l1 -T '{reporoot}\n'
126 $ hg log -l1 -T '{reporoot}\n'
127 $TESTTMP/t
127 $TESTTMP/t
128 $ hg root -Tjson | sed 's|\\\\|\\|g'
128 $ hg root -Tjson | sed 's|\\\\|\\|g'
129 [
129 [
130 {
130 {
131 "hgpath": "$TESTTMP/t/.hg",
131 "hgpath": "$TESTTMP/t/.hg",
132 "reporoot": "$TESTTMP/t",
132 "reporoot": "$TESTTMP/t",
133 "storepath": "$TESTTMP/t/.hg/store"
133 "storepath": "$TESTTMP/t/.hg/store"
134 }
134 }
135 ]
135 ]
136
136
137 At the end...
137 At the end...
138
138
139 $ cd ..
139 $ cd ..
140
140
141 Status message redirection:
141 Status message redirection:
142
142
143 $ hg init empty
143 $ hg init empty
144
144
145 status messages are sent to stdout by default:
145 status messages are sent to stdout by default:
146
146
147 $ hg outgoing -R t empty -Tjson 2>/dev/null
147 $ hg outgoing -R t empty -Tjson 2>/dev/null
148 comparing with empty
148 comparing with empty
149 searching for changes
149 searching for changes
150 [
150 [
151 {
151 {
152 "bookmarks": [],
152 "bookmarks": [],
153 "branch": "default",
153 "branch": "default",
154 "date": [0, 0],
154 "date": [0, 0],
155 "desc": "test",
155 "desc": "test",
156 "node": "acb14030fe0a21b60322c440ad2d20cf7685a376",
156 "node": "acb14030fe0a21b60322c440ad2d20cf7685a376",
157 "parents": ["0000000000000000000000000000000000000000"],
157 "parents": ["0000000000000000000000000000000000000000"],
158 "phase": "draft",
158 "phase": "draft",
159 "rev": 0,
159 "rev": 0,
160 "tags": ["tip"],
160 "tags": ["tip"],
161 "user": "test"
161 "user": "test"
162 }
162 }
163 ]
163 ]
164
164
165 which can be configured to send to stderr, so the output wouldn't be
165 which can be configured to send to stderr, so the output wouldn't be
166 interleaved:
166 interleaved:
167
167
168 $ cat <<'EOF' >> "$HGRCPATH"
168 $ cat <<'EOF' >> "$HGRCPATH"
169 > [ui]
169 > [ui]
170 > message-output = stderr
170 > message-output = stderr
171 > EOF
171 > EOF
172 $ hg outgoing -R t empty -Tjson 2>/dev/null
172 $ hg outgoing -R t empty -Tjson 2>/dev/null
173 [
173 [
174 {
174 {
175 "bookmarks": [],
175 "bookmarks": [],
176 "branch": "default",
176 "branch": "default",
177 "date": [0, 0],
177 "date": [0, 0],
178 "desc": "test",
178 "desc": "test",
179 "node": "acb14030fe0a21b60322c440ad2d20cf7685a376",
179 "node": "acb14030fe0a21b60322c440ad2d20cf7685a376",
180 "parents": ["0000000000000000000000000000000000000000"],
180 "parents": ["0000000000000000000000000000000000000000"],
181 "phase": "draft",
181 "phase": "draft",
182 "rev": 0,
182 "rev": 0,
183 "tags": ["tip"],
183 "tags": ["tip"],
184 "user": "test"
184 "user": "test"
185 }
185 }
186 ]
186 ]
187 $ hg outgoing -R t empty -Tjson >/dev/null
187 $ hg outgoing -R t empty -Tjson >/dev/null
188 comparing with empty
188 comparing with empty
189 searching for changes
189 searching for changes
190
190
191 this option should be turned off by HGPLAIN= since it may break scripting use:
191 this option should be turned off by HGPLAIN= since it may break scripting use:
192
192
193 $ HGPLAIN= hg outgoing -R t empty -Tjson 2>/dev/null
193 $ HGPLAIN= hg outgoing -R t empty -Tjson 2>/dev/null
194 comparing with empty
194 comparing with empty
195 searching for changes
195 searching for changes
196 [
196 [
197 {
197 {
198 "bookmarks": [],
198 "bookmarks": [],
199 "branch": "default",
199 "branch": "default",
200 "date": [0, 0],
200 "date": [0, 0],
201 "desc": "test",
201 "desc": "test",
202 "node": "acb14030fe0a21b60322c440ad2d20cf7685a376",
202 "node": "acb14030fe0a21b60322c440ad2d20cf7685a376",
203 "parents": ["0000000000000000000000000000000000000000"],
203 "parents": ["0000000000000000000000000000000000000000"],
204 "phase": "draft",
204 "phase": "draft",
205 "rev": 0,
205 "rev": 0,
206 "tags": ["tip"],
206 "tags": ["tip"],
207 "user": "test"
207 "user": "test"
208 }
208 }
209 ]
209 ]
210
210
211 but still overridden by --config:
211 but still overridden by --config:
212
212
213 $ HGPLAIN= hg outgoing -R t empty -Tjson --config ui.message-output=stderr \
213 $ HGPLAIN= hg outgoing -R t empty -Tjson --config ui.message-output=stderr \
214 > 2>/dev/null
214 > 2>/dev/null
215 [
215 [
216 {
216 {
217 "bookmarks": [],
217 "bookmarks": [],
218 "branch": "default",
218 "branch": "default",
219 "date": [0, 0],
219 "date": [0, 0],
220 "desc": "test",
220 "desc": "test",
221 "node": "acb14030fe0a21b60322c440ad2d20cf7685a376",
221 "node": "acb14030fe0a21b60322c440ad2d20cf7685a376",
222 "parents": ["0000000000000000000000000000000000000000"],
222 "parents": ["0000000000000000000000000000000000000000"],
223 "phase": "draft",
223 "phase": "draft",
224 "rev": 0,
224 "rev": 0,
225 "tags": ["tip"],
225 "tags": ["tip"],
226 "user": "test"
226 "user": "test"
227 }
227 }
228 ]
228 ]
229
229
230 Invalid ui.message-output option:
230 Invalid ui.message-output option:
231
231
232 $ hg log -R t --config ui.message-output=bad
232 $ hg log -R t --config ui.message-output=bad
233 abort: invalid ui.message-output destination: bad
233 abort: invalid ui.message-output destination: bad
234 [255]
234 [255]
235
235
236 Underlying message streams should be updated when ui.fout/ferr are set:
236 Underlying message streams should be updated when ui.fout/ferr are set:
237
237
238 $ cat <<'EOF' > capui.py
238 $ cat <<'EOF' > capui.py
239 > from mercurial import pycompat, registrar
239 > from mercurial import pycompat, registrar
240 > cmdtable = {}
240 > cmdtable = {}
241 > command = registrar.command(cmdtable)
241 > command = registrar.command(cmdtable)
242 > @command(b'capui', norepo=True)
242 > @command(b'capui', norepo=True)
243 > def capui(ui):
243 > def capui(ui):
244 > out = ui.fout
244 > out = ui.fout
245 > ui.fout = pycompat.bytesio()
245 > ui.fout = pycompat.bytesio()
246 > ui.status(b'status\n')
246 > ui.status(b'status\n')
247 > ui.ferr = pycompat.bytesio()
247 > ui.ferr = pycompat.bytesio()
248 > ui.warn(b'warn\n')
248 > ui.warn(b'warn\n')
249 > out.write(b'stdout: %s' % ui.fout.getvalue())
249 > out.write(b'stdout: %s' % ui.fout.getvalue())
250 > out.write(b'stderr: %s' % ui.ferr.getvalue())
250 > out.write(b'stderr: %s' % ui.ferr.getvalue())
251 > EOF
251 > EOF
252 $ hg --config extensions.capui=capui.py --config ui.message-output=stdio capui
252 $ hg --config extensions.capui=capui.py --config ui.message-output=stdio capui
253 stdout: status
253 stdout: status
254 stderr: warn
254 stderr: warn
@@ -1,439 +1,439 b''
1 Show all commands except debug commands
1 Show all commands except debug commands
2 $ hg debugcomplete
2 $ hg debugcomplete
3 abort
3 abort
4 add
4 add
5 addremove
5 addremove
6 annotate
6 annotate
7 archive
7 archive
8 backout
8 backout
9 bisect
9 bisect
10 bookmarks
10 bookmarks
11 branch
11 branch
12 branches
12 branches
13 bundle
13 bundle
14 cat
14 cat
15 clone
15 clone
16 commit
16 commit
17 config
17 config
18 continue
18 continue
19 copy
19 copy
20 diff
20 diff
21 export
21 export
22 files
22 files
23 forget
23 forget
24 graft
24 graft
25 grep
25 grep
26 heads
26 heads
27 help
27 help
28 identify
28 identify
29 import
29 import
30 incoming
30 incoming
31 init
31 init
32 locate
32 locate
33 log
33 log
34 manifest
34 manifest
35 merge
35 merge
36 outgoing
36 outgoing
37 parents
37 parents
38 paths
38 paths
39 phase
39 phase
40 pull
40 pull
41 push
41 push
42 recover
42 recover
43 remove
43 remove
44 rename
44 rename
45 resolve
45 resolve
46 revert
46 revert
47 rollback
47 rollback
48 root
48 root
49 serve
49 serve
50 shelve
50 shelve
51 status
51 status
52 summary
52 summary
53 tag
53 tag
54 tags
54 tags
55 tip
55 tip
56 unbundle
56 unbundle
57 unshelve
57 unshelve
58 update
58 update
59 verify
59 verify
60 version
60 version
61
61
62 Show all commands that start with "a"
62 Show all commands that start with "a"
63 $ hg debugcomplete a
63 $ hg debugcomplete a
64 abort
64 abort
65 add
65 add
66 addremove
66 addremove
67 annotate
67 annotate
68 archive
68 archive
69
69
70 Do not show debug commands if there are other candidates
70 Do not show debug commands if there are other candidates
71 $ hg debugcomplete d
71 $ hg debugcomplete d
72 diff
72 diff
73
73
74 Show debug commands if there are no other candidates
74 Show debug commands if there are no other candidates
75 $ hg debugcomplete debug
75 $ hg debugcomplete debug
76 debugancestor
76 debugancestor
77 debugantivirusrunning
77 debugantivirusrunning
78 debugapplystreamclonebundle
78 debugapplystreamclonebundle
79 debugbackupbundle
79 debugbackupbundle
80 debugbuilddag
80 debugbuilddag
81 debugbundle
81 debugbundle
82 debugcapabilities
82 debugcapabilities
83 debugchangedfiles
83 debugchangedfiles
84 debugcheckstate
84 debugcheckstate
85 debugcolor
85 debugcolor
86 debugcommands
86 debugcommands
87 debugcomplete
87 debugcomplete
88 debugconfig
88 debugconfig
89 debugcreatestreamclonebundle
89 debugcreatestreamclonebundle
90 debugdag
90 debugdag
91 debugdata
91 debugdata
92 debugdate
92 debugdate
93 debugdeltachain
93 debugdeltachain
94 debugdirstate
94 debugdirstate
95 debugdiscovery
95 debugdiscovery
96 debugdownload
96 debugdownload
97 debugextensions
97 debugextensions
98 debugfileset
98 debugfileset
99 debugformat
99 debugformat
100 debugfsinfo
100 debugfsinfo
101 debuggetbundle
101 debuggetbundle
102 debugignore
102 debugignore
103 debugindex
103 debugindex
104 debugindexdot
104 debugindexdot
105 debugindexstats
105 debugindexstats
106 debuginstall
106 debuginstall
107 debugknown
107 debugknown
108 debuglabelcomplete
108 debuglabelcomplete
109 debuglocks
109 debuglocks
110 debugmanifestfulltextcache
110 debugmanifestfulltextcache
111 debugmergestate
111 debugmergestate
112 debugnamecomplete
112 debugnamecomplete
113 debugnodemap
113 debugnodemap
114 debugobsolete
114 debugobsolete
115 debugp1copies
115 debugp1copies
116 debugp2copies
116 debugp2copies
117 debugpathcomplete
117 debugpathcomplete
118 debugpathcopies
118 debugpathcopies
119 debugpeer
119 debugpeer
120 debugpickmergetool
120 debugpickmergetool
121 debugpushkey
121 debugpushkey
122 debugpvec
122 debugpvec
123 debugrebuilddirstate
123 debugrebuilddirstate
124 debugrebuildfncache
124 debugrebuildfncache
125 debugrename
125 debugrename
126 debugrequires
126 debugrequires
127 debugrevlog
127 debugrevlog
128 debugrevlogindex
128 debugrevlogindex
129 debugrevspec
129 debugrevspec
130 debugserve
130 debugserve
131 debugsetparents
131 debugsetparents
132 debugsidedata
132 debugsidedata
133 debugssl
133 debugssl
134 debugstrip
134 debugstrip
135 debugsub
135 debugsub
136 debugsuccessorssets
136 debugsuccessorssets
137 debugtagscache
137 debugtagscache
138 debugtemplate
138 debugtemplate
139 debuguigetpass
139 debuguigetpass
140 debuguiprompt
140 debuguiprompt
141 debugupdatecaches
141 debugupdatecaches
142 debugupgraderepo
142 debugupgraderepo
143 debugwalk
143 debugwalk
144 debugwhyunstable
144 debugwhyunstable
145 debugwireargs
145 debugwireargs
146 debugwireproto
146 debugwireproto
147
147
148 Do not show the alias of a debug command if there are other candidates
148 Do not show the alias of a debug command if there are other candidates
149 (this should hide rawcommit)
149 (this should hide rawcommit)
150 $ hg debugcomplete r
150 $ hg debugcomplete r
151 recover
151 recover
152 remove
152 remove
153 rename
153 rename
154 resolve
154 resolve
155 revert
155 revert
156 rollback
156 rollback
157 root
157 root
158 Show the alias of a debug command if there are no other candidates
158 Show the alias of a debug command if there are no other candidates
159 $ hg debugcomplete rawc
159 $ hg debugcomplete rawc
160
160
161
161
162 Show the global options
162 Show the global options
163 $ hg debugcomplete --options | sort
163 $ hg debugcomplete --options | sort
164 --color
164 --color
165 --config
165 --config
166 --cwd
166 --cwd
167 --debug
167 --debug
168 --debugger
168 --debugger
169 --encoding
169 --encoding
170 --encodingmode
170 --encodingmode
171 --help
171 --help
172 --hidden
172 --hidden
173 --noninteractive
173 --noninteractive
174 --pager
174 --pager
175 --profile
175 --profile
176 --quiet
176 --quiet
177 --repository
177 --repository
178 --time
178 --time
179 --traceback
179 --traceback
180 --verbose
180 --verbose
181 --version
181 --version
182 -R
182 -R
183 -h
183 -h
184 -q
184 -q
185 -v
185 -v
186 -y
186 -y
187
187
188 Show the options for the "serve" command
188 Show the options for the "serve" command
189 $ hg debugcomplete --options serve | sort
189 $ hg debugcomplete --options serve | sort
190 --accesslog
190 --accesslog
191 --address
191 --address
192 --certificate
192 --certificate
193 --cmdserver
193 --cmdserver
194 --color
194 --color
195 --config
195 --config
196 --cwd
196 --cwd
197 --daemon
197 --daemon
198 --daemon-postexec
198 --daemon-postexec
199 --debug
199 --debug
200 --debugger
200 --debugger
201 --encoding
201 --encoding
202 --encodingmode
202 --encodingmode
203 --errorlog
203 --errorlog
204 --help
204 --help
205 --hidden
205 --hidden
206 --ipv6
206 --ipv6
207 --name
207 --name
208 --noninteractive
208 --noninteractive
209 --pager
209 --pager
210 --pid-file
210 --pid-file
211 --port
211 --port
212 --prefix
212 --prefix
213 --print-url
213 --print-url
214 --profile
214 --profile
215 --quiet
215 --quiet
216 --repository
216 --repository
217 --stdio
217 --stdio
218 --style
218 --style
219 --subrepos
219 --subrepos
220 --templates
220 --templates
221 --time
221 --time
222 --traceback
222 --traceback
223 --verbose
223 --verbose
224 --version
224 --version
225 --web-conf
225 --web-conf
226 -6
226 -6
227 -A
227 -A
228 -E
228 -E
229 -R
229 -R
230 -S
230 -S
231 -a
231 -a
232 -d
232 -d
233 -h
233 -h
234 -n
234 -n
235 -p
235 -p
236 -q
236 -q
237 -t
237 -t
238 -v
238 -v
239 -y
239 -y
240
240
241 Show an error if we use --options with an ambiguous abbreviation
241 Show an error if we use --options with an ambiguous abbreviation
242 $ hg debugcomplete --options s
242 $ hg debugcomplete --options s
243 hg: command 's' is ambiguous:
243 hg: command 's' is ambiguous:
244 serve shelve showconfig status summary
244 serve shelve showconfig status summary
245 [255]
245 [10]
246
246
247 Show all commands + options
247 Show all commands + options
248 $ hg debugcommands
248 $ hg debugcommands
249 abort: dry-run
249 abort: dry-run
250 add: include, exclude, subrepos, dry-run
250 add: include, exclude, subrepos, dry-run
251 addremove: similarity, subrepos, include, exclude, dry-run
251 addremove: similarity, subrepos, include, exclude, dry-run
252 annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, skip, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, include, exclude, template
252 annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, skip, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, include, exclude, template
253 archive: no-decode, prefix, rev, type, subrepos, include, exclude
253 archive: no-decode, prefix, rev, type, subrepos, include, exclude
254 backout: merge, commit, no-commit, parent, rev, edit, tool, include, exclude, message, logfile, date, user
254 backout: merge, commit, no-commit, parent, rev, edit, tool, include, exclude, message, logfile, date, user
255 bisect: reset, good, bad, skip, extend, command, noupdate
255 bisect: reset, good, bad, skip, extend, command, noupdate
256 bookmarks: force, rev, delete, rename, inactive, list, template
256 bookmarks: force, rev, delete, rename, inactive, list, template
257 branch: force, clean, rev
257 branch: force, clean, rev
258 branches: active, closed, rev, template
258 branches: active, closed, rev, template
259 bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure
259 bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure
260 cat: output, rev, decode, include, exclude, template
260 cat: output, rev, decode, include, exclude, template
261 clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure
261 clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure
262 commit: addremove, close-branch, amend, secret, edit, force-close-branch, interactive, include, exclude, message, logfile, date, user, subrepos
262 commit: addremove, close-branch, amend, secret, edit, force-close-branch, interactive, include, exclude, message, logfile, date, user, subrepos
263 config: untrusted, edit, local, shared, non-shared, global, template
263 config: untrusted, edit, local, shared, non-shared, global, template
264 continue: dry-run
264 continue: dry-run
265 copy: forget, after, at-rev, force, include, exclude, dry-run
265 copy: forget, after, at-rev, force, include, exclude, dry-run
266 debugancestor:
266 debugancestor:
267 debugantivirusrunning:
267 debugantivirusrunning:
268 debugapplystreamclonebundle:
268 debugapplystreamclonebundle:
269 debugbackupbundle: recover, patch, git, limit, no-merges, stat, graph, style, template
269 debugbackupbundle: recover, patch, git, limit, no-merges, stat, graph, style, template
270 debugbuilddag: mergeable-file, overwritten-file, new-file
270 debugbuilddag: mergeable-file, overwritten-file, new-file
271 debugbundle: all, part-type, spec
271 debugbundle: all, part-type, spec
272 debugcapabilities:
272 debugcapabilities:
273 debugchangedfiles:
273 debugchangedfiles:
274 debugcheckstate:
274 debugcheckstate:
275 debugcolor: style
275 debugcolor: style
276 debugcommands:
276 debugcommands:
277 debugcomplete: options
277 debugcomplete: options
278 debugcreatestreamclonebundle:
278 debugcreatestreamclonebundle:
279 debugdag: tags, branches, dots, spaces
279 debugdag: tags, branches, dots, spaces
280 debugdata: changelog, manifest, dir
280 debugdata: changelog, manifest, dir
281 debugdate: extended
281 debugdate: extended
282 debugdeltachain: changelog, manifest, dir, template
282 debugdeltachain: changelog, manifest, dir, template
283 debugdirstate: nodates, dates, datesort
283 debugdirstate: nodates, dates, datesort
284 debugdiscovery: old, nonheads, rev, seed, ssh, remotecmd, insecure
284 debugdiscovery: old, nonheads, rev, seed, ssh, remotecmd, insecure
285 debugdownload: output
285 debugdownload: output
286 debugextensions: template
286 debugextensions: template
287 debugfileset: rev, all-files, show-matcher, show-stage
287 debugfileset: rev, all-files, show-matcher, show-stage
288 debugformat: template
288 debugformat: template
289 debugfsinfo:
289 debugfsinfo:
290 debuggetbundle: head, common, type
290 debuggetbundle: head, common, type
291 debugignore:
291 debugignore:
292 debugindex: changelog, manifest, dir, template
292 debugindex: changelog, manifest, dir, template
293 debugindexdot: changelog, manifest, dir
293 debugindexdot: changelog, manifest, dir
294 debugindexstats:
294 debugindexstats:
295 debuginstall: template
295 debuginstall: template
296 debugknown:
296 debugknown:
297 debuglabelcomplete:
297 debuglabelcomplete:
298 debuglocks: force-free-lock, force-free-wlock, set-lock, set-wlock
298 debuglocks: force-free-lock, force-free-wlock, set-lock, set-wlock
299 debugmanifestfulltextcache: clear, add
299 debugmanifestfulltextcache: clear, add
300 debugmergestate: style, template
300 debugmergestate: style, template
301 debugnamecomplete:
301 debugnamecomplete:
302 debugnodemap: dump-new, dump-disk, check, metadata
302 debugnodemap: dump-new, dump-disk, check, metadata
303 debugobsolete: flags, record-parents, rev, exclusive, index, delete, date, user, template
303 debugobsolete: flags, record-parents, rev, exclusive, index, delete, date, user, template
304 debugp1copies: rev
304 debugp1copies: rev
305 debugp2copies: rev
305 debugp2copies: rev
306 debugpathcomplete: full, normal, added, removed
306 debugpathcomplete: full, normal, added, removed
307 debugpathcopies: include, exclude
307 debugpathcopies: include, exclude
308 debugpeer:
308 debugpeer:
309 debugpickmergetool: rev, changedelete, include, exclude, tool
309 debugpickmergetool: rev, changedelete, include, exclude, tool
310 debugpushkey:
310 debugpushkey:
311 debugpvec:
311 debugpvec:
312 debugrebuilddirstate: rev, minimal
312 debugrebuilddirstate: rev, minimal
313 debugrebuildfncache:
313 debugrebuildfncache:
314 debugrename: rev
314 debugrename: rev
315 debugrequires:
315 debugrequires:
316 debugrevlog: changelog, manifest, dir, dump
316 debugrevlog: changelog, manifest, dir, dump
317 debugrevlogindex: changelog, manifest, dir, format
317 debugrevlogindex: changelog, manifest, dir, format
318 debugrevspec: optimize, show-revs, show-set, show-stage, no-optimized, verify-optimized
318 debugrevspec: optimize, show-revs, show-set, show-stage, no-optimized, verify-optimized
319 debugserve: sshstdio, logiofd, logiofile
319 debugserve: sshstdio, logiofd, logiofile
320 debugsetparents:
320 debugsetparents:
321 debugsidedata: changelog, manifest, dir
321 debugsidedata: changelog, manifest, dir
322 debugssl:
322 debugssl:
323 debugstrip: rev, force, no-backup, nobackup, , keep, bookmark, soft
323 debugstrip: rev, force, no-backup, nobackup, , keep, bookmark, soft
324 debugsub: rev
324 debugsub: rev
325 debugsuccessorssets: closest
325 debugsuccessorssets: closest
326 debugtagscache:
326 debugtagscache:
327 debugtemplate: rev, define
327 debugtemplate: rev, define
328 debuguigetpass: prompt
328 debuguigetpass: prompt
329 debuguiprompt: prompt
329 debuguiprompt: prompt
330 debugupdatecaches:
330 debugupdatecaches:
331 debugupgraderepo: optimize, run, backup, changelog, manifest, filelogs
331 debugupgraderepo: optimize, run, backup, changelog, manifest, filelogs
332 debugwalk: include, exclude
332 debugwalk: include, exclude
333 debugwhyunstable:
333 debugwhyunstable:
334 debugwireargs: three, four, five, ssh, remotecmd, insecure
334 debugwireargs: three, four, five, ssh, remotecmd, insecure
335 debugwireproto: localssh, peer, noreadstderr, nologhandshake, ssh, remotecmd, insecure
335 debugwireproto: localssh, peer, noreadstderr, nologhandshake, ssh, remotecmd, insecure
336 diff: rev, from, to, change, text, git, binary, nodates, noprefix, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, unified, stat, root, include, exclude, subrepos
336 diff: rev, from, to, change, text, git, binary, nodates, noprefix, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, unified, stat, root, include, exclude, subrepos
337 export: bookmark, output, switch-parent, rev, text, git, binary, nodates, template
337 export: bookmark, output, switch-parent, rev, text, git, binary, nodates, template
338 files: rev, print0, include, exclude, template, subrepos
338 files: rev, print0, include, exclude, template, subrepos
339 forget: interactive, include, exclude, dry-run
339 forget: interactive, include, exclude, dry-run
340 graft: rev, base, continue, stop, abort, edit, log, no-commit, force, currentdate, currentuser, date, user, tool, dry-run
340 graft: rev, base, continue, stop, abort, edit, log, no-commit, force, currentdate, currentuser, date, user, tool, dry-run
341 grep: print0, all, diff, text, follow, ignore-case, files-with-matches, line-number, rev, all-files, user, date, template, include, exclude
341 grep: print0, all, diff, text, follow, ignore-case, files-with-matches, line-number, rev, all-files, user, date, template, include, exclude
342 heads: rev, topo, active, closed, style, template
342 heads: rev, topo, active, closed, style, template
343 help: extension, command, keyword, system
343 help: extension, command, keyword, system
344 identify: rev, num, id, branch, tags, bookmarks, ssh, remotecmd, insecure, template
344 identify: rev, num, id, branch, tags, bookmarks, ssh, remotecmd, insecure, template
345 import: strip, base, secret, edit, force, no-commit, bypass, partial, exact, prefix, import-branch, message, logfile, date, user, similarity
345 import: strip, base, secret, edit, force, no-commit, bypass, partial, exact, prefix, import-branch, message, logfile, date, user, similarity
346 incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
346 incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
347 init: ssh, remotecmd, insecure
347 init: ssh, remotecmd, insecure
348 locate: rev, print0, fullpath, include, exclude
348 locate: rev, print0, fullpath, include, exclude
349 log: follow, follow-first, date, copies, keyword, rev, line-range, removed, only-merges, user, only-branch, branch, bookmark, prune, patch, git, limit, no-merges, stat, graph, style, template, include, exclude
349 log: follow, follow-first, date, copies, keyword, rev, line-range, removed, only-merges, user, only-branch, branch, bookmark, prune, patch, git, limit, no-merges, stat, graph, style, template, include, exclude
350 manifest: rev, all, template
350 manifest: rev, all, template
351 merge: force, rev, preview, abort, tool
351 merge: force, rev, preview, abort, tool
352 outgoing: force, rev, newest-first, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
352 outgoing: force, rev, newest-first, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
353 parents: rev, style, template
353 parents: rev, style, template
354 paths: template
354 paths: template
355 phase: public, draft, secret, force, rev
355 phase: public, draft, secret, force, rev
356 pull: update, force, confirm, rev, bookmark, branch, ssh, remotecmd, insecure
356 pull: update, force, confirm, rev, bookmark, branch, ssh, remotecmd, insecure
357 push: force, rev, bookmark, all-bookmarks, branch, new-branch, pushvars, publish, ssh, remotecmd, insecure
357 push: force, rev, bookmark, all-bookmarks, branch, new-branch, pushvars, publish, ssh, remotecmd, insecure
358 recover: verify
358 recover: verify
359 remove: after, force, subrepos, include, exclude, dry-run
359 remove: after, force, subrepos, include, exclude, dry-run
360 rename: after, at-rev, force, include, exclude, dry-run
360 rename: after, at-rev, force, include, exclude, dry-run
361 resolve: all, list, mark, unmark, no-status, re-merge, tool, include, exclude, template
361 resolve: all, list, mark, unmark, no-status, re-merge, tool, include, exclude, template
362 revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
362 revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
363 rollback: dry-run, force
363 rollback: dry-run, force
364 root: template
364 root: template
365 serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, ipv6, certificate, print-url, subrepos
365 serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, ipv6, certificate, print-url, subrepos
366 shelve: addremove, unknown, cleanup, date, delete, edit, keep, list, message, name, patch, interactive, stat, include, exclude
366 shelve: addremove, unknown, cleanup, date, delete, edit, keep, list, message, name, patch, interactive, stat, include, exclude
367 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, terse, copies, print0, rev, change, include, exclude, subrepos, template
367 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, terse, copies, print0, rev, change, include, exclude, subrepos, template
368 summary: remote
368 summary: remote
369 tag: force, local, rev, remove, edit, message, date, user
369 tag: force, local, rev, remove, edit, message, date, user
370 tags: template
370 tags: template
371 tip: patch, git, style, template
371 tip: patch, git, style, template
372 unbundle: update
372 unbundle: update
373 unshelve: abort, continue, interactive, keep, name, tool, date
373 unshelve: abort, continue, interactive, keep, name, tool, date
374 update: clean, check, merge, date, rev, tool
374 update: clean, check, merge, date, rev, tool
375 verify: full
375 verify: full
376 version: template
376 version: template
377
377
378 $ hg init a
378 $ hg init a
379 $ cd a
379 $ cd a
380 $ echo fee > fee
380 $ echo fee > fee
381 $ hg ci -q -Amfee
381 $ hg ci -q -Amfee
382 $ hg tag fee
382 $ hg tag fee
383 $ mkdir fie
383 $ mkdir fie
384 $ echo dead > fie/dead
384 $ echo dead > fie/dead
385 $ echo live > fie/live
385 $ echo live > fie/live
386 $ hg bookmark fo
386 $ hg bookmark fo
387 $ hg branch -q fie
387 $ hg branch -q fie
388 $ hg ci -q -Amfie
388 $ hg ci -q -Amfie
389 $ echo fo > fo
389 $ echo fo > fo
390 $ hg branch -qf default
390 $ hg branch -qf default
391 $ hg ci -q -Amfo
391 $ hg ci -q -Amfo
392 $ echo Fum > Fum
392 $ echo Fum > Fum
393 $ hg ci -q -AmFum
393 $ hg ci -q -AmFum
394 $ hg bookmark Fum
394 $ hg bookmark Fum
395
395
396 Test debugpathcomplete
396 Test debugpathcomplete
397
397
398 $ hg debugpathcomplete f
398 $ hg debugpathcomplete f
399 fee
399 fee
400 fie
400 fie
401 fo
401 fo
402 $ hg debugpathcomplete -f f
402 $ hg debugpathcomplete -f f
403 fee
403 fee
404 fie/dead
404 fie/dead
405 fie/live
405 fie/live
406 fo
406 fo
407
407
408 $ hg rm Fum
408 $ hg rm Fum
409 $ hg debugpathcomplete -r F
409 $ hg debugpathcomplete -r F
410 Fum
410 Fum
411
411
412 Test debugnamecomplete
412 Test debugnamecomplete
413
413
414 $ hg debugnamecomplete
414 $ hg debugnamecomplete
415 Fum
415 Fum
416 default
416 default
417 fee
417 fee
418 fie
418 fie
419 fo
419 fo
420 tip
420 tip
421 $ hg debugnamecomplete f
421 $ hg debugnamecomplete f
422 fee
422 fee
423 fie
423 fie
424 fo
424 fo
425
425
426 Test debuglabelcomplete, a deprecated name for debugnamecomplete that is still
426 Test debuglabelcomplete, a deprecated name for debugnamecomplete that is still
427 used for completions in some shells.
427 used for completions in some shells.
428
428
429 $ hg debuglabelcomplete
429 $ hg debuglabelcomplete
430 Fum
430 Fum
431 default
431 default
432 fee
432 fee
433 fie
433 fie
434 fo
434 fo
435 tip
435 tip
436 $ hg debuglabelcomplete f
436 $ hg debuglabelcomplete f
437 fee
437 fee
438 fie
438 fie
439 fo
439 fo
@@ -1,221 +1,221 b''
1 test command parsing and dispatch
1 test command parsing and dispatch
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5
5
6 Redundant options used to crash (issue436):
6 Redundant options used to crash (issue436):
7 $ hg -v log -v
7 $ hg -v log -v
8 $ hg -v log -v x
8 $ hg -v log -v x
9
9
10 $ echo a > a
10 $ echo a > a
11 $ hg ci -Ama
11 $ hg ci -Ama
12 adding a
12 adding a
13
13
14 Missing arg:
14 Missing arg:
15
15
16 $ hg cat
16 $ hg cat
17 hg cat: invalid arguments
17 hg cat: invalid arguments
18 hg cat [OPTION]... FILE...
18 hg cat [OPTION]... FILE...
19
19
20 output the current or given revision of files
20 output the current or given revision of files
21
21
22 options ([+] can be repeated):
22 options ([+] can be repeated):
23
23
24 -o --output FORMAT print output to file with formatted name
24 -o --output FORMAT print output to file with formatted name
25 -r --rev REV print the given revision
25 -r --rev REV print the given revision
26 --decode apply any matching decode filter
26 --decode apply any matching decode filter
27 -I --include PATTERN [+] include names matching the given patterns
27 -I --include PATTERN [+] include names matching the given patterns
28 -X --exclude PATTERN [+] exclude names matching the given patterns
28 -X --exclude PATTERN [+] exclude names matching the given patterns
29 -T --template TEMPLATE display with template
29 -T --template TEMPLATE display with template
30
30
31 (use 'hg cat -h' to show more help)
31 (use 'hg cat -h' to show more help)
32 [255]
32 [10]
33
33
34 Missing parameter for early option:
34 Missing parameter for early option:
35
35
36 $ hg log -R 2>&1 | grep 'hg log'
36 $ hg log -R 2>&1 | grep 'hg log'
37 hg log: option -R requires argument
37 hg log: option -R requires argument
38 hg log [OPTION]... [FILE]
38 hg log [OPTION]... [FILE]
39 (use 'hg log -h' to show more help)
39 (use 'hg log -h' to show more help)
40
40
41 "--" may be an option value:
41 "--" may be an option value:
42
42
43 $ hg -R -- log
43 $ hg -R -- log
44 abort: repository -- not found
44 abort: repository -- not found
45 [255]
45 [255]
46 $ hg log -R --
46 $ hg log -R --
47 abort: repository -- not found
47 abort: repository -- not found
48 [255]
48 [255]
49 $ hg log -T --
49 $ hg log -T --
50 -- (no-eol)
50 -- (no-eol)
51 $ hg log -T -- -k nomatch
51 $ hg log -T -- -k nomatch
52
52
53 Parsing of early options should stop at "--":
53 Parsing of early options should stop at "--":
54
54
55 $ hg cat -- --config=hooks.pre-cat=false
55 $ hg cat -- --config=hooks.pre-cat=false
56 --config=hooks.pre-cat=false: no such file in rev cb9a9f314b8b
56 --config=hooks.pre-cat=false: no such file in rev cb9a9f314b8b
57 [1]
57 [1]
58 $ hg cat -- --debugger
58 $ hg cat -- --debugger
59 --debugger: no such file in rev cb9a9f314b8b
59 --debugger: no such file in rev cb9a9f314b8b
60 [1]
60 [1]
61
61
62 Unparsable form of early options:
62 Unparsable form of early options:
63
63
64 $ hg cat --debugg
64 $ hg cat --debugg
65 abort: option --debugger may not be abbreviated
65 abort: option --debugger may not be abbreviated
66 [10]
66 [10]
67
67
68 Parsing failure of early options should be detected before executing the
68 Parsing failure of early options should be detected before executing the
69 command:
69 command:
70
70
71 $ hg log -b '--config=hooks.pre-log=false' default
71 $ hg log -b '--config=hooks.pre-log=false' default
72 abort: option --config may not be abbreviated
72 abort: option --config may not be abbreviated
73 [10]
73 [10]
74 $ hg log -b -R. default
74 $ hg log -b -R. default
75 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
75 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
76 [10]
76 [10]
77 $ hg log --cwd .. -b --cwd=. default
77 $ hg log --cwd .. -b --cwd=. default
78 abort: option --cwd may not be abbreviated
78 abort: option --cwd may not be abbreviated
79 [10]
79 [10]
80
80
81 However, we can't prevent it from loading extensions and configs:
81 However, we can't prevent it from loading extensions and configs:
82
82
83 $ cat <<EOF > bad.py
83 $ cat <<EOF > bad.py
84 > raise Exception('bad')
84 > raise Exception('bad')
85 > EOF
85 > EOF
86 $ hg log -b '--config=extensions.bad=bad.py' default
86 $ hg log -b '--config=extensions.bad=bad.py' default
87 *** failed to import extension bad from bad.py: bad
87 *** failed to import extension bad from bad.py: bad
88 abort: option --config may not be abbreviated
88 abort: option --config may not be abbreviated
89 [10]
89 [10]
90
90
91 $ mkdir -p badrepo/.hg
91 $ mkdir -p badrepo/.hg
92 $ echo 'invalid-syntax' > badrepo/.hg/hgrc
92 $ echo 'invalid-syntax' > badrepo/.hg/hgrc
93 $ hg log -b -Rbadrepo default
93 $ hg log -b -Rbadrepo default
94 config error at badrepo/.hg/hgrc:1: invalid-syntax
94 config error at badrepo/.hg/hgrc:1: invalid-syntax
95 [30]
95 [30]
96
96
97 $ hg log -b --cwd=inexistent default
97 $ hg log -b --cwd=inexistent default
98 abort: $ENOENT$: 'inexistent'
98 abort: $ENOENT$: 'inexistent'
99 [255]
99 [255]
100
100
101 $ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback'
101 $ hg log -b '--config=ui.traceback=yes' 2>&1 | grep '^Traceback'
102 Traceback (most recent call last):
102 Traceback (most recent call last):
103 $ hg log -b '--config=profiling.enabled=yes' 2>&1 | grep -i sample
103 $ hg log -b '--config=profiling.enabled=yes' 2>&1 | grep -i sample
104 Sample count: .*|No samples recorded\. (re)
104 Sample count: .*|No samples recorded\. (re)
105
105
106 Early options can't be specified in [aliases] and [defaults] because they are
106 Early options can't be specified in [aliases] and [defaults] because they are
107 applied before the command name is resolved:
107 applied before the command name is resolved:
108
108
109 $ hg log -b '--config=alias.log=log --config=hooks.pre-log=false'
109 $ hg log -b '--config=alias.log=log --config=hooks.pre-log=false'
110 hg log: option -b not recognized
110 hg log: option -b not recognized
111 error in definition for alias 'log': --config may only be given on the command
111 error in definition for alias 'log': --config may only be given on the command
112 line
112 line
113 [255]
113 [10]
114
114
115 $ hg log -b '--config=defaults.log=--config=hooks.pre-log=false'
115 $ hg log -b '--config=defaults.log=--config=hooks.pre-log=false'
116 abort: option --config may not be abbreviated
116 abort: option --config may not be abbreviated
117 [10]
117 [10]
118
118
119 Shell aliases bypass any command parsing rules but for the early one:
119 Shell aliases bypass any command parsing rules but for the early one:
120
120
121 $ hg log -b '--config=alias.log=!echo howdy'
121 $ hg log -b '--config=alias.log=!echo howdy'
122 howdy
122 howdy
123
123
124 Early options must come first if HGPLAIN=+strictflags is specified:
124 Early options must come first if HGPLAIN=+strictflags is specified:
125 (BUG: chg cherry-picks early options to pass them as a server command)
125 (BUG: chg cherry-picks early options to pass them as a server command)
126
126
127 #if no-chg
127 #if no-chg
128 $ HGPLAIN=+strictflags hg log -b --config='hooks.pre-log=false' default
128 $ HGPLAIN=+strictflags hg log -b --config='hooks.pre-log=false' default
129 abort: unknown revision '--config=hooks.pre-log=false'
129 abort: unknown revision '--config=hooks.pre-log=false'
130 [255]
130 [255]
131 $ HGPLAIN=+strictflags hg log -b -R. default
131 $ HGPLAIN=+strictflags hg log -b -R. default
132 abort: unknown revision '-R.'
132 abort: unknown revision '-R.'
133 [255]
133 [255]
134 $ HGPLAIN=+strictflags hg log -b --cwd=. default
134 $ HGPLAIN=+strictflags hg log -b --cwd=. default
135 abort: unknown revision '--cwd=.'
135 abort: unknown revision '--cwd=.'
136 [255]
136 [255]
137 #endif
137 #endif
138 $ HGPLAIN=+strictflags hg log -b --debugger default
138 $ HGPLAIN=+strictflags hg log -b --debugger default
139 abort: unknown revision '--debugger'
139 abort: unknown revision '--debugger'
140 [255]
140 [255]
141 $ HGPLAIN=+strictflags hg log -b --config='alias.log=!echo pwned' default
141 $ HGPLAIN=+strictflags hg log -b --config='alias.log=!echo pwned' default
142 abort: unknown revision '--config=alias.log=!echo pwned'
142 abort: unknown revision '--config=alias.log=!echo pwned'
143 [255]
143 [255]
144
144
145 $ HGPLAIN=+strictflags hg log --config='hooks.pre-log=false' -b default
145 $ HGPLAIN=+strictflags hg log --config='hooks.pre-log=false' -b default
146 abort: option --config may not be abbreviated
146 abort: option --config may not be abbreviated
147 [10]
147 [10]
148 $ HGPLAIN=+strictflags hg log -q --cwd=.. -b default
148 $ HGPLAIN=+strictflags hg log -q --cwd=.. -b default
149 abort: option --cwd may not be abbreviated
149 abort: option --cwd may not be abbreviated
150 [10]
150 [10]
151 $ HGPLAIN=+strictflags hg log -q -R . -b default
151 $ HGPLAIN=+strictflags hg log -q -R . -b default
152 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
152 abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo
153 [10]
153 [10]
154
154
155 $ HGPLAIN=+strictflags hg --config='hooks.pre-log=false' log -b default
155 $ HGPLAIN=+strictflags hg --config='hooks.pre-log=false' log -b default
156 abort: pre-log hook exited with status 1
156 abort: pre-log hook exited with status 1
157 [255]
157 [255]
158 $ HGPLAIN=+strictflags hg --cwd .. -q -Ra log -b default
158 $ HGPLAIN=+strictflags hg --cwd .. -q -Ra log -b default
159 0:cb9a9f314b8b
159 0:cb9a9f314b8b
160 $ HGPLAIN=+strictflags hg --cwd .. -q --repository a log -b default
160 $ HGPLAIN=+strictflags hg --cwd .. -q --repository a log -b default
161 0:cb9a9f314b8b
161 0:cb9a9f314b8b
162 $ HGPLAIN=+strictflags hg --cwd .. -q --repo a log -b default
162 $ HGPLAIN=+strictflags hg --cwd .. -q --repo a log -b default
163 0:cb9a9f314b8b
163 0:cb9a9f314b8b
164
164
165 For compatibility reasons, HGPLAIN=+strictflags is not enabled by plain HGPLAIN:
165 For compatibility reasons, HGPLAIN=+strictflags is not enabled by plain HGPLAIN:
166
166
167 $ HGPLAIN= hg log --config='hooks.pre-log=false' -b default
167 $ HGPLAIN= hg log --config='hooks.pre-log=false' -b default
168 abort: pre-log hook exited with status 1
168 abort: pre-log hook exited with status 1
169 [255]
169 [255]
170 $ HGPLAINEXCEPT= hg log --cwd .. -q -Ra -b default
170 $ HGPLAINEXCEPT= hg log --cwd .. -q -Ra -b default
171 0:cb9a9f314b8b
171 0:cb9a9f314b8b
172
172
173 [defaults]
173 [defaults]
174
174
175 $ hg cat a
175 $ hg cat a
176 a
176 a
177 $ cat >> $HGRCPATH <<EOF
177 $ cat >> $HGRCPATH <<EOF
178 > [defaults]
178 > [defaults]
179 > cat = -r null
179 > cat = -r null
180 > EOF
180 > EOF
181 $ hg cat a
181 $ hg cat a
182 a: no such file in rev 000000000000
182 a: no such file in rev 000000000000
183 [1]
183 [1]
184
184
185 $ cd "$TESTTMP"
185 $ cd "$TESTTMP"
186
186
187 OSError "No such file or directory" / "The system cannot find the path
187 OSError "No such file or directory" / "The system cannot find the path
188 specified" should include filename even when it is empty
188 specified" should include filename even when it is empty
189
189
190 $ hg -R a archive ''
190 $ hg -R a archive ''
191 abort: $ENOENT$: '' (no-windows !)
191 abort: $ENOENT$: '' (no-windows !)
192 abort: $ENOTDIR$: '' (windows !)
192 abort: $ENOTDIR$: '' (windows !)
193 [255]
193 [255]
194
194
195 #if no-outer-repo
195 #if no-outer-repo
196
196
197 No repo:
197 No repo:
198
198
199 $ hg cat
199 $ hg cat
200 abort: no repository found in '$TESTTMP' (.hg not found)
200 abort: no repository found in '$TESTTMP' (.hg not found)
201 [10]
201 [10]
202
202
203 #endif
203 #endif
204
204
205 #if rmcwd
205 #if rmcwd
206
206
207 Current directory removed:
207 Current directory removed:
208
208
209 $ mkdir $TESTTMP/repo1
209 $ mkdir $TESTTMP/repo1
210 $ cd $TESTTMP/repo1
210 $ cd $TESTTMP/repo1
211 $ rm -rf $TESTTMP/repo1
211 $ rm -rf $TESTTMP/repo1
212
212
213 The output could be one of the following and something else:
213 The output could be one of the following and something else:
214 chg: abort: failed to getcwd (errno = *) (glob)
214 chg: abort: failed to getcwd (errno = *) (glob)
215 abort: error getting current working directory: * (glob)
215 abort: error getting current working directory: * (glob)
216 sh: 0: getcwd() failed: $ENOENT$
216 sh: 0: getcwd() failed: $ENOENT$
217 Since the exact behavior depends on the shell, only check it returns non-zero.
217 Since the exact behavior depends on the shell, only check it returns non-zero.
218 $ HGDEMANDIMPORT=disable hg version -q 2>/dev/null || false
218 $ HGDEMANDIMPORT=disable hg version -q 2>/dev/null || false
219 [1]
219 [1]
220
220
221 #endif
221 #endif
@@ -1,1908 +1,1908 b''
1 Test basic extension support
1 Test basic extension support
2 $ cat > unflush.py <<EOF
2 $ cat > unflush.py <<EOF
3 > import sys
3 > import sys
4 > from mercurial import pycompat
4 > from mercurial import pycompat
5 > if pycompat.ispy3:
5 > if pycompat.ispy3:
6 > # no changes required
6 > # no changes required
7 > sys.exit(0)
7 > sys.exit(0)
8 > with open(sys.argv[1], 'rb') as f:
8 > with open(sys.argv[1], 'rb') as f:
9 > data = f.read()
9 > data = f.read()
10 > with open(sys.argv[1], 'wb') as f:
10 > with open(sys.argv[1], 'wb') as f:
11 > f.write(data.replace(b', flush=True', b''))
11 > f.write(data.replace(b', flush=True', b''))
12 > EOF
12 > EOF
13
13
14 $ cat > foobar.py <<EOF
14 $ cat > foobar.py <<EOF
15 > import os
15 > import os
16 > from mercurial import commands, exthelper, registrar
16 > from mercurial import commands, exthelper, registrar
17 >
17 >
18 > eh = exthelper.exthelper()
18 > eh = exthelper.exthelper()
19 > eh.configitem(b'tests', b'foo', default=b"Foo")
19 > eh.configitem(b'tests', b'foo', default=b"Foo")
20 >
20 >
21 > uisetup = eh.finaluisetup
21 > uisetup = eh.finaluisetup
22 > uipopulate = eh.finaluipopulate
22 > uipopulate = eh.finaluipopulate
23 > reposetup = eh.finalreposetup
23 > reposetup = eh.finalreposetup
24 > cmdtable = eh.cmdtable
24 > cmdtable = eh.cmdtable
25 > configtable = eh.configtable
25 > configtable = eh.configtable
26 >
26 >
27 > @eh.uisetup
27 > @eh.uisetup
28 > def _uisetup(ui):
28 > def _uisetup(ui):
29 > ui.debug(b"uisetup called [debug]\\n")
29 > ui.debug(b"uisetup called [debug]\\n")
30 > ui.write(b"uisetup called\\n")
30 > ui.write(b"uisetup called\\n")
31 > ui.status(b"uisetup called [status]\\n")
31 > ui.status(b"uisetup called [status]\\n")
32 > ui.flush()
32 > ui.flush()
33 > @eh.uipopulate
33 > @eh.uipopulate
34 > def _uipopulate(ui):
34 > def _uipopulate(ui):
35 > ui._populatecnt = getattr(ui, "_populatecnt", 0) + 1
35 > ui._populatecnt = getattr(ui, "_populatecnt", 0) + 1
36 > ui.write(b"uipopulate called (%d times)\n" % ui._populatecnt)
36 > ui.write(b"uipopulate called (%d times)\n" % ui._populatecnt)
37 > @eh.reposetup
37 > @eh.reposetup
38 > def _reposetup(ui, repo):
38 > def _reposetup(ui, repo):
39 > ui.write(b"reposetup called for %s\\n" % os.path.basename(repo.root))
39 > ui.write(b"reposetup called for %s\\n" % os.path.basename(repo.root))
40 > ui.write(b"ui %s= repo.ui\\n" % (ui == repo.ui and b"=" or b"!"))
40 > ui.write(b"ui %s= repo.ui\\n" % (ui == repo.ui and b"=" or b"!"))
41 > ui.flush()
41 > ui.flush()
42 > @eh.command(b'foo', [], b'hg foo')
42 > @eh.command(b'foo', [], b'hg foo')
43 > def foo(ui, *args, **kwargs):
43 > def foo(ui, *args, **kwargs):
44 > foo = ui.config(b'tests', b'foo')
44 > foo = ui.config(b'tests', b'foo')
45 > ui.write(foo)
45 > ui.write(foo)
46 > ui.write(b"\\n")
46 > ui.write(b"\\n")
47 > @eh.command(b'bar', [], b'hg bar', norepo=True)
47 > @eh.command(b'bar', [], b'hg bar', norepo=True)
48 > def bar(ui, *args, **kwargs):
48 > def bar(ui, *args, **kwargs):
49 > ui.write(b"Bar\\n")
49 > ui.write(b"Bar\\n")
50 > EOF
50 > EOF
51 $ abspath=`pwd`/foobar.py
51 $ abspath=`pwd`/foobar.py
52
52
53 $ mkdir barfoo
53 $ mkdir barfoo
54 $ cp foobar.py barfoo/__init__.py
54 $ cp foobar.py barfoo/__init__.py
55 $ barfoopath=`pwd`/barfoo
55 $ barfoopath=`pwd`/barfoo
56
56
57 $ hg init a
57 $ hg init a
58 $ cd a
58 $ cd a
59 $ echo foo > file
59 $ echo foo > file
60 $ hg add file
60 $ hg add file
61 $ hg commit -m 'add file'
61 $ hg commit -m 'add file'
62
62
63 $ echo '[extensions]' >> $HGRCPATH
63 $ echo '[extensions]' >> $HGRCPATH
64 $ echo "foobar = $abspath" >> $HGRCPATH
64 $ echo "foobar = $abspath" >> $HGRCPATH
65 $ hg foo
65 $ hg foo
66 uisetup called
66 uisetup called
67 uisetup called [status]
67 uisetup called [status]
68 uipopulate called (1 times)
68 uipopulate called (1 times)
69 uipopulate called (1 times)
69 uipopulate called (1 times)
70 uipopulate called (1 times)
70 uipopulate called (1 times)
71 reposetup called for a
71 reposetup called for a
72 ui == repo.ui
72 ui == repo.ui
73 uipopulate called (1 times) (chg !)
73 uipopulate called (1 times) (chg !)
74 uipopulate called (1 times) (chg !)
74 uipopulate called (1 times) (chg !)
75 uipopulate called (1 times) (chg !)
75 uipopulate called (1 times) (chg !)
76 uipopulate called (1 times) (chg !)
76 uipopulate called (1 times) (chg !)
77 uipopulate called (1 times) (chg !)
77 uipopulate called (1 times) (chg !)
78 reposetup called for a (chg !)
78 reposetup called for a (chg !)
79 ui == repo.ui (chg !)
79 ui == repo.ui (chg !)
80 Foo
80 Foo
81 $ hg foo --quiet
81 $ hg foo --quiet
82 uisetup called (no-chg !)
82 uisetup called (no-chg !)
83 uipopulate called (1 times)
83 uipopulate called (1 times)
84 uipopulate called (1 times)
84 uipopulate called (1 times)
85 uipopulate called (1 times) (chg !)
85 uipopulate called (1 times) (chg !)
86 uipopulate called (1 times) (chg !)
86 uipopulate called (1 times) (chg !)
87 uipopulate called (1 times)
87 uipopulate called (1 times)
88 reposetup called for a
88 reposetup called for a
89 ui == repo.ui
89 ui == repo.ui
90 Foo
90 Foo
91 $ hg foo --debug
91 $ hg foo --debug
92 uisetup called [debug] (no-chg !)
92 uisetup called [debug] (no-chg !)
93 uisetup called (no-chg !)
93 uisetup called (no-chg !)
94 uisetup called [status] (no-chg !)
94 uisetup called [status] (no-chg !)
95 uipopulate called (1 times)
95 uipopulate called (1 times)
96 uipopulate called (1 times)
96 uipopulate called (1 times)
97 uipopulate called (1 times) (chg !)
97 uipopulate called (1 times) (chg !)
98 uipopulate called (1 times) (chg !)
98 uipopulate called (1 times) (chg !)
99 uipopulate called (1 times)
99 uipopulate called (1 times)
100 reposetup called for a
100 reposetup called for a
101 ui == repo.ui
101 ui == repo.ui
102 Foo
102 Foo
103
103
104 $ cd ..
104 $ cd ..
105 $ hg clone a b
105 $ hg clone a b
106 uisetup called (no-chg !)
106 uisetup called (no-chg !)
107 uisetup called [status] (no-chg !)
107 uisetup called [status] (no-chg !)
108 uipopulate called (1 times)
108 uipopulate called (1 times)
109 uipopulate called (1 times) (chg !)
109 uipopulate called (1 times) (chg !)
110 uipopulate called (1 times)
110 uipopulate called (1 times)
111 reposetup called for a
111 reposetup called for a
112 ui == repo.ui
112 ui == repo.ui
113 uipopulate called (1 times)
113 uipopulate called (1 times)
114 reposetup called for b
114 reposetup called for b
115 ui == repo.ui
115 ui == repo.ui
116 updating to branch default
116 updating to branch default
117 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
117 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
118
118
119 $ hg bar
119 $ hg bar
120 uisetup called (no-chg !)
120 uisetup called (no-chg !)
121 uisetup called [status] (no-chg !)
121 uisetup called [status] (no-chg !)
122 uipopulate called (1 times)
122 uipopulate called (1 times)
123 uipopulate called (1 times) (chg !)
123 uipopulate called (1 times) (chg !)
124 Bar
124 Bar
125 $ echo 'foobar = !' >> $HGRCPATH
125 $ echo 'foobar = !' >> $HGRCPATH
126
126
127 module/__init__.py-style
127 module/__init__.py-style
128
128
129 $ echo "barfoo = $barfoopath" >> $HGRCPATH
129 $ echo "barfoo = $barfoopath" >> $HGRCPATH
130 $ cd a
130 $ cd a
131 $ hg foo
131 $ hg foo
132 uisetup called
132 uisetup called
133 uisetup called [status]
133 uisetup called [status]
134 uipopulate called (1 times)
134 uipopulate called (1 times)
135 uipopulate called (1 times)
135 uipopulate called (1 times)
136 uipopulate called (1 times)
136 uipopulate called (1 times)
137 reposetup called for a
137 reposetup called for a
138 ui == repo.ui
138 ui == repo.ui
139 uipopulate called (1 times) (chg !)
139 uipopulate called (1 times) (chg !)
140 uipopulate called (1 times) (chg !)
140 uipopulate called (1 times) (chg !)
141 uipopulate called (1 times) (chg !)
141 uipopulate called (1 times) (chg !)
142 uipopulate called (1 times) (chg !)
142 uipopulate called (1 times) (chg !)
143 uipopulate called (1 times) (chg !)
143 uipopulate called (1 times) (chg !)
144 reposetup called for a (chg !)
144 reposetup called for a (chg !)
145 ui == repo.ui (chg !)
145 ui == repo.ui (chg !)
146 Foo
146 Foo
147 $ echo 'barfoo = !' >> $HGRCPATH
147 $ echo 'barfoo = !' >> $HGRCPATH
148
148
149 Check that extensions are loaded in phases:
149 Check that extensions are loaded in phases:
150
150
151 $ cat > foo.py <<EOF
151 $ cat > foo.py <<EOF
152 > from __future__ import print_function
152 > from __future__ import print_function
153 > import os
153 > import os
154 > from mercurial import exthelper
154 > from mercurial import exthelper
155 > from mercurial.utils import procutil
155 > from mercurial.utils import procutil
156 >
156 >
157 > def write(msg):
157 > def write(msg):
158 > procutil.stdout.write(msg)
158 > procutil.stdout.write(msg)
159 > procutil.stdout.flush()
159 > procutil.stdout.flush()
160 >
160 >
161 > name = os.path.basename(__file__).rsplit('.', 1)[0]
161 > name = os.path.basename(__file__).rsplit('.', 1)[0]
162 > bytesname = name.encode('utf-8')
162 > bytesname = name.encode('utf-8')
163 > write(b"1) %s imported\n" % bytesname)
163 > write(b"1) %s imported\n" % bytesname)
164 > eh = exthelper.exthelper()
164 > eh = exthelper.exthelper()
165 > @eh.uisetup
165 > @eh.uisetup
166 > def _uisetup(ui):
166 > def _uisetup(ui):
167 > write(b"2) %s uisetup\n" % bytesname)
167 > write(b"2) %s uisetup\n" % bytesname)
168 > @eh.extsetup
168 > @eh.extsetup
169 > def _extsetup(ui):
169 > def _extsetup(ui):
170 > write(b"3) %s extsetup\n" % bytesname)
170 > write(b"3) %s extsetup\n" % bytesname)
171 > @eh.uipopulate
171 > @eh.uipopulate
172 > def _uipopulate(ui):
172 > def _uipopulate(ui):
173 > write(b"4) %s uipopulate\n" % bytesname)
173 > write(b"4) %s uipopulate\n" % bytesname)
174 > @eh.reposetup
174 > @eh.reposetup
175 > def _reposetup(ui, repo):
175 > def _reposetup(ui, repo):
176 > write(b"5) %s reposetup\n" % bytesname)
176 > write(b"5) %s reposetup\n" % bytesname)
177 >
177 >
178 > extsetup = eh.finalextsetup
178 > extsetup = eh.finalextsetup
179 > reposetup = eh.finalreposetup
179 > reposetup = eh.finalreposetup
180 > uipopulate = eh.finaluipopulate
180 > uipopulate = eh.finaluipopulate
181 > uisetup = eh.finaluisetup
181 > uisetup = eh.finaluisetup
182 > revsetpredicate = eh.revsetpredicate
182 > revsetpredicate = eh.revsetpredicate
183 >
183 >
184 > # custom predicate to check registration of functions at loading
184 > # custom predicate to check registration of functions at loading
185 > from mercurial import (
185 > from mercurial import (
186 > smartset,
186 > smartset,
187 > )
187 > )
188 > @eh.revsetpredicate(bytesname, safe=True) # safe=True for query via hgweb
188 > @eh.revsetpredicate(bytesname, safe=True) # safe=True for query via hgweb
189 > def custompredicate(repo, subset, x):
189 > def custompredicate(repo, subset, x):
190 > return smartset.baseset([r for r in subset if r in {0}])
190 > return smartset.baseset([r for r in subset if r in {0}])
191 > EOF
191 > EOF
192 $ "$PYTHON" $TESTTMP/unflush.py foo.py
192 $ "$PYTHON" $TESTTMP/unflush.py foo.py
193
193
194 $ cp foo.py bar.py
194 $ cp foo.py bar.py
195 $ echo 'foo = foo.py' >> $HGRCPATH
195 $ echo 'foo = foo.py' >> $HGRCPATH
196 $ echo 'bar = bar.py' >> $HGRCPATH
196 $ echo 'bar = bar.py' >> $HGRCPATH
197
197
198 Check normal command's load order of extensions and registration of functions
198 Check normal command's load order of extensions and registration of functions
199
199
200 On chg server, extension should be first set up by the server. Then
200 On chg server, extension should be first set up by the server. Then
201 object-level setup should follow in the worker process.
201 object-level setup should follow in the worker process.
202
202
203 $ hg log -r "foo() and bar()" -q
203 $ hg log -r "foo() and bar()" -q
204 1) foo imported
204 1) foo imported
205 1) bar imported
205 1) bar imported
206 2) foo uisetup
206 2) foo uisetup
207 2) bar uisetup
207 2) bar uisetup
208 3) foo extsetup
208 3) foo extsetup
209 3) bar extsetup
209 3) bar extsetup
210 4) foo uipopulate
210 4) foo uipopulate
211 4) bar uipopulate
211 4) bar uipopulate
212 4) foo uipopulate
212 4) foo uipopulate
213 4) bar uipopulate
213 4) bar uipopulate
214 4) foo uipopulate
214 4) foo uipopulate
215 4) bar uipopulate
215 4) bar uipopulate
216 5) foo reposetup
216 5) foo reposetup
217 5) bar reposetup
217 5) bar reposetup
218 4) foo uipopulate (chg !)
218 4) foo uipopulate (chg !)
219 4) bar uipopulate (chg !)
219 4) bar uipopulate (chg !)
220 4) foo uipopulate (chg !)
220 4) foo uipopulate (chg !)
221 4) bar uipopulate (chg !)
221 4) bar uipopulate (chg !)
222 4) foo uipopulate (chg !)
222 4) foo uipopulate (chg !)
223 4) bar uipopulate (chg !)
223 4) bar uipopulate (chg !)
224 4) foo uipopulate (chg !)
224 4) foo uipopulate (chg !)
225 4) bar uipopulate (chg !)
225 4) bar uipopulate (chg !)
226 4) foo uipopulate (chg !)
226 4) foo uipopulate (chg !)
227 4) bar uipopulate (chg !)
227 4) bar uipopulate (chg !)
228 5) foo reposetup (chg !)
228 5) foo reposetup (chg !)
229 5) bar reposetup (chg !)
229 5) bar reposetup (chg !)
230 0:c24b9ac61126
230 0:c24b9ac61126
231
231
232 Check hgweb's load order of extensions and registration of functions
232 Check hgweb's load order of extensions and registration of functions
233
233
234 $ cat > hgweb.cgi <<EOF
234 $ cat > hgweb.cgi <<EOF
235 > #!$PYTHON
235 > #!$PYTHON
236 > from mercurial import demandimport; demandimport.enable()
236 > from mercurial import demandimport; demandimport.enable()
237 > from mercurial.hgweb import hgweb
237 > from mercurial.hgweb import hgweb
238 > from mercurial.hgweb import wsgicgi
238 > from mercurial.hgweb import wsgicgi
239 > application = hgweb(b'.', b'test repo')
239 > application = hgweb(b'.', b'test repo')
240 > wsgicgi.launch(application)
240 > wsgicgi.launch(application)
241 > EOF
241 > EOF
242 $ . "$TESTDIR/cgienv"
242 $ . "$TESTDIR/cgienv"
243
243
244 $ PATH_INFO='/' SCRIPT_NAME='' "$PYTHON" hgweb.cgi \
244 $ PATH_INFO='/' SCRIPT_NAME='' "$PYTHON" hgweb.cgi \
245 > | grep '^[0-9]) ' # ignores HTML output
245 > | grep '^[0-9]) ' # ignores HTML output
246 1) foo imported
246 1) foo imported
247 1) bar imported
247 1) bar imported
248 2) foo uisetup
248 2) foo uisetup
249 2) bar uisetup
249 2) bar uisetup
250 3) foo extsetup
250 3) foo extsetup
251 3) bar extsetup
251 3) bar extsetup
252 4) foo uipopulate
252 4) foo uipopulate
253 4) bar uipopulate
253 4) bar uipopulate
254 4) foo uipopulate
254 4) foo uipopulate
255 4) bar uipopulate
255 4) bar uipopulate
256 5) foo reposetup
256 5) foo reposetup
257 5) bar reposetup
257 5) bar reposetup
258
258
259 (check that revset predicate foo() and bar() are available)
259 (check that revset predicate foo() and bar() are available)
260
260
261 #if msys
261 #if msys
262 $ PATH_INFO='//shortlog'
262 $ PATH_INFO='//shortlog'
263 #else
263 #else
264 $ PATH_INFO='/shortlog'
264 $ PATH_INFO='/shortlog'
265 #endif
265 #endif
266 $ export PATH_INFO
266 $ export PATH_INFO
267 $ SCRIPT_NAME='' QUERY_STRING='rev=foo() and bar()' "$PYTHON" hgweb.cgi \
267 $ SCRIPT_NAME='' QUERY_STRING='rev=foo() and bar()' "$PYTHON" hgweb.cgi \
268 > | grep '<a href="/rev/[0-9a-z]*">'
268 > | grep '<a href="/rev/[0-9a-z]*">'
269 <a href="/rev/c24b9ac61126">add file</a>
269 <a href="/rev/c24b9ac61126">add file</a>
270
270
271 $ echo 'foo = !' >> $HGRCPATH
271 $ echo 'foo = !' >> $HGRCPATH
272 $ echo 'bar = !' >> $HGRCPATH
272 $ echo 'bar = !' >> $HGRCPATH
273
273
274 Check "from __future__ import absolute_import" support for external libraries
274 Check "from __future__ import absolute_import" support for external libraries
275
275
276 (import-checker.py reports issues for some of heredoc python code
276 (import-checker.py reports issues for some of heredoc python code
277 fragments below, because import-checker.py does not know test specific
277 fragments below, because import-checker.py does not know test specific
278 package hierarchy. NO_CHECK_* should be used as a limit mark of
278 package hierarchy. NO_CHECK_* should be used as a limit mark of
279 heredoc, in order to make import-checker.py ignore them. For
279 heredoc, in order to make import-checker.py ignore them. For
280 simplicity, all python code fragments below are generated with such
280 simplicity, all python code fragments below are generated with such
281 limit mark, regardless of importing module or not.)
281 limit mark, regardless of importing module or not.)
282
282
283 #if windows
283 #if windows
284 $ PATHSEP=";"
284 $ PATHSEP=";"
285 #else
285 #else
286 $ PATHSEP=":"
286 $ PATHSEP=":"
287 #endif
287 #endif
288 $ export PATHSEP
288 $ export PATHSEP
289
289
290 $ mkdir $TESTTMP/libroot
290 $ mkdir $TESTTMP/libroot
291 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
291 $ echo "s = 'libroot/ambig.py'" > $TESTTMP/libroot/ambig.py
292 $ mkdir $TESTTMP/libroot/mod
292 $ mkdir $TESTTMP/libroot/mod
293 $ touch $TESTTMP/libroot/mod/__init__.py
293 $ touch $TESTTMP/libroot/mod/__init__.py
294 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
294 $ echo "s = 'libroot/mod/ambig.py'" > $TESTTMP/libroot/mod/ambig.py
295
295
296 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<NO_CHECK_EOF
296 $ cat > $TESTTMP/libroot/mod/ambigabs.py <<NO_CHECK_EOF
297 > from __future__ import absolute_import, print_function
297 > from __future__ import absolute_import, print_function
298 > import ambig # should load "libroot/ambig.py"
298 > import ambig # should load "libroot/ambig.py"
299 > s = ambig.s
299 > s = ambig.s
300 > NO_CHECK_EOF
300 > NO_CHECK_EOF
301 $ cat > loadabs.py <<NO_CHECK_EOF
301 $ cat > loadabs.py <<NO_CHECK_EOF
302 > import mod.ambigabs as ambigabs
302 > import mod.ambigabs as ambigabs
303 > def extsetup(ui):
303 > def extsetup(ui):
304 > print('ambigabs.s=%s' % ambigabs.s, flush=True)
304 > print('ambigabs.s=%s' % ambigabs.s, flush=True)
305 > NO_CHECK_EOF
305 > NO_CHECK_EOF
306 $ "$PYTHON" $TESTTMP/unflush.py loadabs.py
306 $ "$PYTHON" $TESTTMP/unflush.py loadabs.py
307 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
307 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadabs=loadabs.py root)
308 ambigabs.s=libroot/ambig.py
308 ambigabs.s=libroot/ambig.py
309 $TESTTMP/a
309 $TESTTMP/a
310
310
311 #if no-py3
311 #if no-py3
312 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<NO_CHECK_EOF
312 $ cat > $TESTTMP/libroot/mod/ambigrel.py <<NO_CHECK_EOF
313 > from __future__ import print_function
313 > from __future__ import print_function
314 > import ambig # should load "libroot/mod/ambig.py"
314 > import ambig # should load "libroot/mod/ambig.py"
315 > s = ambig.s
315 > s = ambig.s
316 > NO_CHECK_EOF
316 > NO_CHECK_EOF
317 $ cat > loadrel.py <<NO_CHECK_EOF
317 $ cat > loadrel.py <<NO_CHECK_EOF
318 > import mod.ambigrel as ambigrel
318 > import mod.ambigrel as ambigrel
319 > def extsetup(ui):
319 > def extsetup(ui):
320 > print('ambigrel.s=%s' % ambigrel.s, flush=True)
320 > print('ambigrel.s=%s' % ambigrel.s, flush=True)
321 > NO_CHECK_EOF
321 > NO_CHECK_EOF
322 $ "$PYTHON" $TESTTMP/unflush.py loadrel.py
322 $ "$PYTHON" $TESTTMP/unflush.py loadrel.py
323 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
323 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}/libroot; hg --config extensions.loadrel=loadrel.py root)
324 ambigrel.s=libroot/mod/ambig.py
324 ambigrel.s=libroot/mod/ambig.py
325 $TESTTMP/a
325 $TESTTMP/a
326 #endif
326 #endif
327
327
328 Check absolute/relative import of extension specific modules
328 Check absolute/relative import of extension specific modules
329
329
330 $ mkdir $TESTTMP/extroot
330 $ mkdir $TESTTMP/extroot
331 $ cat > $TESTTMP/extroot/bar.py <<NO_CHECK_EOF
331 $ cat > $TESTTMP/extroot/bar.py <<NO_CHECK_EOF
332 > s = b'this is extroot.bar'
332 > s = b'this is extroot.bar'
333 > NO_CHECK_EOF
333 > NO_CHECK_EOF
334 $ mkdir $TESTTMP/extroot/sub1
334 $ mkdir $TESTTMP/extroot/sub1
335 $ cat > $TESTTMP/extroot/sub1/__init__.py <<NO_CHECK_EOF
335 $ cat > $TESTTMP/extroot/sub1/__init__.py <<NO_CHECK_EOF
336 > s = b'this is extroot.sub1.__init__'
336 > s = b'this is extroot.sub1.__init__'
337 > NO_CHECK_EOF
337 > NO_CHECK_EOF
338 $ cat > $TESTTMP/extroot/sub1/baz.py <<NO_CHECK_EOF
338 $ cat > $TESTTMP/extroot/sub1/baz.py <<NO_CHECK_EOF
339 > s = b'this is extroot.sub1.baz'
339 > s = b'this is extroot.sub1.baz'
340 > NO_CHECK_EOF
340 > NO_CHECK_EOF
341 $ cat > $TESTTMP/extroot/__init__.py <<NO_CHECK_EOF
341 $ cat > $TESTTMP/extroot/__init__.py <<NO_CHECK_EOF
342 > from __future__ import absolute_import
342 > from __future__ import absolute_import
343 > s = b'this is extroot.__init__'
343 > s = b'this is extroot.__init__'
344 > from . import foo
344 > from . import foo
345 > def extsetup(ui):
345 > def extsetup(ui):
346 > ui.write(b'(extroot) ', foo.func(), b'\n')
346 > ui.write(b'(extroot) ', foo.func(), b'\n')
347 > ui.flush()
347 > ui.flush()
348 > NO_CHECK_EOF
348 > NO_CHECK_EOF
349
349
350 $ cat > $TESTTMP/extroot/foo.py <<NO_CHECK_EOF
350 $ cat > $TESTTMP/extroot/foo.py <<NO_CHECK_EOF
351 > # test absolute import
351 > # test absolute import
352 > buf = []
352 > buf = []
353 > def func():
353 > def func():
354 > # "not locals" case
354 > # "not locals" case
355 > import extroot.bar
355 > import extroot.bar
356 > buf.append(b'import extroot.bar in func(): %s' % extroot.bar.s)
356 > buf.append(b'import extroot.bar in func(): %s' % extroot.bar.s)
357 > return b'\n(extroot) '.join(buf)
357 > return b'\n(extroot) '.join(buf)
358 > # b"fromlist == ('*',)" case
358 > # b"fromlist == ('*',)" case
359 > from extroot.bar import *
359 > from extroot.bar import *
360 > buf.append(b'from extroot.bar import *: %s' % s)
360 > buf.append(b'from extroot.bar import *: %s' % s)
361 > # "not fromlist" and "if '.' in name" case
361 > # "not fromlist" and "if '.' in name" case
362 > import extroot.sub1.baz
362 > import extroot.sub1.baz
363 > buf.append(b'import extroot.sub1.baz: %s' % extroot.sub1.baz.s)
363 > buf.append(b'import extroot.sub1.baz: %s' % extroot.sub1.baz.s)
364 > # "not fromlist" and NOT "if '.' in name" case
364 > # "not fromlist" and NOT "if '.' in name" case
365 > import extroot
365 > import extroot
366 > buf.append(b'import extroot: %s' % extroot.s)
366 > buf.append(b'import extroot: %s' % extroot.s)
367 > # NOT "not fromlist" and NOT "level != -1" case
367 > # NOT "not fromlist" and NOT "level != -1" case
368 > from extroot.bar import s
368 > from extroot.bar import s
369 > buf.append(b'from extroot.bar import s: %s' % s)
369 > buf.append(b'from extroot.bar import s: %s' % s)
370 > NO_CHECK_EOF
370 > NO_CHECK_EOF
371 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.extroot=$TESTTMP/extroot root)
371 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.extroot=$TESTTMP/extroot root)
372 (extroot) from extroot.bar import *: this is extroot.bar
372 (extroot) from extroot.bar import *: this is extroot.bar
373 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
373 (extroot) import extroot.sub1.baz: this is extroot.sub1.baz
374 (extroot) import extroot: this is extroot.__init__
374 (extroot) import extroot: this is extroot.__init__
375 (extroot) from extroot.bar import s: this is extroot.bar
375 (extroot) from extroot.bar import s: this is extroot.bar
376 (extroot) import extroot.bar in func(): this is extroot.bar
376 (extroot) import extroot.bar in func(): this is extroot.bar
377 $TESTTMP/a
377 $TESTTMP/a
378
378
379 #if no-py3
379 #if no-py3
380 $ rm "$TESTTMP"/extroot/foo.*
380 $ rm "$TESTTMP"/extroot/foo.*
381 $ rm -Rf "$TESTTMP/extroot/__pycache__"
381 $ rm -Rf "$TESTTMP/extroot/__pycache__"
382 $ cat > $TESTTMP/extroot/foo.py <<NO_CHECK_EOF
382 $ cat > $TESTTMP/extroot/foo.py <<NO_CHECK_EOF
383 > # test relative import
383 > # test relative import
384 > buf = []
384 > buf = []
385 > def func():
385 > def func():
386 > # "not locals" case
386 > # "not locals" case
387 > import bar
387 > import bar
388 > buf.append('import bar in func(): %s' % bar.s)
388 > buf.append('import bar in func(): %s' % bar.s)
389 > return '\n(extroot) '.join(buf)
389 > return '\n(extroot) '.join(buf)
390 > # "fromlist == ('*',)" case
390 > # "fromlist == ('*',)" case
391 > from bar import *
391 > from bar import *
392 > buf.append('from bar import *: %s' % s)
392 > buf.append('from bar import *: %s' % s)
393 > # "not fromlist" and "if '.' in name" case
393 > # "not fromlist" and "if '.' in name" case
394 > import sub1.baz
394 > import sub1.baz
395 > buf.append('import sub1.baz: %s' % sub1.baz.s)
395 > buf.append('import sub1.baz: %s' % sub1.baz.s)
396 > # "not fromlist" and NOT "if '.' in name" case
396 > # "not fromlist" and NOT "if '.' in name" case
397 > import sub1
397 > import sub1
398 > buf.append('import sub1: %s' % sub1.s)
398 > buf.append('import sub1: %s' % sub1.s)
399 > # NOT "not fromlist" and NOT "level != -1" case
399 > # NOT "not fromlist" and NOT "level != -1" case
400 > from bar import s
400 > from bar import s
401 > buf.append('from bar import s: %s' % s)
401 > buf.append('from bar import s: %s' % s)
402 > NO_CHECK_EOF
402 > NO_CHECK_EOF
403 $ hg --config extensions.extroot=$TESTTMP/extroot root
403 $ hg --config extensions.extroot=$TESTTMP/extroot root
404 (extroot) from bar import *: this is extroot.bar
404 (extroot) from bar import *: this is extroot.bar
405 (extroot) import sub1.baz: this is extroot.sub1.baz
405 (extroot) import sub1.baz: this is extroot.sub1.baz
406 (extroot) import sub1: this is extroot.sub1.__init__
406 (extroot) import sub1: this is extroot.sub1.__init__
407 (extroot) from bar import s: this is extroot.bar
407 (extroot) from bar import s: this is extroot.bar
408 (extroot) import bar in func(): this is extroot.bar
408 (extroot) import bar in func(): this is extroot.bar
409 $TESTTMP/a
409 $TESTTMP/a
410 #endif
410 #endif
411
411
412 #if demandimport
412 #if demandimport
413
413
414 Examine whether module loading is delayed until actual referring, even
414 Examine whether module loading is delayed until actual referring, even
415 though module is imported with "absolute_import" feature.
415 though module is imported with "absolute_import" feature.
416
416
417 Files below in each packages are used for described purpose:
417 Files below in each packages are used for described purpose:
418
418
419 - "called": examine whether "from MODULE import ATTR" works correctly
419 - "called": examine whether "from MODULE import ATTR" works correctly
420 - "unused": examine whether loading is delayed correctly
420 - "unused": examine whether loading is delayed correctly
421 - "used": examine whether "from PACKAGE import MODULE" works correctly
421 - "used": examine whether "from PACKAGE import MODULE" works correctly
422
422
423 Package hierarchy is needed to examine whether demand importing works
423 Package hierarchy is needed to examine whether demand importing works
424 as expected for "from SUB.PACK.AGE import MODULE".
424 as expected for "from SUB.PACK.AGE import MODULE".
425
425
426 Setup "external library" to be imported with "absolute_import"
426 Setup "external library" to be imported with "absolute_import"
427 feature.
427 feature.
428
428
429 $ mkdir -p $TESTTMP/extlibroot/lsub1/lsub2
429 $ mkdir -p $TESTTMP/extlibroot/lsub1/lsub2
430 $ touch $TESTTMP/extlibroot/__init__.py
430 $ touch $TESTTMP/extlibroot/__init__.py
431 $ touch $TESTTMP/extlibroot/lsub1/__init__.py
431 $ touch $TESTTMP/extlibroot/lsub1/__init__.py
432 $ touch $TESTTMP/extlibroot/lsub1/lsub2/__init__.py
432 $ touch $TESTTMP/extlibroot/lsub1/lsub2/__init__.py
433
433
434 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/called.py <<NO_CHECK_EOF
434 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/called.py <<NO_CHECK_EOF
435 > def func():
435 > def func():
436 > return b"this is extlibroot.lsub1.lsub2.called.func()"
436 > return b"this is extlibroot.lsub1.lsub2.called.func()"
437 > NO_CHECK_EOF
437 > NO_CHECK_EOF
438 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/unused.py <<NO_CHECK_EOF
438 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/unused.py <<NO_CHECK_EOF
439 > raise Exception("extlibroot.lsub1.lsub2.unused is loaded unintentionally")
439 > raise Exception("extlibroot.lsub1.lsub2.unused is loaded unintentionally")
440 > NO_CHECK_EOF
440 > NO_CHECK_EOF
441 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/used.py <<NO_CHECK_EOF
441 $ cat > $TESTTMP/extlibroot/lsub1/lsub2/used.py <<NO_CHECK_EOF
442 > detail = b"this is extlibroot.lsub1.lsub2.used"
442 > detail = b"this is extlibroot.lsub1.lsub2.used"
443 > NO_CHECK_EOF
443 > NO_CHECK_EOF
444
444
445 Setup sub-package of "external library", which causes instantiation of
445 Setup sub-package of "external library", which causes instantiation of
446 demandmod in "recurse down the module chain" code path. Relative
446 demandmod in "recurse down the module chain" code path. Relative
447 importing with "absolute_import" feature isn't tested, because "level
447 importing with "absolute_import" feature isn't tested, because "level
448 >=1 " doesn't cause instantiation of demandmod.
448 >=1 " doesn't cause instantiation of demandmod.
449
449
450 $ mkdir -p $TESTTMP/extlibroot/recursedown/abs
450 $ mkdir -p $TESTTMP/extlibroot/recursedown/abs
451 $ cat > $TESTTMP/extlibroot/recursedown/abs/used.py <<NO_CHECK_EOF
451 $ cat > $TESTTMP/extlibroot/recursedown/abs/used.py <<NO_CHECK_EOF
452 > detail = b"this is extlibroot.recursedown.abs.used"
452 > detail = b"this is extlibroot.recursedown.abs.used"
453 > NO_CHECK_EOF
453 > NO_CHECK_EOF
454 $ cat > $TESTTMP/extlibroot/recursedown/abs/__init__.py <<NO_CHECK_EOF
454 $ cat > $TESTTMP/extlibroot/recursedown/abs/__init__.py <<NO_CHECK_EOF
455 > from __future__ import absolute_import
455 > from __future__ import absolute_import
456 > from extlibroot.recursedown.abs.used import detail
456 > from extlibroot.recursedown.abs.used import detail
457 > NO_CHECK_EOF
457 > NO_CHECK_EOF
458
458
459 $ mkdir -p $TESTTMP/extlibroot/recursedown/legacy
459 $ mkdir -p $TESTTMP/extlibroot/recursedown/legacy
460 $ cat > $TESTTMP/extlibroot/recursedown/legacy/used.py <<NO_CHECK_EOF
460 $ cat > $TESTTMP/extlibroot/recursedown/legacy/used.py <<NO_CHECK_EOF
461 > detail = b"this is extlibroot.recursedown.legacy.used"
461 > detail = b"this is extlibroot.recursedown.legacy.used"
462 > NO_CHECK_EOF
462 > NO_CHECK_EOF
463 $ cat > $TESTTMP/extlibroot/recursedown/legacy/__init__.py <<NO_CHECK_EOF
463 $ cat > $TESTTMP/extlibroot/recursedown/legacy/__init__.py <<NO_CHECK_EOF
464 > # legacy style (level == -1) import
464 > # legacy style (level == -1) import
465 > from extlibroot.recursedown.legacy.used import detail
465 > from extlibroot.recursedown.legacy.used import detail
466 > NO_CHECK_EOF
466 > NO_CHECK_EOF
467
467
468 $ cat > $TESTTMP/extlibroot/recursedown/__init__.py <<NO_CHECK_EOF
468 $ cat > $TESTTMP/extlibroot/recursedown/__init__.py <<NO_CHECK_EOF
469 > from __future__ import absolute_import
469 > from __future__ import absolute_import
470 > from extlibroot.recursedown.abs import detail as absdetail
470 > from extlibroot.recursedown.abs import detail as absdetail
471 > from .legacy import detail as legacydetail
471 > from .legacy import detail as legacydetail
472 > NO_CHECK_EOF
472 > NO_CHECK_EOF
473
473
474 Setup package that re-exports an attribute of its submodule as the same
474 Setup package that re-exports an attribute of its submodule as the same
475 name. This leaves 'shadowing.used' pointing to 'used.detail', but still
475 name. This leaves 'shadowing.used' pointing to 'used.detail', but still
476 the submodule 'used' should be somehow accessible. (issue5617)
476 the submodule 'used' should be somehow accessible. (issue5617)
477
477
478 $ mkdir -p $TESTTMP/extlibroot/shadowing
478 $ mkdir -p $TESTTMP/extlibroot/shadowing
479 $ cat > $TESTTMP/extlibroot/shadowing/used.py <<NO_CHECK_EOF
479 $ cat > $TESTTMP/extlibroot/shadowing/used.py <<NO_CHECK_EOF
480 > detail = b"this is extlibroot.shadowing.used"
480 > detail = b"this is extlibroot.shadowing.used"
481 > NO_CHECK_EOF
481 > NO_CHECK_EOF
482 $ cat > $TESTTMP/extlibroot/shadowing/proxied.py <<NO_CHECK_EOF
482 $ cat > $TESTTMP/extlibroot/shadowing/proxied.py <<NO_CHECK_EOF
483 > from __future__ import absolute_import
483 > from __future__ import absolute_import
484 > from extlibroot.shadowing.used import detail
484 > from extlibroot.shadowing.used import detail
485 > NO_CHECK_EOF
485 > NO_CHECK_EOF
486 $ cat > $TESTTMP/extlibroot/shadowing/__init__.py <<NO_CHECK_EOF
486 $ cat > $TESTTMP/extlibroot/shadowing/__init__.py <<NO_CHECK_EOF
487 > from __future__ import absolute_import
487 > from __future__ import absolute_import
488 > from .used import detail as used
488 > from .used import detail as used
489 > NO_CHECK_EOF
489 > NO_CHECK_EOF
490
490
491 Setup extension local modules to be imported with "absolute_import"
491 Setup extension local modules to be imported with "absolute_import"
492 feature.
492 feature.
493
493
494 $ mkdir -p $TESTTMP/absextroot/xsub1/xsub2
494 $ mkdir -p $TESTTMP/absextroot/xsub1/xsub2
495 $ touch $TESTTMP/absextroot/xsub1/__init__.py
495 $ touch $TESTTMP/absextroot/xsub1/__init__.py
496 $ touch $TESTTMP/absextroot/xsub1/xsub2/__init__.py
496 $ touch $TESTTMP/absextroot/xsub1/xsub2/__init__.py
497
497
498 $ cat > $TESTTMP/absextroot/xsub1/xsub2/called.py <<NO_CHECK_EOF
498 $ cat > $TESTTMP/absextroot/xsub1/xsub2/called.py <<NO_CHECK_EOF
499 > def func():
499 > def func():
500 > return b"this is absextroot.xsub1.xsub2.called.func()"
500 > return b"this is absextroot.xsub1.xsub2.called.func()"
501 > NO_CHECK_EOF
501 > NO_CHECK_EOF
502 $ cat > $TESTTMP/absextroot/xsub1/xsub2/unused.py <<NO_CHECK_EOF
502 $ cat > $TESTTMP/absextroot/xsub1/xsub2/unused.py <<NO_CHECK_EOF
503 > raise Exception("absextroot.xsub1.xsub2.unused is loaded unintentionally")
503 > raise Exception("absextroot.xsub1.xsub2.unused is loaded unintentionally")
504 > NO_CHECK_EOF
504 > NO_CHECK_EOF
505 $ cat > $TESTTMP/absextroot/xsub1/xsub2/used.py <<NO_CHECK_EOF
505 $ cat > $TESTTMP/absextroot/xsub1/xsub2/used.py <<NO_CHECK_EOF
506 > detail = b"this is absextroot.xsub1.xsub2.used"
506 > detail = b"this is absextroot.xsub1.xsub2.used"
507 > NO_CHECK_EOF
507 > NO_CHECK_EOF
508
508
509 Setup extension local modules to examine whether demand importing
509 Setup extension local modules to examine whether demand importing
510 works as expected in "level > 1" case.
510 works as expected in "level > 1" case.
511
511
512 $ cat > $TESTTMP/absextroot/relimportee.py <<NO_CHECK_EOF
512 $ cat > $TESTTMP/absextroot/relimportee.py <<NO_CHECK_EOF
513 > detail = b"this is absextroot.relimportee"
513 > detail = b"this is absextroot.relimportee"
514 > NO_CHECK_EOF
514 > NO_CHECK_EOF
515 $ cat > $TESTTMP/absextroot/xsub1/xsub2/relimporter.py <<NO_CHECK_EOF
515 $ cat > $TESTTMP/absextroot/xsub1/xsub2/relimporter.py <<NO_CHECK_EOF
516 > from __future__ import absolute_import
516 > from __future__ import absolute_import
517 > from mercurial import pycompat
517 > from mercurial import pycompat
518 > from ... import relimportee
518 > from ... import relimportee
519 > detail = b"this relimporter imports %r" % (
519 > detail = b"this relimporter imports %r" % (
520 > pycompat.bytestr(relimportee.detail))
520 > pycompat.bytestr(relimportee.detail))
521 > NO_CHECK_EOF
521 > NO_CHECK_EOF
522
522
523 Setup modules, which actually import extension local modules at
523 Setup modules, which actually import extension local modules at
524 runtime.
524 runtime.
525
525
526 $ cat > $TESTTMP/absextroot/absolute.py << NO_CHECK_EOF
526 $ cat > $TESTTMP/absextroot/absolute.py << NO_CHECK_EOF
527 > from __future__ import absolute_import
527 > from __future__ import absolute_import
528 >
528 >
529 > # import extension local modules absolutely (level = 0)
529 > # import extension local modules absolutely (level = 0)
530 > from absextroot.xsub1.xsub2 import used, unused
530 > from absextroot.xsub1.xsub2 import used, unused
531 > from absextroot.xsub1.xsub2.called import func
531 > from absextroot.xsub1.xsub2.called import func
532 >
532 >
533 > def getresult():
533 > def getresult():
534 > result = []
534 > result = []
535 > result.append(used.detail)
535 > result.append(used.detail)
536 > result.append(func())
536 > result.append(func())
537 > return result
537 > return result
538 > NO_CHECK_EOF
538 > NO_CHECK_EOF
539
539
540 $ cat > $TESTTMP/absextroot/relative.py << NO_CHECK_EOF
540 $ cat > $TESTTMP/absextroot/relative.py << NO_CHECK_EOF
541 > from __future__ import absolute_import
541 > from __future__ import absolute_import
542 >
542 >
543 > # import extension local modules relatively (level == 1)
543 > # import extension local modules relatively (level == 1)
544 > from .xsub1.xsub2 import used, unused
544 > from .xsub1.xsub2 import used, unused
545 > from .xsub1.xsub2.called import func
545 > from .xsub1.xsub2.called import func
546 >
546 >
547 > # import a module, which implies "importing with level > 1"
547 > # import a module, which implies "importing with level > 1"
548 > from .xsub1.xsub2 import relimporter
548 > from .xsub1.xsub2 import relimporter
549 >
549 >
550 > def getresult():
550 > def getresult():
551 > result = []
551 > result = []
552 > result.append(used.detail)
552 > result.append(used.detail)
553 > result.append(func())
553 > result.append(func())
554 > result.append(relimporter.detail)
554 > result.append(relimporter.detail)
555 > return result
555 > return result
556 > NO_CHECK_EOF
556 > NO_CHECK_EOF
557
557
558 Setup main procedure of extension.
558 Setup main procedure of extension.
559
559
560 $ cat > $TESTTMP/absextroot/__init__.py <<NO_CHECK_EOF
560 $ cat > $TESTTMP/absextroot/__init__.py <<NO_CHECK_EOF
561 > from __future__ import absolute_import
561 > from __future__ import absolute_import
562 > from mercurial import registrar
562 > from mercurial import registrar
563 > cmdtable = {}
563 > cmdtable = {}
564 > command = registrar.command(cmdtable)
564 > command = registrar.command(cmdtable)
565 >
565 >
566 > # "absolute" and "relative" shouldn't be imported before actual
566 > # "absolute" and "relative" shouldn't be imported before actual
567 > # command execution, because (1) they import same modules, and (2)
567 > # command execution, because (1) they import same modules, and (2)
568 > # preceding import (= instantiate "demandmod" object instead of
568 > # preceding import (= instantiate "demandmod" object instead of
569 > # real "module" object) might hide problem of succeeding import.
569 > # real "module" object) might hide problem of succeeding import.
570 >
570 >
571 > @command(b'showabsolute', [], norepo=True)
571 > @command(b'showabsolute', [], norepo=True)
572 > def showabsolute(ui, *args, **opts):
572 > def showabsolute(ui, *args, **opts):
573 > from absextroot import absolute
573 > from absextroot import absolute
574 > ui.write(b'ABS: %s\n' % b'\nABS: '.join(absolute.getresult()))
574 > ui.write(b'ABS: %s\n' % b'\nABS: '.join(absolute.getresult()))
575 >
575 >
576 > @command(b'showrelative', [], norepo=True)
576 > @command(b'showrelative', [], norepo=True)
577 > def showrelative(ui, *args, **opts):
577 > def showrelative(ui, *args, **opts):
578 > from . import relative
578 > from . import relative
579 > ui.write(b'REL: %s\n' % b'\nREL: '.join(relative.getresult()))
579 > ui.write(b'REL: %s\n' % b'\nREL: '.join(relative.getresult()))
580 >
580 >
581 > # import modules from external library
581 > # import modules from external library
582 > from extlibroot.lsub1.lsub2 import used as lused, unused as lunused
582 > from extlibroot.lsub1.lsub2 import used as lused, unused as lunused
583 > from extlibroot.lsub1.lsub2.called import func as lfunc
583 > from extlibroot.lsub1.lsub2.called import func as lfunc
584 > from extlibroot.recursedown import absdetail, legacydetail
584 > from extlibroot.recursedown import absdetail, legacydetail
585 > from extlibroot.shadowing import proxied
585 > from extlibroot.shadowing import proxied
586 >
586 >
587 > def uisetup(ui):
587 > def uisetup(ui):
588 > result = []
588 > result = []
589 > result.append(lused.detail)
589 > result.append(lused.detail)
590 > result.append(lfunc())
590 > result.append(lfunc())
591 > result.append(absdetail)
591 > result.append(absdetail)
592 > result.append(legacydetail)
592 > result.append(legacydetail)
593 > result.append(proxied.detail)
593 > result.append(proxied.detail)
594 > ui.write(b'LIB: %s\n' % b'\nLIB: '.join(result))
594 > ui.write(b'LIB: %s\n' % b'\nLIB: '.join(result))
595 > NO_CHECK_EOF
595 > NO_CHECK_EOF
596
596
597 Examine module importing.
597 Examine module importing.
598
598
599 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showabsolute)
599 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showabsolute)
600 LIB: this is extlibroot.lsub1.lsub2.used
600 LIB: this is extlibroot.lsub1.lsub2.used
601 LIB: this is extlibroot.lsub1.lsub2.called.func()
601 LIB: this is extlibroot.lsub1.lsub2.called.func()
602 LIB: this is extlibroot.recursedown.abs.used
602 LIB: this is extlibroot.recursedown.abs.used
603 LIB: this is extlibroot.recursedown.legacy.used
603 LIB: this is extlibroot.recursedown.legacy.used
604 LIB: this is extlibroot.shadowing.used
604 LIB: this is extlibroot.shadowing.used
605 ABS: this is absextroot.xsub1.xsub2.used
605 ABS: this is absextroot.xsub1.xsub2.used
606 ABS: this is absextroot.xsub1.xsub2.called.func()
606 ABS: this is absextroot.xsub1.xsub2.called.func()
607
607
608 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showrelative)
608 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.absextroot=$TESTTMP/absextroot showrelative)
609 LIB: this is extlibroot.lsub1.lsub2.used
609 LIB: this is extlibroot.lsub1.lsub2.used
610 LIB: this is extlibroot.lsub1.lsub2.called.func()
610 LIB: this is extlibroot.lsub1.lsub2.called.func()
611 LIB: this is extlibroot.recursedown.abs.used
611 LIB: this is extlibroot.recursedown.abs.used
612 LIB: this is extlibroot.recursedown.legacy.used
612 LIB: this is extlibroot.recursedown.legacy.used
613 LIB: this is extlibroot.shadowing.used
613 LIB: this is extlibroot.shadowing.used
614 REL: this is absextroot.xsub1.xsub2.used
614 REL: this is absextroot.xsub1.xsub2.used
615 REL: this is absextroot.xsub1.xsub2.called.func()
615 REL: this is absextroot.xsub1.xsub2.called.func()
616 REL: this relimporter imports 'this is absextroot.relimportee'
616 REL: this relimporter imports 'this is absextroot.relimportee'
617
617
618 Examine whether sub-module is imported relatively as expected.
618 Examine whether sub-module is imported relatively as expected.
619
619
620 See also issue5208 for detail about example case on Python 3.x.
620 See also issue5208 for detail about example case on Python 3.x.
621
621
622 $ f -q $TESTTMP/extlibroot/lsub1/lsub2/notexist.py
622 $ f -q $TESTTMP/extlibroot/lsub1/lsub2/notexist.py
623 $TESTTMP/extlibroot/lsub1/lsub2/notexist.py: file not found
623 $TESTTMP/extlibroot/lsub1/lsub2/notexist.py: file not found
624
624
625 $ cat > $TESTTMP/notexist.py <<NO_CHECK_EOF
625 $ cat > $TESTTMP/notexist.py <<NO_CHECK_EOF
626 > text = 'notexist.py at root is loaded unintentionally\n'
626 > text = 'notexist.py at root is loaded unintentionally\n'
627 > NO_CHECK_EOF
627 > NO_CHECK_EOF
628
628
629 $ cat > $TESTTMP/checkrelativity.py <<NO_CHECK_EOF
629 $ cat > $TESTTMP/checkrelativity.py <<NO_CHECK_EOF
630 > from mercurial import registrar
630 > from mercurial import registrar
631 > cmdtable = {}
631 > cmdtable = {}
632 > command = registrar.command(cmdtable)
632 > command = registrar.command(cmdtable)
633 >
633 >
634 > # demand import avoids failure of importing notexist here, but only on
634 > # demand import avoids failure of importing notexist here, but only on
635 > # Python 2.
635 > # Python 2.
636 > import extlibroot.lsub1.lsub2.notexist
636 > import extlibroot.lsub1.lsub2.notexist
637 >
637 >
638 > @command(b'checkrelativity', [], norepo=True)
638 > @command(b'checkrelativity', [], norepo=True)
639 > def checkrelativity(ui, *args, **opts):
639 > def checkrelativity(ui, *args, **opts):
640 > try:
640 > try:
641 > ui.write(extlibroot.lsub1.lsub2.notexist.text)
641 > ui.write(extlibroot.lsub1.lsub2.notexist.text)
642 > return 1 # unintentional success
642 > return 1 # unintentional success
643 > except ImportError:
643 > except ImportError:
644 > pass # intentional failure
644 > pass # intentional failure
645 > NO_CHECK_EOF
645 > NO_CHECK_EOF
646
646
647 Python 3's lazy importer verifies modules exist before returning the lazy
647 Python 3's lazy importer verifies modules exist before returning the lazy
648 module stub. Our custom lazy importer for Python 2 always returns a stub.
648 module stub. Our custom lazy importer for Python 2 always returns a stub.
649
649
650 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity) || true
650 $ (PYTHONPATH=${PYTHONPATH}${PATHSEP}${TESTTMP}; hg --config extensions.checkrelativity=$TESTTMP/checkrelativity.py checkrelativity) || true
651 *** failed to import extension checkrelativity from $TESTTMP/checkrelativity.py: No module named 'extlibroot.lsub1.lsub2.notexist' (py3 !)
651 *** failed to import extension checkrelativity from $TESTTMP/checkrelativity.py: No module named 'extlibroot.lsub1.lsub2.notexist' (py3 !)
652 hg: unknown command 'checkrelativity' (py3 !)
652 hg: unknown command 'checkrelativity' (py3 !)
653 (use 'hg help' for a list of commands) (py3 !)
653 (use 'hg help' for a list of commands) (py3 !)
654
654
655 #endif
655 #endif
656
656
657 (Here, module importing tests are finished. Therefore, use other than
657 (Here, module importing tests are finished. Therefore, use other than
658 NO_CHECK_* limit mark for heredoc python files, in order to apply
658 NO_CHECK_* limit mark for heredoc python files, in order to apply
659 import-checker.py or so on their contents)
659 import-checker.py or so on their contents)
660
660
661 Make sure a broken uisetup doesn't globally break hg:
661 Make sure a broken uisetup doesn't globally break hg:
662 $ cat > $TESTTMP/baduisetup.py <<EOF
662 $ cat > $TESTTMP/baduisetup.py <<EOF
663 > def uisetup(ui):
663 > def uisetup(ui):
664 > 1 / 0
664 > 1 / 0
665 > EOF
665 > EOF
666
666
667 Even though the extension fails during uisetup, hg is still basically usable:
667 Even though the extension fails during uisetup, hg is still basically usable:
668 $ hg --config extensions.baduisetup=$TESTTMP/baduisetup.py version
668 $ hg --config extensions.baduisetup=$TESTTMP/baduisetup.py version
669 Traceback (most recent call last):
669 Traceback (most recent call last):
670 File "*/mercurial/extensions.py", line *, in _runuisetup (glob)
670 File "*/mercurial/extensions.py", line *, in _runuisetup (glob)
671 uisetup(ui)
671 uisetup(ui)
672 File "$TESTTMP/baduisetup.py", line 2, in uisetup
672 File "$TESTTMP/baduisetup.py", line 2, in uisetup
673 1 / 0
673 1 / 0
674 ZeroDivisionError: * by zero (glob)
674 ZeroDivisionError: * by zero (glob)
675 *** failed to set up extension baduisetup: * by zero (glob)
675 *** failed to set up extension baduisetup: * by zero (glob)
676 Mercurial Distributed SCM (version *) (glob)
676 Mercurial Distributed SCM (version *) (glob)
677 (see https://mercurial-scm.org for more information)
677 (see https://mercurial-scm.org for more information)
678
678
679 Copyright (C) 2005-* Matt Mackall and others (glob)
679 Copyright (C) 2005-* Matt Mackall and others (glob)
680 This is free software; see the source for copying conditions. There is NO
680 This is free software; see the source for copying conditions. There is NO
681 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
681 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
682
682
683 $ cd ..
683 $ cd ..
684
684
685 hide outer repo
685 hide outer repo
686 $ hg init
686 $ hg init
687
687
688 $ cat > empty.py <<EOF
688 $ cat > empty.py <<EOF
689 > '''empty cmdtable
689 > '''empty cmdtable
690 > '''
690 > '''
691 > cmdtable = {}
691 > cmdtable = {}
692 > EOF
692 > EOF
693 $ emptypath=`pwd`/empty.py
693 $ emptypath=`pwd`/empty.py
694 $ echo "empty = $emptypath" >> $HGRCPATH
694 $ echo "empty = $emptypath" >> $HGRCPATH
695 $ hg help empty
695 $ hg help empty
696 empty extension - empty cmdtable
696 empty extension - empty cmdtable
697
697
698 no commands defined
698 no commands defined
699
699
700
700
701 $ echo 'empty = !' >> $HGRCPATH
701 $ echo 'empty = !' >> $HGRCPATH
702
702
703 $ cat > debugextension.py <<EOF
703 $ cat > debugextension.py <<EOF
704 > '''only debugcommands
704 > '''only debugcommands
705 > '''
705 > '''
706 > from mercurial import registrar
706 > from mercurial import registrar
707 > cmdtable = {}
707 > cmdtable = {}
708 > command = registrar.command(cmdtable)
708 > command = registrar.command(cmdtable)
709 > @command(b'debugfoobar', [], b'hg debugfoobar')
709 > @command(b'debugfoobar', [], b'hg debugfoobar')
710 > def debugfoobar(ui, repo, *args, **opts):
710 > def debugfoobar(ui, repo, *args, **opts):
711 > "yet another debug command"
711 > "yet another debug command"
712 > @command(b'foo', [], b'hg foo')
712 > @command(b'foo', [], b'hg foo')
713 > def foo(ui, repo, *args, **opts):
713 > def foo(ui, repo, *args, **opts):
714 > """yet another foo command
714 > """yet another foo command
715 > This command has been DEPRECATED since forever.
715 > This command has been DEPRECATED since forever.
716 > """
716 > """
717 > EOF
717 > EOF
718 $ debugpath=`pwd`/debugextension.py
718 $ debugpath=`pwd`/debugextension.py
719 $ echo "debugextension = $debugpath" >> $HGRCPATH
719 $ echo "debugextension = $debugpath" >> $HGRCPATH
720
720
721 $ hg help debugextension
721 $ hg help debugextension
722 hg debugextensions
722 hg debugextensions
723
723
724 show information about active extensions
724 show information about active extensions
725
725
726 options:
726 options:
727
727
728 -T --template TEMPLATE display with template
728 -T --template TEMPLATE display with template
729
729
730 (some details hidden, use --verbose to show complete help)
730 (some details hidden, use --verbose to show complete help)
731
731
732
732
733 $ hg --verbose help debugextension
733 $ hg --verbose help debugextension
734 hg debugextensions
734 hg debugextensions
735
735
736 show information about active extensions
736 show information about active extensions
737
737
738 options:
738 options:
739
739
740 -T --template TEMPLATE display with template
740 -T --template TEMPLATE display with template
741
741
742 global options ([+] can be repeated):
742 global options ([+] can be repeated):
743
743
744 -R --repository REPO repository root directory or name of overlay bundle
744 -R --repository REPO repository root directory or name of overlay bundle
745 file
745 file
746 --cwd DIR change working directory
746 --cwd DIR change working directory
747 -y --noninteractive do not prompt, automatically pick the first choice for
747 -y --noninteractive do not prompt, automatically pick the first choice for
748 all prompts
748 all prompts
749 -q --quiet suppress output
749 -q --quiet suppress output
750 -v --verbose enable additional output
750 -v --verbose enable additional output
751 --color TYPE when to colorize (boolean, always, auto, never, or
751 --color TYPE when to colorize (boolean, always, auto, never, or
752 debug)
752 debug)
753 --config CONFIG [+] set/override config option (use 'section.name=value')
753 --config CONFIG [+] set/override config option (use 'section.name=value')
754 --debug enable debugging output
754 --debug enable debugging output
755 --debugger start debugger
755 --debugger start debugger
756 --encoding ENCODE set the charset encoding (default: ascii)
756 --encoding ENCODE set the charset encoding (default: ascii)
757 --encodingmode MODE set the charset encoding mode (default: strict)
757 --encodingmode MODE set the charset encoding mode (default: strict)
758 --traceback always print a traceback on exception
758 --traceback always print a traceback on exception
759 --time time how long the command takes
759 --time time how long the command takes
760 --profile print command execution profile
760 --profile print command execution profile
761 --version output version information and exit
761 --version output version information and exit
762 -h --help display help and exit
762 -h --help display help and exit
763 --hidden consider hidden changesets
763 --hidden consider hidden changesets
764 --pager TYPE when to paginate (boolean, always, auto, or never)
764 --pager TYPE when to paginate (boolean, always, auto, or never)
765 (default: auto)
765 (default: auto)
766
766
767
767
768
768
769
769
770
770
771
771
772 $ hg --debug help debugextension
772 $ hg --debug help debugextension
773 hg debugextensions
773 hg debugextensions
774
774
775 show information about active extensions
775 show information about active extensions
776
776
777 options:
777 options:
778
778
779 -T --template TEMPLATE display with template
779 -T --template TEMPLATE display with template
780
780
781 global options ([+] can be repeated):
781 global options ([+] can be repeated):
782
782
783 -R --repository REPO repository root directory or name of overlay bundle
783 -R --repository REPO repository root directory or name of overlay bundle
784 file
784 file
785 --cwd DIR change working directory
785 --cwd DIR change working directory
786 -y --noninteractive do not prompt, automatically pick the first choice for
786 -y --noninteractive do not prompt, automatically pick the first choice for
787 all prompts
787 all prompts
788 -q --quiet suppress output
788 -q --quiet suppress output
789 -v --verbose enable additional output
789 -v --verbose enable additional output
790 --color TYPE when to colorize (boolean, always, auto, never, or
790 --color TYPE when to colorize (boolean, always, auto, never, or
791 debug)
791 debug)
792 --config CONFIG [+] set/override config option (use 'section.name=value')
792 --config CONFIG [+] set/override config option (use 'section.name=value')
793 --debug enable debugging output
793 --debug enable debugging output
794 --debugger start debugger
794 --debugger start debugger
795 --encoding ENCODE set the charset encoding (default: ascii)
795 --encoding ENCODE set the charset encoding (default: ascii)
796 --encodingmode MODE set the charset encoding mode (default: strict)
796 --encodingmode MODE set the charset encoding mode (default: strict)
797 --traceback always print a traceback on exception
797 --traceback always print a traceback on exception
798 --time time how long the command takes
798 --time time how long the command takes
799 --profile print command execution profile
799 --profile print command execution profile
800 --version output version information and exit
800 --version output version information and exit
801 -h --help display help and exit
801 -h --help display help and exit
802 --hidden consider hidden changesets
802 --hidden consider hidden changesets
803 --pager TYPE when to paginate (boolean, always, auto, or never)
803 --pager TYPE when to paginate (boolean, always, auto, or never)
804 (default: auto)
804 (default: auto)
805
805
806
806
807
807
808
808
809
809
810 $ echo 'debugextension = !' >> $HGRCPATH
810 $ echo 'debugextension = !' >> $HGRCPATH
811
811
812 Asking for help about a deprecated extension should do something useful:
812 Asking for help about a deprecated extension should do something useful:
813
813
814 $ hg help glog
814 $ hg help glog
815 'glog' is provided by the following extension:
815 'glog' is provided by the following extension:
816
816
817 graphlog command to view revision graphs from a shell (DEPRECATED)
817 graphlog command to view revision graphs from a shell (DEPRECATED)
818
818
819 (use 'hg help extensions' for information on enabling extensions)
819 (use 'hg help extensions' for information on enabling extensions)
820
820
821 Extension module help vs command help:
821 Extension module help vs command help:
822
822
823 $ echo 'extdiff =' >> $HGRCPATH
823 $ echo 'extdiff =' >> $HGRCPATH
824 $ hg help extdiff
824 $ hg help extdiff
825 hg extdiff [OPT]... [FILE]...
825 hg extdiff [OPT]... [FILE]...
826
826
827 use external program to diff repository (or selected files)
827 use external program to diff repository (or selected files)
828
828
829 Show differences between revisions for the specified files, using an
829 Show differences between revisions for the specified files, using an
830 external program. The default program used is diff, with default options
830 external program. The default program used is diff, with default options
831 "-Npru".
831 "-Npru".
832
832
833 To select a different program, use the -p/--program option. The program
833 To select a different program, use the -p/--program option. The program
834 will be passed the names of two directories to compare, unless the --per-
834 will be passed the names of two directories to compare, unless the --per-
835 file option is specified (see below). To pass additional options to the
835 file option is specified (see below). To pass additional options to the
836 program, use -o/--option. These will be passed before the names of the
836 program, use -o/--option. These will be passed before the names of the
837 directories or files to compare.
837 directories or files to compare.
838
838
839 The --from, --to, and --change options work the same way they do for 'hg
839 The --from, --to, and --change options work the same way they do for 'hg
840 diff'.
840 diff'.
841
841
842 The --per-file option runs the external program repeatedly on each file to
842 The --per-file option runs the external program repeatedly on each file to
843 diff, instead of once on two directories. By default, this happens one by
843 diff, instead of once on two directories. By default, this happens one by
844 one, where the next file diff is open in the external program only once
844 one, where the next file diff is open in the external program only once
845 the previous external program (for the previous file diff) has exited. If
845 the previous external program (for the previous file diff) has exited. If
846 the external program has a graphical interface, it can open all the file
846 the external program has a graphical interface, it can open all the file
847 diffs at once instead of one by one. See 'hg help -e extdiff' for
847 diffs at once instead of one by one. See 'hg help -e extdiff' for
848 information about how to tell Mercurial that a given program has a
848 information about how to tell Mercurial that a given program has a
849 graphical interface.
849 graphical interface.
850
850
851 The --confirm option will prompt the user before each invocation of the
851 The --confirm option will prompt the user before each invocation of the
852 external program. It is ignored if --per-file isn't specified.
852 external program. It is ignored if --per-file isn't specified.
853
853
854 (use 'hg help -e extdiff' to show help for the extdiff extension)
854 (use 'hg help -e extdiff' to show help for the extdiff extension)
855
855
856 options ([+] can be repeated):
856 options ([+] can be repeated):
857
857
858 -p --program CMD comparison program to run
858 -p --program CMD comparison program to run
859 -o --option OPT [+] pass option to comparison program
859 -o --option OPT [+] pass option to comparison program
860 --from REV1 revision to diff from
860 --from REV1 revision to diff from
861 --to REV2 revision to diff to
861 --to REV2 revision to diff to
862 -c --change REV change made by revision
862 -c --change REV change made by revision
863 --per-file compare each file instead of revision snapshots
863 --per-file compare each file instead of revision snapshots
864 --confirm prompt user before each external program invocation
864 --confirm prompt user before each external program invocation
865 --patch compare patches for two revisions
865 --patch compare patches for two revisions
866 -I --include PATTERN [+] include names matching the given patterns
866 -I --include PATTERN [+] include names matching the given patterns
867 -X --exclude PATTERN [+] exclude names matching the given patterns
867 -X --exclude PATTERN [+] exclude names matching the given patterns
868 -S --subrepos recurse into subrepositories
868 -S --subrepos recurse into subrepositories
869
869
870 (some details hidden, use --verbose to show complete help)
870 (some details hidden, use --verbose to show complete help)
871
871
872
872
873
873
874
874
875
875
876
876
877
877
878
878
879
879
880
880
881 $ hg help --extension extdiff
881 $ hg help --extension extdiff
882 extdiff extension - command to allow external programs to compare revisions
882 extdiff extension - command to allow external programs to compare revisions
883
883
884 The extdiff Mercurial extension allows you to use external programs to compare
884 The extdiff Mercurial extension allows you to use external programs to compare
885 revisions, or revision with working directory. The external diff programs are
885 revisions, or revision with working directory. The external diff programs are
886 called with a configurable set of options and two non-option arguments: paths
886 called with a configurable set of options and two non-option arguments: paths
887 to directories containing snapshots of files to compare.
887 to directories containing snapshots of files to compare.
888
888
889 If there is more than one file being compared and the "child" revision is the
889 If there is more than one file being compared and the "child" revision is the
890 working directory, any modifications made in the external diff program will be
890 working directory, any modifications made in the external diff program will be
891 copied back to the working directory from the temporary directory.
891 copied back to the working directory from the temporary directory.
892
892
893 The extdiff extension also allows you to configure new diff commands, so you
893 The extdiff extension also allows you to configure new diff commands, so you
894 do not need to type 'hg extdiff -p kdiff3' always.
894 do not need to type 'hg extdiff -p kdiff3' always.
895
895
896 [extdiff]
896 [extdiff]
897 # add new command that runs GNU diff(1) in 'context diff' mode
897 # add new command that runs GNU diff(1) in 'context diff' mode
898 cdiff = gdiff -Nprc5
898 cdiff = gdiff -Nprc5
899 ## or the old way:
899 ## or the old way:
900 #cmd.cdiff = gdiff
900 #cmd.cdiff = gdiff
901 #opts.cdiff = -Nprc5
901 #opts.cdiff = -Nprc5
902
902
903 # add new command called meld, runs meld (no need to name twice). If
903 # add new command called meld, runs meld (no need to name twice). If
904 # the meld executable is not available, the meld tool in [merge-tools]
904 # the meld executable is not available, the meld tool in [merge-tools]
905 # will be used, if available
905 # will be used, if available
906 meld =
906 meld =
907
907
908 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
908 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
909 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
909 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
910 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
910 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
911 # your .vimrc
911 # your .vimrc
912 vimdiff = gvim -f "+next" \
912 vimdiff = gvim -f "+next" \
913 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
913 "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"
914
914
915 Tool arguments can include variables that are expanded at runtime:
915 Tool arguments can include variables that are expanded at runtime:
916
916
917 $parent1, $plabel1 - filename, descriptive label of first parent
917 $parent1, $plabel1 - filename, descriptive label of first parent
918 $child, $clabel - filename, descriptive label of child revision
918 $child, $clabel - filename, descriptive label of child revision
919 $parent2, $plabel2 - filename, descriptive label of second parent
919 $parent2, $plabel2 - filename, descriptive label of second parent
920 $root - repository root
920 $root - repository root
921 $parent is an alias for $parent1.
921 $parent is an alias for $parent1.
922
922
923 The extdiff extension will look in your [diff-tools] and [merge-tools]
923 The extdiff extension will look in your [diff-tools] and [merge-tools]
924 sections for diff tool arguments, when none are specified in [extdiff].
924 sections for diff tool arguments, when none are specified in [extdiff].
925
925
926 [extdiff]
926 [extdiff]
927 kdiff3 =
927 kdiff3 =
928
928
929 [diff-tools]
929 [diff-tools]
930 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
930 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
931
931
932 If a program has a graphical interface, it might be interesting to tell
932 If a program has a graphical interface, it might be interesting to tell
933 Mercurial about it. It will prevent the program from being mistakenly used in
933 Mercurial about it. It will prevent the program from being mistakenly used in
934 a terminal-only environment (such as an SSH terminal session), and will make
934 a terminal-only environment (such as an SSH terminal session), and will make
935 'hg extdiff --per-file' open multiple file diffs at once instead of one by one
935 'hg extdiff --per-file' open multiple file diffs at once instead of one by one
936 (if you still want to open file diffs one by one, you can use the --confirm
936 (if you still want to open file diffs one by one, you can use the --confirm
937 option).
937 option).
938
938
939 Declaring that a tool has a graphical interface can be done with the "gui"
939 Declaring that a tool has a graphical interface can be done with the "gui"
940 flag next to where "diffargs" are specified:
940 flag next to where "diffargs" are specified:
941
941
942 [diff-tools]
942 [diff-tools]
943 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
943 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
944 kdiff3.gui = true
944 kdiff3.gui = true
945
945
946 You can use -I/-X and list of file or directory names like normal 'hg diff'
946 You can use -I/-X and list of file or directory names like normal 'hg diff'
947 command. The extdiff extension makes snapshots of only needed files, so
947 command. The extdiff extension makes snapshots of only needed files, so
948 running the external diff program will actually be pretty fast (at least
948 running the external diff program will actually be pretty fast (at least
949 faster than having to compare the entire tree).
949 faster than having to compare the entire tree).
950
950
951 list of commands:
951 list of commands:
952
952
953 extdiff use external program to diff repository (or selected files)
953 extdiff use external program to diff repository (or selected files)
954
954
955 (use 'hg help -v -e extdiff' to show built-in aliases and global options)
955 (use 'hg help -v -e extdiff' to show built-in aliases and global options)
956
956
957
957
958
958
959
959
960
960
961
961
962
962
963
963
964
964
965
965
966
966
967
967
968
968
969
969
970
970
971
971
972 $ echo 'extdiff = !' >> $HGRCPATH
972 $ echo 'extdiff = !' >> $HGRCPATH
973
973
974 Test help topic with same name as extension
974 Test help topic with same name as extension
975
975
976 $ cat > multirevs.py <<EOF
976 $ cat > multirevs.py <<EOF
977 > from mercurial import commands, registrar
977 > from mercurial import commands, registrar
978 > cmdtable = {}
978 > cmdtable = {}
979 > command = registrar.command(cmdtable)
979 > command = registrar.command(cmdtable)
980 > """multirevs extension
980 > """multirevs extension
981 > Big multi-line module docstring."""
981 > Big multi-line module docstring."""
982 > @command(b'multirevs', [], b'ARG', norepo=True)
982 > @command(b'multirevs', [], b'ARG', norepo=True)
983 > def multirevs(ui, repo, arg, *args, **opts):
983 > def multirevs(ui, repo, arg, *args, **opts):
984 > """multirevs command"""
984 > """multirevs command"""
985 > EOF
985 > EOF
986 $ echo "multirevs = multirevs.py" >> $HGRCPATH
986 $ echo "multirevs = multirevs.py" >> $HGRCPATH
987
987
988 $ hg help multirevs | tail
988 $ hg help multirevs | tail
989 used):
989 used):
990
990
991 hg update :@
991 hg update :@
992
992
993 - Show diff between tags 1.3 and 1.5 (this works because the first and the
993 - Show diff between tags 1.3 and 1.5 (this works because the first and the
994 last revisions of the revset are used):
994 last revisions of the revset are used):
995
995
996 hg diff -r 1.3::1.5
996 hg diff -r 1.3::1.5
997
997
998 use 'hg help -c multirevs' to see help for the multirevs command
998 use 'hg help -c multirevs' to see help for the multirevs command
999
999
1000
1000
1001
1001
1002
1002
1003
1003
1004
1004
1005 $ hg help -c multirevs
1005 $ hg help -c multirevs
1006 hg multirevs ARG
1006 hg multirevs ARG
1007
1007
1008 multirevs command
1008 multirevs command
1009
1009
1010 (some details hidden, use --verbose to show complete help)
1010 (some details hidden, use --verbose to show complete help)
1011
1011
1012
1012
1013
1013
1014 $ hg multirevs
1014 $ hg multirevs
1015 hg multirevs: invalid arguments
1015 hg multirevs: invalid arguments
1016 hg multirevs ARG
1016 hg multirevs ARG
1017
1017
1018 multirevs command
1018 multirevs command
1019
1019
1020 (use 'hg multirevs -h' to show more help)
1020 (use 'hg multirevs -h' to show more help)
1021 [255]
1021 [10]
1022
1022
1023
1023
1024
1024
1025 $ echo "multirevs = !" >> $HGRCPATH
1025 $ echo "multirevs = !" >> $HGRCPATH
1026
1026
1027 Issue811: Problem loading extensions twice (by site and by user)
1027 Issue811: Problem loading extensions twice (by site and by user)
1028
1028
1029 $ cat <<EOF >> $HGRCPATH
1029 $ cat <<EOF >> $HGRCPATH
1030 > mq =
1030 > mq =
1031 > strip =
1031 > strip =
1032 > hgext.mq =
1032 > hgext.mq =
1033 > hgext/mq =
1033 > hgext/mq =
1034 > EOF
1034 > EOF
1035
1035
1036 Show extensions:
1036 Show extensions:
1037 (note that mq force load strip, also checking it's not loaded twice)
1037 (note that mq force load strip, also checking it's not loaded twice)
1038
1038
1039 #if no-extraextensions
1039 #if no-extraextensions
1040 $ hg debugextensions
1040 $ hg debugextensions
1041 mq
1041 mq
1042 strip
1042 strip
1043 #endif
1043 #endif
1044
1044
1045 For extensions, which name matches one of its commands, help
1045 For extensions, which name matches one of its commands, help
1046 message should ask '-v -e' to get list of built-in aliases
1046 message should ask '-v -e' to get list of built-in aliases
1047 along with extension help itself
1047 along with extension help itself
1048
1048
1049 $ mkdir $TESTTMP/d
1049 $ mkdir $TESTTMP/d
1050 $ cat > $TESTTMP/d/dodo.py <<EOF
1050 $ cat > $TESTTMP/d/dodo.py <<EOF
1051 > """
1051 > """
1052 > This is an awesome 'dodo' extension. It does nothing and
1052 > This is an awesome 'dodo' extension. It does nothing and
1053 > writes 'Foo foo'
1053 > writes 'Foo foo'
1054 > """
1054 > """
1055 > from mercurial import commands, registrar
1055 > from mercurial import commands, registrar
1056 > cmdtable = {}
1056 > cmdtable = {}
1057 > command = registrar.command(cmdtable)
1057 > command = registrar.command(cmdtable)
1058 > @command(b'dodo', [], b'hg dodo')
1058 > @command(b'dodo', [], b'hg dodo')
1059 > def dodo(ui, *args, **kwargs):
1059 > def dodo(ui, *args, **kwargs):
1060 > """Does nothing"""
1060 > """Does nothing"""
1061 > ui.write(b"I do nothing. Yay\\n")
1061 > ui.write(b"I do nothing. Yay\\n")
1062 > @command(b'foofoo', [], b'hg foofoo')
1062 > @command(b'foofoo', [], b'hg foofoo')
1063 > def foofoo(ui, *args, **kwargs):
1063 > def foofoo(ui, *args, **kwargs):
1064 > """Writes 'Foo foo'"""
1064 > """Writes 'Foo foo'"""
1065 > ui.write(b"Foo foo\\n")
1065 > ui.write(b"Foo foo\\n")
1066 > EOF
1066 > EOF
1067 $ dodopath=$TESTTMP/d/dodo.py
1067 $ dodopath=$TESTTMP/d/dodo.py
1068
1068
1069 $ echo "dodo = $dodopath" >> $HGRCPATH
1069 $ echo "dodo = $dodopath" >> $HGRCPATH
1070
1070
1071 Make sure that user is asked to enter '-v -e' to get list of built-in aliases
1071 Make sure that user is asked to enter '-v -e' to get list of built-in aliases
1072 $ hg help -e dodo
1072 $ hg help -e dodo
1073 dodo extension -
1073 dodo extension -
1074
1074
1075 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
1075 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
1076
1076
1077 list of commands:
1077 list of commands:
1078
1078
1079 dodo Does nothing
1079 dodo Does nothing
1080 foofoo Writes 'Foo foo'
1080 foofoo Writes 'Foo foo'
1081
1081
1082 (use 'hg help -v -e dodo' to show built-in aliases and global options)
1082 (use 'hg help -v -e dodo' to show built-in aliases and global options)
1083
1083
1084 Make sure that '-v -e' prints list of built-in aliases along with
1084 Make sure that '-v -e' prints list of built-in aliases along with
1085 extension help itself
1085 extension help itself
1086 $ hg help -v -e dodo
1086 $ hg help -v -e dodo
1087 dodo extension -
1087 dodo extension -
1088
1088
1089 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
1089 This is an awesome 'dodo' extension. It does nothing and writes 'Foo foo'
1090
1090
1091 list of commands:
1091 list of commands:
1092
1092
1093 dodo Does nothing
1093 dodo Does nothing
1094 foofoo Writes 'Foo foo'
1094 foofoo Writes 'Foo foo'
1095
1095
1096 global options ([+] can be repeated):
1096 global options ([+] can be repeated):
1097
1097
1098 -R --repository REPO repository root directory or name of overlay bundle
1098 -R --repository REPO repository root directory or name of overlay bundle
1099 file
1099 file
1100 --cwd DIR change working directory
1100 --cwd DIR change working directory
1101 -y --noninteractive do not prompt, automatically pick the first choice for
1101 -y --noninteractive do not prompt, automatically pick the first choice for
1102 all prompts
1102 all prompts
1103 -q --quiet suppress output
1103 -q --quiet suppress output
1104 -v --verbose enable additional output
1104 -v --verbose enable additional output
1105 --color TYPE when to colorize (boolean, always, auto, never, or
1105 --color TYPE when to colorize (boolean, always, auto, never, or
1106 debug)
1106 debug)
1107 --config CONFIG [+] set/override config option (use 'section.name=value')
1107 --config CONFIG [+] set/override config option (use 'section.name=value')
1108 --debug enable debugging output
1108 --debug enable debugging output
1109 --debugger start debugger
1109 --debugger start debugger
1110 --encoding ENCODE set the charset encoding (default: ascii)
1110 --encoding ENCODE set the charset encoding (default: ascii)
1111 --encodingmode MODE set the charset encoding mode (default: strict)
1111 --encodingmode MODE set the charset encoding mode (default: strict)
1112 --traceback always print a traceback on exception
1112 --traceback always print a traceback on exception
1113 --time time how long the command takes
1113 --time time how long the command takes
1114 --profile print command execution profile
1114 --profile print command execution profile
1115 --version output version information and exit
1115 --version output version information and exit
1116 -h --help display help and exit
1116 -h --help display help and exit
1117 --hidden consider hidden changesets
1117 --hidden consider hidden changesets
1118 --pager TYPE when to paginate (boolean, always, auto, or never)
1118 --pager TYPE when to paginate (boolean, always, auto, or never)
1119 (default: auto)
1119 (default: auto)
1120
1120
1121 Make sure that single '-v' option shows help and built-ins only for 'dodo' command
1121 Make sure that single '-v' option shows help and built-ins only for 'dodo' command
1122 $ hg help -v dodo
1122 $ hg help -v dodo
1123 hg dodo
1123 hg dodo
1124
1124
1125 Does nothing
1125 Does nothing
1126
1126
1127 (use 'hg help -e dodo' to show help for the dodo extension)
1127 (use 'hg help -e dodo' to show help for the dodo extension)
1128
1128
1129 options:
1129 options:
1130
1130
1131 --mq operate on patch repository
1131 --mq operate on patch repository
1132
1132
1133 global options ([+] can be repeated):
1133 global options ([+] can be repeated):
1134
1134
1135 -R --repository REPO repository root directory or name of overlay bundle
1135 -R --repository REPO repository root directory or name of overlay bundle
1136 file
1136 file
1137 --cwd DIR change working directory
1137 --cwd DIR change working directory
1138 -y --noninteractive do not prompt, automatically pick the first choice for
1138 -y --noninteractive do not prompt, automatically pick the first choice for
1139 all prompts
1139 all prompts
1140 -q --quiet suppress output
1140 -q --quiet suppress output
1141 -v --verbose enable additional output
1141 -v --verbose enable additional output
1142 --color TYPE when to colorize (boolean, always, auto, never, or
1142 --color TYPE when to colorize (boolean, always, auto, never, or
1143 debug)
1143 debug)
1144 --config CONFIG [+] set/override config option (use 'section.name=value')
1144 --config CONFIG [+] set/override config option (use 'section.name=value')
1145 --debug enable debugging output
1145 --debug enable debugging output
1146 --debugger start debugger
1146 --debugger start debugger
1147 --encoding ENCODE set the charset encoding (default: ascii)
1147 --encoding ENCODE set the charset encoding (default: ascii)
1148 --encodingmode MODE set the charset encoding mode (default: strict)
1148 --encodingmode MODE set the charset encoding mode (default: strict)
1149 --traceback always print a traceback on exception
1149 --traceback always print a traceback on exception
1150 --time time how long the command takes
1150 --time time how long the command takes
1151 --profile print command execution profile
1151 --profile print command execution profile
1152 --version output version information and exit
1152 --version output version information and exit
1153 -h --help display help and exit
1153 -h --help display help and exit
1154 --hidden consider hidden changesets
1154 --hidden consider hidden changesets
1155 --pager TYPE when to paginate (boolean, always, auto, or never)
1155 --pager TYPE when to paginate (boolean, always, auto, or never)
1156 (default: auto)
1156 (default: auto)
1157
1157
1158 In case when extension name doesn't match any of its commands,
1158 In case when extension name doesn't match any of its commands,
1159 help message should ask for '-v' to get list of built-in aliases
1159 help message should ask for '-v' to get list of built-in aliases
1160 along with extension help
1160 along with extension help
1161 $ cat > $TESTTMP/d/dudu.py <<EOF
1161 $ cat > $TESTTMP/d/dudu.py <<EOF
1162 > """
1162 > """
1163 > This is an awesome 'dudu' extension. It does something and
1163 > This is an awesome 'dudu' extension. It does something and
1164 > also writes 'Beep beep'
1164 > also writes 'Beep beep'
1165 > """
1165 > """
1166 > from mercurial import commands, registrar
1166 > from mercurial import commands, registrar
1167 > cmdtable = {}
1167 > cmdtable = {}
1168 > command = registrar.command(cmdtable)
1168 > command = registrar.command(cmdtable)
1169 > @command(b'something', [], b'hg something')
1169 > @command(b'something', [], b'hg something')
1170 > def something(ui, *args, **kwargs):
1170 > def something(ui, *args, **kwargs):
1171 > """Does something"""
1171 > """Does something"""
1172 > ui.write(b"I do something. Yaaay\\n")
1172 > ui.write(b"I do something. Yaaay\\n")
1173 > @command(b'beep', [], b'hg beep')
1173 > @command(b'beep', [], b'hg beep')
1174 > def beep(ui, *args, **kwargs):
1174 > def beep(ui, *args, **kwargs):
1175 > """Writes 'Beep beep'"""
1175 > """Writes 'Beep beep'"""
1176 > ui.write(b"Beep beep\\n")
1176 > ui.write(b"Beep beep\\n")
1177 > EOF
1177 > EOF
1178 $ dudupath=$TESTTMP/d/dudu.py
1178 $ dudupath=$TESTTMP/d/dudu.py
1179
1179
1180 $ echo "dudu = $dudupath" >> $HGRCPATH
1180 $ echo "dudu = $dudupath" >> $HGRCPATH
1181
1181
1182 $ hg help -e dudu
1182 $ hg help -e dudu
1183 dudu extension -
1183 dudu extension -
1184
1184
1185 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1185 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1186 beep'
1186 beep'
1187
1187
1188 list of commands:
1188 list of commands:
1189
1189
1190 beep Writes 'Beep beep'
1190 beep Writes 'Beep beep'
1191 something Does something
1191 something Does something
1192
1192
1193 (use 'hg help -v dudu' to show built-in aliases and global options)
1193 (use 'hg help -v dudu' to show built-in aliases and global options)
1194
1194
1195 In case when extension name doesn't match any of its commands,
1195 In case when extension name doesn't match any of its commands,
1196 help options '-v' and '-v -e' should be equivalent
1196 help options '-v' and '-v -e' should be equivalent
1197 $ hg help -v dudu
1197 $ hg help -v dudu
1198 dudu extension -
1198 dudu extension -
1199
1199
1200 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1200 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1201 beep'
1201 beep'
1202
1202
1203 list of commands:
1203 list of commands:
1204
1204
1205 beep Writes 'Beep beep'
1205 beep Writes 'Beep beep'
1206 something Does something
1206 something Does something
1207
1207
1208 global options ([+] can be repeated):
1208 global options ([+] can be repeated):
1209
1209
1210 -R --repository REPO repository root directory or name of overlay bundle
1210 -R --repository REPO repository root directory or name of overlay bundle
1211 file
1211 file
1212 --cwd DIR change working directory
1212 --cwd DIR change working directory
1213 -y --noninteractive do not prompt, automatically pick the first choice for
1213 -y --noninteractive do not prompt, automatically pick the first choice for
1214 all prompts
1214 all prompts
1215 -q --quiet suppress output
1215 -q --quiet suppress output
1216 -v --verbose enable additional output
1216 -v --verbose enable additional output
1217 --color TYPE when to colorize (boolean, always, auto, never, or
1217 --color TYPE when to colorize (boolean, always, auto, never, or
1218 debug)
1218 debug)
1219 --config CONFIG [+] set/override config option (use 'section.name=value')
1219 --config CONFIG [+] set/override config option (use 'section.name=value')
1220 --debug enable debugging output
1220 --debug enable debugging output
1221 --debugger start debugger
1221 --debugger start debugger
1222 --encoding ENCODE set the charset encoding (default: ascii)
1222 --encoding ENCODE set the charset encoding (default: ascii)
1223 --encodingmode MODE set the charset encoding mode (default: strict)
1223 --encodingmode MODE set the charset encoding mode (default: strict)
1224 --traceback always print a traceback on exception
1224 --traceback always print a traceback on exception
1225 --time time how long the command takes
1225 --time time how long the command takes
1226 --profile print command execution profile
1226 --profile print command execution profile
1227 --version output version information and exit
1227 --version output version information and exit
1228 -h --help display help and exit
1228 -h --help display help and exit
1229 --hidden consider hidden changesets
1229 --hidden consider hidden changesets
1230 --pager TYPE when to paginate (boolean, always, auto, or never)
1230 --pager TYPE when to paginate (boolean, always, auto, or never)
1231 (default: auto)
1231 (default: auto)
1232
1232
1233 $ hg help -v -e dudu
1233 $ hg help -v -e dudu
1234 dudu extension -
1234 dudu extension -
1235
1235
1236 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1236 This is an awesome 'dudu' extension. It does something and also writes 'Beep
1237 beep'
1237 beep'
1238
1238
1239 list of commands:
1239 list of commands:
1240
1240
1241 beep Writes 'Beep beep'
1241 beep Writes 'Beep beep'
1242 something Does something
1242 something Does something
1243
1243
1244 global options ([+] can be repeated):
1244 global options ([+] can be repeated):
1245
1245
1246 -R --repository REPO repository root directory or name of overlay bundle
1246 -R --repository REPO repository root directory or name of overlay bundle
1247 file
1247 file
1248 --cwd DIR change working directory
1248 --cwd DIR change working directory
1249 -y --noninteractive do not prompt, automatically pick the first choice for
1249 -y --noninteractive do not prompt, automatically pick the first choice for
1250 all prompts
1250 all prompts
1251 -q --quiet suppress output
1251 -q --quiet suppress output
1252 -v --verbose enable additional output
1252 -v --verbose enable additional output
1253 --color TYPE when to colorize (boolean, always, auto, never, or
1253 --color TYPE when to colorize (boolean, always, auto, never, or
1254 debug)
1254 debug)
1255 --config CONFIG [+] set/override config option (use 'section.name=value')
1255 --config CONFIG [+] set/override config option (use 'section.name=value')
1256 --debug enable debugging output
1256 --debug enable debugging output
1257 --debugger start debugger
1257 --debugger start debugger
1258 --encoding ENCODE set the charset encoding (default: ascii)
1258 --encoding ENCODE set the charset encoding (default: ascii)
1259 --encodingmode MODE set the charset encoding mode (default: strict)
1259 --encodingmode MODE set the charset encoding mode (default: strict)
1260 --traceback always print a traceback on exception
1260 --traceback always print a traceback on exception
1261 --time time how long the command takes
1261 --time time how long the command takes
1262 --profile print command execution profile
1262 --profile print command execution profile
1263 --version output version information and exit
1263 --version output version information and exit
1264 -h --help display help and exit
1264 -h --help display help and exit
1265 --hidden consider hidden changesets
1265 --hidden consider hidden changesets
1266 --pager TYPE when to paginate (boolean, always, auto, or never)
1266 --pager TYPE when to paginate (boolean, always, auto, or never)
1267 (default: auto)
1267 (default: auto)
1268
1268
1269 Disabled extension commands:
1269 Disabled extension commands:
1270
1270
1271 $ ORGHGRCPATH=$HGRCPATH
1271 $ ORGHGRCPATH=$HGRCPATH
1272 $ HGRCPATH=
1272 $ HGRCPATH=
1273 $ export HGRCPATH
1273 $ export HGRCPATH
1274 $ hg help email
1274 $ hg help email
1275 'email' is provided by the following extension:
1275 'email' is provided by the following extension:
1276
1276
1277 patchbomb command to send changesets as (a series of) patch emails
1277 patchbomb command to send changesets as (a series of) patch emails
1278
1278
1279 (use 'hg help extensions' for information on enabling extensions)
1279 (use 'hg help extensions' for information on enabling extensions)
1280
1280
1281
1281
1282 $ hg qdel
1282 $ hg qdel
1283 hg: unknown command 'qdel'
1283 hg: unknown command 'qdel'
1284 'qdelete' is provided by the following extension:
1284 'qdelete' is provided by the following extension:
1285
1285
1286 mq manage a stack of patches
1286 mq manage a stack of patches
1287
1287
1288 (use 'hg help extensions' for information on enabling extensions)
1288 (use 'hg help extensions' for information on enabling extensions)
1289 [255]
1289 [255]
1290
1290
1291
1291
1292 $ hg churn
1292 $ hg churn
1293 hg: unknown command 'churn'
1293 hg: unknown command 'churn'
1294 'churn' is provided by the following extension:
1294 'churn' is provided by the following extension:
1295
1295
1296 churn command to display statistics about repository history
1296 churn command to display statistics about repository history
1297
1297
1298 (use 'hg help extensions' for information on enabling extensions)
1298 (use 'hg help extensions' for information on enabling extensions)
1299 [255]
1299 [255]
1300
1300
1301
1301
1302
1302
1303 Disabled extensions:
1303 Disabled extensions:
1304
1304
1305 $ hg help churn
1305 $ hg help churn
1306 churn extension - command to display statistics about repository history
1306 churn extension - command to display statistics about repository history
1307
1307
1308 (use 'hg help extensions' for information on enabling extensions)
1308 (use 'hg help extensions' for information on enabling extensions)
1309
1309
1310 $ hg help patchbomb
1310 $ hg help patchbomb
1311 patchbomb extension - command to send changesets as (a series of) patch emails
1311 patchbomb extension - command to send changesets as (a series of) patch emails
1312
1312
1313 The series is started off with a "[PATCH 0 of N]" introduction, which
1313 The series is started off with a "[PATCH 0 of N]" introduction, which
1314 describes the series as a whole.
1314 describes the series as a whole.
1315
1315
1316 Each patch email has a Subject line of "[PATCH M of N] ...", using the first
1316 Each patch email has a Subject line of "[PATCH M of N] ...", using the first
1317 line of the changeset description as the subject text. The message contains
1317 line of the changeset description as the subject text. The message contains
1318 two or three body parts:
1318 two or three body parts:
1319
1319
1320 - The changeset description.
1320 - The changeset description.
1321 - [Optional] The result of running diffstat on the patch.
1321 - [Optional] The result of running diffstat on the patch.
1322 - The patch itself, as generated by 'hg export'.
1322 - The patch itself, as generated by 'hg export'.
1323
1323
1324 Each message refers to the first in the series using the In-Reply-To and
1324 Each message refers to the first in the series using the In-Reply-To and
1325 References headers, so they will show up as a sequence in threaded mail and
1325 References headers, so they will show up as a sequence in threaded mail and
1326 news readers, and in mail archives.
1326 news readers, and in mail archives.
1327
1327
1328 To configure other defaults, add a section like this to your configuration
1328 To configure other defaults, add a section like this to your configuration
1329 file:
1329 file:
1330
1330
1331 [email]
1331 [email]
1332 from = My Name <my@email>
1332 from = My Name <my@email>
1333 to = recipient1, recipient2, ...
1333 to = recipient1, recipient2, ...
1334 cc = cc1, cc2, ...
1334 cc = cc1, cc2, ...
1335 bcc = bcc1, bcc2, ...
1335 bcc = bcc1, bcc2, ...
1336 reply-to = address1, address2, ...
1336 reply-to = address1, address2, ...
1337
1337
1338 Use "[patchbomb]" as configuration section name if you need to override global
1338 Use "[patchbomb]" as configuration section name if you need to override global
1339 "[email]" address settings.
1339 "[email]" address settings.
1340
1340
1341 Then you can use the 'hg email' command to mail a series of changesets as a
1341 Then you can use the 'hg email' command to mail a series of changesets as a
1342 patchbomb.
1342 patchbomb.
1343
1343
1344 You can also either configure the method option in the email section to be a
1344 You can also either configure the method option in the email section to be a
1345 sendmail compatible mailer or fill out the [smtp] section so that the
1345 sendmail compatible mailer or fill out the [smtp] section so that the
1346 patchbomb extension can automatically send patchbombs directly from the
1346 patchbomb extension can automatically send patchbombs directly from the
1347 commandline. See the [email] and [smtp] sections in hgrc(5) for details.
1347 commandline. See the [email] and [smtp] sections in hgrc(5) for details.
1348
1348
1349 By default, 'hg email' will prompt for a "To" or "CC" header if you do not
1349 By default, 'hg email' will prompt for a "To" or "CC" header if you do not
1350 supply one via configuration or the command line. You can override this to
1350 supply one via configuration or the command line. You can override this to
1351 never prompt by configuring an empty value:
1351 never prompt by configuring an empty value:
1352
1352
1353 [email]
1353 [email]
1354 cc =
1354 cc =
1355
1355
1356 You can control the default inclusion of an introduction message with the
1356 You can control the default inclusion of an introduction message with the
1357 "patchbomb.intro" configuration option. The configuration is always
1357 "patchbomb.intro" configuration option. The configuration is always
1358 overwritten by command line flags like --intro and --desc:
1358 overwritten by command line flags like --intro and --desc:
1359
1359
1360 [patchbomb]
1360 [patchbomb]
1361 intro=auto # include introduction message if more than 1 patch (default)
1361 intro=auto # include introduction message if more than 1 patch (default)
1362 intro=never # never include an introduction message
1362 intro=never # never include an introduction message
1363 intro=always # always include an introduction message
1363 intro=always # always include an introduction message
1364
1364
1365 You can specify a template for flags to be added in subject prefixes. Flags
1365 You can specify a template for flags to be added in subject prefixes. Flags
1366 specified by --flag option are exported as "{flags}" keyword:
1366 specified by --flag option are exported as "{flags}" keyword:
1367
1367
1368 [patchbomb]
1368 [patchbomb]
1369 flagtemplate = "{separate(' ',
1369 flagtemplate = "{separate(' ',
1370 ifeq(branch, 'default', '', branch|upper),
1370 ifeq(branch, 'default', '', branch|upper),
1371 flags)}"
1371 flags)}"
1372
1372
1373 You can set patchbomb to always ask for confirmation by setting
1373 You can set patchbomb to always ask for confirmation by setting
1374 "patchbomb.confirm" to true.
1374 "patchbomb.confirm" to true.
1375
1375
1376 (use 'hg help extensions' for information on enabling extensions)
1376 (use 'hg help extensions' for information on enabling extensions)
1377
1377
1378
1378
1379 Broken disabled extension and command:
1379 Broken disabled extension and command:
1380
1380
1381 $ mkdir hgext
1381 $ mkdir hgext
1382 $ echo > hgext/__init__.py
1382 $ echo > hgext/__init__.py
1383 $ cat > hgext/broken.py <<NO_CHECK_EOF
1383 $ cat > hgext/broken.py <<NO_CHECK_EOF
1384 > "broken extension'
1384 > "broken extension'
1385 > NO_CHECK_EOF
1385 > NO_CHECK_EOF
1386 $ cat > path.py <<EOF
1386 $ cat > path.py <<EOF
1387 > import os
1387 > import os
1388 > import sys
1388 > import sys
1389 > sys.path.insert(0, os.environ['HGEXTPATH'])
1389 > sys.path.insert(0, os.environ['HGEXTPATH'])
1390 > EOF
1390 > EOF
1391 $ HGEXTPATH=`pwd`
1391 $ HGEXTPATH=`pwd`
1392 $ export HGEXTPATH
1392 $ export HGEXTPATH
1393
1393
1394 $ hg --config extensions.path=./path.py help broken
1394 $ hg --config extensions.path=./path.py help broken
1395 broken extension - (no help text available)
1395 broken extension - (no help text available)
1396
1396
1397 (use 'hg help extensions' for information on enabling extensions)
1397 (use 'hg help extensions' for information on enabling extensions)
1398
1398
1399
1399
1400 $ cat > hgext/forest.py <<EOF
1400 $ cat > hgext/forest.py <<EOF
1401 > cmdtable = None
1401 > cmdtable = None
1402 > @command()
1402 > @command()
1403 > def f():
1403 > def f():
1404 > pass
1404 > pass
1405 > @command(123)
1405 > @command(123)
1406 > def g():
1406 > def g():
1407 > pass
1407 > pass
1408 > EOF
1408 > EOF
1409 $ hg --config extensions.path=./path.py help foo
1409 $ hg --config extensions.path=./path.py help foo
1410 abort: no such help topic: foo
1410 abort: no such help topic: foo
1411 (try 'hg help --keyword foo')
1411 (try 'hg help --keyword foo')
1412 [255]
1412 [255]
1413
1413
1414 $ cat > throw.py <<EOF
1414 $ cat > throw.py <<EOF
1415 > from mercurial import commands, registrar, util
1415 > from mercurial import commands, registrar, util
1416 > cmdtable = {}
1416 > cmdtable = {}
1417 > command = registrar.command(cmdtable)
1417 > command = registrar.command(cmdtable)
1418 > class Bogon(Exception): pass
1418 > class Bogon(Exception): pass
1419 > # NB: version should be bytes; simulating extension not ported to py3
1419 > # NB: version should be bytes; simulating extension not ported to py3
1420 > __version__ = '1.0.0'
1420 > __version__ = '1.0.0'
1421 > @command(b'throw', [], b'hg throw', norepo=True)
1421 > @command(b'throw', [], b'hg throw', norepo=True)
1422 > def throw(ui, **opts):
1422 > def throw(ui, **opts):
1423 > """throws an exception"""
1423 > """throws an exception"""
1424 > raise Bogon()
1424 > raise Bogon()
1425 > EOF
1425 > EOF
1426
1426
1427 Test extension without proper byteification of key attributes doesn't crash when
1427 Test extension without proper byteification of key attributes doesn't crash when
1428 accessed.
1428 accessed.
1429
1429
1430 $ hg version -v --config extensions.throw=throw.py | grep '^ '
1430 $ hg version -v --config extensions.throw=throw.py | grep '^ '
1431 throw external 1.0.0
1431 throw external 1.0.0
1432
1432
1433 No declared supported version, extension complains:
1433 No declared supported version, extension complains:
1434 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1434 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1435 ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
1435 ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
1436 ** which supports versions unknown of Mercurial.
1436 ** which supports versions unknown of Mercurial.
1437 ** Please disable "throw" and try your action again.
1437 ** Please disable "throw" and try your action again.
1438 ** If that fixes the bug please report it to the extension author.
1438 ** If that fixes the bug please report it to the extension author.
1439 ** Python * (glob)
1439 ** Python * (glob)
1440 ** Mercurial Distributed SCM * (glob)
1440 ** Mercurial Distributed SCM * (glob)
1441 ** Extensions loaded: throw 1.0.0
1441 ** Extensions loaded: throw 1.0.0
1442
1442
1443 empty declaration of supported version, extension complains (but doesn't choke if
1443 empty declaration of supported version, extension complains (but doesn't choke if
1444 the value is improperly a str instead of bytes):
1444 the value is improperly a str instead of bytes):
1445 $ echo "testedwith = ''" >> throw.py
1445 $ echo "testedwith = ''" >> throw.py
1446 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1446 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1447 ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
1447 ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
1448 ** which supports versions unknown of Mercurial.
1448 ** which supports versions unknown of Mercurial.
1449 ** Please disable "throw" and try your action again.
1449 ** Please disable "throw" and try your action again.
1450 ** If that fixes the bug please report it to the extension author.
1450 ** If that fixes the bug please report it to the extension author.
1451 ** Python * (glob)
1451 ** Python * (glob)
1452 ** Mercurial Distributed SCM (*) (glob)
1452 ** Mercurial Distributed SCM (*) (glob)
1453 ** Extensions loaded: throw 1.0.0
1453 ** Extensions loaded: throw 1.0.0
1454
1454
1455 If the extension specifies a buglink, show that (but don't choke if the value is
1455 If the extension specifies a buglink, show that (but don't choke if the value is
1456 improperly a str instead of bytes):
1456 improperly a str instead of bytes):
1457 $ echo 'buglink = "http://example.com/bts"' >> throw.py
1457 $ echo 'buglink = "http://example.com/bts"' >> throw.py
1458 $ rm -f throw.pyc throw.pyo
1458 $ rm -f throw.pyc throw.pyo
1459 $ rm -Rf __pycache__
1459 $ rm -Rf __pycache__
1460 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1460 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1461 ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
1461 ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
1462 ** which supports versions unknown of Mercurial.
1462 ** which supports versions unknown of Mercurial.
1463 ** Please disable "throw" and try your action again.
1463 ** Please disable "throw" and try your action again.
1464 ** If that fixes the bug please report it to http://example.com/bts
1464 ** If that fixes the bug please report it to http://example.com/bts
1465 ** Python * (glob)
1465 ** Python * (glob)
1466 ** Mercurial Distributed SCM (*) (glob)
1466 ** Mercurial Distributed SCM (*) (glob)
1467 ** Extensions loaded: throw 1.0.0
1467 ** Extensions loaded: throw 1.0.0
1468
1468
1469 If the extensions declare outdated versions, accuse the older extension first:
1469 If the extensions declare outdated versions, accuse the older extension first:
1470 $ echo "from mercurial import util" >> older.py
1470 $ echo "from mercurial import util" >> older.py
1471 $ echo "util.version = lambda:b'2.2'" >> older.py
1471 $ echo "util.version = lambda:b'2.2'" >> older.py
1472 $ echo "testedwith = b'1.9.3'" >> older.py
1472 $ echo "testedwith = b'1.9.3'" >> older.py
1473 $ echo "testedwith = b'2.1.1'" >> throw.py
1473 $ echo "testedwith = b'2.1.1'" >> throw.py
1474 $ rm -f throw.pyc throw.pyo
1474 $ rm -f throw.pyc throw.pyo
1475 $ rm -Rf __pycache__
1475 $ rm -Rf __pycache__
1476 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1476 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1477 > throw 2>&1 | egrep '^\*\*'
1477 > throw 2>&1 | egrep '^\*\*'
1478 ** Unknown exception encountered with possibly-broken third-party extension "older" (version N/A)
1478 ** Unknown exception encountered with possibly-broken third-party extension "older" (version N/A)
1479 ** which supports versions 1.9 of Mercurial.
1479 ** which supports versions 1.9 of Mercurial.
1480 ** Please disable "older" and try your action again.
1480 ** Please disable "older" and try your action again.
1481 ** If that fixes the bug please report it to the extension author.
1481 ** If that fixes the bug please report it to the extension author.
1482 ** Python * (glob)
1482 ** Python * (glob)
1483 ** Mercurial Distributed SCM (version 2.2)
1483 ** Mercurial Distributed SCM (version 2.2)
1484 ** Extensions loaded: older, throw 1.0.0
1484 ** Extensions loaded: older, throw 1.0.0
1485
1485
1486 One extension only tested with older, one only with newer versions:
1486 One extension only tested with older, one only with newer versions:
1487 $ echo "util.version = lambda:b'2.1'" >> older.py
1487 $ echo "util.version = lambda:b'2.1'" >> older.py
1488 $ rm -f older.pyc older.pyo
1488 $ rm -f older.pyc older.pyo
1489 $ rm -Rf __pycache__
1489 $ rm -Rf __pycache__
1490 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1490 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1491 > throw 2>&1 | egrep '^\*\*'
1491 > throw 2>&1 | egrep '^\*\*'
1492 ** Unknown exception encountered with possibly-broken third-party extension "older" (version N/A)
1492 ** Unknown exception encountered with possibly-broken third-party extension "older" (version N/A)
1493 ** which supports versions 1.9 of Mercurial.
1493 ** which supports versions 1.9 of Mercurial.
1494 ** Please disable "older" and try your action again.
1494 ** Please disable "older" and try your action again.
1495 ** If that fixes the bug please report it to the extension author.
1495 ** If that fixes the bug please report it to the extension author.
1496 ** Python * (glob)
1496 ** Python * (glob)
1497 ** Mercurial Distributed SCM (version 2.1)
1497 ** Mercurial Distributed SCM (version 2.1)
1498 ** Extensions loaded: older, throw 1.0.0
1498 ** Extensions loaded: older, throw 1.0.0
1499
1499
1500 Older extension is tested with current version, the other only with newer:
1500 Older extension is tested with current version, the other only with newer:
1501 $ echo "util.version = lambda:b'1.9.3'" >> older.py
1501 $ echo "util.version = lambda:b'1.9.3'" >> older.py
1502 $ rm -f older.pyc older.pyo
1502 $ rm -f older.pyc older.pyo
1503 $ rm -Rf __pycache__
1503 $ rm -Rf __pycache__
1504 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1504 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1505 > throw 2>&1 | egrep '^\*\*'
1505 > throw 2>&1 | egrep '^\*\*'
1506 ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
1506 ** Unknown exception encountered with possibly-broken third-party extension "throw" 1.0.0
1507 ** which supports versions 2.1 of Mercurial.
1507 ** which supports versions 2.1 of Mercurial.
1508 ** Please disable "throw" and try your action again.
1508 ** Please disable "throw" and try your action again.
1509 ** If that fixes the bug please report it to http://example.com/bts
1509 ** If that fixes the bug please report it to http://example.com/bts
1510 ** Python * (glob)
1510 ** Python * (glob)
1511 ** Mercurial Distributed SCM (version 1.9.3)
1511 ** Mercurial Distributed SCM (version 1.9.3)
1512 ** Extensions loaded: older, throw 1.0.0
1512 ** Extensions loaded: older, throw 1.0.0
1513
1513
1514 Ability to point to a different point
1514 Ability to point to a different point
1515 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1515 $ hg --config extensions.throw=throw.py --config extensions.older=older.py \
1516 > --config ui.supportcontact='Your Local Goat Lenders' throw 2>&1 | egrep '^\*\*'
1516 > --config ui.supportcontact='Your Local Goat Lenders' throw 2>&1 | egrep '^\*\*'
1517 ** unknown exception encountered, please report by visiting
1517 ** unknown exception encountered, please report by visiting
1518 ** Your Local Goat Lenders
1518 ** Your Local Goat Lenders
1519 ** Python * (glob)
1519 ** Python * (glob)
1520 ** Mercurial Distributed SCM (*) (glob)
1520 ** Mercurial Distributed SCM (*) (glob)
1521 ** Extensions loaded: older, throw 1.0.0
1521 ** Extensions loaded: older, throw 1.0.0
1522
1522
1523 Declare the version as supporting this hg version, show regular bts link:
1523 Declare the version as supporting this hg version, show regular bts link:
1524 $ hgver=`hg debuginstall -T '{hgver}'`
1524 $ hgver=`hg debuginstall -T '{hgver}'`
1525 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
1525 $ echo 'testedwith = """'"$hgver"'"""' >> throw.py
1526 $ if [ -z "$hgver" ]; then
1526 $ if [ -z "$hgver" ]; then
1527 > echo "unable to fetch a mercurial version. Make sure __version__ is correct";
1527 > echo "unable to fetch a mercurial version. Make sure __version__ is correct";
1528 > fi
1528 > fi
1529 $ rm -f throw.pyc throw.pyo
1529 $ rm -f throw.pyc throw.pyo
1530 $ rm -Rf __pycache__
1530 $ rm -Rf __pycache__
1531 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1531 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1532 ** unknown exception encountered, please report by visiting
1532 ** unknown exception encountered, please report by visiting
1533 ** https://mercurial-scm.org/wiki/BugTracker
1533 ** https://mercurial-scm.org/wiki/BugTracker
1534 ** Python * (glob)
1534 ** Python * (glob)
1535 ** Mercurial Distributed SCM (*) (glob)
1535 ** Mercurial Distributed SCM (*) (glob)
1536 ** Extensions loaded: throw 1.0.0
1536 ** Extensions loaded: throw 1.0.0
1537
1537
1538 Patch version is ignored during compatibility check
1538 Patch version is ignored during compatibility check
1539 $ echo "testedwith = b'3.2'" >> throw.py
1539 $ echo "testedwith = b'3.2'" >> throw.py
1540 $ echo "util.version = lambda:b'3.2.2'" >> throw.py
1540 $ echo "util.version = lambda:b'3.2.2'" >> throw.py
1541 $ rm -f throw.pyc throw.pyo
1541 $ rm -f throw.pyc throw.pyo
1542 $ rm -Rf __pycache__
1542 $ rm -Rf __pycache__
1543 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1543 $ hg --config extensions.throw=throw.py throw 2>&1 | egrep '^\*\*'
1544 ** unknown exception encountered, please report by visiting
1544 ** unknown exception encountered, please report by visiting
1545 ** https://mercurial-scm.org/wiki/BugTracker
1545 ** https://mercurial-scm.org/wiki/BugTracker
1546 ** Python * (glob)
1546 ** Python * (glob)
1547 ** Mercurial Distributed SCM (*) (glob)
1547 ** Mercurial Distributed SCM (*) (glob)
1548 ** Extensions loaded: throw 1.0.0
1548 ** Extensions loaded: throw 1.0.0
1549
1549
1550 Test version number support in 'hg version':
1550 Test version number support in 'hg version':
1551 $ echo '__version__ = (1, 2, 3)' >> throw.py
1551 $ echo '__version__ = (1, 2, 3)' >> throw.py
1552 $ rm -f throw.pyc throw.pyo
1552 $ rm -f throw.pyc throw.pyo
1553 $ rm -Rf __pycache__
1553 $ rm -Rf __pycache__
1554 $ hg version -v
1554 $ hg version -v
1555 Mercurial Distributed SCM (version *) (glob)
1555 Mercurial Distributed SCM (version *) (glob)
1556 (see https://mercurial-scm.org for more information)
1556 (see https://mercurial-scm.org for more information)
1557
1557
1558 Copyright (C) 2005-* Matt Mackall and others (glob)
1558 Copyright (C) 2005-* Matt Mackall and others (glob)
1559 This is free software; see the source for copying conditions. There is NO
1559 This is free software; see the source for copying conditions. There is NO
1560 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1560 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1561
1561
1562 Enabled extensions:
1562 Enabled extensions:
1563
1563
1564
1564
1565 $ hg version -v --config extensions.throw=throw.py
1565 $ hg version -v --config extensions.throw=throw.py
1566 Mercurial Distributed SCM (version *) (glob)
1566 Mercurial Distributed SCM (version *) (glob)
1567 (see https://mercurial-scm.org for more information)
1567 (see https://mercurial-scm.org for more information)
1568
1568
1569 Copyright (C) 2005-* Matt Mackall and others (glob)
1569 Copyright (C) 2005-* Matt Mackall and others (glob)
1570 This is free software; see the source for copying conditions. There is NO
1570 This is free software; see the source for copying conditions. There is NO
1571 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1571 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1572
1572
1573 Enabled extensions:
1573 Enabled extensions:
1574
1574
1575 throw external 1.2.3
1575 throw external 1.2.3
1576 $ echo 'getversion = lambda: b"1.twentythree"' >> throw.py
1576 $ echo 'getversion = lambda: b"1.twentythree"' >> throw.py
1577 $ rm -f throw.pyc throw.pyo
1577 $ rm -f throw.pyc throw.pyo
1578 $ rm -Rf __pycache__
1578 $ rm -Rf __pycache__
1579 $ hg version -v --config extensions.throw=throw.py --config extensions.strip=
1579 $ hg version -v --config extensions.throw=throw.py --config extensions.strip=
1580 Mercurial Distributed SCM (version *) (glob)
1580 Mercurial Distributed SCM (version *) (glob)
1581 (see https://mercurial-scm.org for more information)
1581 (see https://mercurial-scm.org for more information)
1582
1582
1583 Copyright (C) 2005-* Matt Mackall and others (glob)
1583 Copyright (C) 2005-* Matt Mackall and others (glob)
1584 This is free software; see the source for copying conditions. There is NO
1584 This is free software; see the source for copying conditions. There is NO
1585 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1585 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1586
1586
1587 Enabled extensions:
1587 Enabled extensions:
1588
1588
1589 strip internal
1589 strip internal
1590 throw external 1.twentythree
1590 throw external 1.twentythree
1591
1591
1592 $ hg version -q --config extensions.throw=throw.py
1592 $ hg version -q --config extensions.throw=throw.py
1593 Mercurial Distributed SCM (version *) (glob)
1593 Mercurial Distributed SCM (version *) (glob)
1594
1594
1595 Test template output:
1595 Test template output:
1596
1596
1597 $ hg version --config extensions.strip= -T'{extensions}'
1597 $ hg version --config extensions.strip= -T'{extensions}'
1598 strip
1598 strip
1599
1599
1600 Test JSON output of version:
1600 Test JSON output of version:
1601
1601
1602 $ hg version -Tjson
1602 $ hg version -Tjson
1603 [
1603 [
1604 {
1604 {
1605 "extensions": [],
1605 "extensions": [],
1606 "ver": "*" (glob)
1606 "ver": "*" (glob)
1607 }
1607 }
1608 ]
1608 ]
1609
1609
1610 $ hg version --config extensions.throw=throw.py -Tjson
1610 $ hg version --config extensions.throw=throw.py -Tjson
1611 [
1611 [
1612 {
1612 {
1613 "extensions": [{"bundled": false, "name": "throw", "ver": "1.twentythree"}],
1613 "extensions": [{"bundled": false, "name": "throw", "ver": "1.twentythree"}],
1614 "ver": "3.2.2"
1614 "ver": "3.2.2"
1615 }
1615 }
1616 ]
1616 ]
1617
1617
1618 $ hg version --config extensions.strip= -Tjson
1618 $ hg version --config extensions.strip= -Tjson
1619 [
1619 [
1620 {
1620 {
1621 "extensions": [{"bundled": true, "name": "strip", "ver": null}],
1621 "extensions": [{"bundled": true, "name": "strip", "ver": null}],
1622 "ver": "*" (glob)
1622 "ver": "*" (glob)
1623 }
1623 }
1624 ]
1624 ]
1625
1625
1626 Test template output of version:
1626 Test template output of version:
1627
1627
1628 $ hg version --config extensions.throw=throw.py --config extensions.strip= \
1628 $ hg version --config extensions.throw=throw.py --config extensions.strip= \
1629 > -T'{extensions % "{name} {pad(ver, 16)} ({if(bundled, "internal", "external")})\n"}'
1629 > -T'{extensions % "{name} {pad(ver, 16)} ({if(bundled, "internal", "external")})\n"}'
1630 strip (internal)
1630 strip (internal)
1631 throw 1.twentythree (external)
1631 throw 1.twentythree (external)
1632
1632
1633 Refuse to load extensions with minimum version requirements
1633 Refuse to load extensions with minimum version requirements
1634
1634
1635 $ cat > minversion1.py << EOF
1635 $ cat > minversion1.py << EOF
1636 > from mercurial import util
1636 > from mercurial import util
1637 > util.version = lambda: b'3.5.2'
1637 > util.version = lambda: b'3.5.2'
1638 > minimumhgversion = b'3.6'
1638 > minimumhgversion = b'3.6'
1639 > EOF
1639 > EOF
1640 $ hg --config extensions.minversion=minversion1.py version
1640 $ hg --config extensions.minversion=minversion1.py version
1641 (third party extension minversion requires version 3.6 or newer of Mercurial (current: 3.5.2); disabling)
1641 (third party extension minversion requires version 3.6 or newer of Mercurial (current: 3.5.2); disabling)
1642 Mercurial Distributed SCM (version 3.5.2)
1642 Mercurial Distributed SCM (version 3.5.2)
1643 (see https://mercurial-scm.org for more information)
1643 (see https://mercurial-scm.org for more information)
1644
1644
1645 Copyright (C) 2005-* Matt Mackall and others (glob)
1645 Copyright (C) 2005-* Matt Mackall and others (glob)
1646 This is free software; see the source for copying conditions. There is NO
1646 This is free software; see the source for copying conditions. There is NO
1647 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1647 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1648
1648
1649 $ cat > minversion2.py << EOF
1649 $ cat > minversion2.py << EOF
1650 > from mercurial import util
1650 > from mercurial import util
1651 > util.version = lambda: b'3.6'
1651 > util.version = lambda: b'3.6'
1652 > minimumhgversion = b'3.7'
1652 > minimumhgversion = b'3.7'
1653 > EOF
1653 > EOF
1654 $ hg --config extensions.minversion=minversion2.py version 2>&1 | egrep '\(third'
1654 $ hg --config extensions.minversion=minversion2.py version 2>&1 | egrep '\(third'
1655 (third party extension minversion requires version 3.7 or newer of Mercurial (current: 3.6); disabling)
1655 (third party extension minversion requires version 3.7 or newer of Mercurial (current: 3.6); disabling)
1656
1656
1657 Can load version that is only off by point release
1657 Can load version that is only off by point release
1658
1658
1659 $ cat > minversion2.py << EOF
1659 $ cat > minversion2.py << EOF
1660 > from mercurial import util
1660 > from mercurial import util
1661 > util.version = lambda: b'3.6.1'
1661 > util.version = lambda: b'3.6.1'
1662 > minimumhgversion = b'3.6'
1662 > minimumhgversion = b'3.6'
1663 > EOF
1663 > EOF
1664 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1664 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1665 [1]
1665 [1]
1666
1666
1667 Can load minimum version identical to current
1667 Can load minimum version identical to current
1668
1668
1669 $ cat > minversion3.py << EOF
1669 $ cat > minversion3.py << EOF
1670 > from mercurial import util
1670 > from mercurial import util
1671 > util.version = lambda: b'3.5'
1671 > util.version = lambda: b'3.5'
1672 > minimumhgversion = b'3.5'
1672 > minimumhgversion = b'3.5'
1673 > EOF
1673 > EOF
1674 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1674 $ hg --config extensions.minversion=minversion3.py version 2>&1 | egrep '\(third'
1675 [1]
1675 [1]
1676
1676
1677 Restore HGRCPATH
1677 Restore HGRCPATH
1678
1678
1679 $ HGRCPATH=$ORGHGRCPATH
1679 $ HGRCPATH=$ORGHGRCPATH
1680 $ export HGRCPATH
1680 $ export HGRCPATH
1681
1681
1682 Commands handling multiple repositories at a time should invoke only
1682 Commands handling multiple repositories at a time should invoke only
1683 "reposetup()" of extensions enabling in the target repository.
1683 "reposetup()" of extensions enabling in the target repository.
1684
1684
1685 $ mkdir reposetup-test
1685 $ mkdir reposetup-test
1686 $ cd reposetup-test
1686 $ cd reposetup-test
1687
1687
1688 $ cat > $TESTTMP/reposetuptest.py <<EOF
1688 $ cat > $TESTTMP/reposetuptest.py <<EOF
1689 > from mercurial import extensions
1689 > from mercurial import extensions
1690 > def reposetup(ui, repo):
1690 > def reposetup(ui, repo):
1691 > ui.write(b'reposetup() for %s\n' % (repo.root))
1691 > ui.write(b'reposetup() for %s\n' % (repo.root))
1692 > ui.flush()
1692 > ui.flush()
1693 > EOF
1693 > EOF
1694 $ hg init src
1694 $ hg init src
1695 $ echo a > src/a
1695 $ echo a > src/a
1696 $ hg -R src commit -Am '#0 at src/a'
1696 $ hg -R src commit -Am '#0 at src/a'
1697 adding a
1697 adding a
1698 $ echo '[extensions]' >> src/.hg/hgrc
1698 $ echo '[extensions]' >> src/.hg/hgrc
1699 $ echo '# enable extension locally' >> src/.hg/hgrc
1699 $ echo '# enable extension locally' >> src/.hg/hgrc
1700 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
1700 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> src/.hg/hgrc
1701 $ hg -R src status
1701 $ hg -R src status
1702 reposetup() for $TESTTMP/reposetup-test/src
1702 reposetup() for $TESTTMP/reposetup-test/src
1703 reposetup() for $TESTTMP/reposetup-test/src (chg !)
1703 reposetup() for $TESTTMP/reposetup-test/src (chg !)
1704
1704
1705 #if no-extraextensions
1705 #if no-extraextensions
1706 $ hg --cwd src debugextensions
1706 $ hg --cwd src debugextensions
1707 reposetup() for $TESTTMP/reposetup-test/src
1707 reposetup() for $TESTTMP/reposetup-test/src
1708 dodo (untested!)
1708 dodo (untested!)
1709 dudu (untested!)
1709 dudu (untested!)
1710 mq
1710 mq
1711 reposetuptest (untested!)
1711 reposetuptest (untested!)
1712 strip
1712 strip
1713 #endif
1713 #endif
1714
1714
1715 $ hg clone -U src clone-dst1
1715 $ hg clone -U src clone-dst1
1716 reposetup() for $TESTTMP/reposetup-test/src
1716 reposetup() for $TESTTMP/reposetup-test/src
1717 $ hg init push-dst1
1717 $ hg init push-dst1
1718 $ hg -q -R src push push-dst1
1718 $ hg -q -R src push push-dst1
1719 reposetup() for $TESTTMP/reposetup-test/src
1719 reposetup() for $TESTTMP/reposetup-test/src
1720 $ hg init pull-src1
1720 $ hg init pull-src1
1721 $ hg -q -R pull-src1 pull src
1721 $ hg -q -R pull-src1 pull src
1722 reposetup() for $TESTTMP/reposetup-test/src
1722 reposetup() for $TESTTMP/reposetup-test/src
1723
1723
1724 $ cat <<EOF >> $HGRCPATH
1724 $ cat <<EOF >> $HGRCPATH
1725 > [extensions]
1725 > [extensions]
1726 > # disable extension globally and explicitly
1726 > # disable extension globally and explicitly
1727 > reposetuptest = !
1727 > reposetuptest = !
1728 > EOF
1728 > EOF
1729 $ hg clone -U src clone-dst2
1729 $ hg clone -U src clone-dst2
1730 reposetup() for $TESTTMP/reposetup-test/src
1730 reposetup() for $TESTTMP/reposetup-test/src
1731 $ hg init push-dst2
1731 $ hg init push-dst2
1732 $ hg -q -R src push push-dst2
1732 $ hg -q -R src push push-dst2
1733 reposetup() for $TESTTMP/reposetup-test/src
1733 reposetup() for $TESTTMP/reposetup-test/src
1734 $ hg init pull-src2
1734 $ hg init pull-src2
1735 $ hg -q -R pull-src2 pull src
1735 $ hg -q -R pull-src2 pull src
1736 reposetup() for $TESTTMP/reposetup-test/src
1736 reposetup() for $TESTTMP/reposetup-test/src
1737
1737
1738 $ cat <<EOF >> $HGRCPATH
1738 $ cat <<EOF >> $HGRCPATH
1739 > [extensions]
1739 > [extensions]
1740 > # enable extension globally
1740 > # enable extension globally
1741 > reposetuptest = $TESTTMP/reposetuptest.py
1741 > reposetuptest = $TESTTMP/reposetuptest.py
1742 > EOF
1742 > EOF
1743 $ hg clone -U src clone-dst3
1743 $ hg clone -U src clone-dst3
1744 reposetup() for $TESTTMP/reposetup-test/src
1744 reposetup() for $TESTTMP/reposetup-test/src
1745 reposetup() for $TESTTMP/reposetup-test/clone-dst3
1745 reposetup() for $TESTTMP/reposetup-test/clone-dst3
1746 $ hg init push-dst3
1746 $ hg init push-dst3
1747 reposetup() for $TESTTMP/reposetup-test/push-dst3
1747 reposetup() for $TESTTMP/reposetup-test/push-dst3
1748 $ hg -q -R src push push-dst3
1748 $ hg -q -R src push push-dst3
1749 reposetup() for $TESTTMP/reposetup-test/src
1749 reposetup() for $TESTTMP/reposetup-test/src
1750 reposetup() for $TESTTMP/reposetup-test/push-dst3
1750 reposetup() for $TESTTMP/reposetup-test/push-dst3
1751 $ hg init pull-src3
1751 $ hg init pull-src3
1752 reposetup() for $TESTTMP/reposetup-test/pull-src3
1752 reposetup() for $TESTTMP/reposetup-test/pull-src3
1753 $ hg -q -R pull-src3 pull src
1753 $ hg -q -R pull-src3 pull src
1754 reposetup() for $TESTTMP/reposetup-test/pull-src3
1754 reposetup() for $TESTTMP/reposetup-test/pull-src3
1755 reposetup() for $TESTTMP/reposetup-test/src
1755 reposetup() for $TESTTMP/reposetup-test/src
1756
1756
1757 $ echo '[extensions]' >> src/.hg/hgrc
1757 $ echo '[extensions]' >> src/.hg/hgrc
1758 $ echo '# disable extension locally' >> src/.hg/hgrc
1758 $ echo '# disable extension locally' >> src/.hg/hgrc
1759 $ echo 'reposetuptest = !' >> src/.hg/hgrc
1759 $ echo 'reposetuptest = !' >> src/.hg/hgrc
1760 $ hg clone -U src clone-dst4
1760 $ hg clone -U src clone-dst4
1761 reposetup() for $TESTTMP/reposetup-test/clone-dst4
1761 reposetup() for $TESTTMP/reposetup-test/clone-dst4
1762 $ hg init push-dst4
1762 $ hg init push-dst4
1763 reposetup() for $TESTTMP/reposetup-test/push-dst4
1763 reposetup() for $TESTTMP/reposetup-test/push-dst4
1764 $ hg -q -R src push push-dst4
1764 $ hg -q -R src push push-dst4
1765 reposetup() for $TESTTMP/reposetup-test/push-dst4
1765 reposetup() for $TESTTMP/reposetup-test/push-dst4
1766 $ hg init pull-src4
1766 $ hg init pull-src4
1767 reposetup() for $TESTTMP/reposetup-test/pull-src4
1767 reposetup() for $TESTTMP/reposetup-test/pull-src4
1768 $ hg -q -R pull-src4 pull src
1768 $ hg -q -R pull-src4 pull src
1769 reposetup() for $TESTTMP/reposetup-test/pull-src4
1769 reposetup() for $TESTTMP/reposetup-test/pull-src4
1770
1770
1771 disabling in command line overlays with all configuration
1771 disabling in command line overlays with all configuration
1772 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
1772 $ hg --config extensions.reposetuptest=! clone -U src clone-dst5
1773 $ hg --config extensions.reposetuptest=! init push-dst5
1773 $ hg --config extensions.reposetuptest=! init push-dst5
1774 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
1774 $ hg --config extensions.reposetuptest=! -q -R src push push-dst5
1775 $ hg --config extensions.reposetuptest=! init pull-src5
1775 $ hg --config extensions.reposetuptest=! init pull-src5
1776 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
1776 $ hg --config extensions.reposetuptest=! -q -R pull-src5 pull src
1777
1777
1778 $ cat <<EOF >> $HGRCPATH
1778 $ cat <<EOF >> $HGRCPATH
1779 > [extensions]
1779 > [extensions]
1780 > # disable extension globally and explicitly
1780 > # disable extension globally and explicitly
1781 > reposetuptest = !
1781 > reposetuptest = !
1782 > EOF
1782 > EOF
1783 $ hg init parent
1783 $ hg init parent
1784 $ hg init parent/sub1
1784 $ hg init parent/sub1
1785 $ echo 1 > parent/sub1/1
1785 $ echo 1 > parent/sub1/1
1786 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1'
1786 $ hg -R parent/sub1 commit -Am '#0 at parent/sub1'
1787 adding 1
1787 adding 1
1788 $ hg init parent/sub2
1788 $ hg init parent/sub2
1789 $ hg init parent/sub2/sub21
1789 $ hg init parent/sub2/sub21
1790 $ echo 21 > parent/sub2/sub21/21
1790 $ echo 21 > parent/sub2/sub21/21
1791 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21'
1791 $ hg -R parent/sub2/sub21 commit -Am '#0 at parent/sub2/sub21'
1792 adding 21
1792 adding 21
1793 $ cat > parent/sub2/.hgsub <<EOF
1793 $ cat > parent/sub2/.hgsub <<EOF
1794 > sub21 = sub21
1794 > sub21 = sub21
1795 > EOF
1795 > EOF
1796 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2'
1796 $ hg -R parent/sub2 commit -Am '#0 at parent/sub2'
1797 adding .hgsub
1797 adding .hgsub
1798 $ hg init parent/sub3
1798 $ hg init parent/sub3
1799 $ echo 3 > parent/sub3/3
1799 $ echo 3 > parent/sub3/3
1800 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3'
1800 $ hg -R parent/sub3 commit -Am '#0 at parent/sub3'
1801 adding 3
1801 adding 3
1802 $ cat > parent/.hgsub <<EOF
1802 $ cat > parent/.hgsub <<EOF
1803 > sub1 = sub1
1803 > sub1 = sub1
1804 > sub2 = sub2
1804 > sub2 = sub2
1805 > sub3 = sub3
1805 > sub3 = sub3
1806 > EOF
1806 > EOF
1807 $ hg -R parent commit -Am '#0 at parent'
1807 $ hg -R parent commit -Am '#0 at parent'
1808 adding .hgsub
1808 adding .hgsub
1809 $ echo '[extensions]' >> parent/.hg/hgrc
1809 $ echo '[extensions]' >> parent/.hg/hgrc
1810 $ echo '# enable extension locally' >> parent/.hg/hgrc
1810 $ echo '# enable extension locally' >> parent/.hg/hgrc
1811 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
1811 $ echo "reposetuptest = $TESTTMP/reposetuptest.py" >> parent/.hg/hgrc
1812 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
1812 $ cp parent/.hg/hgrc parent/sub2/.hg/hgrc
1813 $ hg -R parent status -S -A
1813 $ hg -R parent status -S -A
1814 reposetup() for $TESTTMP/reposetup-test/parent
1814 reposetup() for $TESTTMP/reposetup-test/parent
1815 reposetup() for $TESTTMP/reposetup-test/parent/sub2
1815 reposetup() for $TESTTMP/reposetup-test/parent/sub2
1816 C .hgsub
1816 C .hgsub
1817 C .hgsubstate
1817 C .hgsubstate
1818 C sub1/1
1818 C sub1/1
1819 C sub2/.hgsub
1819 C sub2/.hgsub
1820 C sub2/.hgsubstate
1820 C sub2/.hgsubstate
1821 C sub2/sub21/21
1821 C sub2/sub21/21
1822 C sub3/3
1822 C sub3/3
1823
1823
1824 $ cd ..
1824 $ cd ..
1825
1825
1826 Prohibit registration of commands that don't use @command (issue5137)
1826 Prohibit registration of commands that don't use @command (issue5137)
1827
1827
1828 $ hg init deprecated
1828 $ hg init deprecated
1829 $ cd deprecated
1829 $ cd deprecated
1830
1830
1831 $ cat <<EOF > deprecatedcmd.py
1831 $ cat <<EOF > deprecatedcmd.py
1832 > def deprecatedcmd(repo, ui):
1832 > def deprecatedcmd(repo, ui):
1833 > pass
1833 > pass
1834 > cmdtable = {
1834 > cmdtable = {
1835 > b'deprecatedcmd': (deprecatedcmd, [], b''),
1835 > b'deprecatedcmd': (deprecatedcmd, [], b''),
1836 > }
1836 > }
1837 > EOF
1837 > EOF
1838 $ cat <<EOF > .hg/hgrc
1838 $ cat <<EOF > .hg/hgrc
1839 > [extensions]
1839 > [extensions]
1840 > deprecatedcmd = `pwd`/deprecatedcmd.py
1840 > deprecatedcmd = `pwd`/deprecatedcmd.py
1841 > mq = !
1841 > mq = !
1842 > hgext.mq = !
1842 > hgext.mq = !
1843 > hgext/mq = !
1843 > hgext/mq = !
1844 > EOF
1844 > EOF
1845
1845
1846 $ hg deprecatedcmd > /dev/null
1846 $ hg deprecatedcmd > /dev/null
1847 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1847 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1848 *** (use @command decorator to register 'deprecatedcmd')
1848 *** (use @command decorator to register 'deprecatedcmd')
1849 hg: unknown command 'deprecatedcmd'
1849 hg: unknown command 'deprecatedcmd'
1850 (use 'hg help' for a list of commands)
1850 (use 'hg help' for a list of commands)
1851 [255]
1851 [10]
1852
1852
1853 the extension shouldn't be loaded at all so the mq works:
1853 the extension shouldn't be loaded at all so the mq works:
1854
1854
1855 $ hg qseries --config extensions.mq= > /dev/null
1855 $ hg qseries --config extensions.mq= > /dev/null
1856 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1856 *** failed to import extension deprecatedcmd from $TESTTMP/deprecated/deprecatedcmd.py: missing attributes: norepo, optionalrepo, inferrepo
1857 *** (use @command decorator to register 'deprecatedcmd')
1857 *** (use @command decorator to register 'deprecatedcmd')
1858
1858
1859 $ cd ..
1859 $ cd ..
1860
1860
1861 Test synopsis and docstring extending
1861 Test synopsis and docstring extending
1862
1862
1863 $ hg init exthelp
1863 $ hg init exthelp
1864 $ cat > exthelp.py <<EOF
1864 $ cat > exthelp.py <<EOF
1865 > from mercurial import commands, extensions
1865 > from mercurial import commands, extensions
1866 > def exbookmarks(orig, *args, **opts):
1866 > def exbookmarks(orig, *args, **opts):
1867 > return orig(*args, **opts)
1867 > return orig(*args, **opts)
1868 > def uisetup(ui):
1868 > def uisetup(ui):
1869 > synopsis = b' GREPME [--foo] [-x]'
1869 > synopsis = b' GREPME [--foo] [-x]'
1870 > docstring = '''
1870 > docstring = '''
1871 > GREPME make sure that this is in the help!
1871 > GREPME make sure that this is in the help!
1872 > '''
1872 > '''
1873 > extensions.wrapcommand(commands.table, b'bookmarks', exbookmarks,
1873 > extensions.wrapcommand(commands.table, b'bookmarks', exbookmarks,
1874 > synopsis, docstring)
1874 > synopsis, docstring)
1875 > EOF
1875 > EOF
1876 $ abspath=`pwd`/exthelp.py
1876 $ abspath=`pwd`/exthelp.py
1877 $ echo '[extensions]' >> $HGRCPATH
1877 $ echo '[extensions]' >> $HGRCPATH
1878 $ echo "exthelp = $abspath" >> $HGRCPATH
1878 $ echo "exthelp = $abspath" >> $HGRCPATH
1879 $ cd exthelp
1879 $ cd exthelp
1880 $ hg help bookmarks | grep GREPME
1880 $ hg help bookmarks | grep GREPME
1881 hg bookmarks [OPTIONS]... [NAME]... GREPME [--foo] [-x]
1881 hg bookmarks [OPTIONS]... [NAME]... GREPME [--foo] [-x]
1882 GREPME make sure that this is in the help!
1882 GREPME make sure that this is in the help!
1883 $ cd ..
1883 $ cd ..
1884
1884
1885 Prohibit the use of unicode strings as the default value of options
1885 Prohibit the use of unicode strings as the default value of options
1886
1886
1887 $ hg init $TESTTMP/opt-unicode-default
1887 $ hg init $TESTTMP/opt-unicode-default
1888
1888
1889 $ cat > $TESTTMP/test_unicode_default_value.py << EOF
1889 $ cat > $TESTTMP/test_unicode_default_value.py << EOF
1890 > from __future__ import print_function
1890 > from __future__ import print_function
1891 > from mercurial import registrar
1891 > from mercurial import registrar
1892 > cmdtable = {}
1892 > cmdtable = {}
1893 > command = registrar.command(cmdtable)
1893 > command = registrar.command(cmdtable)
1894 > @command(b'dummy', [(b'', b'opt', u'value', u'help')], 'ext [OPTIONS]')
1894 > @command(b'dummy', [(b'', b'opt', u'value', u'help')], 'ext [OPTIONS]')
1895 > def ext(*args, **opts):
1895 > def ext(*args, **opts):
1896 > print(opts[b'opt'], flush=True)
1896 > print(opts[b'opt'], flush=True)
1897 > EOF
1897 > EOF
1898 $ "$PYTHON" $TESTTMP/unflush.py $TESTTMP/test_unicode_default_value.py
1898 $ "$PYTHON" $TESTTMP/unflush.py $TESTTMP/test_unicode_default_value.py
1899 $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF
1899 $ cat > $TESTTMP/opt-unicode-default/.hg/hgrc << EOF
1900 > [extensions]
1900 > [extensions]
1901 > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py
1901 > test_unicode_default_value = $TESTTMP/test_unicode_default_value.py
1902 > EOF
1902 > EOF
1903 $ hg -R $TESTTMP/opt-unicode-default dummy
1903 $ hg -R $TESTTMP/opt-unicode-default dummy
1904 *** failed to import extension test_unicode_default_value from $TESTTMP/test_unicode_default_value.py: unicode *'value' found in cmdtable.dummy (glob)
1904 *** failed to import extension test_unicode_default_value from $TESTTMP/test_unicode_default_value.py: unicode *'value' found in cmdtable.dummy (glob)
1905 *** (use b'' to make it byte string)
1905 *** (use b'' to make it byte string)
1906 hg: unknown command 'dummy'
1906 hg: unknown command 'dummy'
1907 (did you mean summary?)
1907 (did you mean summary?)
1908 [255]
1908 [10]
@@ -1,261 +1,261 b''
1 $ cat >> $HGRCPATH << EOF
1 $ cat >> $HGRCPATH << EOF
2 > [extensions]
2 > [extensions]
3 > fastannotate=
3 > fastannotate=
4 > EOF
4 > EOF
5
5
6 $ hg init repo
6 $ hg init repo
7 $ cd repo
7 $ cd repo
8
8
9 a simple merge case
9 a simple merge case
10
10
11 $ echo 1 > a
11 $ echo 1 > a
12 $ hg commit -qAm 'append 1'
12 $ hg commit -qAm 'append 1'
13 $ echo 2 >> a
13 $ echo 2 >> a
14 $ hg commit -m 'append 2'
14 $ hg commit -m 'append 2'
15 $ echo 3 >> a
15 $ echo 3 >> a
16 $ hg commit -m 'append 3'
16 $ hg commit -m 'append 3'
17 $ hg up 1 -q
17 $ hg up 1 -q
18 $ cat > a << EOF
18 $ cat > a << EOF
19 > 0
19 > 0
20 > 1
20 > 1
21 > 2
21 > 2
22 > EOF
22 > EOF
23 $ hg commit -qm 'insert 0'
23 $ hg commit -qm 'insert 0'
24 $ hg merge 2 -q
24 $ hg merge 2 -q
25 $ echo 4 >> a
25 $ echo 4 >> a
26 $ hg commit -m merge
26 $ hg commit -m merge
27 $ hg log -G -T '{rev}: {desc}'
27 $ hg log -G -T '{rev}: {desc}'
28 @ 4: merge
28 @ 4: merge
29 |\
29 |\
30 | o 3: insert 0
30 | o 3: insert 0
31 | |
31 | |
32 o | 2: append 3
32 o | 2: append 3
33 |/
33 |/
34 o 1: append 2
34 o 1: append 2
35 |
35 |
36 o 0: append 1
36 o 0: append 1
37
37
38 $ hg fastannotate a
38 $ hg fastannotate a
39 3: 0
39 3: 0
40 0: 1
40 0: 1
41 1: 2
41 1: 2
42 2: 3
42 2: 3
43 4: 4
43 4: 4
44 $ hg fastannotate -r 0 a
44 $ hg fastannotate -r 0 a
45 0: 1
45 0: 1
46 $ hg fastannotate -r 1 a
46 $ hg fastannotate -r 1 a
47 0: 1
47 0: 1
48 1: 2
48 1: 2
49 $ hg fastannotate -udnclf a
49 $ hg fastannotate -udnclf a
50 test 3 d641cb51f61e Thu Jan 01 00:00:00 1970 +0000 a:1: 0
50 test 3 d641cb51f61e Thu Jan 01 00:00:00 1970 +0000 a:1: 0
51 test 0 4994017376d3 Thu Jan 01 00:00:00 1970 +0000 a:1: 1
51 test 0 4994017376d3 Thu Jan 01 00:00:00 1970 +0000 a:1: 1
52 test 1 e940cb6d9a06 Thu Jan 01 00:00:00 1970 +0000 a:2: 2
52 test 1 e940cb6d9a06 Thu Jan 01 00:00:00 1970 +0000 a:2: 2
53 test 2 26162a884ba6 Thu Jan 01 00:00:00 1970 +0000 a:3: 3
53 test 2 26162a884ba6 Thu Jan 01 00:00:00 1970 +0000 a:3: 3
54 test 4 3ad7bcd2815f Thu Jan 01 00:00:00 1970 +0000 a:5: 4
54 test 4 3ad7bcd2815f Thu Jan 01 00:00:00 1970 +0000 a:5: 4
55 $ hg fastannotate --linear a
55 $ hg fastannotate --linear a
56 3: 0
56 3: 0
57 0: 1
57 0: 1
58 1: 2
58 1: 2
59 4: 3
59 4: 3
60 4: 4
60 4: 4
61
61
62 incrementally updating
62 incrementally updating
63
63
64 $ hg fastannotate -r 0 a --debug
64 $ hg fastannotate -r 0 a --debug
65 fastannotate: a: using fast path (resolved fctx: True)
65 fastannotate: a: using fast path (resolved fctx: True)
66 0: 1
66 0: 1
67 $ hg fastannotate -r 0 a --debug --rebuild
67 $ hg fastannotate -r 0 a --debug --rebuild
68 fastannotate: a: 1 new changesets in the main branch
68 fastannotate: a: 1 new changesets in the main branch
69 0: 1
69 0: 1
70 $ hg fastannotate -r 1 a --debug
70 $ hg fastannotate -r 1 a --debug
71 fastannotate: a: 1 new changesets in the main branch
71 fastannotate: a: 1 new changesets in the main branch
72 0: 1
72 0: 1
73 1: 2
73 1: 2
74 $ hg fastannotate -r 3 a --debug
74 $ hg fastannotate -r 3 a --debug
75 fastannotate: a: 1 new changesets in the main branch
75 fastannotate: a: 1 new changesets in the main branch
76 3: 0
76 3: 0
77 0: 1
77 0: 1
78 1: 2
78 1: 2
79 $ hg fastannotate -r 4 a --debug
79 $ hg fastannotate -r 4 a --debug
80 fastannotate: a: 1 new changesets in the main branch
80 fastannotate: a: 1 new changesets in the main branch
81 3: 0
81 3: 0
82 0: 1
82 0: 1
83 1: 2
83 1: 2
84 2: 3
84 2: 3
85 4: 4
85 4: 4
86 $ hg fastannotate -r 1 a --debug
86 $ hg fastannotate -r 1 a --debug
87 fastannotate: a: using fast path (resolved fctx: True)
87 fastannotate: a: using fast path (resolved fctx: True)
88 0: 1
88 0: 1
89 1: 2
89 1: 2
90
90
91 rebuild happens automatically if unable to update
91 rebuild happens automatically if unable to update
92
92
93 $ hg fastannotate -r 2 a --debug
93 $ hg fastannotate -r 2 a --debug
94 fastannotate: a: cache broken and deleted
94 fastannotate: a: cache broken and deleted
95 fastannotate: a: 3 new changesets in the main branch
95 fastannotate: a: 3 new changesets in the main branch
96 0: 1
96 0: 1
97 1: 2
97 1: 2
98 2: 3
98 2: 3
99
99
100 config option "fastannotate.mainbranch"
100 config option "fastannotate.mainbranch"
101
101
102 $ hg fastannotate -r 1 --rebuild --config fastannotate.mainbranch=tip a --debug
102 $ hg fastannotate -r 1 --rebuild --config fastannotate.mainbranch=tip a --debug
103 fastannotate: a: 4 new changesets in the main branch
103 fastannotate: a: 4 new changesets in the main branch
104 0: 1
104 0: 1
105 1: 2
105 1: 2
106 $ hg fastannotate -r 4 a --debug
106 $ hg fastannotate -r 4 a --debug
107 fastannotate: a: using fast path (resolved fctx: True)
107 fastannotate: a: using fast path (resolved fctx: True)
108 3: 0
108 3: 0
109 0: 1
109 0: 1
110 1: 2
110 1: 2
111 2: 3
111 2: 3
112 4: 4
112 4: 4
113
113
114 config option "fastannotate.modes"
114 config option "fastannotate.modes"
115
115
116 $ hg annotate -r 1 --debug a
116 $ hg annotate -r 1 --debug a
117 0: 1
117 0: 1
118 1: 2
118 1: 2
119 $ hg annotate --config fastannotate.modes=fctx -r 1 --debug a
119 $ hg annotate --config fastannotate.modes=fctx -r 1 --debug a
120 fastannotate: a: using fast path (resolved fctx: False)
120 fastannotate: a: using fast path (resolved fctx: False)
121 0: 1
121 0: 1
122 1: 2
122 1: 2
123 $ hg fastannotate --config fastannotate.modes=fctx -h -q
123 $ hg fastannotate --config fastannotate.modes=fctx -h -q
124 hg: unknown command 'fastannotate'
124 hg: unknown command 'fastannotate'
125 (did you mean *) (glob)
125 (did you mean *) (glob)
126 [255]
126 [10]
127
127
128 rename
128 rename
129
129
130 $ hg mv a b
130 $ hg mv a b
131 $ cat > b << EOF
131 $ cat > b << EOF
132 > 0
132 > 0
133 > 11
133 > 11
134 > 3
134 > 3
135 > 44
135 > 44
136 > EOF
136 > EOF
137 $ hg commit -m b -q
137 $ hg commit -m b -q
138 $ hg fastannotate -ncf --long-hash b
138 $ hg fastannotate -ncf --long-hash b
139 3 d641cb51f61e331c44654104301f8154d7865c89 a: 0
139 3 d641cb51f61e331c44654104301f8154d7865c89 a: 0
140 5 d44dade239915bc82b91e4556b1257323f8e5824 b: 11
140 5 d44dade239915bc82b91e4556b1257323f8e5824 b: 11
141 2 26162a884ba60e8c87bf4e0d6bb8efcc6f711a4e a: 3
141 2 26162a884ba60e8c87bf4e0d6bb8efcc6f711a4e a: 3
142 5 d44dade239915bc82b91e4556b1257323f8e5824 b: 44
142 5 d44dade239915bc82b91e4556b1257323f8e5824 b: 44
143 $ hg fastannotate -r 26162a884ba60e8c87bf4e0d6bb8efcc6f711a4e a
143 $ hg fastannotate -r 26162a884ba60e8c87bf4e0d6bb8efcc6f711a4e a
144 0: 1
144 0: 1
145 1: 2
145 1: 2
146 2: 3
146 2: 3
147
147
148 fastannotate --deleted
148 fastannotate --deleted
149
149
150 $ hg fastannotate --deleted -nf b
150 $ hg fastannotate --deleted -nf b
151 3 a: 0
151 3 a: 0
152 5 b: 11
152 5 b: 11
153 0 a: -1
153 0 a: -1
154 1 a: -2
154 1 a: -2
155 2 a: 3
155 2 a: 3
156 5 b: 44
156 5 b: 44
157 4 a: -4
157 4 a: -4
158 $ hg fastannotate --deleted -r 3 -nf a
158 $ hg fastannotate --deleted -r 3 -nf a
159 3 a: 0
159 3 a: 0
160 0 a: 1
160 0 a: 1
161 1 a: 2
161 1 a: 2
162
162
163 file and directories with ".l", ".m" suffixes
163 file and directories with ".l", ".m" suffixes
164
164
165 $ cd ..
165 $ cd ..
166 $ hg init repo2
166 $ hg init repo2
167 $ cd repo2
167 $ cd repo2
168
168
169 $ mkdir a.l b.m c.lock a.l.hg b.hg
169 $ mkdir a.l b.m c.lock a.l.hg b.hg
170 $ for i in a b c d d.l d.m a.l/a b.m/a c.lock/a a.l.hg/a b.hg/a; do
170 $ for i in a b c d d.l d.m a.l/a b.m/a c.lock/a a.l.hg/a b.hg/a; do
171 > echo $i > $i
171 > echo $i > $i
172 > done
172 > done
173 $ hg add . -q
173 $ hg add . -q
174 $ hg commit -m init
174 $ hg commit -m init
175 $ hg fastannotate a.l/a b.m/a c.lock/a a.l.hg/a b.hg/a d.l d.m a b c d
175 $ hg fastannotate a.l/a b.m/a c.lock/a a.l.hg/a b.hg/a d.l d.m a b c d
176 0: a
176 0: a
177 0: a.l.hg/a
177 0: a.l.hg/a
178 0: a.l/a
178 0: a.l/a
179 0: b
179 0: b
180 0: b.hg/a
180 0: b.hg/a
181 0: b.m/a
181 0: b.m/a
182 0: c
182 0: c
183 0: c.lock/a
183 0: c.lock/a
184 0: d
184 0: d
185 0: d.l
185 0: d.l
186 0: d.m
186 0: d.m
187
187
188 empty file
188 empty file
189
189
190 $ touch empty
190 $ touch empty
191 $ hg commit -A empty -m empty
191 $ hg commit -A empty -m empty
192 $ hg fastannotate empty
192 $ hg fastannotate empty
193
193
194 json format
194 json format
195
195
196 $ hg fastannotate -Tjson -cludn b a empty
196 $ hg fastannotate -Tjson -cludn b a empty
197 [
197 [
198 {
198 {
199 "date": [0.0, 0],
199 "date": [0.0, 0],
200 "line": "a\n",
200 "line": "a\n",
201 "line_number": 1,
201 "line_number": 1,
202 "node": "1fd620b16252aecb54c6aa530dff5ed6e6ec3d21",
202 "node": "1fd620b16252aecb54c6aa530dff5ed6e6ec3d21",
203 "rev": 0,
203 "rev": 0,
204 "user": "test"
204 "user": "test"
205 },
205 },
206 {
206 {
207 "date": [0.0, 0],
207 "date": [0.0, 0],
208 "line": "b\n",
208 "line": "b\n",
209 "line_number": 1,
209 "line_number": 1,
210 "node": "1fd620b16252aecb54c6aa530dff5ed6e6ec3d21",
210 "node": "1fd620b16252aecb54c6aa530dff5ed6e6ec3d21",
211 "rev": 0,
211 "rev": 0,
212 "user": "test"
212 "user": "test"
213 }
213 }
214 ]
214 ]
215
215
216 $ hg fastannotate -Tjson -cludn empty
216 $ hg fastannotate -Tjson -cludn empty
217 [
217 [
218 ]
218 ]
219 $ hg fastannotate -Tjson --no-content -n a
219 $ hg fastannotate -Tjson --no-content -n a
220 [
220 [
221 {
221 {
222 "rev": 0
222 "rev": 0
223 }
223 }
224 ]
224 ]
225
225
226 working copy
226 working copy
227
227
228 $ echo a >> a
228 $ echo a >> a
229 $ hg fastannotate -r 'wdir()' a
229 $ hg fastannotate -r 'wdir()' a
230 abort: cannot update linelog to wdir()
230 abort: cannot update linelog to wdir()
231 (set fastannotate.mainbranch)
231 (set fastannotate.mainbranch)
232 [255]
232 [255]
233 $ cat >> $HGRCPATH << EOF
233 $ cat >> $HGRCPATH << EOF
234 > [fastannotate]
234 > [fastannotate]
235 > mainbranch = .
235 > mainbranch = .
236 > EOF
236 > EOF
237 $ hg fastannotate -r 'wdir()' a
237 $ hg fastannotate -r 'wdir()' a
238 0 : a
238 0 : a
239 1+: a
239 1+: a
240 $ hg fastannotate -cludn -r 'wdir()' a
240 $ hg fastannotate -cludn -r 'wdir()' a
241 test 0 1fd620b16252 Thu Jan 01 00:00:00 1970 +0000:1: a
241 test 0 1fd620b16252 Thu Jan 01 00:00:00 1970 +0000:1: a
242 test 1 720582f5bdb6+ *:2: a (glob)
242 test 1 720582f5bdb6+ *:2: a (glob)
243 $ hg fastannotate -cludn -r 'wdir()' -Tjson a
243 $ hg fastannotate -cludn -r 'wdir()' -Tjson a
244 [
244 [
245 {
245 {
246 "date": [0.0, 0],
246 "date": [0.0, 0],
247 "line": "a\n",
247 "line": "a\n",
248 "line_number": 1,
248 "line_number": 1,
249 "node": "1fd620b16252aecb54c6aa530dff5ed6e6ec3d21",
249 "node": "1fd620b16252aecb54c6aa530dff5ed6e6ec3d21",
250 "rev": 0,
250 "rev": 0,
251 "user": "test"
251 "user": "test"
252 },
252 },
253 {
253 {
254 "date": [*, 0], (glob)
254 "date": [*, 0], (glob)
255 "line": "a\n",
255 "line": "a\n",
256 "line_number": 2,
256 "line_number": 2,
257 "node": null,
257 "node": null,
258 "rev": null,
258 "rev": null,
259 "user": "test"
259 "user": "test"
260 }
260 }
261 ]
261 ]
@@ -1,3932 +1,3932 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 Repository creation:
56 Repository creation:
57
57
58 clone make a copy of an existing repository
58 clone make a copy of an existing repository
59 init create a new repository in the given directory
59 init create a new repository in the given directory
60
60
61 Remote repository management:
61 Remote repository management:
62
62
63 incoming show new changesets found in source
63 incoming show new changesets found in source
64 outgoing show changesets not found in the destination
64 outgoing show changesets not found in the destination
65 paths show aliases for remote repositories
65 paths show aliases for remote repositories
66 pull pull changes from the specified source
66 pull pull changes from the specified source
67 push push changes to the specified destination
67 push push changes to the specified destination
68 serve start stand-alone webserver
68 serve start stand-alone webserver
69
69
70 Change creation:
70 Change creation:
71
71
72 commit commit the specified files or all outstanding changes
72 commit commit the specified files or all outstanding changes
73
73
74 Change manipulation:
74 Change manipulation:
75
75
76 backout reverse effect of earlier changeset
76 backout reverse effect of earlier changeset
77 graft copy changes from other branches onto the current branch
77 graft copy changes from other branches onto the current branch
78 merge merge another revision into working directory
78 merge merge another revision into working directory
79
79
80 Change organization:
80 Change organization:
81
81
82 bookmarks create a new bookmark or list existing bookmarks
82 bookmarks create a new bookmark or list existing bookmarks
83 branch set or show the current branch name
83 branch set or show the current branch name
84 branches list repository named branches
84 branches list repository named branches
85 phase set or show the current phase name
85 phase set or show the current phase name
86 tag add one or more tags for the current or given revision
86 tag add one or more tags for the current or given revision
87 tags list repository tags
87 tags list repository tags
88
88
89 File content management:
89 File content management:
90
90
91 annotate show changeset information by line for each file
91 annotate show changeset information by line for each file
92 cat output the current or given revision of files
92 cat output the current or given revision of files
93 copy mark files as copied for the next commit
93 copy mark files as copied for the next commit
94 diff diff repository (or selected files)
94 diff diff repository (or selected files)
95 grep search for a pattern in specified files
95 grep search for a pattern in specified files
96
96
97 Change navigation:
97 Change navigation:
98
98
99 bisect subdivision search of changesets
99 bisect subdivision search of changesets
100 heads show branch heads
100 heads show branch heads
101 identify identify the working directory or specified revision
101 identify identify the working directory or specified revision
102 log show revision history of entire repository or files
102 log show revision history of entire repository or files
103
103
104 Working directory management:
104 Working directory management:
105
105
106 add add the specified files on the next commit
106 add add the specified files on the next commit
107 addremove add all new files, delete all missing files
107 addremove add all new files, delete all missing files
108 files list tracked files
108 files list tracked files
109 forget forget the specified files on the next commit
109 forget forget the specified files on the next commit
110 remove remove the specified files on the next commit
110 remove remove the specified files on the next commit
111 rename rename files; equivalent of copy + remove
111 rename rename files; equivalent of copy + remove
112 resolve redo merges or set/view the merge status of files
112 resolve redo merges or set/view the merge status of files
113 revert restore files to their checkout state
113 revert restore files to their checkout state
114 root print the root (top) of the current working directory
114 root print the root (top) of the current working directory
115 shelve save and set aside changes from the working directory
115 shelve save and set aside changes from the working directory
116 status show changed files in the working directory
116 status show changed files in the working directory
117 summary summarize working directory state
117 summary summarize working directory state
118 unshelve restore a shelved change to the working directory
118 unshelve restore a shelved change to the working directory
119 update update working directory (or switch revisions)
119 update update working directory (or switch revisions)
120
120
121 Change import/export:
121 Change import/export:
122
122
123 archive create an unversioned archive of a repository revision
123 archive create an unversioned archive of a repository revision
124 bundle create a bundle file
124 bundle create a bundle file
125 export dump the header and diffs for one or more changesets
125 export dump the header and diffs for one or more changesets
126 import import an ordered set of patches
126 import import an ordered set of patches
127 unbundle apply one or more bundle files
127 unbundle apply one or more bundle files
128
128
129 Repository maintenance:
129 Repository maintenance:
130
130
131 manifest output the current or given revision of the project manifest
131 manifest output the current or given revision of the project manifest
132 recover roll back an interrupted transaction
132 recover roll back an interrupted transaction
133 verify verify the integrity of the repository
133 verify verify the integrity of the repository
134
134
135 Help:
135 Help:
136
136
137 config show combined config settings from all hgrc files
137 config show combined config settings from all hgrc files
138 help show help for a given topic or a help overview
138 help show help for a given topic or a help overview
139 version output version and copyright information
139 version output version and copyright information
140
140
141 additional help topics:
141 additional help topics:
142
142
143 Mercurial identifiers:
143 Mercurial identifiers:
144
144
145 filesets Specifying File Sets
145 filesets Specifying File Sets
146 hgignore Syntax for Mercurial Ignore Files
146 hgignore Syntax for Mercurial Ignore Files
147 patterns File Name Patterns
147 patterns File Name Patterns
148 revisions Specifying Revisions
148 revisions Specifying Revisions
149 urls URL Paths
149 urls URL Paths
150
150
151 Mercurial output:
151 Mercurial output:
152
152
153 color Colorizing Outputs
153 color Colorizing Outputs
154 dates Date Formats
154 dates Date Formats
155 diffs Diff Formats
155 diffs Diff Formats
156 templating Template Usage
156 templating Template Usage
157
157
158 Mercurial configuration:
158 Mercurial configuration:
159
159
160 config Configuration Files
160 config Configuration Files
161 environment Environment Variables
161 environment Environment Variables
162 extensions Using Additional Features
162 extensions Using Additional Features
163 flags Command-line flags
163 flags Command-line flags
164 hgweb Configuring hgweb
164 hgweb Configuring hgweb
165 merge-tools Merge Tools
165 merge-tools Merge Tools
166 pager Pager Support
166 pager Pager Support
167
167
168 Concepts:
168 Concepts:
169
169
170 bundlespec Bundle File Formats
170 bundlespec Bundle File Formats
171 glossary Glossary
171 glossary Glossary
172 phases Working with Phases
172 phases Working with Phases
173 subrepos Subrepositories
173 subrepos Subrepositories
174
174
175 Miscellaneous:
175 Miscellaneous:
176
176
177 deprecated Deprecated Features
177 deprecated Deprecated Features
178 internals Technical implementation topics
178 internals Technical implementation topics
179 scripting Using Mercurial from scripts and automation
179 scripting Using Mercurial from scripts and automation
180
180
181 (use 'hg help -v' to show built-in aliases and global options)
181 (use 'hg help -v' to show built-in aliases and global options)
182
182
183 $ hg -q help
183 $ hg -q help
184 Repository creation:
184 Repository creation:
185
185
186 clone make a copy of an existing repository
186 clone make a copy of an existing repository
187 init create a new repository in the given directory
187 init create a new repository in the given directory
188
188
189 Remote repository management:
189 Remote repository management:
190
190
191 incoming show new changesets found in source
191 incoming show new changesets found in source
192 outgoing show changesets not found in the destination
192 outgoing show changesets not found in the destination
193 paths show aliases for remote repositories
193 paths show aliases for remote repositories
194 pull pull changes from the specified source
194 pull pull changes from the specified source
195 push push changes to the specified destination
195 push push changes to the specified destination
196 serve start stand-alone webserver
196 serve start stand-alone webserver
197
197
198 Change creation:
198 Change creation:
199
199
200 commit commit the specified files or all outstanding changes
200 commit commit the specified files or all outstanding changes
201
201
202 Change manipulation:
202 Change manipulation:
203
203
204 backout reverse effect of earlier changeset
204 backout reverse effect of earlier changeset
205 graft copy changes from other branches onto the current branch
205 graft copy changes from other branches onto the current branch
206 merge merge another revision into working directory
206 merge merge another revision into working directory
207
207
208 Change organization:
208 Change organization:
209
209
210 bookmarks create a new bookmark or list existing bookmarks
210 bookmarks create a new bookmark or list existing bookmarks
211 branch set or show the current branch name
211 branch set or show the current branch name
212 branches list repository named branches
212 branches list repository named branches
213 phase set or show the current phase name
213 phase set or show the current phase name
214 tag add one or more tags for the current or given revision
214 tag add one or more tags for the current or given revision
215 tags list repository tags
215 tags list repository tags
216
216
217 File content management:
217 File content management:
218
218
219 annotate show changeset information by line for each file
219 annotate show changeset information by line for each file
220 cat output the current or given revision of files
220 cat output the current or given revision of files
221 copy mark files as copied for the next commit
221 copy mark files as copied for the next commit
222 diff diff repository (or selected files)
222 diff diff repository (or selected files)
223 grep search for a pattern in specified files
223 grep search for a pattern in specified files
224
224
225 Change navigation:
225 Change navigation:
226
226
227 bisect subdivision search of changesets
227 bisect subdivision search of changesets
228 heads show branch heads
228 heads show branch heads
229 identify identify the working directory or specified revision
229 identify identify the working directory or specified revision
230 log show revision history of entire repository or files
230 log show revision history of entire repository or files
231
231
232 Working directory management:
232 Working directory management:
233
233
234 add add the specified files on the next commit
234 add add the specified files on the next commit
235 addremove add all new files, delete all missing files
235 addremove add all new files, delete all missing files
236 files list tracked files
236 files list tracked files
237 forget forget the specified files on the next commit
237 forget forget the specified files on the next commit
238 remove remove the specified files on the next commit
238 remove remove the specified files on the next commit
239 rename rename files; equivalent of copy + remove
239 rename rename files; equivalent of copy + remove
240 resolve redo merges or set/view the merge status of files
240 resolve redo merges or set/view the merge status of files
241 revert restore files to their checkout state
241 revert restore files to their checkout state
242 root print the root (top) of the current working directory
242 root print the root (top) of the current working directory
243 shelve save and set aside changes from the working directory
243 shelve save and set aside changes from the working directory
244 status show changed files in the working directory
244 status show changed files in the working directory
245 summary summarize working directory state
245 summary summarize working directory state
246 unshelve restore a shelved change to the working directory
246 unshelve restore a shelved change to the working directory
247 update update working directory (or switch revisions)
247 update update working directory (or switch revisions)
248
248
249 Change import/export:
249 Change import/export:
250
250
251 archive create an unversioned archive of a repository revision
251 archive create an unversioned archive of a repository revision
252 bundle create a bundle file
252 bundle create a bundle file
253 export dump the header and diffs for one or more changesets
253 export dump the header and diffs for one or more changesets
254 import import an ordered set of patches
254 import import an ordered set of patches
255 unbundle apply one or more bundle files
255 unbundle apply one or more bundle files
256
256
257 Repository maintenance:
257 Repository maintenance:
258
258
259 manifest output the current or given revision of the project manifest
259 manifest output the current or given revision of the project manifest
260 recover roll back an interrupted transaction
260 recover roll back an interrupted transaction
261 verify verify the integrity of the repository
261 verify verify the integrity of the repository
262
262
263 Help:
263 Help:
264
264
265 config show combined config settings from all hgrc files
265 config show combined config settings from all hgrc files
266 help show help for a given topic or a help overview
266 help show help for a given topic or a help overview
267 version output version and copyright information
267 version output version and copyright information
268
268
269 additional help topics:
269 additional help topics:
270
270
271 Mercurial identifiers:
271 Mercurial identifiers:
272
272
273 filesets Specifying File Sets
273 filesets Specifying File Sets
274 hgignore Syntax for Mercurial Ignore Files
274 hgignore Syntax for Mercurial Ignore Files
275 patterns File Name Patterns
275 patterns File Name Patterns
276 revisions Specifying Revisions
276 revisions Specifying Revisions
277 urls URL Paths
277 urls URL Paths
278
278
279 Mercurial output:
279 Mercurial output:
280
280
281 color Colorizing Outputs
281 color Colorizing Outputs
282 dates Date Formats
282 dates Date Formats
283 diffs Diff Formats
283 diffs Diff Formats
284 templating Template Usage
284 templating Template Usage
285
285
286 Mercurial configuration:
286 Mercurial configuration:
287
287
288 config Configuration Files
288 config Configuration Files
289 environment Environment Variables
289 environment Environment Variables
290 extensions Using Additional Features
290 extensions Using Additional Features
291 flags Command-line flags
291 flags Command-line flags
292 hgweb Configuring hgweb
292 hgweb Configuring hgweb
293 merge-tools Merge Tools
293 merge-tools Merge Tools
294 pager Pager Support
294 pager Pager Support
295
295
296 Concepts:
296 Concepts:
297
297
298 bundlespec Bundle File Formats
298 bundlespec Bundle File Formats
299 glossary Glossary
299 glossary Glossary
300 phases Working with Phases
300 phases Working with Phases
301 subrepos Subrepositories
301 subrepos Subrepositories
302
302
303 Miscellaneous:
303 Miscellaneous:
304
304
305 deprecated Deprecated Features
305 deprecated Deprecated Features
306 internals Technical implementation topics
306 internals Technical implementation topics
307 scripting Using Mercurial from scripts and automation
307 scripting Using Mercurial from scripts and automation
308
308
309 Test extension help:
309 Test extension help:
310 $ hg help extensions --config extensions.rebase= --config extensions.children=
310 $ hg help extensions --config extensions.rebase= --config extensions.children=
311 Using Additional Features
311 Using Additional Features
312 """""""""""""""""""""""""
312 """""""""""""""""""""""""
313
313
314 Mercurial has the ability to add new features through the use of
314 Mercurial has the ability to add new features through the use of
315 extensions. Extensions may add new commands, add options to existing
315 extensions. Extensions may add new commands, add options to existing
316 commands, change the default behavior of commands, or implement hooks.
316 commands, change the default behavior of commands, or implement hooks.
317
317
318 To enable the "foo" extension, either shipped with Mercurial or in the
318 To enable the "foo" extension, either shipped with Mercurial or in the
319 Python search path, create an entry for it in your configuration file,
319 Python search path, create an entry for it in your configuration file,
320 like this:
320 like this:
321
321
322 [extensions]
322 [extensions]
323 foo =
323 foo =
324
324
325 You may also specify the full path to an extension:
325 You may also specify the full path to an extension:
326
326
327 [extensions]
327 [extensions]
328 myfeature = ~/.hgext/myfeature.py
328 myfeature = ~/.hgext/myfeature.py
329
329
330 See 'hg help config' for more information on configuration files.
330 See 'hg help config' for more information on configuration files.
331
331
332 Extensions are not loaded by default for a variety of reasons: they can
332 Extensions are not loaded by default for a variety of reasons: they can
333 increase startup overhead; they may be meant for advanced usage only; they
333 increase startup overhead; they may be meant for advanced usage only; they
334 may provide potentially dangerous abilities (such as letting you destroy
334 may provide potentially dangerous abilities (such as letting you destroy
335 or modify history); they might not be ready for prime time; or they may
335 or modify history); they might not be ready for prime time; or they may
336 alter some usual behaviors of stock Mercurial. It is thus up to the user
336 alter some usual behaviors of stock Mercurial. It is thus up to the user
337 to activate extensions as needed.
337 to activate extensions as needed.
338
338
339 To explicitly disable an extension enabled in a configuration file of
339 To explicitly disable an extension enabled in a configuration file of
340 broader scope, prepend its path with !:
340 broader scope, prepend its path with !:
341
341
342 [extensions]
342 [extensions]
343 # disabling extension bar residing in /path/to/extension/bar.py
343 # disabling extension bar residing in /path/to/extension/bar.py
344 bar = !/path/to/extension/bar.py
344 bar = !/path/to/extension/bar.py
345 # ditto, but no path was supplied for extension baz
345 # ditto, but no path was supplied for extension baz
346 baz = !
346 baz = !
347
347
348 enabled extensions:
348 enabled extensions:
349
349
350 children command to display child changesets (DEPRECATED)
350 children command to display child changesets (DEPRECATED)
351 rebase command to move sets of revisions to a different ancestor
351 rebase command to move sets of revisions to a different ancestor
352
352
353 disabled extensions:
353 disabled extensions:
354
354
355 acl hooks for controlling repository access
355 acl hooks for controlling repository access
356 blackbox log repository events to a blackbox for debugging
356 blackbox log repository events to a blackbox for debugging
357 bugzilla hooks for integrating with the Bugzilla bug tracker
357 bugzilla hooks for integrating with the Bugzilla bug tracker
358 censor erase file content at a given revision
358 censor erase file content at a given revision
359 churn command to display statistics about repository history
359 churn command to display statistics about repository history
360 clonebundles advertise pre-generated bundles to seed clones
360 clonebundles advertise pre-generated bundles to seed clones
361 closehead close arbitrary heads without checking them out first
361 closehead close arbitrary heads without checking them out first
362 convert import revisions from foreign VCS repositories into
362 convert import revisions from foreign VCS repositories into
363 Mercurial
363 Mercurial
364 eol automatically manage newlines in repository files
364 eol automatically manage newlines in repository files
365 extdiff command to allow external programs to compare revisions
365 extdiff command to allow external programs to compare revisions
366 factotum http authentication with factotum
366 factotum http authentication with factotum
367 fastexport export repositories as git fast-import stream
367 fastexport export repositories as git fast-import stream
368 githelp try mapping git commands to Mercurial commands
368 githelp try mapping git commands to Mercurial commands
369 gpg commands to sign and verify changesets
369 gpg commands to sign and verify changesets
370 hgk browse the repository in a graphical way
370 hgk browse the repository in a graphical way
371 highlight syntax highlighting for hgweb (requires Pygments)
371 highlight syntax highlighting for hgweb (requires Pygments)
372 histedit interactive history editing
372 histedit interactive history editing
373 keyword expand keywords in tracked files
373 keyword expand keywords in tracked files
374 largefiles track large binary files
374 largefiles track large binary files
375 mq manage a stack of patches
375 mq manage a stack of patches
376 notify hooks for sending email push notifications
376 notify hooks for sending email push notifications
377 patchbomb command to send changesets as (a series of) patch emails
377 patchbomb command to send changesets as (a series of) patch emails
378 purge command to delete untracked files from the working
378 purge command to delete untracked files from the working
379 directory
379 directory
380 relink recreates hardlinks between repository clones
380 relink recreates hardlinks between repository clones
381 schemes extend schemes with shortcuts to repository swarms
381 schemes extend schemes with shortcuts to repository swarms
382 share share a common history between several working directories
382 share share a common history between several working directories
383 transplant command to transplant changesets from another branch
383 transplant command to transplant changesets from another branch
384 win32mbcs allow the use of MBCS paths with problematic encodings
384 win32mbcs allow the use of MBCS paths with problematic encodings
385 zeroconf discover and advertise repositories on the local network
385 zeroconf discover and advertise repositories on the local network
386
386
387 #endif
387 #endif
388
388
389 Verify that deprecated extensions are included if --verbose:
389 Verify that deprecated extensions are included if --verbose:
390
390
391 $ hg -v help extensions | grep children
391 $ hg -v help extensions | grep children
392 children command to display child changesets (DEPRECATED)
392 children command to display child changesets (DEPRECATED)
393
393
394 Verify that extension keywords appear in help templates
394 Verify that extension keywords appear in help templates
395
395
396 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
396 $ hg help --config extensions.transplant= templating|grep transplant > /dev/null
397
397
398 Test short command list with verbose option
398 Test short command list with verbose option
399
399
400 $ hg -v help shortlist
400 $ hg -v help shortlist
401 Mercurial Distributed SCM
401 Mercurial Distributed SCM
402
402
403 basic commands:
403 basic commands:
404
404
405 abort abort an unfinished operation (EXPERIMENTAL)
405 abort abort an unfinished operation (EXPERIMENTAL)
406 add add the specified files on the next commit
406 add add the specified files on the next commit
407 annotate, blame
407 annotate, blame
408 show changeset information by line for each file
408 show changeset information by line for each file
409 clone make a copy of an existing repository
409 clone make a copy of an existing repository
410 commit, ci commit the specified files or all outstanding changes
410 commit, ci commit the specified files or all outstanding changes
411 continue resumes an interrupted operation (EXPERIMENTAL)
411 continue resumes an interrupted operation (EXPERIMENTAL)
412 diff diff repository (or selected files)
412 diff diff repository (or selected files)
413 export dump the header and diffs for one or more changesets
413 export dump the header and diffs for one or more changesets
414 forget forget the specified files on the next commit
414 forget forget the specified files on the next commit
415 init create a new repository in the given directory
415 init create a new repository in the given directory
416 log, history show revision history of entire repository or files
416 log, history show revision history of entire repository or files
417 merge merge another revision into working directory
417 merge merge another revision into working directory
418 pull pull changes from the specified source
418 pull pull changes from the specified source
419 push push changes to the specified destination
419 push push changes to the specified destination
420 remove, rm remove the specified files on the next commit
420 remove, rm remove the specified files on the next commit
421 serve start stand-alone webserver
421 serve start stand-alone webserver
422 status, st show changed files in the working directory
422 status, st show changed files in the working directory
423 summary, sum summarize working directory state
423 summary, sum summarize working directory state
424 update, up, checkout, co
424 update, up, checkout, co
425 update working directory (or switch revisions)
425 update working directory (or switch revisions)
426
426
427 global options ([+] can be repeated):
427 global options ([+] can be repeated):
428
428
429 -R --repository REPO repository root directory or name of overlay bundle
429 -R --repository REPO repository root directory or name of overlay bundle
430 file
430 file
431 --cwd DIR change working directory
431 --cwd DIR change working directory
432 -y --noninteractive do not prompt, automatically pick the first choice for
432 -y --noninteractive do not prompt, automatically pick the first choice for
433 all prompts
433 all prompts
434 -q --quiet suppress output
434 -q --quiet suppress output
435 -v --verbose enable additional output
435 -v --verbose enable additional output
436 --color TYPE when to colorize (boolean, always, auto, never, or
436 --color TYPE when to colorize (boolean, always, auto, never, or
437 debug)
437 debug)
438 --config CONFIG [+] set/override config option (use 'section.name=value')
438 --config CONFIG [+] set/override config option (use 'section.name=value')
439 --debug enable debugging output
439 --debug enable debugging output
440 --debugger start debugger
440 --debugger start debugger
441 --encoding ENCODE set the charset encoding (default: ascii)
441 --encoding ENCODE set the charset encoding (default: ascii)
442 --encodingmode MODE set the charset encoding mode (default: strict)
442 --encodingmode MODE set the charset encoding mode (default: strict)
443 --traceback always print a traceback on exception
443 --traceback always print a traceback on exception
444 --time time how long the command takes
444 --time time how long the command takes
445 --profile print command execution profile
445 --profile print command execution profile
446 --version output version information and exit
446 --version output version information and exit
447 -h --help display help and exit
447 -h --help display help and exit
448 --hidden consider hidden changesets
448 --hidden consider hidden changesets
449 --pager TYPE when to paginate (boolean, always, auto, or never)
449 --pager TYPE when to paginate (boolean, always, auto, or never)
450 (default: auto)
450 (default: auto)
451
451
452 (use 'hg help' for the full list of commands)
452 (use 'hg help' for the full list of commands)
453
453
454 $ hg add -h
454 $ hg add -h
455 hg add [OPTION]... [FILE]...
455 hg add [OPTION]... [FILE]...
456
456
457 add the specified files on the next commit
457 add the specified files on the next commit
458
458
459 Schedule files to be version controlled and added to the repository.
459 Schedule files to be version controlled and added to the repository.
460
460
461 The files will be added to the repository at the next commit. To undo an
461 The files will be added to the repository at the next commit. To undo an
462 add before that, see 'hg forget'.
462 add before that, see 'hg forget'.
463
463
464 If no names are given, add all files to the repository (except files
464 If no names are given, add all files to the repository (except files
465 matching ".hgignore").
465 matching ".hgignore").
466
466
467 Returns 0 if all files are successfully added.
467 Returns 0 if all files are successfully added.
468
468
469 options ([+] can be repeated):
469 options ([+] can be repeated):
470
470
471 -I --include PATTERN [+] include names matching the given patterns
471 -I --include PATTERN [+] include names matching the given patterns
472 -X --exclude PATTERN [+] exclude names matching the given patterns
472 -X --exclude PATTERN [+] exclude names matching the given patterns
473 -S --subrepos recurse into subrepositories
473 -S --subrepos recurse into subrepositories
474 -n --dry-run do not perform actions, just print output
474 -n --dry-run do not perform actions, just print output
475
475
476 (some details hidden, use --verbose to show complete help)
476 (some details hidden, use --verbose to show complete help)
477
477
478 Verbose help for add
478 Verbose help for add
479
479
480 $ hg add -hv
480 $ hg add -hv
481 hg add [OPTION]... [FILE]...
481 hg add [OPTION]... [FILE]...
482
482
483 add the specified files on the next commit
483 add the specified files on the next commit
484
484
485 Schedule files to be version controlled and added to the repository.
485 Schedule files to be version controlled and added to the repository.
486
486
487 The files will be added to the repository at the next commit. To undo an
487 The files will be added to the repository at the next commit. To undo an
488 add before that, see 'hg forget'.
488 add before that, see 'hg forget'.
489
489
490 If no names are given, add all files to the repository (except files
490 If no names are given, add all files to the repository (except files
491 matching ".hgignore").
491 matching ".hgignore").
492
492
493 Examples:
493 Examples:
494
494
495 - New (unknown) files are added automatically by 'hg add':
495 - New (unknown) files are added automatically by 'hg add':
496
496
497 $ ls
497 $ ls
498 foo.c
498 foo.c
499 $ hg status
499 $ hg status
500 ? foo.c
500 ? foo.c
501 $ hg add
501 $ hg add
502 adding foo.c
502 adding foo.c
503 $ hg status
503 $ hg status
504 A foo.c
504 A foo.c
505
505
506 - Specific files to be added can be specified:
506 - Specific files to be added can be specified:
507
507
508 $ ls
508 $ ls
509 bar.c foo.c
509 bar.c foo.c
510 $ hg status
510 $ hg status
511 ? bar.c
511 ? bar.c
512 ? foo.c
512 ? foo.c
513 $ hg add bar.c
513 $ hg add bar.c
514 $ hg status
514 $ hg status
515 A bar.c
515 A bar.c
516 ? foo.c
516 ? foo.c
517
517
518 Returns 0 if all files are successfully added.
518 Returns 0 if all files are successfully added.
519
519
520 options ([+] can be repeated):
520 options ([+] can be repeated):
521
521
522 -I --include PATTERN [+] include names matching the given patterns
522 -I --include PATTERN [+] include names matching the given patterns
523 -X --exclude PATTERN [+] exclude names matching the given patterns
523 -X --exclude PATTERN [+] exclude names matching the given patterns
524 -S --subrepos recurse into subrepositories
524 -S --subrepos recurse into subrepositories
525 -n --dry-run do not perform actions, just print output
525 -n --dry-run do not perform actions, just print output
526
526
527 global options ([+] can be repeated):
527 global options ([+] can be repeated):
528
528
529 -R --repository REPO repository root directory or name of overlay bundle
529 -R --repository REPO repository root directory or name of overlay bundle
530 file
530 file
531 --cwd DIR change working directory
531 --cwd DIR change working directory
532 -y --noninteractive do not prompt, automatically pick the first choice for
532 -y --noninteractive do not prompt, automatically pick the first choice for
533 all prompts
533 all prompts
534 -q --quiet suppress output
534 -q --quiet suppress output
535 -v --verbose enable additional output
535 -v --verbose enable additional output
536 --color TYPE when to colorize (boolean, always, auto, never, or
536 --color TYPE when to colorize (boolean, always, auto, never, or
537 debug)
537 debug)
538 --config CONFIG [+] set/override config option (use 'section.name=value')
538 --config CONFIG [+] set/override config option (use 'section.name=value')
539 --debug enable debugging output
539 --debug enable debugging output
540 --debugger start debugger
540 --debugger start debugger
541 --encoding ENCODE set the charset encoding (default: ascii)
541 --encoding ENCODE set the charset encoding (default: ascii)
542 --encodingmode MODE set the charset encoding mode (default: strict)
542 --encodingmode MODE set the charset encoding mode (default: strict)
543 --traceback always print a traceback on exception
543 --traceback always print a traceback on exception
544 --time time how long the command takes
544 --time time how long the command takes
545 --profile print command execution profile
545 --profile print command execution profile
546 --version output version information and exit
546 --version output version information and exit
547 -h --help display help and exit
547 -h --help display help and exit
548 --hidden consider hidden changesets
548 --hidden consider hidden changesets
549 --pager TYPE when to paginate (boolean, always, auto, or never)
549 --pager TYPE when to paginate (boolean, always, auto, or never)
550 (default: auto)
550 (default: auto)
551
551
552 Test the textwidth config option
552 Test the textwidth config option
553
553
554 $ hg root -h --config ui.textwidth=50
554 $ hg root -h --config ui.textwidth=50
555 hg root
555 hg root
556
556
557 print the root (top) of the current working
557 print the root (top) of the current working
558 directory
558 directory
559
559
560 Print the root directory of the current
560 Print the root directory of the current
561 repository.
561 repository.
562
562
563 Returns 0 on success.
563 Returns 0 on success.
564
564
565 options:
565 options:
566
566
567 -T --template TEMPLATE display with template
567 -T --template TEMPLATE display with template
568
568
569 (some details hidden, use --verbose to show
569 (some details hidden, use --verbose to show
570 complete help)
570 complete help)
571
571
572 Test help option with version option
572 Test help option with version option
573
573
574 $ hg add -h --version
574 $ hg add -h --version
575 Mercurial Distributed SCM (version *) (glob)
575 Mercurial Distributed SCM (version *) (glob)
576 (see https://mercurial-scm.org for more information)
576 (see https://mercurial-scm.org for more information)
577
577
578 Copyright (C) 2005-* Matt Mackall and others (glob)
578 Copyright (C) 2005-* Matt Mackall and others (glob)
579 This is free software; see the source for copying conditions. There is NO
579 This is free software; see the source for copying conditions. There is NO
580 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
580 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
581
581
582 $ hg add --skjdfks
582 $ hg add --skjdfks
583 hg add: option --skjdfks not recognized
583 hg add: option --skjdfks not recognized
584 hg add [OPTION]... [FILE]...
584 hg add [OPTION]... [FILE]...
585
585
586 add the specified files on the next commit
586 add the specified files on the next commit
587
587
588 options ([+] can be repeated):
588 options ([+] can be repeated):
589
589
590 -I --include PATTERN [+] include names matching the given patterns
590 -I --include PATTERN [+] include names matching the given patterns
591 -X --exclude PATTERN [+] exclude names matching the given patterns
591 -X --exclude PATTERN [+] exclude names matching the given patterns
592 -S --subrepos recurse into subrepositories
592 -S --subrepos recurse into subrepositories
593 -n --dry-run do not perform actions, just print output
593 -n --dry-run do not perform actions, just print output
594
594
595 (use 'hg add -h' to show more help)
595 (use 'hg add -h' to show more help)
596 [255]
596 [10]
597
597
598 Test ambiguous command help
598 Test ambiguous command help
599
599
600 $ hg help ad
600 $ hg help ad
601 list of commands:
601 list of commands:
602
602
603 add add the specified files on the next commit
603 add add the specified files on the next commit
604 addremove add all new files, delete all missing files
604 addremove add all new files, delete all missing files
605
605
606 (use 'hg help -v ad' to show built-in aliases and global options)
606 (use 'hg help -v ad' to show built-in aliases and global options)
607
607
608 Test command without options
608 Test command without options
609
609
610 $ hg help verify
610 $ hg help verify
611 hg verify
611 hg verify
612
612
613 verify the integrity of the repository
613 verify the integrity of the repository
614
614
615 Verify the integrity of the current repository.
615 Verify the integrity of the current repository.
616
616
617 This will perform an extensive check of the repository's integrity,
617 This will perform an extensive check of the repository's integrity,
618 validating the hashes and checksums of each entry in the changelog,
618 validating the hashes and checksums of each entry in the changelog,
619 manifest, and tracked files, as well as the integrity of their crosslinks
619 manifest, and tracked files, as well as the integrity of their crosslinks
620 and indices.
620 and indices.
621
621
622 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
622 Please see https://mercurial-scm.org/wiki/RepositoryCorruption for more
623 information about recovery from corruption of the repository.
623 information about recovery from corruption of the repository.
624
624
625 Returns 0 on success, 1 if errors are encountered.
625 Returns 0 on success, 1 if errors are encountered.
626
626
627 options:
627 options:
628
628
629 (some details hidden, use --verbose to show complete help)
629 (some details hidden, use --verbose to show complete help)
630
630
631 $ hg help diff
631 $ hg help diff
632 hg diff [OPTION]... ([-c REV] | [--from REV1] [--to REV2]) [FILE]...
632 hg diff [OPTION]... ([-c REV] | [--from REV1] [--to REV2]) [FILE]...
633
633
634 diff repository (or selected files)
634 diff repository (or selected files)
635
635
636 Show differences between revisions for the specified files.
636 Show differences between revisions for the specified files.
637
637
638 Differences between files are shown using the unified diff format.
638 Differences between files are shown using the unified diff format.
639
639
640 Note:
640 Note:
641 'hg diff' may generate unexpected results for merges, as it will
641 'hg diff' may generate unexpected results for merges, as it will
642 default to comparing against the working directory's first parent
642 default to comparing against the working directory's first parent
643 changeset if no revisions are specified.
643 changeset if no revisions are specified.
644
644
645 By default, the working directory files are compared to its first parent.
645 By default, the working directory files are compared to its first parent.
646 To see the differences from another revision, use --from. To see the
646 To see the differences from another revision, use --from. To see the
647 difference to another revision, use --to. For example, 'hg diff --from .^'
647 difference to another revision, use --to. For example, 'hg diff --from .^'
648 will show the differences from the working copy's grandparent to the
648 will show the differences from the working copy's grandparent to the
649 working copy, 'hg diff --to .' will show the diff from the working copy to
649 working copy, 'hg diff --to .' will show the diff from the working copy to
650 its parent (i.e. the reverse of the default), and 'hg diff --from 1.0 --to
650 its parent (i.e. the reverse of the default), and 'hg diff --from 1.0 --to
651 1.2' will show the diff between those two revisions.
651 1.2' will show the diff between those two revisions.
652
652
653 Alternatively you can specify -c/--change with a revision to see the
653 Alternatively you can specify -c/--change with a revision to see the
654 changes in that changeset relative to its first parent (i.e. 'hg diff -c
654 changes in that changeset relative to its first parent (i.e. 'hg diff -c
655 42' is equivalent to 'hg diff --from 42^ --to 42')
655 42' is equivalent to 'hg diff --from 42^ --to 42')
656
656
657 Without the -a/--text option, diff will avoid generating diffs of files it
657 Without the -a/--text option, diff will avoid generating diffs of files it
658 detects as binary. With -a, diff will generate a diff anyway, probably
658 detects as binary. With -a, diff will generate a diff anyway, probably
659 with undesirable results.
659 with undesirable results.
660
660
661 Use the -g/--git option to generate diffs in the git extended diff format.
661 Use the -g/--git option to generate diffs in the git extended diff format.
662 For more information, read 'hg help diffs'.
662 For more information, read 'hg help diffs'.
663
663
664 Returns 0 on success.
664 Returns 0 on success.
665
665
666 options ([+] can be repeated):
666 options ([+] can be repeated):
667
667
668 --from REV1 revision to diff from
668 --from REV1 revision to diff from
669 --to REV2 revision to diff to
669 --to REV2 revision to diff to
670 -c --change REV change made by revision
670 -c --change REV change made by revision
671 -a --text treat all files as text
671 -a --text treat all files as text
672 -g --git use git extended diff format
672 -g --git use git extended diff format
673 --binary generate binary diffs in git mode (default)
673 --binary generate binary diffs in git mode (default)
674 --nodates omit dates from diff headers
674 --nodates omit dates from diff headers
675 --noprefix omit a/ and b/ prefixes from filenames
675 --noprefix omit a/ and b/ prefixes from filenames
676 -p --show-function show which function each change is in
676 -p --show-function show which function each change is in
677 --reverse produce a diff that undoes the changes
677 --reverse produce a diff that undoes the changes
678 -w --ignore-all-space ignore white space when comparing lines
678 -w --ignore-all-space ignore white space when comparing lines
679 -b --ignore-space-change ignore changes in the amount of white space
679 -b --ignore-space-change ignore changes in the amount of white space
680 -B --ignore-blank-lines ignore changes whose lines are all blank
680 -B --ignore-blank-lines ignore changes whose lines are all blank
681 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
681 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
682 -U --unified NUM number of lines of context to show
682 -U --unified NUM number of lines of context to show
683 --stat output diffstat-style summary of changes
683 --stat output diffstat-style summary of changes
684 --root DIR produce diffs relative to subdirectory
684 --root DIR produce diffs relative to subdirectory
685 -I --include PATTERN [+] include names matching the given patterns
685 -I --include PATTERN [+] include names matching the given patterns
686 -X --exclude PATTERN [+] exclude names matching the given patterns
686 -X --exclude PATTERN [+] exclude names matching the given patterns
687 -S --subrepos recurse into subrepositories
687 -S --subrepos recurse into subrepositories
688
688
689 (some details hidden, use --verbose to show complete help)
689 (some details hidden, use --verbose to show complete help)
690
690
691 $ hg help status
691 $ hg help status
692 hg status [OPTION]... [FILE]...
692 hg status [OPTION]... [FILE]...
693
693
694 aliases: st
694 aliases: st
695
695
696 show changed files in the working directory
696 show changed files in the working directory
697
697
698 Show status of files in the repository. If names are given, only files
698 Show status of files in the repository. If names are given, only files
699 that match are shown. Files that are clean or ignored or the source of a
699 that match are shown. Files that are clean or ignored or the source of a
700 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
700 copy/move operation, are not listed unless -c/--clean, -i/--ignored,
701 -C/--copies or -A/--all are given. Unless options described with "show
701 -C/--copies or -A/--all are given. Unless options described with "show
702 only ..." are given, the options -mardu are used.
702 only ..." are given, the options -mardu are used.
703
703
704 Option -q/--quiet hides untracked (unknown and ignored) files unless
704 Option -q/--quiet hides untracked (unknown and ignored) files unless
705 explicitly requested with -u/--unknown or -i/--ignored.
705 explicitly requested with -u/--unknown or -i/--ignored.
706
706
707 Note:
707 Note:
708 'hg status' may appear to disagree with diff if permissions have
708 'hg status' may appear to disagree with diff if permissions have
709 changed or a merge has occurred. The standard diff format does not
709 changed or a merge has occurred. The standard diff format does not
710 report permission changes and diff only reports changes relative to one
710 report permission changes and diff only reports changes relative to one
711 merge parent.
711 merge parent.
712
712
713 If one revision is given, it is used as the base revision. If two
713 If one revision is given, it is used as the base revision. If two
714 revisions are given, the differences between them are shown. The --change
714 revisions are given, the differences between them are shown. The --change
715 option can also be used as a shortcut to list the changed files of a
715 option can also be used as a shortcut to list the changed files of a
716 revision from its first parent.
716 revision from its first parent.
717
717
718 The codes used to show the status of files are:
718 The codes used to show the status of files are:
719
719
720 M = modified
720 M = modified
721 A = added
721 A = added
722 R = removed
722 R = removed
723 C = clean
723 C = clean
724 ! = missing (deleted by non-hg command, but still tracked)
724 ! = missing (deleted by non-hg command, but still tracked)
725 ? = not tracked
725 ? = not tracked
726 I = ignored
726 I = ignored
727 = origin of the previous file (with --copies)
727 = origin of the previous file (with --copies)
728
728
729 Returns 0 on success.
729 Returns 0 on success.
730
730
731 options ([+] can be repeated):
731 options ([+] can be repeated):
732
732
733 -A --all show status of all files
733 -A --all show status of all files
734 -m --modified show only modified files
734 -m --modified show only modified files
735 -a --added show only added files
735 -a --added show only added files
736 -r --removed show only removed files
736 -r --removed show only removed files
737 -d --deleted show only missing files
737 -d --deleted show only missing files
738 -c --clean show only files without changes
738 -c --clean show only files without changes
739 -u --unknown show only unknown (not tracked) files
739 -u --unknown show only unknown (not tracked) files
740 -i --ignored show only ignored files
740 -i --ignored show only ignored files
741 -n --no-status hide status prefix
741 -n --no-status hide status prefix
742 -C --copies show source of copied files
742 -C --copies show source of copied files
743 -0 --print0 end filenames with NUL, for use with xargs
743 -0 --print0 end filenames with NUL, for use with xargs
744 --rev REV [+] show difference from revision
744 --rev REV [+] show difference from revision
745 --change REV list the changed files of a revision
745 --change REV list the changed files of a revision
746 -I --include PATTERN [+] include names matching the given patterns
746 -I --include PATTERN [+] include names matching the given patterns
747 -X --exclude PATTERN [+] exclude names matching the given patterns
747 -X --exclude PATTERN [+] exclude names matching the given patterns
748 -S --subrepos recurse into subrepositories
748 -S --subrepos recurse into subrepositories
749 -T --template TEMPLATE display with template
749 -T --template TEMPLATE display with template
750
750
751 (some details hidden, use --verbose to show complete help)
751 (some details hidden, use --verbose to show complete help)
752
752
753 $ hg -q help status
753 $ hg -q help status
754 hg status [OPTION]... [FILE]...
754 hg status [OPTION]... [FILE]...
755
755
756 show changed files in the working directory
756 show changed files in the working directory
757
757
758 $ hg help foo
758 $ hg help foo
759 abort: no such help topic: foo
759 abort: no such help topic: foo
760 (try 'hg help --keyword foo')
760 (try 'hg help --keyword foo')
761 [10]
761 [10]
762
762
763 $ hg skjdfks
763 $ hg skjdfks
764 hg: unknown command 'skjdfks'
764 hg: unknown command 'skjdfks'
765 (use 'hg help' for a list of commands)
765 (use 'hg help' for a list of commands)
766 [255]
766 [10]
767
767
768 Typoed command gives suggestion
768 Typoed command gives suggestion
769 $ hg puls
769 $ hg puls
770 hg: unknown command 'puls'
770 hg: unknown command 'puls'
771 (did you mean one of pull, push?)
771 (did you mean one of pull, push?)
772 [255]
772 [10]
773
773
774 Not enabled extension gets suggested
774 Not enabled extension gets suggested
775
775
776 $ hg rebase
776 $ hg rebase
777 hg: unknown command 'rebase'
777 hg: unknown command 'rebase'
778 'rebase' is provided by the following extension:
778 'rebase' is provided by the following extension:
779
779
780 rebase command to move sets of revisions to a different ancestor
780 rebase command to move sets of revisions to a different ancestor
781
781
782 (use 'hg help extensions' for information on enabling extensions)
782 (use 'hg help extensions' for information on enabling extensions)
783 [255]
783 [10]
784
784
785 Disabled extension gets suggested
785 Disabled extension gets suggested
786 $ hg --config extensions.rebase=! rebase
786 $ hg --config extensions.rebase=! rebase
787 hg: unknown command 'rebase'
787 hg: unknown command 'rebase'
788 'rebase' is provided by the following extension:
788 'rebase' is provided by the following extension:
789
789
790 rebase command to move sets of revisions to a different ancestor
790 rebase command to move sets of revisions to a different ancestor
791
791
792 (use 'hg help extensions' for information on enabling extensions)
792 (use 'hg help extensions' for information on enabling extensions)
793 [255]
793 [10]
794
794
795 Checking that help adapts based on the config:
795 Checking that help adapts based on the config:
796
796
797 $ hg help diff --config ui.tweakdefaults=true | egrep -e '^ *(-g|config)'
797 $ hg help diff --config ui.tweakdefaults=true | egrep -e '^ *(-g|config)'
798 -g --[no-]git use git extended diff format (default: on from
798 -g --[no-]git use git extended diff format (default: on from
799 config)
799 config)
800
800
801 Make sure that we don't run afoul of the help system thinking that
801 Make sure that we don't run afoul of the help system thinking that
802 this is a section and erroring out weirdly.
802 this is a section and erroring out weirdly.
803
803
804 $ hg .log
804 $ hg .log
805 hg: unknown command '.log'
805 hg: unknown command '.log'
806 (did you mean log?)
806 (did you mean log?)
807 [255]
807 [10]
808
808
809 $ hg log.
809 $ hg log.
810 hg: unknown command 'log.'
810 hg: unknown command 'log.'
811 (did you mean log?)
811 (did you mean log?)
812 [255]
812 [10]
813 $ hg pu.lh
813 $ hg pu.lh
814 hg: unknown command 'pu.lh'
814 hg: unknown command 'pu.lh'
815 (did you mean one of pull, push?)
815 (did you mean one of pull, push?)
816 [255]
816 [10]
817
817
818 $ cat > helpext.py <<EOF
818 $ cat > helpext.py <<EOF
819 > import os
819 > import os
820 > from mercurial import commands, fancyopts, registrar
820 > from mercurial import commands, fancyopts, registrar
821 >
821 >
822 > def func(arg):
822 > def func(arg):
823 > return '%sfoo' % arg
823 > return '%sfoo' % arg
824 > class customopt(fancyopts.customopt):
824 > class customopt(fancyopts.customopt):
825 > def newstate(self, oldstate, newparam, abort):
825 > def newstate(self, oldstate, newparam, abort):
826 > return '%sbar' % oldstate
826 > return '%sbar' % oldstate
827 > cmdtable = {}
827 > cmdtable = {}
828 > command = registrar.command(cmdtable)
828 > command = registrar.command(cmdtable)
829 >
829 >
830 > @command(b'nohelp',
830 > @command(b'nohelp',
831 > [(b'', b'longdesc', 3, b'x'*67),
831 > [(b'', b'longdesc', 3, b'x'*67),
832 > (b'n', b'', None, b'normal desc'),
832 > (b'n', b'', None, b'normal desc'),
833 > (b'', b'newline', b'', b'line1\nline2'),
833 > (b'', b'newline', b'', b'line1\nline2'),
834 > (b'', b'default-off', False, b'enable X'),
834 > (b'', b'default-off', False, b'enable X'),
835 > (b'', b'default-on', True, b'enable Y'),
835 > (b'', b'default-on', True, b'enable Y'),
836 > (b'', b'callableopt', func, b'adds foo'),
836 > (b'', b'callableopt', func, b'adds foo'),
837 > (b'', b'customopt', customopt(''), b'adds bar'),
837 > (b'', b'customopt', customopt(''), b'adds bar'),
838 > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')],
838 > (b'', b'customopt-withdefault', customopt('foo'), b'adds bar')],
839 > b'hg nohelp',
839 > b'hg nohelp',
840 > norepo=True)
840 > norepo=True)
841 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
841 > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')])
842 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
842 > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')])
843 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
843 > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')])
844 > def nohelp(ui, *args, **kwargs):
844 > def nohelp(ui, *args, **kwargs):
845 > pass
845 > pass
846 >
846 >
847 > @command(b'hashelp', [], b'hg hashelp', norepo=True)
847 > @command(b'hashelp', [], b'hg hashelp', norepo=True)
848 > def hashelp(ui, *args, **kwargs):
848 > def hashelp(ui, *args, **kwargs):
849 > """Extension command's help"""
849 > """Extension command's help"""
850 >
850 >
851 > def uisetup(ui):
851 > def uisetup(ui):
852 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
852 > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext')
853 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
853 > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext')
854 > ui.setconfig(b'alias', b'hgalias:doc', b'My doc', b'helpext')
854 > ui.setconfig(b'alias', b'hgalias:doc', b'My doc', b'helpext')
855 > ui.setconfig(b'alias', b'hgalias:category', b'navigation', b'helpext')
855 > ui.setconfig(b'alias', b'hgalias:category', b'navigation', b'helpext')
856 > ui.setconfig(b'alias', b'hgaliasnodoc', b'summary', b'helpext')
856 > ui.setconfig(b'alias', b'hgaliasnodoc', b'summary', b'helpext')
857 >
857 >
858 > EOF
858 > EOF
859 $ echo '[extensions]' >> $HGRCPATH
859 $ echo '[extensions]' >> $HGRCPATH
860 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
860 $ echo "helpext = `pwd`/helpext.py" >> $HGRCPATH
861
861
862 Test for aliases
862 Test for aliases
863
863
864 $ hg help | grep hgalias
864 $ hg help | grep hgalias
865 hgalias My doc
865 hgalias My doc
866
866
867 $ hg help hgalias
867 $ hg help hgalias
868 hg hgalias [--remote]
868 hg hgalias [--remote]
869
869
870 alias for: hg summary
870 alias for: hg summary
871
871
872 My doc
872 My doc
873
873
874 defined by: helpext
874 defined by: helpext
875
875
876 options:
876 options:
877
877
878 --remote check for push and pull
878 --remote check for push and pull
879
879
880 (some details hidden, use --verbose to show complete help)
880 (some details hidden, use --verbose to show complete help)
881 $ hg help hgaliasnodoc
881 $ hg help hgaliasnodoc
882 hg hgaliasnodoc [--remote]
882 hg hgaliasnodoc [--remote]
883
883
884 alias for: hg summary
884 alias for: hg summary
885
885
886 summarize working directory state
886 summarize working directory state
887
887
888 This generates a brief summary of the working directory state, including
888 This generates a brief summary of the working directory state, including
889 parents, branch, commit status, phase and available updates.
889 parents, branch, commit status, phase and available updates.
890
890
891 With the --remote option, this will check the default paths for incoming
891 With the --remote option, this will check the default paths for incoming
892 and outgoing changes. This can be time-consuming.
892 and outgoing changes. This can be time-consuming.
893
893
894 Returns 0 on success.
894 Returns 0 on success.
895
895
896 defined by: helpext
896 defined by: helpext
897
897
898 options:
898 options:
899
899
900 --remote check for push and pull
900 --remote check for push and pull
901
901
902 (some details hidden, use --verbose to show complete help)
902 (some details hidden, use --verbose to show complete help)
903
903
904 $ hg help shellalias
904 $ hg help shellalias
905 hg shellalias
905 hg shellalias
906
906
907 shell alias for: echo hi
907 shell alias for: echo hi
908
908
909 (no help text available)
909 (no help text available)
910
910
911 defined by: helpext
911 defined by: helpext
912
912
913 (some details hidden, use --verbose to show complete help)
913 (some details hidden, use --verbose to show complete help)
914
914
915 Test command with no help text
915 Test command with no help text
916
916
917 $ hg help nohelp
917 $ hg help nohelp
918 hg nohelp
918 hg nohelp
919
919
920 (no help text available)
920 (no help text available)
921
921
922 options:
922 options:
923
923
924 --longdesc VALUE
924 --longdesc VALUE
925 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
925 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
926 xxxxxxxxxxxxxxxxxxxxxxx (default: 3)
926 xxxxxxxxxxxxxxxxxxxxxxx (default: 3)
927 -n -- normal desc
927 -n -- normal desc
928 --newline VALUE line1 line2
928 --newline VALUE line1 line2
929 --default-off enable X
929 --default-off enable X
930 --[no-]default-on enable Y (default: on)
930 --[no-]default-on enable Y (default: on)
931 --callableopt VALUE adds foo
931 --callableopt VALUE adds foo
932 --customopt VALUE adds bar
932 --customopt VALUE adds bar
933 --customopt-withdefault VALUE adds bar (default: foo)
933 --customopt-withdefault VALUE adds bar (default: foo)
934
934
935 (some details hidden, use --verbose to show complete help)
935 (some details hidden, use --verbose to show complete help)
936
936
937 Test that default list of commands includes extension commands that have help,
937 Test that default list of commands includes extension commands that have help,
938 but not those that don't, except in verbose mode, when a keyword is passed, or
938 but not those that don't, except in verbose mode, when a keyword is passed, or
939 when help about the extension is requested.
939 when help about the extension is requested.
940
940
941 #if no-extraextensions
941 #if no-extraextensions
942
942
943 $ hg help | grep hashelp
943 $ hg help | grep hashelp
944 hashelp Extension command's help
944 hashelp Extension command's help
945 $ hg help | grep nohelp
945 $ hg help | grep nohelp
946 [1]
946 [1]
947 $ hg help -v | grep nohelp
947 $ hg help -v | grep nohelp
948 nohelp (no help text available)
948 nohelp (no help text available)
949
949
950 $ hg help -k nohelp
950 $ hg help -k nohelp
951 Commands:
951 Commands:
952
952
953 nohelp hg nohelp
953 nohelp hg nohelp
954
954
955 Extension Commands:
955 Extension Commands:
956
956
957 nohelp (no help text available)
957 nohelp (no help text available)
958
958
959 $ hg help helpext
959 $ hg help helpext
960 helpext extension - no help text available
960 helpext extension - no help text available
961
961
962 list of commands:
962 list of commands:
963
963
964 hashelp Extension command's help
964 hashelp Extension command's help
965 nohelp (no help text available)
965 nohelp (no help text available)
966
966
967 (use 'hg help -v helpext' to show built-in aliases and global options)
967 (use 'hg help -v helpext' to show built-in aliases and global options)
968
968
969 #endif
969 #endif
970
970
971 Test list of internal help commands
971 Test list of internal help commands
972
972
973 $ hg help debug
973 $ hg help debug
974 debug commands (internal and unsupported):
974 debug commands (internal and unsupported):
975
975
976 debugancestor
976 debugancestor
977 find the ancestor revision of two revisions in a given index
977 find the ancestor revision of two revisions in a given index
978 debugantivirusrunning
978 debugantivirusrunning
979 attempt to trigger an antivirus scanner to see if one is active
979 attempt to trigger an antivirus scanner to see if one is active
980 debugapplystreamclonebundle
980 debugapplystreamclonebundle
981 apply a stream clone bundle file
981 apply a stream clone bundle file
982 debugbackupbundle
982 debugbackupbundle
983 lists the changesets available in backup bundles
983 lists the changesets available in backup bundles
984 debugbuilddag
984 debugbuilddag
985 builds a repo with a given DAG from scratch in the current
985 builds a repo with a given DAG from scratch in the current
986 empty repo
986 empty repo
987 debugbundle lists the contents of a bundle
987 debugbundle lists the contents of a bundle
988 debugcapabilities
988 debugcapabilities
989 lists the capabilities of a remote peer
989 lists the capabilities of a remote peer
990 debugchangedfiles
990 debugchangedfiles
991 list the stored files changes for a revision
991 list the stored files changes for a revision
992 debugcheckstate
992 debugcheckstate
993 validate the correctness of the current dirstate
993 validate the correctness of the current dirstate
994 debugcolor show available color, effects or style
994 debugcolor show available color, effects or style
995 debugcommands
995 debugcommands
996 list all available commands and options
996 list all available commands and options
997 debugcomplete
997 debugcomplete
998 returns the completion list associated with the given command
998 returns the completion list associated with the given command
999 debugcreatestreamclonebundle
999 debugcreatestreamclonebundle
1000 create a stream clone bundle file
1000 create a stream clone bundle file
1001 debugdag format the changelog or an index DAG as a concise textual
1001 debugdag format the changelog or an index DAG as a concise textual
1002 description
1002 description
1003 debugdata dump the contents of a data file revision
1003 debugdata dump the contents of a data file revision
1004 debugdate parse and display a date
1004 debugdate parse and display a date
1005 debugdeltachain
1005 debugdeltachain
1006 dump information about delta chains in a revlog
1006 dump information about delta chains in a revlog
1007 debugdirstate
1007 debugdirstate
1008 show the contents of the current dirstate
1008 show the contents of the current dirstate
1009 debugdiscovery
1009 debugdiscovery
1010 runs the changeset discovery protocol in isolation
1010 runs the changeset discovery protocol in isolation
1011 debugdownload
1011 debugdownload
1012 download a resource using Mercurial logic and config
1012 download a resource using Mercurial logic and config
1013 debugextensions
1013 debugextensions
1014 show information about active extensions
1014 show information about active extensions
1015 debugfileset parse and apply a fileset specification
1015 debugfileset parse and apply a fileset specification
1016 debugformat display format information about the current repository
1016 debugformat display format information about the current repository
1017 debugfsinfo show information detected about current filesystem
1017 debugfsinfo show information detected about current filesystem
1018 debuggetbundle
1018 debuggetbundle
1019 retrieves a bundle from a repo
1019 retrieves a bundle from a repo
1020 debugignore display the combined ignore pattern and information about
1020 debugignore display the combined ignore pattern and information about
1021 ignored files
1021 ignored files
1022 debugindex dump index data for a storage primitive
1022 debugindex dump index data for a storage primitive
1023 debugindexdot
1023 debugindexdot
1024 dump an index DAG as a graphviz dot file
1024 dump an index DAG as a graphviz dot file
1025 debugindexstats
1025 debugindexstats
1026 show stats related to the changelog index
1026 show stats related to the changelog index
1027 debuginstall test Mercurial installation
1027 debuginstall test Mercurial installation
1028 debugknown test whether node ids are known to a repo
1028 debugknown test whether node ids are known to a repo
1029 debuglocks show or modify state of locks
1029 debuglocks show or modify state of locks
1030 debugmanifestfulltextcache
1030 debugmanifestfulltextcache
1031 show, clear or amend the contents of the manifest fulltext
1031 show, clear or amend the contents of the manifest fulltext
1032 cache
1032 cache
1033 debugmergestate
1033 debugmergestate
1034 print merge state
1034 print merge state
1035 debugnamecomplete
1035 debugnamecomplete
1036 complete "names" - tags, open branch names, bookmark names
1036 complete "names" - tags, open branch names, bookmark names
1037 debugnodemap write and inspect on disk nodemap
1037 debugnodemap write and inspect on disk nodemap
1038 debugobsolete
1038 debugobsolete
1039 create arbitrary obsolete marker
1039 create arbitrary obsolete marker
1040 debugoptADV (no help text available)
1040 debugoptADV (no help text available)
1041 debugoptDEP (no help text available)
1041 debugoptDEP (no help text available)
1042 debugoptEXP (no help text available)
1042 debugoptEXP (no help text available)
1043 debugp1copies
1043 debugp1copies
1044 dump copy information compared to p1
1044 dump copy information compared to p1
1045 debugp2copies
1045 debugp2copies
1046 dump copy information compared to p2
1046 dump copy information compared to p2
1047 debugpathcomplete
1047 debugpathcomplete
1048 complete part or all of a tracked path
1048 complete part or all of a tracked path
1049 debugpathcopies
1049 debugpathcopies
1050 show copies between two revisions
1050 show copies between two revisions
1051 debugpeer establish a connection to a peer repository
1051 debugpeer establish a connection to a peer repository
1052 debugpickmergetool
1052 debugpickmergetool
1053 examine which merge tool is chosen for specified file
1053 examine which merge tool is chosen for specified file
1054 debugpushkey access the pushkey key/value protocol
1054 debugpushkey access the pushkey key/value protocol
1055 debugpvec (no help text available)
1055 debugpvec (no help text available)
1056 debugrebuilddirstate
1056 debugrebuilddirstate
1057 rebuild the dirstate as it would look like for the given
1057 rebuild the dirstate as it would look like for the given
1058 revision
1058 revision
1059 debugrebuildfncache
1059 debugrebuildfncache
1060 rebuild the fncache file
1060 rebuild the fncache file
1061 debugrename dump rename information
1061 debugrename dump rename information
1062 debugrequires
1062 debugrequires
1063 print the current repo requirements
1063 print the current repo requirements
1064 debugrevlog show data and statistics about a revlog
1064 debugrevlog show data and statistics about a revlog
1065 debugrevlogindex
1065 debugrevlogindex
1066 dump the contents of a revlog index
1066 dump the contents of a revlog index
1067 debugrevspec parse and apply a revision specification
1067 debugrevspec parse and apply a revision specification
1068 debugserve run a server with advanced settings
1068 debugserve run a server with advanced settings
1069 debugsetparents
1069 debugsetparents
1070 manually set the parents of the current working directory
1070 manually set the parents of the current working directory
1071 (DANGEROUS)
1071 (DANGEROUS)
1072 debugsidedata
1072 debugsidedata
1073 dump the side data for a cl/manifest/file revision
1073 dump the side data for a cl/manifest/file revision
1074 debugssl test a secure connection to a server
1074 debugssl test a secure connection to a server
1075 debugstrip strip changesets and all their descendants from the repository
1075 debugstrip strip changesets and all their descendants from the repository
1076 debugsub (no help text available)
1076 debugsub (no help text available)
1077 debugsuccessorssets
1077 debugsuccessorssets
1078 show set of successors for revision
1078 show set of successors for revision
1079 debugtagscache
1079 debugtagscache
1080 display the contents of .hg/cache/hgtagsfnodes1
1080 display the contents of .hg/cache/hgtagsfnodes1
1081 debugtemplate
1081 debugtemplate
1082 parse and apply a template
1082 parse and apply a template
1083 debuguigetpass
1083 debuguigetpass
1084 show prompt to type password
1084 show prompt to type password
1085 debuguiprompt
1085 debuguiprompt
1086 show plain prompt
1086 show plain prompt
1087 debugupdatecaches
1087 debugupdatecaches
1088 warm all known caches in the repository
1088 warm all known caches in the repository
1089 debugupgraderepo
1089 debugupgraderepo
1090 upgrade a repository to use different features
1090 upgrade a repository to use different features
1091 debugwalk show how files match on given patterns
1091 debugwalk show how files match on given patterns
1092 debugwhyunstable
1092 debugwhyunstable
1093 explain instabilities of a changeset
1093 explain instabilities of a changeset
1094 debugwireargs
1094 debugwireargs
1095 (no help text available)
1095 (no help text available)
1096 debugwireproto
1096 debugwireproto
1097 send wire protocol commands to a server
1097 send wire protocol commands to a server
1098
1098
1099 (use 'hg help -v debug' to show built-in aliases and global options)
1099 (use 'hg help -v debug' to show built-in aliases and global options)
1100
1100
1101 internals topic renders index of available sub-topics
1101 internals topic renders index of available sub-topics
1102
1102
1103 $ hg help internals
1103 $ hg help internals
1104 Technical implementation topics
1104 Technical implementation topics
1105 """""""""""""""""""""""""""""""
1105 """""""""""""""""""""""""""""""
1106
1106
1107 To access a subtopic, use "hg help internals.{subtopic-name}"
1107 To access a subtopic, use "hg help internals.{subtopic-name}"
1108
1108
1109 bid-merge Bid Merge Algorithm
1109 bid-merge Bid Merge Algorithm
1110 bundle2 Bundle2
1110 bundle2 Bundle2
1111 bundles Bundles
1111 bundles Bundles
1112 cbor CBOR
1112 cbor CBOR
1113 censor Censor
1113 censor Censor
1114 changegroups Changegroups
1114 changegroups Changegroups
1115 config Config Registrar
1115 config Config Registrar
1116 extensions Extension API
1116 extensions Extension API
1117 mergestate Mergestate
1117 mergestate Mergestate
1118 requirements Repository Requirements
1118 requirements Repository Requirements
1119 revlogs Revision Logs
1119 revlogs Revision Logs
1120 wireprotocol Wire Protocol
1120 wireprotocol Wire Protocol
1121 wireprotocolrpc
1121 wireprotocolrpc
1122 Wire Protocol RPC
1122 Wire Protocol RPC
1123 wireprotocolv2
1123 wireprotocolv2
1124 Wire Protocol Version 2
1124 Wire Protocol Version 2
1125
1125
1126 sub-topics can be accessed
1126 sub-topics can be accessed
1127
1127
1128 $ hg help internals.changegroups
1128 $ hg help internals.changegroups
1129 Changegroups
1129 Changegroups
1130 """"""""""""
1130 """"""""""""
1131
1131
1132 Changegroups are representations of repository revlog data, specifically
1132 Changegroups are representations of repository revlog data, specifically
1133 the changelog data, root/flat manifest data, treemanifest data, and
1133 the changelog data, root/flat manifest data, treemanifest data, and
1134 filelogs.
1134 filelogs.
1135
1135
1136 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1136 There are 3 versions of changegroups: "1", "2", and "3". From a high-
1137 level, versions "1" and "2" are almost exactly the same, with the only
1137 level, versions "1" and "2" are almost exactly the same, with the only
1138 difference being an additional item in the *delta header*. Version "3"
1138 difference being an additional item in the *delta header*. Version "3"
1139 adds support for storage flags in the *delta header* and optionally
1139 adds support for storage flags in the *delta header* and optionally
1140 exchanging treemanifests (enabled by setting an option on the
1140 exchanging treemanifests (enabled by setting an option on the
1141 "changegroup" part in the bundle2).
1141 "changegroup" part in the bundle2).
1142
1142
1143 Changegroups when not exchanging treemanifests consist of 3 logical
1143 Changegroups when not exchanging treemanifests consist of 3 logical
1144 segments:
1144 segments:
1145
1145
1146 +---------------------------------+
1146 +---------------------------------+
1147 | | | |
1147 | | | |
1148 | changeset | manifest | filelogs |
1148 | changeset | manifest | filelogs |
1149 | | | |
1149 | | | |
1150 | | | |
1150 | | | |
1151 +---------------------------------+
1151 +---------------------------------+
1152
1152
1153 When exchanging treemanifests, there are 4 logical segments:
1153 When exchanging treemanifests, there are 4 logical segments:
1154
1154
1155 +-------------------------------------------------+
1155 +-------------------------------------------------+
1156 | | | | |
1156 | | | | |
1157 | changeset | root | treemanifests | filelogs |
1157 | changeset | root | treemanifests | filelogs |
1158 | | manifest | | |
1158 | | manifest | | |
1159 | | | | |
1159 | | | | |
1160 +-------------------------------------------------+
1160 +-------------------------------------------------+
1161
1161
1162 The principle building block of each segment is a *chunk*. A *chunk* is a
1162 The principle building block of each segment is a *chunk*. A *chunk* is a
1163 framed piece of data:
1163 framed piece of data:
1164
1164
1165 +---------------------------------------+
1165 +---------------------------------------+
1166 | | |
1166 | | |
1167 | length | data |
1167 | length | data |
1168 | (4 bytes) | (<length - 4> bytes) |
1168 | (4 bytes) | (<length - 4> bytes) |
1169 | | |
1169 | | |
1170 +---------------------------------------+
1170 +---------------------------------------+
1171
1171
1172 All integers are big-endian signed integers. Each chunk starts with a
1172 All integers are big-endian signed integers. Each chunk starts with a
1173 32-bit integer indicating the length of the entire chunk (including the
1173 32-bit integer indicating the length of the entire chunk (including the
1174 length field itself).
1174 length field itself).
1175
1175
1176 There is a special case chunk that has a value of 0 for the length
1176 There is a special case chunk that has a value of 0 for the length
1177 ("0x00000000"). We call this an *empty chunk*.
1177 ("0x00000000"). We call this an *empty chunk*.
1178
1178
1179 Delta Groups
1179 Delta Groups
1180 ============
1180 ============
1181
1181
1182 A *delta group* expresses the content of a revlog as a series of deltas,
1182 A *delta group* expresses the content of a revlog as a series of deltas,
1183 or patches against previous revisions.
1183 or patches against previous revisions.
1184
1184
1185 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1185 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
1186 to signal the end of the delta group:
1186 to signal the end of the delta group:
1187
1187
1188 +------------------------------------------------------------------------+
1188 +------------------------------------------------------------------------+
1189 | | | | | |
1189 | | | | | |
1190 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1190 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
1191 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1191 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
1192 | | | | | |
1192 | | | | | |
1193 +------------------------------------------------------------------------+
1193 +------------------------------------------------------------------------+
1194
1194
1195 Each *chunk*'s data consists of the following:
1195 Each *chunk*'s data consists of the following:
1196
1196
1197 +---------------------------------------+
1197 +---------------------------------------+
1198 | | |
1198 | | |
1199 | delta header | delta data |
1199 | delta header | delta data |
1200 | (various by version) | (various) |
1200 | (various by version) | (various) |
1201 | | |
1201 | | |
1202 +---------------------------------------+
1202 +---------------------------------------+
1203
1203
1204 The *delta data* is a series of *delta*s that describe a diff from an
1204 The *delta data* is a series of *delta*s that describe a diff from an
1205 existing entry (either that the recipient already has, or previously
1205 existing entry (either that the recipient already has, or previously
1206 specified in the bundle/changegroup).
1206 specified in the bundle/changegroup).
1207
1207
1208 The *delta header* is different between versions "1", "2", and "3" of the
1208 The *delta header* is different between versions "1", "2", and "3" of the
1209 changegroup format.
1209 changegroup format.
1210
1210
1211 Version 1 (headerlen=80):
1211 Version 1 (headerlen=80):
1212
1212
1213 +------------------------------------------------------+
1213 +------------------------------------------------------+
1214 | | | | |
1214 | | | | |
1215 | node | p1 node | p2 node | link node |
1215 | node | p1 node | p2 node | link node |
1216 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1216 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1217 | | | | |
1217 | | | | |
1218 +------------------------------------------------------+
1218 +------------------------------------------------------+
1219
1219
1220 Version 2 (headerlen=100):
1220 Version 2 (headerlen=100):
1221
1221
1222 +------------------------------------------------------------------+
1222 +------------------------------------------------------------------+
1223 | | | | | |
1223 | | | | | |
1224 | node | p1 node | p2 node | base node | link node |
1224 | node | p1 node | p2 node | base node | link node |
1225 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1225 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
1226 | | | | | |
1226 | | | | | |
1227 +------------------------------------------------------------------+
1227 +------------------------------------------------------------------+
1228
1228
1229 Version 3 (headerlen=102):
1229 Version 3 (headerlen=102):
1230
1230
1231 +------------------------------------------------------------------------------+
1231 +------------------------------------------------------------------------------+
1232 | | | | | | |
1232 | | | | | | |
1233 | node | p1 node | p2 node | base node | link node | flags |
1233 | node | p1 node | p2 node | base node | link node | flags |
1234 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1234 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
1235 | | | | | | |
1235 | | | | | | |
1236 +------------------------------------------------------------------------------+
1236 +------------------------------------------------------------------------------+
1237
1237
1238 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1238 The *delta data* consists of "chunklen - 4 - headerlen" bytes, which
1239 contain a series of *delta*s, densely packed (no separators). These deltas
1239 contain a series of *delta*s, densely packed (no separators). These deltas
1240 describe a diff from an existing entry (either that the recipient already
1240 describe a diff from an existing entry (either that the recipient already
1241 has, or previously specified in the bundle/changegroup). The format is
1241 has, or previously specified in the bundle/changegroup). The format is
1242 described more fully in "hg help internals.bdiff", but briefly:
1242 described more fully in "hg help internals.bdiff", but briefly:
1243
1243
1244 +---------------------------------------------------------------+
1244 +---------------------------------------------------------------+
1245 | | | | |
1245 | | | | |
1246 | start offset | end offset | new length | content |
1246 | start offset | end offset | new length | content |
1247 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1247 | (4 bytes) | (4 bytes) | (4 bytes) | (<new length> bytes) |
1248 | | | | |
1248 | | | | |
1249 +---------------------------------------------------------------+
1249 +---------------------------------------------------------------+
1250
1250
1251 Please note that the length field in the delta data does *not* include
1251 Please note that the length field in the delta data does *not* include
1252 itself.
1252 itself.
1253
1253
1254 In version 1, the delta is always applied against the previous node from
1254 In version 1, the delta is always applied against the previous node from
1255 the changegroup or the first parent if this is the first entry in the
1255 the changegroup or the first parent if this is the first entry in the
1256 changegroup.
1256 changegroup.
1257
1257
1258 In version 2 and up, the delta base node is encoded in the entry in the
1258 In version 2 and up, the delta base node is encoded in the entry in the
1259 changegroup. This allows the delta to be expressed against any parent,
1259 changegroup. This allows the delta to be expressed against any parent,
1260 which can result in smaller deltas and more efficient encoding of data.
1260 which can result in smaller deltas and more efficient encoding of data.
1261
1261
1262 The *flags* field holds bitwise flags affecting the processing of revision
1262 The *flags* field holds bitwise flags affecting the processing of revision
1263 data. The following flags are defined:
1263 data. The following flags are defined:
1264
1264
1265 32768
1265 32768
1266 Censored revision. The revision's fulltext has been replaced by censor
1266 Censored revision. The revision's fulltext has been replaced by censor
1267 metadata. May only occur on file revisions.
1267 metadata. May only occur on file revisions.
1268
1268
1269 16384
1269 16384
1270 Ellipsis revision. Revision hash does not match data (likely due to
1270 Ellipsis revision. Revision hash does not match data (likely due to
1271 rewritten parents).
1271 rewritten parents).
1272
1272
1273 8192
1273 8192
1274 Externally stored. The revision fulltext contains "key:value" "\n"
1274 Externally stored. The revision fulltext contains "key:value" "\n"
1275 delimited metadata defining an object stored elsewhere. Used by the LFS
1275 delimited metadata defining an object stored elsewhere. Used by the LFS
1276 extension.
1276 extension.
1277
1277
1278 For historical reasons, the integer values are identical to revlog version
1278 For historical reasons, the integer values are identical to revlog version
1279 1 per-revision storage flags and correspond to bits being set in this
1279 1 per-revision storage flags and correspond to bits being set in this
1280 2-byte field. Bits were allocated starting from the most-significant bit,
1280 2-byte field. Bits were allocated starting from the most-significant bit,
1281 hence the reverse ordering and allocation of these flags.
1281 hence the reverse ordering and allocation of these flags.
1282
1282
1283 Changeset Segment
1283 Changeset Segment
1284 =================
1284 =================
1285
1285
1286 The *changeset segment* consists of a single *delta group* holding
1286 The *changeset segment* consists of a single *delta group* holding
1287 changelog data. The *empty chunk* at the end of the *delta group* denotes
1287 changelog data. The *empty chunk* at the end of the *delta group* denotes
1288 the boundary to the *manifest segment*.
1288 the boundary to the *manifest segment*.
1289
1289
1290 Manifest Segment
1290 Manifest Segment
1291 ================
1291 ================
1292
1292
1293 The *manifest segment* consists of a single *delta group* holding manifest
1293 The *manifest segment* consists of a single *delta group* holding manifest
1294 data. If treemanifests are in use, it contains only the manifest for the
1294 data. If treemanifests are in use, it contains only the manifest for the
1295 root directory of the repository. Otherwise, it contains the entire
1295 root directory of the repository. Otherwise, it contains the entire
1296 manifest data. The *empty chunk* at the end of the *delta group* denotes
1296 manifest data. The *empty chunk* at the end of the *delta group* denotes
1297 the boundary to the next segment (either the *treemanifests segment* or
1297 the boundary to the next segment (either the *treemanifests segment* or
1298 the *filelogs segment*, depending on version and the request options).
1298 the *filelogs segment*, depending on version and the request options).
1299
1299
1300 Treemanifests Segment
1300 Treemanifests Segment
1301 ---------------------
1301 ---------------------
1302
1302
1303 The *treemanifests segment* only exists in changegroup version "3", and
1303 The *treemanifests segment* only exists in changegroup version "3", and
1304 only if the 'treemanifest' param is part of the bundle2 changegroup part
1304 only if the 'treemanifest' param is part of the bundle2 changegroup part
1305 (it is not possible to use changegroup version 3 outside of bundle2).
1305 (it is not possible to use changegroup version 3 outside of bundle2).
1306 Aside from the filenames in the *treemanifests segment* containing a
1306 Aside from the filenames in the *treemanifests segment* containing a
1307 trailing "/" character, it behaves identically to the *filelogs segment*
1307 trailing "/" character, it behaves identically to the *filelogs segment*
1308 (see below). The final sub-segment is followed by an *empty chunk*
1308 (see below). The final sub-segment is followed by an *empty chunk*
1309 (logically, a sub-segment with filename size 0). This denotes the boundary
1309 (logically, a sub-segment with filename size 0). This denotes the boundary
1310 to the *filelogs segment*.
1310 to the *filelogs segment*.
1311
1311
1312 Filelogs Segment
1312 Filelogs Segment
1313 ================
1313 ================
1314
1314
1315 The *filelogs segment* consists of multiple sub-segments, each
1315 The *filelogs segment* consists of multiple sub-segments, each
1316 corresponding to an individual file whose data is being described:
1316 corresponding to an individual file whose data is being described:
1317
1317
1318 +--------------------------------------------------+
1318 +--------------------------------------------------+
1319 | | | | | |
1319 | | | | | |
1320 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1320 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
1321 | | | | | (4 bytes) |
1321 | | | | | (4 bytes) |
1322 | | | | | |
1322 | | | | | |
1323 +--------------------------------------------------+
1323 +--------------------------------------------------+
1324
1324
1325 The final filelog sub-segment is followed by an *empty chunk* (logically,
1325 The final filelog sub-segment is followed by an *empty chunk* (logically,
1326 a sub-segment with filename size 0). This denotes the end of the segment
1326 a sub-segment with filename size 0). This denotes the end of the segment
1327 and of the overall changegroup.
1327 and of the overall changegroup.
1328
1328
1329 Each filelog sub-segment consists of the following:
1329 Each filelog sub-segment consists of the following:
1330
1330
1331 +------------------------------------------------------+
1331 +------------------------------------------------------+
1332 | | | |
1332 | | | |
1333 | filename length | filename | delta group |
1333 | filename length | filename | delta group |
1334 | (4 bytes) | (<length - 4> bytes) | (various) |
1334 | (4 bytes) | (<length - 4> bytes) | (various) |
1335 | | | |
1335 | | | |
1336 +------------------------------------------------------+
1336 +------------------------------------------------------+
1337
1337
1338 That is, a *chunk* consisting of the filename (not terminated or padded)
1338 That is, a *chunk* consisting of the filename (not terminated or padded)
1339 followed by N chunks constituting the *delta group* for this file. The
1339 followed by N chunks constituting the *delta group* for this file. The
1340 *empty chunk* at the end of each *delta group* denotes the boundary to the
1340 *empty chunk* at the end of each *delta group* denotes the boundary to the
1341 next filelog sub-segment.
1341 next filelog sub-segment.
1342
1342
1343 non-existent subtopics print an error
1343 non-existent subtopics print an error
1344
1344
1345 $ hg help internals.foo
1345 $ hg help internals.foo
1346 abort: no such help topic: internals.foo
1346 abort: no such help topic: internals.foo
1347 (try 'hg help --keyword foo')
1347 (try 'hg help --keyword foo')
1348 [10]
1348 [10]
1349
1349
1350 test advanced, deprecated and experimental options are hidden in command help
1350 test advanced, deprecated and experimental options are hidden in command help
1351 $ hg help debugoptADV
1351 $ hg help debugoptADV
1352 hg debugoptADV
1352 hg debugoptADV
1353
1353
1354 (no help text available)
1354 (no help text available)
1355
1355
1356 options:
1356 options:
1357
1357
1358 (some details hidden, use --verbose to show complete help)
1358 (some details hidden, use --verbose to show complete help)
1359 $ hg help debugoptDEP
1359 $ hg help debugoptDEP
1360 hg debugoptDEP
1360 hg debugoptDEP
1361
1361
1362 (no help text available)
1362 (no help text available)
1363
1363
1364 options:
1364 options:
1365
1365
1366 (some details hidden, use --verbose to show complete help)
1366 (some details hidden, use --verbose to show complete help)
1367
1367
1368 $ hg help debugoptEXP
1368 $ hg help debugoptEXP
1369 hg debugoptEXP
1369 hg debugoptEXP
1370
1370
1371 (no help text available)
1371 (no help text available)
1372
1372
1373 options:
1373 options:
1374
1374
1375 (some details hidden, use --verbose to show complete help)
1375 (some details hidden, use --verbose to show complete help)
1376
1376
1377 test advanced, deprecated and experimental options are shown with -v
1377 test advanced, deprecated and experimental options are shown with -v
1378 $ hg help -v debugoptADV | grep aopt
1378 $ hg help -v debugoptADV | grep aopt
1379 --aopt option is (ADVANCED)
1379 --aopt option is (ADVANCED)
1380 $ hg help -v debugoptDEP | grep dopt
1380 $ hg help -v debugoptDEP | grep dopt
1381 --dopt option is (DEPRECATED)
1381 --dopt option is (DEPRECATED)
1382 $ hg help -v debugoptEXP | grep eopt
1382 $ hg help -v debugoptEXP | grep eopt
1383 --eopt option is (EXPERIMENTAL)
1383 --eopt option is (EXPERIMENTAL)
1384
1384
1385 #if gettext
1385 #if gettext
1386 test deprecated option is hidden with translation with untranslated description
1386 test deprecated option is hidden with translation with untranslated description
1387 (use many globy for not failing on changed transaction)
1387 (use many globy for not failing on changed transaction)
1388 $ LANGUAGE=sv hg help debugoptDEP
1388 $ LANGUAGE=sv hg help debugoptDEP
1389 hg debugoptDEP
1389 hg debugoptDEP
1390
1390
1391 (*) (glob)
1391 (*) (glob)
1392
1392
1393 options:
1393 options:
1394
1394
1395 (some details hidden, use --verbose to show complete help)
1395 (some details hidden, use --verbose to show complete help)
1396 #endif
1396 #endif
1397
1397
1398 Test commands that collide with topics (issue4240)
1398 Test commands that collide with topics (issue4240)
1399
1399
1400 $ hg config -hq
1400 $ hg config -hq
1401 hg config [-u] [NAME]...
1401 hg config [-u] [NAME]...
1402
1402
1403 show combined config settings from all hgrc files
1403 show combined config settings from all hgrc files
1404 $ hg showconfig -hq
1404 $ hg showconfig -hq
1405 hg config [-u] [NAME]...
1405 hg config [-u] [NAME]...
1406
1406
1407 show combined config settings from all hgrc files
1407 show combined config settings from all hgrc files
1408
1408
1409 Test a help topic
1409 Test a help topic
1410
1410
1411 $ hg help dates
1411 $ hg help dates
1412 Date Formats
1412 Date Formats
1413 """"""""""""
1413 """"""""""""
1414
1414
1415 Some commands allow the user to specify a date, e.g.:
1415 Some commands allow the user to specify a date, e.g.:
1416
1416
1417 - backout, commit, import, tag: Specify the commit date.
1417 - backout, commit, import, tag: Specify the commit date.
1418 - log, revert, update: Select revision(s) by date.
1418 - log, revert, update: Select revision(s) by date.
1419
1419
1420 Many date formats are valid. Here are some examples:
1420 Many date formats are valid. Here are some examples:
1421
1421
1422 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1422 - "Wed Dec 6 13:18:29 2006" (local timezone assumed)
1423 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1423 - "Dec 6 13:18 -0600" (year assumed, time offset provided)
1424 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1424 - "Dec 6 13:18 UTC" (UTC and GMT are aliases for +0000)
1425 - "Dec 6" (midnight)
1425 - "Dec 6" (midnight)
1426 - "13:18" (today assumed)
1426 - "13:18" (today assumed)
1427 - "3:39" (3:39AM assumed)
1427 - "3:39" (3:39AM assumed)
1428 - "3:39pm" (15:39)
1428 - "3:39pm" (15:39)
1429 - "2006-12-06 13:18:29" (ISO 8601 format)
1429 - "2006-12-06 13:18:29" (ISO 8601 format)
1430 - "2006-12-6 13:18"
1430 - "2006-12-6 13:18"
1431 - "2006-12-6"
1431 - "2006-12-6"
1432 - "12-6"
1432 - "12-6"
1433 - "12/6"
1433 - "12/6"
1434 - "12/6/6" (Dec 6 2006)
1434 - "12/6/6" (Dec 6 2006)
1435 - "today" (midnight)
1435 - "today" (midnight)
1436 - "yesterday" (midnight)
1436 - "yesterday" (midnight)
1437 - "now" - right now
1437 - "now" - right now
1438
1438
1439 Lastly, there is Mercurial's internal format:
1439 Lastly, there is Mercurial's internal format:
1440
1440
1441 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1441 - "1165411109 0" (Wed Dec 6 13:18:29 2006 UTC)
1442
1442
1443 This is the internal representation format for dates. The first number is
1443 This is the internal representation format for dates. The first number is
1444 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1444 the number of seconds since the epoch (1970-01-01 00:00 UTC). The second
1445 is the offset of the local timezone, in seconds west of UTC (negative if
1445 is the offset of the local timezone, in seconds west of UTC (negative if
1446 the timezone is east of UTC).
1446 the timezone is east of UTC).
1447
1447
1448 The log command also accepts date ranges:
1448 The log command also accepts date ranges:
1449
1449
1450 - "<DATE" - at or before a given date/time
1450 - "<DATE" - at or before a given date/time
1451 - ">DATE" - on or after a given date/time
1451 - ">DATE" - on or after a given date/time
1452 - "DATE to DATE" - a date range, inclusive
1452 - "DATE to DATE" - a date range, inclusive
1453 - "-DAYS" - within a given number of days from today
1453 - "-DAYS" - within a given number of days from today
1454
1454
1455 Test repeated config section name
1455 Test repeated config section name
1456
1456
1457 $ hg help config.host
1457 $ hg help config.host
1458 "http_proxy.host"
1458 "http_proxy.host"
1459 Host name and (optional) port of the proxy server, for example
1459 Host name and (optional) port of the proxy server, for example
1460 "myproxy:8000".
1460 "myproxy:8000".
1461
1461
1462 "smtp.host"
1462 "smtp.host"
1463 Host name of mail server, e.g. "mail.example.com".
1463 Host name of mail server, e.g. "mail.example.com".
1464
1464
1465
1465
1466 Test section name with dot
1466 Test section name with dot
1467
1467
1468 $ hg help config.ui.username
1468 $ hg help config.ui.username
1469 "ui.username"
1469 "ui.username"
1470 The committer of a changeset created when running "commit". Typically
1470 The committer of a changeset created when running "commit". Typically
1471 a person's name and email address, e.g. "Fred Widget
1471 a person's name and email address, e.g. "Fred Widget
1472 <fred@example.com>". Environment variables in the username are
1472 <fred@example.com>". Environment variables in the username are
1473 expanded.
1473 expanded.
1474
1474
1475 (default: "$EMAIL" or "username@hostname". If the username in hgrc is
1475 (default: "$EMAIL" or "username@hostname". If the username in hgrc is
1476 empty, e.g. if the system admin set "username =" in the system hgrc,
1476 empty, e.g. if the system admin set "username =" in the system hgrc,
1477 it has to be specified manually or in a different hgrc file)
1477 it has to be specified manually or in a different hgrc file)
1478
1478
1479
1479
1480 $ hg help config.annotate.git
1480 $ hg help config.annotate.git
1481 abort: help section not found: config.annotate.git
1481 abort: help section not found: config.annotate.git
1482 [10]
1482 [10]
1483
1483
1484 $ hg help config.update.check
1484 $ hg help config.update.check
1485 "commands.update.check"
1485 "commands.update.check"
1486 Determines what level of checking 'hg update' will perform before
1486 Determines what level of checking 'hg update' will perform before
1487 moving to a destination revision. Valid values are "abort", "none",
1487 moving to a destination revision. Valid values are "abort", "none",
1488 "linear", and "noconflict". "abort" always fails if the working
1488 "linear", and "noconflict". "abort" always fails if the working
1489 directory has uncommitted changes. "none" performs no checking, and
1489 directory has uncommitted changes. "none" performs no checking, and
1490 may result in a merge with uncommitted changes. "linear" allows any
1490 may result in a merge with uncommitted changes. "linear" allows any
1491 update as long as it follows a straight line in the revision history,
1491 update as long as it follows a straight line in the revision history,
1492 and may trigger a merge with uncommitted changes. "noconflict" will
1492 and may trigger a merge with uncommitted changes. "noconflict" will
1493 allow any update which would not trigger a merge with uncommitted
1493 allow any update which would not trigger a merge with uncommitted
1494 changes, if any are present. (default: "linear")
1494 changes, if any are present. (default: "linear")
1495
1495
1496
1496
1497 $ hg help config.commands.update.check
1497 $ hg help config.commands.update.check
1498 "commands.update.check"
1498 "commands.update.check"
1499 Determines what level of checking 'hg update' will perform before
1499 Determines what level of checking 'hg update' will perform before
1500 moving to a destination revision. Valid values are "abort", "none",
1500 moving to a destination revision. Valid values are "abort", "none",
1501 "linear", and "noconflict". "abort" always fails if the working
1501 "linear", and "noconflict". "abort" always fails if the working
1502 directory has uncommitted changes. "none" performs no checking, and
1502 directory has uncommitted changes. "none" performs no checking, and
1503 may result in a merge with uncommitted changes. "linear" allows any
1503 may result in a merge with uncommitted changes. "linear" allows any
1504 update as long as it follows a straight line in the revision history,
1504 update as long as it follows a straight line in the revision history,
1505 and may trigger a merge with uncommitted changes. "noconflict" will
1505 and may trigger a merge with uncommitted changes. "noconflict" will
1506 allow any update which would not trigger a merge with uncommitted
1506 allow any update which would not trigger a merge with uncommitted
1507 changes, if any are present. (default: "linear")
1507 changes, if any are present. (default: "linear")
1508
1508
1509
1509
1510 $ hg help config.ommands.update.check
1510 $ hg help config.ommands.update.check
1511 abort: help section not found: config.ommands.update.check
1511 abort: help section not found: config.ommands.update.check
1512 [10]
1512 [10]
1513
1513
1514 Unrelated trailing paragraphs shouldn't be included
1514 Unrelated trailing paragraphs shouldn't be included
1515
1515
1516 $ hg help config.extramsg | grep '^$'
1516 $ hg help config.extramsg | grep '^$'
1517
1517
1518
1518
1519 Test capitalized section name
1519 Test capitalized section name
1520
1520
1521 $ hg help scripting.HGPLAIN > /dev/null
1521 $ hg help scripting.HGPLAIN > /dev/null
1522
1522
1523 Help subsection:
1523 Help subsection:
1524
1524
1525 $ hg help config.charsets |grep "Email example:" > /dev/null
1525 $ hg help config.charsets |grep "Email example:" > /dev/null
1526 [1]
1526 [1]
1527
1527
1528 Show nested definitions
1528 Show nested definitions
1529 ("profiling.type"[break]"ls"[break]"stat"[break])
1529 ("profiling.type"[break]"ls"[break]"stat"[break])
1530
1530
1531 $ hg help config.type | egrep '^$'|wc -l
1531 $ hg help config.type | egrep '^$'|wc -l
1532 \s*3 (re)
1532 \s*3 (re)
1533
1533
1534 $ hg help config.profiling.type.ls
1534 $ hg help config.profiling.type.ls
1535 "profiling.type.ls"
1535 "profiling.type.ls"
1536 Use Python's built-in instrumenting profiler. This profiler works on
1536 Use Python's built-in instrumenting profiler. This profiler works on
1537 all platforms, but each line number it reports is the first line of
1537 all platforms, but each line number it reports is the first line of
1538 a function. This restriction makes it difficult to identify the
1538 a function. This restriction makes it difficult to identify the
1539 expensive parts of a non-trivial function.
1539 expensive parts of a non-trivial function.
1540
1540
1541
1541
1542 Separate sections from subsections
1542 Separate sections from subsections
1543
1543
1544 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1544 $ hg help config.format | egrep '^ ("|-)|^\s*$' | uniq
1545 "format"
1545 "format"
1546 --------
1546 --------
1547
1547
1548 "usegeneraldelta"
1548 "usegeneraldelta"
1549
1549
1550 "dotencode"
1550 "dotencode"
1551
1551
1552 "usefncache"
1552 "usefncache"
1553
1553
1554 "usestore"
1554 "usestore"
1555
1555
1556 "sparse-revlog"
1556 "sparse-revlog"
1557
1557
1558 "revlog-compression"
1558 "revlog-compression"
1559
1559
1560 "bookmarks-in-store"
1560 "bookmarks-in-store"
1561
1561
1562 "profiling"
1562 "profiling"
1563 -----------
1563 -----------
1564
1564
1565 "format"
1565 "format"
1566
1566
1567 "progress"
1567 "progress"
1568 ----------
1568 ----------
1569
1569
1570 "format"
1570 "format"
1571
1571
1572
1572
1573 Last item in help config.*:
1573 Last item in help config.*:
1574
1574
1575 $ hg help config.`hg help config|grep '^ "'| \
1575 $ hg help config.`hg help config|grep '^ "'| \
1576 > tail -1|sed 's![ "]*!!g'`| \
1576 > tail -1|sed 's![ "]*!!g'`| \
1577 > grep 'hg help -c config' > /dev/null
1577 > grep 'hg help -c config' > /dev/null
1578 [1]
1578 [1]
1579
1579
1580 note to use help -c for general hg help config:
1580 note to use help -c for general hg help config:
1581
1581
1582 $ hg help config |grep 'hg help -c config' > /dev/null
1582 $ hg help config |grep 'hg help -c config' > /dev/null
1583
1583
1584 Test templating help
1584 Test templating help
1585
1585
1586 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1586 $ hg help templating | egrep '(desc|diffstat|firstline|nonempty) '
1587 desc String. The text of the changeset description.
1587 desc String. The text of the changeset description.
1588 diffstat String. Statistics of changes with the following format:
1588 diffstat String. Statistics of changes with the following format:
1589 firstline Any text. Returns the first line of text.
1589 firstline Any text. Returns the first line of text.
1590 nonempty Any text. Returns '(none)' if the string is empty.
1590 nonempty Any text. Returns '(none)' if the string is empty.
1591
1591
1592 Test deprecated items
1592 Test deprecated items
1593
1593
1594 $ hg help -v templating | grep currentbookmark
1594 $ hg help -v templating | grep currentbookmark
1595 currentbookmark
1595 currentbookmark
1596 $ hg help templating | (grep currentbookmark || true)
1596 $ hg help templating | (grep currentbookmark || true)
1597
1597
1598 Test help hooks
1598 Test help hooks
1599
1599
1600 $ cat > helphook1.py <<EOF
1600 $ cat > helphook1.py <<EOF
1601 > from mercurial import help
1601 > from mercurial import help
1602 >
1602 >
1603 > def rewrite(ui, topic, doc):
1603 > def rewrite(ui, topic, doc):
1604 > return doc + b'\nhelphook1\n'
1604 > return doc + b'\nhelphook1\n'
1605 >
1605 >
1606 > def extsetup(ui):
1606 > def extsetup(ui):
1607 > help.addtopichook(b'revisions', rewrite)
1607 > help.addtopichook(b'revisions', rewrite)
1608 > EOF
1608 > EOF
1609 $ cat > helphook2.py <<EOF
1609 $ cat > helphook2.py <<EOF
1610 > from mercurial import help
1610 > from mercurial import help
1611 >
1611 >
1612 > def rewrite(ui, topic, doc):
1612 > def rewrite(ui, topic, doc):
1613 > return doc + b'\nhelphook2\n'
1613 > return doc + b'\nhelphook2\n'
1614 >
1614 >
1615 > def extsetup(ui):
1615 > def extsetup(ui):
1616 > help.addtopichook(b'revisions', rewrite)
1616 > help.addtopichook(b'revisions', rewrite)
1617 > EOF
1617 > EOF
1618 $ echo '[extensions]' >> $HGRCPATH
1618 $ echo '[extensions]' >> $HGRCPATH
1619 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1619 $ echo "helphook1 = `pwd`/helphook1.py" >> $HGRCPATH
1620 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1620 $ echo "helphook2 = `pwd`/helphook2.py" >> $HGRCPATH
1621 $ hg help revsets | grep helphook
1621 $ hg help revsets | grep helphook
1622 helphook1
1622 helphook1
1623 helphook2
1623 helphook2
1624
1624
1625 help -c should only show debug --debug
1625 help -c should only show debug --debug
1626
1626
1627 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1627 $ hg help -c --debug|egrep debug|wc -l|egrep '^\s*0\s*$'
1628 [1]
1628 [1]
1629
1629
1630 help -c should only show deprecated for -v
1630 help -c should only show deprecated for -v
1631
1631
1632 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1632 $ hg help -c -v|egrep DEPRECATED|wc -l|egrep '^\s*0\s*$'
1633 [1]
1633 [1]
1634
1634
1635 Test -s / --system
1635 Test -s / --system
1636
1636
1637 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1637 $ hg help config.files -s windows |grep 'etc/mercurial' | \
1638 > wc -l | sed -e 's/ //g'
1638 > wc -l | sed -e 's/ //g'
1639 0
1639 0
1640 $ hg help config.files --system unix | grep 'USER' | \
1640 $ hg help config.files --system unix | grep 'USER' | \
1641 > wc -l | sed -e 's/ //g'
1641 > wc -l | sed -e 's/ //g'
1642 0
1642 0
1643
1643
1644 Test -e / -c / -k combinations
1644 Test -e / -c / -k combinations
1645
1645
1646 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1646 $ hg help -c|egrep '^[A-Z].*:|^ debug'
1647 Commands:
1647 Commands:
1648 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1648 $ hg help -e|egrep '^[A-Z].*:|^ debug'
1649 Extensions:
1649 Extensions:
1650 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1650 $ hg help -k|egrep '^[A-Z].*:|^ debug'
1651 Topics:
1651 Topics:
1652 Commands:
1652 Commands:
1653 Extensions:
1653 Extensions:
1654 Extension Commands:
1654 Extension Commands:
1655 $ hg help -c schemes
1655 $ hg help -c schemes
1656 abort: no such help topic: schemes
1656 abort: no such help topic: schemes
1657 (try 'hg help --keyword schemes')
1657 (try 'hg help --keyword schemes')
1658 [10]
1658 [10]
1659 $ hg help -e schemes |head -1
1659 $ hg help -e schemes |head -1
1660 schemes extension - extend schemes with shortcuts to repository swarms
1660 schemes extension - extend schemes with shortcuts to repository swarms
1661 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1661 $ hg help -c -k dates |egrep '^(Topics|Extensions|Commands):'
1662 Commands:
1662 Commands:
1663 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1663 $ hg help -e -k a |egrep '^(Topics|Extensions|Commands):'
1664 Extensions:
1664 Extensions:
1665 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1665 $ hg help -e -c -k date |egrep '^(Topics|Extensions|Commands):'
1666 Extensions:
1666 Extensions:
1667 Commands:
1667 Commands:
1668 $ hg help -c commit > /dev/null
1668 $ hg help -c commit > /dev/null
1669 $ hg help -e -c commit > /dev/null
1669 $ hg help -e -c commit > /dev/null
1670 $ hg help -e commit
1670 $ hg help -e commit
1671 abort: no such help topic: commit
1671 abort: no such help topic: commit
1672 (try 'hg help --keyword commit')
1672 (try 'hg help --keyword commit')
1673 [10]
1673 [10]
1674
1674
1675 Test keyword search help
1675 Test keyword search help
1676
1676
1677 $ cat > prefixedname.py <<EOF
1677 $ cat > prefixedname.py <<EOF
1678 > '''matched against word "clone"
1678 > '''matched against word "clone"
1679 > '''
1679 > '''
1680 > EOF
1680 > EOF
1681 $ echo '[extensions]' >> $HGRCPATH
1681 $ echo '[extensions]' >> $HGRCPATH
1682 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1682 $ echo "dot.dot.prefixedname = `pwd`/prefixedname.py" >> $HGRCPATH
1683 $ hg help -k clone
1683 $ hg help -k clone
1684 Topics:
1684 Topics:
1685
1685
1686 config Configuration Files
1686 config Configuration Files
1687 extensions Using Additional Features
1687 extensions Using Additional Features
1688 glossary Glossary
1688 glossary Glossary
1689 phases Working with Phases
1689 phases Working with Phases
1690 subrepos Subrepositories
1690 subrepos Subrepositories
1691 urls URL Paths
1691 urls URL Paths
1692
1692
1693 Commands:
1693 Commands:
1694
1694
1695 bookmarks create a new bookmark or list existing bookmarks
1695 bookmarks create a new bookmark or list existing bookmarks
1696 clone make a copy of an existing repository
1696 clone make a copy of an existing repository
1697 paths show aliases for remote repositories
1697 paths show aliases for remote repositories
1698 pull pull changes from the specified source
1698 pull pull changes from the specified source
1699 update update working directory (or switch revisions)
1699 update update working directory (or switch revisions)
1700
1700
1701 Extensions:
1701 Extensions:
1702
1702
1703 clonebundles advertise pre-generated bundles to seed clones
1703 clonebundles advertise pre-generated bundles to seed clones
1704 narrow create clones which fetch history data for subset of files
1704 narrow create clones which fetch history data for subset of files
1705 (EXPERIMENTAL)
1705 (EXPERIMENTAL)
1706 prefixedname matched against word "clone"
1706 prefixedname matched against word "clone"
1707 relink recreates hardlinks between repository clones
1707 relink recreates hardlinks between repository clones
1708
1708
1709 Extension Commands:
1709 Extension Commands:
1710
1710
1711 qclone clone main and patch repository at same time
1711 qclone clone main and patch repository at same time
1712
1712
1713 Test unfound topic
1713 Test unfound topic
1714
1714
1715 $ hg help nonexistingtopicthatwillneverexisteverever
1715 $ hg help nonexistingtopicthatwillneverexisteverever
1716 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1716 abort: no such help topic: nonexistingtopicthatwillneverexisteverever
1717 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1717 (try 'hg help --keyword nonexistingtopicthatwillneverexisteverever')
1718 [10]
1718 [10]
1719
1719
1720 Test unfound keyword
1720 Test unfound keyword
1721
1721
1722 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1722 $ hg help --keyword nonexistingwordthatwillneverexisteverever
1723 abort: no matches
1723 abort: no matches
1724 (try 'hg help' for a list of topics)
1724 (try 'hg help' for a list of topics)
1725 [10]
1725 [10]
1726
1726
1727 Test omit indicating for help
1727 Test omit indicating for help
1728
1728
1729 $ cat > addverboseitems.py <<EOF
1729 $ cat > addverboseitems.py <<EOF
1730 > r'''extension to test omit indicating.
1730 > r'''extension to test omit indicating.
1731 >
1731 >
1732 > This paragraph is never omitted (for extension)
1732 > This paragraph is never omitted (for extension)
1733 >
1733 >
1734 > .. container:: verbose
1734 > .. container:: verbose
1735 >
1735 >
1736 > This paragraph is omitted,
1736 > This paragraph is omitted,
1737 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1737 > if :hg:\`help\` is invoked without \`\`-v\`\` (for extension)
1738 >
1738 >
1739 > This paragraph is never omitted, too (for extension)
1739 > This paragraph is never omitted, too (for extension)
1740 > '''
1740 > '''
1741 > from __future__ import absolute_import
1741 > from __future__ import absolute_import
1742 > from mercurial import commands, help
1742 > from mercurial import commands, help
1743 > testtopic = br"""This paragraph is never omitted (for topic).
1743 > testtopic = br"""This paragraph is never omitted (for topic).
1744 >
1744 >
1745 > .. container:: verbose
1745 > .. container:: verbose
1746 >
1746 >
1747 > This paragraph is omitted,
1747 > This paragraph is omitted,
1748 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1748 > if :hg:\`help\` is invoked without \`\`-v\`\` (for topic)
1749 >
1749 >
1750 > This paragraph is never omitted, too (for topic)
1750 > This paragraph is never omitted, too (for topic)
1751 > """
1751 > """
1752 > def extsetup(ui):
1752 > def extsetup(ui):
1753 > help.helptable.append(([b"topic-containing-verbose"],
1753 > help.helptable.append(([b"topic-containing-verbose"],
1754 > b"This is the topic to test omit indicating.",
1754 > b"This is the topic to test omit indicating.",
1755 > lambda ui: testtopic))
1755 > lambda ui: testtopic))
1756 > EOF
1756 > EOF
1757 $ echo '[extensions]' >> $HGRCPATH
1757 $ echo '[extensions]' >> $HGRCPATH
1758 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1758 $ echo "addverboseitems = `pwd`/addverboseitems.py" >> $HGRCPATH
1759 $ hg help addverboseitems
1759 $ hg help addverboseitems
1760 addverboseitems extension - extension to test omit indicating.
1760 addverboseitems extension - extension to test omit indicating.
1761
1761
1762 This paragraph is never omitted (for extension)
1762 This paragraph is never omitted (for extension)
1763
1763
1764 This paragraph is never omitted, too (for extension)
1764 This paragraph is never omitted, too (for extension)
1765
1765
1766 (some details hidden, use --verbose to show complete help)
1766 (some details hidden, use --verbose to show complete help)
1767
1767
1768 no commands defined
1768 no commands defined
1769 $ hg help -v addverboseitems
1769 $ hg help -v addverboseitems
1770 addverboseitems extension - extension to test omit indicating.
1770 addverboseitems extension - extension to test omit indicating.
1771
1771
1772 This paragraph is never omitted (for extension)
1772 This paragraph is never omitted (for extension)
1773
1773
1774 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1774 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1775 extension)
1775 extension)
1776
1776
1777 This paragraph is never omitted, too (for extension)
1777 This paragraph is never omitted, too (for extension)
1778
1778
1779 no commands defined
1779 no commands defined
1780 $ hg help topic-containing-verbose
1780 $ hg help topic-containing-verbose
1781 This is the topic to test omit indicating.
1781 This is the topic to test omit indicating.
1782 """"""""""""""""""""""""""""""""""""""""""
1782 """"""""""""""""""""""""""""""""""""""""""
1783
1783
1784 This paragraph is never omitted (for topic).
1784 This paragraph is never omitted (for topic).
1785
1785
1786 This paragraph is never omitted, too (for topic)
1786 This paragraph is never omitted, too (for topic)
1787
1787
1788 (some details hidden, use --verbose to show complete help)
1788 (some details hidden, use --verbose to show complete help)
1789 $ hg help -v topic-containing-verbose
1789 $ hg help -v topic-containing-verbose
1790 This is the topic to test omit indicating.
1790 This is the topic to test omit indicating.
1791 """"""""""""""""""""""""""""""""""""""""""
1791 """"""""""""""""""""""""""""""""""""""""""
1792
1792
1793 This paragraph is never omitted (for topic).
1793 This paragraph is never omitted (for topic).
1794
1794
1795 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1795 This paragraph is omitted, if 'hg help' is invoked without "-v" (for
1796 topic)
1796 topic)
1797
1797
1798 This paragraph is never omitted, too (for topic)
1798 This paragraph is never omitted, too (for topic)
1799
1799
1800 Test section lookup
1800 Test section lookup
1801
1801
1802 $ hg help revset.merge
1802 $ hg help revset.merge
1803 "merge()"
1803 "merge()"
1804 Changeset is a merge changeset.
1804 Changeset is a merge changeset.
1805
1805
1806 $ hg help glossary.dag
1806 $ hg help glossary.dag
1807 DAG
1807 DAG
1808 The repository of changesets of a distributed version control system
1808 The repository of changesets of a distributed version control system
1809 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1809 (DVCS) can be described as a directed acyclic graph (DAG), consisting
1810 of nodes and edges, where nodes correspond to changesets and edges
1810 of nodes and edges, where nodes correspond to changesets and edges
1811 imply a parent -> child relation. This graph can be visualized by
1811 imply a parent -> child relation. This graph can be visualized by
1812 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1812 graphical tools such as 'hg log --graph'. In Mercurial, the DAG is
1813 limited by the requirement for children to have at most two parents.
1813 limited by the requirement for children to have at most two parents.
1814
1814
1815
1815
1816 $ hg help hgrc.paths
1816 $ hg help hgrc.paths
1817 "paths"
1817 "paths"
1818 -------
1818 -------
1819
1819
1820 Assigns symbolic names and behavior to repositories.
1820 Assigns symbolic names and behavior to repositories.
1821
1821
1822 Options are symbolic names defining the URL or directory that is the
1822 Options are symbolic names defining the URL or directory that is the
1823 location of the repository. Example:
1823 location of the repository. Example:
1824
1824
1825 [paths]
1825 [paths]
1826 my_server = https://example.com/my_repo
1826 my_server = https://example.com/my_repo
1827 local_path = /home/me/repo
1827 local_path = /home/me/repo
1828
1828
1829 These symbolic names can be used from the command line. To pull from
1829 These symbolic names can be used from the command line. To pull from
1830 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1830 "my_server": 'hg pull my_server'. To push to "local_path": 'hg push
1831 local_path'.
1831 local_path'.
1832
1832
1833 Options containing colons (":") denote sub-options that can influence
1833 Options containing colons (":") denote sub-options that can influence
1834 behavior for that specific path. Example:
1834 behavior for that specific path. Example:
1835
1835
1836 [paths]
1836 [paths]
1837 my_server = https://example.com/my_path
1837 my_server = https://example.com/my_path
1838 my_server:pushurl = ssh://example.com/my_path
1838 my_server:pushurl = ssh://example.com/my_path
1839
1839
1840 The following sub-options can be defined:
1840 The following sub-options can be defined:
1841
1841
1842 "pushurl"
1842 "pushurl"
1843 The URL to use for push operations. If not defined, the location
1843 The URL to use for push operations. If not defined, the location
1844 defined by the path's main entry is used.
1844 defined by the path's main entry is used.
1845
1845
1846 "pushrev"
1846 "pushrev"
1847 A revset defining which revisions to push by default.
1847 A revset defining which revisions to push by default.
1848
1848
1849 When 'hg push' is executed without a "-r" argument, the revset defined
1849 When 'hg push' is executed without a "-r" argument, the revset defined
1850 by this sub-option is evaluated to determine what to push.
1850 by this sub-option is evaluated to determine what to push.
1851
1851
1852 For example, a value of "." will push the working directory's revision
1852 For example, a value of "." will push the working directory's revision
1853 by default.
1853 by default.
1854
1854
1855 Revsets specifying bookmarks will not result in the bookmark being
1855 Revsets specifying bookmarks will not result in the bookmark being
1856 pushed.
1856 pushed.
1857
1857
1858 The following special named paths exist:
1858 The following special named paths exist:
1859
1859
1860 "default"
1860 "default"
1861 The URL or directory to use when no source or remote is specified.
1861 The URL or directory to use when no source or remote is specified.
1862
1862
1863 'hg clone' will automatically define this path to the location the
1863 'hg clone' will automatically define this path to the location the
1864 repository was cloned from.
1864 repository was cloned from.
1865
1865
1866 "default-push"
1866 "default-push"
1867 (deprecated) The URL or directory for the default 'hg push' location.
1867 (deprecated) The URL or directory for the default 'hg push' location.
1868 "default:pushurl" should be used instead.
1868 "default:pushurl" should be used instead.
1869
1869
1870 $ hg help glossary.mcguffin
1870 $ hg help glossary.mcguffin
1871 abort: help section not found: glossary.mcguffin
1871 abort: help section not found: glossary.mcguffin
1872 [10]
1872 [10]
1873
1873
1874 $ hg help glossary.mc.guffin
1874 $ hg help glossary.mc.guffin
1875 abort: help section not found: glossary.mc.guffin
1875 abort: help section not found: glossary.mc.guffin
1876 [10]
1876 [10]
1877
1877
1878 $ hg help template.files
1878 $ hg help template.files
1879 files List of strings. All files modified, added, or removed by
1879 files List of strings. All files modified, added, or removed by
1880 this changeset.
1880 this changeset.
1881 files(pattern)
1881 files(pattern)
1882 All files of the current changeset matching the pattern. See
1882 All files of the current changeset matching the pattern. See
1883 'hg help patterns'.
1883 'hg help patterns'.
1884
1884
1885 Test section lookup by translated message
1885 Test section lookup by translated message
1886
1886
1887 str.lower() instead of encoding.lower(str) on translated message might
1887 str.lower() instead of encoding.lower(str) on translated message might
1888 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1888 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
1889 as the second or later byte of multi-byte character.
1889 as the second or later byte of multi-byte character.
1890
1890
1891 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1891 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
1892 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1892 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
1893 replacement makes message meaningless.
1893 replacement makes message meaningless.
1894
1894
1895 This tests that section lookup by translated string isn't broken by
1895 This tests that section lookup by translated string isn't broken by
1896 such str.lower().
1896 such str.lower().
1897
1897
1898 $ "$PYTHON" <<EOF
1898 $ "$PYTHON" <<EOF
1899 > def escape(s):
1899 > def escape(s):
1900 > return b''.join(b'\\u%x' % ord(uc) for uc in s.decode('cp932'))
1900 > return b''.join(b'\\u%x' % ord(uc) for uc in s.decode('cp932'))
1901 > # translation of "record" in ja_JP.cp932
1901 > # translation of "record" in ja_JP.cp932
1902 > upper = b"\x8bL\x98^"
1902 > upper = b"\x8bL\x98^"
1903 > # str.lower()-ed section name should be treated as different one
1903 > # str.lower()-ed section name should be treated as different one
1904 > lower = b"\x8bl\x98^"
1904 > lower = b"\x8bl\x98^"
1905 > with open('ambiguous.py', 'wb') as fp:
1905 > with open('ambiguous.py', 'wb') as fp:
1906 > fp.write(b"""# ambiguous section names in ja_JP.cp932
1906 > fp.write(b"""# ambiguous section names in ja_JP.cp932
1907 > u'''summary of extension
1907 > u'''summary of extension
1908 >
1908 >
1909 > %s
1909 > %s
1910 > ----
1910 > ----
1911 >
1911 >
1912 > Upper name should show only this message
1912 > Upper name should show only this message
1913 >
1913 >
1914 > %s
1914 > %s
1915 > ----
1915 > ----
1916 >
1916 >
1917 > Lower name should show only this message
1917 > Lower name should show only this message
1918 >
1918 >
1919 > subsequent section
1919 > subsequent section
1920 > ------------------
1920 > ------------------
1921 >
1921 >
1922 > This should be hidden at 'hg help ambiguous' with section name.
1922 > This should be hidden at 'hg help ambiguous' with section name.
1923 > '''
1923 > '''
1924 > """ % (escape(upper), escape(lower)))
1924 > """ % (escape(upper), escape(lower)))
1925 > EOF
1925 > EOF
1926
1926
1927 $ cat >> $HGRCPATH <<EOF
1927 $ cat >> $HGRCPATH <<EOF
1928 > [extensions]
1928 > [extensions]
1929 > ambiguous = ./ambiguous.py
1929 > ambiguous = ./ambiguous.py
1930 > EOF
1930 > EOF
1931
1931
1932 $ "$PYTHON" <<EOF | sh
1932 $ "$PYTHON" <<EOF | sh
1933 > from mercurial.utils import procutil
1933 > from mercurial.utils import procutil
1934 > upper = b"\x8bL\x98^"
1934 > upper = b"\x8bL\x98^"
1935 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % upper)
1935 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % upper)
1936 > EOF
1936 > EOF
1937 \x8bL\x98^ (esc)
1937 \x8bL\x98^ (esc)
1938 ----
1938 ----
1939
1939
1940 Upper name should show only this message
1940 Upper name should show only this message
1941
1941
1942
1942
1943 $ "$PYTHON" <<EOF | sh
1943 $ "$PYTHON" <<EOF | sh
1944 > from mercurial.utils import procutil
1944 > from mercurial.utils import procutil
1945 > lower = b"\x8bl\x98^"
1945 > lower = b"\x8bl\x98^"
1946 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % lower)
1946 > procutil.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % lower)
1947 > EOF
1947 > EOF
1948 \x8bl\x98^ (esc)
1948 \x8bl\x98^ (esc)
1949 ----
1949 ----
1950
1950
1951 Lower name should show only this message
1951 Lower name should show only this message
1952
1952
1953
1953
1954 $ cat >> $HGRCPATH <<EOF
1954 $ cat >> $HGRCPATH <<EOF
1955 > [extensions]
1955 > [extensions]
1956 > ambiguous = !
1956 > ambiguous = !
1957 > EOF
1957 > EOF
1958
1958
1959 Show help content of disabled extensions
1959 Show help content of disabled extensions
1960
1960
1961 $ cat >> $HGRCPATH <<EOF
1961 $ cat >> $HGRCPATH <<EOF
1962 > [extensions]
1962 > [extensions]
1963 > ambiguous = !./ambiguous.py
1963 > ambiguous = !./ambiguous.py
1964 > EOF
1964 > EOF
1965 $ hg help -e ambiguous
1965 $ hg help -e ambiguous
1966 ambiguous extension - (no help text available)
1966 ambiguous extension - (no help text available)
1967
1967
1968 (use 'hg help extensions' for information on enabling extensions)
1968 (use 'hg help extensions' for information on enabling extensions)
1969
1969
1970 Test dynamic list of merge tools only shows up once
1970 Test dynamic list of merge tools only shows up once
1971 $ hg help merge-tools
1971 $ hg help merge-tools
1972 Merge Tools
1972 Merge Tools
1973 """""""""""
1973 """""""""""
1974
1974
1975 To merge files Mercurial uses merge tools.
1975 To merge files Mercurial uses merge tools.
1976
1976
1977 A merge tool combines two different versions of a file into a merged file.
1977 A merge tool combines two different versions of a file into a merged file.
1978 Merge tools are given the two files and the greatest common ancestor of
1978 Merge tools are given the two files and the greatest common ancestor of
1979 the two file versions, so they can determine the changes made on both
1979 the two file versions, so they can determine the changes made on both
1980 branches.
1980 branches.
1981
1981
1982 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1982 Merge tools are used both for 'hg resolve', 'hg merge', 'hg update', 'hg
1983 backout' and in several extensions.
1983 backout' and in several extensions.
1984
1984
1985 Usually, the merge tool tries to automatically reconcile the files by
1985 Usually, the merge tool tries to automatically reconcile the files by
1986 combining all non-overlapping changes that occurred separately in the two
1986 combining all non-overlapping changes that occurred separately in the two
1987 different evolutions of the same initial base file. Furthermore, some
1987 different evolutions of the same initial base file. Furthermore, some
1988 interactive merge programs make it easier to manually resolve conflicting
1988 interactive merge programs make it easier to manually resolve conflicting
1989 merges, either in a graphical way, or by inserting some conflict markers.
1989 merges, either in a graphical way, or by inserting some conflict markers.
1990 Mercurial does not include any interactive merge programs but relies on
1990 Mercurial does not include any interactive merge programs but relies on
1991 external tools for that.
1991 external tools for that.
1992
1992
1993 Available merge tools
1993 Available merge tools
1994 =====================
1994 =====================
1995
1995
1996 External merge tools and their properties are configured in the merge-
1996 External merge tools and their properties are configured in the merge-
1997 tools configuration section - see hgrc(5) - but they can often just be
1997 tools configuration section - see hgrc(5) - but they can often just be
1998 named by their executable.
1998 named by their executable.
1999
1999
2000 A merge tool is generally usable if its executable can be found on the
2000 A merge tool is generally usable if its executable can be found on the
2001 system and if it can handle the merge. The executable is found if it is an
2001 system and if it can handle the merge. The executable is found if it is an
2002 absolute or relative executable path or the name of an application in the
2002 absolute or relative executable path or the name of an application in the
2003 executable search path. The tool is assumed to be able to handle the merge
2003 executable search path. The tool is assumed to be able to handle the merge
2004 if it can handle symlinks if the file is a symlink, if it can handle
2004 if it can handle symlinks if the file is a symlink, if it can handle
2005 binary files if the file is binary, and if a GUI is available if the tool
2005 binary files if the file is binary, and if a GUI is available if the tool
2006 requires a GUI.
2006 requires a GUI.
2007
2007
2008 There are some internal merge tools which can be used. The internal merge
2008 There are some internal merge tools which can be used. The internal merge
2009 tools are:
2009 tools are:
2010
2010
2011 ":dump"
2011 ":dump"
2012 Creates three versions of the files to merge, containing the contents of
2012 Creates three versions of the files to merge, containing the contents of
2013 local, other and base. These files can then be used to perform a merge
2013 local, other and base. These files can then be used to perform a merge
2014 manually. If the file to be merged is named "a.txt", these files will
2014 manually. If the file to be merged is named "a.txt", these files will
2015 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
2015 accordingly be named "a.txt.local", "a.txt.other" and "a.txt.base" and
2016 they will be placed in the same directory as "a.txt".
2016 they will be placed in the same directory as "a.txt".
2017
2017
2018 This implies premerge. Therefore, files aren't dumped, if premerge runs
2018 This implies premerge. Therefore, files aren't dumped, if premerge runs
2019 successfully. Use :forcedump to forcibly write files out.
2019 successfully. Use :forcedump to forcibly write files out.
2020
2020
2021 (actual capabilities: binary, symlink)
2021 (actual capabilities: binary, symlink)
2022
2022
2023 ":fail"
2023 ":fail"
2024 Rather than attempting to merge files that were modified on both
2024 Rather than attempting to merge files that were modified on both
2025 branches, it marks them as unresolved. The resolve command must be used
2025 branches, it marks them as unresolved. The resolve command must be used
2026 to resolve these conflicts.
2026 to resolve these conflicts.
2027
2027
2028 (actual capabilities: binary, symlink)
2028 (actual capabilities: binary, symlink)
2029
2029
2030 ":forcedump"
2030 ":forcedump"
2031 Creates three versions of the files as same as :dump, but omits
2031 Creates three versions of the files as same as :dump, but omits
2032 premerge.
2032 premerge.
2033
2033
2034 (actual capabilities: binary, symlink)
2034 (actual capabilities: binary, symlink)
2035
2035
2036 ":local"
2036 ":local"
2037 Uses the local 'p1()' version of files as the merged version.
2037 Uses the local 'p1()' version of files as the merged version.
2038
2038
2039 (actual capabilities: binary, symlink)
2039 (actual capabilities: binary, symlink)
2040
2040
2041 ":merge"
2041 ":merge"
2042 Uses the internal non-interactive simple merge algorithm for merging
2042 Uses the internal non-interactive simple merge algorithm for merging
2043 files. It will fail if there are any conflicts and leave markers in the
2043 files. It will fail if there are any conflicts and leave markers in the
2044 partially merged file. Markers will have two sections, one for each side
2044 partially merged file. Markers will have two sections, one for each side
2045 of merge.
2045 of merge.
2046
2046
2047 ":merge-local"
2047 ":merge-local"
2048 Like :merge, but resolve all conflicts non-interactively in favor of the
2048 Like :merge, but resolve all conflicts non-interactively in favor of the
2049 local 'p1()' changes.
2049 local 'p1()' changes.
2050
2050
2051 ":merge-other"
2051 ":merge-other"
2052 Like :merge, but resolve all conflicts non-interactively in favor of the
2052 Like :merge, but resolve all conflicts non-interactively in favor of the
2053 other 'p2()' changes.
2053 other 'p2()' changes.
2054
2054
2055 ":merge3"
2055 ":merge3"
2056 Uses the internal non-interactive simple merge algorithm for merging
2056 Uses the internal non-interactive simple merge algorithm for merging
2057 files. It will fail if there are any conflicts and leave markers in the
2057 files. It will fail if there are any conflicts and leave markers in the
2058 partially merged file. Marker will have three sections, one from each
2058 partially merged file. Marker will have three sections, one from each
2059 side of the merge and one for the base content.
2059 side of the merge and one for the base content.
2060
2060
2061 ":mergediff"
2061 ":mergediff"
2062 Uses the internal non-interactive simple merge algorithm for merging
2062 Uses the internal non-interactive simple merge algorithm for merging
2063 files. It will fail if there are any conflicts and leave markers in the
2063 files. It will fail if there are any conflicts and leave markers in the
2064 partially merged file. The marker will have two sections, one with the
2064 partially merged file. The marker will have two sections, one with the
2065 content from one side of the merge, and one with a diff from the base
2065 content from one side of the merge, and one with a diff from the base
2066 content to the content on the other side. (experimental)
2066 content to the content on the other side. (experimental)
2067
2067
2068 ":other"
2068 ":other"
2069 Uses the other 'p2()' version of files as the merged version.
2069 Uses the other 'p2()' version of files as the merged version.
2070
2070
2071 (actual capabilities: binary, symlink)
2071 (actual capabilities: binary, symlink)
2072
2072
2073 ":prompt"
2073 ":prompt"
2074 Asks the user which of the local 'p1()' or the other 'p2()' version to
2074 Asks the user which of the local 'p1()' or the other 'p2()' version to
2075 keep as the merged version.
2075 keep as the merged version.
2076
2076
2077 (actual capabilities: binary, symlink)
2077 (actual capabilities: binary, symlink)
2078
2078
2079 ":tagmerge"
2079 ":tagmerge"
2080 Uses the internal tag merge algorithm (experimental).
2080 Uses the internal tag merge algorithm (experimental).
2081
2081
2082 ":union"
2082 ":union"
2083 Uses the internal non-interactive simple merge algorithm for merging
2083 Uses the internal non-interactive simple merge algorithm for merging
2084 files. It will use both left and right sides for conflict regions. No
2084 files. It will use both left and right sides for conflict regions. No
2085 markers are inserted.
2085 markers are inserted.
2086
2086
2087 Internal tools are always available and do not require a GUI but will by
2087 Internal tools are always available and do not require a GUI but will by
2088 default not handle symlinks or binary files. See next section for detail
2088 default not handle symlinks or binary files. See next section for detail
2089 about "actual capabilities" described above.
2089 about "actual capabilities" described above.
2090
2090
2091 Choosing a merge tool
2091 Choosing a merge tool
2092 =====================
2092 =====================
2093
2093
2094 Mercurial uses these rules when deciding which merge tool to use:
2094 Mercurial uses these rules when deciding which merge tool to use:
2095
2095
2096 1. If a tool has been specified with the --tool option to merge or
2096 1. If a tool has been specified with the --tool option to merge or
2097 resolve, it is used. If it is the name of a tool in the merge-tools
2097 resolve, it is used. If it is the name of a tool in the merge-tools
2098 configuration, its configuration is used. Otherwise the specified tool
2098 configuration, its configuration is used. Otherwise the specified tool
2099 must be executable by the shell.
2099 must be executable by the shell.
2100 2. If the "HGMERGE" environment variable is present, its value is used and
2100 2. If the "HGMERGE" environment variable is present, its value is used and
2101 must be executable by the shell.
2101 must be executable by the shell.
2102 3. If the filename of the file to be merged matches any of the patterns in
2102 3. If the filename of the file to be merged matches any of the patterns in
2103 the merge-patterns configuration section, the first usable merge tool
2103 the merge-patterns configuration section, the first usable merge tool
2104 corresponding to a matching pattern is used.
2104 corresponding to a matching pattern is used.
2105 4. If ui.merge is set it will be considered next. If the value is not the
2105 4. If ui.merge is set it will be considered next. If the value is not the
2106 name of a configured tool, the specified value is used and must be
2106 name of a configured tool, the specified value is used and must be
2107 executable by the shell. Otherwise the named tool is used if it is
2107 executable by the shell. Otherwise the named tool is used if it is
2108 usable.
2108 usable.
2109 5. If any usable merge tools are present in the merge-tools configuration
2109 5. If any usable merge tools are present in the merge-tools configuration
2110 section, the one with the highest priority is used.
2110 section, the one with the highest priority is used.
2111 6. If a program named "hgmerge" can be found on the system, it is used -
2111 6. If a program named "hgmerge" can be found on the system, it is used -
2112 but it will by default not be used for symlinks and binary files.
2112 but it will by default not be used for symlinks and binary files.
2113 7. If the file to be merged is not binary and is not a symlink, then
2113 7. If the file to be merged is not binary and is not a symlink, then
2114 internal ":merge" is used.
2114 internal ":merge" is used.
2115 8. Otherwise, ":prompt" is used.
2115 8. Otherwise, ":prompt" is used.
2116
2116
2117 For historical reason, Mercurial treats merge tools as below while
2117 For historical reason, Mercurial treats merge tools as below while
2118 examining rules above.
2118 examining rules above.
2119
2119
2120 step specified via binary symlink
2120 step specified via binary symlink
2121 ----------------------------------
2121 ----------------------------------
2122 1. --tool o/o o/o
2122 1. --tool o/o o/o
2123 2. HGMERGE o/o o/o
2123 2. HGMERGE o/o o/o
2124 3. merge-patterns o/o(*) x/?(*)
2124 3. merge-patterns o/o(*) x/?(*)
2125 4. ui.merge x/?(*) x/?(*)
2125 4. ui.merge x/?(*) x/?(*)
2126
2126
2127 Each capability column indicates Mercurial behavior for internal/external
2127 Each capability column indicates Mercurial behavior for internal/external
2128 merge tools at examining each rule.
2128 merge tools at examining each rule.
2129
2129
2130 - "o": "assume that a tool has capability"
2130 - "o": "assume that a tool has capability"
2131 - "x": "assume that a tool does not have capability"
2131 - "x": "assume that a tool does not have capability"
2132 - "?": "check actual capability of a tool"
2132 - "?": "check actual capability of a tool"
2133
2133
2134 If "merge.strict-capability-check" configuration is true, Mercurial checks
2134 If "merge.strict-capability-check" configuration is true, Mercurial checks
2135 capabilities of merge tools strictly in (*) cases above (= each capability
2135 capabilities of merge tools strictly in (*) cases above (= each capability
2136 column becomes "?/?"). It is false by default for backward compatibility.
2136 column becomes "?/?"). It is false by default for backward compatibility.
2137
2137
2138 Note:
2138 Note:
2139 After selecting a merge program, Mercurial will by default attempt to
2139 After selecting a merge program, Mercurial will by default attempt to
2140 merge the files using a simple merge algorithm first. Only if it
2140 merge the files using a simple merge algorithm first. Only if it
2141 doesn't succeed because of conflicting changes will Mercurial actually
2141 doesn't succeed because of conflicting changes will Mercurial actually
2142 execute the merge program. Whether to use the simple merge algorithm
2142 execute the merge program. Whether to use the simple merge algorithm
2143 first can be controlled by the premerge setting of the merge tool.
2143 first can be controlled by the premerge setting of the merge tool.
2144 Premerge is enabled by default unless the file is binary or a symlink.
2144 Premerge is enabled by default unless the file is binary or a symlink.
2145
2145
2146 See the merge-tools and ui sections of hgrc(5) for details on the
2146 See the merge-tools and ui sections of hgrc(5) for details on the
2147 configuration of merge tools.
2147 configuration of merge tools.
2148
2148
2149 Compression engines listed in `hg help bundlespec`
2149 Compression engines listed in `hg help bundlespec`
2150
2150
2151 $ hg help bundlespec | grep gzip
2151 $ hg help bundlespec | grep gzip
2152 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
2152 "v1" bundles can only use the "gzip", "bzip2", and "none" compression
2153 An algorithm that produces smaller bundles than "gzip".
2153 An algorithm that produces smaller bundles than "gzip".
2154 This engine will likely produce smaller bundles than "gzip" but will be
2154 This engine will likely produce smaller bundles than "gzip" but will be
2155 "gzip"
2155 "gzip"
2156 better compression than "gzip". It also frequently yields better (?)
2156 better compression than "gzip". It also frequently yields better (?)
2157
2157
2158 Test usage of section marks in help documents
2158 Test usage of section marks in help documents
2159
2159
2160 $ cd "$TESTDIR"/../doc
2160 $ cd "$TESTDIR"/../doc
2161 $ "$PYTHON" check-seclevel.py
2161 $ "$PYTHON" check-seclevel.py
2162 $ cd $TESTTMP
2162 $ cd $TESTTMP
2163
2163
2164 #if serve
2164 #if serve
2165
2165
2166 Test the help pages in hgweb.
2166 Test the help pages in hgweb.
2167
2167
2168 Dish up an empty repo; serve it cold.
2168 Dish up an empty repo; serve it cold.
2169
2169
2170 $ hg init "$TESTTMP/test"
2170 $ hg init "$TESTTMP/test"
2171 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
2171 $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
2172 $ cat hg.pid >> $DAEMON_PIDS
2172 $ cat hg.pid >> $DAEMON_PIDS
2173
2173
2174 $ get-with-headers.py $LOCALIP:$HGPORT "help"
2174 $ get-with-headers.py $LOCALIP:$HGPORT "help"
2175 200 Script output follows
2175 200 Script output follows
2176
2176
2177 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2177 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2178 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2178 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2179 <head>
2179 <head>
2180 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2180 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2181 <meta name="robots" content="index, nofollow" />
2181 <meta name="robots" content="index, nofollow" />
2182 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2182 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2183 <script type="text/javascript" src="/static/mercurial.js"></script>
2183 <script type="text/javascript" src="/static/mercurial.js"></script>
2184
2184
2185 <title>Help: Index</title>
2185 <title>Help: Index</title>
2186 </head>
2186 </head>
2187 <body>
2187 <body>
2188
2188
2189 <div class="container">
2189 <div class="container">
2190 <div class="menu">
2190 <div class="menu">
2191 <div class="logo">
2191 <div class="logo">
2192 <a href="https://mercurial-scm.org/">
2192 <a href="https://mercurial-scm.org/">
2193 <img src="/static/hglogo.png" alt="mercurial" /></a>
2193 <img src="/static/hglogo.png" alt="mercurial" /></a>
2194 </div>
2194 </div>
2195 <ul>
2195 <ul>
2196 <li><a href="/shortlog">log</a></li>
2196 <li><a href="/shortlog">log</a></li>
2197 <li><a href="/graph">graph</a></li>
2197 <li><a href="/graph">graph</a></li>
2198 <li><a href="/tags">tags</a></li>
2198 <li><a href="/tags">tags</a></li>
2199 <li><a href="/bookmarks">bookmarks</a></li>
2199 <li><a href="/bookmarks">bookmarks</a></li>
2200 <li><a href="/branches">branches</a></li>
2200 <li><a href="/branches">branches</a></li>
2201 </ul>
2201 </ul>
2202 <ul>
2202 <ul>
2203 <li class="active">help</li>
2203 <li class="active">help</li>
2204 </ul>
2204 </ul>
2205 </div>
2205 </div>
2206
2206
2207 <div class="main">
2207 <div class="main">
2208 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2208 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2209
2209
2210 <form class="search" action="/log">
2210 <form class="search" action="/log">
2211
2211
2212 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2212 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2213 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2213 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2214 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2214 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2215 </form>
2215 </form>
2216 <table class="bigtable">
2216 <table class="bigtable">
2217 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2217 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
2218
2218
2219 <tr><td>
2219 <tr><td>
2220 <a href="/help/bundlespec">
2220 <a href="/help/bundlespec">
2221 bundlespec
2221 bundlespec
2222 </a>
2222 </a>
2223 </td><td>
2223 </td><td>
2224 Bundle File Formats
2224 Bundle File Formats
2225 </td></tr>
2225 </td></tr>
2226 <tr><td>
2226 <tr><td>
2227 <a href="/help/color">
2227 <a href="/help/color">
2228 color
2228 color
2229 </a>
2229 </a>
2230 </td><td>
2230 </td><td>
2231 Colorizing Outputs
2231 Colorizing Outputs
2232 </td></tr>
2232 </td></tr>
2233 <tr><td>
2233 <tr><td>
2234 <a href="/help/config">
2234 <a href="/help/config">
2235 config
2235 config
2236 </a>
2236 </a>
2237 </td><td>
2237 </td><td>
2238 Configuration Files
2238 Configuration Files
2239 </td></tr>
2239 </td></tr>
2240 <tr><td>
2240 <tr><td>
2241 <a href="/help/dates">
2241 <a href="/help/dates">
2242 dates
2242 dates
2243 </a>
2243 </a>
2244 </td><td>
2244 </td><td>
2245 Date Formats
2245 Date Formats
2246 </td></tr>
2246 </td></tr>
2247 <tr><td>
2247 <tr><td>
2248 <a href="/help/deprecated">
2248 <a href="/help/deprecated">
2249 deprecated
2249 deprecated
2250 </a>
2250 </a>
2251 </td><td>
2251 </td><td>
2252 Deprecated Features
2252 Deprecated Features
2253 </td></tr>
2253 </td></tr>
2254 <tr><td>
2254 <tr><td>
2255 <a href="/help/diffs">
2255 <a href="/help/diffs">
2256 diffs
2256 diffs
2257 </a>
2257 </a>
2258 </td><td>
2258 </td><td>
2259 Diff Formats
2259 Diff Formats
2260 </td></tr>
2260 </td></tr>
2261 <tr><td>
2261 <tr><td>
2262 <a href="/help/environment">
2262 <a href="/help/environment">
2263 environment
2263 environment
2264 </a>
2264 </a>
2265 </td><td>
2265 </td><td>
2266 Environment Variables
2266 Environment Variables
2267 </td></tr>
2267 </td></tr>
2268 <tr><td>
2268 <tr><td>
2269 <a href="/help/extensions">
2269 <a href="/help/extensions">
2270 extensions
2270 extensions
2271 </a>
2271 </a>
2272 </td><td>
2272 </td><td>
2273 Using Additional Features
2273 Using Additional Features
2274 </td></tr>
2274 </td></tr>
2275 <tr><td>
2275 <tr><td>
2276 <a href="/help/filesets">
2276 <a href="/help/filesets">
2277 filesets
2277 filesets
2278 </a>
2278 </a>
2279 </td><td>
2279 </td><td>
2280 Specifying File Sets
2280 Specifying File Sets
2281 </td></tr>
2281 </td></tr>
2282 <tr><td>
2282 <tr><td>
2283 <a href="/help/flags">
2283 <a href="/help/flags">
2284 flags
2284 flags
2285 </a>
2285 </a>
2286 </td><td>
2286 </td><td>
2287 Command-line flags
2287 Command-line flags
2288 </td></tr>
2288 </td></tr>
2289 <tr><td>
2289 <tr><td>
2290 <a href="/help/glossary">
2290 <a href="/help/glossary">
2291 glossary
2291 glossary
2292 </a>
2292 </a>
2293 </td><td>
2293 </td><td>
2294 Glossary
2294 Glossary
2295 </td></tr>
2295 </td></tr>
2296 <tr><td>
2296 <tr><td>
2297 <a href="/help/hgignore">
2297 <a href="/help/hgignore">
2298 hgignore
2298 hgignore
2299 </a>
2299 </a>
2300 </td><td>
2300 </td><td>
2301 Syntax for Mercurial Ignore Files
2301 Syntax for Mercurial Ignore Files
2302 </td></tr>
2302 </td></tr>
2303 <tr><td>
2303 <tr><td>
2304 <a href="/help/hgweb">
2304 <a href="/help/hgweb">
2305 hgweb
2305 hgweb
2306 </a>
2306 </a>
2307 </td><td>
2307 </td><td>
2308 Configuring hgweb
2308 Configuring hgweb
2309 </td></tr>
2309 </td></tr>
2310 <tr><td>
2310 <tr><td>
2311 <a href="/help/internals">
2311 <a href="/help/internals">
2312 internals
2312 internals
2313 </a>
2313 </a>
2314 </td><td>
2314 </td><td>
2315 Technical implementation topics
2315 Technical implementation topics
2316 </td></tr>
2316 </td></tr>
2317 <tr><td>
2317 <tr><td>
2318 <a href="/help/merge-tools">
2318 <a href="/help/merge-tools">
2319 merge-tools
2319 merge-tools
2320 </a>
2320 </a>
2321 </td><td>
2321 </td><td>
2322 Merge Tools
2322 Merge Tools
2323 </td></tr>
2323 </td></tr>
2324 <tr><td>
2324 <tr><td>
2325 <a href="/help/pager">
2325 <a href="/help/pager">
2326 pager
2326 pager
2327 </a>
2327 </a>
2328 </td><td>
2328 </td><td>
2329 Pager Support
2329 Pager Support
2330 </td></tr>
2330 </td></tr>
2331 <tr><td>
2331 <tr><td>
2332 <a href="/help/patterns">
2332 <a href="/help/patterns">
2333 patterns
2333 patterns
2334 </a>
2334 </a>
2335 </td><td>
2335 </td><td>
2336 File Name Patterns
2336 File Name Patterns
2337 </td></tr>
2337 </td></tr>
2338 <tr><td>
2338 <tr><td>
2339 <a href="/help/phases">
2339 <a href="/help/phases">
2340 phases
2340 phases
2341 </a>
2341 </a>
2342 </td><td>
2342 </td><td>
2343 Working with Phases
2343 Working with Phases
2344 </td></tr>
2344 </td></tr>
2345 <tr><td>
2345 <tr><td>
2346 <a href="/help/revisions">
2346 <a href="/help/revisions">
2347 revisions
2347 revisions
2348 </a>
2348 </a>
2349 </td><td>
2349 </td><td>
2350 Specifying Revisions
2350 Specifying Revisions
2351 </td></tr>
2351 </td></tr>
2352 <tr><td>
2352 <tr><td>
2353 <a href="/help/scripting">
2353 <a href="/help/scripting">
2354 scripting
2354 scripting
2355 </a>
2355 </a>
2356 </td><td>
2356 </td><td>
2357 Using Mercurial from scripts and automation
2357 Using Mercurial from scripts and automation
2358 </td></tr>
2358 </td></tr>
2359 <tr><td>
2359 <tr><td>
2360 <a href="/help/subrepos">
2360 <a href="/help/subrepos">
2361 subrepos
2361 subrepos
2362 </a>
2362 </a>
2363 </td><td>
2363 </td><td>
2364 Subrepositories
2364 Subrepositories
2365 </td></tr>
2365 </td></tr>
2366 <tr><td>
2366 <tr><td>
2367 <a href="/help/templating">
2367 <a href="/help/templating">
2368 templating
2368 templating
2369 </a>
2369 </a>
2370 </td><td>
2370 </td><td>
2371 Template Usage
2371 Template Usage
2372 </td></tr>
2372 </td></tr>
2373 <tr><td>
2373 <tr><td>
2374 <a href="/help/urls">
2374 <a href="/help/urls">
2375 urls
2375 urls
2376 </a>
2376 </a>
2377 </td><td>
2377 </td><td>
2378 URL Paths
2378 URL Paths
2379 </td></tr>
2379 </td></tr>
2380 <tr><td>
2380 <tr><td>
2381 <a href="/help/topic-containing-verbose">
2381 <a href="/help/topic-containing-verbose">
2382 topic-containing-verbose
2382 topic-containing-verbose
2383 </a>
2383 </a>
2384 </td><td>
2384 </td><td>
2385 This is the topic to test omit indicating.
2385 This is the topic to test omit indicating.
2386 </td></tr>
2386 </td></tr>
2387
2387
2388
2388
2389 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2389 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
2390
2390
2391 <tr><td>
2391 <tr><td>
2392 <a href="/help/abort">
2392 <a href="/help/abort">
2393 abort
2393 abort
2394 </a>
2394 </a>
2395 </td><td>
2395 </td><td>
2396 abort an unfinished operation (EXPERIMENTAL)
2396 abort an unfinished operation (EXPERIMENTAL)
2397 </td></tr>
2397 </td></tr>
2398 <tr><td>
2398 <tr><td>
2399 <a href="/help/add">
2399 <a href="/help/add">
2400 add
2400 add
2401 </a>
2401 </a>
2402 </td><td>
2402 </td><td>
2403 add the specified files on the next commit
2403 add the specified files on the next commit
2404 </td></tr>
2404 </td></tr>
2405 <tr><td>
2405 <tr><td>
2406 <a href="/help/annotate">
2406 <a href="/help/annotate">
2407 annotate
2407 annotate
2408 </a>
2408 </a>
2409 </td><td>
2409 </td><td>
2410 show changeset information by line for each file
2410 show changeset information by line for each file
2411 </td></tr>
2411 </td></tr>
2412 <tr><td>
2412 <tr><td>
2413 <a href="/help/clone">
2413 <a href="/help/clone">
2414 clone
2414 clone
2415 </a>
2415 </a>
2416 </td><td>
2416 </td><td>
2417 make a copy of an existing repository
2417 make a copy of an existing repository
2418 </td></tr>
2418 </td></tr>
2419 <tr><td>
2419 <tr><td>
2420 <a href="/help/commit">
2420 <a href="/help/commit">
2421 commit
2421 commit
2422 </a>
2422 </a>
2423 </td><td>
2423 </td><td>
2424 commit the specified files or all outstanding changes
2424 commit the specified files or all outstanding changes
2425 </td></tr>
2425 </td></tr>
2426 <tr><td>
2426 <tr><td>
2427 <a href="/help/continue">
2427 <a href="/help/continue">
2428 continue
2428 continue
2429 </a>
2429 </a>
2430 </td><td>
2430 </td><td>
2431 resumes an interrupted operation (EXPERIMENTAL)
2431 resumes an interrupted operation (EXPERIMENTAL)
2432 </td></tr>
2432 </td></tr>
2433 <tr><td>
2433 <tr><td>
2434 <a href="/help/diff">
2434 <a href="/help/diff">
2435 diff
2435 diff
2436 </a>
2436 </a>
2437 </td><td>
2437 </td><td>
2438 diff repository (or selected files)
2438 diff repository (or selected files)
2439 </td></tr>
2439 </td></tr>
2440 <tr><td>
2440 <tr><td>
2441 <a href="/help/export">
2441 <a href="/help/export">
2442 export
2442 export
2443 </a>
2443 </a>
2444 </td><td>
2444 </td><td>
2445 dump the header and diffs for one or more changesets
2445 dump the header and diffs for one or more changesets
2446 </td></tr>
2446 </td></tr>
2447 <tr><td>
2447 <tr><td>
2448 <a href="/help/forget">
2448 <a href="/help/forget">
2449 forget
2449 forget
2450 </a>
2450 </a>
2451 </td><td>
2451 </td><td>
2452 forget the specified files on the next commit
2452 forget the specified files on the next commit
2453 </td></tr>
2453 </td></tr>
2454 <tr><td>
2454 <tr><td>
2455 <a href="/help/init">
2455 <a href="/help/init">
2456 init
2456 init
2457 </a>
2457 </a>
2458 </td><td>
2458 </td><td>
2459 create a new repository in the given directory
2459 create a new repository in the given directory
2460 </td></tr>
2460 </td></tr>
2461 <tr><td>
2461 <tr><td>
2462 <a href="/help/log">
2462 <a href="/help/log">
2463 log
2463 log
2464 </a>
2464 </a>
2465 </td><td>
2465 </td><td>
2466 show revision history of entire repository or files
2466 show revision history of entire repository or files
2467 </td></tr>
2467 </td></tr>
2468 <tr><td>
2468 <tr><td>
2469 <a href="/help/merge">
2469 <a href="/help/merge">
2470 merge
2470 merge
2471 </a>
2471 </a>
2472 </td><td>
2472 </td><td>
2473 merge another revision into working directory
2473 merge another revision into working directory
2474 </td></tr>
2474 </td></tr>
2475 <tr><td>
2475 <tr><td>
2476 <a href="/help/pull">
2476 <a href="/help/pull">
2477 pull
2477 pull
2478 </a>
2478 </a>
2479 </td><td>
2479 </td><td>
2480 pull changes from the specified source
2480 pull changes from the specified source
2481 </td></tr>
2481 </td></tr>
2482 <tr><td>
2482 <tr><td>
2483 <a href="/help/push">
2483 <a href="/help/push">
2484 push
2484 push
2485 </a>
2485 </a>
2486 </td><td>
2486 </td><td>
2487 push changes to the specified destination
2487 push changes to the specified destination
2488 </td></tr>
2488 </td></tr>
2489 <tr><td>
2489 <tr><td>
2490 <a href="/help/remove">
2490 <a href="/help/remove">
2491 remove
2491 remove
2492 </a>
2492 </a>
2493 </td><td>
2493 </td><td>
2494 remove the specified files on the next commit
2494 remove the specified files on the next commit
2495 </td></tr>
2495 </td></tr>
2496 <tr><td>
2496 <tr><td>
2497 <a href="/help/serve">
2497 <a href="/help/serve">
2498 serve
2498 serve
2499 </a>
2499 </a>
2500 </td><td>
2500 </td><td>
2501 start stand-alone webserver
2501 start stand-alone webserver
2502 </td></tr>
2502 </td></tr>
2503 <tr><td>
2503 <tr><td>
2504 <a href="/help/status">
2504 <a href="/help/status">
2505 status
2505 status
2506 </a>
2506 </a>
2507 </td><td>
2507 </td><td>
2508 show changed files in the working directory
2508 show changed files in the working directory
2509 </td></tr>
2509 </td></tr>
2510 <tr><td>
2510 <tr><td>
2511 <a href="/help/summary">
2511 <a href="/help/summary">
2512 summary
2512 summary
2513 </a>
2513 </a>
2514 </td><td>
2514 </td><td>
2515 summarize working directory state
2515 summarize working directory state
2516 </td></tr>
2516 </td></tr>
2517 <tr><td>
2517 <tr><td>
2518 <a href="/help/update">
2518 <a href="/help/update">
2519 update
2519 update
2520 </a>
2520 </a>
2521 </td><td>
2521 </td><td>
2522 update working directory (or switch revisions)
2522 update working directory (or switch revisions)
2523 </td></tr>
2523 </td></tr>
2524
2524
2525
2525
2526
2526
2527 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2527 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
2528
2528
2529 <tr><td>
2529 <tr><td>
2530 <a href="/help/addremove">
2530 <a href="/help/addremove">
2531 addremove
2531 addremove
2532 </a>
2532 </a>
2533 </td><td>
2533 </td><td>
2534 add all new files, delete all missing files
2534 add all new files, delete all missing files
2535 </td></tr>
2535 </td></tr>
2536 <tr><td>
2536 <tr><td>
2537 <a href="/help/archive">
2537 <a href="/help/archive">
2538 archive
2538 archive
2539 </a>
2539 </a>
2540 </td><td>
2540 </td><td>
2541 create an unversioned archive of a repository revision
2541 create an unversioned archive of a repository revision
2542 </td></tr>
2542 </td></tr>
2543 <tr><td>
2543 <tr><td>
2544 <a href="/help/backout">
2544 <a href="/help/backout">
2545 backout
2545 backout
2546 </a>
2546 </a>
2547 </td><td>
2547 </td><td>
2548 reverse effect of earlier changeset
2548 reverse effect of earlier changeset
2549 </td></tr>
2549 </td></tr>
2550 <tr><td>
2550 <tr><td>
2551 <a href="/help/bisect">
2551 <a href="/help/bisect">
2552 bisect
2552 bisect
2553 </a>
2553 </a>
2554 </td><td>
2554 </td><td>
2555 subdivision search of changesets
2555 subdivision search of changesets
2556 </td></tr>
2556 </td></tr>
2557 <tr><td>
2557 <tr><td>
2558 <a href="/help/bookmarks">
2558 <a href="/help/bookmarks">
2559 bookmarks
2559 bookmarks
2560 </a>
2560 </a>
2561 </td><td>
2561 </td><td>
2562 create a new bookmark or list existing bookmarks
2562 create a new bookmark or list existing bookmarks
2563 </td></tr>
2563 </td></tr>
2564 <tr><td>
2564 <tr><td>
2565 <a href="/help/branch">
2565 <a href="/help/branch">
2566 branch
2566 branch
2567 </a>
2567 </a>
2568 </td><td>
2568 </td><td>
2569 set or show the current branch name
2569 set or show the current branch name
2570 </td></tr>
2570 </td></tr>
2571 <tr><td>
2571 <tr><td>
2572 <a href="/help/branches">
2572 <a href="/help/branches">
2573 branches
2573 branches
2574 </a>
2574 </a>
2575 </td><td>
2575 </td><td>
2576 list repository named branches
2576 list repository named branches
2577 </td></tr>
2577 </td></tr>
2578 <tr><td>
2578 <tr><td>
2579 <a href="/help/bundle">
2579 <a href="/help/bundle">
2580 bundle
2580 bundle
2581 </a>
2581 </a>
2582 </td><td>
2582 </td><td>
2583 create a bundle file
2583 create a bundle file
2584 </td></tr>
2584 </td></tr>
2585 <tr><td>
2585 <tr><td>
2586 <a href="/help/cat">
2586 <a href="/help/cat">
2587 cat
2587 cat
2588 </a>
2588 </a>
2589 </td><td>
2589 </td><td>
2590 output the current or given revision of files
2590 output the current or given revision of files
2591 </td></tr>
2591 </td></tr>
2592 <tr><td>
2592 <tr><td>
2593 <a href="/help/config">
2593 <a href="/help/config">
2594 config
2594 config
2595 </a>
2595 </a>
2596 </td><td>
2596 </td><td>
2597 show combined config settings from all hgrc files
2597 show combined config settings from all hgrc files
2598 </td></tr>
2598 </td></tr>
2599 <tr><td>
2599 <tr><td>
2600 <a href="/help/copy">
2600 <a href="/help/copy">
2601 copy
2601 copy
2602 </a>
2602 </a>
2603 </td><td>
2603 </td><td>
2604 mark files as copied for the next commit
2604 mark files as copied for the next commit
2605 </td></tr>
2605 </td></tr>
2606 <tr><td>
2606 <tr><td>
2607 <a href="/help/files">
2607 <a href="/help/files">
2608 files
2608 files
2609 </a>
2609 </a>
2610 </td><td>
2610 </td><td>
2611 list tracked files
2611 list tracked files
2612 </td></tr>
2612 </td></tr>
2613 <tr><td>
2613 <tr><td>
2614 <a href="/help/graft">
2614 <a href="/help/graft">
2615 graft
2615 graft
2616 </a>
2616 </a>
2617 </td><td>
2617 </td><td>
2618 copy changes from other branches onto the current branch
2618 copy changes from other branches onto the current branch
2619 </td></tr>
2619 </td></tr>
2620 <tr><td>
2620 <tr><td>
2621 <a href="/help/grep">
2621 <a href="/help/grep">
2622 grep
2622 grep
2623 </a>
2623 </a>
2624 </td><td>
2624 </td><td>
2625 search for a pattern in specified files
2625 search for a pattern in specified files
2626 </td></tr>
2626 </td></tr>
2627 <tr><td>
2627 <tr><td>
2628 <a href="/help/hashelp">
2628 <a href="/help/hashelp">
2629 hashelp
2629 hashelp
2630 </a>
2630 </a>
2631 </td><td>
2631 </td><td>
2632 Extension command's help
2632 Extension command's help
2633 </td></tr>
2633 </td></tr>
2634 <tr><td>
2634 <tr><td>
2635 <a href="/help/heads">
2635 <a href="/help/heads">
2636 heads
2636 heads
2637 </a>
2637 </a>
2638 </td><td>
2638 </td><td>
2639 show branch heads
2639 show branch heads
2640 </td></tr>
2640 </td></tr>
2641 <tr><td>
2641 <tr><td>
2642 <a href="/help/help">
2642 <a href="/help/help">
2643 help
2643 help
2644 </a>
2644 </a>
2645 </td><td>
2645 </td><td>
2646 show help for a given topic or a help overview
2646 show help for a given topic or a help overview
2647 </td></tr>
2647 </td></tr>
2648 <tr><td>
2648 <tr><td>
2649 <a href="/help/hgalias">
2649 <a href="/help/hgalias">
2650 hgalias
2650 hgalias
2651 </a>
2651 </a>
2652 </td><td>
2652 </td><td>
2653 My doc
2653 My doc
2654 </td></tr>
2654 </td></tr>
2655 <tr><td>
2655 <tr><td>
2656 <a href="/help/hgaliasnodoc">
2656 <a href="/help/hgaliasnodoc">
2657 hgaliasnodoc
2657 hgaliasnodoc
2658 </a>
2658 </a>
2659 </td><td>
2659 </td><td>
2660 summarize working directory state
2660 summarize working directory state
2661 </td></tr>
2661 </td></tr>
2662 <tr><td>
2662 <tr><td>
2663 <a href="/help/identify">
2663 <a href="/help/identify">
2664 identify
2664 identify
2665 </a>
2665 </a>
2666 </td><td>
2666 </td><td>
2667 identify the working directory or specified revision
2667 identify the working directory or specified revision
2668 </td></tr>
2668 </td></tr>
2669 <tr><td>
2669 <tr><td>
2670 <a href="/help/import">
2670 <a href="/help/import">
2671 import
2671 import
2672 </a>
2672 </a>
2673 </td><td>
2673 </td><td>
2674 import an ordered set of patches
2674 import an ordered set of patches
2675 </td></tr>
2675 </td></tr>
2676 <tr><td>
2676 <tr><td>
2677 <a href="/help/incoming">
2677 <a href="/help/incoming">
2678 incoming
2678 incoming
2679 </a>
2679 </a>
2680 </td><td>
2680 </td><td>
2681 show new changesets found in source
2681 show new changesets found in source
2682 </td></tr>
2682 </td></tr>
2683 <tr><td>
2683 <tr><td>
2684 <a href="/help/manifest">
2684 <a href="/help/manifest">
2685 manifest
2685 manifest
2686 </a>
2686 </a>
2687 </td><td>
2687 </td><td>
2688 output the current or given revision of the project manifest
2688 output the current or given revision of the project manifest
2689 </td></tr>
2689 </td></tr>
2690 <tr><td>
2690 <tr><td>
2691 <a href="/help/nohelp">
2691 <a href="/help/nohelp">
2692 nohelp
2692 nohelp
2693 </a>
2693 </a>
2694 </td><td>
2694 </td><td>
2695 (no help text available)
2695 (no help text available)
2696 </td></tr>
2696 </td></tr>
2697 <tr><td>
2697 <tr><td>
2698 <a href="/help/outgoing">
2698 <a href="/help/outgoing">
2699 outgoing
2699 outgoing
2700 </a>
2700 </a>
2701 </td><td>
2701 </td><td>
2702 show changesets not found in the destination
2702 show changesets not found in the destination
2703 </td></tr>
2703 </td></tr>
2704 <tr><td>
2704 <tr><td>
2705 <a href="/help/paths">
2705 <a href="/help/paths">
2706 paths
2706 paths
2707 </a>
2707 </a>
2708 </td><td>
2708 </td><td>
2709 show aliases for remote repositories
2709 show aliases for remote repositories
2710 </td></tr>
2710 </td></tr>
2711 <tr><td>
2711 <tr><td>
2712 <a href="/help/phase">
2712 <a href="/help/phase">
2713 phase
2713 phase
2714 </a>
2714 </a>
2715 </td><td>
2715 </td><td>
2716 set or show the current phase name
2716 set or show the current phase name
2717 </td></tr>
2717 </td></tr>
2718 <tr><td>
2718 <tr><td>
2719 <a href="/help/recover">
2719 <a href="/help/recover">
2720 recover
2720 recover
2721 </a>
2721 </a>
2722 </td><td>
2722 </td><td>
2723 roll back an interrupted transaction
2723 roll back an interrupted transaction
2724 </td></tr>
2724 </td></tr>
2725 <tr><td>
2725 <tr><td>
2726 <a href="/help/rename">
2726 <a href="/help/rename">
2727 rename
2727 rename
2728 </a>
2728 </a>
2729 </td><td>
2729 </td><td>
2730 rename files; equivalent of copy + remove
2730 rename files; equivalent of copy + remove
2731 </td></tr>
2731 </td></tr>
2732 <tr><td>
2732 <tr><td>
2733 <a href="/help/resolve">
2733 <a href="/help/resolve">
2734 resolve
2734 resolve
2735 </a>
2735 </a>
2736 </td><td>
2736 </td><td>
2737 redo merges or set/view the merge status of files
2737 redo merges or set/view the merge status of files
2738 </td></tr>
2738 </td></tr>
2739 <tr><td>
2739 <tr><td>
2740 <a href="/help/revert">
2740 <a href="/help/revert">
2741 revert
2741 revert
2742 </a>
2742 </a>
2743 </td><td>
2743 </td><td>
2744 restore files to their checkout state
2744 restore files to their checkout state
2745 </td></tr>
2745 </td></tr>
2746 <tr><td>
2746 <tr><td>
2747 <a href="/help/root">
2747 <a href="/help/root">
2748 root
2748 root
2749 </a>
2749 </a>
2750 </td><td>
2750 </td><td>
2751 print the root (top) of the current working directory
2751 print the root (top) of the current working directory
2752 </td></tr>
2752 </td></tr>
2753 <tr><td>
2753 <tr><td>
2754 <a href="/help/shellalias">
2754 <a href="/help/shellalias">
2755 shellalias
2755 shellalias
2756 </a>
2756 </a>
2757 </td><td>
2757 </td><td>
2758 (no help text available)
2758 (no help text available)
2759 </td></tr>
2759 </td></tr>
2760 <tr><td>
2760 <tr><td>
2761 <a href="/help/shelve">
2761 <a href="/help/shelve">
2762 shelve
2762 shelve
2763 </a>
2763 </a>
2764 </td><td>
2764 </td><td>
2765 save and set aside changes from the working directory
2765 save and set aside changes from the working directory
2766 </td></tr>
2766 </td></tr>
2767 <tr><td>
2767 <tr><td>
2768 <a href="/help/tag">
2768 <a href="/help/tag">
2769 tag
2769 tag
2770 </a>
2770 </a>
2771 </td><td>
2771 </td><td>
2772 add one or more tags for the current or given revision
2772 add one or more tags for the current or given revision
2773 </td></tr>
2773 </td></tr>
2774 <tr><td>
2774 <tr><td>
2775 <a href="/help/tags">
2775 <a href="/help/tags">
2776 tags
2776 tags
2777 </a>
2777 </a>
2778 </td><td>
2778 </td><td>
2779 list repository tags
2779 list repository tags
2780 </td></tr>
2780 </td></tr>
2781 <tr><td>
2781 <tr><td>
2782 <a href="/help/unbundle">
2782 <a href="/help/unbundle">
2783 unbundle
2783 unbundle
2784 </a>
2784 </a>
2785 </td><td>
2785 </td><td>
2786 apply one or more bundle files
2786 apply one or more bundle files
2787 </td></tr>
2787 </td></tr>
2788 <tr><td>
2788 <tr><td>
2789 <a href="/help/unshelve">
2789 <a href="/help/unshelve">
2790 unshelve
2790 unshelve
2791 </a>
2791 </a>
2792 </td><td>
2792 </td><td>
2793 restore a shelved change to the working directory
2793 restore a shelved change to the working directory
2794 </td></tr>
2794 </td></tr>
2795 <tr><td>
2795 <tr><td>
2796 <a href="/help/verify">
2796 <a href="/help/verify">
2797 verify
2797 verify
2798 </a>
2798 </a>
2799 </td><td>
2799 </td><td>
2800 verify the integrity of the repository
2800 verify the integrity of the repository
2801 </td></tr>
2801 </td></tr>
2802 <tr><td>
2802 <tr><td>
2803 <a href="/help/version">
2803 <a href="/help/version">
2804 version
2804 version
2805 </a>
2805 </a>
2806 </td><td>
2806 </td><td>
2807 output version and copyright information
2807 output version and copyright information
2808 </td></tr>
2808 </td></tr>
2809
2809
2810
2810
2811 </table>
2811 </table>
2812 </div>
2812 </div>
2813 </div>
2813 </div>
2814
2814
2815
2815
2816
2816
2817 </body>
2817 </body>
2818 </html>
2818 </html>
2819
2819
2820
2820
2821 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2821 $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
2822 200 Script output follows
2822 200 Script output follows
2823
2823
2824 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2824 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2825 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2825 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
2826 <head>
2826 <head>
2827 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2827 <link rel="icon" href="/static/hgicon.png" type="image/png" />
2828 <meta name="robots" content="index, nofollow" />
2828 <meta name="robots" content="index, nofollow" />
2829 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2829 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
2830 <script type="text/javascript" src="/static/mercurial.js"></script>
2830 <script type="text/javascript" src="/static/mercurial.js"></script>
2831
2831
2832 <title>Help: add</title>
2832 <title>Help: add</title>
2833 </head>
2833 </head>
2834 <body>
2834 <body>
2835
2835
2836 <div class="container">
2836 <div class="container">
2837 <div class="menu">
2837 <div class="menu">
2838 <div class="logo">
2838 <div class="logo">
2839 <a href="https://mercurial-scm.org/">
2839 <a href="https://mercurial-scm.org/">
2840 <img src="/static/hglogo.png" alt="mercurial" /></a>
2840 <img src="/static/hglogo.png" alt="mercurial" /></a>
2841 </div>
2841 </div>
2842 <ul>
2842 <ul>
2843 <li><a href="/shortlog">log</a></li>
2843 <li><a href="/shortlog">log</a></li>
2844 <li><a href="/graph">graph</a></li>
2844 <li><a href="/graph">graph</a></li>
2845 <li><a href="/tags">tags</a></li>
2845 <li><a href="/tags">tags</a></li>
2846 <li><a href="/bookmarks">bookmarks</a></li>
2846 <li><a href="/bookmarks">bookmarks</a></li>
2847 <li><a href="/branches">branches</a></li>
2847 <li><a href="/branches">branches</a></li>
2848 </ul>
2848 </ul>
2849 <ul>
2849 <ul>
2850 <li class="active"><a href="/help">help</a></li>
2850 <li class="active"><a href="/help">help</a></li>
2851 </ul>
2851 </ul>
2852 </div>
2852 </div>
2853
2853
2854 <div class="main">
2854 <div class="main">
2855 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2855 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
2856 <h3>Help: add</h3>
2856 <h3>Help: add</h3>
2857
2857
2858 <form class="search" action="/log">
2858 <form class="search" action="/log">
2859
2859
2860 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2860 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
2861 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2861 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
2862 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2862 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
2863 </form>
2863 </form>
2864 <div id="doc">
2864 <div id="doc">
2865 <p>
2865 <p>
2866 hg add [OPTION]... [FILE]...
2866 hg add [OPTION]... [FILE]...
2867 </p>
2867 </p>
2868 <p>
2868 <p>
2869 add the specified files on the next commit
2869 add the specified files on the next commit
2870 </p>
2870 </p>
2871 <p>
2871 <p>
2872 Schedule files to be version controlled and added to the
2872 Schedule files to be version controlled and added to the
2873 repository.
2873 repository.
2874 </p>
2874 </p>
2875 <p>
2875 <p>
2876 The files will be added to the repository at the next commit. To
2876 The files will be added to the repository at the next commit. To
2877 undo an add before that, see 'hg forget'.
2877 undo an add before that, see 'hg forget'.
2878 </p>
2878 </p>
2879 <p>
2879 <p>
2880 If no names are given, add all files to the repository (except
2880 If no names are given, add all files to the repository (except
2881 files matching &quot;.hgignore&quot;).
2881 files matching &quot;.hgignore&quot;).
2882 </p>
2882 </p>
2883 <p>
2883 <p>
2884 Examples:
2884 Examples:
2885 </p>
2885 </p>
2886 <ul>
2886 <ul>
2887 <li> New (unknown) files are added automatically by 'hg add':
2887 <li> New (unknown) files are added automatically by 'hg add':
2888 <pre>
2888 <pre>
2889 \$ ls (re)
2889 \$ ls (re)
2890 foo.c
2890 foo.c
2891 \$ hg status (re)
2891 \$ hg status (re)
2892 ? foo.c
2892 ? foo.c
2893 \$ hg add (re)
2893 \$ hg add (re)
2894 adding foo.c
2894 adding foo.c
2895 \$ hg status (re)
2895 \$ hg status (re)
2896 A foo.c
2896 A foo.c
2897 </pre>
2897 </pre>
2898 <li> Specific files to be added can be specified:
2898 <li> Specific files to be added can be specified:
2899 <pre>
2899 <pre>
2900 \$ ls (re)
2900 \$ ls (re)
2901 bar.c foo.c
2901 bar.c foo.c
2902 \$ hg status (re)
2902 \$ hg status (re)
2903 ? bar.c
2903 ? bar.c
2904 ? foo.c
2904 ? foo.c
2905 \$ hg add bar.c (re)
2905 \$ hg add bar.c (re)
2906 \$ hg status (re)
2906 \$ hg status (re)
2907 A bar.c
2907 A bar.c
2908 ? foo.c
2908 ? foo.c
2909 </pre>
2909 </pre>
2910 </ul>
2910 </ul>
2911 <p>
2911 <p>
2912 Returns 0 if all files are successfully added.
2912 Returns 0 if all files are successfully added.
2913 </p>
2913 </p>
2914 <p>
2914 <p>
2915 options ([+] can be repeated):
2915 options ([+] can be repeated):
2916 </p>
2916 </p>
2917 <table>
2917 <table>
2918 <tr><td>-I</td>
2918 <tr><td>-I</td>
2919 <td>--include PATTERN [+]</td>
2919 <td>--include PATTERN [+]</td>
2920 <td>include names matching the given patterns</td></tr>
2920 <td>include names matching the given patterns</td></tr>
2921 <tr><td>-X</td>
2921 <tr><td>-X</td>
2922 <td>--exclude PATTERN [+]</td>
2922 <td>--exclude PATTERN [+]</td>
2923 <td>exclude names matching the given patterns</td></tr>
2923 <td>exclude names matching the given patterns</td></tr>
2924 <tr><td>-S</td>
2924 <tr><td>-S</td>
2925 <td>--subrepos</td>
2925 <td>--subrepos</td>
2926 <td>recurse into subrepositories</td></tr>
2926 <td>recurse into subrepositories</td></tr>
2927 <tr><td>-n</td>
2927 <tr><td>-n</td>
2928 <td>--dry-run</td>
2928 <td>--dry-run</td>
2929 <td>do not perform actions, just print output</td></tr>
2929 <td>do not perform actions, just print output</td></tr>
2930 </table>
2930 </table>
2931 <p>
2931 <p>
2932 global options ([+] can be repeated):
2932 global options ([+] can be repeated):
2933 </p>
2933 </p>
2934 <table>
2934 <table>
2935 <tr><td>-R</td>
2935 <tr><td>-R</td>
2936 <td>--repository REPO</td>
2936 <td>--repository REPO</td>
2937 <td>repository root directory or name of overlay bundle file</td></tr>
2937 <td>repository root directory or name of overlay bundle file</td></tr>
2938 <tr><td></td>
2938 <tr><td></td>
2939 <td>--cwd DIR</td>
2939 <td>--cwd DIR</td>
2940 <td>change working directory</td></tr>
2940 <td>change working directory</td></tr>
2941 <tr><td>-y</td>
2941 <tr><td>-y</td>
2942 <td>--noninteractive</td>
2942 <td>--noninteractive</td>
2943 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2943 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
2944 <tr><td>-q</td>
2944 <tr><td>-q</td>
2945 <td>--quiet</td>
2945 <td>--quiet</td>
2946 <td>suppress output</td></tr>
2946 <td>suppress output</td></tr>
2947 <tr><td>-v</td>
2947 <tr><td>-v</td>
2948 <td>--verbose</td>
2948 <td>--verbose</td>
2949 <td>enable additional output</td></tr>
2949 <td>enable additional output</td></tr>
2950 <tr><td></td>
2950 <tr><td></td>
2951 <td>--color TYPE</td>
2951 <td>--color TYPE</td>
2952 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2952 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
2953 <tr><td></td>
2953 <tr><td></td>
2954 <td>--config CONFIG [+]</td>
2954 <td>--config CONFIG [+]</td>
2955 <td>set/override config option (use 'section.name=value')</td></tr>
2955 <td>set/override config option (use 'section.name=value')</td></tr>
2956 <tr><td></td>
2956 <tr><td></td>
2957 <td>--debug</td>
2957 <td>--debug</td>
2958 <td>enable debugging output</td></tr>
2958 <td>enable debugging output</td></tr>
2959 <tr><td></td>
2959 <tr><td></td>
2960 <td>--debugger</td>
2960 <td>--debugger</td>
2961 <td>start debugger</td></tr>
2961 <td>start debugger</td></tr>
2962 <tr><td></td>
2962 <tr><td></td>
2963 <td>--encoding ENCODE</td>
2963 <td>--encoding ENCODE</td>
2964 <td>set the charset encoding (default: ascii)</td></tr>
2964 <td>set the charset encoding (default: ascii)</td></tr>
2965 <tr><td></td>
2965 <tr><td></td>
2966 <td>--encodingmode MODE</td>
2966 <td>--encodingmode MODE</td>
2967 <td>set the charset encoding mode (default: strict)</td></tr>
2967 <td>set the charset encoding mode (default: strict)</td></tr>
2968 <tr><td></td>
2968 <tr><td></td>
2969 <td>--traceback</td>
2969 <td>--traceback</td>
2970 <td>always print a traceback on exception</td></tr>
2970 <td>always print a traceback on exception</td></tr>
2971 <tr><td></td>
2971 <tr><td></td>
2972 <td>--time</td>
2972 <td>--time</td>
2973 <td>time how long the command takes</td></tr>
2973 <td>time how long the command takes</td></tr>
2974 <tr><td></td>
2974 <tr><td></td>
2975 <td>--profile</td>
2975 <td>--profile</td>
2976 <td>print command execution profile</td></tr>
2976 <td>print command execution profile</td></tr>
2977 <tr><td></td>
2977 <tr><td></td>
2978 <td>--version</td>
2978 <td>--version</td>
2979 <td>output version information and exit</td></tr>
2979 <td>output version information and exit</td></tr>
2980 <tr><td>-h</td>
2980 <tr><td>-h</td>
2981 <td>--help</td>
2981 <td>--help</td>
2982 <td>display help and exit</td></tr>
2982 <td>display help and exit</td></tr>
2983 <tr><td></td>
2983 <tr><td></td>
2984 <td>--hidden</td>
2984 <td>--hidden</td>
2985 <td>consider hidden changesets</td></tr>
2985 <td>consider hidden changesets</td></tr>
2986 <tr><td></td>
2986 <tr><td></td>
2987 <td>--pager TYPE</td>
2987 <td>--pager TYPE</td>
2988 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2988 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
2989 </table>
2989 </table>
2990
2990
2991 </div>
2991 </div>
2992 </div>
2992 </div>
2993 </div>
2993 </div>
2994
2994
2995
2995
2996
2996
2997 </body>
2997 </body>
2998 </html>
2998 </html>
2999
2999
3000
3000
3001 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
3001 $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
3002 200 Script output follows
3002 200 Script output follows
3003
3003
3004 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3004 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3005 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3005 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3006 <head>
3006 <head>
3007 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3007 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3008 <meta name="robots" content="index, nofollow" />
3008 <meta name="robots" content="index, nofollow" />
3009 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3009 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3010 <script type="text/javascript" src="/static/mercurial.js"></script>
3010 <script type="text/javascript" src="/static/mercurial.js"></script>
3011
3011
3012 <title>Help: remove</title>
3012 <title>Help: remove</title>
3013 </head>
3013 </head>
3014 <body>
3014 <body>
3015
3015
3016 <div class="container">
3016 <div class="container">
3017 <div class="menu">
3017 <div class="menu">
3018 <div class="logo">
3018 <div class="logo">
3019 <a href="https://mercurial-scm.org/">
3019 <a href="https://mercurial-scm.org/">
3020 <img src="/static/hglogo.png" alt="mercurial" /></a>
3020 <img src="/static/hglogo.png" alt="mercurial" /></a>
3021 </div>
3021 </div>
3022 <ul>
3022 <ul>
3023 <li><a href="/shortlog">log</a></li>
3023 <li><a href="/shortlog">log</a></li>
3024 <li><a href="/graph">graph</a></li>
3024 <li><a href="/graph">graph</a></li>
3025 <li><a href="/tags">tags</a></li>
3025 <li><a href="/tags">tags</a></li>
3026 <li><a href="/bookmarks">bookmarks</a></li>
3026 <li><a href="/bookmarks">bookmarks</a></li>
3027 <li><a href="/branches">branches</a></li>
3027 <li><a href="/branches">branches</a></li>
3028 </ul>
3028 </ul>
3029 <ul>
3029 <ul>
3030 <li class="active"><a href="/help">help</a></li>
3030 <li class="active"><a href="/help">help</a></li>
3031 </ul>
3031 </ul>
3032 </div>
3032 </div>
3033
3033
3034 <div class="main">
3034 <div class="main">
3035 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3035 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3036 <h3>Help: remove</h3>
3036 <h3>Help: remove</h3>
3037
3037
3038 <form class="search" action="/log">
3038 <form class="search" action="/log">
3039
3039
3040 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3040 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3041 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3041 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3042 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3042 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3043 </form>
3043 </form>
3044 <div id="doc">
3044 <div id="doc">
3045 <p>
3045 <p>
3046 hg remove [OPTION]... FILE...
3046 hg remove [OPTION]... FILE...
3047 </p>
3047 </p>
3048 <p>
3048 <p>
3049 aliases: rm
3049 aliases: rm
3050 </p>
3050 </p>
3051 <p>
3051 <p>
3052 remove the specified files on the next commit
3052 remove the specified files on the next commit
3053 </p>
3053 </p>
3054 <p>
3054 <p>
3055 Schedule the indicated files for removal from the current branch.
3055 Schedule the indicated files for removal from the current branch.
3056 </p>
3056 </p>
3057 <p>
3057 <p>
3058 This command schedules the files to be removed at the next commit.
3058 This command schedules the files to be removed at the next commit.
3059 To undo a remove before that, see 'hg revert'. To undo added
3059 To undo a remove before that, see 'hg revert'. To undo added
3060 files, see 'hg forget'.
3060 files, see 'hg forget'.
3061 </p>
3061 </p>
3062 <p>
3062 <p>
3063 -A/--after can be used to remove only files that have already
3063 -A/--after can be used to remove only files that have already
3064 been deleted, -f/--force can be used to force deletion, and -Af
3064 been deleted, -f/--force can be used to force deletion, and -Af
3065 can be used to remove files from the next revision without
3065 can be used to remove files from the next revision without
3066 deleting them from the working directory.
3066 deleting them from the working directory.
3067 </p>
3067 </p>
3068 <p>
3068 <p>
3069 The following table details the behavior of remove for different
3069 The following table details the behavior of remove for different
3070 file states (columns) and option combinations (rows). The file
3070 file states (columns) and option combinations (rows). The file
3071 states are Added [A], Clean [C], Modified [M] and Missing [!]
3071 states are Added [A], Clean [C], Modified [M] and Missing [!]
3072 (as reported by 'hg status'). The actions are Warn, Remove
3072 (as reported by 'hg status'). The actions are Warn, Remove
3073 (from branch) and Delete (from disk):
3073 (from branch) and Delete (from disk):
3074 </p>
3074 </p>
3075 <table>
3075 <table>
3076 <tr><td>opt/state</td>
3076 <tr><td>opt/state</td>
3077 <td>A</td>
3077 <td>A</td>
3078 <td>C</td>
3078 <td>C</td>
3079 <td>M</td>
3079 <td>M</td>
3080 <td>!</td></tr>
3080 <td>!</td></tr>
3081 <tr><td>none</td>
3081 <tr><td>none</td>
3082 <td>W</td>
3082 <td>W</td>
3083 <td>RD</td>
3083 <td>RD</td>
3084 <td>W</td>
3084 <td>W</td>
3085 <td>R</td></tr>
3085 <td>R</td></tr>
3086 <tr><td>-f</td>
3086 <tr><td>-f</td>
3087 <td>R</td>
3087 <td>R</td>
3088 <td>RD</td>
3088 <td>RD</td>
3089 <td>RD</td>
3089 <td>RD</td>
3090 <td>R</td></tr>
3090 <td>R</td></tr>
3091 <tr><td>-A</td>
3091 <tr><td>-A</td>
3092 <td>W</td>
3092 <td>W</td>
3093 <td>W</td>
3093 <td>W</td>
3094 <td>W</td>
3094 <td>W</td>
3095 <td>R</td></tr>
3095 <td>R</td></tr>
3096 <tr><td>-Af</td>
3096 <tr><td>-Af</td>
3097 <td>R</td>
3097 <td>R</td>
3098 <td>R</td>
3098 <td>R</td>
3099 <td>R</td>
3099 <td>R</td>
3100 <td>R</td></tr>
3100 <td>R</td></tr>
3101 </table>
3101 </table>
3102 <p>
3102 <p>
3103 <b>Note:</b>
3103 <b>Note:</b>
3104 </p>
3104 </p>
3105 <p>
3105 <p>
3106 'hg remove' never deletes files in Added [A] state from the
3106 'hg remove' never deletes files in Added [A] state from the
3107 working directory, not even if &quot;--force&quot; is specified.
3107 working directory, not even if &quot;--force&quot; is specified.
3108 </p>
3108 </p>
3109 <p>
3109 <p>
3110 Returns 0 on success, 1 if any warnings encountered.
3110 Returns 0 on success, 1 if any warnings encountered.
3111 </p>
3111 </p>
3112 <p>
3112 <p>
3113 options ([+] can be repeated):
3113 options ([+] can be repeated):
3114 </p>
3114 </p>
3115 <table>
3115 <table>
3116 <tr><td>-A</td>
3116 <tr><td>-A</td>
3117 <td>--after</td>
3117 <td>--after</td>
3118 <td>record delete for missing files</td></tr>
3118 <td>record delete for missing files</td></tr>
3119 <tr><td>-f</td>
3119 <tr><td>-f</td>
3120 <td>--force</td>
3120 <td>--force</td>
3121 <td>forget added files, delete modified files</td></tr>
3121 <td>forget added files, delete modified files</td></tr>
3122 <tr><td>-S</td>
3122 <tr><td>-S</td>
3123 <td>--subrepos</td>
3123 <td>--subrepos</td>
3124 <td>recurse into subrepositories</td></tr>
3124 <td>recurse into subrepositories</td></tr>
3125 <tr><td>-I</td>
3125 <tr><td>-I</td>
3126 <td>--include PATTERN [+]</td>
3126 <td>--include PATTERN [+]</td>
3127 <td>include names matching the given patterns</td></tr>
3127 <td>include names matching the given patterns</td></tr>
3128 <tr><td>-X</td>
3128 <tr><td>-X</td>
3129 <td>--exclude PATTERN [+]</td>
3129 <td>--exclude PATTERN [+]</td>
3130 <td>exclude names matching the given patterns</td></tr>
3130 <td>exclude names matching the given patterns</td></tr>
3131 <tr><td>-n</td>
3131 <tr><td>-n</td>
3132 <td>--dry-run</td>
3132 <td>--dry-run</td>
3133 <td>do not perform actions, just print output</td></tr>
3133 <td>do not perform actions, just print output</td></tr>
3134 </table>
3134 </table>
3135 <p>
3135 <p>
3136 global options ([+] can be repeated):
3136 global options ([+] can be repeated):
3137 </p>
3137 </p>
3138 <table>
3138 <table>
3139 <tr><td>-R</td>
3139 <tr><td>-R</td>
3140 <td>--repository REPO</td>
3140 <td>--repository REPO</td>
3141 <td>repository root directory or name of overlay bundle file</td></tr>
3141 <td>repository root directory or name of overlay bundle file</td></tr>
3142 <tr><td></td>
3142 <tr><td></td>
3143 <td>--cwd DIR</td>
3143 <td>--cwd DIR</td>
3144 <td>change working directory</td></tr>
3144 <td>change working directory</td></tr>
3145 <tr><td>-y</td>
3145 <tr><td>-y</td>
3146 <td>--noninteractive</td>
3146 <td>--noninteractive</td>
3147 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3147 <td>do not prompt, automatically pick the first choice for all prompts</td></tr>
3148 <tr><td>-q</td>
3148 <tr><td>-q</td>
3149 <td>--quiet</td>
3149 <td>--quiet</td>
3150 <td>suppress output</td></tr>
3150 <td>suppress output</td></tr>
3151 <tr><td>-v</td>
3151 <tr><td>-v</td>
3152 <td>--verbose</td>
3152 <td>--verbose</td>
3153 <td>enable additional output</td></tr>
3153 <td>enable additional output</td></tr>
3154 <tr><td></td>
3154 <tr><td></td>
3155 <td>--color TYPE</td>
3155 <td>--color TYPE</td>
3156 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3156 <td>when to colorize (boolean, always, auto, never, or debug)</td></tr>
3157 <tr><td></td>
3157 <tr><td></td>
3158 <td>--config CONFIG [+]</td>
3158 <td>--config CONFIG [+]</td>
3159 <td>set/override config option (use 'section.name=value')</td></tr>
3159 <td>set/override config option (use 'section.name=value')</td></tr>
3160 <tr><td></td>
3160 <tr><td></td>
3161 <td>--debug</td>
3161 <td>--debug</td>
3162 <td>enable debugging output</td></tr>
3162 <td>enable debugging output</td></tr>
3163 <tr><td></td>
3163 <tr><td></td>
3164 <td>--debugger</td>
3164 <td>--debugger</td>
3165 <td>start debugger</td></tr>
3165 <td>start debugger</td></tr>
3166 <tr><td></td>
3166 <tr><td></td>
3167 <td>--encoding ENCODE</td>
3167 <td>--encoding ENCODE</td>
3168 <td>set the charset encoding (default: ascii)</td></tr>
3168 <td>set the charset encoding (default: ascii)</td></tr>
3169 <tr><td></td>
3169 <tr><td></td>
3170 <td>--encodingmode MODE</td>
3170 <td>--encodingmode MODE</td>
3171 <td>set the charset encoding mode (default: strict)</td></tr>
3171 <td>set the charset encoding mode (default: strict)</td></tr>
3172 <tr><td></td>
3172 <tr><td></td>
3173 <td>--traceback</td>
3173 <td>--traceback</td>
3174 <td>always print a traceback on exception</td></tr>
3174 <td>always print a traceback on exception</td></tr>
3175 <tr><td></td>
3175 <tr><td></td>
3176 <td>--time</td>
3176 <td>--time</td>
3177 <td>time how long the command takes</td></tr>
3177 <td>time how long the command takes</td></tr>
3178 <tr><td></td>
3178 <tr><td></td>
3179 <td>--profile</td>
3179 <td>--profile</td>
3180 <td>print command execution profile</td></tr>
3180 <td>print command execution profile</td></tr>
3181 <tr><td></td>
3181 <tr><td></td>
3182 <td>--version</td>
3182 <td>--version</td>
3183 <td>output version information and exit</td></tr>
3183 <td>output version information and exit</td></tr>
3184 <tr><td>-h</td>
3184 <tr><td>-h</td>
3185 <td>--help</td>
3185 <td>--help</td>
3186 <td>display help and exit</td></tr>
3186 <td>display help and exit</td></tr>
3187 <tr><td></td>
3187 <tr><td></td>
3188 <td>--hidden</td>
3188 <td>--hidden</td>
3189 <td>consider hidden changesets</td></tr>
3189 <td>consider hidden changesets</td></tr>
3190 <tr><td></td>
3190 <tr><td></td>
3191 <td>--pager TYPE</td>
3191 <td>--pager TYPE</td>
3192 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3192 <td>when to paginate (boolean, always, auto, or never) (default: auto)</td></tr>
3193 </table>
3193 </table>
3194
3194
3195 </div>
3195 </div>
3196 </div>
3196 </div>
3197 </div>
3197 </div>
3198
3198
3199
3199
3200
3200
3201 </body>
3201 </body>
3202 </html>
3202 </html>
3203
3203
3204
3204
3205 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
3205 $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
3206 200 Script output follows
3206 200 Script output follows
3207
3207
3208 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3208 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3209 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3209 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3210 <head>
3210 <head>
3211 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3211 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3212 <meta name="robots" content="index, nofollow" />
3212 <meta name="robots" content="index, nofollow" />
3213 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3213 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3214 <script type="text/javascript" src="/static/mercurial.js"></script>
3214 <script type="text/javascript" src="/static/mercurial.js"></script>
3215
3215
3216 <title>Help: dates</title>
3216 <title>Help: dates</title>
3217 </head>
3217 </head>
3218 <body>
3218 <body>
3219
3219
3220 <div class="container">
3220 <div class="container">
3221 <div class="menu">
3221 <div class="menu">
3222 <div class="logo">
3222 <div class="logo">
3223 <a href="https://mercurial-scm.org/">
3223 <a href="https://mercurial-scm.org/">
3224 <img src="/static/hglogo.png" alt="mercurial" /></a>
3224 <img src="/static/hglogo.png" alt="mercurial" /></a>
3225 </div>
3225 </div>
3226 <ul>
3226 <ul>
3227 <li><a href="/shortlog">log</a></li>
3227 <li><a href="/shortlog">log</a></li>
3228 <li><a href="/graph">graph</a></li>
3228 <li><a href="/graph">graph</a></li>
3229 <li><a href="/tags">tags</a></li>
3229 <li><a href="/tags">tags</a></li>
3230 <li><a href="/bookmarks">bookmarks</a></li>
3230 <li><a href="/bookmarks">bookmarks</a></li>
3231 <li><a href="/branches">branches</a></li>
3231 <li><a href="/branches">branches</a></li>
3232 </ul>
3232 </ul>
3233 <ul>
3233 <ul>
3234 <li class="active"><a href="/help">help</a></li>
3234 <li class="active"><a href="/help">help</a></li>
3235 </ul>
3235 </ul>
3236 </div>
3236 </div>
3237
3237
3238 <div class="main">
3238 <div class="main">
3239 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3239 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3240 <h3>Help: dates</h3>
3240 <h3>Help: dates</h3>
3241
3241
3242 <form class="search" action="/log">
3242 <form class="search" action="/log">
3243
3243
3244 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3244 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3245 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3245 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3246 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3246 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3247 </form>
3247 </form>
3248 <div id="doc">
3248 <div id="doc">
3249 <h1>Date Formats</h1>
3249 <h1>Date Formats</h1>
3250 <p>
3250 <p>
3251 Some commands allow the user to specify a date, e.g.:
3251 Some commands allow the user to specify a date, e.g.:
3252 </p>
3252 </p>
3253 <ul>
3253 <ul>
3254 <li> backout, commit, import, tag: Specify the commit date.
3254 <li> backout, commit, import, tag: Specify the commit date.
3255 <li> log, revert, update: Select revision(s) by date.
3255 <li> log, revert, update: Select revision(s) by date.
3256 </ul>
3256 </ul>
3257 <p>
3257 <p>
3258 Many date formats are valid. Here are some examples:
3258 Many date formats are valid. Here are some examples:
3259 </p>
3259 </p>
3260 <ul>
3260 <ul>
3261 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
3261 <li> &quot;Wed Dec 6 13:18:29 2006&quot; (local timezone assumed)
3262 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
3262 <li> &quot;Dec 6 13:18 -0600&quot; (year assumed, time offset provided)
3263 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
3263 <li> &quot;Dec 6 13:18 UTC&quot; (UTC and GMT are aliases for +0000)
3264 <li> &quot;Dec 6&quot; (midnight)
3264 <li> &quot;Dec 6&quot; (midnight)
3265 <li> &quot;13:18&quot; (today assumed)
3265 <li> &quot;13:18&quot; (today assumed)
3266 <li> &quot;3:39&quot; (3:39AM assumed)
3266 <li> &quot;3:39&quot; (3:39AM assumed)
3267 <li> &quot;3:39pm&quot; (15:39)
3267 <li> &quot;3:39pm&quot; (15:39)
3268 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
3268 <li> &quot;2006-12-06 13:18:29&quot; (ISO 8601 format)
3269 <li> &quot;2006-12-6 13:18&quot;
3269 <li> &quot;2006-12-6 13:18&quot;
3270 <li> &quot;2006-12-6&quot;
3270 <li> &quot;2006-12-6&quot;
3271 <li> &quot;12-6&quot;
3271 <li> &quot;12-6&quot;
3272 <li> &quot;12/6&quot;
3272 <li> &quot;12/6&quot;
3273 <li> &quot;12/6/6&quot; (Dec 6 2006)
3273 <li> &quot;12/6/6&quot; (Dec 6 2006)
3274 <li> &quot;today&quot; (midnight)
3274 <li> &quot;today&quot; (midnight)
3275 <li> &quot;yesterday&quot; (midnight)
3275 <li> &quot;yesterday&quot; (midnight)
3276 <li> &quot;now&quot; - right now
3276 <li> &quot;now&quot; - right now
3277 </ul>
3277 </ul>
3278 <p>
3278 <p>
3279 Lastly, there is Mercurial's internal format:
3279 Lastly, there is Mercurial's internal format:
3280 </p>
3280 </p>
3281 <ul>
3281 <ul>
3282 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
3282 <li> &quot;1165411109 0&quot; (Wed Dec 6 13:18:29 2006 UTC)
3283 </ul>
3283 </ul>
3284 <p>
3284 <p>
3285 This is the internal representation format for dates. The first number
3285 This is the internal representation format for dates. The first number
3286 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
3286 is the number of seconds since the epoch (1970-01-01 00:00 UTC). The
3287 second is the offset of the local timezone, in seconds west of UTC
3287 second is the offset of the local timezone, in seconds west of UTC
3288 (negative if the timezone is east of UTC).
3288 (negative if the timezone is east of UTC).
3289 </p>
3289 </p>
3290 <p>
3290 <p>
3291 The log command also accepts date ranges:
3291 The log command also accepts date ranges:
3292 </p>
3292 </p>
3293 <ul>
3293 <ul>
3294 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3294 <li> &quot;&lt;DATE&quot; - at or before a given date/time
3295 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3295 <li> &quot;&gt;DATE&quot; - on or after a given date/time
3296 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3296 <li> &quot;DATE to DATE&quot; - a date range, inclusive
3297 <li> &quot;-DAYS&quot; - within a given number of days from today
3297 <li> &quot;-DAYS&quot; - within a given number of days from today
3298 </ul>
3298 </ul>
3299
3299
3300 </div>
3300 </div>
3301 </div>
3301 </div>
3302 </div>
3302 </div>
3303
3303
3304
3304
3305
3305
3306 </body>
3306 </body>
3307 </html>
3307 </html>
3308
3308
3309
3309
3310 $ get-with-headers.py $LOCALIP:$HGPORT "help/pager"
3310 $ get-with-headers.py $LOCALIP:$HGPORT "help/pager"
3311 200 Script output follows
3311 200 Script output follows
3312
3312
3313 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3313 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3314 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3314 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3315 <head>
3315 <head>
3316 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3316 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3317 <meta name="robots" content="index, nofollow" />
3317 <meta name="robots" content="index, nofollow" />
3318 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3318 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3319 <script type="text/javascript" src="/static/mercurial.js"></script>
3319 <script type="text/javascript" src="/static/mercurial.js"></script>
3320
3320
3321 <title>Help: pager</title>
3321 <title>Help: pager</title>
3322 </head>
3322 </head>
3323 <body>
3323 <body>
3324
3324
3325 <div class="container">
3325 <div class="container">
3326 <div class="menu">
3326 <div class="menu">
3327 <div class="logo">
3327 <div class="logo">
3328 <a href="https://mercurial-scm.org/">
3328 <a href="https://mercurial-scm.org/">
3329 <img src="/static/hglogo.png" alt="mercurial" /></a>
3329 <img src="/static/hglogo.png" alt="mercurial" /></a>
3330 </div>
3330 </div>
3331 <ul>
3331 <ul>
3332 <li><a href="/shortlog">log</a></li>
3332 <li><a href="/shortlog">log</a></li>
3333 <li><a href="/graph">graph</a></li>
3333 <li><a href="/graph">graph</a></li>
3334 <li><a href="/tags">tags</a></li>
3334 <li><a href="/tags">tags</a></li>
3335 <li><a href="/bookmarks">bookmarks</a></li>
3335 <li><a href="/bookmarks">bookmarks</a></li>
3336 <li><a href="/branches">branches</a></li>
3336 <li><a href="/branches">branches</a></li>
3337 </ul>
3337 </ul>
3338 <ul>
3338 <ul>
3339 <li class="active"><a href="/help">help</a></li>
3339 <li class="active"><a href="/help">help</a></li>
3340 </ul>
3340 </ul>
3341 </div>
3341 </div>
3342
3342
3343 <div class="main">
3343 <div class="main">
3344 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3344 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3345 <h3>Help: pager</h3>
3345 <h3>Help: pager</h3>
3346
3346
3347 <form class="search" action="/log">
3347 <form class="search" action="/log">
3348
3348
3349 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3349 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3350 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3350 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3351 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3351 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3352 </form>
3352 </form>
3353 <div id="doc">
3353 <div id="doc">
3354 <h1>Pager Support</h1>
3354 <h1>Pager Support</h1>
3355 <p>
3355 <p>
3356 Some Mercurial commands can produce a lot of output, and Mercurial will
3356 Some Mercurial commands can produce a lot of output, and Mercurial will
3357 attempt to use a pager to make those commands more pleasant.
3357 attempt to use a pager to make those commands more pleasant.
3358 </p>
3358 </p>
3359 <p>
3359 <p>
3360 To set the pager that should be used, set the application variable:
3360 To set the pager that should be used, set the application variable:
3361 </p>
3361 </p>
3362 <pre>
3362 <pre>
3363 [pager]
3363 [pager]
3364 pager = less -FRX
3364 pager = less -FRX
3365 </pre>
3365 </pre>
3366 <p>
3366 <p>
3367 If no pager is set in the user or repository configuration, Mercurial uses the
3367 If no pager is set in the user or repository configuration, Mercurial uses the
3368 environment variable $PAGER. If $PAGER is not set, pager.pager from the default
3368 environment variable $PAGER. If $PAGER is not set, pager.pager from the default
3369 or system configuration is used. If none of these are set, a default pager will
3369 or system configuration is used. If none of these are set, a default pager will
3370 be used, typically 'less' on Unix and 'more' on Windows.
3370 be used, typically 'less' on Unix and 'more' on Windows.
3371 </p>
3371 </p>
3372 <p>
3372 <p>
3373 You can disable the pager for certain commands by adding them to the
3373 You can disable the pager for certain commands by adding them to the
3374 pager.ignore list:
3374 pager.ignore list:
3375 </p>
3375 </p>
3376 <pre>
3376 <pre>
3377 [pager]
3377 [pager]
3378 ignore = version, help, update
3378 ignore = version, help, update
3379 </pre>
3379 </pre>
3380 <p>
3380 <p>
3381 To ignore global commands like 'hg version' or 'hg help', you have
3381 To ignore global commands like 'hg version' or 'hg help', you have
3382 to specify them in your user configuration file.
3382 to specify them in your user configuration file.
3383 </p>
3383 </p>
3384 <p>
3384 <p>
3385 To control whether the pager is used at all for an individual command,
3385 To control whether the pager is used at all for an individual command,
3386 you can use --pager=&lt;value&gt;:
3386 you can use --pager=&lt;value&gt;:
3387 </p>
3387 </p>
3388 <ul>
3388 <ul>
3389 <li> use as needed: 'auto'.
3389 <li> use as needed: 'auto'.
3390 <li> require the pager: 'yes' or 'on'.
3390 <li> require the pager: 'yes' or 'on'.
3391 <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work).
3391 <li> suppress the pager: 'no' or 'off' (any unrecognized value will also work).
3392 </ul>
3392 </ul>
3393 <p>
3393 <p>
3394 To globally turn off all attempts to use a pager, set:
3394 To globally turn off all attempts to use a pager, set:
3395 </p>
3395 </p>
3396 <pre>
3396 <pre>
3397 [ui]
3397 [ui]
3398 paginate = never
3398 paginate = never
3399 </pre>
3399 </pre>
3400 <p>
3400 <p>
3401 which will prevent the pager from running.
3401 which will prevent the pager from running.
3402 </p>
3402 </p>
3403
3403
3404 </div>
3404 </div>
3405 </div>
3405 </div>
3406 </div>
3406 </div>
3407
3407
3408
3408
3409
3409
3410 </body>
3410 </body>
3411 </html>
3411 </html>
3412
3412
3413
3413
3414 Sub-topic indexes rendered properly
3414 Sub-topic indexes rendered properly
3415
3415
3416 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3416 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
3417 200 Script output follows
3417 200 Script output follows
3418
3418
3419 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3419 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3420 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3420 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3421 <head>
3421 <head>
3422 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3422 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3423 <meta name="robots" content="index, nofollow" />
3423 <meta name="robots" content="index, nofollow" />
3424 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3424 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3425 <script type="text/javascript" src="/static/mercurial.js"></script>
3425 <script type="text/javascript" src="/static/mercurial.js"></script>
3426
3426
3427 <title>Help: internals</title>
3427 <title>Help: internals</title>
3428 </head>
3428 </head>
3429 <body>
3429 <body>
3430
3430
3431 <div class="container">
3431 <div class="container">
3432 <div class="menu">
3432 <div class="menu">
3433 <div class="logo">
3433 <div class="logo">
3434 <a href="https://mercurial-scm.org/">
3434 <a href="https://mercurial-scm.org/">
3435 <img src="/static/hglogo.png" alt="mercurial" /></a>
3435 <img src="/static/hglogo.png" alt="mercurial" /></a>
3436 </div>
3436 </div>
3437 <ul>
3437 <ul>
3438 <li><a href="/shortlog">log</a></li>
3438 <li><a href="/shortlog">log</a></li>
3439 <li><a href="/graph">graph</a></li>
3439 <li><a href="/graph">graph</a></li>
3440 <li><a href="/tags">tags</a></li>
3440 <li><a href="/tags">tags</a></li>
3441 <li><a href="/bookmarks">bookmarks</a></li>
3441 <li><a href="/bookmarks">bookmarks</a></li>
3442 <li><a href="/branches">branches</a></li>
3442 <li><a href="/branches">branches</a></li>
3443 </ul>
3443 </ul>
3444 <ul>
3444 <ul>
3445 <li><a href="/help">help</a></li>
3445 <li><a href="/help">help</a></li>
3446 </ul>
3446 </ul>
3447 </div>
3447 </div>
3448
3448
3449 <div class="main">
3449 <div class="main">
3450 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3450 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3451
3451
3452 <form class="search" action="/log">
3452 <form class="search" action="/log">
3453
3453
3454 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3454 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3455 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3455 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3456 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3456 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3457 </form>
3457 </form>
3458 <table class="bigtable">
3458 <table class="bigtable">
3459 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3459 <tr><td colspan="2"><h2><a name="topics" href="#topics">Topics</a></h2></td></tr>
3460
3460
3461 <tr><td>
3461 <tr><td>
3462 <a href="/help/internals.bid-merge">
3462 <a href="/help/internals.bid-merge">
3463 bid-merge
3463 bid-merge
3464 </a>
3464 </a>
3465 </td><td>
3465 </td><td>
3466 Bid Merge Algorithm
3466 Bid Merge Algorithm
3467 </td></tr>
3467 </td></tr>
3468 <tr><td>
3468 <tr><td>
3469 <a href="/help/internals.bundle2">
3469 <a href="/help/internals.bundle2">
3470 bundle2
3470 bundle2
3471 </a>
3471 </a>
3472 </td><td>
3472 </td><td>
3473 Bundle2
3473 Bundle2
3474 </td></tr>
3474 </td></tr>
3475 <tr><td>
3475 <tr><td>
3476 <a href="/help/internals.bundles">
3476 <a href="/help/internals.bundles">
3477 bundles
3477 bundles
3478 </a>
3478 </a>
3479 </td><td>
3479 </td><td>
3480 Bundles
3480 Bundles
3481 </td></tr>
3481 </td></tr>
3482 <tr><td>
3482 <tr><td>
3483 <a href="/help/internals.cbor">
3483 <a href="/help/internals.cbor">
3484 cbor
3484 cbor
3485 </a>
3485 </a>
3486 </td><td>
3486 </td><td>
3487 CBOR
3487 CBOR
3488 </td></tr>
3488 </td></tr>
3489 <tr><td>
3489 <tr><td>
3490 <a href="/help/internals.censor">
3490 <a href="/help/internals.censor">
3491 censor
3491 censor
3492 </a>
3492 </a>
3493 </td><td>
3493 </td><td>
3494 Censor
3494 Censor
3495 </td></tr>
3495 </td></tr>
3496 <tr><td>
3496 <tr><td>
3497 <a href="/help/internals.changegroups">
3497 <a href="/help/internals.changegroups">
3498 changegroups
3498 changegroups
3499 </a>
3499 </a>
3500 </td><td>
3500 </td><td>
3501 Changegroups
3501 Changegroups
3502 </td></tr>
3502 </td></tr>
3503 <tr><td>
3503 <tr><td>
3504 <a href="/help/internals.config">
3504 <a href="/help/internals.config">
3505 config
3505 config
3506 </a>
3506 </a>
3507 </td><td>
3507 </td><td>
3508 Config Registrar
3508 Config Registrar
3509 </td></tr>
3509 </td></tr>
3510 <tr><td>
3510 <tr><td>
3511 <a href="/help/internals.extensions">
3511 <a href="/help/internals.extensions">
3512 extensions
3512 extensions
3513 </a>
3513 </a>
3514 </td><td>
3514 </td><td>
3515 Extension API
3515 Extension API
3516 </td></tr>
3516 </td></tr>
3517 <tr><td>
3517 <tr><td>
3518 <a href="/help/internals.mergestate">
3518 <a href="/help/internals.mergestate">
3519 mergestate
3519 mergestate
3520 </a>
3520 </a>
3521 </td><td>
3521 </td><td>
3522 Mergestate
3522 Mergestate
3523 </td></tr>
3523 </td></tr>
3524 <tr><td>
3524 <tr><td>
3525 <a href="/help/internals.requirements">
3525 <a href="/help/internals.requirements">
3526 requirements
3526 requirements
3527 </a>
3527 </a>
3528 </td><td>
3528 </td><td>
3529 Repository Requirements
3529 Repository Requirements
3530 </td></tr>
3530 </td></tr>
3531 <tr><td>
3531 <tr><td>
3532 <a href="/help/internals.revlogs">
3532 <a href="/help/internals.revlogs">
3533 revlogs
3533 revlogs
3534 </a>
3534 </a>
3535 </td><td>
3535 </td><td>
3536 Revision Logs
3536 Revision Logs
3537 </td></tr>
3537 </td></tr>
3538 <tr><td>
3538 <tr><td>
3539 <a href="/help/internals.wireprotocol">
3539 <a href="/help/internals.wireprotocol">
3540 wireprotocol
3540 wireprotocol
3541 </a>
3541 </a>
3542 </td><td>
3542 </td><td>
3543 Wire Protocol
3543 Wire Protocol
3544 </td></tr>
3544 </td></tr>
3545 <tr><td>
3545 <tr><td>
3546 <a href="/help/internals.wireprotocolrpc">
3546 <a href="/help/internals.wireprotocolrpc">
3547 wireprotocolrpc
3547 wireprotocolrpc
3548 </a>
3548 </a>
3549 </td><td>
3549 </td><td>
3550 Wire Protocol RPC
3550 Wire Protocol RPC
3551 </td></tr>
3551 </td></tr>
3552 <tr><td>
3552 <tr><td>
3553 <a href="/help/internals.wireprotocolv2">
3553 <a href="/help/internals.wireprotocolv2">
3554 wireprotocolv2
3554 wireprotocolv2
3555 </a>
3555 </a>
3556 </td><td>
3556 </td><td>
3557 Wire Protocol Version 2
3557 Wire Protocol Version 2
3558 </td></tr>
3558 </td></tr>
3559
3559
3560
3560
3561
3561
3562
3562
3563
3563
3564 </table>
3564 </table>
3565 </div>
3565 </div>
3566 </div>
3566 </div>
3567
3567
3568
3568
3569
3569
3570 </body>
3570 </body>
3571 </html>
3571 </html>
3572
3572
3573
3573
3574 Sub-topic topics rendered properly
3574 Sub-topic topics rendered properly
3575
3575
3576 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3576 $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
3577 200 Script output follows
3577 200 Script output follows
3578
3578
3579 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3579 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3580 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3580 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3581 <head>
3581 <head>
3582 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3582 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3583 <meta name="robots" content="index, nofollow" />
3583 <meta name="robots" content="index, nofollow" />
3584 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3584 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3585 <script type="text/javascript" src="/static/mercurial.js"></script>
3585 <script type="text/javascript" src="/static/mercurial.js"></script>
3586
3586
3587 <title>Help: internals.changegroups</title>
3587 <title>Help: internals.changegroups</title>
3588 </head>
3588 </head>
3589 <body>
3589 <body>
3590
3590
3591 <div class="container">
3591 <div class="container">
3592 <div class="menu">
3592 <div class="menu">
3593 <div class="logo">
3593 <div class="logo">
3594 <a href="https://mercurial-scm.org/">
3594 <a href="https://mercurial-scm.org/">
3595 <img src="/static/hglogo.png" alt="mercurial" /></a>
3595 <img src="/static/hglogo.png" alt="mercurial" /></a>
3596 </div>
3596 </div>
3597 <ul>
3597 <ul>
3598 <li><a href="/shortlog">log</a></li>
3598 <li><a href="/shortlog">log</a></li>
3599 <li><a href="/graph">graph</a></li>
3599 <li><a href="/graph">graph</a></li>
3600 <li><a href="/tags">tags</a></li>
3600 <li><a href="/tags">tags</a></li>
3601 <li><a href="/bookmarks">bookmarks</a></li>
3601 <li><a href="/bookmarks">bookmarks</a></li>
3602 <li><a href="/branches">branches</a></li>
3602 <li><a href="/branches">branches</a></li>
3603 </ul>
3603 </ul>
3604 <ul>
3604 <ul>
3605 <li class="active"><a href="/help">help</a></li>
3605 <li class="active"><a href="/help">help</a></li>
3606 </ul>
3606 </ul>
3607 </div>
3607 </div>
3608
3608
3609 <div class="main">
3609 <div class="main">
3610 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3610 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3611 <h3>Help: internals.changegroups</h3>
3611 <h3>Help: internals.changegroups</h3>
3612
3612
3613 <form class="search" action="/log">
3613 <form class="search" action="/log">
3614
3614
3615 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3615 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3616 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3616 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3617 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3617 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3618 </form>
3618 </form>
3619 <div id="doc">
3619 <div id="doc">
3620 <h1>Changegroups</h1>
3620 <h1>Changegroups</h1>
3621 <p>
3621 <p>
3622 Changegroups are representations of repository revlog data, specifically
3622 Changegroups are representations of repository revlog data, specifically
3623 the changelog data, root/flat manifest data, treemanifest data, and
3623 the changelog data, root/flat manifest data, treemanifest data, and
3624 filelogs.
3624 filelogs.
3625 </p>
3625 </p>
3626 <p>
3626 <p>
3627 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3627 There are 3 versions of changegroups: &quot;1&quot;, &quot;2&quot;, and &quot;3&quot;. From a
3628 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3628 high-level, versions &quot;1&quot; and &quot;2&quot; are almost exactly the same, with the
3629 only difference being an additional item in the *delta header*. Version
3629 only difference being an additional item in the *delta header*. Version
3630 &quot;3&quot; adds support for storage flags in the *delta header* and optionally
3630 &quot;3&quot; adds support for storage flags in the *delta header* and optionally
3631 exchanging treemanifests (enabled by setting an option on the
3631 exchanging treemanifests (enabled by setting an option on the
3632 &quot;changegroup&quot; part in the bundle2).
3632 &quot;changegroup&quot; part in the bundle2).
3633 </p>
3633 </p>
3634 <p>
3634 <p>
3635 Changegroups when not exchanging treemanifests consist of 3 logical
3635 Changegroups when not exchanging treemanifests consist of 3 logical
3636 segments:
3636 segments:
3637 </p>
3637 </p>
3638 <pre>
3638 <pre>
3639 +---------------------------------+
3639 +---------------------------------+
3640 | | | |
3640 | | | |
3641 | changeset | manifest | filelogs |
3641 | changeset | manifest | filelogs |
3642 | | | |
3642 | | | |
3643 | | | |
3643 | | | |
3644 +---------------------------------+
3644 +---------------------------------+
3645 </pre>
3645 </pre>
3646 <p>
3646 <p>
3647 When exchanging treemanifests, there are 4 logical segments:
3647 When exchanging treemanifests, there are 4 logical segments:
3648 </p>
3648 </p>
3649 <pre>
3649 <pre>
3650 +-------------------------------------------------+
3650 +-------------------------------------------------+
3651 | | | | |
3651 | | | | |
3652 | changeset | root | treemanifests | filelogs |
3652 | changeset | root | treemanifests | filelogs |
3653 | | manifest | | |
3653 | | manifest | | |
3654 | | | | |
3654 | | | | |
3655 +-------------------------------------------------+
3655 +-------------------------------------------------+
3656 </pre>
3656 </pre>
3657 <p>
3657 <p>
3658 The principle building block of each segment is a *chunk*. A *chunk*
3658 The principle building block of each segment is a *chunk*. A *chunk*
3659 is a framed piece of data:
3659 is a framed piece of data:
3660 </p>
3660 </p>
3661 <pre>
3661 <pre>
3662 +---------------------------------------+
3662 +---------------------------------------+
3663 | | |
3663 | | |
3664 | length | data |
3664 | length | data |
3665 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3665 | (4 bytes) | (&lt;length - 4&gt; bytes) |
3666 | | |
3666 | | |
3667 +---------------------------------------+
3667 +---------------------------------------+
3668 </pre>
3668 </pre>
3669 <p>
3669 <p>
3670 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3670 All integers are big-endian signed integers. Each chunk starts with a 32-bit
3671 integer indicating the length of the entire chunk (including the length field
3671 integer indicating the length of the entire chunk (including the length field
3672 itself).
3672 itself).
3673 </p>
3673 </p>
3674 <p>
3674 <p>
3675 There is a special case chunk that has a value of 0 for the length
3675 There is a special case chunk that has a value of 0 for the length
3676 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3676 (&quot;0x00000000&quot;). We call this an *empty chunk*.
3677 </p>
3677 </p>
3678 <h2>Delta Groups</h2>
3678 <h2>Delta Groups</h2>
3679 <p>
3679 <p>
3680 A *delta group* expresses the content of a revlog as a series of deltas,
3680 A *delta group* expresses the content of a revlog as a series of deltas,
3681 or patches against previous revisions.
3681 or patches against previous revisions.
3682 </p>
3682 </p>
3683 <p>
3683 <p>
3684 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3684 Delta groups consist of 0 or more *chunks* followed by the *empty chunk*
3685 to signal the end of the delta group:
3685 to signal the end of the delta group:
3686 </p>
3686 </p>
3687 <pre>
3687 <pre>
3688 +------------------------------------------------------------------------+
3688 +------------------------------------------------------------------------+
3689 | | | | | |
3689 | | | | | |
3690 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3690 | chunk0 length | chunk0 data | chunk1 length | chunk1 data | 0x0 |
3691 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3691 | (4 bytes) | (various) | (4 bytes) | (various) | (4 bytes) |
3692 | | | | | |
3692 | | | | | |
3693 +------------------------------------------------------------------------+
3693 +------------------------------------------------------------------------+
3694 </pre>
3694 </pre>
3695 <p>
3695 <p>
3696 Each *chunk*'s data consists of the following:
3696 Each *chunk*'s data consists of the following:
3697 </p>
3697 </p>
3698 <pre>
3698 <pre>
3699 +---------------------------------------+
3699 +---------------------------------------+
3700 | | |
3700 | | |
3701 | delta header | delta data |
3701 | delta header | delta data |
3702 | (various by version) | (various) |
3702 | (various by version) | (various) |
3703 | | |
3703 | | |
3704 +---------------------------------------+
3704 +---------------------------------------+
3705 </pre>
3705 </pre>
3706 <p>
3706 <p>
3707 The *delta data* is a series of *delta*s that describe a diff from an existing
3707 The *delta data* is a series of *delta*s that describe a diff from an existing
3708 entry (either that the recipient already has, or previously specified in the
3708 entry (either that the recipient already has, or previously specified in the
3709 bundle/changegroup).
3709 bundle/changegroup).
3710 </p>
3710 </p>
3711 <p>
3711 <p>
3712 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3712 The *delta header* is different between versions &quot;1&quot;, &quot;2&quot;, and
3713 &quot;3&quot; of the changegroup format.
3713 &quot;3&quot; of the changegroup format.
3714 </p>
3714 </p>
3715 <p>
3715 <p>
3716 Version 1 (headerlen=80):
3716 Version 1 (headerlen=80):
3717 </p>
3717 </p>
3718 <pre>
3718 <pre>
3719 +------------------------------------------------------+
3719 +------------------------------------------------------+
3720 | | | | |
3720 | | | | |
3721 | node | p1 node | p2 node | link node |
3721 | node | p1 node | p2 node | link node |
3722 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3722 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3723 | | | | |
3723 | | | | |
3724 +------------------------------------------------------+
3724 +------------------------------------------------------+
3725 </pre>
3725 </pre>
3726 <p>
3726 <p>
3727 Version 2 (headerlen=100):
3727 Version 2 (headerlen=100):
3728 </p>
3728 </p>
3729 <pre>
3729 <pre>
3730 +------------------------------------------------------------------+
3730 +------------------------------------------------------------------+
3731 | | | | | |
3731 | | | | | |
3732 | node | p1 node | p2 node | base node | link node |
3732 | node | p1 node | p2 node | base node | link node |
3733 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3733 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) |
3734 | | | | | |
3734 | | | | | |
3735 +------------------------------------------------------------------+
3735 +------------------------------------------------------------------+
3736 </pre>
3736 </pre>
3737 <p>
3737 <p>
3738 Version 3 (headerlen=102):
3738 Version 3 (headerlen=102):
3739 </p>
3739 </p>
3740 <pre>
3740 <pre>
3741 +------------------------------------------------------------------------------+
3741 +------------------------------------------------------------------------------+
3742 | | | | | | |
3742 | | | | | | |
3743 | node | p1 node | p2 node | base node | link node | flags |
3743 | node | p1 node | p2 node | base node | link node | flags |
3744 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3744 | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (20 bytes) | (2 bytes) |
3745 | | | | | | |
3745 | | | | | | |
3746 +------------------------------------------------------------------------------+
3746 +------------------------------------------------------------------------------+
3747 </pre>
3747 </pre>
3748 <p>
3748 <p>
3749 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3749 The *delta data* consists of &quot;chunklen - 4 - headerlen&quot; bytes, which contain a
3750 series of *delta*s, densely packed (no separators). These deltas describe a diff
3750 series of *delta*s, densely packed (no separators). These deltas describe a diff
3751 from an existing entry (either that the recipient already has, or previously
3751 from an existing entry (either that the recipient already has, or previously
3752 specified in the bundle/changegroup). The format is described more fully in
3752 specified in the bundle/changegroup). The format is described more fully in
3753 &quot;hg help internals.bdiff&quot;, but briefly:
3753 &quot;hg help internals.bdiff&quot;, but briefly:
3754 </p>
3754 </p>
3755 <pre>
3755 <pre>
3756 +---------------------------------------------------------------+
3756 +---------------------------------------------------------------+
3757 | | | | |
3757 | | | | |
3758 | start offset | end offset | new length | content |
3758 | start offset | end offset | new length | content |
3759 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3759 | (4 bytes) | (4 bytes) | (4 bytes) | (&lt;new length&gt; bytes) |
3760 | | | | |
3760 | | | | |
3761 +---------------------------------------------------------------+
3761 +---------------------------------------------------------------+
3762 </pre>
3762 </pre>
3763 <p>
3763 <p>
3764 Please note that the length field in the delta data does *not* include itself.
3764 Please note that the length field in the delta data does *not* include itself.
3765 </p>
3765 </p>
3766 <p>
3766 <p>
3767 In version 1, the delta is always applied against the previous node from
3767 In version 1, the delta is always applied against the previous node from
3768 the changegroup or the first parent if this is the first entry in the
3768 the changegroup or the first parent if this is the first entry in the
3769 changegroup.
3769 changegroup.
3770 </p>
3770 </p>
3771 <p>
3771 <p>
3772 In version 2 and up, the delta base node is encoded in the entry in the
3772 In version 2 and up, the delta base node is encoded in the entry in the
3773 changegroup. This allows the delta to be expressed against any parent,
3773 changegroup. This allows the delta to be expressed against any parent,
3774 which can result in smaller deltas and more efficient encoding of data.
3774 which can result in smaller deltas and more efficient encoding of data.
3775 </p>
3775 </p>
3776 <p>
3776 <p>
3777 The *flags* field holds bitwise flags affecting the processing of revision
3777 The *flags* field holds bitwise flags affecting the processing of revision
3778 data. The following flags are defined:
3778 data. The following flags are defined:
3779 </p>
3779 </p>
3780 <dl>
3780 <dl>
3781 <dt>32768
3781 <dt>32768
3782 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions.
3782 <dd>Censored revision. The revision's fulltext has been replaced by censor metadata. May only occur on file revisions.
3783 <dt>16384
3783 <dt>16384
3784 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents).
3784 <dd>Ellipsis revision. Revision hash does not match data (likely due to rewritten parents).
3785 <dt>8192
3785 <dt>8192
3786 <dd>Externally stored. The revision fulltext contains &quot;key:value&quot; &quot;\n&quot; delimited metadata defining an object stored elsewhere. Used by the LFS extension.
3786 <dd>Externally stored. The revision fulltext contains &quot;key:value&quot; &quot;\n&quot; delimited metadata defining an object stored elsewhere. Used by the LFS extension.
3787 </dl>
3787 </dl>
3788 <p>
3788 <p>
3789 For historical reasons, the integer values are identical to revlog version 1
3789 For historical reasons, the integer values are identical to revlog version 1
3790 per-revision storage flags and correspond to bits being set in this 2-byte
3790 per-revision storage flags and correspond to bits being set in this 2-byte
3791 field. Bits were allocated starting from the most-significant bit, hence the
3791 field. Bits were allocated starting from the most-significant bit, hence the
3792 reverse ordering and allocation of these flags.
3792 reverse ordering and allocation of these flags.
3793 </p>
3793 </p>
3794 <h2>Changeset Segment</h2>
3794 <h2>Changeset Segment</h2>
3795 <p>
3795 <p>
3796 The *changeset segment* consists of a single *delta group* holding
3796 The *changeset segment* consists of a single *delta group* holding
3797 changelog data. The *empty chunk* at the end of the *delta group* denotes
3797 changelog data. The *empty chunk* at the end of the *delta group* denotes
3798 the boundary to the *manifest segment*.
3798 the boundary to the *manifest segment*.
3799 </p>
3799 </p>
3800 <h2>Manifest Segment</h2>
3800 <h2>Manifest Segment</h2>
3801 <p>
3801 <p>
3802 The *manifest segment* consists of a single *delta group* holding manifest
3802 The *manifest segment* consists of a single *delta group* holding manifest
3803 data. If treemanifests are in use, it contains only the manifest for the
3803 data. If treemanifests are in use, it contains only the manifest for the
3804 root directory of the repository. Otherwise, it contains the entire
3804 root directory of the repository. Otherwise, it contains the entire
3805 manifest data. The *empty chunk* at the end of the *delta group* denotes
3805 manifest data. The *empty chunk* at the end of the *delta group* denotes
3806 the boundary to the next segment (either the *treemanifests segment* or the
3806 the boundary to the next segment (either the *treemanifests segment* or the
3807 *filelogs segment*, depending on version and the request options).
3807 *filelogs segment*, depending on version and the request options).
3808 </p>
3808 </p>
3809 <h3>Treemanifests Segment</h3>
3809 <h3>Treemanifests Segment</h3>
3810 <p>
3810 <p>
3811 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3811 The *treemanifests segment* only exists in changegroup version &quot;3&quot;, and
3812 only if the 'treemanifest' param is part of the bundle2 changegroup part
3812 only if the 'treemanifest' param is part of the bundle2 changegroup part
3813 (it is not possible to use changegroup version 3 outside of bundle2).
3813 (it is not possible to use changegroup version 3 outside of bundle2).
3814 Aside from the filenames in the *treemanifests segment* containing a
3814 Aside from the filenames in the *treemanifests segment* containing a
3815 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3815 trailing &quot;/&quot; character, it behaves identically to the *filelogs segment*
3816 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3816 (see below). The final sub-segment is followed by an *empty chunk* (logically,
3817 a sub-segment with filename size 0). This denotes the boundary to the
3817 a sub-segment with filename size 0). This denotes the boundary to the
3818 *filelogs segment*.
3818 *filelogs segment*.
3819 </p>
3819 </p>
3820 <h2>Filelogs Segment</h2>
3820 <h2>Filelogs Segment</h2>
3821 <p>
3821 <p>
3822 The *filelogs segment* consists of multiple sub-segments, each
3822 The *filelogs segment* consists of multiple sub-segments, each
3823 corresponding to an individual file whose data is being described:
3823 corresponding to an individual file whose data is being described:
3824 </p>
3824 </p>
3825 <pre>
3825 <pre>
3826 +--------------------------------------------------+
3826 +--------------------------------------------------+
3827 | | | | | |
3827 | | | | | |
3828 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3828 | filelog0 | filelog1 | filelog2 | ... | 0x0 |
3829 | | | | | (4 bytes) |
3829 | | | | | (4 bytes) |
3830 | | | | | |
3830 | | | | | |
3831 +--------------------------------------------------+
3831 +--------------------------------------------------+
3832 </pre>
3832 </pre>
3833 <p>
3833 <p>
3834 The final filelog sub-segment is followed by an *empty chunk* (logically,
3834 The final filelog sub-segment is followed by an *empty chunk* (logically,
3835 a sub-segment with filename size 0). This denotes the end of the segment
3835 a sub-segment with filename size 0). This denotes the end of the segment
3836 and of the overall changegroup.
3836 and of the overall changegroup.
3837 </p>
3837 </p>
3838 <p>
3838 <p>
3839 Each filelog sub-segment consists of the following:
3839 Each filelog sub-segment consists of the following:
3840 </p>
3840 </p>
3841 <pre>
3841 <pre>
3842 +------------------------------------------------------+
3842 +------------------------------------------------------+
3843 | | | |
3843 | | | |
3844 | filename length | filename | delta group |
3844 | filename length | filename | delta group |
3845 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3845 | (4 bytes) | (&lt;length - 4&gt; bytes) | (various) |
3846 | | | |
3846 | | | |
3847 +------------------------------------------------------+
3847 +------------------------------------------------------+
3848 </pre>
3848 </pre>
3849 <p>
3849 <p>
3850 That is, a *chunk* consisting of the filename (not terminated or padded)
3850 That is, a *chunk* consisting of the filename (not terminated or padded)
3851 followed by N chunks constituting the *delta group* for this file. The
3851 followed by N chunks constituting the *delta group* for this file. The
3852 *empty chunk* at the end of each *delta group* denotes the boundary to the
3852 *empty chunk* at the end of each *delta group* denotes the boundary to the
3853 next filelog sub-segment.
3853 next filelog sub-segment.
3854 </p>
3854 </p>
3855
3855
3856 </div>
3856 </div>
3857 </div>
3857 </div>
3858 </div>
3858 </div>
3859
3859
3860
3860
3861
3861
3862 </body>
3862 </body>
3863 </html>
3863 </html>
3864
3864
3865
3865
3866 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
3866 $ get-with-headers.py 127.0.0.1:$HGPORT "help/unknowntopic"
3867 404 Not Found
3867 404 Not Found
3868
3868
3869 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3869 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3870 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3870 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
3871 <head>
3871 <head>
3872 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3872 <link rel="icon" href="/static/hgicon.png" type="image/png" />
3873 <meta name="robots" content="index, nofollow" />
3873 <meta name="robots" content="index, nofollow" />
3874 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3874 <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
3875 <script type="text/javascript" src="/static/mercurial.js"></script>
3875 <script type="text/javascript" src="/static/mercurial.js"></script>
3876
3876
3877 <title>test: error</title>
3877 <title>test: error</title>
3878 </head>
3878 </head>
3879 <body>
3879 <body>
3880
3880
3881 <div class="container">
3881 <div class="container">
3882 <div class="menu">
3882 <div class="menu">
3883 <div class="logo">
3883 <div class="logo">
3884 <a href="https://mercurial-scm.org/">
3884 <a href="https://mercurial-scm.org/">
3885 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
3885 <img src="/static/hglogo.png" width=75 height=90 border=0 alt="mercurial" /></a>
3886 </div>
3886 </div>
3887 <ul>
3887 <ul>
3888 <li><a href="/shortlog">log</a></li>
3888 <li><a href="/shortlog">log</a></li>
3889 <li><a href="/graph">graph</a></li>
3889 <li><a href="/graph">graph</a></li>
3890 <li><a href="/tags">tags</a></li>
3890 <li><a href="/tags">tags</a></li>
3891 <li><a href="/bookmarks">bookmarks</a></li>
3891 <li><a href="/bookmarks">bookmarks</a></li>
3892 <li><a href="/branches">branches</a></li>
3892 <li><a href="/branches">branches</a></li>
3893 </ul>
3893 </ul>
3894 <ul>
3894 <ul>
3895 <li><a href="/help">help</a></li>
3895 <li><a href="/help">help</a></li>
3896 </ul>
3896 </ul>
3897 </div>
3897 </div>
3898
3898
3899 <div class="main">
3899 <div class="main">
3900
3900
3901 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3901 <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
3902 <h3>error</h3>
3902 <h3>error</h3>
3903
3903
3904
3904
3905 <form class="search" action="/log">
3905 <form class="search" action="/log">
3906
3906
3907 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3907 <p><input name="rev" id="search1" type="text" size="30" value="" /></p>
3908 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3908 <div id="hint">Find changesets by keywords (author, files, the commit message), revision
3909 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3909 number or hash, or <a href="/help/revsets">revset expression</a>.</div>
3910 </form>
3910 </form>
3911
3911
3912 <div class="description">
3912 <div class="description">
3913 <p>
3913 <p>
3914 An error occurred while processing your request:
3914 An error occurred while processing your request:
3915 </p>
3915 </p>
3916 <p>
3916 <p>
3917 Not Found
3917 Not Found
3918 </p>
3918 </p>
3919 </div>
3919 </div>
3920 </div>
3920 </div>
3921 </div>
3921 </div>
3922
3922
3923
3923
3924
3924
3925 </body>
3925 </body>
3926 </html>
3926 </html>
3927
3927
3928 [1]
3928 [1]
3929
3929
3930 $ killdaemons.py
3930 $ killdaemons.py
3931
3931
3932 #endif
3932 #endif
@@ -1,227 +1,227 b''
1 #testcases flat tree
1 #testcases flat tree
2 $ . "$TESTDIR/narrow-library.sh"
2 $ . "$TESTDIR/narrow-library.sh"
3
3
4 #if tree
4 #if tree
5 $ cat << EOF >> $HGRCPATH
5 $ cat << EOF >> $HGRCPATH
6 > [experimental]
6 > [experimental]
7 > treemanifest = 1
7 > treemanifest = 1
8 > EOF
8 > EOF
9 #endif
9 #endif
10
10
11 $ hg init master
11 $ hg init master
12 $ cd master
12 $ cd master
13 $ cat >> .hg/hgrc <<EOF
13 $ cat >> .hg/hgrc <<EOF
14 > [narrow]
14 > [narrow]
15 > serveellipses=True
15 > serveellipses=True
16 > EOF
16 > EOF
17
17
18 $ mkdir inside
18 $ mkdir inside
19 $ echo 'inside' > inside/f
19 $ echo 'inside' > inside/f
20 $ hg add inside/f
20 $ hg add inside/f
21 $ hg commit -m 'add inside'
21 $ hg commit -m 'add inside'
22
22
23 $ mkdir widest
23 $ mkdir widest
24 $ echo 'widest' > widest/f
24 $ echo 'widest' > widest/f
25 $ hg add widest/f
25 $ hg add widest/f
26 $ hg commit -m 'add widest'
26 $ hg commit -m 'add widest'
27
27
28 $ mkdir outside
28 $ mkdir outside
29 $ echo 'outside' > outside/f
29 $ echo 'outside' > outside/f
30 $ hg add outside/f
30 $ hg add outside/f
31 $ hg commit -m 'add outside'
31 $ hg commit -m 'add outside'
32
32
33 $ cd ..
33 $ cd ..
34
34
35 narrow clone the inside file
35 narrow clone the inside file
36
36
37 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
37 $ hg clone --narrow ssh://user@dummy/master narrow --include inside
38 requesting all changes
38 requesting all changes
39 adding changesets
39 adding changesets
40 adding manifests
40 adding manifests
41 adding file changes
41 adding file changes
42 added 2 changesets with 1 changes to 1 files
42 added 2 changesets with 1 changes to 1 files
43 new changesets *:* (glob)
43 new changesets *:* (glob)
44 updating to branch default
44 updating to branch default
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ cd narrow
46 $ cd narrow
47 $ hg tracked
47 $ hg tracked
48 I path:inside
48 I path:inside
49 $ ls -A
49 $ ls -A
50 .hg
50 .hg
51 inside
51 inside
52 $ cat inside/f
52 $ cat inside/f
53 inside
53 inside
54 $ cd ..
54 $ cd ..
55
55
56 add more upstream files which we will include in a wider narrow spec
56 add more upstream files which we will include in a wider narrow spec
57
57
58 $ cd master
58 $ cd master
59
59
60 $ mkdir wider
60 $ mkdir wider
61 $ echo 'wider' > wider/f
61 $ echo 'wider' > wider/f
62 $ hg add wider/f
62 $ hg add wider/f
63 $ echo 'widest v2' > widest/f
63 $ echo 'widest v2' > widest/f
64 $ hg commit -m 'add wider, update widest'
64 $ hg commit -m 'add wider, update widest'
65
65
66 $ echo 'widest v3' > widest/f
66 $ echo 'widest v3' > widest/f
67 $ hg commit -m 'update widest v3'
67 $ hg commit -m 'update widest v3'
68
68
69 $ echo 'inside v2' > inside/f
69 $ echo 'inside v2' > inside/f
70 $ hg commit -m 'update inside'
70 $ hg commit -m 'update inside'
71
71
72 $ mkdir outside2
72 $ mkdir outside2
73 $ echo 'outside2' > outside2/f
73 $ echo 'outside2' > outside2/f
74 $ hg add outside2/f
74 $ hg add outside2/f
75 $ hg commit -m 'add outside2'
75 $ hg commit -m 'add outside2'
76
76
77 $ echo 'widest v4' > widest/f
77 $ echo 'widest v4' > widest/f
78 $ hg commit -m 'update widest v4'
78 $ hg commit -m 'update widest v4'
79
79
80 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
80 $ hg log -T "{if(ellipsis, '...')}{rev}: {desc}\n"
81 7: update widest v4
81 7: update widest v4
82 6: add outside2
82 6: add outside2
83 5: update inside
83 5: update inside
84 4: update widest v3
84 4: update widest v3
85 3: add wider, update widest
85 3: add wider, update widest
86 2: add outside
86 2: add outside
87 1: add widest
87 1: add widest
88 0: add inside
88 0: add inside
89
89
90 $ cd ..
90 $ cd ..
91
91
92 Testing the --import-rules flag of `hg tracked` command
92 Testing the --import-rules flag of `hg tracked` command
93
93
94 $ cd narrow
94 $ cd narrow
95 $ hg tracked --import-rules
95 $ hg tracked --import-rules
96 hg tracked: option --import-rules requires argument
96 hg tracked: option --import-rules requires argument
97 hg tracked [OPTIONS]... [REMOTE]
97 hg tracked [OPTIONS]... [REMOTE]
98
98
99 show or change the current narrowspec
99 show or change the current narrowspec
100
100
101 options ([+] can be repeated):
101 options ([+] can be repeated):
102
102
103 --addinclude VALUE [+] new paths to include
103 --addinclude VALUE [+] new paths to include
104 --removeinclude VALUE [+] old paths to no longer include
104 --removeinclude VALUE [+] old paths to no longer include
105 --auto-remove-includes automatically choose unused includes to
105 --auto-remove-includes automatically choose unused includes to
106 remove
106 remove
107 --addexclude VALUE [+] new paths to exclude
107 --addexclude VALUE [+] new paths to exclude
108 --import-rules VALUE import narrowspecs from a file
108 --import-rules VALUE import narrowspecs from a file
109 --removeexclude VALUE [+] old paths to no longer exclude
109 --removeexclude VALUE [+] old paths to no longer exclude
110 --clear whether to replace the existing narrowspec
110 --clear whether to replace the existing narrowspec
111 --force-delete-local-changes forces deletion of local changes when
111 --force-delete-local-changes forces deletion of local changes when
112 narrowing
112 narrowing
113 --update-working-copy update working copy when the store has
113 --update-working-copy update working copy when the store has
114 changed
114 changed
115 -e --ssh CMD specify ssh command to use
115 -e --ssh CMD specify ssh command to use
116 --remotecmd CMD specify hg command to run on the remote side
116 --remotecmd CMD specify hg command to run on the remote side
117 --insecure do not verify server certificate (ignoring
117 --insecure do not verify server certificate (ignoring
118 web.cacerts config)
118 web.cacerts config)
119
119
120 (use 'hg tracked -h' to show more help)
120 (use 'hg tracked -h' to show more help)
121 [255]
121 [10]
122 $ hg tracked --import-rules doesnotexist
122 $ hg tracked --import-rules doesnotexist
123 abort: cannot read narrowspecs from '$TESTTMP/narrow/doesnotexist': $ENOENT$
123 abort: cannot read narrowspecs from '$TESTTMP/narrow/doesnotexist': $ENOENT$
124 [50]
124 [50]
125
125
126 $ cat > specs <<EOF
126 $ cat > specs <<EOF
127 > %include foo
127 > %include foo
128 > [include]
128 > [include]
129 > path:widest/
129 > path:widest/
130 > [exclude]
130 > [exclude]
131 > path:inside/
131 > path:inside/
132 > EOF
132 > EOF
133
133
134 $ hg tracked --import-rules specs
134 $ hg tracked --import-rules specs
135 abort: including other spec files using '%include' is not supported in narrowspec
135 abort: including other spec files using '%include' is not supported in narrowspec
136 [10]
136 [10]
137
137
138 $ cat > specs <<EOF
138 $ cat > specs <<EOF
139 > [include]
139 > [include]
140 > outisde
140 > outisde
141 > [exclude]
141 > [exclude]
142 > inside
142 > inside
143 > EOF
143 > EOF
144
144
145 $ hg tracked --import-rules specs
145 $ hg tracked --import-rules specs
146 comparing with ssh://user@dummy/master
146 comparing with ssh://user@dummy/master
147 searching for changes
147 searching for changes
148 looking for local changes to affected paths
148 looking for local changes to affected paths
149 deleting data/inside/f.i
149 deleting data/inside/f.i
150 deleting meta/inside/00manifest.i (tree !)
150 deleting meta/inside/00manifest.i (tree !)
151 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
151 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
152 adding changesets
152 adding changesets
153 adding manifests
153 adding manifests
154 adding file changes
154 adding file changes
155 added 2 changesets with 0 changes to 0 files
155 added 2 changesets with 0 changes to 0 files
156 $ hg tracked
156 $ hg tracked
157 I path:outisde
157 I path:outisde
158 X path:inside
158 X path:inside
159
159
160 Testing the --import-rules flag with --addinclude and --addexclude
160 Testing the --import-rules flag with --addinclude and --addexclude
161
161
162 $ cat > specs <<EOF
162 $ cat > specs <<EOF
163 > [include]
163 > [include]
164 > widest
164 > widest
165 > EOF
165 > EOF
166
166
167 $ hg tracked --import-rules specs --addinclude 'wider/'
167 $ hg tracked --import-rules specs --addinclude 'wider/'
168 comparing with ssh://user@dummy/master
168 comparing with ssh://user@dummy/master
169 searching for changes
169 searching for changes
170 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
170 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
171 adding changesets
171 adding changesets
172 adding manifests
172 adding manifests
173 adding file changes
173 adding file changes
174 added 3 changesets with 1 changes to 1 files
174 added 3 changesets with 1 changes to 1 files
175 $ hg tracked
175 $ hg tracked
176 I path:outisde
176 I path:outisde
177 I path:wider
177 I path:wider
178 I path:widest
178 I path:widest
179 X path:inside
179 X path:inside
180
180
181 $ cat > specs <<EOF
181 $ cat > specs <<EOF
182 > [exclude]
182 > [exclude]
183 > outside2
183 > outside2
184 > EOF
184 > EOF
185
185
186 $ hg tracked --import-rules specs --addexclude 'widest'
186 $ hg tracked --import-rules specs --addexclude 'widest'
187 comparing with ssh://user@dummy/master
187 comparing with ssh://user@dummy/master
188 searching for changes
188 searching for changes
189 looking for local changes to affected paths
189 looking for local changes to affected paths
190 deleting data/widest/f.i
190 deleting data/widest/f.i
191 deleting meta/widest/00manifest.i (tree !)
191 deleting meta/widest/00manifest.i (tree !)
192 $ hg tracked
192 $ hg tracked
193 I path:outisde
193 I path:outisde
194 I path:wider
194 I path:wider
195 X path:inside
195 X path:inside
196 X path:outside2
196 X path:outside2
197 X path:widest
197 X path:widest
198
198
199 $ hg tracked --import-rules specs --clear
199 $ hg tracked --import-rules specs --clear
200 abort: the --clear option is not yet supported
200 abort: the --clear option is not yet supported
201 [10]
201 [10]
202
202
203 Testing with passing a out of wdir file
203 Testing with passing a out of wdir file
204
204
205 $ cat > ../nspecs <<EOF
205 $ cat > ../nspecs <<EOF
206 > [include]
206 > [include]
207 > widest
207 > widest
208 > EOF
208 > EOF
209
209
210 $ hg tracked --import-rules ../nspecs
210 $ hg tracked --import-rules ../nspecs
211 comparing with ssh://user@dummy/master
211 comparing with ssh://user@dummy/master
212 searching for changes
212 searching for changes
213 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
213 saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-widen.hg (glob)
214 adding changesets
214 adding changesets
215 adding manifests
215 adding manifests
216 adding file changes
216 adding file changes
217 added 3 changesets with 0 changes to 0 files
217 added 3 changesets with 0 changes to 0 files
218
218
219 $ cd ..
219 $ cd ..
220
220
221 Testing tracked command on a non-narrow repo
221 Testing tracked command on a non-narrow repo
222
222
223 $ hg init non-narrow
223 $ hg init non-narrow
224 $ cd non-narrow
224 $ cd non-narrow
225 $ hg tracked --addinclude foobar
225 $ hg tracked --addinclude foobar
226 abort: the tracked command is only supported on repositories cloned with --narrow
226 abort: the tracked command is only supported on repositories cloned with --narrow
227 [10]
227 [10]
@@ -1,473 +1,473 b''
1 Create configuration
1 Create configuration
2
2
3 $ echo "[ui]" >> $HGRCPATH
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "interactive=true" >> $HGRCPATH
4 $ echo "interactive=true" >> $HGRCPATH
5
5
6 help record (no record)
6 help record (no record)
7
7
8 $ hg help record
8 $ hg help record
9 record extension - commands to interactively select changes for
9 record extension - commands to interactively select changes for
10 commit/qrefresh (DEPRECATED)
10 commit/qrefresh (DEPRECATED)
11
11
12 The feature provided by this extension has been moved into core Mercurial as
12 The feature provided by this extension has been moved into core Mercurial as
13 'hg commit --interactive'.
13 'hg commit --interactive'.
14
14
15 (use 'hg help extensions' for information on enabling extensions)
15 (use 'hg help extensions' for information on enabling extensions)
16
16
17 help qrecord (no record)
17 help qrecord (no record)
18
18
19 $ hg help qrecord
19 $ hg help qrecord
20 'qrecord' is provided by the following extension:
20 'qrecord' is provided by the following extension:
21
21
22 record commands to interactively select changes for commit/qrefresh
22 record commands to interactively select changes for commit/qrefresh
23 (DEPRECATED)
23 (DEPRECATED)
24
24
25 (use 'hg help extensions' for information on enabling extensions)
25 (use 'hg help extensions' for information on enabling extensions)
26
26
27 $ echo "[extensions]" >> $HGRCPATH
27 $ echo "[extensions]" >> $HGRCPATH
28 $ echo "record=" >> $HGRCPATH
28 $ echo "record=" >> $HGRCPATH
29
29
30 help record (record)
30 help record (record)
31
31
32 $ hg help record
32 $ hg help record
33 hg record [OPTION]... [FILE]...
33 hg record [OPTION]... [FILE]...
34
34
35 interactively select changes to commit
35 interactively select changes to commit
36
36
37 If a list of files is omitted, all changes reported by 'hg status' will be
37 If a list of files is omitted, all changes reported by 'hg status' will be
38 candidates for recording.
38 candidates for recording.
39
39
40 See 'hg help dates' for a list of formats valid for -d/--date.
40 See 'hg help dates' for a list of formats valid for -d/--date.
41
41
42 If using the text interface (see 'hg help config'), you will be prompted
42 If using the text interface (see 'hg help config'), you will be prompted
43 for whether to record changes to each modified file, and for files with
43 for whether to record changes to each modified file, and for files with
44 multiple changes, for each change to use. For each query, the following
44 multiple changes, for each change to use. For each query, the following
45 responses are possible:
45 responses are possible:
46
46
47 y - record this change
47 y - record this change
48 n - skip this change
48 n - skip this change
49 e - edit this change manually
49 e - edit this change manually
50
50
51 s - skip remaining changes to this file
51 s - skip remaining changes to this file
52 f - record remaining changes to this file
52 f - record remaining changes to this file
53
53
54 d - done, skip remaining changes and files
54 d - done, skip remaining changes and files
55 a - record all changes to all remaining files
55 a - record all changes to all remaining files
56 q - quit, recording no changes
56 q - quit, recording no changes
57
57
58 ? - display help
58 ? - display help
59
59
60 This command is not available when committing a merge.
60 This command is not available when committing a merge.
61
61
62 (use 'hg help -e record' to show help for the record extension)
62 (use 'hg help -e record' to show help for the record extension)
63
63
64 options ([+] can be repeated):
64 options ([+] can be repeated):
65
65
66 -A --addremove mark new/missing files as added/removed before
66 -A --addremove mark new/missing files as added/removed before
67 committing
67 committing
68 --close-branch mark a branch head as closed
68 --close-branch mark a branch head as closed
69 --amend amend the parent of the working directory
69 --amend amend the parent of the working directory
70 -s --secret use the secret phase for committing
70 -s --secret use the secret phase for committing
71 -e --edit invoke editor on commit messages
71 -e --edit invoke editor on commit messages
72 -I --include PATTERN [+] include names matching the given patterns
72 -I --include PATTERN [+] include names matching the given patterns
73 -X --exclude PATTERN [+] exclude names matching the given patterns
73 -X --exclude PATTERN [+] exclude names matching the given patterns
74 -m --message TEXT use text as commit message
74 -m --message TEXT use text as commit message
75 -l --logfile FILE read commit message from file
75 -l --logfile FILE read commit message from file
76 -d --date DATE record the specified date as commit date
76 -d --date DATE record the specified date as commit date
77 -u --user USER record the specified user as committer
77 -u --user USER record the specified user as committer
78 -S --subrepos recurse into subrepositories
78 -S --subrepos recurse into subrepositories
79 -w --ignore-all-space ignore white space when comparing lines
79 -w --ignore-all-space ignore white space when comparing lines
80 -b --ignore-space-change ignore changes in the amount of white space
80 -b --ignore-space-change ignore changes in the amount of white space
81 -B --ignore-blank-lines ignore changes whose lines are all blank
81 -B --ignore-blank-lines ignore changes whose lines are all blank
82 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
82 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
83
83
84 (some details hidden, use --verbose to show complete help)
84 (some details hidden, use --verbose to show complete help)
85
85
86 help (no mq, so no qrecord)
86 help (no mq, so no qrecord)
87
87
88 $ hg help qrecord
88 $ hg help qrecord
89 hg qrecord [OPTION]... PATCH [FILE]...
89 hg qrecord [OPTION]... PATCH [FILE]...
90
90
91 interactively record a new patch
91 interactively record a new patch
92
92
93 See 'hg help qnew' & 'hg help record' for more information and usage.
93 See 'hg help qnew' & 'hg help record' for more information and usage.
94
94
95 (some details hidden, use --verbose to show complete help)
95 (some details hidden, use --verbose to show complete help)
96
96
97 $ hg init a
97 $ hg init a
98
98
99 qrecord (mq not present)
99 qrecord (mq not present)
100
100
101 $ hg -R a qrecord
101 $ hg -R a qrecord
102 hg qrecord: invalid arguments
102 hg qrecord: invalid arguments
103 hg qrecord [OPTION]... PATCH [FILE]...
103 hg qrecord [OPTION]... PATCH [FILE]...
104
104
105 interactively record a new patch
105 interactively record a new patch
106
106
107 (use 'hg qrecord -h' to show more help)
107 (use 'hg qrecord -h' to show more help)
108 [255]
108 [10]
109
109
110 qrecord patch (mq not present)
110 qrecord patch (mq not present)
111
111
112 $ hg -R a qrecord patch
112 $ hg -R a qrecord patch
113 abort: 'mq' extension not loaded
113 abort: 'mq' extension not loaded
114 [255]
114 [255]
115
115
116 help (bad mq)
116 help (bad mq)
117
117
118 $ echo "mq=nonexistent" >> $HGRCPATH
118 $ echo "mq=nonexistent" >> $HGRCPATH
119 $ hg help qrecord
119 $ hg help qrecord
120 *** failed to import extension mq from nonexistent: [Errno *] * (glob)
120 *** failed to import extension mq from nonexistent: [Errno *] * (glob)
121 hg qrecord [OPTION]... PATCH [FILE]...
121 hg qrecord [OPTION]... PATCH [FILE]...
122
122
123 interactively record a new patch
123 interactively record a new patch
124
124
125 See 'hg help qnew' & 'hg help record' for more information and usage.
125 See 'hg help qnew' & 'hg help record' for more information and usage.
126
126
127 (some details hidden, use --verbose to show complete help)
127 (some details hidden, use --verbose to show complete help)
128
128
129 help (mq present)
129 help (mq present)
130
130
131 $ sed 's/mq=nonexistent/mq=/' $HGRCPATH > hgrc.tmp
131 $ sed 's/mq=nonexistent/mq=/' $HGRCPATH > hgrc.tmp
132 $ mv hgrc.tmp $HGRCPATH
132 $ mv hgrc.tmp $HGRCPATH
133
133
134 $ hg help qrecord
134 $ hg help qrecord
135 hg qrecord [OPTION]... PATCH [FILE]...
135 hg qrecord [OPTION]... PATCH [FILE]...
136
136
137 interactively record a new patch
137 interactively record a new patch
138
138
139 See 'hg help qnew' & 'hg help record' for more information and usage.
139 See 'hg help qnew' & 'hg help record' for more information and usage.
140
140
141 options ([+] can be repeated):
141 options ([+] can be repeated):
142
142
143 -e --edit invoke editor on commit messages
143 -e --edit invoke editor on commit messages
144 -g --git use git extended diff format
144 -g --git use git extended diff format
145 -U --currentuser add "From: <current user>" to patch
145 -U --currentuser add "From: <current user>" to patch
146 -u --user USER add "From: <USER>" to patch
146 -u --user USER add "From: <USER>" to patch
147 -D --currentdate add "Date: <current date>" to patch
147 -D --currentdate add "Date: <current date>" to patch
148 -d --date DATE add "Date: <DATE>" to patch
148 -d --date DATE add "Date: <DATE>" to patch
149 -I --include PATTERN [+] include names matching the given patterns
149 -I --include PATTERN [+] include names matching the given patterns
150 -X --exclude PATTERN [+] exclude names matching the given patterns
150 -X --exclude PATTERN [+] exclude names matching the given patterns
151 -m --message TEXT use text as commit message
151 -m --message TEXT use text as commit message
152 -l --logfile FILE read commit message from file
152 -l --logfile FILE read commit message from file
153 -w --ignore-all-space ignore white space when comparing lines
153 -w --ignore-all-space ignore white space when comparing lines
154 -b --ignore-space-change ignore changes in the amount of white space
154 -b --ignore-space-change ignore changes in the amount of white space
155 -B --ignore-blank-lines ignore changes whose lines are all blank
155 -B --ignore-blank-lines ignore changes whose lines are all blank
156 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
156 -Z --ignore-space-at-eol ignore changes in whitespace at EOL
157 --mq operate on patch repository
157 --mq operate on patch repository
158
158
159 (some details hidden, use --verbose to show complete help)
159 (some details hidden, use --verbose to show complete help)
160
160
161 $ cd a
161 $ cd a
162
162
163 Base commit
163 Base commit
164
164
165 $ cat > 1.txt <<EOF
165 $ cat > 1.txt <<EOF
166 > 1
166 > 1
167 > 2
167 > 2
168 > 3
168 > 3
169 > 4
169 > 4
170 > 5
170 > 5
171 > EOF
171 > EOF
172 $ cat > 2.txt <<EOF
172 $ cat > 2.txt <<EOF
173 > a
173 > a
174 > b
174 > b
175 > c
175 > c
176 > d
176 > d
177 > e
177 > e
178 > f
178 > f
179 > EOF
179 > EOF
180
180
181 $ mkdir dir
181 $ mkdir dir
182 $ cat > dir/a.txt <<EOF
182 $ cat > dir/a.txt <<EOF
183 > hello world
183 > hello world
184 >
184 >
185 > someone
185 > someone
186 > up
186 > up
187 > there
187 > there
188 > loves
188 > loves
189 > me
189 > me
190 > EOF
190 > EOF
191
191
192 $ hg add 1.txt 2.txt dir/a.txt
192 $ hg add 1.txt 2.txt dir/a.txt
193 $ hg commit -m 'initial checkin'
193 $ hg commit -m 'initial checkin'
194
194
195 Changing files
195 Changing files
196
196
197 $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
197 $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
198 $ sed -e 's/b/b b/' 2.txt > 2.txt.new
198 $ sed -e 's/b/b b/' 2.txt > 2.txt.new
199 $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
199 $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
200
200
201 $ mv -f 1.txt.new 1.txt
201 $ mv -f 1.txt.new 1.txt
202 $ mv -f 2.txt.new 2.txt
202 $ mv -f 2.txt.new 2.txt
203 $ mv -f dir/a.txt.new dir/a.txt
203 $ mv -f dir/a.txt.new dir/a.txt
204
204
205 Whole diff
205 Whole diff
206
206
207 $ hg diff --nodates
207 $ hg diff --nodates
208 diff -r 1057167b20ef 1.txt
208 diff -r 1057167b20ef 1.txt
209 --- a/1.txt
209 --- a/1.txt
210 +++ b/1.txt
210 +++ b/1.txt
211 @@ -1,5 +1,5 @@
211 @@ -1,5 +1,5 @@
212 1
212 1
213 -2
213 -2
214 +2 2
214 +2 2
215 3
215 3
216 -4
216 -4
217 +4 4
217 +4 4
218 5
218 5
219 diff -r 1057167b20ef 2.txt
219 diff -r 1057167b20ef 2.txt
220 --- a/2.txt
220 --- a/2.txt
221 +++ b/2.txt
221 +++ b/2.txt
222 @@ -1,5 +1,5 @@
222 @@ -1,5 +1,5 @@
223 a
223 a
224 -b
224 -b
225 +b b
225 +b b
226 c
226 c
227 d
227 d
228 e
228 e
229 diff -r 1057167b20ef dir/a.txt
229 diff -r 1057167b20ef dir/a.txt
230 --- a/dir/a.txt
230 --- a/dir/a.txt
231 +++ b/dir/a.txt
231 +++ b/dir/a.txt
232 @@ -1,4 +1,4 @@
232 @@ -1,4 +1,4 @@
233 -hello world
233 -hello world
234 +hello world!
234 +hello world!
235
235
236 someone
236 someone
237 up
237 up
238
238
239 qrecord with bad patch name, should abort before prompting
239 qrecord with bad patch name, should abort before prompting
240
240
241 $ hg qrecord .hg
241 $ hg qrecord .hg
242 abort: patch name cannot begin with ".hg"
242 abort: patch name cannot begin with ".hg"
243 [255]
243 [255]
244 $ hg qrecord ' foo'
244 $ hg qrecord ' foo'
245 abort: patch name cannot begin or end with whitespace
245 abort: patch name cannot begin or end with whitespace
246 [255]
246 [255]
247 $ hg qrecord 'foo '
247 $ hg qrecord 'foo '
248 abort: patch name cannot begin or end with whitespace
248 abort: patch name cannot begin or end with whitespace
249 [255]
249 [255]
250
250
251 qrecord a.patch
251 qrecord a.patch
252
252
253 $ hg qrecord -d '0 0' -m aaa a.patch <<EOF
253 $ hg qrecord -d '0 0' -m aaa a.patch <<EOF
254 > y
254 > y
255 > y
255 > y
256 > n
256 > n
257 > y
257 > y
258 > y
258 > y
259 > n
259 > n
260 > EOF
260 > EOF
261 diff --git a/1.txt b/1.txt
261 diff --git a/1.txt b/1.txt
262 2 hunks, 2 lines changed
262 2 hunks, 2 lines changed
263 examine changes to '1.txt'?
263 examine changes to '1.txt'?
264 (enter ? for help) [Ynesfdaq?] y
264 (enter ? for help) [Ynesfdaq?] y
265
265
266 @@ -1,3 +1,3 @@
266 @@ -1,3 +1,3 @@
267 1
267 1
268 -2
268 -2
269 +2 2
269 +2 2
270 3
270 3
271 record change 1/4 to '1.txt'?
271 record change 1/4 to '1.txt'?
272 (enter ? for help) [Ynesfdaq?] y
272 (enter ? for help) [Ynesfdaq?] y
273
273
274 @@ -3,3 +3,3 @@
274 @@ -3,3 +3,3 @@
275 3
275 3
276 -4
276 -4
277 +4 4
277 +4 4
278 5
278 5
279 record change 2/4 to '1.txt'?
279 record change 2/4 to '1.txt'?
280 (enter ? for help) [Ynesfdaq?] n
280 (enter ? for help) [Ynesfdaq?] n
281
281
282 diff --git a/2.txt b/2.txt
282 diff --git a/2.txt b/2.txt
283 1 hunks, 1 lines changed
283 1 hunks, 1 lines changed
284 examine changes to '2.txt'?
284 examine changes to '2.txt'?
285 (enter ? for help) [Ynesfdaq?] y
285 (enter ? for help) [Ynesfdaq?] y
286
286
287 @@ -1,5 +1,5 @@
287 @@ -1,5 +1,5 @@
288 a
288 a
289 -b
289 -b
290 +b b
290 +b b
291 c
291 c
292 d
292 d
293 e
293 e
294 record change 3/4 to '2.txt'?
294 record change 3/4 to '2.txt'?
295 (enter ? for help) [Ynesfdaq?] y
295 (enter ? for help) [Ynesfdaq?] y
296
296
297 diff --git a/dir/a.txt b/dir/a.txt
297 diff --git a/dir/a.txt b/dir/a.txt
298 1 hunks, 1 lines changed
298 1 hunks, 1 lines changed
299 examine changes to 'dir/a.txt'?
299 examine changes to 'dir/a.txt'?
300 (enter ? for help) [Ynesfdaq?] n
300 (enter ? for help) [Ynesfdaq?] n
301
301
302
302
303 After qrecord a.patch 'tip'"
303 After qrecord a.patch 'tip'"
304
304
305 $ hg tip -p
305 $ hg tip -p
306 changeset: 1:5d1ca63427ee
306 changeset: 1:5d1ca63427ee
307 tag: a.patch
307 tag: a.patch
308 tag: qbase
308 tag: qbase
309 tag: qtip
309 tag: qtip
310 tag: tip
310 tag: tip
311 user: test
311 user: test
312 date: Thu Jan 01 00:00:00 1970 +0000
312 date: Thu Jan 01 00:00:00 1970 +0000
313 summary: aaa
313 summary: aaa
314
314
315 diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
315 diff -r 1057167b20ef -r 5d1ca63427ee 1.txt
316 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
316 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
317 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
317 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
318 @@ -1,5 +1,5 @@
318 @@ -1,5 +1,5 @@
319 1
319 1
320 -2
320 -2
321 +2 2
321 +2 2
322 3
322 3
323 4
323 4
324 5
324 5
325 diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
325 diff -r 1057167b20ef -r 5d1ca63427ee 2.txt
326 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
326 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
327 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
327 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
328 @@ -1,5 +1,5 @@
328 @@ -1,5 +1,5 @@
329 a
329 a
330 -b
330 -b
331 +b b
331 +b b
332 c
332 c
333 d
333 d
334 e
334 e
335
335
336
336
337 After qrecord a.patch 'diff'"
337 After qrecord a.patch 'diff'"
338
338
339 $ hg diff --nodates
339 $ hg diff --nodates
340 diff -r 5d1ca63427ee 1.txt
340 diff -r 5d1ca63427ee 1.txt
341 --- a/1.txt
341 --- a/1.txt
342 +++ b/1.txt
342 +++ b/1.txt
343 @@ -1,5 +1,5 @@
343 @@ -1,5 +1,5 @@
344 1
344 1
345 2 2
345 2 2
346 3
346 3
347 -4
347 -4
348 +4 4
348 +4 4
349 5
349 5
350 diff -r 5d1ca63427ee dir/a.txt
350 diff -r 5d1ca63427ee dir/a.txt
351 --- a/dir/a.txt
351 --- a/dir/a.txt
352 +++ b/dir/a.txt
352 +++ b/dir/a.txt
353 @@ -1,4 +1,4 @@
353 @@ -1,4 +1,4 @@
354 -hello world
354 -hello world
355 +hello world!
355 +hello world!
356
356
357 someone
357 someone
358 up
358 up
359
359
360 qrecord b.patch
360 qrecord b.patch
361
361
362 $ hg qrecord -d '0 0' -m bbb b.patch <<EOF
362 $ hg qrecord -d '0 0' -m bbb b.patch <<EOF
363 > y
363 > y
364 > y
364 > y
365 > y
365 > y
366 > y
366 > y
367 > EOF
367 > EOF
368 diff --git a/1.txt b/1.txt
368 diff --git a/1.txt b/1.txt
369 1 hunks, 1 lines changed
369 1 hunks, 1 lines changed
370 examine changes to '1.txt'?
370 examine changes to '1.txt'?
371 (enter ? for help) [Ynesfdaq?] y
371 (enter ? for help) [Ynesfdaq?] y
372
372
373 @@ -1,5 +1,5 @@
373 @@ -1,5 +1,5 @@
374 1
374 1
375 2 2
375 2 2
376 3
376 3
377 -4
377 -4
378 +4 4
378 +4 4
379 5
379 5
380 record change 1/2 to '1.txt'?
380 record change 1/2 to '1.txt'?
381 (enter ? for help) [Ynesfdaq?] y
381 (enter ? for help) [Ynesfdaq?] y
382
382
383 diff --git a/dir/a.txt b/dir/a.txt
383 diff --git a/dir/a.txt b/dir/a.txt
384 1 hunks, 1 lines changed
384 1 hunks, 1 lines changed
385 examine changes to 'dir/a.txt'?
385 examine changes to 'dir/a.txt'?
386 (enter ? for help) [Ynesfdaq?] y
386 (enter ? for help) [Ynesfdaq?] y
387
387
388 @@ -1,4 +1,4 @@
388 @@ -1,4 +1,4 @@
389 -hello world
389 -hello world
390 +hello world!
390 +hello world!
391
391
392 someone
392 someone
393 up
393 up
394 record change 2/2 to 'dir/a.txt'?
394 record change 2/2 to 'dir/a.txt'?
395 (enter ? for help) [Ynesfdaq?] y
395 (enter ? for help) [Ynesfdaq?] y
396
396
397
397
398 After qrecord b.patch 'tip'
398 After qrecord b.patch 'tip'
399
399
400 $ hg tip -p
400 $ hg tip -p
401 changeset: 2:b056198bf878
401 changeset: 2:b056198bf878
402 tag: b.patch
402 tag: b.patch
403 tag: qtip
403 tag: qtip
404 tag: tip
404 tag: tip
405 user: test
405 user: test
406 date: Thu Jan 01 00:00:00 1970 +0000
406 date: Thu Jan 01 00:00:00 1970 +0000
407 summary: bbb
407 summary: bbb
408
408
409 diff -r 5d1ca63427ee -r b056198bf878 1.txt
409 diff -r 5d1ca63427ee -r b056198bf878 1.txt
410 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
410 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
411 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
411 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
412 @@ -1,5 +1,5 @@
412 @@ -1,5 +1,5 @@
413 1
413 1
414 2 2
414 2 2
415 3
415 3
416 -4
416 -4
417 +4 4
417 +4 4
418 5
418 5
419 diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
419 diff -r 5d1ca63427ee -r b056198bf878 dir/a.txt
420 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
420 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
421 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
421 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
422 @@ -1,4 +1,4 @@
422 @@ -1,4 +1,4 @@
423 -hello world
423 -hello world
424 +hello world!
424 +hello world!
425
425
426 someone
426 someone
427 up
427 up
428
428
429
429
430 After qrecord b.patch 'diff'
430 After qrecord b.patch 'diff'
431
431
432 $ hg diff --nodates
432 $ hg diff --nodates
433
433
434 $ cd ..
434 $ cd ..
435
435
436 qrecord should throw an error when histedit in process
436 qrecord should throw an error when histedit in process
437
437
438 $ hg init issue5981
438 $ hg init issue5981
439 $ cd issue5981
439 $ cd issue5981
440 $ cat >> $HGRCPATH <<EOF
440 $ cat >> $HGRCPATH <<EOF
441 > [extensions]
441 > [extensions]
442 > histedit=
442 > histedit=
443 > mq=
443 > mq=
444 > EOF
444 > EOF
445 $ echo > a
445 $ echo > a
446 $ hg ci -Am 'foo bar'
446 $ hg ci -Am 'foo bar'
447 adding a
447 adding a
448 $ hg log
448 $ hg log
449 changeset: 0:ea55e2ae468f
449 changeset: 0:ea55e2ae468f
450 tag: tip
450 tag: tip
451 user: test
451 user: test
452 date: Thu Jan 01 00:00:00 1970 +0000
452 date: Thu Jan 01 00:00:00 1970 +0000
453 summary: foo bar
453 summary: foo bar
454
454
455 $ hg histedit tip --commands - 2>&1 <<EOF
455 $ hg histedit tip --commands - 2>&1 <<EOF
456 > edit ea55e2ae468f foo bar
456 > edit ea55e2ae468f foo bar
457 > EOF
457 > EOF
458 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
458 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
459 Editing (ea55e2ae468f), commit as needed now to split the change
459 Editing (ea55e2ae468f), commit as needed now to split the change
460 (to edit ea55e2ae468f, `hg histedit --continue` after making changes)
460 (to edit ea55e2ae468f, `hg histedit --continue` after making changes)
461 [240]
461 [240]
462 $ echo 'foo bar' > a
462 $ echo 'foo bar' > a
463 $ hg qrecord -d '0 0' -m aaa a.patch <<EOF
463 $ hg qrecord -d '0 0' -m aaa a.patch <<EOF
464 > y
464 > y
465 > y
465 > y
466 > n
466 > n
467 > y
467 > y
468 > y
468 > y
469 > n
469 > n
470 > EOF
470 > EOF
471 abort: histedit in progress
471 abort: histedit in progress
472 (use 'hg histedit --continue' or 'hg histedit --abort')
472 (use 'hg histedit --continue' or 'hg histedit --abort')
473 [20]
473 [20]
@@ -1,579 +1,579 b''
1 setup
1 setup
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > share =
5 > share =
6 > [format]
6 > [format]
7 > exp-share-safe = True
7 > exp-share-safe = True
8 > EOF
8 > EOF
9
9
10 prepare source repo
10 prepare source repo
11
11
12 $ hg init source
12 $ hg init source
13 $ cd source
13 $ cd source
14 $ cat .hg/requires
14 $ cat .hg/requires
15 exp-sharesafe
15 exp-sharesafe
16 $ cat .hg/store/requires
16 $ cat .hg/store/requires
17 dotencode
17 dotencode
18 fncache
18 fncache
19 generaldelta
19 generaldelta
20 revlogv1
20 revlogv1
21 sparserevlog
21 sparserevlog
22 store
22 store
23 $ hg debugrequirements
23 $ hg debugrequirements
24 dotencode
24 dotencode
25 exp-sharesafe
25 exp-sharesafe
26 fncache
26 fncache
27 generaldelta
27 generaldelta
28 revlogv1
28 revlogv1
29 sparserevlog
29 sparserevlog
30 store
30 store
31
31
32 $ echo a > a
32 $ echo a > a
33 $ hg ci -Aqm "added a"
33 $ hg ci -Aqm "added a"
34 $ echo b > b
34 $ echo b > b
35 $ hg ci -Aqm "added b"
35 $ hg ci -Aqm "added b"
36
36
37 $ HGEDITOR=cat hg config --shared
37 $ HGEDITOR=cat hg config --shared
38 abort: repository is not shared; can't use --shared
38 abort: repository is not shared; can't use --shared
39 [10]
39 [10]
40 $ cd ..
40 $ cd ..
41
41
42 Create a shared repo and check the requirements are shared and read correctly
42 Create a shared repo and check the requirements are shared and read correctly
43 $ hg share source shared1
43 $ hg share source shared1
44 updating working directory
44 updating working directory
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 $ cd shared1
46 $ cd shared1
47 $ cat .hg/requires
47 $ cat .hg/requires
48 exp-sharesafe
48 exp-sharesafe
49 shared
49 shared
50
50
51 $ hg debugrequirements -R ../source
51 $ hg debugrequirements -R ../source
52 dotencode
52 dotencode
53 exp-sharesafe
53 exp-sharesafe
54 fncache
54 fncache
55 generaldelta
55 generaldelta
56 revlogv1
56 revlogv1
57 sparserevlog
57 sparserevlog
58 store
58 store
59
59
60 $ hg debugrequirements
60 $ hg debugrequirements
61 dotencode
61 dotencode
62 exp-sharesafe
62 exp-sharesafe
63 fncache
63 fncache
64 generaldelta
64 generaldelta
65 revlogv1
65 revlogv1
66 shared
66 shared
67 sparserevlog
67 sparserevlog
68 store
68 store
69
69
70 $ echo c > c
70 $ echo c > c
71 $ hg ci -Aqm "added c"
71 $ hg ci -Aqm "added c"
72
72
73 Check that config of the source repository is also loaded
73 Check that config of the source repository is also loaded
74
74
75 $ hg showconfig ui.curses
75 $ hg showconfig ui.curses
76 [1]
76 [1]
77
77
78 $ echo "[ui]" >> ../source/.hg/hgrc
78 $ echo "[ui]" >> ../source/.hg/hgrc
79 $ echo "curses=true" >> ../source/.hg/hgrc
79 $ echo "curses=true" >> ../source/.hg/hgrc
80
80
81 $ hg showconfig ui.curses
81 $ hg showconfig ui.curses
82 true
82 true
83
83
84 Test that extensions of source repository are also loaded
84 Test that extensions of source repository are also loaded
85
85
86 $ hg debugextensions
86 $ hg debugextensions
87 share
87 share
88 $ hg extdiff -p echo
88 $ hg extdiff -p echo
89 hg: unknown command 'extdiff'
89 hg: unknown command 'extdiff'
90 'extdiff' is provided by the following extension:
90 'extdiff' is provided by the following extension:
91
91
92 extdiff command to allow external programs to compare revisions
92 extdiff command to allow external programs to compare revisions
93
93
94 (use 'hg help extensions' for information on enabling extensions)
94 (use 'hg help extensions' for information on enabling extensions)
95 [255]
95 [10]
96
96
97 $ echo "[extensions]" >> ../source/.hg/hgrc
97 $ echo "[extensions]" >> ../source/.hg/hgrc
98 $ echo "extdiff=" >> ../source/.hg/hgrc
98 $ echo "extdiff=" >> ../source/.hg/hgrc
99
99
100 $ hg debugextensions -R ../source
100 $ hg debugextensions -R ../source
101 extdiff
101 extdiff
102 share
102 share
103 $ hg extdiff -R ../source -p echo
103 $ hg extdiff -R ../source -p echo
104
104
105 BROKEN: the command below will not work if config of shared source is not loaded
105 BROKEN: the command below will not work if config of shared source is not loaded
106 on dispatch but debugextensions says that extension
106 on dispatch but debugextensions says that extension
107 is loaded
107 is loaded
108 $ hg debugextensions
108 $ hg debugextensions
109 extdiff
109 extdiff
110 share
110 share
111
111
112 $ hg extdiff -p echo
112 $ hg extdiff -p echo
113
113
114 However, local .hg/hgrc should override the config set by share source
114 However, local .hg/hgrc should override the config set by share source
115
115
116 $ echo "[ui]" >> .hg/hgrc
116 $ echo "[ui]" >> .hg/hgrc
117 $ echo "curses=false" >> .hg/hgrc
117 $ echo "curses=false" >> .hg/hgrc
118
118
119 $ hg showconfig ui.curses
119 $ hg showconfig ui.curses
120 false
120 false
121
121
122 $ HGEDITOR=cat hg config --shared
122 $ HGEDITOR=cat hg config --shared
123 [ui]
123 [ui]
124 curses=true
124 curses=true
125 [extensions]
125 [extensions]
126 extdiff=
126 extdiff=
127
127
128 $ HGEDITOR=cat hg config --local
128 $ HGEDITOR=cat hg config --local
129 [ui]
129 [ui]
130 curses=false
130 curses=false
131
131
132 Testing that hooks set in source repository also runs in shared repo
132 Testing that hooks set in source repository also runs in shared repo
133
133
134 $ cd ../source
134 $ cd ../source
135 $ cat <<EOF >> .hg/hgrc
135 $ cat <<EOF >> .hg/hgrc
136 > [extensions]
136 > [extensions]
137 > hooklib=
137 > hooklib=
138 > [hooks]
138 > [hooks]
139 > pretxnchangegroup.reject_merge_commits = \
139 > pretxnchangegroup.reject_merge_commits = \
140 > python:hgext.hooklib.reject_merge_commits.hook
140 > python:hgext.hooklib.reject_merge_commits.hook
141 > EOF
141 > EOF
142
142
143 $ cd ..
143 $ cd ..
144 $ hg clone source cloned
144 $ hg clone source cloned
145 updating to branch default
145 updating to branch default
146 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 $ cd cloned
147 $ cd cloned
148 $ hg up 0
148 $ hg up 0
149 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
149 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
150 $ echo bar > bar
150 $ echo bar > bar
151 $ hg ci -Aqm "added bar"
151 $ hg ci -Aqm "added bar"
152 $ hg merge
152 $ hg merge
153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
154 (branch merge, don't forget to commit)
154 (branch merge, don't forget to commit)
155 $ hg ci -m "merge commit"
155 $ hg ci -m "merge commit"
156
156
157 $ hg push ../source
157 $ hg push ../source
158 pushing to ../source
158 pushing to ../source
159 searching for changes
159 searching for changes
160 adding changesets
160 adding changesets
161 adding manifests
161 adding manifests
162 adding file changes
162 adding file changes
163 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
163 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
164 transaction abort!
164 transaction abort!
165 rollback completed
165 rollback completed
166 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
166 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
167 [255]
167 [255]
168
168
169 $ hg push ../shared1
169 $ hg push ../shared1
170 pushing to ../shared1
170 pushing to ../shared1
171 searching for changes
171 searching for changes
172 adding changesets
172 adding changesets
173 adding manifests
173 adding manifests
174 adding file changes
174 adding file changes
175 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
175 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
176 transaction abort!
176 transaction abort!
177 rollback completed
177 rollback completed
178 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
178 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
179 [255]
179 [255]
180
180
181 Test that if share source config is untrusted, we dont read it
181 Test that if share source config is untrusted, we dont read it
182
182
183 $ cd ../shared1
183 $ cd ../shared1
184
184
185 $ cat << EOF > $TESTTMP/untrusted.py
185 $ cat << EOF > $TESTTMP/untrusted.py
186 > from mercurial import scmutil, util
186 > from mercurial import scmutil, util
187 > def uisetup(ui):
187 > def uisetup(ui):
188 > class untrustedui(ui.__class__):
188 > class untrustedui(ui.__class__):
189 > def _trusted(self, fp, f):
189 > def _trusted(self, fp, f):
190 > if util.normpath(fp.name).endswith(b'source/.hg/hgrc'):
190 > if util.normpath(fp.name).endswith(b'source/.hg/hgrc'):
191 > return False
191 > return False
192 > return super(untrustedui, self)._trusted(fp, f)
192 > return super(untrustedui, self)._trusted(fp, f)
193 > ui.__class__ = untrustedui
193 > ui.__class__ = untrustedui
194 > EOF
194 > EOF
195
195
196 $ hg showconfig hooks
196 $ hg showconfig hooks
197 hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook
197 hooks.pretxnchangegroup.reject_merge_commits=python:hgext.hooklib.reject_merge_commits.hook
198
198
199 $ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py
199 $ hg showconfig hooks --config extensions.untrusted=$TESTTMP/untrusted.py
200 [1]
200 [1]
201
201
202 Update the source repository format and check that shared repo works
202 Update the source repository format and check that shared repo works
203
203
204 $ cd ../source
204 $ cd ../source
205
205
206 Disable zstd related tests because its not present on pure version
206 Disable zstd related tests because its not present on pure version
207 #if zstd
207 #if zstd
208 $ echo "[format]" >> .hg/hgrc
208 $ echo "[format]" >> .hg/hgrc
209 $ echo "revlog-compression=zstd" >> .hg/hgrc
209 $ echo "revlog-compression=zstd" >> .hg/hgrc
210
210
211 $ hg debugupgraderepo --run -q
211 $ hg debugupgraderepo --run -q
212 upgrade will perform the following actions:
212 upgrade will perform the following actions:
213
213
214 requirements
214 requirements
215 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store
215 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store
216 added: revlog-compression-zstd
216 added: revlog-compression-zstd
217
217
218 processed revlogs:
218 processed revlogs:
219 - all-filelogs
219 - all-filelogs
220 - changelog
220 - changelog
221 - manifest
221 - manifest
222
222
223 $ hg log -r .
223 $ hg log -r .
224 changeset: 1:5f6d8a4bf34a
224 changeset: 1:5f6d8a4bf34a
225 user: test
225 user: test
226 date: Thu Jan 01 00:00:00 1970 +0000
226 date: Thu Jan 01 00:00:00 1970 +0000
227 summary: added b
227 summary: added b
228
228
229 #endif
229 #endif
230 $ echo "[format]" >> .hg/hgrc
230 $ echo "[format]" >> .hg/hgrc
231 $ echo "use-persistent-nodemap=True" >> .hg/hgrc
231 $ echo "use-persistent-nodemap=True" >> .hg/hgrc
232
232
233 $ hg debugupgraderepo --run -q -R ../shared1
233 $ hg debugupgraderepo --run -q -R ../shared1
234 abort: cannot upgrade repository; unsupported source requirement: shared
234 abort: cannot upgrade repository; unsupported source requirement: shared
235 [255]
235 [255]
236
236
237 $ hg debugupgraderepo --run -q
237 $ hg debugupgraderepo --run -q
238 upgrade will perform the following actions:
238 upgrade will perform the following actions:
239
239
240 requirements
240 requirements
241 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
241 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store (no-zstd !)
242 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
242 preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !)
243 added: persistent-nodemap
243 added: persistent-nodemap
244
244
245 processed revlogs:
245 processed revlogs:
246 - all-filelogs
246 - all-filelogs
247 - changelog
247 - changelog
248 - manifest
248 - manifest
249
249
250 $ hg log -r .
250 $ hg log -r .
251 changeset: 1:5f6d8a4bf34a
251 changeset: 1:5f6d8a4bf34a
252 user: test
252 user: test
253 date: Thu Jan 01 00:00:00 1970 +0000
253 date: Thu Jan 01 00:00:00 1970 +0000
254 summary: added b
254 summary: added b
255
255
256
256
257 Shared one should work
257 Shared one should work
258 $ cd ../shared1
258 $ cd ../shared1
259 $ hg log -r .
259 $ hg log -r .
260 changeset: 2:155349b645be
260 changeset: 2:155349b645be
261 tag: tip
261 tag: tip
262 user: test
262 user: test
263 date: Thu Jan 01 00:00:00 1970 +0000
263 date: Thu Jan 01 00:00:00 1970 +0000
264 summary: added c
264 summary: added c
265
265
266
266
267 Testing that nonsharedrc is loaded for source and not shared
267 Testing that nonsharedrc is loaded for source and not shared
268
268
269 $ cd ../source
269 $ cd ../source
270 $ touch .hg/hgrc-not-shared
270 $ touch .hg/hgrc-not-shared
271 $ echo "[ui]" >> .hg/hgrc-not-shared
271 $ echo "[ui]" >> .hg/hgrc-not-shared
272 $ echo "traceback=true" >> .hg/hgrc-not-shared
272 $ echo "traceback=true" >> .hg/hgrc-not-shared
273
273
274 $ hg showconfig ui.traceback
274 $ hg showconfig ui.traceback
275 true
275 true
276
276
277 $ HGEDITOR=cat hg config --non-shared
277 $ HGEDITOR=cat hg config --non-shared
278 [ui]
278 [ui]
279 traceback=true
279 traceback=true
280
280
281 $ cd ../shared1
281 $ cd ../shared1
282 $ hg showconfig ui.traceback
282 $ hg showconfig ui.traceback
283 [1]
283 [1]
284
284
285 Unsharing works
285 Unsharing works
286
286
287 $ hg unshare
287 $ hg unshare
288
288
289 Test that source config is added to the shared one after unshare, and the config
289 Test that source config is added to the shared one after unshare, and the config
290 of current repo is still respected over the config which came from source config
290 of current repo is still respected over the config which came from source config
291 $ cd ../cloned
291 $ cd ../cloned
292 $ hg push ../shared1
292 $ hg push ../shared1
293 pushing to ../shared1
293 pushing to ../shared1
294 searching for changes
294 searching for changes
295 adding changesets
295 adding changesets
296 adding manifests
296 adding manifests
297 adding file changes
297 adding file changes
298 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
298 error: pretxnchangegroup.reject_merge_commits hook failed: bcde3522682d rejected as merge on the same branch. Please consider rebase.
299 transaction abort!
299 transaction abort!
300 rollback completed
300 rollback completed
301 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
301 abort: bcde3522682d rejected as merge on the same branch. Please consider rebase.
302 [255]
302 [255]
303 $ hg showconfig ui.curses -R ../shared1
303 $ hg showconfig ui.curses -R ../shared1
304 false
304 false
305
305
306 $ cd ../
306 $ cd ../
307
307
308 Test that upgrading using debugupgraderepo works
308 Test that upgrading using debugupgraderepo works
309 =================================================
309 =================================================
310
310
311 $ hg init non-share-safe --config format.exp-share-safe=false
311 $ hg init non-share-safe --config format.exp-share-safe=false
312 $ cd non-share-safe
312 $ cd non-share-safe
313 $ hg debugrequirements
313 $ hg debugrequirements
314 dotencode
314 dotencode
315 fncache
315 fncache
316 generaldelta
316 generaldelta
317 revlogv1
317 revlogv1
318 sparserevlog
318 sparserevlog
319 store
319 store
320 $ echo foo > foo
320 $ echo foo > foo
321 $ hg ci -Aqm 'added foo'
321 $ hg ci -Aqm 'added foo'
322 $ echo bar > bar
322 $ echo bar > bar
323 $ hg ci -Aqm 'added bar'
323 $ hg ci -Aqm 'added bar'
324
324
325 Create a share before upgrading
325 Create a share before upgrading
326
326
327 $ cd ..
327 $ cd ..
328 $ hg share non-share-safe nss-share
328 $ hg share non-share-safe nss-share
329 updating working directory
329 updating working directory
330 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
331 $ hg debugrequirements -R nss-share
331 $ hg debugrequirements -R nss-share
332 dotencode
332 dotencode
333 fncache
333 fncache
334 generaldelta
334 generaldelta
335 revlogv1
335 revlogv1
336 shared
336 shared
337 sparserevlog
337 sparserevlog
338 store
338 store
339 $ cd non-share-safe
339 $ cd non-share-safe
340
340
341 Upgrade
341 Upgrade
342
342
343 $ hg debugupgraderepo -q
343 $ hg debugupgraderepo -q
344 requirements
344 requirements
345 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
345 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
346 added: exp-sharesafe
346 added: exp-sharesafe
347
347
348 processed revlogs:
348 processed revlogs:
349 - all-filelogs
349 - all-filelogs
350 - changelog
350 - changelog
351 - manifest
351 - manifest
352
352
353 $ hg debugupgraderepo --run -q
353 $ hg debugupgraderepo --run -q
354 upgrade will perform the following actions:
354 upgrade will perform the following actions:
355
355
356 requirements
356 requirements
357 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
357 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
358 added: exp-sharesafe
358 added: exp-sharesafe
359
359
360 processed revlogs:
360 processed revlogs:
361 - all-filelogs
361 - all-filelogs
362 - changelog
362 - changelog
363 - manifest
363 - manifest
364
364
365 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
365 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
366
366
367 $ hg debugrequirements
367 $ hg debugrequirements
368 dotencode
368 dotencode
369 exp-sharesafe
369 exp-sharesafe
370 fncache
370 fncache
371 generaldelta
371 generaldelta
372 revlogv1
372 revlogv1
373 sparserevlog
373 sparserevlog
374 store
374 store
375
375
376 $ cat .hg/requires
376 $ cat .hg/requires
377 exp-sharesafe
377 exp-sharesafe
378
378
379 $ cat .hg/store/requires
379 $ cat .hg/store/requires
380 dotencode
380 dotencode
381 fncache
381 fncache
382 generaldelta
382 generaldelta
383 revlogv1
383 revlogv1
384 sparserevlog
384 sparserevlog
385 store
385 store
386
386
387 $ hg log -GT "{node}: {desc}\n"
387 $ hg log -GT "{node}: {desc}\n"
388 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
388 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
389 |
389 |
390 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
390 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
391
391
392
392
393 Make sure existing shares still works
393 Make sure existing shares still works
394
394
395 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-warn-outdated-shares=false
395 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-warn-outdated-shares=false
396 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
396 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
397 |
397 |
398 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
398 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
399
399
400
400
401 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
401 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
402 warning: source repository supports share-safe functionality. Reshare to upgrade.
402 warning: source repository supports share-safe functionality. Reshare to upgrade.
403 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
403 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
404 |
404 |
405 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
405 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
406
406
407
407
408
408
409 Create a safe share from upgrade one
409 Create a safe share from upgrade one
410
410
411 $ cd ..
411 $ cd ..
412 $ hg share non-share-safe ss-share
412 $ hg share non-share-safe ss-share
413 updating working directory
413 updating working directory
414 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 $ cd ss-share
415 $ cd ss-share
416 $ hg log -GT "{node}: {desc}\n"
416 $ hg log -GT "{node}: {desc}\n"
417 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
417 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
418 |
418 |
419 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
419 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
420
420
421 $ cd ../non-share-safe
421 $ cd ../non-share-safe
422
422
423 Test that downgrading works too
423 Test that downgrading works too
424
424
425 $ cat >> $HGRCPATH <<EOF
425 $ cat >> $HGRCPATH <<EOF
426 > [extensions]
426 > [extensions]
427 > share =
427 > share =
428 > [format]
428 > [format]
429 > exp-share-safe = False
429 > exp-share-safe = False
430 > EOF
430 > EOF
431
431
432 $ hg debugupgraderepo -q
432 $ hg debugupgraderepo -q
433 requirements
433 requirements
434 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
434 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
435 removed: exp-sharesafe
435 removed: exp-sharesafe
436
436
437 processed revlogs:
437 processed revlogs:
438 - all-filelogs
438 - all-filelogs
439 - changelog
439 - changelog
440 - manifest
440 - manifest
441
441
442 $ hg debugupgraderepo -q --run
442 $ hg debugupgraderepo -q --run
443 upgrade will perform the following actions:
443 upgrade will perform the following actions:
444
444
445 requirements
445 requirements
446 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
446 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
447 removed: exp-sharesafe
447 removed: exp-sharesafe
448
448
449 processed revlogs:
449 processed revlogs:
450 - all-filelogs
450 - all-filelogs
451 - changelog
451 - changelog
452 - manifest
452 - manifest
453
453
454 repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared.
454 repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared.
455
455
456 $ hg debugrequirements
456 $ hg debugrequirements
457 dotencode
457 dotencode
458 fncache
458 fncache
459 generaldelta
459 generaldelta
460 revlogv1
460 revlogv1
461 sparserevlog
461 sparserevlog
462 store
462 store
463
463
464 $ cat .hg/requires
464 $ cat .hg/requires
465 dotencode
465 dotencode
466 fncache
466 fncache
467 generaldelta
467 generaldelta
468 revlogv1
468 revlogv1
469 sparserevlog
469 sparserevlog
470 store
470 store
471
471
472 $ test -f .hg/store/requires
472 $ test -f .hg/store/requires
473 [1]
473 [1]
474
474
475 $ hg log -GT "{node}: {desc}\n"
475 $ hg log -GT "{node}: {desc}\n"
476 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
476 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
477 |
477 |
478 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
478 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
479
479
480
480
481 Make sure existing shares still works
481 Make sure existing shares still works
482
482
483 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
483 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
484 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
484 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
485 |
485 |
486 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
486 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
487
487
488
488
489 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
489 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
490 abort: share source does not support exp-sharesafe requirement
490 abort: share source does not support exp-sharesafe requirement
491 [255]
491 [255]
492
492
493 Testing automatic downgrade of shares when config is set
493 Testing automatic downgrade of shares when config is set
494
494
495 $ touch ../ss-share/.hg/wlock
495 $ touch ../ss-share/.hg/wlock
496 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config experimental.sharesafe-auto-downgrade-shares=true
496 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config experimental.sharesafe-auto-downgrade-shares=true
497 abort: failed to downgrade share, got error: Lock held
497 abort: failed to downgrade share, got error: Lock held
498 [255]
498 [255]
499 $ rm ../ss-share/.hg/wlock
499 $ rm ../ss-share/.hg/wlock
500
500
501 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config experimental.sharesafe-auto-downgrade-shares=true
501 $ hg log -GT "{node}: {desc}\n" -R ../ss-share --config experimental.sharesafe-auto-downgrade-shares=true
502 repository downgraded to not use share-safe mode
502 repository downgraded to not use share-safe mode
503 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
503 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
504 |
504 |
505 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
505 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
506
506
507
507
508 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
508 $ hg log -GT "{node}: {desc}\n" -R ../ss-share
509 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
509 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
510 |
510 |
511 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
511 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
512
512
513
513
514
514
515 Testing automatic upgrade of shares when config is set
515 Testing automatic upgrade of shares when config is set
516
516
517 $ hg debugupgraderepo -q --run --config format.exp-share-safe=True
517 $ hg debugupgraderepo -q --run --config format.exp-share-safe=True
518 upgrade will perform the following actions:
518 upgrade will perform the following actions:
519
519
520 requirements
520 requirements
521 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
521 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
522 added: exp-sharesafe
522 added: exp-sharesafe
523
523
524 processed revlogs:
524 processed revlogs:
525 - all-filelogs
525 - all-filelogs
526 - changelog
526 - changelog
527 - manifest
527 - manifest
528
528
529 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
529 repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode.
530 $ hg debugrequirements
530 $ hg debugrequirements
531 dotencode
531 dotencode
532 exp-sharesafe
532 exp-sharesafe
533 fncache
533 fncache
534 generaldelta
534 generaldelta
535 revlogv1
535 revlogv1
536 sparserevlog
536 sparserevlog
537 store
537 store
538 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
538 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
539 warning: source repository supports share-safe functionality. Reshare to upgrade.
539 warning: source repository supports share-safe functionality. Reshare to upgrade.
540 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
540 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
541 |
541 |
542 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
542 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
543
543
544
544
545 Check that if lock is taken, upgrade fails but read operation are successful
545 Check that if lock is taken, upgrade fails but read operation are successful
546 $ touch ../nss-share/.hg/wlock
546 $ touch ../nss-share/.hg/wlock
547 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
547 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
548 failed to upgrade share, got error: Lock held
548 failed to upgrade share, got error: Lock held
549 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
549 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
550 |
550 |
551 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
551 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
552
552
553
553
554 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true --config experimental.sharesafe-warn-outdated-shares=false
554 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true --config experimental.sharesafe-warn-outdated-shares=false
555 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
555 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
556 |
556 |
557 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
557 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
558
558
559
559
560 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true --config experimental.sharesafe-auto-upgrade-fail-error=true
560 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true --config experimental.sharesafe-auto-upgrade-fail-error=true
561 abort: failed to upgrade share, got error: Lock held
561 abort: failed to upgrade share, got error: Lock held
562 [255]
562 [255]
563
563
564 $ rm ../nss-share/.hg/wlock
564 $ rm ../nss-share/.hg/wlock
565 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
565 $ hg log -GT "{node}: {desc}\n" -R ../nss-share --config experimental.sharesafe-auto-upgrade-shares=true
566 repository upgraded to use share-safe mode
566 repository upgraded to use share-safe mode
567 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
567 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
568 |
568 |
569 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
569 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
570
570
571
571
572 Test that unshare works
572 Test that unshare works
573
573
574 $ hg unshare -R ../nss-share
574 $ hg unshare -R ../nss-share
575 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
575 $ hg log -GT "{node}: {desc}\n" -R ../nss-share
576 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
576 @ f63db81e6dde1d9c78814167f77fb1fb49283f4f: added bar
577 |
577 |
578 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
578 o f3ba8b99bb6f897c87bbc1c07b75c6ddf43a4f77: added foo
579
579
@@ -1,407 +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 \x1b[0;32madding .hgignore\x1b[0m (esc)
171 \x1b[0;32madding .hgignore\x1b[0m (esc)
172 \x1b[0;32madding deleted\x1b[0m (esc)
172 \x1b[0;32madding deleted\x1b[0m (esc)
173 \x1b[0;32madding modified\x1b[0m (esc)
173 \x1b[0;32madding modified\x1b[0m (esc)
174 \x1b[0;32madding removed\x1b[0m (esc)
174 \x1b[0;32madding removed\x1b[0m (esc)
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 $ tic -o "$TESTTMP/terminfo" "$TESTDIR/hgterm.ti"
243 $ tic -o "$TESTTMP/terminfo" "$TESTDIR/hgterm.ti"
244 $ ln -s "$TESTTMP/terminfo" "$TESTTMP/terminfo.cdb"
244 $ ln -s "$TESTTMP/terminfo" "$TESTTMP/terminfo.cdb"
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 \x1b[0;32madding .hgignore\x1b[0m (esc)
299 \x1b[0;32madding .hgignore\x1b[0m (esc)
300 \x1b[0;32madding deleted\x1b[0m (esc)
300 \x1b[0;32madding deleted\x1b[0m (esc)
301 \x1b[0;32madding modified\x1b[0m (esc)
301 \x1b[0;32madding modified\x1b[0m (esc)
302 \x1b[0;32madding removed\x1b[0m (esc)
302 \x1b[0;32madding removed\x1b[0m (esc)
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 (use 'hg help' for a list of commands)
397 [255]
397 [10]
398
398
399 color coding of error message without curses
399 color coding of error message without curses
400
400
401 $ echo 'raise ImportError' > curses.py
401 $ echo 'raise ImportError' > curses.py
402 $ PYTHONPATH=`pwd`:$PYTHONPATH hg unknowncommand > /dev/null
402 $ PYTHONPATH=`pwd`:$PYTHONPATH hg unknowncommand > /dev/null
403 hg: unknown command 'unknowncommand'
403 hg: unknown command 'unknowncommand'
404 (use 'hg help' for a list of commands)
404 (use 'hg help' for a list of commands)
405 [255]
405 [10]
406
406
407 $ cd ..
407 $ cd ..
@@ -1,26 +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 (use 'hg help' for a list of commands)
18 (use 'hg help' for a list of commands)
19 [255]
19 [10]
20 $ hg annotate a
20 $ hg annotate a
21 0: a
21 0: a
22
22
23 should succeed - up is an alias, not an abbreviation
23 should succeed - up is an alias, not an abbreviation
24
24
25 $ hg up
25 $ hg up
26 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
@@ -1,1459 +1,1459 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "strip=" >> $HGRCPATH
2 $ echo "strip=" >> $HGRCPATH
3 $ echo "drawdag=$TESTDIR/drawdag.py" >> $HGRCPATH
3 $ echo "drawdag=$TESTDIR/drawdag.py" >> $HGRCPATH
4
4
5 $ restore() {
5 $ restore() {
6 > hg unbundle -q .hg/strip-backup/*
6 > hg unbundle -q .hg/strip-backup/*
7 > rm .hg/strip-backup/*
7 > rm .hg/strip-backup/*
8 > }
8 > }
9 $ teststrip() {
9 $ teststrip() {
10 > hg up -C $1
10 > hg up -C $1
11 > echo % before update $1, strip $2
11 > echo % before update $1, strip $2
12 > hg log -G -T '{rev}:{node}'
12 > hg log -G -T '{rev}:{node}'
13 > hg --traceback debugstrip $2
13 > hg --traceback debugstrip $2
14 > echo % after update $1, strip $2
14 > echo % after update $1, strip $2
15 > hg log -G -T '{rev}:{node}'
15 > hg log -G -T '{rev}:{node}'
16 > restore
16 > restore
17 > }
17 > }
18
18
19 $ hg init test
19 $ hg init test
20 $ cd test
20 $ cd test
21
21
22 $ echo foo > bar
22 $ echo foo > bar
23 $ hg ci -Ama
23 $ hg ci -Ama
24 adding bar
24 adding bar
25
25
26 $ echo more >> bar
26 $ echo more >> bar
27 $ hg ci -Amb
27 $ hg ci -Amb
28
28
29 $ echo blah >> bar
29 $ echo blah >> bar
30 $ hg ci -Amc
30 $ hg ci -Amc
31
31
32 $ hg up 1
32 $ hg up 1
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 $ echo blah >> bar
34 $ echo blah >> bar
35 $ hg ci -Amd
35 $ hg ci -Amd
36 created new head
36 created new head
37
37
38 $ echo final >> bar
38 $ echo final >> bar
39 $ hg ci -Ame
39 $ hg ci -Ame
40
40
41 $ hg log
41 $ hg log
42 changeset: 4:443431ffac4f
42 changeset: 4:443431ffac4f
43 tag: tip
43 tag: tip
44 user: test
44 user: test
45 date: Thu Jan 01 00:00:00 1970 +0000
45 date: Thu Jan 01 00:00:00 1970 +0000
46 summary: e
46 summary: e
47
47
48 changeset: 3:65bd5f99a4a3
48 changeset: 3:65bd5f99a4a3
49 parent: 1:ef3a871183d7
49 parent: 1:ef3a871183d7
50 user: test
50 user: test
51 date: Thu Jan 01 00:00:00 1970 +0000
51 date: Thu Jan 01 00:00:00 1970 +0000
52 summary: d
52 summary: d
53
53
54 changeset: 2:264128213d29
54 changeset: 2:264128213d29
55 user: test
55 user: test
56 date: Thu Jan 01 00:00:00 1970 +0000
56 date: Thu Jan 01 00:00:00 1970 +0000
57 summary: c
57 summary: c
58
58
59 changeset: 1:ef3a871183d7
59 changeset: 1:ef3a871183d7
60 user: test
60 user: test
61 date: Thu Jan 01 00:00:00 1970 +0000
61 date: Thu Jan 01 00:00:00 1970 +0000
62 summary: b
62 summary: b
63
63
64 changeset: 0:9ab35a2d17cb
64 changeset: 0:9ab35a2d17cb
65 user: test
65 user: test
66 date: Thu Jan 01 00:00:00 1970 +0000
66 date: Thu Jan 01 00:00:00 1970 +0000
67 summary: a
67 summary: a
68
68
69
69
70 $ teststrip 4 4
70 $ teststrip 4 4
71 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
72 % before update 4, strip 4
72 % before update 4, strip 4
73 @ 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
73 @ 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
74 |
74 |
75 o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
75 o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
76 |
76 |
77 | o 2:264128213d290d868c54642d13aeaa3675551a78
77 | o 2:264128213d290d868c54642d13aeaa3675551a78
78 |/
78 |/
79 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
79 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
80 |
80 |
81 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
81 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
82
82
83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
84 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
85 % after update 4, strip 4
85 % after update 4, strip 4
86 @ 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
86 @ 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
87 |
87 |
88 | o 2:264128213d290d868c54642d13aeaa3675551a78
88 | o 2:264128213d290d868c54642d13aeaa3675551a78
89 |/
89 |/
90 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
90 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
91 |
91 |
92 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
92 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
93
93
94 $ teststrip 4 3
94 $ teststrip 4 3
95 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 % before update 4, strip 3
96 % before update 4, strip 3
97 @ 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
97 @ 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
98 |
98 |
99 o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
99 o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
100 |
100 |
101 | o 2:264128213d290d868c54642d13aeaa3675551a78
101 | o 2:264128213d290d868c54642d13aeaa3675551a78
102 |/
102 |/
103 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
103 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
104 |
104 |
105 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
105 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
106
106
107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
108 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
109 % after update 4, strip 3
109 % after update 4, strip 3
110 o 2:264128213d290d868c54642d13aeaa3675551a78
110 o 2:264128213d290d868c54642d13aeaa3675551a78
111 |
111 |
112 @ 1:ef3a871183d7199c541cc140218298bbfcc6c28a
112 @ 1:ef3a871183d7199c541cc140218298bbfcc6c28a
113 |
113 |
114 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
114 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
115
115
116 $ teststrip 1 4
116 $ teststrip 1 4
117 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
117 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
118 % before update 1, strip 4
118 % before update 1, strip 4
119 o 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
119 o 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
120 |
120 |
121 o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
121 o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
122 |
122 |
123 | o 2:264128213d290d868c54642d13aeaa3675551a78
123 | o 2:264128213d290d868c54642d13aeaa3675551a78
124 |/
124 |/
125 @ 1:ef3a871183d7199c541cc140218298bbfcc6c28a
125 @ 1:ef3a871183d7199c541cc140218298bbfcc6c28a
126 |
126 |
127 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
127 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
128
128
129 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
129 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
130 % after update 1, strip 4
130 % after update 1, strip 4
131 o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
131 o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
132 |
132 |
133 | o 2:264128213d290d868c54642d13aeaa3675551a78
133 | o 2:264128213d290d868c54642d13aeaa3675551a78
134 |/
134 |/
135 @ 1:ef3a871183d7199c541cc140218298bbfcc6c28a
135 @ 1:ef3a871183d7199c541cc140218298bbfcc6c28a
136 |
136 |
137 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
137 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
138
138
139 $ teststrip 4 2
139 $ teststrip 4 2
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 % before update 4, strip 2
141 % before update 4, strip 2
142 @ 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
142 @ 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
143 |
143 |
144 o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
144 o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64
145 |
145 |
146 | o 2:264128213d290d868c54642d13aeaa3675551a78
146 | o 2:264128213d290d868c54642d13aeaa3675551a78
147 |/
147 |/
148 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
148 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
149 |
149 |
150 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
150 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
151
151
152 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
152 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
153 % after update 4, strip 2
153 % after update 4, strip 2
154 @ 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
154 @ 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
155 |
155 |
156 o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64
156 o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64
157 |
157 |
158 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
158 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
159 |
159 |
160 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
160 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
161
161
162 $ teststrip 4 1
162 $ teststrip 4 1
163 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
163 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
164 % before update 4, strip 1
164 % before update 4, strip 1
165 @ 4:264128213d290d868c54642d13aeaa3675551a78
165 @ 4:264128213d290d868c54642d13aeaa3675551a78
166 |
166 |
167 | o 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
167 | o 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
168 | |
168 | |
169 | o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64
169 | o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64
170 |/
170 |/
171 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
171 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
172 |
172 |
173 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
173 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
174
174
175 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
176 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
177 % after update 4, strip 1
177 % after update 4, strip 1
178 @ 0:9ab35a2d17cb64271241ea881efcc19dd953215b
178 @ 0:9ab35a2d17cb64271241ea881efcc19dd953215b
179
179
180 $ teststrip null 4
180 $ teststrip null 4
181 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
181 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
182 % before update null, strip 4
182 % before update null, strip 4
183 o 4:264128213d290d868c54642d13aeaa3675551a78
183 o 4:264128213d290d868c54642d13aeaa3675551a78
184 |
184 |
185 | o 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
185 | o 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
186 | |
186 | |
187 | o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64
187 | o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64
188 |/
188 |/
189 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
189 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
190 |
190 |
191 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
191 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
192
192
193 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
193 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
194 % after update null, strip 4
194 % after update null, strip 4
195 o 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
195 o 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce
196 |
196 |
197 o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64
197 o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64
198 |
198 |
199 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
199 o 1:ef3a871183d7199c541cc140218298bbfcc6c28a
200 |
200 |
201 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
201 o 0:9ab35a2d17cb64271241ea881efcc19dd953215b
202
202
203
203
204 $ hg log
204 $ hg log
205 changeset: 4:264128213d29
205 changeset: 4:264128213d29
206 tag: tip
206 tag: tip
207 parent: 1:ef3a871183d7
207 parent: 1:ef3a871183d7
208 user: test
208 user: test
209 date: Thu Jan 01 00:00:00 1970 +0000
209 date: Thu Jan 01 00:00:00 1970 +0000
210 summary: c
210 summary: c
211
211
212 changeset: 3:443431ffac4f
212 changeset: 3:443431ffac4f
213 user: test
213 user: test
214 date: Thu Jan 01 00:00:00 1970 +0000
214 date: Thu Jan 01 00:00:00 1970 +0000
215 summary: e
215 summary: e
216
216
217 changeset: 2:65bd5f99a4a3
217 changeset: 2:65bd5f99a4a3
218 user: test
218 user: test
219 date: Thu Jan 01 00:00:00 1970 +0000
219 date: Thu Jan 01 00:00:00 1970 +0000
220 summary: d
220 summary: d
221
221
222 changeset: 1:ef3a871183d7
222 changeset: 1:ef3a871183d7
223 user: test
223 user: test
224 date: Thu Jan 01 00:00:00 1970 +0000
224 date: Thu Jan 01 00:00:00 1970 +0000
225 summary: b
225 summary: b
226
226
227 changeset: 0:9ab35a2d17cb
227 changeset: 0:9ab35a2d17cb
228 user: test
228 user: test
229 date: Thu Jan 01 00:00:00 1970 +0000
229 date: Thu Jan 01 00:00:00 1970 +0000
230 summary: a
230 summary: a
231
231
232 $ hg up -C 4
232 $ hg up -C 4
233 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
234 $ hg parents
234 $ hg parents
235 changeset: 4:264128213d29
235 changeset: 4:264128213d29
236 tag: tip
236 tag: tip
237 parent: 1:ef3a871183d7
237 parent: 1:ef3a871183d7
238 user: test
238 user: test
239 date: Thu Jan 01 00:00:00 1970 +0000
239 date: Thu Jan 01 00:00:00 1970 +0000
240 summary: c
240 summary: c
241
241
242
242
243 $ hg --traceback strip 4
243 $ hg --traceback strip 4
244 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
245 saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg
245 saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg
246 $ hg parents
246 $ hg parents
247 changeset: 1:ef3a871183d7
247 changeset: 1:ef3a871183d7
248 user: test
248 user: test
249 date: Thu Jan 01 00:00:00 1970 +0000
249 date: Thu Jan 01 00:00:00 1970 +0000
250 summary: b
250 summary: b
251
251
252 $ hg debugbundle .hg/strip-backup/*
252 $ hg debugbundle .hg/strip-backup/*
253 Stream params: {Compression: BZ}
253 Stream params: {Compression: BZ}
254 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
254 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
255 264128213d290d868c54642d13aeaa3675551a78
255 264128213d290d868c54642d13aeaa3675551a78
256 cache:rev-branch-cache -- {} (mandatory: False)
256 cache:rev-branch-cache -- {} (mandatory: False)
257 phase-heads -- {} (mandatory: True)
257 phase-heads -- {} (mandatory: True)
258 264128213d290d868c54642d13aeaa3675551a78 draft
258 264128213d290d868c54642d13aeaa3675551a78 draft
259 $ hg unbundle .hg/strip-backup/*
259 $ hg unbundle .hg/strip-backup/*
260 adding changesets
260 adding changesets
261 adding manifests
261 adding manifests
262 adding file changes
262 adding file changes
263 added 1 changesets with 0 changes to 1 files (+1 heads)
263 added 1 changesets with 0 changes to 1 files (+1 heads)
264 new changesets 264128213d29 (1 drafts)
264 new changesets 264128213d29 (1 drafts)
265 (run 'hg heads' to see heads, 'hg merge' to merge)
265 (run 'hg heads' to see heads, 'hg merge' to merge)
266 $ rm .hg/strip-backup/*
266 $ rm .hg/strip-backup/*
267 $ hg log --graph
267 $ hg log --graph
268 o changeset: 4:264128213d29
268 o changeset: 4:264128213d29
269 | tag: tip
269 | tag: tip
270 | parent: 1:ef3a871183d7
270 | parent: 1:ef3a871183d7
271 | user: test
271 | user: test
272 | date: Thu Jan 01 00:00:00 1970 +0000
272 | date: Thu Jan 01 00:00:00 1970 +0000
273 | summary: c
273 | summary: c
274 |
274 |
275 | o changeset: 3:443431ffac4f
275 | o changeset: 3:443431ffac4f
276 | | user: test
276 | | user: test
277 | | date: Thu Jan 01 00:00:00 1970 +0000
277 | | date: Thu Jan 01 00:00:00 1970 +0000
278 | | summary: e
278 | | summary: e
279 | |
279 | |
280 | o changeset: 2:65bd5f99a4a3
280 | o changeset: 2:65bd5f99a4a3
281 |/ user: test
281 |/ user: test
282 | date: Thu Jan 01 00:00:00 1970 +0000
282 | date: Thu Jan 01 00:00:00 1970 +0000
283 | summary: d
283 | summary: d
284 |
284 |
285 @ changeset: 1:ef3a871183d7
285 @ changeset: 1:ef3a871183d7
286 | user: test
286 | user: test
287 | date: Thu Jan 01 00:00:00 1970 +0000
287 | date: Thu Jan 01 00:00:00 1970 +0000
288 | summary: b
288 | summary: b
289 |
289 |
290 o changeset: 0:9ab35a2d17cb
290 o changeset: 0:9ab35a2d17cb
291 user: test
291 user: test
292 date: Thu Jan 01 00:00:00 1970 +0000
292 date: Thu Jan 01 00:00:00 1970 +0000
293 summary: a
293 summary: a
294
294
295 $ hg up -C 2
295 $ hg up -C 2
296 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
296 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
297 $ hg merge 4
297 $ hg merge 4
298 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
298 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
299 (branch merge, don't forget to commit)
299 (branch merge, don't forget to commit)
300
300
301 before strip of merge parent
301 before strip of merge parent
302
302
303 $ hg parents
303 $ hg parents
304 changeset: 2:65bd5f99a4a3
304 changeset: 2:65bd5f99a4a3
305 user: test
305 user: test
306 date: Thu Jan 01 00:00:00 1970 +0000
306 date: Thu Jan 01 00:00:00 1970 +0000
307 summary: d
307 summary: d
308
308
309 changeset: 4:264128213d29
309 changeset: 4:264128213d29
310 tag: tip
310 tag: tip
311 parent: 1:ef3a871183d7
311 parent: 1:ef3a871183d7
312 user: test
312 user: test
313 date: Thu Jan 01 00:00:00 1970 +0000
313 date: Thu Jan 01 00:00:00 1970 +0000
314 summary: c
314 summary: c
315
315
316 ##strip not allowed with merge in progress
316 ##strip not allowed with merge in progress
317 $ hg strip 4
317 $ hg strip 4
318 abort: outstanding uncommitted merge
318 abort: outstanding uncommitted merge
319 (use 'hg commit' or 'hg merge --abort')
319 (use 'hg commit' or 'hg merge --abort')
320 [20]
320 [20]
321 ##strip allowed --force with merge in progress
321 ##strip allowed --force with merge in progress
322 $ hg strip 4 --force
322 $ hg strip 4 --force
323 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
324 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
324 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
325
325
326 after strip of merge parent
326 after strip of merge parent
327
327
328 $ hg parents
328 $ hg parents
329 changeset: 1:ef3a871183d7
329 changeset: 1:ef3a871183d7
330 user: test
330 user: test
331 date: Thu Jan 01 00:00:00 1970 +0000
331 date: Thu Jan 01 00:00:00 1970 +0000
332 summary: b
332 summary: b
333
333
334 $ restore
334 $ restore
335
335
336 $ hg up
336 $ hg up
337 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
337 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
338 updated to "264128213d29: c"
338 updated to "264128213d29: c"
339 1 other heads for branch "default"
339 1 other heads for branch "default"
340 $ hg log -G
340 $ hg log -G
341 @ changeset: 4:264128213d29
341 @ changeset: 4:264128213d29
342 | tag: tip
342 | tag: tip
343 | parent: 1:ef3a871183d7
343 | parent: 1:ef3a871183d7
344 | user: test
344 | user: test
345 | date: Thu Jan 01 00:00:00 1970 +0000
345 | date: Thu Jan 01 00:00:00 1970 +0000
346 | summary: c
346 | summary: c
347 |
347 |
348 | o changeset: 3:443431ffac4f
348 | o changeset: 3:443431ffac4f
349 | | user: test
349 | | user: test
350 | | date: Thu Jan 01 00:00:00 1970 +0000
350 | | date: Thu Jan 01 00:00:00 1970 +0000
351 | | summary: e
351 | | summary: e
352 | |
352 | |
353 | o changeset: 2:65bd5f99a4a3
353 | o changeset: 2:65bd5f99a4a3
354 |/ user: test
354 |/ user: test
355 | date: Thu Jan 01 00:00:00 1970 +0000
355 | date: Thu Jan 01 00:00:00 1970 +0000
356 | summary: d
356 | summary: d
357 |
357 |
358 o changeset: 1:ef3a871183d7
358 o changeset: 1:ef3a871183d7
359 | user: test
359 | user: test
360 | date: Thu Jan 01 00:00:00 1970 +0000
360 | date: Thu Jan 01 00:00:00 1970 +0000
361 | summary: b
361 | summary: b
362 |
362 |
363 o changeset: 0:9ab35a2d17cb
363 o changeset: 0:9ab35a2d17cb
364 user: test
364 user: test
365 date: Thu Jan 01 00:00:00 1970 +0000
365 date: Thu Jan 01 00:00:00 1970 +0000
366 summary: a
366 summary: a
367
367
368
368
369 2 is parent of 3, only one strip should happen
369 2 is parent of 3, only one strip should happen
370
370
371 $ hg strip "roots(2)" 3
371 $ hg strip "roots(2)" 3
372 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
372 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
373 $ hg log -G
373 $ hg log -G
374 @ changeset: 2:264128213d29
374 @ changeset: 2:264128213d29
375 | tag: tip
375 | tag: tip
376 | user: test
376 | user: test
377 | date: Thu Jan 01 00:00:00 1970 +0000
377 | date: Thu Jan 01 00:00:00 1970 +0000
378 | summary: c
378 | summary: c
379 |
379 |
380 o changeset: 1:ef3a871183d7
380 o changeset: 1:ef3a871183d7
381 | user: test
381 | user: test
382 | date: Thu Jan 01 00:00:00 1970 +0000
382 | date: Thu Jan 01 00:00:00 1970 +0000
383 | summary: b
383 | summary: b
384 |
384 |
385 o changeset: 0:9ab35a2d17cb
385 o changeset: 0:9ab35a2d17cb
386 user: test
386 user: test
387 date: Thu Jan 01 00:00:00 1970 +0000
387 date: Thu Jan 01 00:00:00 1970 +0000
388 summary: a
388 summary: a
389
389
390 $ restore
390 $ restore
391 $ hg log -G
391 $ hg log -G
392 o changeset: 4:443431ffac4f
392 o changeset: 4:443431ffac4f
393 | tag: tip
393 | tag: tip
394 | user: test
394 | user: test
395 | date: Thu Jan 01 00:00:00 1970 +0000
395 | date: Thu Jan 01 00:00:00 1970 +0000
396 | summary: e
396 | summary: e
397 |
397 |
398 o changeset: 3:65bd5f99a4a3
398 o changeset: 3:65bd5f99a4a3
399 | parent: 1:ef3a871183d7
399 | parent: 1:ef3a871183d7
400 | user: test
400 | user: test
401 | date: Thu Jan 01 00:00:00 1970 +0000
401 | date: Thu Jan 01 00:00:00 1970 +0000
402 | summary: d
402 | summary: d
403 |
403 |
404 | @ changeset: 2:264128213d29
404 | @ changeset: 2:264128213d29
405 |/ user: test
405 |/ user: test
406 | date: Thu Jan 01 00:00:00 1970 +0000
406 | date: Thu Jan 01 00:00:00 1970 +0000
407 | summary: c
407 | summary: c
408 |
408 |
409 o changeset: 1:ef3a871183d7
409 o changeset: 1:ef3a871183d7
410 | user: test
410 | user: test
411 | date: Thu Jan 01 00:00:00 1970 +0000
411 | date: Thu Jan 01 00:00:00 1970 +0000
412 | summary: b
412 | summary: b
413 |
413 |
414 o changeset: 0:9ab35a2d17cb
414 o changeset: 0:9ab35a2d17cb
415 user: test
415 user: test
416 date: Thu Jan 01 00:00:00 1970 +0000
416 date: Thu Jan 01 00:00:00 1970 +0000
417 summary: a
417 summary: a
418
418
419 Failed hook while applying "saveheads" bundle.
419 Failed hook while applying "saveheads" bundle.
420
420
421 $ hg strip 2 --config hooks.pretxnchangegroup.bad=false
421 $ hg strip 2 --config hooks.pretxnchangegroup.bad=false
422 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
422 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
423 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
423 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
424 transaction abort!
424 transaction abort!
425 rollback completed
425 rollback completed
426 strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
426 strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
427 strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
427 strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
428 (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob)
428 (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob)
429 abort: pretxnchangegroup.bad hook exited with status 1
429 abort: pretxnchangegroup.bad hook exited with status 1
430 [255]
430 [255]
431 $ restore
431 $ restore
432 $ hg log -G
432 $ hg log -G
433 o changeset: 4:443431ffac4f
433 o changeset: 4:443431ffac4f
434 | tag: tip
434 | tag: tip
435 | user: test
435 | user: test
436 | date: Thu Jan 01 00:00:00 1970 +0000
436 | date: Thu Jan 01 00:00:00 1970 +0000
437 | summary: e
437 | summary: e
438 |
438 |
439 o changeset: 3:65bd5f99a4a3
439 o changeset: 3:65bd5f99a4a3
440 | parent: 1:ef3a871183d7
440 | parent: 1:ef3a871183d7
441 | user: test
441 | user: test
442 | date: Thu Jan 01 00:00:00 1970 +0000
442 | date: Thu Jan 01 00:00:00 1970 +0000
443 | summary: d
443 | summary: d
444 |
444 |
445 | o changeset: 2:264128213d29
445 | o changeset: 2:264128213d29
446 |/ user: test
446 |/ user: test
447 | date: Thu Jan 01 00:00:00 1970 +0000
447 | date: Thu Jan 01 00:00:00 1970 +0000
448 | summary: c
448 | summary: c
449 |
449 |
450 @ changeset: 1:ef3a871183d7
450 @ changeset: 1:ef3a871183d7
451 | user: test
451 | user: test
452 | date: Thu Jan 01 00:00:00 1970 +0000
452 | date: Thu Jan 01 00:00:00 1970 +0000
453 | summary: b
453 | summary: b
454 |
454 |
455 o changeset: 0:9ab35a2d17cb
455 o changeset: 0:9ab35a2d17cb
456 user: test
456 user: test
457 date: Thu Jan 01 00:00:00 1970 +0000
457 date: Thu Jan 01 00:00:00 1970 +0000
458 summary: a
458 summary: a
459
459
460
460
461 2 different branches: 2 strips
461 2 different branches: 2 strips
462
462
463 $ hg strip 2 4
463 $ hg strip 2 4
464 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
464 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
465 $ hg log -G
465 $ hg log -G
466 o changeset: 2:65bd5f99a4a3
466 o changeset: 2:65bd5f99a4a3
467 | tag: tip
467 | tag: tip
468 | user: test
468 | user: test
469 | date: Thu Jan 01 00:00:00 1970 +0000
469 | date: Thu Jan 01 00:00:00 1970 +0000
470 | summary: d
470 | summary: d
471 |
471 |
472 @ changeset: 1:ef3a871183d7
472 @ changeset: 1:ef3a871183d7
473 | user: test
473 | user: test
474 | date: Thu Jan 01 00:00:00 1970 +0000
474 | date: Thu Jan 01 00:00:00 1970 +0000
475 | summary: b
475 | summary: b
476 |
476 |
477 o changeset: 0:9ab35a2d17cb
477 o changeset: 0:9ab35a2d17cb
478 user: test
478 user: test
479 date: Thu Jan 01 00:00:00 1970 +0000
479 date: Thu Jan 01 00:00:00 1970 +0000
480 summary: a
480 summary: a
481
481
482 $ restore
482 $ restore
483
483
484 2 different branches and a common ancestor: 1 strip
484 2 different branches and a common ancestor: 1 strip
485
485
486 $ hg strip 1 "2|4"
486 $ hg strip 1 "2|4"
487 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
487 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
488 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
489 $ restore
489 $ restore
490
490
491 verify fncache is kept up-to-date
491 verify fncache is kept up-to-date
492
492
493 $ touch a
493 $ touch a
494 $ hg ci -qAm a
494 $ hg ci -qAm a
495 #if repofncache
495 #if repofncache
496 $ cat .hg/store/fncache | sort
496 $ cat .hg/store/fncache | sort
497 data/a.i
497 data/a.i
498 data/bar.i
498 data/bar.i
499 #endif
499 #endif
500
500
501 $ hg strip tip
501 $ hg strip tip
502 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
502 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
503 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
503 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
504 #if repofncache
504 #if repofncache
505 $ cat .hg/store/fncache
505 $ cat .hg/store/fncache
506 data/bar.i
506 data/bar.i
507 #endif
507 #endif
508
508
509 stripping an empty revset
509 stripping an empty revset
510
510
511 $ hg strip "1 and not 1"
511 $ hg strip "1 and not 1"
512 abort: empty revision set
512 abort: empty revision set
513 [255]
513 [255]
514
514
515 remove branchy history for qimport tests
515 remove branchy history for qimport tests
516
516
517 $ hg strip 3
517 $ hg strip 3
518 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
518 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
519
519
520
520
521 strip of applied mq should cleanup status file
521 strip of applied mq should cleanup status file
522
522
523 $ echo "mq=" >> $HGRCPATH
523 $ echo "mq=" >> $HGRCPATH
524 $ hg up -C 3
524 $ hg up -C 3
525 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
525 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
526 $ echo fooagain >> bar
526 $ echo fooagain >> bar
527 $ hg ci -mf
527 $ hg ci -mf
528 $ hg qimport -r tip:2
528 $ hg qimport -r tip:2
529
529
530 applied patches before strip
530 applied patches before strip
531
531
532 $ hg qapplied
532 $ hg qapplied
533 d
533 d
534 e
534 e
535 f
535 f
536
536
537 stripping revision in queue
537 stripping revision in queue
538
538
539 $ hg strip 3
539 $ hg strip 3
540 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
540 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
541 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
541 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
542
542
543 applied patches after stripping rev in queue
543 applied patches after stripping rev in queue
544
544
545 $ hg qapplied
545 $ hg qapplied
546 d
546 d
547
547
548 stripping ancestor of queue
548 stripping ancestor of queue
549
549
550 $ hg strip 1
550 $ hg strip 1
551 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
551 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
552 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
552 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
553
553
554 applied patches after stripping ancestor of queue
554 applied patches after stripping ancestor of queue
555
555
556 $ hg qapplied
556 $ hg qapplied
557
557
558 Verify strip protects against stripping wc parent when there are uncommitted mods
558 Verify strip protects against stripping wc parent when there are uncommitted mods
559
559
560 $ echo b > b
560 $ echo b > b
561 $ echo bb > bar
561 $ echo bb > bar
562 $ hg add b
562 $ hg add b
563 $ hg ci -m 'b'
563 $ hg ci -m 'b'
564 $ hg log --graph
564 $ hg log --graph
565 @ changeset: 1:76dcf9fab855
565 @ changeset: 1:76dcf9fab855
566 | tag: tip
566 | tag: tip
567 | user: test
567 | user: test
568 | date: Thu Jan 01 00:00:00 1970 +0000
568 | date: Thu Jan 01 00:00:00 1970 +0000
569 | summary: b
569 | summary: b
570 |
570 |
571 o changeset: 0:9ab35a2d17cb
571 o changeset: 0:9ab35a2d17cb
572 user: test
572 user: test
573 date: Thu Jan 01 00:00:00 1970 +0000
573 date: Thu Jan 01 00:00:00 1970 +0000
574 summary: a
574 summary: a
575
575
576 $ hg up 0
576 $ hg up 0
577 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
577 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
578 $ echo c > bar
578 $ echo c > bar
579 $ hg up -t false
579 $ hg up -t false
580 merging bar
580 merging bar
581 merging bar failed!
581 merging bar failed!
582 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
582 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
583 use 'hg resolve' to retry unresolved file merges
583 use 'hg resolve' to retry unresolved file merges
584 [1]
584 [1]
585 $ hg sum
585 $ hg sum
586 parent: 1:76dcf9fab855 tip
586 parent: 1:76dcf9fab855 tip
587 b
587 b
588 branch: default
588 branch: default
589 commit: 1 modified, 1 unknown, 1 unresolved
589 commit: 1 modified, 1 unknown, 1 unresolved
590 update: (current)
590 update: (current)
591 phases: 2 draft
591 phases: 2 draft
592 mq: 3 unapplied
592 mq: 3 unapplied
593
593
594 $ hg log --graph
594 $ hg log --graph
595 @ changeset: 1:76dcf9fab855
595 @ changeset: 1:76dcf9fab855
596 | tag: tip
596 | tag: tip
597 | user: test
597 | user: test
598 | date: Thu Jan 01 00:00:00 1970 +0000
598 | date: Thu Jan 01 00:00:00 1970 +0000
599 | summary: b
599 | summary: b
600 |
600 |
601 % changeset: 0:9ab35a2d17cb
601 % changeset: 0:9ab35a2d17cb
602 user: test
602 user: test
603 date: Thu Jan 01 00:00:00 1970 +0000
603 date: Thu Jan 01 00:00:00 1970 +0000
604 summary: a
604 summary: a
605
605
606 $ echo c > b
606 $ echo c > b
607 $ hg strip tip
607 $ hg strip tip
608 abort: uncommitted changes
608 abort: uncommitted changes
609 [20]
609 [20]
610 $ hg strip tip --keep
610 $ hg strip tip --keep
611 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
611 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
612 $ hg log --graph
612 $ hg log --graph
613 @ changeset: 0:9ab35a2d17cb
613 @ changeset: 0:9ab35a2d17cb
614 tag: tip
614 tag: tip
615 user: test
615 user: test
616 date: Thu Jan 01 00:00:00 1970 +0000
616 date: Thu Jan 01 00:00:00 1970 +0000
617 summary: a
617 summary: a
618
618
619 $ hg status
619 $ hg status
620 M bar
620 M bar
621 ? b
621 ? b
622 ? bar.orig
622 ? bar.orig
623
623
624 $ rm bar.orig
624 $ rm bar.orig
625 $ hg sum
625 $ hg sum
626 parent: 0:9ab35a2d17cb tip
626 parent: 0:9ab35a2d17cb tip
627 a
627 a
628 branch: default
628 branch: default
629 commit: 1 modified, 1 unknown
629 commit: 1 modified, 1 unknown
630 update: (current)
630 update: (current)
631 phases: 1 draft
631 phases: 1 draft
632 mq: 3 unapplied
632 mq: 3 unapplied
633
633
634 Strip adds, removes, modifies with --keep
634 Strip adds, removes, modifies with --keep
635
635
636 $ touch b
636 $ touch b
637 $ hg add b
637 $ hg add b
638 $ hg commit -mb
638 $ hg commit -mb
639 $ touch c
639 $ touch c
640
640
641 ... with a clean working dir
641 ... with a clean working dir
642
642
643 $ hg add c
643 $ hg add c
644 $ hg rm bar
644 $ hg rm bar
645 $ hg commit -mc
645 $ hg commit -mc
646 $ hg status
646 $ hg status
647 $ hg strip --keep tip
647 $ hg strip --keep tip
648 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
648 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
649 $ hg status
649 $ hg status
650 ! bar
650 ! bar
651 ? c
651 ? c
652
652
653 ... with a dirty working dir
653 ... with a dirty working dir
654
654
655 $ hg add c
655 $ hg add c
656 $ hg rm bar
656 $ hg rm bar
657 $ hg commit -mc
657 $ hg commit -mc
658 $ hg status
658 $ hg status
659 $ echo b > b
659 $ echo b > b
660 $ echo d > d
660 $ echo d > d
661 $ hg strip --keep tip
661 $ hg strip --keep tip
662 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
662 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
663 $ hg status
663 $ hg status
664 M b
664 M b
665 ! bar
665 ! bar
666 ? c
666 ? c
667 ? d
667 ? d
668
668
669 ... after updating the dirstate
669 ... after updating the dirstate
670 $ hg add c
670 $ hg add c
671 $ hg commit -mc
671 $ hg commit -mc
672 $ hg rm c
672 $ hg rm c
673 $ hg commit -mc
673 $ hg commit -mc
674 $ hg strip --keep '.^' -q
674 $ hg strip --keep '.^' -q
675 $ cd ..
675 $ cd ..
676
676
677 stripping many nodes on a complex graph (issue3299)
677 stripping many nodes on a complex graph (issue3299)
678
678
679 $ hg init issue3299
679 $ hg init issue3299
680 $ cd issue3299
680 $ cd issue3299
681 $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a'
681 $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a'
682 $ hg strip 'not ancestors(x)'
682 $ hg strip 'not ancestors(x)'
683 saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob)
683 saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob)
684
684
685 test hg strip -B bookmark
685 test hg strip -B bookmark
686
686
687 $ cd ..
687 $ cd ..
688 $ hg init bookmarks
688 $ hg init bookmarks
689 $ cd bookmarks
689 $ cd bookmarks
690 $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f'
690 $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f'
691 $ hg bookmark -r 'a' 'todelete'
691 $ hg bookmark -r 'a' 'todelete'
692 $ hg bookmark -r 'b' 'B'
692 $ hg bookmark -r 'b' 'B'
693 $ hg bookmark -r 'b' 'nostrip'
693 $ hg bookmark -r 'b' 'nostrip'
694 $ hg bookmark -r 'c' 'delete'
694 $ hg bookmark -r 'c' 'delete'
695 $ hg bookmark -r 'd' 'multipledelete1'
695 $ hg bookmark -r 'd' 'multipledelete1'
696 $ hg bookmark -r 'e' 'multipledelete2'
696 $ hg bookmark -r 'e' 'multipledelete2'
697 $ hg bookmark -r 'f' 'singlenode1'
697 $ hg bookmark -r 'f' 'singlenode1'
698 $ hg bookmark -r 'f' 'singlenode2'
698 $ hg bookmark -r 'f' 'singlenode2'
699 $ hg up -C todelete
699 $ hg up -C todelete
700 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
700 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
701 (activating bookmark todelete)
701 (activating bookmark todelete)
702 $ hg strip -B nostrip
702 $ hg strip -B nostrip
703 bookmark 'nostrip' deleted
703 bookmark 'nostrip' deleted
704 abort: empty revision set
704 abort: empty revision set
705 [255]
705 [255]
706 $ hg strip -B todelete
706 $ hg strip -B todelete
707 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
707 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
708 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
708 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
709 bookmark 'todelete' deleted
709 bookmark 'todelete' deleted
710 $ hg id -ir dcbb326fdec2
710 $ hg id -ir dcbb326fdec2
711 abort: unknown revision 'dcbb326fdec2'
711 abort: unknown revision 'dcbb326fdec2'
712 [255]
712 [255]
713 $ hg id -ir d62d843c9a01
713 $ hg id -ir d62d843c9a01
714 d62d843c9a01
714 d62d843c9a01
715 $ hg bookmarks
715 $ hg bookmarks
716 B 9:ff43616e5d0f
716 B 9:ff43616e5d0f
717 delete 6:2702dd0c91e7
717 delete 6:2702dd0c91e7
718 multipledelete1 11:e46a4836065c
718 multipledelete1 11:e46a4836065c
719 multipledelete2 12:b4594d867745
719 multipledelete2 12:b4594d867745
720 singlenode1 13:43227190fef8
720 singlenode1 13:43227190fef8
721 singlenode2 13:43227190fef8
721 singlenode2 13:43227190fef8
722 $ hg strip -B multipledelete1 -B multipledelete2
722 $ hg strip -B multipledelete1 -B multipledelete2
723 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg
723 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg
724 bookmark 'multipledelete1' deleted
724 bookmark 'multipledelete1' deleted
725 bookmark 'multipledelete2' deleted
725 bookmark 'multipledelete2' deleted
726 $ hg id -ir e46a4836065c
726 $ hg id -ir e46a4836065c
727 abort: unknown revision 'e46a4836065c'
727 abort: unknown revision 'e46a4836065c'
728 [255]
728 [255]
729 $ hg id -ir b4594d867745
729 $ hg id -ir b4594d867745
730 abort: unknown revision 'b4594d867745'
730 abort: unknown revision 'b4594d867745'
731 [255]
731 [255]
732 $ hg strip -B singlenode1 -B singlenode2
732 $ hg strip -B singlenode1 -B singlenode2
733 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg
733 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg
734 bookmark 'singlenode1' deleted
734 bookmark 'singlenode1' deleted
735 bookmark 'singlenode2' deleted
735 bookmark 'singlenode2' deleted
736 $ hg id -ir 43227190fef8
736 $ hg id -ir 43227190fef8
737 abort: unknown revision '43227190fef8'
737 abort: unknown revision '43227190fef8'
738 [255]
738 [255]
739 $ hg strip -B unknownbookmark
739 $ hg strip -B unknownbookmark
740 abort: bookmark 'unknownbookmark' not found
740 abort: bookmark 'unknownbookmark' not found
741 [255]
741 [255]
742 $ hg strip -B unknownbookmark1 -B unknownbookmark2
742 $ hg strip -B unknownbookmark1 -B unknownbookmark2
743 abort: bookmark 'unknownbookmark1,unknownbookmark2' not found
743 abort: bookmark 'unknownbookmark1,unknownbookmark2' not found
744 [255]
744 [255]
745 $ hg strip -B delete -B unknownbookmark
745 $ hg strip -B delete -B unknownbookmark
746 abort: bookmark 'unknownbookmark' not found
746 abort: bookmark 'unknownbookmark' not found
747 [255]
747 [255]
748 $ hg strip -B delete
748 $ hg strip -B delete
749 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
749 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
750 bookmark 'delete' deleted
750 bookmark 'delete' deleted
751 $ hg id -ir 6:2702dd0c91e7
751 $ hg id -ir 6:2702dd0c91e7
752 abort: unknown revision '2702dd0c91e7'
752 abort: unknown revision '2702dd0c91e7'
753 [255]
753 [255]
754 $ hg update B
754 $ hg update B
755 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
755 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
756 (activating bookmark B)
756 (activating bookmark B)
757 $ echo a > a
757 $ echo a > a
758 $ hg add a
758 $ hg add a
759 $ hg strip -B B
759 $ hg strip -B B
760 abort: uncommitted changes
760 abort: uncommitted changes
761 [20]
761 [20]
762 $ hg bookmarks
762 $ hg bookmarks
763 * B 6:ff43616e5d0f
763 * B 6:ff43616e5d0f
764
764
765 Make sure no one adds back a -b option:
765 Make sure no one adds back a -b option:
766
766
767 $ hg strip -b tip
767 $ hg strip -b tip
768 hg debugstrip: option -b not recognized
768 hg debugstrip: option -b not recognized
769 hg debugstrip [-k] [-f] [-B bookmark] [-r] REV...
769 hg debugstrip [-k] [-f] [-B bookmark] [-r] REV...
770
770
771 strip changesets and all their descendants from the repository
771 strip changesets and all their descendants from the repository
772
772
773 options ([+] can be repeated):
773 options ([+] can be repeated):
774
774
775 -r --rev REV [+] strip specified revision (optional, can specify
775 -r --rev REV [+] strip specified revision (optional, can specify
776 revisions without this option)
776 revisions without this option)
777 -f --force force removal of changesets, discard uncommitted
777 -f --force force removal of changesets, discard uncommitted
778 changes (no backup)
778 changes (no backup)
779 --no-backup do not save backup bundle
779 --no-backup do not save backup bundle
780 -k --keep do not modify working directory during strip
780 -k --keep do not modify working directory during strip
781 -B --bookmark BOOKMARK [+] remove revs only reachable from given bookmark
781 -B --bookmark BOOKMARK [+] remove revs only reachable from given bookmark
782 --mq operate on patch repository
782 --mq operate on patch repository
783
783
784 (use 'hg debugstrip -h' to show more help)
784 (use 'hg debugstrip -h' to show more help)
785 [255]
785 [10]
786
786
787 $ cd ..
787 $ cd ..
788
788
789 Verify bundles don't get overwritten:
789 Verify bundles don't get overwritten:
790
790
791 $ hg init doublebundle
791 $ hg init doublebundle
792 $ cd doublebundle
792 $ cd doublebundle
793 $ touch a
793 $ touch a
794 $ hg commit -Aqm a
794 $ hg commit -Aqm a
795 $ touch b
795 $ touch b
796 $ hg commit -Aqm b
796 $ hg commit -Aqm b
797 $ hg strip -r 0
797 $ hg strip -r 0
798 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
798 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
799 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg
799 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg
800 $ ls .hg/strip-backup
800 $ ls .hg/strip-backup
801 3903775176ed-e68910bd-backup.hg
801 3903775176ed-e68910bd-backup.hg
802 #if repobundlerepo
802 #if repobundlerepo
803 $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg
803 $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg
804 $ hg strip -r 0
804 $ hg strip -r 0
805 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg
805 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg
806 $ ls .hg/strip-backup
806 $ ls .hg/strip-backup
807 3903775176ed-54390173-backup.hg
807 3903775176ed-54390173-backup.hg
808 3903775176ed-e68910bd-backup.hg
808 3903775176ed-e68910bd-backup.hg
809 #endif
809 #endif
810 $ cd ..
810 $ cd ..
811
811
812 Test that we only bundle the stripped changesets (issue4736)
812 Test that we only bundle the stripped changesets (issue4736)
813 ------------------------------------------------------------
813 ------------------------------------------------------------
814
814
815 initialization (previous repo is empty anyway)
815 initialization (previous repo is empty anyway)
816
816
817 $ hg init issue4736
817 $ hg init issue4736
818 $ cd issue4736
818 $ cd issue4736
819 $ echo a > a
819 $ echo a > a
820 $ hg add a
820 $ hg add a
821 $ hg commit -m commitA
821 $ hg commit -m commitA
822 $ echo b > b
822 $ echo b > b
823 $ hg add b
823 $ hg add b
824 $ hg commit -m commitB
824 $ hg commit -m commitB
825 $ echo c > c
825 $ echo c > c
826 $ hg add c
826 $ hg add c
827 $ hg commit -m commitC
827 $ hg commit -m commitC
828 $ hg up 'desc(commitB)'
828 $ hg up 'desc(commitB)'
829 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
829 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
830 $ echo d > d
830 $ echo d > d
831 $ hg add d
831 $ hg add d
832 $ hg commit -m commitD
832 $ hg commit -m commitD
833 created new head
833 created new head
834 $ hg up 'desc(commitC)'
834 $ hg up 'desc(commitC)'
835 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
835 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
836 $ hg merge 'desc(commitD)'
836 $ hg merge 'desc(commitD)'
837 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
837 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
838 (branch merge, don't forget to commit)
838 (branch merge, don't forget to commit)
839 $ hg ci -m 'mergeCD'
839 $ hg ci -m 'mergeCD'
840 $ hg log -G
840 $ hg log -G
841 @ changeset: 4:d8db9d137221
841 @ changeset: 4:d8db9d137221
842 |\ tag: tip
842 |\ tag: tip
843 | | parent: 2:5c51d8d6557d
843 | | parent: 2:5c51d8d6557d
844 | | parent: 3:6625a5168474
844 | | parent: 3:6625a5168474
845 | | user: test
845 | | user: test
846 | | date: Thu Jan 01 00:00:00 1970 +0000
846 | | date: Thu Jan 01 00:00:00 1970 +0000
847 | | summary: mergeCD
847 | | summary: mergeCD
848 | |
848 | |
849 | o changeset: 3:6625a5168474
849 | o changeset: 3:6625a5168474
850 | | parent: 1:eca11cf91c71
850 | | parent: 1:eca11cf91c71
851 | | user: test
851 | | user: test
852 | | date: Thu Jan 01 00:00:00 1970 +0000
852 | | date: Thu Jan 01 00:00:00 1970 +0000
853 | | summary: commitD
853 | | summary: commitD
854 | |
854 | |
855 o | changeset: 2:5c51d8d6557d
855 o | changeset: 2:5c51d8d6557d
856 |/ user: test
856 |/ user: test
857 | date: Thu Jan 01 00:00:00 1970 +0000
857 | date: Thu Jan 01 00:00:00 1970 +0000
858 | summary: commitC
858 | summary: commitC
859 |
859 |
860 o changeset: 1:eca11cf91c71
860 o changeset: 1:eca11cf91c71
861 | user: test
861 | user: test
862 | date: Thu Jan 01 00:00:00 1970 +0000
862 | date: Thu Jan 01 00:00:00 1970 +0000
863 | summary: commitB
863 | summary: commitB
864 |
864 |
865 o changeset: 0:105141ef12d0
865 o changeset: 0:105141ef12d0
866 user: test
866 user: test
867 date: Thu Jan 01 00:00:00 1970 +0000
867 date: Thu Jan 01 00:00:00 1970 +0000
868 summary: commitA
868 summary: commitA
869
869
870
870
871 Check bundle behavior:
871 Check bundle behavior:
872
872
873 $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg
873 $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg
874 2 changesets found
874 2 changesets found
875 #if repobundlerepo
875 #if repobundlerepo
876 $ hg log -r 'bundle()' -R ../issue4736.hg
876 $ hg log -r 'bundle()' -R ../issue4736.hg
877 changeset: 3:6625a5168474
877 changeset: 3:6625a5168474
878 parent: 1:eca11cf91c71
878 parent: 1:eca11cf91c71
879 user: test
879 user: test
880 date: Thu Jan 01 00:00:00 1970 +0000
880 date: Thu Jan 01 00:00:00 1970 +0000
881 summary: commitD
881 summary: commitD
882
882
883 changeset: 4:d8db9d137221
883 changeset: 4:d8db9d137221
884 tag: tip
884 tag: tip
885 parent: 2:5c51d8d6557d
885 parent: 2:5c51d8d6557d
886 parent: 3:6625a5168474
886 parent: 3:6625a5168474
887 user: test
887 user: test
888 date: Thu Jan 01 00:00:00 1970 +0000
888 date: Thu Jan 01 00:00:00 1970 +0000
889 summary: mergeCD
889 summary: mergeCD
890
890
891 #endif
891 #endif
892
892
893 check strip behavior
893 check strip behavior
894
894
895 $ hg --config extensions.strip= strip 'desc(commitD)' --debug
895 $ hg --config extensions.strip= strip 'desc(commitD)' --debug
896 resolving manifests
896 resolving manifests
897 branchmerge: False, force: True, partial: False
897 branchmerge: False, force: True, partial: False
898 ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71
898 ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71
899 c: other deleted -> r
899 c: other deleted -> r
900 removing c
900 removing c
901 d: other deleted -> r
901 d: other deleted -> r
902 removing d
902 removing d
903 starting 4 threads for background file closing (?)
903 starting 4 threads for background file closing (?)
904 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
904 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
905 2 changesets found
905 2 changesets found
906 list of changesets:
906 list of changesets:
907 6625a516847449b6f0fa3737b9ba56e9f0f3032c
907 6625a516847449b6f0fa3737b9ba56e9f0f3032c
908 d8db9d1372214336d2b5570f20ee468d2c72fa8b
908 d8db9d1372214336d2b5570f20ee468d2c72fa8b
909 bundle2-output-bundle: "HG20", (1 params) 3 parts total
909 bundle2-output-bundle: "HG20", (1 params) 3 parts total
910 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
910 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
911 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
911 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
912 bundle2-output-part: "phase-heads" 24 bytes payload
912 bundle2-output-part: "phase-heads" 24 bytes payload
913 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg
913 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg
914 updating the branch cache
914 updating the branch cache
915 invalid branch cache (served): tip differs
915 invalid branch cache (served): tip differs
916 $ hg log -G
916 $ hg log -G
917 o changeset: 2:5c51d8d6557d
917 o changeset: 2:5c51d8d6557d
918 | tag: tip
918 | tag: tip
919 | user: test
919 | user: test
920 | date: Thu Jan 01 00:00:00 1970 +0000
920 | date: Thu Jan 01 00:00:00 1970 +0000
921 | summary: commitC
921 | summary: commitC
922 |
922 |
923 @ changeset: 1:eca11cf91c71
923 @ changeset: 1:eca11cf91c71
924 | user: test
924 | user: test
925 | date: Thu Jan 01 00:00:00 1970 +0000
925 | date: Thu Jan 01 00:00:00 1970 +0000
926 | summary: commitB
926 | summary: commitB
927 |
927 |
928 o changeset: 0:105141ef12d0
928 o changeset: 0:105141ef12d0
929 user: test
929 user: test
930 date: Thu Jan 01 00:00:00 1970 +0000
930 date: Thu Jan 01 00:00:00 1970 +0000
931 summary: commitA
931 summary: commitA
932
932
933
933
934 strip backup content
934 strip backup content
935
935
936 #if repobundlerepo
936 #if repobundlerepo
937 $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg
937 $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg
938 changeset: 3:6625a5168474
938 changeset: 3:6625a5168474
939 parent: 1:eca11cf91c71
939 parent: 1:eca11cf91c71
940 user: test
940 user: test
941 date: Thu Jan 01 00:00:00 1970 +0000
941 date: Thu Jan 01 00:00:00 1970 +0000
942 summary: commitD
942 summary: commitD
943
943
944 changeset: 4:d8db9d137221
944 changeset: 4:d8db9d137221
945 tag: tip
945 tag: tip
946 parent: 2:5c51d8d6557d
946 parent: 2:5c51d8d6557d
947 parent: 3:6625a5168474
947 parent: 3:6625a5168474
948 user: test
948 user: test
949 date: Thu Jan 01 00:00:00 1970 +0000
949 date: Thu Jan 01 00:00:00 1970 +0000
950 summary: mergeCD
950 summary: mergeCD
951
951
952
952
953 #endif
953 #endif
954
954
955 Check that the phase cache is properly invalidated after a strip with bookmark.
955 Check that the phase cache is properly invalidated after a strip with bookmark.
956
956
957 $ cat > ../stripstalephasecache.py << EOF
957 $ cat > ../stripstalephasecache.py << EOF
958 > from mercurial import extensions, localrepo
958 > from mercurial import extensions, localrepo
959 > def transactioncallback(orig, repo, desc, *args, **kwargs):
959 > def transactioncallback(orig, repo, desc, *args, **kwargs):
960 > def test(transaction):
960 > def test(transaction):
961 > # observe cache inconsistency
961 > # observe cache inconsistency
962 > try:
962 > try:
963 > [repo.changelog.node(r) for r in repo.revs(b"not public()")]
963 > [repo.changelog.node(r) for r in repo.revs(b"not public()")]
964 > except IndexError:
964 > except IndexError:
965 > repo.ui.status(b"Index error!\n")
965 > repo.ui.status(b"Index error!\n")
966 > transaction = orig(repo, desc, *args, **kwargs)
966 > transaction = orig(repo, desc, *args, **kwargs)
967 > # warm up the phase cache
967 > # warm up the phase cache
968 > list(repo.revs(b"not public()"))
968 > list(repo.revs(b"not public()"))
969 > if desc != b'strip':
969 > if desc != b'strip':
970 > transaction.addpostclose(b"phase invalidation test", test)
970 > transaction.addpostclose(b"phase invalidation test", test)
971 > return transaction
971 > return transaction
972 > def extsetup(ui):
972 > def extsetup(ui):
973 > extensions.wrapfunction(localrepo.localrepository, b"transaction",
973 > extensions.wrapfunction(localrepo.localrepository, b"transaction",
974 > transactioncallback)
974 > transactioncallback)
975 > EOF
975 > EOF
976 $ hg up -C 2
976 $ hg up -C 2
977 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
977 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
978 $ echo k > k
978 $ echo k > k
979 $ hg add k
979 $ hg add k
980 $ hg commit -m commitK
980 $ hg commit -m commitK
981 $ echo l > l
981 $ echo l > l
982 $ hg add l
982 $ hg add l
983 $ hg commit -m commitL
983 $ hg commit -m commitL
984 $ hg book -r tip blah
984 $ hg book -r tip blah
985 $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py
985 $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py
986 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
986 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
987 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg
987 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg
988 $ hg up -C 1
988 $ hg up -C 1
989 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
989 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
990
990
991 Error during post-close callback of the strip transaction
991 Error during post-close callback of the strip transaction
992 (They should be gracefully handled and reported)
992 (They should be gracefully handled and reported)
993
993
994 $ cat > ../crashstrip.py << EOF
994 $ cat > ../crashstrip.py << EOF
995 > from mercurial import error
995 > from mercurial import error
996 > def reposetup(ui, repo):
996 > def reposetup(ui, repo):
997 > class crashstriprepo(repo.__class__):
997 > class crashstriprepo(repo.__class__):
998 > def transaction(self, desc, *args, **kwargs):
998 > def transaction(self, desc, *args, **kwargs):
999 > tr = super(crashstriprepo, self).transaction(desc, *args, **kwargs)
999 > tr = super(crashstriprepo, self).transaction(desc, *args, **kwargs)
1000 > if desc == b'strip':
1000 > if desc == b'strip':
1001 > def crash(tra): raise error.Abort(b'boom')
1001 > def crash(tra): raise error.Abort(b'boom')
1002 > tr.addpostclose(b'crash', crash)
1002 > tr.addpostclose(b'crash', crash)
1003 > return tr
1003 > return tr
1004 > repo.__class__ = crashstriprepo
1004 > repo.__class__ = crashstriprepo
1005 > EOF
1005 > EOF
1006 $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py
1006 $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py
1007 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg
1007 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg
1008 strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg'
1008 strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg'
1009 abort: boom
1009 abort: boom
1010 [255]
1010 [255]
1011
1011
1012 test stripping a working directory parent doesn't switch named branches
1012 test stripping a working directory parent doesn't switch named branches
1013
1013
1014 $ hg log -G
1014 $ hg log -G
1015 @ changeset: 1:eca11cf91c71
1015 @ changeset: 1:eca11cf91c71
1016 | tag: tip
1016 | tag: tip
1017 | user: test
1017 | user: test
1018 | date: Thu Jan 01 00:00:00 1970 +0000
1018 | date: Thu Jan 01 00:00:00 1970 +0000
1019 | summary: commitB
1019 | summary: commitB
1020 |
1020 |
1021 o changeset: 0:105141ef12d0
1021 o changeset: 0:105141ef12d0
1022 user: test
1022 user: test
1023 date: Thu Jan 01 00:00:00 1970 +0000
1023 date: Thu Jan 01 00:00:00 1970 +0000
1024 summary: commitA
1024 summary: commitA
1025
1025
1026
1026
1027 $ hg branch new-branch
1027 $ hg branch new-branch
1028 marked working directory as branch new-branch
1028 marked working directory as branch new-branch
1029 (branches are permanent and global, did you want a bookmark?)
1029 (branches are permanent and global, did you want a bookmark?)
1030 $ hg ci -m "start new branch"
1030 $ hg ci -m "start new branch"
1031 $ echo 'foo' > foo.txt
1031 $ echo 'foo' > foo.txt
1032 $ hg ci -Aqm foo
1032 $ hg ci -Aqm foo
1033 $ hg up default
1033 $ hg up default
1034 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1034 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1035 $ echo 'bar' > bar.txt
1035 $ echo 'bar' > bar.txt
1036 $ hg ci -Aqm bar
1036 $ hg ci -Aqm bar
1037 $ hg up new-branch
1037 $ hg up new-branch
1038 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1038 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1039 $ hg merge default
1039 $ hg merge default
1040 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1040 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1041 (branch merge, don't forget to commit)
1041 (branch merge, don't forget to commit)
1042 $ hg log -G
1042 $ hg log -G
1043 @ changeset: 4:35358f982181
1043 @ changeset: 4:35358f982181
1044 | tag: tip
1044 | tag: tip
1045 | parent: 1:eca11cf91c71
1045 | parent: 1:eca11cf91c71
1046 | user: test
1046 | user: test
1047 | date: Thu Jan 01 00:00:00 1970 +0000
1047 | date: Thu Jan 01 00:00:00 1970 +0000
1048 | summary: bar
1048 | summary: bar
1049 |
1049 |
1050 | @ changeset: 3:f62c6c09b707
1050 | @ changeset: 3:f62c6c09b707
1051 | | branch: new-branch
1051 | | branch: new-branch
1052 | | user: test
1052 | | user: test
1053 | | date: Thu Jan 01 00:00:00 1970 +0000
1053 | | date: Thu Jan 01 00:00:00 1970 +0000
1054 | | summary: foo
1054 | | summary: foo
1055 | |
1055 | |
1056 | o changeset: 2:b1d33a8cadd9
1056 | o changeset: 2:b1d33a8cadd9
1057 |/ branch: new-branch
1057 |/ branch: new-branch
1058 | user: test
1058 | user: test
1059 | date: Thu Jan 01 00:00:00 1970 +0000
1059 | date: Thu Jan 01 00:00:00 1970 +0000
1060 | summary: start new branch
1060 | summary: start new branch
1061 |
1061 |
1062 o changeset: 1:eca11cf91c71
1062 o changeset: 1:eca11cf91c71
1063 | user: test
1063 | user: test
1064 | date: Thu Jan 01 00:00:00 1970 +0000
1064 | date: Thu Jan 01 00:00:00 1970 +0000
1065 | summary: commitB
1065 | summary: commitB
1066 |
1066 |
1067 o changeset: 0:105141ef12d0
1067 o changeset: 0:105141ef12d0
1068 user: test
1068 user: test
1069 date: Thu Jan 01 00:00:00 1970 +0000
1069 date: Thu Jan 01 00:00:00 1970 +0000
1070 summary: commitA
1070 summary: commitA
1071
1071
1072
1072
1073 $ hg strip --force -r 35358f982181
1073 $ hg strip --force -r 35358f982181
1074 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1074 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1075 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-50d992d4-backup.hg
1075 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-50d992d4-backup.hg
1076 $ hg log -G
1076 $ hg log -G
1077 @ changeset: 3:f62c6c09b707
1077 @ changeset: 3:f62c6c09b707
1078 | branch: new-branch
1078 | branch: new-branch
1079 | tag: tip
1079 | tag: tip
1080 | user: test
1080 | user: test
1081 | date: Thu Jan 01 00:00:00 1970 +0000
1081 | date: Thu Jan 01 00:00:00 1970 +0000
1082 | summary: foo
1082 | summary: foo
1083 |
1083 |
1084 o changeset: 2:b1d33a8cadd9
1084 o changeset: 2:b1d33a8cadd9
1085 | branch: new-branch
1085 | branch: new-branch
1086 | user: test
1086 | user: test
1087 | date: Thu Jan 01 00:00:00 1970 +0000
1087 | date: Thu Jan 01 00:00:00 1970 +0000
1088 | summary: start new branch
1088 | summary: start new branch
1089 |
1089 |
1090 o changeset: 1:eca11cf91c71
1090 o changeset: 1:eca11cf91c71
1091 | user: test
1091 | user: test
1092 | date: Thu Jan 01 00:00:00 1970 +0000
1092 | date: Thu Jan 01 00:00:00 1970 +0000
1093 | summary: commitB
1093 | summary: commitB
1094 |
1094 |
1095 o changeset: 0:105141ef12d0
1095 o changeset: 0:105141ef12d0
1096 user: test
1096 user: test
1097 date: Thu Jan 01 00:00:00 1970 +0000
1097 date: Thu Jan 01 00:00:00 1970 +0000
1098 summary: commitA
1098 summary: commitA
1099
1099
1100
1100
1101 $ hg up default
1101 $ hg up default
1102 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1102 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1103 $ echo 'bar' > bar.txt
1103 $ echo 'bar' > bar.txt
1104 $ hg ci -Aqm bar
1104 $ hg ci -Aqm bar
1105 $ hg up new-branch
1105 $ hg up new-branch
1106 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1106 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1107 $ hg merge default
1107 $ hg merge default
1108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1109 (branch merge, don't forget to commit)
1109 (branch merge, don't forget to commit)
1110 $ hg ci -m merge
1110 $ hg ci -m merge
1111 $ hg log -G
1111 $ hg log -G
1112 @ changeset: 5:4cf5e92caec2
1112 @ changeset: 5:4cf5e92caec2
1113 |\ branch: new-branch
1113 |\ branch: new-branch
1114 | | tag: tip
1114 | | tag: tip
1115 | | parent: 3:f62c6c09b707
1115 | | parent: 3:f62c6c09b707
1116 | | parent: 4:35358f982181
1116 | | parent: 4:35358f982181
1117 | | user: test
1117 | | user: test
1118 | | date: Thu Jan 01 00:00:00 1970 +0000
1118 | | date: Thu Jan 01 00:00:00 1970 +0000
1119 | | summary: merge
1119 | | summary: merge
1120 | |
1120 | |
1121 | o changeset: 4:35358f982181
1121 | o changeset: 4:35358f982181
1122 | | parent: 1:eca11cf91c71
1122 | | parent: 1:eca11cf91c71
1123 | | user: test
1123 | | user: test
1124 | | date: Thu Jan 01 00:00:00 1970 +0000
1124 | | date: Thu Jan 01 00:00:00 1970 +0000
1125 | | summary: bar
1125 | | summary: bar
1126 | |
1126 | |
1127 o | changeset: 3:f62c6c09b707
1127 o | changeset: 3:f62c6c09b707
1128 | | branch: new-branch
1128 | | branch: new-branch
1129 | | user: test
1129 | | user: test
1130 | | date: Thu Jan 01 00:00:00 1970 +0000
1130 | | date: Thu Jan 01 00:00:00 1970 +0000
1131 | | summary: foo
1131 | | summary: foo
1132 | |
1132 | |
1133 o | changeset: 2:b1d33a8cadd9
1133 o | changeset: 2:b1d33a8cadd9
1134 |/ branch: new-branch
1134 |/ branch: new-branch
1135 | user: test
1135 | user: test
1136 | date: Thu Jan 01 00:00:00 1970 +0000
1136 | date: Thu Jan 01 00:00:00 1970 +0000
1137 | summary: start new branch
1137 | summary: start new branch
1138 |
1138 |
1139 o changeset: 1:eca11cf91c71
1139 o changeset: 1:eca11cf91c71
1140 | user: test
1140 | user: test
1141 | date: Thu Jan 01 00:00:00 1970 +0000
1141 | date: Thu Jan 01 00:00:00 1970 +0000
1142 | summary: commitB
1142 | summary: commitB
1143 |
1143 |
1144 o changeset: 0:105141ef12d0
1144 o changeset: 0:105141ef12d0
1145 user: test
1145 user: test
1146 date: Thu Jan 01 00:00:00 1970 +0000
1146 date: Thu Jan 01 00:00:00 1970 +0000
1147 summary: commitA
1147 summary: commitA
1148
1148
1149
1149
1150 $ hg strip -r 35358f982181
1150 $ hg strip -r 35358f982181
1151 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1151 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1152 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1152 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1153 $ hg log -G
1153 $ hg log -G
1154 @ changeset: 3:f62c6c09b707
1154 @ changeset: 3:f62c6c09b707
1155 | branch: new-branch
1155 | branch: new-branch
1156 | tag: tip
1156 | tag: tip
1157 | user: test
1157 | user: test
1158 | date: Thu Jan 01 00:00:00 1970 +0000
1158 | date: Thu Jan 01 00:00:00 1970 +0000
1159 | summary: foo
1159 | summary: foo
1160 |
1160 |
1161 o changeset: 2:b1d33a8cadd9
1161 o changeset: 2:b1d33a8cadd9
1162 | branch: new-branch
1162 | branch: new-branch
1163 | user: test
1163 | user: test
1164 | date: Thu Jan 01 00:00:00 1970 +0000
1164 | date: Thu Jan 01 00:00:00 1970 +0000
1165 | summary: start new branch
1165 | summary: start new branch
1166 |
1166 |
1167 o changeset: 1:eca11cf91c71
1167 o changeset: 1:eca11cf91c71
1168 | user: test
1168 | user: test
1169 | date: Thu Jan 01 00:00:00 1970 +0000
1169 | date: Thu Jan 01 00:00:00 1970 +0000
1170 | summary: commitB
1170 | summary: commitB
1171 |
1171 |
1172 o changeset: 0:105141ef12d0
1172 o changeset: 0:105141ef12d0
1173 user: test
1173 user: test
1174 date: Thu Jan 01 00:00:00 1970 +0000
1174 date: Thu Jan 01 00:00:00 1970 +0000
1175 summary: commitA
1175 summary: commitA
1176
1176
1177
1177
1178 stripping a set containing a merge properly reset file content, including items on other branches
1178 stripping a set containing a merge properly reset file content, including items on other branches
1179
1179
1180 The added file is moved to unknown, which is the behavior we have been seeing for other `hg strip --keep` call.
1180 The added file is moved to unknown, which is the behavior we have been seeing for other `hg strip --keep` call.
1181
1181
1182 stripping a set containing a merge properly reset file content, including items on other branches
1182 stripping a set containing a merge properly reset file content, including items on other branches
1183
1183
1184 The added file is moved to unknown, which is the behavior we have been seeing for other `hg strip --keep` call.
1184 The added file is moved to unknown, which is the behavior we have been seeing for other `hg strip --keep` call.
1185
1185
1186 $ hg unbundle -u $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1186 $ hg unbundle -u $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1187 adding changesets
1187 adding changesets
1188 adding manifests
1188 adding manifests
1189 adding file changes
1189 adding file changes
1190 added 2 changesets with 1 changes to 1 files
1190 added 2 changesets with 1 changes to 1 files
1191 new changesets 35358f982181:4cf5e92caec2 (2 drafts)
1191 new changesets 35358f982181:4cf5e92caec2 (2 drafts)
1192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1193
1193
1194 $ hg id
1194 $ hg id
1195 4cf5e92caec2 (new-branch) tip
1195 4cf5e92caec2 (new-branch) tip
1196 $ hg status --rev "f62c6c09b707"
1196 $ hg status --rev "f62c6c09b707"
1197 A bar.txt
1197 A bar.txt
1198 $ hg diff --rev "f62c6c09b707"
1198 $ hg diff --rev "f62c6c09b707"
1199 diff -r f62c6c09b707 bar.txt
1199 diff -r f62c6c09b707 bar.txt
1200 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1200 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1201 +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000
1201 +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000
1202 @@ -0,0 +1,1 @@
1202 @@ -0,0 +1,1 @@
1203 +bar
1203 +bar
1204 $ hg log -G -v --rev 35358f982181:: --patch
1204 $ hg log -G -v --rev 35358f982181:: --patch
1205 @ changeset: 5:4cf5e92caec2
1205 @ changeset: 5:4cf5e92caec2
1206 |\ branch: new-branch
1206 |\ branch: new-branch
1207 | ~ tag: tip
1207 | ~ tag: tip
1208 | parent: 3:f62c6c09b707
1208 | parent: 3:f62c6c09b707
1209 | parent: 4:35358f982181
1209 | parent: 4:35358f982181
1210 | user: test
1210 | user: test
1211 | date: Thu Jan 01 00:00:00 1970 +0000
1211 | date: Thu Jan 01 00:00:00 1970 +0000
1212 | description:
1212 | description:
1213 | merge
1213 | merge
1214 |
1214 |
1215 |
1215 |
1216 | diff -r f62c6c09b707 -r 4cf5e92caec2 bar.txt
1216 | diff -r f62c6c09b707 -r 4cf5e92caec2 bar.txt
1217 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1217 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1218 | +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000
1218 | +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000
1219 | @@ -0,0 +1,1 @@
1219 | @@ -0,0 +1,1 @@
1220 | +bar
1220 | +bar
1221 |
1221 |
1222 o changeset: 4:35358f982181
1222 o changeset: 4:35358f982181
1223 | parent: 1:eca11cf91c71
1223 | parent: 1:eca11cf91c71
1224 ~ user: test
1224 ~ user: test
1225 date: Thu Jan 01 00:00:00 1970 +0000
1225 date: Thu Jan 01 00:00:00 1970 +0000
1226 files: bar.txt
1226 files: bar.txt
1227 description:
1227 description:
1228 bar
1228 bar
1229
1229
1230
1230
1231 diff -r eca11cf91c71 -r 35358f982181 bar.txt
1231 diff -r eca11cf91c71 -r 35358f982181 bar.txt
1232 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1232 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1233 +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000
1233 +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000
1234 @@ -0,0 +1,1 @@
1234 @@ -0,0 +1,1 @@
1235 +bar
1235 +bar
1236
1236
1237
1237
1238 $ hg strip -k -r 35358f982181
1238 $ hg strip -k -r 35358f982181
1239 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1239 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1240 $ hg log -G
1240 $ hg log -G
1241 @ changeset: 3:f62c6c09b707
1241 @ changeset: 3:f62c6c09b707
1242 | branch: new-branch
1242 | branch: new-branch
1243 | tag: tip
1243 | tag: tip
1244 | user: test
1244 | user: test
1245 | date: Thu Jan 01 00:00:00 1970 +0000
1245 | date: Thu Jan 01 00:00:00 1970 +0000
1246 | summary: foo
1246 | summary: foo
1247 |
1247 |
1248 o changeset: 2:b1d33a8cadd9
1248 o changeset: 2:b1d33a8cadd9
1249 | branch: new-branch
1249 | branch: new-branch
1250 | user: test
1250 | user: test
1251 | date: Thu Jan 01 00:00:00 1970 +0000
1251 | date: Thu Jan 01 00:00:00 1970 +0000
1252 | summary: start new branch
1252 | summary: start new branch
1253 |
1253 |
1254 o changeset: 1:eca11cf91c71
1254 o changeset: 1:eca11cf91c71
1255 | user: test
1255 | user: test
1256 | date: Thu Jan 01 00:00:00 1970 +0000
1256 | date: Thu Jan 01 00:00:00 1970 +0000
1257 | summary: commitB
1257 | summary: commitB
1258 |
1258 |
1259 o changeset: 0:105141ef12d0
1259 o changeset: 0:105141ef12d0
1260 user: test
1260 user: test
1261 date: Thu Jan 01 00:00:00 1970 +0000
1261 date: Thu Jan 01 00:00:00 1970 +0000
1262 summary: commitA
1262 summary: commitA
1263
1263
1264
1264
1265 $ hg status -A
1265 $ hg status -A
1266 ? bar.txt
1266 ? bar.txt
1267 C a
1267 C a
1268 C b
1268 C b
1269 C foo.txt
1269 C foo.txt
1270 $ cat bar.txt
1270 $ cat bar.txt
1271 bar
1271 bar
1272
1272
1273 Use delayedstrip to strip inside a transaction
1273 Use delayedstrip to strip inside a transaction
1274
1274
1275 $ cd $TESTTMP
1275 $ cd $TESTTMP
1276 $ hg init delayedstrip
1276 $ hg init delayedstrip
1277 $ cd delayedstrip
1277 $ cd delayedstrip
1278 $ hg debugdrawdag <<'EOS'
1278 $ hg debugdrawdag <<'EOS'
1279 > D
1279 > D
1280 > |
1280 > |
1281 > C F H # Commit on top of "I",
1281 > C F H # Commit on top of "I",
1282 > | |/| # Strip B+D+I+E+G+H+Z
1282 > | |/| # Strip B+D+I+E+G+H+Z
1283 > I B E G
1283 > I B E G
1284 > \|/
1284 > \|/
1285 > A Z
1285 > A Z
1286 > EOS
1286 > EOS
1287 $ cp -R . ../scmutilcleanup
1287 $ cp -R . ../scmutilcleanup
1288
1288
1289 $ hg up -C I
1289 $ hg up -C I
1290 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1290 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1291 $ echo 3 >> I
1291 $ echo 3 >> I
1292 $ cat > $TESTTMP/delayedstrip.py <<EOF
1292 $ cat > $TESTTMP/delayedstrip.py <<EOF
1293 > from __future__ import absolute_import
1293 > from __future__ import absolute_import
1294 > from mercurial import commands, registrar, repair
1294 > from mercurial import commands, registrar, repair
1295 > cmdtable = {}
1295 > cmdtable = {}
1296 > command = registrar.command(cmdtable)
1296 > command = registrar.command(cmdtable)
1297 > @command(b'testdelayedstrip')
1297 > @command(b'testdelayedstrip')
1298 > def testdelayedstrip(ui, repo):
1298 > def testdelayedstrip(ui, repo):
1299 > def getnodes(expr):
1299 > def getnodes(expr):
1300 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1300 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1301 > with repo.wlock():
1301 > with repo.wlock():
1302 > with repo.lock():
1302 > with repo.lock():
1303 > with repo.transaction(b'delayedstrip'):
1303 > with repo.transaction(b'delayedstrip'):
1304 > repair.delayedstrip(ui, repo, getnodes(b'B+I+Z+D+E'), b'J')
1304 > repair.delayedstrip(ui, repo, getnodes(b'B+I+Z+D+E'), b'J')
1305 > repair.delayedstrip(ui, repo, getnodes(b'G+H+Z'), b'I')
1305 > repair.delayedstrip(ui, repo, getnodes(b'G+H+Z'), b'I')
1306 > commands.commit(ui, repo, message=b'J', date=b'0 0')
1306 > commands.commit(ui, repo, message=b'J', date=b'0 0')
1307 > EOF
1307 > EOF
1308 $ hg testdelayedstrip --config extensions.t=$TESTTMP/delayedstrip.py
1308 $ hg testdelayedstrip --config extensions.t=$TESTTMP/delayedstrip.py
1309 warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22
1309 warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22
1310 saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg
1310 saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg
1311
1311
1312 $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)'
1312 $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)'
1313 @ 6:2f2d51af6205 J
1313 @ 6:2f2d51af6205 J
1314 |
1314 |
1315 o 3:08ebfeb61bac I
1315 o 3:08ebfeb61bac I
1316 |
1316 |
1317 | o 5:64a8289d2492 F
1317 | o 5:64a8289d2492 F
1318 | |
1318 | |
1319 | o 2:7fb047a69f22 E
1319 | o 2:7fb047a69f22 E
1320 |/
1320 |/
1321 | o 4:26805aba1e60 C
1321 | o 4:26805aba1e60 C
1322 | |
1322 | |
1323 | o 1:112478962961 B
1323 | o 1:112478962961 B
1324 |/
1324 |/
1325 o 0:426bada5c675 A
1325 o 0:426bada5c675 A
1326
1326
1327 Test high-level scmutil.cleanupnodes API
1327 Test high-level scmutil.cleanupnodes API
1328
1328
1329 $ cd $TESTTMP/scmutilcleanup
1329 $ cd $TESTTMP/scmutilcleanup
1330 $ hg debugdrawdag <<'EOS'
1330 $ hg debugdrawdag <<'EOS'
1331 > D2 F2 G2 # D2, F2, G2 are replacements for D, F, G
1331 > D2 F2 G2 # D2, F2, G2 are replacements for D, F, G
1332 > | | |
1332 > | | |
1333 > C H G
1333 > C H G
1334 > EOS
1334 > EOS
1335 $ for i in B C D F G I Z; do
1335 $ for i in B C D F G I Z; do
1336 > hg bookmark -i -r $i b-$i
1336 > hg bookmark -i -r $i b-$i
1337 > done
1337 > done
1338 $ hg bookmark -i -r E 'b-F@divergent1'
1338 $ hg bookmark -i -r E 'b-F@divergent1'
1339 $ hg bookmark -i -r H 'b-F@divergent2'
1339 $ hg bookmark -i -r H 'b-F@divergent2'
1340 $ hg bookmark -i -r G 'b-F@divergent3'
1340 $ hg bookmark -i -r G 'b-F@divergent3'
1341 $ cp -R . ../scmutilcleanup.obsstore
1341 $ cp -R . ../scmutilcleanup.obsstore
1342
1342
1343 $ cat > $TESTTMP/scmutilcleanup.py <<EOF
1343 $ cat > $TESTTMP/scmutilcleanup.py <<EOF
1344 > from mercurial import registrar, scmutil
1344 > from mercurial import registrar, scmutil
1345 > cmdtable = {}
1345 > cmdtable = {}
1346 > command = registrar.command(cmdtable)
1346 > command = registrar.command(cmdtable)
1347 > @command(b'testnodescleanup')
1347 > @command(b'testnodescleanup')
1348 > def testnodescleanup(ui, repo):
1348 > def testnodescleanup(ui, repo):
1349 > def nodes(expr):
1349 > def nodes(expr):
1350 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1350 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1351 > def node(expr):
1351 > def node(expr):
1352 > return nodes(expr)[0]
1352 > return nodes(expr)[0]
1353 > with repo.wlock():
1353 > with repo.wlock():
1354 > with repo.lock():
1354 > with repo.lock():
1355 > with repo.transaction(b'delayedstrip'):
1355 > with repo.transaction(b'delayedstrip'):
1356 > mapping = {node(b'F'): [node(b'F2')],
1356 > mapping = {node(b'F'): [node(b'F2')],
1357 > node(b'D'): [node(b'D2')],
1357 > node(b'D'): [node(b'D2')],
1358 > node(b'G'): [node(b'G2')]}
1358 > node(b'G'): [node(b'G2')]}
1359 > scmutil.cleanupnodes(repo, mapping, b'replace')
1359 > scmutil.cleanupnodes(repo, mapping, b'replace')
1360 > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2-obsolete()'),
1360 > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2-obsolete()'),
1361 > b'replace')
1361 > b'replace')
1362 > EOF
1362 > EOF
1363 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
1363 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
1364 warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60
1364 warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60
1365 saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg
1365 saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg
1366
1366
1367 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1367 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1368 o 8:1473d4b996d1 G2 b-F@divergent3 b-G
1368 o 8:1473d4b996d1 G2 b-F@divergent3 b-G
1369 |
1369 |
1370 | o 7:d11b3456a873 F2 b-F
1370 | o 7:d11b3456a873 F2 b-F
1371 | |
1371 | |
1372 | o 5:5cb05ba470a7 H
1372 | o 5:5cb05ba470a7 H
1373 |/|
1373 |/|
1374 | o 3:7fb047a69f22 E b-F@divergent1
1374 | o 3:7fb047a69f22 E b-F@divergent1
1375 | |
1375 | |
1376 | | o 6:7c78f703e465 D2 b-D
1376 | | o 6:7c78f703e465 D2 b-D
1377 | | |
1377 | | |
1378 | | o 4:26805aba1e60 C
1378 | | o 4:26805aba1e60 C
1379 | | |
1379 | | |
1380 | | o 2:112478962961 B
1380 | | o 2:112478962961 B
1381 | |/
1381 | |/
1382 o | 1:1fc8102cda62 G
1382 o | 1:1fc8102cda62 G
1383 /
1383 /
1384 o 0:426bada5c675 A b-B b-C b-I
1384 o 0:426bada5c675 A b-B b-C b-I
1385
1385
1386 $ hg bookmark
1386 $ hg bookmark
1387 b-B 0:426bada5c675
1387 b-B 0:426bada5c675
1388 b-C 0:426bada5c675
1388 b-C 0:426bada5c675
1389 b-D 6:7c78f703e465
1389 b-D 6:7c78f703e465
1390 b-F 7:d11b3456a873
1390 b-F 7:d11b3456a873
1391 b-F@divergent1 3:7fb047a69f22
1391 b-F@divergent1 3:7fb047a69f22
1392 b-F@divergent3 8:1473d4b996d1
1392 b-F@divergent3 8:1473d4b996d1
1393 b-G 8:1473d4b996d1
1393 b-G 8:1473d4b996d1
1394 b-I 0:426bada5c675
1394 b-I 0:426bada5c675
1395 b-Z -1:000000000000
1395 b-Z -1:000000000000
1396
1396
1397 Test the above using obsstore "by the way". Not directly related to strip, but
1397 Test the above using obsstore "by the way". Not directly related to strip, but
1398 we have reusable code here
1398 we have reusable code here
1399
1399
1400 $ cd $TESTTMP/scmutilcleanup.obsstore
1400 $ cd $TESTTMP/scmutilcleanup.obsstore
1401 $ cat >> .hg/hgrc <<EOF
1401 $ cat >> .hg/hgrc <<EOF
1402 > [experimental]
1402 > [experimental]
1403 > evolution=true
1403 > evolution=true
1404 > evolution.track-operation=1
1404 > evolution.track-operation=1
1405 > EOF
1405 > EOF
1406
1406
1407 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
1407 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
1408 4 new orphan changesets
1408 4 new orphan changesets
1409
1409
1410 $ rm .hg/localtags
1410 $ rm .hg/localtags
1411 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1411 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1412 * 12:1473d4b996d1 G2 b-F@divergent3 b-G
1412 * 12:1473d4b996d1 G2 b-F@divergent3 b-G
1413 |
1413 |
1414 | * 11:d11b3456a873 F2 b-F
1414 | * 11:d11b3456a873 F2 b-F
1415 | |
1415 | |
1416 | * 8:5cb05ba470a7 H
1416 | * 8:5cb05ba470a7 H
1417 |/|
1417 |/|
1418 | o 4:7fb047a69f22 E b-F@divergent1
1418 | o 4:7fb047a69f22 E b-F@divergent1
1419 | |
1419 | |
1420 | | * 10:7c78f703e465 D2 b-D
1420 | | * 10:7c78f703e465 D2 b-D
1421 | | |
1421 | | |
1422 | | x 6:26805aba1e60 C
1422 | | x 6:26805aba1e60 C
1423 | | |
1423 | | |
1424 | | x 3:112478962961 B
1424 | | x 3:112478962961 B
1425 | |/
1425 | |/
1426 x | 1:1fc8102cda62 G
1426 x | 1:1fc8102cda62 G
1427 /
1427 /
1428 o 0:426bada5c675 A b-B b-C b-I
1428 o 0:426bada5c675 A b-B b-C b-I
1429
1429
1430 $ hg debugobsolete
1430 $ hg debugobsolete
1431 1fc8102cda6204549f031015641606ccf5513ec3 1473d4b996d1d1b121de6b39fab6a04fbf9d873e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'}
1431 1fc8102cda6204549f031015641606ccf5513ec3 1473d4b996d1d1b121de6b39fab6a04fbf9d873e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'}
1432 64a8289d249234b9886244d379f15e6b650b28e3 d11b3456a873daec7c7bc53e5622e8df6d741bd2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'}
1432 64a8289d249234b9886244d379f15e6b650b28e3 d11b3456a873daec7c7bc53e5622e8df6d741bd2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'}
1433 f585351a92f85104bff7c284233c338b10eb1df7 7c78f703e465d73102cc8780667ce269c5208a40 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'replace', 'user': 'test'}
1433 f585351a92f85104bff7c284233c338b10eb1df7 7c78f703e465d73102cc8780667ce269c5208a40 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'replace', 'user': 'test'}
1434 48b9aae0607f43ff110d84e6883c151942add5ab 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1434 48b9aae0607f43ff110d84e6883c151942add5ab 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1435 112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1435 112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1436 08ebfeb61bac6e3f12079de774d285a0d6689eba 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1436 08ebfeb61bac6e3f12079de774d285a0d6689eba 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1437 26805aba1e600a82e93661149f2313866a221a7b 0 {112478962961147124edd43549aedd1a335e44bf} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1437 26805aba1e600a82e93661149f2313866a221a7b 0 {112478962961147124edd43549aedd1a335e44bf} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1438 $ cd ..
1438 $ cd ..
1439
1439
1440 Test that obsmarkers are restored even when not using generaldelta
1440 Test that obsmarkers are restored even when not using generaldelta
1441
1441
1442 $ hg --config format.usegeneraldelta=no init issue5678
1442 $ hg --config format.usegeneraldelta=no init issue5678
1443 $ cd issue5678
1443 $ cd issue5678
1444 $ cat >> .hg/hgrc <<EOF
1444 $ cat >> .hg/hgrc <<EOF
1445 > [experimental]
1445 > [experimental]
1446 > evolution=true
1446 > evolution=true
1447 > EOF
1447 > EOF
1448 $ echo a > a
1448 $ echo a > a
1449 $ hg ci -Aqm a
1449 $ hg ci -Aqm a
1450 $ hg ci --amend -m a2
1450 $ hg ci --amend -m a2
1451 $ hg debugobsolete
1451 $ hg debugobsolete
1452 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1452 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1453 $ hg strip .
1453 $ hg strip .
1454 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1454 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1455 saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/489bac576828-bef27e14-backup.hg
1455 saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/489bac576828-bef27e14-backup.hg
1456 $ hg unbundle -q .hg/strip-backup/*
1456 $ hg unbundle -q .hg/strip-backup/*
1457 $ hg debugobsolete
1457 $ hg debugobsolete
1458 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1458 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1459 $ cd ..
1459 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now