Skip to content

Commit 964ca3b

Browse files
committed
Merge #105: backport.py expects pulls that are prefixed with repo name
ff3e027 backport.py expects pulls that are prefixed with repo name (Hennadii Stepanov) Pull request description: It is required because since #92 merge commit messages always include `repo_from`. Example of usage: bitcoin/bitcoin#22427. ACKs for top commit: laanwj: Tested ACK ff3e027 (both with `bitcoin/bitcoin` and `bitcoin-core/gui` repositories) Tree-SHA512: 2811edc51322e6e53cac8357050198c86a49e42067827e9cc87253e57333f81a4fc301ae91bca662304254dc81ce73caccc8279128c6b71d2259086846014c65
2 parents efbd3a7 + ff3e027 commit 964ca3b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ backport
118118
--------
119119

120120
Script to backport pull requests in order of merge, to minimize number of conflicts.
121-
Pull ids are listed in `to_backport.txt` or given on the command line.
121+
Pull ids are listed in `to_backport.txt` or given on the command line, and they must be prefixed
122+
with the repository name, e.g.:
123+
124+
```bash
125+
../bitcoin-maintainer-tools/backport.py bitcoin/bitcoin#21907 bitcoin-core/gui#277 bitcoin-core/gui#365
126+
127+
```
122128

123129
Requires `pip3 install gitpython` or similar.
124130

backport.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def ask_prompt(text):
2222
print("",file=sys.stderr)
2323
return reply
2424

25-
merge_re = re.compile('^Merge (#[0-9]+)')
25+
merge_re = re.compile('^Merge (\w+(?:-\w+)*/\w+(?:-\w+)*#[0-9]+)')
2626
if len(sys.argv) > 1:
27-
pulls = ['#'+x.strip() for x in sys.argv[1:]]
27+
pulls = [x.strip() for x in sys.argv[1:]]
2828
else:
2929
with open('to_backport.txt','r') as f:
3030
pulls = [x.strip() for x in f if x.strip()]

0 commit comments

Comments
 (0)