The way this works is it re-runs the merge and "stores" conflicts, and then
diffs against the conflicted result. In a normal merge, you should only see
diffs against conflicted regions or in cases where there was a semantic
conflict but not a textual one. This makes it easier to detect "evil merges"
that contain substantial new work embedded in the merge commit.
Details
- Reviewers
marmoute martinvonz - Group Reviewers
hg-reviewers - Commits
- rHG1a7d12c82057: diff: add experimental support for "merge diffs"
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
Event Timeline
Looking forward to using this!
mercurial/commands.py | ||
---|---|---|
2414 | How about making this boolean-valued instead? I'd expect hg diff --merge -c <some merge commit> to work. That will also make it easy to provide a config option to always enable it. (I don't ever want the current behavior for -c with merge commits.) | |
2503–2518 | Seems like it would be cleaner to combine these two. | |
2506–2507 | Or should we allow non-merge commits so one can always pass --merge without thinking (e.g. in [defaults])? | |
2512 | Want to set a specific merge tool here while running this? | |
tests/test-diff-change.t | ||
187 | We should have at least one test showing a "four-way diff" with base, left, right, and resolved states. |
For anyone curious what's left, the test currently fails like this:
--- tests/test-diff-change.t +++ tests/test-diff-change.t.err @@ -241,9 +241,15 @@ ->>>>>>> other: d9e7de69eac3 - test: new file 9 10 + diff -r 5010caab09f6 new-file-p2.txt + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/new-file-p2.txt Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +this file is new in p2 of the merge There must _NOT_ be a .hg/merge directory leftover. $ test ! -e .hg/merge - - - $ cd .. + [1] + + + $ cd ..
mercurial/commands.py | ||
---|---|---|
2502 | How about calling these "pctx1" and "pctx2" instead so the same name doesn't change meaning and so you don't have to reassign "ctx2"? | |
tests/test-diff-change.t | ||
187 | Like the test case you added below. There, base is "8", left is "z", right is "y", and resolved is "z", if I'm reading that right. |
According to IRC discussion, this series is not ready for review, so moving it out of yadda.
Looks good to me but the commit description needs to be updated and an entry in relnotes/next will be helpful.
tests/test-diff-change.t | ||
---|---|---|
155 | Would be nice to silence this :) |
tests/test-diff-change.t | ||
---|---|---|
155 | Sorry, I meant the one on line 231, of course |
This is definitely releases-notes-worthy, so can you mention it there?
mercurial/commands.py | ||
---|---|---|
2502 | Ping on this |
tests/test-diff-change.t | ||
---|---|---|
155 | Yep, agreed. |
How about making this boolean-valued instead? I'd expect hg diff --merge -c <some merge commit> to work. That will also make it easy to provide a config option to always enable it. (I don't ever want the current behavior for -c with merge commits.)