@@ -122,7 +122,7 @@ def commit_range(repo: pygit2.Repository, commit_range: str):
122
122
start_commit = repo .revparse_single (start_commit_ref )
123
123
end_commit = repo .revparse_single (end_commit_ref )
124
124
125
- walker = repo .walk (end_commit .oid )
125
+ walker = repo .walk (end_commit .id )
126
126
walker .simplify_first_parent () # Avoid wandering off to merged branches. Same as 'git log --first-parent'
127
127
128
128
result = []
@@ -171,7 +171,7 @@ def main():
171
171
172
172
for order_number , commit in enumerate (commits ):
173
173
commit : pygit2 .Commit
174
- log .info (f"Processing commit '{ commit .hex } { commit .message .splitlines ()[0 ]} '" )
174
+ log .info (f"Processing commit '{ str ( commit .id ) } { commit .message .splitlines ()[0 ]} '" )
175
175
root = ET .Element ('UPDATES' , Version = FORMAT_VERSION , Source = 'git' )
176
176
update = ET .SubElement (root , 'UPDATE' )
177
177
@@ -193,11 +193,11 @@ def main():
193
193
commit_branches = list (repo .branches .remote .with_commit (commit ))
194
194
commit_branches_num = len (commit_branches )
195
195
if commit_branches_num == 0 :
196
- log .error (f"Unable to get branch name for commit { commit .hex } . "
196
+ log .error (f"Unable to get branch name for commit { str ( commit .id ) } . "
197
197
f"Make sure that the local tracking branch exists for the remote branch." )
198
198
continue
199
199
elif commit_branches_num > 1 :
200
- log .warning (f"Ambiguity in getting branch name for commit { commit .hex } . Got branches: { commit_branches } ."
200
+ log .warning (f"Ambiguity in getting branch name for commit { str ( commit .id ) } . Got branches: { commit_branches } ."
201
201
f"Using the first one: { commit_branches [0 ]} " )
202
202
ET .SubElement (update , 'OS' , Repo = config ['repo' ], Id = config ['os' ], Branch = commit_branches [0 ])
203
203
@@ -214,7 +214,7 @@ def main():
214
214
ET .SubElement (people , 'AUTHOR' , AuthorName = f"{ commit .author .name } " , AuthorEmail = f"{ commit .author .email } " )
215
215
216
216
log .debug ("Writing commit hash" )
217
- ET .SubElement (update , 'COMMIT' , Hash = commit .hex , HashShort = commit .short_id ,
217
+ ET .SubElement (update , 'COMMIT' , Hash = str ( commit .id ) , HashShort = commit .short_id ,
218
218
Subject = commit .message .splitlines ()[0 ], EncodingLoses = "false" , Repository = config ['repo' ])
219
219
220
220
files = ET .SubElement (update , 'FILES' )
@@ -244,7 +244,7 @@ def main():
244
244
245
245
file_name = (f"{ commit_datetime .year } .{ commit_datetime .month :02d} .{ commit_datetime .day :02d} ."
246
246
f"{ commit_datetime .hour :02d} .{ commit_datetime .minute :02d} .{ commit_datetime .second :02d} ."
247
- f"{ order_number :06d} .{ commit .hex } .xml" )
247
+ f"{ order_number :06d} .{ str ( commit .id ) } .xml" )
248
248
file_mode = 'wb' if config ['force' ] else 'xb'
249
249
log .debug ("Dumping XML" )
250
250
try :
0 commit comments