changeset 10534:a957038218cd stable

url: avoid traceback when parsing [auth] (issue2056)
author Patrick Mezard <pmezard@gmail.com>
date Tue, 23 Feb 2010 22:31:54 +0100
parents 184cdb66263e
children 5203a324ba73
files mercurial/url.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/url.py	Tue Feb 23 23:19:09 2010 +0100
+++ b/mercurial/url.py	Tue Feb 23 22:31:54 2010 +0100
@@ -140,6 +140,9 @@
         # Read configuration
         config = dict()
         for key, val in self.ui.configitems('auth'):
+            if '.' not in key:
+                self.ui.warn(_("ignoring invalid [auth] key '%s'\n" % key))
+                continue
             group, setting = key.split('.', 1)
             gdict = config.setdefault(group, dict())
             gdict[setting] = val