@@ -154,7 +154,7 @@ def remove_last(l):
154
154
# set of all commits
155
155
commits = subprocess .check_output ([GIT , 'rev-list' , '--reverse' , '--topo-order' , ref_from + '..' + ref_to ])
156
156
commits = commits .decode ()
157
- commits = remove_last (commits .split ( ' \n ' ))
157
+ commits = remove_last (commits .splitlines ( ))
158
158
commits_list = commits
159
159
commits = set (commits )
160
160
@@ -166,7 +166,7 @@ def remove_last(l):
166
166
info = subprocess .check_output ([GIT , 'show' , '-s' , '--format=%B%x00%P' , commit ])
167
167
info = info .decode ()
168
168
(message , parents ) = info .split ('\0 ' )
169
- title = message .rstrip ().split ( ' \n ' )[0 ]
169
+ title = message .rstrip ().splitlines ( )[0 ]
170
170
parents = parents .rstrip ().split (' ' )
171
171
commit_data [commit ] = CommitData (commit , message , title , parents )
172
172
@@ -182,7 +182,7 @@ def parse_commit_message(msg):
182
182
Parse backport commit message.
183
183
'''
184
184
retval = CommitMetaData ()
185
- for line in msg .split ( ' \n ' ):
185
+ for line in msg .splitlines ( ):
186
186
m = re .match ('Github-Pull: #?(\d+)' , line , re .I )
187
187
if m :
188
188
retval .pull = int (m .group (1 ))
@@ -210,7 +210,7 @@ def parse_commit_message(msg):
210
210
#print('removing ', c.sha)
211
211
sub_commits = subprocess .check_output ([GIT , 'rev-list' , c .parents [0 ]+ '..' + c .parents [1 ]])
212
212
sub_commits = sub_commits .decode ()
213
- sub_commits = set (sub_commits .rstrip ().split ( ' \n ' ))
213
+ sub_commits = set (sub_commits .rstrip ().splitlines ( ))
214
214
pull = int (match .group (1 ))
215
215
216
216
# remove commits that are not in the global list
0 commit comments