Show More
@@ -1,415 +1,378 b'' | |||||
1 | $ echo "[extensions]" >> $HGRCPATH |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
2 | $ echo "extdiff=" >> $HGRCPATH |
|
2 | $ echo "extdiff=" >> $HGRCPATH | |
3 |
|
3 | |||
4 | $ hg init a |
|
4 | $ hg init a | |
5 | $ cd a |
|
5 | $ cd a | |
6 | $ echo a > a |
|
6 | $ echo a > a | |
7 | $ echo b > b |
|
7 | $ echo b > b | |
8 | $ hg add |
|
8 | $ hg add | |
9 | adding a |
|
9 | adding a | |
10 | adding b |
|
10 | adding b | |
11 |
|
11 | |||
12 | Should diff cloned directories: |
|
12 | Should diff cloned directories: | |
13 |
|
13 | |||
14 | $ hg extdiff -o -r $opt |
|
14 | $ hg extdiff -o -r $opt | |
15 | Only in a: a |
|
15 | Only in a: a | |
16 | Only in a: b |
|
16 | Only in a: b | |
17 | [1] |
|
17 | [1] | |
18 |
|
18 | |||
19 | $ cat <<EOF >> $HGRCPATH |
|
19 | $ cat <<EOF >> $HGRCPATH | |
20 | > [extdiff] |
|
20 | > [extdiff] | |
21 | > cmd.falabala = echo |
|
21 | > cmd.falabala = echo | |
22 | > opts.falabala = diffing |
|
22 | > opts.falabala = diffing | |
23 | > cmd.edspace = echo |
|
23 | > cmd.edspace = echo | |
24 | > opts.edspace = "name <user@example.com>" |
|
24 | > opts.edspace = "name <user@example.com>" | |
25 | > EOF |
|
25 | > EOF | |
26 |
|
26 | |||
27 | $ hg falabala |
|
27 | $ hg falabala | |
28 | diffing a.000000000000 a |
|
28 | diffing a.000000000000 a | |
29 | [1] |
|
29 | [1] | |
30 |
|
30 | |||
31 | $ hg help falabala |
|
31 | $ hg help falabala | |
32 | hg falabala [OPTION]... [FILE]... |
|
32 | hg falabala [OPTION]... [FILE]... | |
33 |
|
33 | |||
34 | use external program to diff repository (or selected files) |
|
34 | use external program to diff repository (or selected files) | |
35 |
|
35 | |||
36 | Show differences between revisions for the specified files, using the |
|
36 | Show differences between revisions for the specified files, using the | |
37 | following program: |
|
37 | following program: | |
38 |
|
38 | |||
39 | 'echo' |
|
39 | 'echo' | |
40 |
|
40 | |||
41 | When two revision arguments are given, then changes are shown between |
|
41 | When two revision arguments are given, then changes are shown between | |
42 | those revisions. If only one revision is specified then that revision is |
|
42 | those revisions. If only one revision is specified then that revision is | |
43 | compared to the working directory, and, when no revisions are specified, |
|
43 | compared to the working directory, and, when no revisions are specified, | |
44 | the working directory files are compared to its parent. |
|
44 | the working directory files are compared to its parent. | |
45 |
|
45 | |||
46 | options ([+] can be repeated): |
|
46 | options ([+] can be repeated): | |
47 |
|
47 | |||
48 | -o --option OPT [+] pass option to comparison program |
|
48 | -o --option OPT [+] pass option to comparison program | |
49 | -r --rev REV [+] revision |
|
49 | -r --rev REV [+] revision | |
50 | -c --change REV change made by revision |
|
50 | -c --change REV change made by revision | |
51 | --patch compare patches for two revisions |
|
51 | --patch compare patches for two revisions | |
52 | -I --include PATTERN [+] include names matching the given patterns |
|
52 | -I --include PATTERN [+] include names matching the given patterns | |
53 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
53 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
54 | -S --subrepos recurse into subrepositories |
|
54 | -S --subrepos recurse into subrepositories | |
55 |
|
55 | |||
56 | (some details hidden, use --verbose to show complete help) |
|
56 | (some details hidden, use --verbose to show complete help) | |
57 |
|
57 | |||
58 | $ hg ci -d '0 0' -mtest1 |
|
58 | $ hg ci -d '0 0' -mtest1 | |
59 |
|
59 | |||
60 | $ echo b >> a |
|
60 | $ echo b >> a | |
61 | $ hg ci -d '1 0' -mtest2 |
|
61 | $ hg ci -d '1 0' -mtest2 | |
62 |
|
62 | |||
63 | Should diff cloned files directly: |
|
63 | Should diff cloned files directly: | |
64 |
|
64 | |||
65 | #if windows |
|
|||
66 | $ hg falabala -r 0:1 |
|
65 | $ hg falabala -r 0:1 | |
67 | diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) |
|
66 | diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) | |
|
67 | diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) | |||
68 | [1] |
|
68 | [1] | |
69 | #else |
|
|||
70 | $ hg falabala -r 0:1 |
|
|||
71 | diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
|||
72 | [1] |
|
|||
73 | #endif |
|
|||
74 |
|
|
69 | ||
75 | Specifying an empty revision should abort. |
|
70 | Specifying an empty revision should abort. | |
76 |
|
71 | |||
77 | $ hg extdiff -p diff --patch --rev 'ancestor()' --rev 1 |
|
72 | $ hg extdiff -p diff --patch --rev 'ancestor()' --rev 1 | |
78 | abort: empty revision on one side of range |
|
73 | abort: empty revision on one side of range | |
79 | [255] |
|
74 | [255] | |
80 |
|
75 | |||
81 | Test diff during merge: |
|
76 | Test diff during merge: | |
82 |
|
77 | |||
83 | $ hg update -C 0 |
|
78 | $ hg update -C 0 | |
84 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
79 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
85 | $ echo c >> c |
|
80 | $ echo c >> c | |
86 | $ hg add c |
|
81 | $ hg add c | |
87 | $ hg ci -m "new branch" -d '1 0' |
|
82 | $ hg ci -m "new branch" -d '1 0' | |
88 | created new head |
|
83 | created new head | |
89 | $ hg merge 1 |
|
84 | $ hg merge 1 | |
90 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
85 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
91 | (branch merge, don't forget to commit) |
|
86 | (branch merge, don't forget to commit) | |
92 |
|
87 | |||
93 | Should diff cloned file against wc file: |
|
88 | Should diff cloned file against wc file: | |
94 |
|
89 | |||
95 | #if windows |
|
|||
96 | $ hg falabala |
|
90 | $ hg falabala | |
97 | diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "*\\a\\a" (glob) |
|
91 | diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "*\\a\\a" (glob) (windows !) | |
|
92 | diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob) (no-windows !) | |||
98 | [1] |
|
93 | [1] | |
99 | #else |
|
|||
100 | $ hg falabala |
|
|||
101 | diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob) |
|
|||
102 | [1] |
|
|||
103 | #endif |
|
|||
104 |
|
94 | |||
105 |
|
95 | |||
106 | Test --change option: |
|
96 | Test --change option: | |
107 |
|
97 | |||
108 | $ hg ci -d '2 0' -mtest3 |
|
98 | $ hg ci -d '2 0' -mtest3 | |
109 | #if windows |
|
99 | ||
110 | $ hg falabala -c 1 |
|
100 | $ hg falabala -c 1 | |
111 | diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) |
|
101 | diffing "*\\extdiff.*\\a.8a5febb7f867\\a" "a.34eed99112ab\\a" (glob) (windows !) | |
|
102 | diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) (no-windows !) | |||
112 | [1] |
|
103 | [1] | |
113 | #else |
|
|||
114 | $ hg falabala -c 1 |
|
|||
115 | diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
|||
116 | [1] |
|
|||
117 | #endif |
|
|||
118 |
|
104 | |||
119 | Check diff are made from the first parent: |
|
105 | Check diff are made from the first parent: | |
120 |
|
106 | |||
121 | #if windows |
|
|||
122 | $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code" |
|
107 | $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code" | |
123 | diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "a.46c0e4daeb72\\a" (glob) |
|
108 | diffing "*\\extdiff.*\\a.2a13a4d2da36\\a" "a.46c0e4daeb72\\a" (glob) (windows !) | |
|
109 | diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob) (no-windows !) | |||
124 | diff-like tools yield a non-zero exit code |
|
110 | diff-like tools yield a non-zero exit code | |
125 | #else |
|
|||
126 | $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code" |
|
|||
127 | diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob) |
|
|||
128 | diff-like tools yield a non-zero exit code |
|
|||
129 | #endif |
|
|||
130 |
|
111 | |||
131 | issue3153: ensure using extdiff with removed subrepos doesn't crash: |
|
112 | issue3153: ensure using extdiff with removed subrepos doesn't crash: | |
132 |
|
113 | |||
133 | $ hg init suba |
|
114 | $ hg init suba | |
134 | $ cd suba |
|
115 | $ cd suba | |
135 | $ echo suba > suba |
|
116 | $ echo suba > suba | |
136 | $ hg add |
|
117 | $ hg add | |
137 | adding suba |
|
118 | adding suba | |
138 | $ hg ci -m "adding suba file" |
|
119 | $ hg ci -m "adding suba file" | |
139 | $ cd .. |
|
120 | $ cd .. | |
140 | $ echo suba=suba > .hgsub |
|
121 | $ echo suba=suba > .hgsub | |
141 | $ hg add |
|
122 | $ hg add | |
142 | adding .hgsub |
|
123 | adding .hgsub | |
143 | $ hg ci -Sm "adding subrepo" |
|
124 | $ hg ci -Sm "adding subrepo" | |
144 | $ echo > .hgsub |
|
125 | $ echo > .hgsub | |
145 | $ hg ci -m "removing subrepo" |
|
126 | $ hg ci -m "removing subrepo" | |
146 | $ hg falabala -r 4 -r 5 -S |
|
127 | $ hg falabala -r 4 -r 5 -S | |
147 | diffing a.398e36faf9c6 a.5ab95fb166c4 |
|
128 | diffing a.398e36faf9c6 a.5ab95fb166c4 | |
148 | [1] |
|
129 | [1] | |
149 |
|
130 | |||
150 | issue4463: usage of command line configuration without additional quoting |
|
131 | issue4463: usage of command line configuration without additional quoting | |
151 |
|
132 | |||
152 | $ cat <<EOF >> $HGRCPATH |
|
133 | $ cat <<EOF >> $HGRCPATH | |
153 | > [extdiff] |
|
134 | > [extdiff] | |
154 | > cmd.4463a = echo |
|
135 | > cmd.4463a = echo | |
155 | > opts.4463a = a-naked 'single quoted' "double quoted" |
|
136 | > opts.4463a = a-naked 'single quoted' "double quoted" | |
156 | > 4463b = echo b-naked 'single quoted' "double quoted" |
|
137 | > 4463b = echo b-naked 'single quoted' "double quoted" | |
157 | > echo = |
|
138 | > echo = | |
158 | > EOF |
|
139 | > EOF | |
159 | $ hg update -q -C 0 |
|
140 | $ hg update -q -C 0 | |
160 | $ echo a >> a |
|
141 | $ echo a >> a | |
161 | #if windows |
|
142 | ||
162 | $ hg --debug 4463a | grep '^running' |
|
143 | $ hg --debug 4463a | grep '^running' | |
163 | running 'echo a-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) |
|
144 | running 'echo a-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) | |
|
145 | running 'echo a-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) | |||
164 | $ hg --debug 4463b | grep '^running' |
|
146 | $ hg --debug 4463b | grep '^running' | |
165 | running 'echo b-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) |
|
147 | running 'echo b-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) | |
|
148 | running 'echo b-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) | |||
166 | $ hg --debug echo | grep '^running' |
|
149 | $ hg --debug echo | grep '^running' | |
167 | running '*echo* "*\\a" "*\\a"' in */extdiff.* (glob) |
|
150 | running '*echo* "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) | |
168 | #else |
|
151 | running '*echo */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) | |
169 | $ hg --debug 4463a | grep '^running' |
|
|||
170 | running 'echo a-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) |
|
|||
171 | $ hg --debug 4463b | grep '^running' |
|
|||
172 | running 'echo b-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) |
|
|||
173 | $ hg --debug echo | grep '^running' |
|
|||
174 | running '*echo */a $TESTTMP/a/a' in */extdiff.* (glob) |
|
|||
175 | #endif |
|
|||
176 |
|
|
152 | ||
177 | (getting options from other than extdiff section) |
|
153 | (getting options from other than extdiff section) | |
178 |
|
154 | |||
179 | $ cat <<EOF >> $HGRCPATH |
|
155 | $ cat <<EOF >> $HGRCPATH | |
180 | > [extdiff] |
|
156 | > [extdiff] | |
181 | > # using diff-tools diffargs |
|
157 | > # using diff-tools diffargs | |
182 | > 4463b2 = echo |
|
158 | > 4463b2 = echo | |
183 | > # using merge-tools diffargs |
|
159 | > # using merge-tools diffargs | |
184 | > 4463b3 = echo |
|
160 | > 4463b3 = echo | |
185 | > # no diffargs |
|
161 | > # no diffargs | |
186 | > 4463b4 = echo |
|
162 | > 4463b4 = echo | |
187 | > [diff-tools] |
|
163 | > [diff-tools] | |
188 | > 4463b2.diffargs = b2-naked 'single quoted' "double quoted" |
|
164 | > 4463b2.diffargs = b2-naked 'single quoted' "double quoted" | |
189 | > [merge-tools] |
|
165 | > [merge-tools] | |
190 | > 4463b3.diffargs = b3-naked 'single quoted' "double quoted" |
|
166 | > 4463b3.diffargs = b3-naked 'single quoted' "double quoted" | |
191 | > EOF |
|
167 | > EOF | |
192 | #if windows |
|
168 | ||
193 | $ hg --debug 4463b2 | grep '^running' |
|
169 | $ hg --debug 4463b2 | grep '^running' | |
194 | running 'echo b2-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) |
|
170 | running 'echo b2-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) | |
|
171 | running 'echo b2-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) | |||
195 | $ hg --debug 4463b3 | grep '^running' |
|
172 | $ hg --debug 4463b3 | grep '^running' | |
196 | running 'echo b3-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) |
|
173 | running 'echo b3-naked \'single quoted\' "double quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) | |
|
174 | running 'echo b3-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) | |||
197 | $ hg --debug 4463b4 | grep '^running' |
|
175 | $ hg --debug 4463b4 | grep '^running' | |
198 | running 'echo "*\\a" "*\\a"' in */extdiff.* (glob) |
|
176 | running 'echo "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) | |
|
177 | running 'echo */a $TESTTMP/a/a' in */extdiff.* (glob) (no-windows !) | |||
199 | $ hg --debug 4463b4 --option b4-naked --option 'being quoted' | grep '^running' |
|
178 | $ hg --debug 4463b4 --option b4-naked --option 'being quoted' | grep '^running' | |
200 | running 'echo b4-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) |
|
179 | running 'echo b4-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) | |
|
180 | running "echo b4-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) (no-windows !) | |||
201 | $ hg --debug extdiff -p echo --option echo-naked --option 'being quoted' | grep '^running' |
|
181 | $ hg --debug extdiff -p echo --option echo-naked --option 'being quoted' | grep '^running' | |
202 | running 'echo echo-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) |
|
182 | running 'echo echo-naked "being quoted" "*\\a" "*\\a"' in */extdiff.* (glob) (windows !) | |
203 | #else |
|
183 | running "echo echo-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) (no-windows !) | |
204 | $ hg --debug 4463b2 | grep '^running' |
|
|||
205 | running 'echo b2-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) |
|
|||
206 | $ hg --debug 4463b3 | grep '^running' |
|
|||
207 | running 'echo b3-naked \'single quoted\' "double quoted" */a $TESTTMP/a/a' in */extdiff.* (glob) |
|
|||
208 | $ hg --debug 4463b4 | grep '^running' |
|
|||
209 | running 'echo */a $TESTTMP/a/a' in */extdiff.* (glob) |
|
|||
210 | $ hg --debug 4463b4 --option b4-naked --option 'being quoted' | grep '^running' |
|
|||
211 | running "echo b4-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) |
|
|||
212 | $ hg --debug extdiff -p echo --option echo-naked --option 'being quoted' | grep '^running' |
|
|||
213 | running "echo echo-naked 'being quoted' */a $TESTTMP/a/a" in */extdiff.* (glob) |
|
|||
214 | #endif |
|
|||
215 |
|
|
184 | ||
216 | $ touch 'sp ace' |
|
185 | $ touch 'sp ace' | |
217 | $ hg add 'sp ace' |
|
186 | $ hg add 'sp ace' | |
218 | $ hg ci -m 'sp ace' |
|
187 | $ hg ci -m 'sp ace' | |
219 | created new head |
|
188 | created new head | |
220 | $ echo > 'sp ace' |
|
189 | $ echo > 'sp ace' | |
221 |
|
190 | |||
222 | Test pre-72a89cf86fcd backward compatibility with half-baked manual quoting |
|
191 | Test pre-72a89cf86fcd backward compatibility with half-baked manual quoting | |
223 |
|
192 | |||
224 | $ cat <<EOF >> $HGRCPATH |
|
193 | $ cat <<EOF >> $HGRCPATH | |
225 | > [extdiff] |
|
194 | > [extdiff] | |
226 | > odd = |
|
195 | > odd = | |
227 | > [merge-tools] |
|
196 | > [merge-tools] | |
228 | > odd.diffargs = --foo='\$clabel' '\$clabel' "--bar=\$clabel" "\$clabel" |
|
197 | > odd.diffargs = --foo='\$clabel' '\$clabel' "--bar=\$clabel" "\$clabel" | |
229 | > odd.executable = echo |
|
198 | > odd.executable = echo | |
230 | > EOF |
|
199 | > EOF | |
231 | #if windows |
|
200 | ||
232 | $ hg --debug odd | grep '^running' |
|
201 | $ hg --debug odd | grep '^running' | |
233 | running '"*\\echo.exe" --foo="sp ace" "sp ace" --bar="sp ace" "sp ace"' in * (glob) |
|
202 | running '"*\\echo.exe" --foo="sp ace" "sp ace" --bar="sp ace" "sp ace"' in * (glob) (windows !) | |
234 | #else |
|
203 | running "*/echo --foo='sp ace' 'sp ace' --bar='sp ace' 'sp ace'" in * (glob) (no-windows !) | |
235 | $ hg --debug odd | grep '^running' |
|
|||
236 | running "*/echo --foo='sp ace' 'sp ace' --bar='sp ace' 'sp ace'" in * (glob) |
|
|||
237 | #endif |
|
|||
238 |
|
|
204 | ||
239 | Empty argument must be quoted |
|
205 | Empty argument must be quoted | |
240 |
|
206 | |||
241 | $ cat <<EOF >> $HGRCPATH |
|
207 | $ cat <<EOF >> $HGRCPATH | |
242 | > [extdiff] |
|
208 | > [extdiff] | |
243 | > kdiff3 = echo |
|
209 | > kdiff3 = echo | |
244 | > [merge-tools] |
|
210 | > [merge-tools] | |
245 | > kdiff3.diffargs=--L1 \$plabel1 --L2 \$clabel \$parent \$child |
|
211 | > kdiff3.diffargs=--L1 \$plabel1 --L2 \$clabel \$parent \$child | |
246 | > EOF |
|
212 | > EOF | |
247 | #if windows |
|
213 | ||
248 | $ hg --debug kdiff3 -r0 | grep '^running' |
|
214 | $ hg --debug kdiff3 -r0 | grep '^running' | |
249 | running 'echo --L1 "@0" --L2 "" a.8a5febb7f867 a' in * (glob) |
|
215 | running 'echo --L1 "@0" --L2 "" a.8a5febb7f867 a' in * (glob) (windows !) | |
250 | #else |
|
216 | running "echo --L1 '@0' --L2 '' a.8a5febb7f867 a" in * (glob) (no-windows !) | |
251 | $ hg --debug kdiff3 -r0 | grep '^running' |
|
|||
252 | running "echo --L1 '@0' --L2 '' a.8a5febb7f867 a" in * (glob) |
|
|||
253 | #endif |
|
|||
254 |
|
|
217 | ||
255 | #if execbit |
|
218 | #if execbit | |
256 |
|
219 | |||
257 | Test extdiff of multiple files in tmp dir: |
|
220 | Test extdiff of multiple files in tmp dir: | |
258 |
|
221 | |||
259 | $ hg update -C 0 > /dev/null |
|
222 | $ hg update -C 0 > /dev/null | |
260 | $ echo changed > a |
|
223 | $ echo changed > a | |
261 | $ echo changed > b |
|
224 | $ echo changed > b | |
262 | $ chmod +x b |
|
225 | $ chmod +x b | |
263 |
|
226 | |||
264 | Diff in working directory, before: |
|
227 | Diff in working directory, before: | |
265 |
|
228 | |||
266 | $ hg diff --git |
|
229 | $ hg diff --git | |
267 | diff --git a/a b/a |
|
230 | diff --git a/a b/a | |
268 | --- a/a |
|
231 | --- a/a | |
269 | +++ b/a |
|
232 | +++ b/a | |
270 | @@ -1,1 +1,1 @@ |
|
233 | @@ -1,1 +1,1 @@ | |
271 | -a |
|
234 | -a | |
272 | +changed |
|
235 | +changed | |
273 | diff --git a/b b/b |
|
236 | diff --git a/b b/b | |
274 | old mode 100644 |
|
237 | old mode 100644 | |
275 | new mode 100755 |
|
238 | new mode 100755 | |
276 | --- a/b |
|
239 | --- a/b | |
277 | +++ b/b |
|
240 | +++ b/b | |
278 | @@ -1,1 +1,1 @@ |
|
241 | @@ -1,1 +1,1 @@ | |
279 | -b |
|
242 | -b | |
280 | +changed |
|
243 | +changed | |
281 |
|
244 | |||
282 |
|
245 | |||
283 | Edit with extdiff -p: |
|
246 | Edit with extdiff -p: | |
284 |
|
247 | |||
285 | Prepare custom diff/edit tool: |
|
248 | Prepare custom diff/edit tool: | |
286 |
|
249 | |||
287 | $ cat > 'diff tool.py' << EOT |
|
250 | $ cat > 'diff tool.py' << EOT | |
288 | > #!/usr/bin/env python |
|
251 | > #!/usr/bin/env python | |
289 | > import time |
|
252 | > import time | |
290 | > time.sleep(1) # avoid unchanged-timestamp problems |
|
253 | > time.sleep(1) # avoid unchanged-timestamp problems | |
291 | > file('a/a', 'ab').write('edited\n') |
|
254 | > file('a/a', 'ab').write('edited\n') | |
292 | > file('a/b', 'ab').write('edited\n') |
|
255 | > file('a/b', 'ab').write('edited\n') | |
293 | > EOT |
|
256 | > EOT | |
294 |
|
257 | |||
295 | $ chmod +x 'diff tool.py' |
|
258 | $ chmod +x 'diff tool.py' | |
296 |
|
259 | |||
297 | will change to /tmp/extdiff.TMP and populate directories a.TMP and a |
|
260 | will change to /tmp/extdiff.TMP and populate directories a.TMP and a | |
298 | and start tool |
|
261 | and start tool | |
299 |
|
262 | |||
300 | $ hg extdiff -p "`pwd`/diff tool.py" |
|
263 | $ hg extdiff -p "`pwd`/diff tool.py" | |
301 | [1] |
|
264 | [1] | |
302 |
|
265 | |||
303 | Diff in working directory, after: |
|
266 | Diff in working directory, after: | |
304 |
|
267 | |||
305 | $ hg diff --git |
|
268 | $ hg diff --git | |
306 | diff --git a/a b/a |
|
269 | diff --git a/a b/a | |
307 | --- a/a |
|
270 | --- a/a | |
308 | +++ b/a |
|
271 | +++ b/a | |
309 | @@ -1,1 +1,2 @@ |
|
272 | @@ -1,1 +1,2 @@ | |
310 | -a |
|
273 | -a | |
311 | +changed |
|
274 | +changed | |
312 | +edited |
|
275 | +edited | |
313 | diff --git a/b b/b |
|
276 | diff --git a/b b/b | |
314 | old mode 100644 |
|
277 | old mode 100644 | |
315 | new mode 100755 |
|
278 | new mode 100755 | |
316 | --- a/b |
|
279 | --- a/b | |
317 | +++ b/b |
|
280 | +++ b/b | |
318 | @@ -1,1 +1,2 @@ |
|
281 | @@ -1,1 +1,2 @@ | |
319 | -b |
|
282 | -b | |
320 | +changed |
|
283 | +changed | |
321 | +edited |
|
284 | +edited | |
322 |
|
285 | |||
323 | Test extdiff with --option: |
|
286 | Test extdiff with --option: | |
324 |
|
287 | |||
325 | $ hg extdiff -p echo -o this -c 1 |
|
288 | $ hg extdiff -p echo -o this -c 1 | |
326 | this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
289 | this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
327 | [1] |
|
290 | [1] | |
328 |
|
291 | |||
329 | $ hg falabala -o this -c 1 |
|
292 | $ hg falabala -o this -c 1 | |
330 | diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
293 | diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
331 | [1] |
|
294 | [1] | |
332 |
|
295 | |||
333 | Test extdiff's handling of options with spaces in them: |
|
296 | Test extdiff's handling of options with spaces in them: | |
334 |
|
297 | |||
335 | $ hg edspace -c 1 |
|
298 | $ hg edspace -c 1 | |
336 | name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
299 | name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
337 | [1] |
|
300 | [1] | |
338 |
|
301 | |||
339 | $ hg extdiff -p echo -o "name <user@example.com>" -c 1 |
|
302 | $ hg extdiff -p echo -o "name <user@example.com>" -c 1 | |
340 | name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
303 | name <user@example.com> */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
341 | [1] |
|
304 | [1] | |
342 |
|
305 | |||
343 | Test with revsets: |
|
306 | Test with revsets: | |
344 |
|
307 | |||
345 | $ hg extdif -p echo -c "rev(1)" |
|
308 | $ hg extdif -p echo -c "rev(1)" | |
346 | */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
309 | */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
347 | [1] |
|
310 | [1] | |
348 |
|
311 | |||
349 | $ hg extdif -p echo -r "0::1" |
|
312 | $ hg extdif -p echo -r "0::1" | |
350 | */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
313 | */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
351 | [1] |
|
314 | [1] | |
352 |
|
315 | |||
353 | Fallback to merge-tools.tool.executable|regkey |
|
316 | Fallback to merge-tools.tool.executable|regkey | |
354 | $ mkdir dir |
|
317 | $ mkdir dir | |
355 | $ cat > 'dir/tool.sh' << EOF |
|
318 | $ cat > 'dir/tool.sh' << EOF | |
356 | > #!/bin/sh |
|
319 | > #!/bin/sh | |
357 | > echo "** custom diff **" |
|
320 | > echo "** custom diff **" | |
358 | > EOF |
|
321 | > EOF | |
359 | $ chmod +x dir/tool.sh |
|
322 | $ chmod +x dir/tool.sh | |
360 | $ tool=`pwd`/dir/tool.sh |
|
323 | $ tool=`pwd`/dir/tool.sh | |
361 | $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool |
|
324 | $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool | |
362 | making snapshot of 2 files from rev * (glob) |
|
325 | making snapshot of 2 files from rev * (glob) | |
363 | a |
|
326 | a | |
364 | b |
|
327 | b | |
365 | making snapshot of 2 files from working directory |
|
328 | making snapshot of 2 files from working directory | |
366 | a |
|
329 | a | |
367 | b |
|
330 | b | |
368 | running '$TESTTMP/a/dir/tool.sh a.* a' in */extdiff.* (glob) |
|
331 | running '$TESTTMP/a/dir/tool.sh a.* a' in */extdiff.* (glob) | |
369 | ** custom diff ** |
|
332 | ** custom diff ** | |
370 | cleaning up temp directory |
|
333 | cleaning up temp directory | |
371 | [1] |
|
334 | [1] | |
372 |
|
335 | |||
373 | $ cd .. |
|
336 | $ cd .. | |
374 |
|
337 | |||
375 | #endif |
|
338 | #endif | |
376 |
|
339 | |||
377 | #if symlink |
|
340 | #if symlink | |
378 |
|
341 | |||
379 | Test symlinks handling (issue1909) |
|
342 | Test symlinks handling (issue1909) | |
380 |
|
343 | |||
381 | $ hg init testsymlinks |
|
344 | $ hg init testsymlinks | |
382 | $ cd testsymlinks |
|
345 | $ cd testsymlinks | |
383 | $ echo a > a |
|
346 | $ echo a > a | |
384 | $ hg ci -Am adda |
|
347 | $ hg ci -Am adda | |
385 | adding a |
|
348 | adding a | |
386 | $ echo a >> a |
|
349 | $ echo a >> a | |
387 | $ ln -s missing linka |
|
350 | $ ln -s missing linka | |
388 | $ hg add linka |
|
351 | $ hg add linka | |
389 | $ hg falabala -r 0 --traceback |
|
352 | $ hg falabala -r 0 --traceback | |
390 | diffing testsymlinks.07f494440405 testsymlinks |
|
353 | diffing testsymlinks.07f494440405 testsymlinks | |
391 | [1] |
|
354 | [1] | |
392 | $ cd .. |
|
355 | $ cd .. | |
393 |
|
356 | |||
394 | #endif |
|
357 | #endif | |
395 |
|
358 | |||
396 | Test handling of non-ASCII paths in generated docstrings (issue5301) |
|
359 | Test handling of non-ASCII paths in generated docstrings (issue5301) | |
397 |
|
360 | |||
398 | >>> open("u", "w").write("\xa5\xa5") |
|
361 | >>> open("u", "w").write("\xa5\xa5") | |
399 | $ U=`cat u` |
|
362 | $ U=`cat u` | |
400 |
|
363 | |||
401 | $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help -k xyzzy |
|
364 | $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help -k xyzzy | |
402 | abort: no matches |
|
365 | abort: no matches | |
403 | (try 'hg help' for a list of topics) |
|
366 | (try 'hg help' for a list of topics) | |
404 | [255] |
|
367 | [255] | |
405 |
|
368 | |||
406 | $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help td > /dev/null |
|
369 | $ HGPLAIN=1 hg --config hgext.extdiff= --config extdiff.cmd.td=hi help td > /dev/null | |
407 |
|
370 | |||
408 | $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help -k xyzzy |
|
371 | $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help -k xyzzy | |
409 | abort: no matches |
|
372 | abort: no matches | |
410 | (try 'hg help' for a list of topics) |
|
373 | (try 'hg help' for a list of topics) | |
411 | [255] |
|
374 | [255] | |
412 |
|
375 | |||
413 | $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help td \ |
|
376 | $ LC_MESSAGES=ja_JP.UTF-8 hg --config hgext.extdiff= --config extdiff.cmd.td=$U help td \ | |
414 | > | grep "^ '" |
|
377 | > | grep "^ '" | |
415 | '\xa5\xa5' |
|
378 | '\xa5\xa5' |
General Comments 0
You need to be logged in to leave comments.
Login now