comparison tests/test-extdiff.t @ 46133:0a4d47f4337b

extdiff: add --from/--to and deprecate -r, as was done for `hg diff` I recently replaced `hg diff`'s `-r` flag by `--from` and `--to` and then deprecated the `-r` flag. This patch repeats that for `hg extdiff`. Differential Revision: https://phab.mercurial-scm.org/D9624
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 16 Dec 2020 21:06:29 -0800
parents dfe2760db2a6
children c9b2a4d69e66
comparison
equal deleted inserted replaced
46132:dfe2760db2a6 46133:0a4d47f4337b
48 the working directory files are compared to its parent. 48 the working directory files are compared to its parent.
49 49
50 options ([+] can be repeated): 50 options ([+] can be repeated):
51 51
52 -o --option OPT [+] pass option to comparison program 52 -o --option OPT [+] pass option to comparison program
53 -r --rev REV [+] revision 53 --from REV1 revision to diff from
54 --to REV2 revision to diff to
54 -c --change REV change made by revision 55 -c --change REV change made by revision
55 --per-file compare each file instead of revision snapshots 56 --per-file compare each file instead of revision snapshots
56 --confirm prompt user before each external program invocation 57 --confirm prompt user before each external program invocation
57 --patch compare patches for two revisions 58 --patch compare patches for two revisions
58 -I --include PATTERN [+] include names matching the given patterns 59 -I --include PATTERN [+] include names matching the given patterns
66 $ echo b >> a 67 $ echo b >> a
67 $ hg ci -d '1 0' -mtest2 68 $ hg ci -d '1 0' -mtest2
68 69
69 Should diff cloned files directly: 70 Should diff cloned files directly:
70 71
71 $ hg falabala -r 0:1 72 $ hg falabala --from 0 --to 1
72 diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) 73 diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !)
73 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) 74 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !)
74 [1] 75 [1]
75 76
76 Can show diff from working copy: 77 Can show diff from working copy:
77 $ echo c >> a 78 $ echo c >> a
78 $ hg falabala -r 'wdir()' -r 1 79 $ hg falabala --to 1
79 diffing "*\\extdiff.*\\a" "a.34eed99112ab\\a" (glob) (windows !) 80 diffing "*\\extdiff.*\\a" "a.34eed99112ab\\a" (glob) (windows !)
80 diffing */extdiff.*/a a.34eed99112ab/a (glob) (no-windows !) 81 diffing */extdiff.*/a a.34eed99112ab/a (glob) (no-windows !)
81 [1] 82 [1]
82 $ hg revert a 83 $ hg revert a
83 $ rm a.orig 84 $ rm a.orig
137 $ hg add 138 $ hg add
138 adding .hgsub 139 adding .hgsub
139 $ hg ci -Sm "adding subrepo" 140 $ hg ci -Sm "adding subrepo"
140 $ echo > .hgsub 141 $ echo > .hgsub
141 $ hg ci -m "removing subrepo" 142 $ hg ci -m "removing subrepo"
142 $ hg falabala -r 4 -r 5 -S 143 $ hg falabala --from 4 --to 5 -S
143 diffing a.398e36faf9c6 a.5ab95fb166c4 144 diffing a.398e36faf9c6 a.5ab95fb166c4
144 [1] 145 [1]
145 146
146 Test --per-file option: 147 Test --per-file option:
147 148
290 > kdiff3 = echo 291 > kdiff3 = echo
291 > [merge-tools] 292 > [merge-tools]
292 > kdiff3.diffargs=--L1 \$plabel1 --L2 \$clabel \$parent \$child 293 > kdiff3.diffargs=--L1 \$plabel1 --L2 \$clabel \$parent \$child
293 > EOF 294 > EOF
294 295
295 $ hg --debug kdiff3 -r0 | grep '^running' 296 $ hg --debug kdiff3 --from 0 | grep '^running'
296 running 'echo --L1 "@0" --L2 "" a.8a5febb7f867 a' in * (glob) (windows !) 297 running 'echo --L1 "@0" --L2 "" a.8a5febb7f867 a' in * (glob) (windows !)
297 running "echo --L1 '@0' --L2 '' a.8a5febb7f867 a" in * (glob) (no-windows !) 298 running "echo --L1 '@0' --L2 '' a.8a5febb7f867 a" in * (glob) (no-windows !)
298 299
299 300
300 Test extdiff of multiple files in tmp dir: 301 Test extdiff of multiple files in tmp dir:
494 $ hg ci -Am adda 495 $ hg ci -Am adda
495 adding a 496 adding a
496 $ echo a >> a 497 $ echo a >> a
497 $ ln -s missing linka 498 $ ln -s missing linka
498 $ hg add linka 499 $ hg add linka
499 $ hg falabala -r 0 --traceback 500 $ hg falabala --from 0 --traceback
500 diffing testsymlinks.07f494440405 testsymlinks 501 diffing testsymlinks.07f494440405 testsymlinks
501 [1] 502 [1]
502 $ cd .. 503 $ cd ..
503 504
504 #endif 505 #endif