File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -64,26 +64,34 @@ def find_pr_list(start: str, end: str):
64
64
"""
65
65
66
66
# Let git generate the proper pr history
67
- cmd = "git log --merges -- oneline " + start + ".." + end
67
+ cmd = "git log --oneline " + start + ".." + end
68
68
cmd = cmd .split ()
69
69
output = subprocess .run (cmd , cwd = FOLDER , stdout = subprocess .PIPE )
70
70
pr_commits = output .stdout .split (b"\n " )
71
71
72
72
# Fetch ids for all merge requests from PRS
73
- pattern_re = re .compile ("( \S+) Merge pull request #\d+ from ( \S+) " )
74
- uid_re = re .compile ("# \d+" )
73
+ merge_re = re .compile ("\S+ Merge pull request #( \d+) from \S+" )
74
+ squash_re = re .compile ("\(#( \d+)\) " )
75
75
76
76
ids = []
77
77
for pr in pr_commits :
78
78
79
79
pr_s = str (pr )
80
80
81
- # ignore if doesn't follow the usual pattern
82
- if not pattern_re .fullmatch (pr_s ):
83
- continue
81
+ # Match agains usual pattern
82
+ uid = None
83
+ match = merge_re .fullmatch (pr_s )
84
+
85
+ # Match agains squash pattern
86
+ if not match :
87
+ match = squash_re .search (pr_s )
88
+
89
+ # Abort
90
+ if not match :
91
+ continue
84
92
85
93
# Extract PR uid
86
- uid = int (uid_re . search ( pr_s ). group (0 )[ 1 :] )
94
+ uid = int (match . group (1 ) )
87
95
ids .append (uid )
88
96
89
97
return ids
You can’t perform that action at this time.
0 commit comments