From: Frantisek Hrbata Date: Thu, 3 Dec 2020 17:25:51 +0000 (+0100) Subject: git-mr-create: escape newline in all tags, not only in MR description X-Git-Tag: v0.2~65 X-Git-Url: http://www.hrbata.com/gitweb/?a=commitdiff_plain;h=d162a5f32f7c78d5c72592a6557e9f4c79455ced;p=gimrr.git git-mr-create: escape newline in all tags, not only in MR description Signed-off-by: Frantisek Hrbata --- diff --git a/git-mr-create b/git-mr-create index 62034c2..b29080c 100755 --- a/git-mr-create +++ b/git-mr-create @@ -74,7 +74,6 @@ if not subj: desc = "" if len(split) > 1: desc = "".join(split[1:]) - desc = desc.replace("\n", "\\n") an = mrlib.git_config("user.name") if not an: diff --git a/mrlib.py b/mrlib.py index 8869874..ddc96b3 100755 --- a/mrlib.py +++ b/mrlib.py @@ -160,6 +160,7 @@ def add_tag(tags, mr, commit, tag, user, value): if tag not in tags[mr][commit]: tags[mr][commit][tag] = set() + value = str(value).replace("\n", "\\n") tags[mr][commit][tag].add((user, value)) def remove_tag(tags, mr, commit, tag, user=None, value=None): @@ -227,8 +228,6 @@ def load_tags(mrs, refs=None, users=None, commits=True, squash=False): if not commits and commit != rev_zero: continue - value = value.replace("\\n", "\n") - add_tag(tags, mr, commit, tag, user, value) if tag == "at":