comparison tests/test-diff-change.t @ 46496:d57e607d9e33

diff: replace --merge option by config option I can't think of any reason you'd want to enable the merge diff on a run-to-run basis; you'd probably either always or never want it set (though I can't see why you'd never want it set). If you have it set, you'll probably also want the same output in `hg log -p` output. Having a single config option for the feature makes sense. Differential Revision: https://phab.mercurial-scm.org/D9956
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 04 Feb 2021 13:05:51 -0800
parents 62a0b5daa15f
children 7d908ee19b5b
comparison
equal deleted inserted replaced
46495:5aac1a1a5beb 46496:d57e607d9e33
194 9 194 9
195 10 195 10
196 196
197 merge diff should show only manual edits to a merge: 197 merge diff should show only manual edits to a merge:
198 198
199 $ hg diff --merge -c 6 199 $ hg diff --config diff.merge=yes -c 6
200 (no diff output is expected here) 200 (no diff output is expected here)
201 201
202 Construct an "evil merge" that does something other than just the merge. 202 Construct an "evil merge" that does something other than just the merge.
203 203
204 $ hg co ".^" 204 $ hg co ".^"
224 10 224 10
225 +11 225 +11
226 Contrast with the `hg diff -c 7` version above: only the manual edit shows 226 Contrast with the `hg diff -c 7` version above: only the manual edit shows
227 up, making it easy to identify changes someone is otherwise trying to sneak 227 up, making it easy to identify changes someone is otherwise trying to sneak
228 into a merge. 228 into a merge.
229 $ hg diff --merge -c 7 229 $ hg diff --config diff.merge=yes -c 7
230 diff -r 8ad85e839ba7 file.txt 230 diff -r 8ad85e839ba7 file.txt
231 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 231 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000
232 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 232 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000
233 @@ -9,3 +9,4 @@ 233 @@ -9,3 +9,4 @@
234 y 234 y
264 [1] 264 [1]
265 $ hg revert file.txt -r . 265 $ hg revert file.txt -r .
266 $ hg resolve -ma 266 $ hg resolve -ma
267 (no more unresolved files) 267 (no more unresolved files)
268 $ hg commit -m 'merge conflicted edit' 268 $ hg commit -m 'merge conflicted edit'
269 Without --merge, it's a diff against p1 269 Without diff.merge, it's a diff against p1
270 $ hg diff --no-merge -c 11 270 $ hg diff --config diff.merge=no -c 11
271 diff -r fd1f17c90d7c -r 5010caab09f6 new-file-p2.txt 271 diff -r fd1f17c90d7c -r 5010caab09f6 new-file-p2.txt
272 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 272 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
273 +++ b/new-file-p2.txt Thu Jan 01 00:00:00 1970 +0000 273 +++ b/new-file-p2.txt Thu Jan 01 00:00:00 1970 +0000
274 @@ -0,0 +1,1 @@ 274 @@ -0,0 +1,1 @@
275 +this file is new in p2 of the merge 275 +this file is new in p2 of the merge
276 With --merge, it's a diff against the conflicted content. 276 With diff.merge, it's a diff against the conflicted content.
277 $ hg diff --merge -c 11 277 $ hg diff --config diff.merge=yes -c 11
278 diff -r 5010caab09f6 file.txt 278 diff -r 5010caab09f6 file.txt
279 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000 279 --- a/file.txt Thu Jan 01 00:00:00 1970 +0000
280 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000 280 +++ b/file.txt Thu Jan 01 00:00:00 1970 +0000
281 @@ -6,12 +6,6 @@ 281 @@ -6,12 +6,6 @@
282 5 282 5