[Bug 3964] New: Mercurial breaks with re2 installed

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Mon Jun 17 16:38:00 CDT 2013


http://bz.selenic.com/show_bug.cgi?id=3964

          Priority: normal
            Bug ID: 3964
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: Mercurial breaks with re2 installed
          Severity: bug
    Classification: Unclassified
                OS: Mac OS
          Reporter: abarnert at yahoo.com
          Hardware: Macintosh
            Status: UNCONFIRMED
           Version: unspecified
         Component: Mercurial
           Product: Mercurial

If you have either https://pypi.python.org/pypi/re2/ or an older version of
https://github.com/facebook/pyre2.git installed, the "hg" command-line tool
does not run.

The problem is not there with the current version of the Facebook re2 wrapper,
but considering that what you get with "sudo pip install re2" does cause the
problem, that seems pretty bad.

Also, the error handling is not exactly optimal—even run "hg --help" or "hg
version" or "hg debuginstall" fails with no useful output or traceback. Any
invocation of the "hg" command, if you have anything at all in ~/.hgrc or in a
project .hgrc, gives something like this:

> 1
> 1
> 1
> 1
> 1
> 1
> 1
> hg: parse error at /Users/abarnert/.hgrc:1: [ui]

I tried reinstalling Mercurial in various different ways (most recently by
using the mercurial-2.6+20130507-py2.7-macosx10.8.mpkg binary installer), and
always got the same problem.

I couldn't figure out how to get a useful traceback, even with importing
mercurial from Python. I had to ack the source to find the error in order to
figure out that the problem.

re2.compile(r'\[([^\[]+)\]').match('[ui]') returns None with the old Facebook
wrapper or the wrapper off PyPI. (It works with findall, but not match. I don't
know why.)

It would be useful to allow the script to start up and at least get far enough
to print version numbers, help, etc. even if there's a bad line in the config
file.

It might also be useful to try to distinguish the re2 version and not use the
known-bad versions, or to provide some way to fall back to re if re2 doesn't
seem to be working, or at least to add some information about "try removing
re2, or upgrading to the latest Facebook version" in the error message, or
somewhere it's easily googleable, or… something.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list