Mercurial > hg
annotate tests/test-extdiff.t @ 52280:dae74953ab66 stable
Added tag 6.9 for changeset b267c5764cc6
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Wed, 20 Nov 2024 15:38:54 +0100 |
parents | a81d2cafdbcc |
children |
rev | line source |
---|---|
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
1 $ echo "[extensions]" >> $HGRCPATH |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
2 $ echo "extdiff=" >> $HGRCPATH |
2906
453097750fbf
extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
3 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
4 $ hg init a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
5 $ cd a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
6 $ echo a > a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
7 $ echo b > b |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
8 $ hg add |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
9 adding a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
10 adding b |
2906
453097750fbf
extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
11 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
12 Should diff cloned directories: |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
13 |
46130
60677eca7434
tests: remove undefined (empty) $opt from test-extdiff.t
Martin von Zweigbergk <martinvonz@google.com>
parents:
43822
diff
changeset
|
14 $ hg extdiff -o -r |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
15 Only in a: a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
16 Only in a: b |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12304
diff
changeset
|
17 [1] |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
18 |
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23152
diff
changeset
|
19 $ cat <<EOF >> $HGRCPATH |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23152
diff
changeset
|
20 > [extdiff] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23152
diff
changeset
|
21 > cmd.falabala = echo |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23152
diff
changeset
|
22 > opts.falabala = diffing |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23152
diff
changeset
|
23 > cmd.edspace = echo |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23152
diff
changeset
|
24 > opts.edspace = "name <user@example.com>" |
41584
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
25 > alabalaf = |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
26 > [merge-tools] |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
27 > alabalaf.executable = echo |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
28 > alabalaf.diffargs = diffing |
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
23152
diff
changeset
|
29 > EOF |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
30 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
31 $ hg falabala |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
32 diffing a.000000000000 a |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12304
diff
changeset
|
33 [1] |
2906
453097750fbf
extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
34 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
35 $ hg help falabala |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
36 hg falabala [OPTION]... [FILE]... |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
37 |
29723
91b2f2176395
extdiff: isolate path variable of saved command to independent paragraph
Yuya Nishihara <yuya@tcha.org>
parents:
29630
diff
changeset
|
38 use external program to diff repository (or selected files) |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
39 |
52099
31076a2301f1
py-3-13: stabilize the docstring output across all supported Python versions
Raphaël Gomès <rgomes@octobus.net>
parents:
52023
diff
changeset
|
40 Show differences between revisions for the specified files, using the |
31076a2301f1
py-3-13: stabilize the docstring output across all supported Python versions
Raphaël Gomès <rgomes@octobus.net>
parents:
52023
diff
changeset
|
41 following program: |
29723
91b2f2176395
extdiff: isolate path variable of saved command to independent paragraph
Yuya Nishihara <yuya@tcha.org>
parents:
29630
diff
changeset
|
42 |
52099
31076a2301f1
py-3-13: stabilize the docstring output across all supported Python versions
Raphaël Gomès <rgomes@octobus.net>
parents:
52023
diff
changeset
|
43 'echo' |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
44 |
52099
31076a2301f1
py-3-13: stabilize the docstring output across all supported Python versions
Raphaël Gomès <rgomes@octobus.net>
parents:
52023
diff
changeset
|
45 When two revision arguments are given, then changes are shown between those |
31076a2301f1
py-3-13: stabilize the docstring output across all supported Python versions
Raphaël Gomès <rgomes@octobus.net>
parents:
52023
diff
changeset
|
46 revisions. If only one revision is specified then that revision is compared to |
31076a2301f1
py-3-13: stabilize the docstring output across all supported Python versions
Raphaël Gomès <rgomes@octobus.net>
parents:
52023
diff
changeset
|
47 the working directory, and, when no revisions are specified, the working |
31076a2301f1
py-3-13: stabilize the docstring output across all supported Python versions
Raphaël Gomès <rgomes@octobus.net>
parents:
52023
diff
changeset
|
48 directory files are compared to its parent. |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
49 |
22117
c1d93edcf004
help: fold repeatable option message into option table header
Matt Mackall <mpm@selenic.com>
parents:
22110
diff
changeset
|
50 options ([+] can be repeated): |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
51 |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14024
diff
changeset
|
52 -o --option OPT [+] pass option to comparison program |
46133
0a4d47f4337b
extdiff: add --from/--to and deprecate -r, as was done for `hg diff`
Martin von Zweigbergk <martinvonz@google.com>
parents:
46132
diff
changeset
|
53 --from REV1 revision to diff from |
0a4d47f4337b
extdiff: add --from/--to and deprecate -r, as was done for `hg diff`
Martin von Zweigbergk <martinvonz@google.com>
parents:
46132
diff
changeset
|
54 --to REV2 revision to diff to |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14024
diff
changeset
|
55 -c --change REV change made by revision |
41487
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
56 --per-file compare each file instead of revision snapshots |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
57 --confirm prompt user before each external program invocation |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
58 --patch compare patches for two revisions |
15145
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14024
diff
changeset
|
59 -I --include PATTERN [+] include names matching the given patterns |
ff26712a0c50
help: use RST to format option lists
Matt Mackall <mpm@selenic.com>
parents:
14024
diff
changeset
|
60 -X --exclude PATTERN [+] exclude names matching the given patterns |
30152
d65e246100ed
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
30024
diff
changeset
|
61 -S --subrepos recurse into subrepositories |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
62 |
22110
26f7c8033bed
help: tweak --verbose command help hint
Matt Mackall <mpm@selenic.com>
parents:
17837
diff
changeset
|
63 (some details hidden, use --verbose to show complete help) |
2906
453097750fbf
extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
64 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
65 $ hg ci -d '0 0' -mtest1 |
2906
453097750fbf
extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
66 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
67 $ echo b >> a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
68 $ hg ci -d '1 0' -mtest2 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
69 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
70 Should diff cloned files directly: |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
71 |
46133
0a4d47f4337b
extdiff: add --from/--to and deprecate -r, as was done for `hg diff`
Martin von Zweigbergk <martinvonz@google.com>
parents:
46132
diff
changeset
|
72 $ hg falabala --from 0 --to 1 |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
73 diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
74 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) |
24885
eea3977e6fca
windows: make shellquote() quote any path containing '\' (issue4629)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24153
diff
changeset
|
75 [1] |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
76 |
46132
dfe2760db2a6
extdiff: fix crash when showing diff from wdir()
Martin von Zweigbergk <martinvonz@google.com>
parents:
46130
diff
changeset
|
77 Can show diff from working copy: |
dfe2760db2a6
extdiff: fix crash when showing diff from wdir()
Martin von Zweigbergk <martinvonz@google.com>
parents:
46130
diff
changeset
|
78 $ echo c >> a |
46133
0a4d47f4337b
extdiff: add --from/--to and deprecate -r, as was done for `hg diff`
Martin von Zweigbergk <martinvonz@google.com>
parents:
46132
diff
changeset
|
79 $ hg falabala --to 1 |
46132
dfe2760db2a6
extdiff: fix crash when showing diff from wdir()
Martin von Zweigbergk <martinvonz@google.com>
parents:
46130
diff
changeset
|
80 diffing "*\\extdiff.*\\a" "a.34eed99112ab\\a" (glob) (windows !) |
dfe2760db2a6
extdiff: fix crash when showing diff from wdir()
Martin von Zweigbergk <martinvonz@google.com>
parents:
46130
diff
changeset
|
81 diffing */extdiff.*/a a.34eed99112ab/a (glob) (no-windows !) |
dfe2760db2a6
extdiff: fix crash when showing diff from wdir()
Martin von Zweigbergk <martinvonz@google.com>
parents:
46130
diff
changeset
|
82 [1] |
dfe2760db2a6
extdiff: fix crash when showing diff from wdir()
Martin von Zweigbergk <martinvonz@google.com>
parents:
46130
diff
changeset
|
83 $ hg revert a |
dfe2760db2a6
extdiff: fix crash when showing diff from wdir()
Martin von Zweigbergk <martinvonz@google.com>
parents:
46130
diff
changeset
|
84 $ rm a.orig |
dfe2760db2a6
extdiff: fix crash when showing diff from wdir()
Martin von Zweigbergk <martinvonz@google.com>
parents:
46130
diff
changeset
|
85 |
26836
88c4e97b9669
scmutil: abort if an empty revision is given to revpair()
Matt Harbison <matt_harbison@yahoo.com>
parents:
26228
diff
changeset
|
86 Specifying an empty revision should abort. |
88c4e97b9669
scmutil: abort if an empty revision is given to revpair()
Matt Harbison <matt_harbison@yahoo.com>
parents:
26228
diff
changeset
|
87 |
28053
34a2944aac9b
check-code: add rule to detect usage of external diff via extdiff
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
27183
diff
changeset
|
88 $ hg extdiff -p diff --patch --rev 'ancestor()' --rev 1 |
26836
88c4e97b9669
scmutil: abort if an empty revision is given to revpair()
Matt Harbison <matt_harbison@yahoo.com>
parents:
26228
diff
changeset
|
89 abort: empty revision on one side of range |
48030
7d908ee19b5b
errors: use InputError for some invalid revsets and such
Martin von Zweigbergk <martinvonz@google.com>
parents:
46261
diff
changeset
|
90 [10] |
26836
88c4e97b9669
scmutil: abort if an empty revision is given to revpair()
Matt Harbison <matt_harbison@yahoo.com>
parents:
26228
diff
changeset
|
91 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
92 Test diff during merge: |
2906
453097750fbf
extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
93 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
94 $ hg update -C 0 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
95 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
96 $ echo c >> c |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
97 $ hg add c |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
98 $ hg ci -m "new branch" -d '1 0' |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
99 created new head |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
100 $ hg merge 1 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
101 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
102 (branch merge, don't forget to commit) |
2906
453097750fbf
extdiff: fix bugs. add test.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff
changeset
|
103 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
104 Should diff cloned file against wc file: |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
105 |
24885
eea3977e6fca
windows: make shellquote() quote any path containing '\' (issue4629)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24153
diff
changeset
|
106 $ hg falabala |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
107 diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "*\\a\\a" (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
108 diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob) (no-windows !) |
24885
eea3977e6fca
windows: make shellquote() quote any path containing '\' (issue4629)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24153
diff
changeset
|
109 [1] |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
110 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
111 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
112 Test --change option: |
3330
49966b5ab16f
fix traceback of extdiff after a merge
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
2990
diff
changeset
|
113 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
114 $ hg ci -d '2 0' -mtest3 |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
115 |
24885
eea3977e6fca
windows: make shellquote() quote any path containing '\' (issue4629)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24153
diff
changeset
|
116 $ hg falabala -c 1 |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
117 diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
118 diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) |
24885
eea3977e6fca
windows: make shellquote() quote any path containing '\' (issue4629)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24153
diff
changeset
|
119 [1] |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
120 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
121 Check diff are made from the first parent: |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
122 |
24885
eea3977e6fca
windows: make shellquote() quote any path containing '\' (issue4629)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24153
diff
changeset
|
123 $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code" |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
124 diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "a.46c0e4daeb72\\a" (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
125 diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob) (no-windows !) |
24885
eea3977e6fca
windows: make shellquote() quote any path containing '\' (issue4629)
Matt Harbison <matt_harbison@yahoo.com>
parents:
24153
diff
changeset
|
126 diff-like tools yield a non-zero exit code |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
127 |
27183
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
128 issue3153: ensure using extdiff with removed subrepos doesn't crash: |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
129 |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
130 $ hg init suba |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
131 $ cd suba |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
132 $ echo suba > suba |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
133 $ hg add |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
134 adding suba |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
135 $ hg ci -m "adding suba file" |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
136 $ cd .. |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
137 $ echo suba=suba > .hgsub |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
138 $ hg add |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
139 adding .hgsub |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
140 $ hg ci -Sm "adding subrepo" |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
141 $ echo > .hgsub |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
142 $ hg ci -m "removing subrepo" |
46133
0a4d47f4337b
extdiff: add --from/--to and deprecate -r, as was done for `hg diff`
Martin von Zweigbergk <martinvonz@google.com>
parents:
46132
diff
changeset
|
143 $ hg falabala --from 4 --to 5 -S |
27183
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
144 diffing a.398e36faf9c6 a.5ab95fb166c4 |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
145 [1] |
0945539a3a6b
extdiff: correctly handle deleted subrepositories (issue3153)
Andrew Zwicky <andrew.zwicky@gmail.com>
parents:
26836
diff
changeset
|
146 |
41487
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
147 Test --per-file option: |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
148 |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
149 $ hg up -q -C 3 |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
150 $ echo a2 > a |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
151 $ echo b2 > b |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
152 $ hg ci -d '3 0' -mtestmode1 |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
153 created new head |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
154 $ hg falabala -c 6 --per-file |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
155 diffing "*\\extdiff.*\\a.46c0e4daeb72\\a" "a.81906f2b98ac\\a" (glob) (windows !) |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
156 diffing */extdiff.*/a.46c0e4daeb72/a a.81906f2b98ac/a (glob) (no-windows !) |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
157 diffing "*\\extdiff.*\\a.46c0e4daeb72\\b" "a.81906f2b98ac\\b" (glob) (windows !) |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
158 diffing */extdiff.*/a.46c0e4daeb72/b a.81906f2b98ac/b (glob) (no-windows !) |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
159 [1] |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
160 |
52023
d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com>
parents:
48030
diff
changeset
|
161 #if no-gui |
d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com>
parents:
48030
diff
changeset
|
162 Test gui tool error: |
d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com>
parents:
48030
diff
changeset
|
163 |
d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com>
parents:
48030
diff
changeset
|
164 $ hg --config extdiff.gui.alabalaf=True alabalaf |
d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com>
parents:
48030
diff
changeset
|
165 abort: tool 'alabalaf' requires a GUI |
d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com>
parents:
48030
diff
changeset
|
166 (to override, use: --config diff-tools.alabalaf.gui=False) |
d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com>
parents:
48030
diff
changeset
|
167 [255] |
d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com>
parents:
48030
diff
changeset
|
168 #endif |
d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com>
parents:
48030
diff
changeset
|
169 |
52153
a81d2cafdbcc
tests: stabilize `test-extdiff.t` on macOS
Matt Harbison <matt_harbison@yahoo.com>
parents:
52100
diff
changeset
|
170 #if gui |
41584
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
171 Test --per-file option for gui tool: |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
172 |
52023
d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com>
parents:
48030
diff
changeset
|
173 $ DISPLAY=fake hg --config extdiff.gui.alabalaf=True alabalaf -c 6 --per-file --debug |
41809
e0a3ee3fdb33
tests: add more wildcards to test-extdiff.t
Matt Harbison <matt_harbison@yahoo.com>
parents:
41712
diff
changeset
|
174 diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) |
e0a3ee3fdb33
tests: add more wildcards to test-extdiff.t
Matt Harbison <matt_harbison@yahoo.com>
parents:
41712
diff
changeset
|
175 diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) |
41584
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
176 making snapshot of 2 files from rev 46c0e4daeb72 |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
177 a |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
178 b |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
179 making snapshot of 2 files from rev 81906f2b98ac |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
180 a |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
181 b |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
182 running '* diffing * *' in * (backgrounded) (glob) |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
183 running '* diffing * *' in * (backgrounded) (glob) |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
184 cleaning up temp directory |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
185 [1] |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
186 |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
187 Test --per-file option for gui tool again: |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
188 |
52023
d1b54c152673
extdiff: don't run gui programs when in a cli-only environment
Ludovic Chabant <ludovic@chabant.com>
parents:
48030
diff
changeset
|
189 $ DISPLAY=fake hg --config merge-tools.alabalaf.gui=True alabalaf -c 6 --per-file --debug |
41712
88d4477ac4f6
tests: add more wildcards to test-extdiff.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
41608
diff
changeset
|
190 diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) |
88d4477ac4f6
tests: add more wildcards to test-extdiff.t
Gregory Szorc <gregory.szorc@gmail.com>
parents:
41608
diff
changeset
|
191 diffing */extdiff.*/a.46c0e4daeb72/* a.81906f2b98ac/* (glob) |
41584
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
192 making snapshot of 2 files from rev 46c0e4daeb72 |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
193 a |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
194 b |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
195 making snapshot of 2 files from rev 81906f2b98ac |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
196 a |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
197 b |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
198 running '* diffing * *' in * (backgrounded) (glob) |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
199 running '* diffing * *' in * (backgrounded) (glob) |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
200 cleaning up temp directory |
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
201 [1] |
52153
a81d2cafdbcc
tests: stabilize `test-extdiff.t` on macOS
Matt Harbison <matt_harbison@yahoo.com>
parents:
52100
diff
changeset
|
202 #endif |
41584
a4cd77a425a3
extdiff: support tools that can be run simultaneously
Ludovic Chabant <ludovic@chabant.com>
parents:
41487
diff
changeset
|
203 |
41487
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
204 Test --per-file and --confirm options: |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
205 |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
206 $ hg --config ui.interactive=True falabala -c 6 --per-file --confirm <<EOF |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
207 > n |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
208 > y |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
209 > EOF |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
210 diff a (1 of 2) [Yns?] n |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
211 diff b (2 of 2) [Yns?] y |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
212 diffing "*\\extdiff.*\\a.46c0e4daeb72\\b" "a.81906f2b98ac\\b" (glob) (windows !) |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
213 diffing */extdiff.*/a.46c0e4daeb72/b a.81906f2b98ac/b (glob) (no-windows !) |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
214 [1] |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
215 |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
216 Test --per-file and --confirm options with skipping: |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
217 |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
218 $ hg --config ui.interactive=True falabala -c 6 --per-file --confirm <<EOF |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
219 > s |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
220 > EOF |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
221 diff a (1 of 2) [Yns?] s |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
222 [1] |
fa471151d269
extdiff: add --per-file and --confirm options
Ludovic Chabant <ludovic@chabant.com>
parents:
39707
diff
changeset
|
223 |
23680
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
224 issue4463: usage of command line configuration without additional quoting |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
225 |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
226 $ cat <<EOF >> $HGRCPATH |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
227 > [extdiff] |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
228 > cmd.4463a = echo |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
229 > opts.4463a = a-naked 'single quoted' "double quoted" |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
230 > 4463b = echo b-naked 'single quoted' "double quoted" |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
231 > echo = |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
232 > EOF |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
233 $ hg update -q -C 0 |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
234 $ echo a >> a |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
235 |
23680
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
236 $ hg --debug 4463a | grep '^running' |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
237 running 'echo a-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
238 running 'echo a-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) |
23680
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
239 $ hg --debug 4463b | grep '^running' |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
240 running 'echo b-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
241 running 'echo b-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) |
23680
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
242 $ hg --debug echo | grep '^running' |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
243 running '*echo* "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
244 running '*echo */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) |
23680
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
245 |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
246 (getting options from other than extdiff section) |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
247 |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
248 $ cat <<EOF >> $HGRCPATH |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
249 > [extdiff] |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
250 > # using diff-tools diffargs |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
251 > 4463b2 = echo |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
252 > # using merge-tools diffargs |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
253 > 4463b3 = echo |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
254 > # no diffargs |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
255 > 4463b4 = echo |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
256 > [diff-tools] |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
257 > 4463b2.diffargs = b2-naked 'single quoted' "double quoted" |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
258 > [merge-tools] |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
259 > 4463b3.diffargs = b3-naked 'single quoted' "double quoted" |
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
260 > EOF |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
261 |
23680
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
262 $ hg --debug 4463b2 | grep '^running' |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
263 running 'echo b2-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
264 running 'echo b2-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) |
23680
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
265 $ hg --debug 4463b3 | grep '^running' |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
266 running 'echo b3-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
267 running 'echo b3-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) |
23680
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
268 $ hg --debug 4463b4 | grep '^running' |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
269 running 'echo "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
270 running 'echo */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) |
23682
1642eb429536
windows: quote the specified string only when it has to be quoted
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23680
diff
changeset
|
271 $ hg --debug 4463b4 --option b4-naked --option 'being quoted' | grep '^running' |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
272 running 'echo b4-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
273 running "echo b4-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) (no-windows !) |
23682
1642eb429536
windows: quote the specified string only when it has to be quoted
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23680
diff
changeset
|
274 $ hg --debug extdiff -p echo --option echo-naked --option 'being quoted' | grep '^running' |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
275 running 'echo echo-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
276 running "echo echo-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) (no-windows !) |
23680
4075f2f8ea53
extdiff: avoid unexpected quoting arguments for external tools (issue4463)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
23172
diff
changeset
|
277 |
23969
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
278 $ touch 'sp ace' |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
279 $ hg add 'sp ace' |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
280 $ hg ci -m 'sp ace' |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
281 created new head |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
282 $ echo > 'sp ace' |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
283 |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
284 Test pre-72a89cf86fcd backward compatibility with half-baked manual quoting |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
285 |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
286 $ cat <<EOF >> $HGRCPATH |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
287 > [extdiff] |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
288 > odd = |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
289 > [merge-tools] |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
290 > odd.diffargs = --foo='\$clabel' '\$clabel' "--bar=\$clabel" "\$clabel" |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
291 > odd.executable = echo |
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
292 > EOF |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
293 |
32213
bc2e23354cc0
test-extdiff: fill in a missing Windows test
Matt Harbison <matt_harbison@yahoo.com>
parents:
30152
diff
changeset
|
294 $ hg --debug odd | grep '^running' |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
295 running '"*\\echo.exe" --foo="sp ace" "sp ace" --bar="sp ace" "sp ace"' in * (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
296 running "*/echo --foo='sp ace' 'sp ace' --bar='sp ace' 'sp ace'" in * (glob) (no-windows !) |
23969
01e5b7323a48
extdiff: reintroduce backward compatibility with manual quoting of parameters
Mads Kiilerich <madski@unity3d.com>
parents:
23683
diff
changeset
|
297 |
24108
d65ecb814fc0
shellquote: fix missing quotes for empty string
Yuya Nishihara <yuya@tcha.org>
parents:
23974
diff
changeset
|
298 Empty argument must be quoted |
d65ecb814fc0
shellquote: fix missing quotes for empty string
Yuya Nishihara <yuya@tcha.org>
parents:
23974
diff
changeset
|
299 |
d65ecb814fc0
shellquote: fix missing quotes for empty string
Yuya Nishihara <yuya@tcha.org>
parents:
23974
diff
changeset
|
300 $ cat <<EOF >> $HGRCPATH |
d65ecb814fc0
shellquote: fix missing quotes for empty string
Yuya Nishihara <yuya@tcha.org>
parents:
23974
diff
changeset
|
301 > [extdiff] |
d65ecb814fc0
shellquote: fix missing quotes for empty string
Yuya Nishihara <yuya@tcha.org>
parents:
23974
diff
changeset
|
302 > kdiff3 = echo |
d65ecb814fc0
shellquote: fix missing quotes for empty string
Yuya Nishihara <yuya@tcha.org>
parents:
23974
diff
changeset
|
303 > [merge-tools] |
d65ecb814fc0
shellquote: fix missing quotes for empty string
Yuya Nishihara <yuya@tcha.org>
parents:
23974
diff
changeset
|
304 > kdiff3.diffargs=--L1 \$plabel1 --L2 \$clabel \$parent \$child |
d65ecb814fc0
shellquote: fix missing quotes for empty string
Yuya Nishihara <yuya@tcha.org>
parents:
23974
diff
changeset
|
305 > EOF |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
306 |
46133
0a4d47f4337b
extdiff: add --from/--to and deprecate -r, as was done for `hg diff`
Martin von Zweigbergk <martinvonz@google.com>
parents:
46132
diff
changeset
|
307 $ hg --debug kdiff3 --from 0 | grep '^running' |
32214
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
308 running 'echo --L1 "@0" --L2 "" a.8a5febb7f867 a' in * (glob) (windows !) |
c05f71e57ec4
test-extdiff: deduplicate tests
Matt Harbison <matt_harbison@yahoo.com>
parents:
32213
diff
changeset
|
309 running "echo --L1 '@0' --L2 '' a.8a5febb7f867 a" in * (glob) (no-windows !) |
24108
d65ecb814fc0
shellquote: fix missing quotes for empty string
Yuya Nishihara <yuya@tcha.org>
parents:
23974
diff
changeset
|
310 |
16899
8149ff405c78
tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
15442
diff
changeset
|
311 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
312 Test extdiff of multiple files in tmp dir: |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
313 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
314 $ hg update -C 0 > /dev/null |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
315 $ echo changed > a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
316 $ echo changed > b |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
317 #if execbit |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
318 $ chmod +x b |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
319 #endif |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
320 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
321 Diff in working directory, before: |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
322 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
323 $ hg diff --git |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
324 diff --git a/a b/a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
325 --- a/a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
326 +++ b/a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
327 @@ -1,1 +1,1 @@ |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
328 -a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
329 +changed |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
330 diff --git a/b b/b |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
331 old mode 100644 (execbit !) |
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
332 new mode 100755 (execbit !) |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
333 --- a/b |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
334 +++ b/b |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
335 @@ -1,1 +1,1 @@ |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
336 -b |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
337 +changed |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
338 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
339 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
340 Edit with extdiff -p: |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
341 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
342 Prepare custom diff/edit tool: |
8065
66d0a03d3afc
extdiff: preserve execute-bit across copies (issue1562)
Patrick Mezard <pmezard@gmail.com>
parents:
7758
diff
changeset
|
343 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
344 $ cat > 'diff tool.py' << EOT |
32938
b6776b34e44e
tests: use $PYTHON in #! so we always use the right Python
Augie Fackler <augie@google.com>
parents:
32283
diff
changeset
|
345 > #!$PYTHON |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
346 > import time |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
347 > time.sleep(1) # avoid unchanged-timestamp problems |
36029
d83fc41dabf3
py3: replace file() with open() in test-extdiff.t
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33613
diff
changeset
|
348 > open('a/a', 'ab').write(b'edited\n') |
d83fc41dabf3
py3: replace file() with open() in test-extdiff.t
Pulkit Goyal <7895pulkit@gmail.com>
parents:
33613
diff
changeset
|
349 > open('a/b', 'ab').write(b'edited\n') |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
350 > EOT |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
351 |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
352 #if execbit |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
353 $ chmod +x 'diff tool.py' |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
354 #endif |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
355 |
12328
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
356 will change to /tmp/extdiff.TMP and populate directories a.TMP and a |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
357 and start tool |
b63f6422d2a7
tests: fix a bunch of pointless #s in unified tests
Matt Mackall <mpm@selenic.com>
parents:
12316
diff
changeset
|
358 |
33613
3b77d4787c18
tests: avoid unexpected result at invocation of *.py file on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
359 #if windows |
3b77d4787c18
tests: avoid unexpected result at invocation of *.py file on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
360 $ cat > 'diff tool.bat' << EOF |
39707
5abc47d4ca6b
tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents:
36268
diff
changeset
|
361 > @"$PYTHON" "`pwd`/diff tool.py" |
33613
3b77d4787c18
tests: avoid unexpected result at invocation of *.py file on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
362 > EOF |
3b77d4787c18
tests: avoid unexpected result at invocation of *.py file on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
363 $ hg extdiff -p "`pwd`/diff tool.bat" |
3b77d4787c18
tests: avoid unexpected result at invocation of *.py file on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
364 [1] |
3b77d4787c18
tests: avoid unexpected result at invocation of *.py file on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
365 #else |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
366 $ hg extdiff -p "`pwd`/diff tool.py" |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12304
diff
changeset
|
367 [1] |
33613
3b77d4787c18
tests: avoid unexpected result at invocation of *.py file on Windows
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
32938
diff
changeset
|
368 #endif |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
369 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
370 Diff in working directory, after: |
9956
6045a8c4dbbc
extdiff: respect --option in command aliases (issue949)
Sune Foldager <cryo@cyanite.org>
parents:
8212
diff
changeset
|
371 |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
372 $ hg diff --git |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
373 diff --git a/a b/a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
374 --- a/a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
375 +++ b/a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
376 @@ -1,1 +1,2 @@ |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
377 -a |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
378 +changed |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
379 +edited |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
380 diff --git a/b b/b |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
381 old mode 100644 (execbit !) |
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
382 new mode 100755 (execbit !) |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
383 --- a/b |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
384 +++ b/b |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
385 @@ -1,1 +1,2 @@ |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
386 -b |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
387 +changed |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
388 +edited |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
389 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
390 Test extdiff with --option: |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
391 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
392 $ hg extdiff -p echo -o this -c 1 |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
393 this "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) |
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
394 this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12304
diff
changeset
|
395 [1] |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
396 |
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
397 $ hg falabala -o this -c 1 |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
398 diffing this "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) |
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
399 diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12304
diff
changeset
|
400 [1] |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
401 |
23138
72a89cf86fcd
extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents:
22117
diff
changeset
|
402 Test extdiff's handling of options with spaces in them: |
72a89cf86fcd
extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents:
22117
diff
changeset
|
403 |
72a89cf86fcd
extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents:
22117
diff
changeset
|
404 $ hg edspace -c 1 |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
405 "name <user@example.com>" "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) |
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
406 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) |
23138
72a89cf86fcd
extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents:
22117
diff
changeset
|
407 [1] |
72a89cf86fcd
extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents:
22117
diff
changeset
|
408 |
72a89cf86fcd
extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents:
22117
diff
changeset
|
409 $ hg extdiff -p echo -o "name <user@example.com>" -c 1 |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
410 "name <user@example.com>" "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) |
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
411 name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) |
23138
72a89cf86fcd
extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents:
22117
diff
changeset
|
412 [1] |
72a89cf86fcd
extdiff: quote user-supplied options passed to shell
Michael Fyles <mf@vorston.net>
parents:
22117
diff
changeset
|
413 |
13660
a56c1b2bff18
Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents:
12640
diff
changeset
|
414 Test with revsets: |
a56c1b2bff18
Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents:
12640
diff
changeset
|
415 |
a56c1b2bff18
Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents:
12640
diff
changeset
|
416 $ hg extdif -p echo -c "rev(1)" |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
417 "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) |
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
418 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) |
12316
4134686b83e1
tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents:
12304
diff
changeset
|
419 [1] |
13660
a56c1b2bff18
Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents:
12640
diff
changeset
|
420 |
a56c1b2bff18
Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents:
12640
diff
changeset
|
421 $ hg extdif -p echo -r "0::1" |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
422 "*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) |
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
423 */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) |
13660
a56c1b2bff18
Updating hgext.extdiff to use revsets
David Wolever <david@wolever.net>
parents:
12640
diff
changeset
|
424 [1] |
14024 | 425 |
23150
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
426 Fallback to merge-tools.tool.executable|regkey |
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
427 $ mkdir dir |
32217
affd753ddaf1
extdiff: copy back files to the working directory if the size changed
Matt Harbison <matt_harbison@yahoo.com>
parents:
32216
diff
changeset
|
428 $ cat > 'dir/tool.sh' << 'EOF' |
23150
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
429 > #!/bin/sh |
32217
affd753ddaf1
extdiff: copy back files to the working directory if the size changed
Matt Harbison <matt_harbison@yahoo.com>
parents:
32216
diff
changeset
|
430 > # Mimic a tool that syncs all attrs, including mtime |
affd753ddaf1
extdiff: copy back files to the working directory if the size changed
Matt Harbison <matt_harbison@yahoo.com>
parents:
32216
diff
changeset
|
431 > cp $1/a $2/a |
affd753ddaf1
extdiff: copy back files to the working directory if the size changed
Matt Harbison <matt_harbison@yahoo.com>
parents:
32216
diff
changeset
|
432 > touch -r $1/a $2/a |
32283
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
433 > chmod +x $2/a |
23150
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
434 > echo "** custom diff **" |
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
435 > EOF |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
436 #if execbit |
23150
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
437 $ chmod +x dir/tool.sh |
32215
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
438 #endif |
f41cc3dd73d6
test-extdiff: narrow the range of an '#if execbit' block
Matt Harbison <matt_harbison@yahoo.com>
parents:
32214
diff
changeset
|
439 |
32216
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
440 Windows can't run *.sh directly, so create a shim executable that can be. |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
441 Without something executable, the next hg command will try to run `tl` instead |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
442 of $tool (and fail). |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
443 #if windows |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
444 $ cat > dir/tool.bat <<EOF |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
445 > @sh -c "`pwd`/dir/tool.sh %1 %2" |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
446 > EOF |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
447 $ tool=`pwd`/dir/tool.bat |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
448 #else |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
449 $ tool=`pwd`/dir/tool.sh |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
450 #endif |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
451 |
32217
affd753ddaf1
extdiff: copy back files to the working directory if the size changed
Matt Harbison <matt_harbison@yahoo.com>
parents:
32216
diff
changeset
|
452 $ cat a |
affd753ddaf1
extdiff: copy back files to the working directory if the size changed
Matt Harbison <matt_harbison@yahoo.com>
parents:
32216
diff
changeset
|
453 changed |
affd753ddaf1
extdiff: copy back files to the working directory if the size changed
Matt Harbison <matt_harbison@yahoo.com>
parents:
32216
diff
changeset
|
454 edited |
23150
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
455 $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool |
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
456 making snapshot of 2 files from rev * (glob) |
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
457 a |
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
458 b |
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
459 making snapshot of 2 files from working directory |
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
460 a |
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
461 b |
32216
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
462 running '$TESTTMP/a/dir/tool.bat a.* a' in */extdiff.* (glob) (windows !) |
98bb992bef19
test-extdiff: enable a previously failing test on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
32215
diff
changeset
|
463 running '$TESTTMP/a/dir/tool.sh a.* a' in */extdiff.* (glob) (no-windows !) |
23150
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
464 ** custom diff ** |
32217
affd753ddaf1
extdiff: copy back files to the working directory if the size changed
Matt Harbison <matt_harbison@yahoo.com>
parents:
32216
diff
changeset
|
465 file changed while diffing. Overwriting: $TESTTMP/a/a (src: */extdiff.*/a/a) (glob) |
23150
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
466 cleaning up temp directory |
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
467 [1] |
32217
affd753ddaf1
extdiff: copy back files to the working directory if the size changed
Matt Harbison <matt_harbison@yahoo.com>
parents:
32216
diff
changeset
|
468 $ cat a |
affd753ddaf1
extdiff: copy back files to the working directory if the size changed
Matt Harbison <matt_harbison@yahoo.com>
parents:
32216
diff
changeset
|
469 a |
23150
aff73c777b0b
extdiff: allow a preconfigured merge-tool to be invoked
Matt Harbison <matt_harbison@yahoo.com>
parents:
22117
diff
changeset
|
470 |
32283
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
471 #if execbit |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
472 $ [ -x a ] |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
473 |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
474 $ cat > 'dir/tool.sh' << 'EOF' |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
475 > #!/bin/sh |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
476 > chmod -x $2/a |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
477 > echo "** custom diff **" |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
478 > EOF |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
479 |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
480 $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
481 making snapshot of 2 files from rev * (glob) |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
482 a |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
483 b |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
484 making snapshot of 2 files from working directory |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
485 a |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
486 b |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
487 running '$TESTTMP/a/dir/tool.sh a.* a' in */extdiff.* (glob) |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
488 ** custom diff ** |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
489 file changed while diffing. Overwriting: $TESTTMP/a/a (src: */extdiff.*/a/a) (glob) |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
490 cleaning up temp directory |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
491 [1] |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
492 |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
493 $ [ -x a ] |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
494 [1] |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
495 #endif |
8a1ff5ed620e
extdiff: copy back execbit-only changes to the working directory
Matt Harbison <matt_harbison@yahoo.com>
parents:
32217
diff
changeset
|
496 |
14021
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
497 $ cd .. |
12304
41dd368b6fe8
tests: unify test-extdiff
Adrian Buehlmann <adrian@cadifra.com>
parents:
10775
diff
changeset
|
498 |
16899
8149ff405c78
tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
15442
diff
changeset
|
499 #if symlink |
8149ff405c78
tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
15442
diff
changeset
|
500 |
14024 | 501 Test symlinks handling (issue1909) |
502 | |
14021
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
503 $ hg init testsymlinks |
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
504 $ cd testsymlinks |
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
505 $ echo a > a |
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
506 $ hg ci -Am adda |
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
507 adding a |
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
508 $ echo a >> a |
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
509 $ ln -s missing linka |
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
510 $ hg add linka |
46133
0a4d47f4337b
extdiff: add --from/--to and deprecate -r, as was done for `hg diff`
Martin von Zweigbergk <martinvonz@google.com>
parents:
46132
diff
changeset
|
511 $ hg falabala --from 0 --traceback |
14021
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
512 diffing testsymlinks.07f494440405 testsymlinks |
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
513 [1] |
3eb632d9cf42
extdiff: fix broken symlinks handling (issue1909)
Patrick Mezard <pmezard@gmail.com>
parents:
12640
diff
changeset
|
514 $ cd .. |
16899
8149ff405c78
tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
15442
diff
changeset
|
515 |
8149ff405c78
tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents:
15442
diff
changeset
|
516 #endif |
29630
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
517 |
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
518 Test handling of non-ASCII paths in generated docstrings (issue5301) |
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
519 |
36268
be5a6fe3643a
py3: make test-extdiff.t pass on Python 3
Yuya Nishihara <yuya@tcha.org>
parents:
36029
diff
changeset
|
520 >>> with open("u", "wb") as f: |
be5a6fe3643a
py3: make test-extdiff.t pass on Python 3
Yuya Nishihara <yuya@tcha.org>
parents:
36029
diff
changeset
|
521 ... n = f.write(b"\xa5\xa5") |
29630
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
522 $ U=`cat u` |
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
523 |
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
524 $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help -k xyzzy |
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
525 abort: no matches |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29723
diff
changeset
|
526 (try 'hg help' for a list of topics) |
46261
c9b2a4d69e66
errors: raise InputError when non-existent help section requested
Martin von Zweigbergk <martinvonz@google.com>
parents:
46133
diff
changeset
|
527 [10] |
29630
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
528 |
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
529 $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help td > /dev/null |
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
530 |
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
531 $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help -k xyzzy |
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
532 abort: no matches |
29974
7109d5ddeb0c
help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents:
29723
diff
changeset
|
533 (try 'hg help' for a list of topics) |
46261
c9b2a4d69e66
errors: raise InputError when non-existent help section requested
Martin von Zweigbergk <martinvonz@google.com>
parents:
46133
diff
changeset
|
534 [10] |
29630
67b180c0e263
extdiff: escape path for docstring (issue5301)
Matt Mackall <mpm@selenic.com>
parents:
28053
diff
changeset
|
535 |
29723
91b2f2176395
extdiff: isolate path variable of saved command to independent paragraph
Yuya Nishihara <yuya@tcha.org>
parents:
29630
diff
changeset
|
536 $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help td \ |
52099
31076a2301f1
py-3-13: stabilize the docstring output across all supported Python versions
Raphaël Gomès <rgomes@octobus.net>
parents:
52023
diff
changeset
|
537 > | grep "^ '" |
31076a2301f1
py-3-13: stabilize the docstring output across all supported Python versions
Raphaël Gomès <rgomes@octobus.net>
parents:
52023
diff
changeset
|
538 '\xa5\xa5' |
43790
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
539 |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
540 $ cd $TESTTMP |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
541 |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
542 Test that diffing a single file works, even if that file is new |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
543 |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
544 $ hg init testsinglefile |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
545 $ cd testsinglefile |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
546 $ echo a > a |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
547 $ hg add a |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
548 $ hg falabala |
43822
fb03cd716f50
tests: stabilize test-extdiff.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
43790
diff
changeset
|
549 diffing nul "*\\a" (glob) (windows !) |
fb03cd716f50
tests: stabilize test-extdiff.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
43790
diff
changeset
|
550 diffing /dev/null */a (glob) (no-windows !) |
43790
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
551 [1] |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
552 $ hg ci -qm a |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
553 $ hg falabala -c . |
43822
fb03cd716f50
tests: stabilize test-extdiff.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
43790
diff
changeset
|
554 diffing nul "*\\a" (glob) (windows !) |
fb03cd716f50
tests: stabilize test-extdiff.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
43790
diff
changeset
|
555 diffing /dev/null */a (glob) (no-windows !) |
43790
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
556 [1] |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
557 $ echo a >> a |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
558 $ hg falabala |
43822
fb03cd716f50
tests: stabilize test-extdiff.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
43790
diff
changeset
|
559 diffing "*\\a" "*\\a" (glob) (windows !) |
fb03cd716f50
tests: stabilize test-extdiff.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
43790
diff
changeset
|
560 diffing */a */a (glob) (no-windows !) |
43790
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
561 [1] |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
562 $ hg ci -qm 2a |
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
563 $ hg falabala -c . |
43822
fb03cd716f50
tests: stabilize test-extdiff.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
43790
diff
changeset
|
564 diffing "*\\a" "*\\a" (glob) (windows !) |
fb03cd716f50
tests: stabilize test-extdiff.t on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents:
43790
diff
changeset
|
565 diffing */a */a (glob) (no-windows !) |
43790
765a9c299c44
py3: make a pycompat.osdevnull, use it in extdiff
Kyle Lippincott <spectral@google.com>
parents:
41809
diff
changeset
|
566 [1] |