mercurial/dispatch.py
branchstable
changeset 21569 c5afb07c33d3
parent 21556 5e13507a3b4e
child 21572 6c9b7712ac69
--- a/mercurial/dispatch.py	Thu May 08 19:03:00 2014 +0900
+++ b/mercurial/dispatch.py	Sat May 17 13:06:16 2014 +0900
@@ -383,7 +383,16 @@
             self.fn = fn
             return
 
-        args = shlex.split(self.definition)
+        try:
+            args = shlex.split(self.definition)
+        except ValueError, inst:
+            def fn(ui, *args):
+                ui.warn(_("error in definition for alias '%s': %s\n")
+                        % (self.name, inst))
+                return 1
+            self.fn = fn
+            self.badalias = True
+            return
         self.cmdname = cmd = args.pop(0)
         args = map(util.expandpath, args)