equal
deleted
inserted
replaced
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() |