hg-fast-export.py: do not generate invalid ref names
commit04a7ec1351e7e7ae7a8e666e064a1e3c41c65946
authorKyle J. McKay <mackyle@gmail.com>
Fri, 4 Apr 2014 12:13:28 +0000 (4 05:13 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 16 Apr 2014 03:03:13 +0000 (15 20:03 -0700)
treeb7aeb661a4b7bee01058cd38ed5585627fffb587
parent6665bba63353a70a968776cf339e9e813d3fce52
hg-fast-export.py: do not generate invalid ref names

Git has various rules about what is and is not a valid ref
name.  These are summarized in the 'git help check-ref-format'
output.

Update the ref name conversion code to take into account all the
rules.  Also compile the regexs only once and eliminate invalid
index exceptions.

These reference names no longer cause exceptions:

  /a
  a//b

These reference names no longer generate invalid names:

  a@{b}
  a.lock

All ref names that were previously converted to valid Git ref names
should continue to be converted to the same ref name now.
hg-fast-export.py