@@ -41,15 +41,25 @@ def format_pr_entry(target, number, auth=None):
41
41
42
42
43
43
def get_version_entry (
44
- branch , repo , version , * , since = None , until = None , auth = None , resolve_backports = False
44
+ ref ,
45
+ branch ,
46
+ repo ,
47
+ version ,
48
+ * ,
49
+ since = None ,
50
+ until = None ,
51
+ auth = None ,
52
+ resolve_backports = False ,
45
53
):
46
54
"""Get a changelog for the changes since the last tag on the given branch.
47
55
48
56
Parameters
49
57
----------
50
58
branch : str
51
59
The target branch
52
- respo : str
60
+ ref: str
61
+ The source reference
62
+ repo : str
53
63
The GitHub owner/repo
54
64
version : str
55
65
The new version
@@ -68,22 +78,22 @@ def get_version_entry(
68
78
A formatted changelog entry with markers
69
79
"""
70
80
71
- if not since :
81
+ if since :
72
82
tags = util .run (
73
- f"git --no-pager tag --sort=-creatordate --merged { branch } " , quiet = True
83
+ f"git --no-pager tag --sort=-creatordate --merged { ref } " , quiet = True
74
84
)
75
85
if tags :
76
86
since = tags .splitlines ()[0 ]
77
87
78
88
util .log (f"Getting changes to { repo } since { since } on branch { branch } ..." )
79
89
80
- until = until or util .run (f'git --no-pager log -n 1 { branch } --pretty=format:"%H"' )
81
-
82
- until = until .replace ("%" , "" )
90
+ if until :
91
+ until = until .replace ("%" , "" )
83
92
84
93
md = generate_activity_md (
85
94
repo ,
86
95
since = since ,
96
+ until = until ,
87
97
kind = "pr" ,
88
98
heading_level = 2 ,
89
99
auth = auth ,
@@ -129,7 +139,7 @@ def get_version_entry(
129
139
return output
130
140
131
141
132
- def build_entry (branch , repo , auth , changelog_path , since , resolve_backports ):
142
+ def build_entry (ref , branch , repo , auth , changelog_path , since , resolve_backports ):
133
143
"""Build a python version entry"""
134
144
branch = branch or util .get_branch ()
135
145
repo = repo or util .get_repo ()
@@ -148,6 +158,7 @@ def build_entry(branch, repo, auth, changelog_path, since, resolve_backports):
148
158
149
159
# Get changelog entry
150
160
entry = get_version_entry (
161
+ ref ,
151
162
branch ,
152
163
repo ,
153
164
version ,
@@ -196,7 +207,9 @@ def format(changelog):
196
207
return re .sub (r"\n\n+$" , r"\n" , changelog )
197
208
198
209
199
- def check_entry (branch , repo , auth , changelog_path , since , resolve_backports , output ):
210
+ def check_entry (
211
+ ref , branch , repo , auth , changelog_path , since , resolve_backports , output
212
+ ):
200
213
"""Check changelog entry"""
201
214
branch = branch or util .get_branch ()
202
215
@@ -220,6 +233,7 @@ def check_entry(branch, repo, auth, changelog_path, since, resolve_backports, ou
220
233
repo = repo or util .get_repo ()
221
234
222
235
raw_entry = get_version_entry (
236
+ ref ,
223
237
branch ,
224
238
repo ,
225
239
version ,
0 commit comments