Skip to content

Commit 69f4006

Browse files
jcristaushtrom
authored andcommitted
Fix destination branch for esr tags (bug 1967193)
tags_destination_branch can be a regexp in which case backslash escapes have to be processed, otherwise we try to create a branch with an invalid name.
1 parent 2dc56be commit 69f4006

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

git_hg_sync/mapping.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,16 @@ def match(self, event: Push) -> Sequence[MappingMatch]:
105105
if not self._tag_pattern.match(tag_name):
106106
continue
107107
destination_url = re.sub(self._tag_pattern, self.destination_url, tag_name)
108+
tags_destination_branch = re.sub(
109+
self._tag_pattern, self.tags_destination_branch, tag_name
110+
)
108111
matches.append(
109112
MappingMatch(
110113
destination_url=destination_url,
111114
operation=SyncTagOperation(
112115
tag=tag_name,
113116
source_commit=commit,
114-
tags_destination_branch=self.tags_destination_branch,
117+
tags_destination_branch=tags_destination_branch,
115118
tag_message_suffix=self.tag_message_suffix,
116119
),
117120
)

0 commit comments

Comments
 (0)