Skip to content

Commit ff3e027

Browse files
committed
backport.py expects pulls that are prefixed with repo name
It is required because since #92 merge commit messages always include repo_from.
1 parent 12f4642 commit ff3e027

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

+7-1
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

+2-2
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)