|
13 | 13 |
|
14 | 14 | """ |
15 | 15 |
|
| 16 | +# NB: This exact commit message is used to find commits for reverting during backports. |
| 17 | +# Changing it requires a transition period where both old and new versions are supported. |
| 18 | +BACKPORT_COMMIT_MESSAGE = 'Update version and changelog for v' |
16 | 19 |
|
17 | 20 | # Name of the remote |
18 | 21 | ORIGIN = 'origin' |
@@ -287,7 +290,7 @@ def main(): |
287 | 290 | # This commit will not exist the first time we release the v{N-1} branch from the v{N} branch, so we |
288 | 291 | # use `git log --grep` to conditionally revert the commit. |
289 | 292 | print('Reverting the version number and changelog updates from the last release to avoid conflicts') |
290 | | - vOlder_update_commits = run_git('log', '--grep', '^Update version and changelog for v', '--format=%H').split() |
| 293 | + vOlder_update_commits = run_git('log', '--grep', f'^{BACKPORT_COMMIT_MESSAGE}', '--format=%H').split() |
291 | 294 |
|
292 | 295 | if len(vOlder_update_commits) > 0: |
293 | 296 | print(f' Reverting {vOlder_update_commits[0]}') |
@@ -329,7 +332,7 @@ def main(): |
329 | 332 |
|
330 | 333 | # Amend the commit generated by `npm version` to update the CHANGELOG |
331 | 334 | run_git('add', 'CHANGELOG.md') |
332 | | - run_git('commit', '-m', f'Update version and changelog for v{version}') |
| 335 | + run_git('commit', '-m', f'{BACKPORT_COMMIT_MESSAGE}{version}') |
333 | 336 | else: |
334 | 337 | # If we're performing a standard release, there won't be any new commits on the target branch, |
335 | 338 | # as these will have already been merged back into the source branch. Therefore we can just |
|
0 commit comments