Non-Working Mercurial after Mac OS X Lion (10.7) Install

Mads Kiilerich mads at kiilerich.com
Sun Aug 21 19:30:27 UTC 2011


Augie Fackler wrote, On 08/21/2011 08:35 PM:
>
>
> On Aug 21, 2011 11:07 AM, "Kime H. Smith, Jr." 
> <khsmith at mediakinematics.com <mailto:khsmith at mediakinematics.com>> wrote:
> >
> > Augie:
> >
> > I commented out a line in the [paths] section of the rc file and the 
> command line behavior of "hg" seems to be restored.  Since I haven't 
> made any changes to the file in quite some time, it must be the newer 
> version of HG that was sensitive to the "bad" path entry.
> >
> > Problem resolved!
> >
> > Thanks again for your help.
>
> What was the offending line? Or something similar, so we can figure 
> out why it broke things so badly.
>

$ tail -n1 .hg/hgrc
x = file://x/

$ ./hg --traceback
Traceback (most recent call last):
   File "/home/mk/hg/mercurial/dispatch.py", line 87, in _runcatch
     return _dispatch(req)
   File "/home/mk/hg/mercurial/dispatch.py", line 552, in _dispatch
     path, lui = _getlocal(ui, rpath)
   File "/home/mk/hg/mercurial/dispatch.py", line 484, in _getlocal
     lui.readconfig(os.path.join(path, ".hg", "hgrc"), path)
   File "/home/mk/hg/mercurial/ui.py", line 108, in readconfig
     self.fixconfig(root=root)
   File "/home/mk/hg/mercurial/ui.py", line 124, in fixconfig
     if not util.hasscheme(p) and not os.path.isabs(p):
   File "/home/mk/hg/mercurial/util.py", line 1596, in hasscheme
     return bool(url(path).scheme)
   File "/home/mk/hg/mercurial/util.py", line 1468, in __init__
     raise Abort(_('file:// URLs can only refer to localhost'))
Abort: file:// URLs can only refer to localhost
abort: file:// URLs can only refer to localhost

Such invalid paths might have worked (or passed silently) in previous 
versions. It is however incorrect syntax, so I think it is OK that it 
fails now ... if just the error message was more helpful ...

It is a bit unfortunate that we process all paths every time hg is 
started. We could perhaps remove path handling from fixconfig and add a 
ui.configpath() instead. Path processing should however be so safe and 
fast that the extra processing on start doesn't matter ...

/Mads



More information about the Mercurial mailing list