From patchwork Fri Feb 5 08:04:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D9958: log: respect diff.merge in -p output From: phabricator X-Patchwork-Id: 48271 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 5 Feb 2021 08:04:27 +0000 martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9958 AFFECTED FILES mercurial/logcmdutil.py relnotes/next tests/test-log.t CHANGE DETAILS To: martinvonz, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -1966,6 +1966,26 @@ @@ -0,0 +1,1 @@ +b + +Test that diff.merge is respected (file b was added on one side and +and therefore merged cleanly) + + $ hg log -pr 3 --config diff.merge=yes + changeset: 3:8e07aafe1edc + tag: tip + parent: 2:b09be438c43a + parent: 1:925d80f479bb + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: 3 + + diff -r 8e07aafe1edc a + --- a/a Thu Jan 01 00:00:00 1970 +0000 + +++ b/a Thu Jan 01 00:00:00 1970 +0000 + @@ -1,1 +1,1 @@ + -b + +c + $ cd .. 'hg log -r rev fn' when last(filelog(fn)) != rev diff --git a/relnotes/next b/relnotes/next --- a/relnotes/next +++ b/relnotes/next @@ -11,7 +11,8 @@ * There's a new `diff.merge` config option to show the changes relative to an automerge for merge changesets. This makes it easier to detect and review manual changes performed in merge - changesets. It is only supported by `hg diff --change` so far. + changesets. It is supported by `hg diff --change`, `hg log -p` + `hg incoming -p`, and `hg outgoing -p` so far. == Bug Fixes == diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py +++ b/mercurial/logcmdutil.py @@ -242,7 +242,7 @@ ui, ctx.repo(), diffopts, - ctx.p1(), + diff_parent(ctx), ctx, match=self._makefilematcher(ctx), stat=stat,