comparison sat/plugins/plugin_merge_req_mercurial.py @ 2627:163aab916bcf

plugin merge-request/mercurial: fixed missing last line in diff while parsing patch
author Goffi <goffi@goffi.org>
date Fri, 29 Jun 2018 15:54:46 +0200
parents 49533de4540b
children 378188abe941
comparison
equal deleted inserted replaced
2626:6ef2b4fa90a5 2627:163aab916bcf
189 else: 189 else:
190 commit_msg.append(line) 190 commit_msg.append(line)
191 if state == 'diff': 191 if state == 'diff':
192 if line.startswith(u'# ') or idx == len(lines)-1: 192 if line.startswith(u'# ') or idx == len(lines)-1:
193 # a new patch is starting or we have reached end of patches 193 # a new patch is starting or we have reached end of patches
194 if idx == len(lines)-1:
195 # end of patches, we need to keep the line
196 diff.append(line)
194 patch[self._m.META_COMMIT_MSG] = u'\n'.join(commit_msg) 197 patch[self._m.META_COMMIT_MSG] = u'\n'.join(commit_msg)
195 patch[self._m.META_DIFF] = u'\n'.join(diff) 198 patch[self._m.META_DIFF] = u'\n'.join(diff)
196 patches.append(patch) 199 patches.append(patch)
197 if idx == len(lines)-1: 200 if idx == len(lines)-1:
198 del lines[:] 201 del lines[:]