--config option

Bill Schroeder bschroeder at allstontrading.com
Wed Nov 4 14:02:50 CST 2009

Here's a patch to improve the error message for the --config option. 



# HG changeset patch
# User Bill Schroeder <bschroeder at allstontrading.com>
# Date 1257363855 21600
# Node ID e7d7301c10e10fc3d4a00ea1e4526130b5473ed2
# Parent  07a62819b3096e5c05f0b799587f0f373470e9d7
impove usage text and error message for --config option

diff -r 07a62819b309 -r e7d7301c10e1 mercurial/dispatch.py
--- a/mercurial/dispatch.py    Fri Oct 16 00:09:18 2009 +0200
+++ b/mercurial/dispatch.py    Wed Nov 04 13:44:15 2009 -0600
@@ -272,7 +272,9 @@
     return (cmd, cmd and i[0] or None, args, options, cmdoptions)
 def _parseconfig(ui, config):
-    """parse the --config options from the command line"""
+    """parse the --config options from the command line
+    Takes the format: section.name=value
+    """
     for cfg in config:
             name, value = cfg.split('=', 1)
@@ -281,7 +283,7 @@
                 raise IndexError
             ui.setconfig(section, name, value)
         except (IndexError, ValueError):
-            raise util.Abort(_('malformed --config option: %s') % cfg)
+            raise util.Abort(_('malformed --config option: %s, format 
is section.name=value') % cfg)
 def _earlygetopt(aliases, args):
     """Return list of values for an option (or aliases).

This message is for the named person(s) use only. It may contain confidential proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Allston Trading LLC and its subsidiaries and affiliates each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity.

More information about the Mercurial-devel mailing list