changeset 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 6ef2b4fa90a5
children 779351da2c13
files sat/plugins/plugin_merge_req_mercurial.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_merge_req_mercurial.py	Wed Jun 27 22:50:32 2018 +0200
+++ b/sat/plugins/plugin_merge_req_mercurial.py	Fri Jun 29 15:54:46 2018 +0200
@@ -191,6 +191,9 @@
                 if state == 'diff':
                     if line.startswith(u'# ') or idx == len(lines)-1:
                         # a new patch is starting or we have reached end of patches
+                        if idx == len(lines)-1:
+                            # end of patches, we need to keep the line
+                            diff.append(line)
                         patch[self._m.META_COMMIT_MSG] = u'\n'.join(commit_msg)
                         patch[self._m.META_DIFF] = u'\n'.join(diff)
                         patches.append(patch)