url: use rsplit to split [auth] keys
authorSteve Borho <steve@borho.org>
Sat, 12 Feb 2011 21:53:27 -0600
changeset 13370 d13a533a0b11
parent 13368 d4ab9486e514
child 13371 c691cfdc6b4d
url: use rsplit to split [auth] keys None of the auth section subkeys include a period, so it makes zero sense to not split from the end. By using rsplit() users can use the hostname as group keys.
mercurial/url.py
--- a/mercurial/url.py	Thu Feb 10 13:46:28 2011 -0600
+++ b/mercurial/url.py	Sat Feb 12 21:53:27 2011 -0600
@@ -155,7 +155,7 @@
             if '.' not in key:
                 self.ui.warn(_("ignoring invalid [auth] key '%s'\n") % key)
                 continue
-            group, setting = key.split('.', 1)
+            group, setting = key.rsplit('.', 1)
             gdict = config.setdefault(group, dict())
             if setting in ('username', 'cert', 'key'):
                 val = util.expandpath(val)