# HG changeset patch # User Martin von Zweigbergk # Date 2021-02-04 21:32:11 # Node ID a788e4bbbd6ef287138e9fba5c7da99170d4f66b # Parent 09fee527ebfd5e2c1b6cbdc1ea4d9387e6ee45a1 log: respect diff.merge in -p output Differential Revision: https://phab.mercurial-scm.org/D9958 diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py +++ b/mercurial/logcmdutil.py @@ -247,7 +247,7 @@ class changesetdiffer(object): ui, ctx.repo(), diffopts, - ctx.p1(), + diff_parent(ctx), ctx, match=self._makefilematcher(ctx), stat=stat, 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/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -1966,6 +1966,26 @@ Diff here should be the same: @@ -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