{"thread":{"id":"34246","subject":"[PATCH] git-remote-hg: Fix . at end of ref","startedAt":"2013-06-21T16:12:38Z","lastAt":"2013-06-21T16:12:38Z","messageCount":1,"participants":["Brian Gernhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"221606","messageId":"1371831158-9720-1-git-send-email-brian@gernhardtsoftware.com","threadId":"34246","inReplyTo":null,"subject":"[PATCH] git-remote-hg: Fix . at end of ref","fromName":"Brian Gernhardt","fromEmail":"brian@gernhardtsoftware.com","sentAt":"2013-06-21T16:12:38Z","receivedAt":"2013-06-21T16:12:38Z","isPatch":true,"sender":{"key":"brian@gernhardtsoftware.com","avatar":"https://avatars.githubusercontent.com/u/133455?v=4"},"body":"Any Mercurial tag/branch/bookmark that ended with a period would be\nrejected by fast-import.  The repository could be cloned, but any\nfurther fetch would fail.\n\nUse a similar trick to the space handling, but only when the period is\nat the end of the ref.\n\nProbably need a more general solution to this problem.\n\nSigned-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>\n---\n contrib/remote-helpers/git-remote-hg | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg\nindex 0194c67..7fa6cd7 100755\n--- a/contrib/remote-helpers/git-remote-hg\n+++ b/contrib/remote-helpers/git-remote-hg\n@@ -78,9 +78,11 @@ def hgbin(n):\n     return node.bin(n)\n \n def hgref(ref):\n+    ref = re.sub('_\\._$', '.', ref)\n     return ref.replace('___', ' ')\n \n def gitref(ref):\n+    ref = re.sub('\\.$', '_._', ref)\n     return ref.replace(' ', '___')\n \n def check_version(*check):\n-- \n1.8.3.1.636.g893104c\n"}]}