[PATCH] git-remote-hg: Fix . at end of ref

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Any Mercurial tag/branch/bookmark that ended with a period would be
rejected by fast-import.  The repository could be cloned, but any
further fetch would fail.

Use a similar trick to the space handling, but only when the period is
at the end of the ref.

Probably need a more general solution to this problem.

Signed-off-by: Brian Gernhardt <brian@xxxxxxxxxxxxxxxxxxxxx>
---
 contrib/remote-helpers/git-remote-hg | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index 0194c67..7fa6cd7 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -78,9 +78,11 @@ def hgbin(n):
     return node.bin(n)
 
 def hgref(ref):
+    ref = re.sub('_\._$', '.', ref)
     return ref.replace('___', ' ')
 
 def gitref(ref):
+    ref = re.sub('\.$', '_._', ref)
     return ref.replace(' ', '___')
 
 def check_version(*check):
-- 
1.8.3.1.636.g893104c

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]