[PATCH 1 of 1] alias: back up and restore commands.norepo before checking for shell aliases

Steve Losh steve at stevelosh.com
Fri Oct 8 15:10:18 CDT 2010


# HG changeset patch
# User Steve Losh <steve at stevelosh.com>
# Date 1286568600 14400
# Node ID 987380e884a2ba8be65c56f5aa753516799a7692
# Parent  7178f6fedb9db000300abda8168d36a890a686c2
alias: back up and restore commands.norepo before checking for shell aliases

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -432,10 +432,11 @@
 
     return path, lui
 
 def _checkshellalias(ui, args):
     cwd = os.getcwd()
+    norepo = commands.norepo
     options = {}
     args = fancyopts.fancyopts(args, commands.globalopts, options)
 
     if not args:
         return
@@ -451,20 +452,22 @@
 
     cmd = args[0]
     try:
         aliases, entry = cmdutil.findcmd(cmd, cmdtable, lui.config("ui", "strict"))
     except error.UnknownCommand:
+        commands.norepo = norepo
         os.chdir(cwd)
         return
 
     cmd = aliases[0]
     fn = entry[0]
 
     if cmd and hasattr(fn, 'shell'):
         d = lambda: fn(ui, *args[1:])
         return lambda: runcommand(lui, None, cmd, args[:1], ui, options, d, [], {})
 
+    commands.norepo = norepo
     os.chdir(cwd)
 
 _loaded = set()
 def _dispatch(ui, args):
     shellaliasfn = _checkshellalias(ui, args)


More information about the Mercurial-devel mailing list