plugin merge-request/mercurial: fixed missing last line in diff while parsing patch

This commit is contained in:
Goffi 2018-06-29 15:54:46 +02:00
commit b9a6cdd785

View file

@ -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)