comparison mercurial/dispatch.py @ 11691:b6360a113478

Merge with stable
author Matt Mackall <mpm@selenic.com>
date Sun, 25 Jul 2010 21:20:05 -0500
parents 757f39fa1162 e4357c214bf1
children 708291e9389c
comparison
equal deleted inserted replaced
11690:55b56b801c04 11691:b6360a113478
260 260
261 def __call__(self, ui, *args, **opts): 261 def __call__(self, ui, *args, **opts):
262 if self.shadows: 262 if self.shadows:
263 ui.debug("alias '%s' shadows command\n" % self.name) 263 ui.debug("alias '%s' shadows command\n" % self.name)
264 264
265 return self.fn(ui, *args, **opts) 265 return util.checksignature(self.fn)(ui, *args, **opts)
266 266
267 def addaliases(ui, cmdtable): 267 def addaliases(ui, cmdtable):
268 # aliases are processed after extensions have been loaded, so they 268 # aliases are processed after extensions have been loaded, so they
269 # may use extension commands. Aliases can also use other alias definitions, 269 # may use extension commands. Aliases can also use other alias definitions,
270 # but only if they have been defined prior to the current definition. 270 # but only if they have been defined prior to the current definition.
378 cwd = _earlygetopt(['--cwd'], args) 378 cwd = _earlygetopt(['--cwd'], args)
379 if cwd: 379 if cwd:
380 os.chdir(cwd[-1]) 380 os.chdir(cwd[-1])
381 381
382 # read the local repository .hgrc into a local ui object 382 # read the local repository .hgrc into a local ui object
383 path = cmdutil.findrepo(os.getcwd()) or "" 383 try:
384 wd = os.getcwd()
385 except OSError, e:
386 raise util.Abort(_("error getting current working directory: %s") %
387 e.strerror)
388 path = cmdutil.findrepo(wd) or ""
384 if not path: 389 if not path:
385 lui = ui 390 lui = ui
386 else: 391 else:
387 try: 392 try:
388 lui = ui.copy() 393 lui = ui.copy()