Message6401

Author mjc
Recipients
Date 2008-06-25.00:59:48
Content
Our group has email addresses as https usernames, so they contain '@'.  This 
leads to commands like:
  hg clone http://mjc%40example.com@hg.example.com/repo/...

The clone works fine, but it puts the URL into .hgrc verbatim, which leads to 
the following stack trace when running hg in the working directory:

  File ".../site-packages/mercurial/ui.py", line 166, in readconfig
    self.fixconfig(root=root)
  File ".../site-packages/mercurial/ui.py", line 207, in fixconfig
    pathsitems = cdata.items('paths')
  File ".../python2.5/ConfigParser.py", line 557, in items
    for option in options]
  File ".../site-packages/mercurial/util.py", line 137, in _interpolate
    option, rawval, vars)
  File ".../python2.5/ConfigParser.py", line 593, in _interpolate
    self._interpolate_some(option, L, rawval, section, vars, 1)
  File ".../python2.5/ConfigParser.py", line 634, in _interpolate_some
    "'%%' must be followed by '%%' or '(', found: %r" % (rest,))
ConfigParser.InterpolationSyntaxError: '%' must be followed by '%' or '(', 
found: '%40example.com@hg.example.com/repo'

The same would happen for any URL-encoded username.  Suggested fix attached.
Files
File name Uploaded
fix-http-at-username.diff mjc, 2008-06-25.00:59:48
History
Date User Action Args
2008-06-25 00:59:48mjcsetmessageid: <1214355588.61.0.0958355267566.issue1199@selenic.com>
2008-06-25 00:59:48mjclinkissue1199 messages
2008-06-25 00:59:48mjccreate