From 6e3872b6a0465d3da271f6d16b45a86f99e620ea Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 2 Jun 2008 13:23:48 -0500 Subject: [PATCH] hg-fast-export.py: sanitize tildes (~) in branch names In git-check-ref-format (1), there is the following rule for refnames: 3. It cannot have ASCII control character (i.e. bytes whose values are lower than \040, or \177 DEL), space, tilde ~, caret ^, colon :, question-mark ?, asterisk *, or open bracket [ anywhere; and indeed, this rule is enforced by "git fast-import". hg-fast-export already checked for all of the visible characters listed except for ~ and converted them to underscores. For some reason the tilde was forgotten. This patch makes good on the omission. Note that control characters are still left alone. Signed-off-by: Jonathan Nieder Signed-off-by: Rocco Rutte --- hg-fast-export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hg-fast-export.py b/hg-fast-export.py index e3af8a6..8c88921 100755 --- a/hg-fast-export.py +++ b/hg-fast-export.py @@ -141,7 +141,7 @@ def sanitize_name(name,what="branch"): return name n=name - p=re.compile('([[ ^:?*]|\.\.)') + p=re.compile('([[ ~^:?*]|\.\.)') n=p.sub('_', n) if n[-1] == '/': n=n[:-1]+'_' n='/'.join(map(dot,n.split('/'))) -- 2.11.4.GIT