Applied rule #7 of git-check-ref-format
authorAnton Rieder <johannes.a.rieder@student.tugraz.at>
Wed, 16 May 2012 21:44:00 +0000 (16 23:44 +0200)
committerAnton Rieder <johannes.a.rieder@student.tugraz.at>
Wed, 16 May 2012 21:44:00 +0000 (16 23:44 +0200)
Rule #7 of git-check-ref-format states "7. They cannot end with a dot
'.'." which was not yet implemented in fast-export. This commit fixes
this.

hg-fast-export.py

index 2da0289..49b2add 100755 (executable)
@@ -140,7 +140,7 @@ def sanitize_name(name,what="branch"):
   n=name
   p=re.compile('([[ ~^:?*]|\.\.)')
   n=p.sub('_', n)
-  if n[-1] == '/': n=n[:-1]+'_'
+  if n[-1] in ('/', '.'): n=n[:-1]+'_'
   n='/'.join(map(dot,n.split('/')))
   p=re.compile('_+')
   n=p.sub('_', n)