dispatch: better error message for --config option
authorBill Schroeder <bschroeder@allstontrading.com>
Wed, 04 Nov 2009 13:44:15 -0600
changeset 9825 0d850f8beea6
parent 9824 87c92b260710
child 9826 d768614578dd
dispatch: better error message for --config option
mercurial/dispatch.py
tests/test-globalopts.out
--- a/mercurial/dispatch.py	Wed Nov 11 00:05:12 2009 +0100
+++ b/mercurial/dispatch.py	Wed Nov 04 13:44:15 2009 -0600
@@ -279,7 +279,8 @@
                 raise IndexError
             ui.setconfig(section, name, value)
         except (IndexError, ValueError):
-            raise util.Abort(_('malformed --config option: %s') % cfg)
+            raise util.Abort(_('malformed --config option: %r '
+                               '(use --config section.name=value)') % cfg)
 
 def _earlygetopt(aliases, args):
     """Return list of values for an option (or aliases).
--- a/tests/test-globalopts.out	Wed Nov 11 00:05:12 2009 +0100
+++ b/tests/test-globalopts.out	Wed Nov 04 13:44:15 2009 -0600
@@ -107,11 +107,11 @@
 
 %% --config
 quuxfoo
-abort: malformed --config option: 
-abort: malformed --config option: a.b
-abort: malformed --config option: a
-abort: malformed --config option: a.=
-abort: malformed --config option: .b=
+abort: malformed --config option: '' (use --config section.name=value)
+abort: malformed --config option: 'a.b' (use --config section.name=value)
+abort: malformed --config option: 'a' (use --config section.name=value)
+abort: malformed --config option: 'a.=' (use --config section.name=value)
+abort: malformed --config option: '.b=' (use --config section.name=value)
 %% --debug
 changeset:   1:b6c483daf2907ce5825c0bb50f5716226281cc1a
 tag:         tip