From 952dafa45c1b38b64aa68c70acf43d165abb2fd7 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 1 Mar 2021 09:44:18 +0100 Subject: [PATCH] [IMP] forwardport: feedback on conflict append `git status` data to stderr, should be somewhat more informative especially when a conflict is a DU (where the file has been deleted on one side, so there is no conflict marker anywhere). Fixes #461 --- forwardport/models/project.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/forwardport/models/project.py b/forwardport/models/project.py index 15c0a037..fd9b910d 100644 --- a/forwardport/models/project.py +++ b/forwardport/models/project.py @@ -871,7 +871,12 @@ This PR targets %s and is part of the forward-port chain. Further PRs will be cr conf.with_params('merge.renamelimit=0')\ .with_config(check=False)\ .cherry_pick(squashed, no_commit=True) - + status = conf.stdout().status(short=True, untracked_files='no').stdout.decode() + h, out, err = e.args + if err.strip(): + err = err.rstrip() + '\n----------\nstatus:\n' + status + else: + err = 'status:\n' + status # if there was a single commit, reuse its message when committing # the conflict # TODO: still add conflict information to this? @@ -888,8 +893,8 @@ stdout: %s stderr: %s -""" % e.args) - return e.args, working_copy +""" % (h, out, err)) + return (h, out, err), working_copy def _cherry_pick(self, working_copy): """ Cherrypicks ``self`` into the working copy