##// END OF EJS Templates
Infer a --repository argument from command arguments when reasonable....
Jesse Glick -
r6150:aafdea37 default
parent child Browse files
Show More
@@ -1,413 +1,417 b''
1 1 # dispatch.py - command dispatching for mercurial
2 2 #
3 3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
4 4 #
5 5 # This software may be used and distributed according to the terms
6 6 # of the GNU General Public License, incorporated herein by reference.
7 7
8 8 from node import *
9 9 from i18n import _
10 10 import os, sys, atexit, signal, pdb, traceback, socket, errno, shlex, time
11 11 import util, commands, hg, lock, fancyopts, revlog, version, extensions, hook
12 12 import cmdutil
13 13 import ui as _ui
14 14
15 15 class ParseError(Exception):
16 16 """Exception raised on errors in parsing the command line."""
17 17
18 18 def run():
19 19 "run the command in sys.argv"
20 20 sys.exit(dispatch(sys.argv[1:]))
21 21
22 22 def dispatch(args):
23 23 "run the command specified in args"
24 24 try:
25 25 u = _ui.ui(traceback='--traceback' in args)
26 26 except util.Abort, inst:
27 27 sys.stderr.write(_("abort: %s\n") % inst)
28 28 return -1
29 29 return _runcatch(u, args)
30 30
31 31 def _runcatch(ui, args):
32 32 def catchterm(*args):
33 33 raise util.SignalInterrupt
34 34
35 35 for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM':
36 36 num = getattr(signal, name, None)
37 37 if num: signal.signal(num, catchterm)
38 38
39 39 try:
40 40 try:
41 41 # enter the debugger before command execution
42 42 if '--debugger' in args:
43 43 pdb.set_trace()
44 44 try:
45 45 return _dispatch(ui, args)
46 46 finally:
47 47 ui.flush()
48 48 except:
49 49 # enter the debugger when we hit an exception
50 50 if '--debugger' in args:
51 51 pdb.post_mortem(sys.exc_info()[2])
52 52 ui.print_exc()
53 53 raise
54 54
55 55 except ParseError, inst:
56 56 if inst.args[0]:
57 57 ui.warn(_("hg %s: %s\n") % (inst.args[0], inst.args[1]))
58 58 commands.help_(ui, inst.args[0])
59 59 else:
60 60 ui.warn(_("hg: %s\n") % inst.args[1])
61 61 commands.help_(ui, 'shortlist')
62 62 except cmdutil.AmbiguousCommand, inst:
63 63 ui.warn(_("hg: command '%s' is ambiguous:\n %s\n") %
64 64 (inst.args[0], " ".join(inst.args[1])))
65 65 except cmdutil.UnknownCommand, inst:
66 66 ui.warn(_("hg: unknown command '%s'\n") % inst.args[0])
67 67 commands.help_(ui, 'shortlist')
68 68 except hg.RepoError, inst:
69 69 ui.warn(_("abort: %s!\n") % inst)
70 70 except lock.LockHeld, inst:
71 71 if inst.errno == errno.ETIMEDOUT:
72 72 reason = _('timed out waiting for lock held by %s') % inst.locker
73 73 else:
74 74 reason = _('lock held by %s') % inst.locker
75 75 ui.warn(_("abort: %s: %s\n") % (inst.desc or inst.filename, reason))
76 76 except lock.LockUnavailable, inst:
77 77 ui.warn(_("abort: could not lock %s: %s\n") %
78 78 (inst.desc or inst.filename, inst.strerror))
79 79 except revlog.RevlogError, inst:
80 80 ui.warn(_("abort: %s!\n") % inst)
81 81 except util.SignalInterrupt:
82 82 ui.warn(_("killed!\n"))
83 83 except KeyboardInterrupt:
84 84 try:
85 85 ui.warn(_("interrupted!\n"))
86 86 except IOError, inst:
87 87 if inst.errno == errno.EPIPE:
88 88 if ui.debugflag:
89 89 ui.warn(_("\nbroken pipe\n"))
90 90 else:
91 91 raise
92 92 except socket.error, inst:
93 93 ui.warn(_("abort: %s\n") % inst[1])
94 94 except IOError, inst:
95 95 if hasattr(inst, "code"):
96 96 ui.warn(_("abort: %s\n") % inst)
97 97 elif hasattr(inst, "reason"):
98 98 try: # usually it is in the form (errno, strerror)
99 99 reason = inst.reason.args[1]
100 100 except: # it might be anything, for example a string
101 101 reason = inst.reason
102 102 ui.warn(_("abort: error: %s\n") % reason)
103 103 elif hasattr(inst, "args") and inst[0] == errno.EPIPE:
104 104 if ui.debugflag:
105 105 ui.warn(_("broken pipe\n"))
106 106 elif getattr(inst, "strerror", None):
107 107 if getattr(inst, "filename", None):
108 108 ui.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename))
109 109 else:
110 110 ui.warn(_("abort: %s\n") % inst.strerror)
111 111 else:
112 112 raise
113 113 except OSError, inst:
114 114 if getattr(inst, "filename", None):
115 115 ui.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename))
116 116 else:
117 117 ui.warn(_("abort: %s\n") % inst.strerror)
118 118 except util.UnexpectedOutput, inst:
119 119 ui.warn(_("abort: %s") % inst[0])
120 120 if not isinstance(inst[1], basestring):
121 121 ui.warn(" %r\n" % (inst[1],))
122 122 elif not inst[1]:
123 123 ui.warn(_(" empty string\n"))
124 124 else:
125 125 ui.warn("\n%r\n" % util.ellipsis(inst[1]))
126 126 except ImportError, inst:
127 127 m = str(inst).split()[-1]
128 128 ui.warn(_("abort: could not import module %s!\n") % m)
129 129 if m in "mpatch bdiff".split():
130 130 ui.warn(_("(did you forget to compile extensions?)\n"))
131 131 elif m in "zlib".split():
132 132 ui.warn(_("(is your Python install correct?)\n"))
133 133
134 134 except util.Abort, inst:
135 135 ui.warn(_("abort: %s\n") % inst)
136 136 except MemoryError:
137 137 ui.warn(_("abort: out of memory\n"))
138 138 except SystemExit, inst:
139 139 # Commands shouldn't sys.exit directly, but give a return code.
140 140 # Just in case catch this and and pass exit code to caller.
141 141 return inst.code
142 142 except:
143 143 ui.warn(_("** unknown exception encountered, details follow\n"))
144 144 ui.warn(_("** report bug details to "
145 145 "http://www.selenic.com/mercurial/bts\n"))
146 146 ui.warn(_("** or mercurial@selenic.com\n"))
147 147 ui.warn(_("** Mercurial Distributed SCM (version %s)\n")
148 148 % version.get_version())
149 149 raise
150 150
151 151 return -1
152 152
153 def _findrepo():
154 p = os.getcwd()
153 def _findrepo(p):
155 154 while not os.path.isdir(os.path.join(p, ".hg")):
156 155 oldp, p = p, os.path.dirname(p)
157 156 if p == oldp:
158 157 return None
159 158
160 159 return p
161 160
162 161 def _parse(ui, args):
163 162 options = {}
164 163 cmdoptions = {}
165 164
166 165 try:
167 166 args = fancyopts.fancyopts(args, commands.globalopts, options)
168 167 except fancyopts.getopt.GetoptError, inst:
169 168 raise ParseError(None, inst)
170 169
171 170 if args:
172 171 cmd, args = args[0], args[1:]
173 172 aliases, i = cmdutil.findcmd(ui, cmd, commands.table)
174 173 cmd = aliases[0]
175 174 defaults = ui.config("defaults", cmd)
176 175 if defaults:
177 176 args = shlex.split(defaults) + args
178 177 c = list(i[1])
179 178 else:
180 179 cmd = None
181 180 c = []
182 181
183 182 # combine global options into local
184 183 for o in commands.globalopts:
185 184 c.append((o[0], o[1], options[o[1]], o[3]))
186 185
187 186 try:
188 187 args = fancyopts.fancyopts(args, c, cmdoptions)
189 188 except fancyopts.getopt.GetoptError, inst:
190 189 raise ParseError(cmd, inst)
191 190
192 191 # separate global options back out
193 192 for o in commands.globalopts:
194 193 n = o[1]
195 194 options[n] = cmdoptions[n]
196 195 del cmdoptions[n]
197 196
198 197 return (cmd, cmd and i[0] or None, args, options, cmdoptions)
199 198
200 199 def _parseconfig(config):
201 200 """parse the --config options from the command line"""
202 201 parsed = []
203 202 for cfg in config:
204 203 try:
205 204 name, value = cfg.split('=', 1)
206 205 section, name = name.split('.', 1)
207 206 if not section or not name:
208 207 raise IndexError
209 208 parsed.append((section, name, value))
210 209 except (IndexError, ValueError):
211 210 raise util.Abort(_('malformed --config option: %s') % cfg)
212 211 return parsed
213 212
214 213 def _earlygetopt(aliases, args):
215 214 """Return list of values for an option (or aliases).
216 215
217 216 The values are listed in the order they appear in args.
218 217 The options and values are removed from args.
219 218 """
220 219 try:
221 220 argcount = args.index("--")
222 221 except ValueError:
223 222 argcount = len(args)
224 223 shortopts = [opt for opt in aliases if len(opt) == 2]
225 224 values = []
226 225 pos = 0
227 226 while pos < argcount:
228 227 if args[pos] in aliases:
229 228 if pos + 1 >= argcount:
230 229 # ignore and let getopt report an error if there is no value
231 230 break
232 231 del args[pos]
233 232 values.append(args.pop(pos))
234 233 argcount -= 2
235 234 elif args[pos][:2] in shortopts:
236 235 # short option can have no following space, e.g. hg log -Rfoo
237 236 values.append(args.pop(pos)[2:])
238 237 argcount -= 1
239 238 else:
240 239 pos += 1
241 240 return values
242 241
243 242 _loaded = {}
244 243 def _dispatch(ui, args):
245 244 # read --config before doing anything else
246 245 # (e.g. to change trust settings for reading .hg/hgrc)
247 246 config = _earlygetopt(['--config'], args)
248 247 if config:
249 248 ui.updateopts(config=_parseconfig(config))
250 249
251 250 # check for cwd
252 251 cwd = _earlygetopt(['--cwd'], args)
253 252 if cwd:
254 253 os.chdir(cwd[-1])
255 254
256 255 # read the local repository .hgrc into a local ui object
257 path = _findrepo() or ""
256 path = _findrepo(os.getcwd()) or ""
258 257 if not path:
259 258 lui = ui
260 259 if path:
261 260 try:
262 261 lui = _ui.ui(parentui=ui)
263 262 lui.readconfig(os.path.join(path, ".hg", "hgrc"))
264 263 except IOError:
265 264 pass
266 265
267 266 # now we can expand paths, even ones in .hg/hgrc
268 267 rpath = _earlygetopt(["-R", "--repository", "--repo"], args)
269 268 if rpath:
270 269 path = lui.expandpath(rpath[-1])
271 270 lui = _ui.ui(parentui=ui)
272 271 lui.readconfig(os.path.join(path, ".hg", "hgrc"))
273 272
274 273 extensions.loadall(lui)
275 274 for name, module in extensions.extensions():
276 275 if name in _loaded:
277 276 continue
278 277
279 278 # setup extensions
280 279 # TODO this should be generalized to scheme, where extensions can
281 280 # redepend on other extensions. then we should toposort them, and
282 281 # do initialization in correct order
283 282 extsetup = getattr(module, 'extsetup', None)
284 283 if extsetup:
285 284 extsetup()
286 285
287 286 cmdtable = getattr(module, 'cmdtable', {})
288 287 overrides = [cmd for cmd in cmdtable if cmd in commands.table]
289 288 if overrides:
290 289 ui.warn(_("extension '%s' overrides commands: %s\n")
291 290 % (name, " ".join(overrides)))
292 291 commands.table.update(cmdtable)
293 292 _loaded[name] = 1
294 293 # check for fallback encoding
295 294 fallback = lui.config('ui', 'fallbackencoding')
296 295 if fallback:
297 296 util._fallbackencoding = fallback
298 297
299 298 fullargs = args
300 299 cmd, func, args, options, cmdoptions = _parse(lui, args)
301 300
302 301 if options["config"]:
303 302 raise util.Abort(_("Option --config may not be abbreviated!"))
304 303 if options["cwd"]:
305 304 raise util.Abort(_("Option --cwd may not be abbreviated!"))
306 305 if options["repository"]:
307 306 raise util.Abort(_(
308 307 "Option -R has to be separated from other options (i.e. not -qR) "
309 308 "and --repository may only be abbreviated as --repo!"))
310 309
311 310 if options["encoding"]:
312 311 util._encoding = options["encoding"]
313 312 if options["encodingmode"]:
314 313 util._encodingmode = options["encodingmode"]
315 314 if options["time"]:
316 315 def get_times():
317 316 t = os.times()
318 317 if t[4] == 0.0: # Windows leaves this as zero, so use time.clock()
319 318 t = (t[0], t[1], t[2], t[3], time.clock())
320 319 return t
321 320 s = get_times()
322 321 def print_time():
323 322 t = get_times()
324 323 ui.warn(_("Time: real %.3f secs (user %.3f+%.3f sys %.3f+%.3f)\n") %
325 324 (t[4]-s[4], t[0]-s[0], t[2]-s[2], t[1]-s[1], t[3]-s[3]))
326 325 atexit.register(print_time)
327 326
328 327 ui.updateopts(options["verbose"], options["debug"], options["quiet"],
329 328 not options["noninteractive"], options["traceback"])
330 329
331 330 if options['help']:
332 331 return commands.help_(ui, cmd, options['version'])
333 332 elif options['version']:
334 333 return commands.version_(ui)
335 334 elif not cmd:
336 335 return commands.help_(ui, 'shortlist')
337 336
338 337 repo = None
339 338 if cmd not in commands.norepo.split():
340 339 try:
341 340 repo = hg.repository(ui, path=path)
342 341 ui = repo.ui
343 342 if not repo.local():
344 343 raise util.Abort(_("repository '%s' is not local") % path)
345 344 ui.setconfig("bundle", "mainreporoot", repo.root)
346 345 except hg.RepoError:
347 346 if cmd not in commands.optionalrepo.split():
347 if args and not path: # try to infer -R from command args
348 repos = map(_findrepo, args)
349 guess = repos[0]
350 if guess and repos.count(guess) == len(repos):
351 return _dispatch(ui, ['--repository', guess] + fullargs)
348 352 if not path:
349 353 raise hg.RepoError(_("There is no Mercurial repository here"
350 354 " (.hg not found)"))
351 355 raise
352 356 d = lambda: func(ui, repo, *args, **cmdoptions)
353 357 else:
354 358 d = lambda: func(ui, *args, **cmdoptions)
355 359
356 360 # run pre-hook, and abort if it fails
357 361 ret = hook.hook(lui, repo, "pre-%s" % cmd, False, args=" ".join(fullargs))
358 362 if ret:
359 363 return ret
360 364 ret = _runcommand(ui, options, cmd, d)
361 365 # run post-hook, passing command result
362 366 hook.hook(lui, repo, "post-%s" % cmd, False, args=" ".join(fullargs),
363 367 result = ret)
364 368 return ret
365 369
366 370 def _runcommand(ui, options, cmd, cmdfunc):
367 371 def checkargs():
368 372 try:
369 373 return cmdfunc()
370 374 except TypeError, inst:
371 375 # was this an argument error?
372 376 tb = traceback.extract_tb(sys.exc_info()[2])
373 377 if len(tb) != 2: # no
374 378 raise
375 379 raise ParseError(cmd, _("invalid arguments"))
376 380
377 381 if options['profile']:
378 382 import hotshot, hotshot.stats
379 383 prof = hotshot.Profile("hg.prof")
380 384 try:
381 385 try:
382 386 return prof.runcall(checkargs)
383 387 except:
384 388 try:
385 389 ui.warn(_('exception raised - generating '
386 390 'profile anyway\n'))
387 391 except:
388 392 pass
389 393 raise
390 394 finally:
391 395 prof.close()
392 396 stats = hotshot.stats.load("hg.prof")
393 397 stats.strip_dirs()
394 398 stats.sort_stats('time', 'calls')
395 399 stats.print_stats(40)
396 400 elif options['lsprof']:
397 401 try:
398 402 from mercurial import lsprof
399 403 except ImportError:
400 404 raise util.Abort(_(
401 405 'lsprof not available - install from '
402 406 'http://codespeak.net/svn/user/arigo/hack/misc/lsprof/'))
403 407 p = lsprof.Profiler()
404 408 p.enable(subcalls=True)
405 409 try:
406 410 return checkargs()
407 411 finally:
408 412 p.disable()
409 413 stats = lsprof.Stats(p.getstats())
410 414 stats.sort()
411 415 stats.pprint(top=10, file=sys.stderr, climit=5)
412 416 else:
413 417 return checkargs()
@@ -1,87 +1,94 b''
1 1 #!/bin/sh
2 2
3 3 hg init a
4 4 cd a
5 5 echo a > a
6 6 hg ci -A -d'1 0' -m a
7 7
8 8 cd ..
9 9
10 10 hg init b
11 11 cd b
12 12 echo b > b
13 13 hg ci -A -d'1 0' -m b
14 14
15 15 cd ..
16 16
17 17 hg clone a c
18 18 cd c
19 19 hg pull -f ../b
20 20 hg merge
21 21
22 22 cd ..
23 23
24 24 echo %% -R/--repository
25 25 hg -R a tip
26 26 hg --repository b tip
27 27
28 echo %% implicit -R
29 hg ann a/a
30 hg ann a/a a/a
31 hg ann a/a b/b
32 hg -R b ann a/a
33 hg log
34
28 35 echo %% abbrev of long option
29 36 hg --repo c tip
30 37
31 38 echo "%% earlygetopt with duplicate options (36d23de02da1)"
32 39 hg --cwd a --cwd b --cwd c tip
33 40 hg --repo c --repository b -R a tip
34 41
35 42 echo "%% earlygetopt short option without following space"
36 43 hg -q -Rb tip
37 44
38 45 echo "%% earlygetopt with illegal abbreviations"
39 46 hg --confi "foo.bar=baz"
40 47 hg --cw a tip
41 48 hg --rep a tip
42 49 hg --repositor a tip
43 50 hg -qR a tip
44 51 hg -qRa tip
45 52
46 53 echo %% --cwd
47 54 hg --cwd a parents
48 55
49 56 echo %% -y/--noninteractive - just be sure it is parsed
50 57 hg --cwd a tip -q --noninteractive
51 58 hg --cwd a tip -q -y
52 59
53 60 echo %% -q/--quiet
54 61 hg -R a -q tip
55 62 hg -R b -q tip
56 63 hg -R c --quiet parents
57 64
58 65 echo %% -v/--verbose
59 66 hg --cwd c head -v
60 67 hg --cwd b tip --verbose
61 68
62 69 echo %% --config
63 70 hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
64 71 hg --cwd c --config '' tip -q
65 72 hg --cwd c --config a.b tip -q
66 73 hg --cwd c --config a tip -q
67 74 hg --cwd c --config a.= tip -q
68 75 hg --cwd c --config .b= tip -q
69 76
70 77 echo %% --debug
71 78 hg --cwd c log --debug
72 79
73 80 echo %% --traceback
74 81 hg --cwd c --config x --traceback tip 2>&1 | grep -i 'traceback'
75 82
76 83 echo %% --time
77 84 hg --cwd a --time tip 2>&1 | grep '^Time:' | sed 's/[0-9][0-9]*/x/g'
78 85
79 86 echo %% --version
80 87 hg --version -q | sed 's/version [^)]*/version xxx/'
81 88
82 89 echo %% -h/--help
83 90 hg -h
84 91 hg --help
85 92
86 93 echo %% not tested: --debugger
87 94
@@ -1,247 +1,253 b''
1 1 adding a
2 2 adding b
3 3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
4 4 pulling from ../b
5 5 searching for changes
6 6 warning: repository is unrelated
7 7 adding changesets
8 8 adding manifests
9 9 adding file changes
10 10 added 1 changesets with 1 changes to 1 files (+1 heads)
11 11 (run 'hg heads' to see heads, 'hg merge' to merge)
12 12 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 13 (branch merge, don't forget to commit)
14 14 %% -R/--repository
15 15 changeset: 0:8580ff50825a
16 16 tag: tip
17 17 user: test
18 18 date: Thu Jan 01 00:00:01 1970 +0000
19 19 summary: a
20 20
21 21 changeset: 0:b6c483daf290
22 22 tag: tip
23 23 user: test
24 24 date: Thu Jan 01 00:00:01 1970 +0000
25 25 summary: b
26 26
27 %% implicit -R
28 0: a
29 0: a
30 abort: There is no Mercurial repository here (.hg not found)!
31 abort: a/a not under root
32 abort: There is no Mercurial repository here (.hg not found)!
27 33 %% abbrev of long option
28 34 changeset: 1:b6c483daf290
29 35 tag: tip
30 36 parent: -1:000000000000
31 37 user: test
32 38 date: Thu Jan 01 00:00:01 1970 +0000
33 39 summary: b
34 40
35 41 %% earlygetopt with duplicate options (36d23de02da1)
36 42 changeset: 1:b6c483daf290
37 43 tag: tip
38 44 parent: -1:000000000000
39 45 user: test
40 46 date: Thu Jan 01 00:00:01 1970 +0000
41 47 summary: b
42 48
43 49 changeset: 0:8580ff50825a
44 50 tag: tip
45 51 user: test
46 52 date: Thu Jan 01 00:00:01 1970 +0000
47 53 summary: a
48 54
49 55 %% earlygetopt short option without following space
50 56 0:b6c483daf290
51 57 %% earlygetopt with illegal abbreviations
52 58 abort: Option --config may not be abbreviated!
53 59 abort: Option --cwd may not be abbreviated!
54 60 abort: Option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
55 61 abort: Option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
56 62 abort: Option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
57 63 abort: Option -R has to be separated from other options (i.e. not -qR) and --repository may only be abbreviated as --repo!
58 64 %% --cwd
59 65 changeset: 0:8580ff50825a
60 66 tag: tip
61 67 user: test
62 68 date: Thu Jan 01 00:00:01 1970 +0000
63 69 summary: a
64 70
65 71 %% -y/--noninteractive - just be sure it is parsed
66 72 0:8580ff50825a
67 73 0:8580ff50825a
68 74 %% -q/--quiet
69 75 0:8580ff50825a
70 76 0:b6c483daf290
71 77 0:8580ff50825a
72 78 1:b6c483daf290
73 79 %% -v/--verbose
74 80 changeset: 1:b6c483daf290
75 81 tag: tip
76 82 parent: -1:000000000000
77 83 user: test
78 84 date: Thu Jan 01 00:00:01 1970 +0000
79 85 files: b
80 86 description:
81 87 b
82 88
83 89
84 90 changeset: 0:8580ff50825a
85 91 user: test
86 92 date: Thu Jan 01 00:00:01 1970 +0000
87 93 files: a
88 94 description:
89 95 a
90 96
91 97
92 98 changeset: 0:b6c483daf290
93 99 tag: tip
94 100 user: test
95 101 date: Thu Jan 01 00:00:01 1970 +0000
96 102 files: b
97 103 description:
98 104 b
99 105
100 106
101 107 %% --config
102 108 quuxfoo
103 109 abort: malformed --config option:
104 110 abort: malformed --config option: a.b
105 111 abort: malformed --config option: a
106 112 abort: malformed --config option: a.=
107 113 abort: malformed --config option: .b=
108 114 %% --debug
109 115 changeset: 1:b6c483daf2907ce5825c0bb50f5716226281cc1a
110 116 tag: tip
111 117 parent: -1:0000000000000000000000000000000000000000
112 118 parent: -1:0000000000000000000000000000000000000000
113 119 manifest: 1:23226e7a252cacdc2d99e4fbdc3653441056de49
114 120 user: test
115 121 date: Thu Jan 01 00:00:01 1970 +0000
116 122 files+: b
117 123 extra: branch=default
118 124 description:
119 125 b
120 126
121 127
122 128 changeset: 0:8580ff50825a50c8f716709acdf8de0deddcd6ab
123 129 parent: -1:0000000000000000000000000000000000000000
124 130 parent: -1:0000000000000000000000000000000000000000
125 131 manifest: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
126 132 user: test
127 133 date: Thu Jan 01 00:00:01 1970 +0000
128 134 files+: a
129 135 extra: branch=default
130 136 description:
131 137 a
132 138
133 139
134 140 %% --traceback
135 141 Traceback (most recent call last):
136 142 %% --time
137 143 Time: real x.x secs (user x.x+x.x sys x.x+x.x)
138 144 %% --version
139 145 Mercurial Distributed SCM (version xxx)
140 146 %% -h/--help
141 147 Mercurial Distributed SCM
142 148
143 149 list of commands:
144 150
145 151 add add the specified files on the next commit
146 152 addremove add all new files, delete all missing files
147 153 annotate show changeset information per file line
148 154 archive create unversioned archive of a repository revision
149 155 backout reverse effect of earlier changeset
150 156 bisect subdivision search of changesets
151 157 branch set or show the current branch name
152 158 branches list repository named branches
153 159 bundle create a changegroup file
154 160 cat output the current or given revision of files
155 161 clone make a copy of an existing repository
156 162 commit commit the specified files or all outstanding changes
157 163 copy mark files as copied for the next commit
158 164 diff diff repository (or selected files)
159 165 export dump the header and diffs for one or more changesets
160 166 grep search for a pattern in specified files and revisions
161 167 heads show current repository heads or show branch heads
162 168 help show help for a command, extension, or list of commands
163 169 identify identify the working copy or specified revision
164 170 import import an ordered set of patches
165 171 incoming show new changesets found in source
166 172 init create a new repository in the given directory
167 173 locate locate files matching specific patterns
168 174 log show revision history of entire repository or files
169 175 manifest output the current or given revision of the project manifest
170 176 merge merge working directory with another revision
171 177 outgoing show changesets not found in destination
172 178 parents show the parents of the working dir or revision
173 179 paths show definition of symbolic path names
174 180 pull pull changes from the specified source
175 181 push push changes to the specified destination
176 182 recover roll back an interrupted transaction
177 183 remove remove the specified files on the next commit
178 184 rename rename files; equivalent of copy + remove
179 185 revert restore individual files or dirs to an earlier state
180 186 rollback roll back the last transaction
181 187 root print the root (top) of the current working dir
182 188 serve export the repository via HTTP
183 189 showconfig show combined config settings from all hgrc files
184 190 status show changed files in the working directory
185 191 tag add a tag for the current or given revision
186 192 tags list repository tags
187 193 tip show the tip revision
188 194 unbundle apply one or more changegroup files
189 195 update update working directory
190 196 verify verify the integrity of the repository
191 197 version output version and copyright information
192 198
193 199 use "hg -v help" to show aliases and global options
194 200 Mercurial Distributed SCM
195 201
196 202 list of commands:
197 203
198 204 add add the specified files on the next commit
199 205 addremove add all new files, delete all missing files
200 206 annotate show changeset information per file line
201 207 archive create unversioned archive of a repository revision
202 208 backout reverse effect of earlier changeset
203 209 bisect subdivision search of changesets
204 210 branch set or show the current branch name
205 211 branches list repository named branches
206 212 bundle create a changegroup file
207 213 cat output the current or given revision of files
208 214 clone make a copy of an existing repository
209 215 commit commit the specified files or all outstanding changes
210 216 copy mark files as copied for the next commit
211 217 diff diff repository (or selected files)
212 218 export dump the header and diffs for one or more changesets
213 219 grep search for a pattern in specified files and revisions
214 220 heads show current repository heads or show branch heads
215 221 help show help for a command, extension, or list of commands
216 222 identify identify the working copy or specified revision
217 223 import import an ordered set of patches
218 224 incoming show new changesets found in source
219 225 init create a new repository in the given directory
220 226 locate locate files matching specific patterns
221 227 log show revision history of entire repository or files
222 228 manifest output the current or given revision of the project manifest
223 229 merge merge working directory with another revision
224 230 outgoing show changesets not found in destination
225 231 parents show the parents of the working dir or revision
226 232 paths show definition of symbolic path names
227 233 pull pull changes from the specified source
228 234 push push changes to the specified destination
229 235 recover roll back an interrupted transaction
230 236 remove remove the specified files on the next commit
231 237 rename rename files; equivalent of copy + remove
232 238 revert restore individual files or dirs to an earlier state
233 239 rollback roll back the last transaction
234 240 root print the root (top) of the current working dir
235 241 serve export the repository via HTTP
236 242 showconfig show combined config settings from all hgrc files
237 243 status show changed files in the working directory
238 244 tag add a tag for the current or given revision
239 245 tags list repository tags
240 246 tip show the tip revision
241 247 unbundle apply one or more changegroup files
242 248 update update working directory
243 249 verify verify the integrity of the repository
244 250 version output version and copyright information
245 251
246 252 use "hg -v help" to show aliases and global options
247 253 %% not tested: --debugger
General Comments 0
You need to be logged in to leave comments. Login now