changeset 18693:633cd0c46e6a

dispatch: also a separate warning message on aliases with --config As mentioned in bug 2043, --config is also not supported in an alias. So report this the same way as the other "early" options. Example with alias.broken = stat --config a.config=1 Before: $ hg broken abort: Option --config may not be abbreviated! After: $ hg broken error in definition for alias 'broken': --config may only be given on the command line
author Simon Heimberg <simohe@besonet.ch>
date Tue, 12 Feb 2013 22:15:31 +0100
parents af4387d8d1c7
children 6a012704c841
files mercurial/dispatch.py tests/test-alias.t
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Thu Feb 14 13:56:02 2013 -0600
+++ b/mercurial/dispatch.py	Tue Feb 12 22:15:31 2013 +0100
@@ -334,7 +334,7 @@
         self.cmdname = cmd = args.pop(0)
         args = map(util.expandpath, args)
 
-        for invalidarg in ("--cwd", "-R", "--repository", "--repo"):
+        for invalidarg in ("--cwd", "-R", "--repository", "--repo", "--config"):
             if _earlygetopt([invalidarg], args):
                 def fn(ui, *args):
                     ui.warn(_("error in definition for alias '%s': %s may only "
--- a/tests/test-alias.t	Thu Feb 14 13:56:02 2013 -0600
+++ b/tests/test-alias.t	Tue Feb 12 22:15:31 2013 +0100
@@ -17,6 +17,7 @@
   > no-R = status -R elsewhere
   > no--repo = status --repo elsewhere
   > no--repository = status --repository elsewhere
+  > no--config = status --config a.config=1
   > mylog = log
   > lognull = log -r null
   > shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
@@ -106,6 +107,8 @@
   error in definition for alias 'no--repository': --repository may only be given on the command line
   $ hg help no--repository
   error in definition for alias 'no--repository': --repository may only be given on the command line
+  $ hg no--config
+  error in definition for alias 'no--config': --config may only be given on the command line
 
 optional repository