From b9a6cdd78517a565df38e6de67328f20a8a15dd1 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 29 Jun 2018 15:54:46 +0200 Subject: [PATCH] plugin merge-request/mercurial: fixed missing last line in diff while parsing patch --- sat/plugins/plugin_merge_req_mercurial.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sat/plugins/plugin_merge_req_mercurial.py b/sat/plugins/plugin_merge_req_mercurial.py index a2aadac0..d80b1d2f 100755 --- a/sat/plugins/plugin_merge_req_mercurial.py +++ b/sat/plugins/plugin_merge_req_mercurial.py @@ -191,6 +191,9 @@ class MercurialHandler(object): 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)