Show More
@@ -1,981 +1,985 | |||||
1 | test merge-tools configuration - mostly exercising filemerge.py |
|
1 | test merge-tools configuration - mostly exercising filemerge.py | |
2 |
|
2 | |||
3 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test |
|
3 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test | |
4 | $ hg init |
|
4 | $ hg init | |
5 |
|
5 | |||
6 | revision 0 |
|
6 | revision 0 | |
7 |
|
7 | |||
8 | $ echo "revision 0" > f |
|
8 | $ echo "revision 0" > f | |
9 | $ echo "space" >> f |
|
9 | $ echo "space" >> f | |
10 | $ hg commit -Am "revision 0" |
|
10 | $ hg commit -Am "revision 0" | |
11 | adding f |
|
11 | adding f | |
12 |
|
12 | |||
13 | revision 1 |
|
13 | revision 1 | |
14 |
|
14 | |||
15 | $ echo "revision 1" > f |
|
15 | $ echo "revision 1" > f | |
16 | $ echo "space" >> f |
|
16 | $ echo "space" >> f | |
17 | $ hg commit -Am "revision 1" |
|
17 | $ hg commit -Am "revision 1" | |
18 | $ hg update 0 > /dev/null |
|
18 | $ hg update 0 > /dev/null | |
19 |
|
19 | |||
20 | revision 2 |
|
20 | revision 2 | |
21 |
|
21 | |||
22 | $ echo "revision 2" > f |
|
22 | $ echo "revision 2" > f | |
23 | $ echo "space" >> f |
|
23 | $ echo "space" >> f | |
24 | $ hg commit -Am "revision 2" |
|
24 | $ hg commit -Am "revision 2" | |
25 | created new head |
|
25 | created new head | |
26 | $ hg update 0 > /dev/null |
|
26 | $ hg update 0 > /dev/null | |
27 |
|
27 | |||
28 | revision 3 - simple to merge |
|
28 | revision 3 - simple to merge | |
29 |
|
29 | |||
30 | $ echo "revision 3" >> f |
|
30 | $ echo "revision 3" >> f | |
31 | $ hg commit -Am "revision 3" |
|
31 | $ hg commit -Am "revision 3" | |
32 | created new head |
|
32 | created new head | |
33 |
|
33 | |||
34 | revision 4 - hard to merge |
|
34 | revision 4 - hard to merge | |
35 |
|
35 | |||
36 | $ hg update 0 > /dev/null |
|
36 | $ hg update 0 > /dev/null | |
37 | $ echo "revision 4" > f |
|
37 | $ echo "revision 4" > f | |
38 | $ hg commit -Am "revision 4" |
|
38 | $ hg commit -Am "revision 4" | |
39 | created new head |
|
39 | created new head | |
40 |
|
40 | |||
41 | $ echo "[merge-tools]" > .hg/hgrc |
|
41 | $ echo "[merge-tools]" > .hg/hgrc | |
42 |
|
42 | |||
43 | $ beforemerge() { |
|
43 | $ beforemerge() { | |
44 | > cat .hg/hgrc |
|
44 | > cat .hg/hgrc | |
45 | > echo "# hg update -C 1" |
|
45 | > echo "# hg update -C 1" | |
46 | > hg update -C 1 > /dev/null |
|
46 | > hg update -C 1 > /dev/null | |
47 | > } |
|
47 | > } | |
48 | $ aftermerge() { |
|
48 | $ aftermerge() { | |
49 | > echo "# cat f" |
|
49 | > echo "# cat f" | |
50 | > cat f |
|
50 | > cat f | |
51 | > echo "# hg stat" |
|
51 | > echo "# hg stat" | |
52 | > hg stat |
|
52 | > hg stat | |
53 | > rm -f f.orig |
|
53 | > rm -f f.orig | |
54 | > } |
|
54 | > } | |
55 |
|
55 | |||
56 | Tool selection |
|
56 | Tool selection | |
57 |
|
57 | |||
58 | default is internal merge: |
|
58 | default is internal merge: | |
59 |
|
59 | |||
60 | $ beforemerge |
|
60 | $ beforemerge | |
61 | [merge-tools] |
|
61 | [merge-tools] | |
62 | # hg update -C 1 |
|
62 | # hg update -C 1 | |
63 |
|
63 | |||
64 | hg merge -r 2 |
|
64 | hg merge -r 2 | |
65 | override $PATH to ensure hgmerge not visible; use $PYTHON in case we're |
|
65 | override $PATH to ensure hgmerge not visible; use $PYTHON in case we're | |
66 | running from a devel copy, not a temp installation |
|
66 | running from a devel copy, not a temp installation | |
67 |
|
67 | |||
68 | $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 |
|
68 | $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 | |
69 | merging f |
|
69 | merging f | |
70 | warning: conflicts during merge. |
|
70 | warning: conflicts during merge. | |
71 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
71 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') | |
72 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
72 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
73 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
73 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
74 | [1] |
|
74 | [1] | |
75 | $ aftermerge |
|
75 | $ aftermerge | |
76 | # cat f |
|
76 | # cat f | |
77 | <<<<<<< local: ef83787e2614 - test: revision 1 |
|
77 | <<<<<<< local: ef83787e2614 - test: revision 1 | |
78 | revision 1 |
|
78 | revision 1 | |
79 | ======= |
|
79 | ======= | |
80 | revision 2 |
|
80 | revision 2 | |
81 | >>>>>>> other: 0185f4e0cf02 - test: revision 2 |
|
81 | >>>>>>> other: 0185f4e0cf02 - test: revision 2 | |
82 | space |
|
82 | space | |
83 | # hg stat |
|
83 | # hg stat | |
84 | M f |
|
84 | M f | |
85 | ? f.orig |
|
85 | ? f.orig | |
86 |
|
86 | |||
87 | simplest hgrc using false for merge: |
|
87 | simplest hgrc using false for merge: | |
88 |
|
88 | |||
89 | $ echo "false.whatever=" >> .hg/hgrc |
|
89 | $ echo "false.whatever=" >> .hg/hgrc | |
90 | $ beforemerge |
|
90 | $ beforemerge | |
91 | [merge-tools] |
|
91 | [merge-tools] | |
92 | false.whatever= |
|
92 | false.whatever= | |
93 | # hg update -C 1 |
|
93 | # hg update -C 1 | |
94 | $ hg merge -r 2 |
|
94 | $ hg merge -r 2 | |
95 | merging f |
|
95 | merging f | |
96 | merging f failed! |
|
96 | merging f failed! | |
97 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
97 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
98 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
98 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
99 | [1] |
|
99 | [1] | |
100 | $ aftermerge |
|
100 | $ aftermerge | |
101 | # cat f |
|
101 | # cat f | |
102 | revision 1 |
|
102 | revision 1 | |
103 | space |
|
103 | space | |
104 | # hg stat |
|
104 | # hg stat | |
105 | M f |
|
105 | M f | |
106 | ? f.orig |
|
106 | ? f.orig | |
107 |
|
107 | |||
|
108 | #if unix-permissions | |||
|
109 | ||||
108 | unexecutable file in $PATH shouldn't be found: |
|
110 | unexecutable file in $PATH shouldn't be found: | |
109 |
|
111 | |||
110 | $ touch false |
|
112 | $ echo "echo fail" > false | |
111 | $ hg up -qC 1 |
|
113 | $ hg up -qC 1 | |
112 | $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 |
|
114 | $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 | |
113 | merging f |
|
115 | merging f | |
114 | warning: conflicts during merge. |
|
116 | warning: conflicts during merge. | |
115 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
117 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') | |
116 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
118 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
117 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
119 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
118 | [1] |
|
120 | [1] | |
119 | $ rm false |
|
121 | $ rm false | |
120 |
|
122 | |||
|
123 | #endif | |||
|
124 | ||||
121 | executable directory in $PATH shouldn't be found: |
|
125 | executable directory in $PATH shouldn't be found: | |
122 |
|
126 | |||
123 | $ mkdir false |
|
127 | $ mkdir false | |
124 | $ hg up -qC 1 |
|
128 | $ hg up -qC 1 | |
125 | $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 |
|
129 | $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 | |
126 | merging f |
|
130 | merging f | |
127 | warning: conflicts during merge. |
|
131 | warning: conflicts during merge. | |
128 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
132 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') | |
129 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
133 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
130 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
134 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
131 | [1] |
|
135 | [1] | |
132 | $ rmdir false |
|
136 | $ rmdir false | |
133 |
|
137 | |||
134 | true with higher .priority gets precedence: |
|
138 | true with higher .priority gets precedence: | |
135 |
|
139 | |||
136 | $ echo "true.priority=1" >> .hg/hgrc |
|
140 | $ echo "true.priority=1" >> .hg/hgrc | |
137 | $ beforemerge |
|
141 | $ beforemerge | |
138 | [merge-tools] |
|
142 | [merge-tools] | |
139 | false.whatever= |
|
143 | false.whatever= | |
140 | true.priority=1 |
|
144 | true.priority=1 | |
141 | # hg update -C 1 |
|
145 | # hg update -C 1 | |
142 | $ hg merge -r 2 |
|
146 | $ hg merge -r 2 | |
143 | merging f |
|
147 | merging f | |
144 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
148 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
145 | (branch merge, don't forget to commit) |
|
149 | (branch merge, don't forget to commit) | |
146 | $ aftermerge |
|
150 | $ aftermerge | |
147 | # cat f |
|
151 | # cat f | |
148 | revision 1 |
|
152 | revision 1 | |
149 | space |
|
153 | space | |
150 | # hg stat |
|
154 | # hg stat | |
151 | M f |
|
155 | M f | |
152 |
|
156 | |||
153 | unless lowered on command line: |
|
157 | unless lowered on command line: | |
154 |
|
158 | |||
155 | $ beforemerge |
|
159 | $ beforemerge | |
156 | [merge-tools] |
|
160 | [merge-tools] | |
157 | false.whatever= |
|
161 | false.whatever= | |
158 | true.priority=1 |
|
162 | true.priority=1 | |
159 | # hg update -C 1 |
|
163 | # hg update -C 1 | |
160 | $ hg merge -r 2 --config merge-tools.true.priority=-7 |
|
164 | $ hg merge -r 2 --config merge-tools.true.priority=-7 | |
161 | merging f |
|
165 | merging f | |
162 | merging f failed! |
|
166 | merging f failed! | |
163 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
167 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
164 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
168 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
165 | [1] |
|
169 | [1] | |
166 | $ aftermerge |
|
170 | $ aftermerge | |
167 | # cat f |
|
171 | # cat f | |
168 | revision 1 |
|
172 | revision 1 | |
169 | space |
|
173 | space | |
170 | # hg stat |
|
174 | # hg stat | |
171 | M f |
|
175 | M f | |
172 | ? f.orig |
|
176 | ? f.orig | |
173 |
|
177 | |||
174 | or false set higher on command line: |
|
178 | or false set higher on command line: | |
175 |
|
179 | |||
176 | $ beforemerge |
|
180 | $ beforemerge | |
177 | [merge-tools] |
|
181 | [merge-tools] | |
178 | false.whatever= |
|
182 | false.whatever= | |
179 | true.priority=1 |
|
183 | true.priority=1 | |
180 | # hg update -C 1 |
|
184 | # hg update -C 1 | |
181 | $ hg merge -r 2 --config merge-tools.false.priority=117 |
|
185 | $ hg merge -r 2 --config merge-tools.false.priority=117 | |
182 | merging f |
|
186 | merging f | |
183 | merging f failed! |
|
187 | merging f failed! | |
184 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
188 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
185 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
189 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
186 | [1] |
|
190 | [1] | |
187 | $ aftermerge |
|
191 | $ aftermerge | |
188 | # cat f |
|
192 | # cat f | |
189 | revision 1 |
|
193 | revision 1 | |
190 | space |
|
194 | space | |
191 | # hg stat |
|
195 | # hg stat | |
192 | M f |
|
196 | M f | |
193 | ? f.orig |
|
197 | ? f.orig | |
194 |
|
198 | |||
195 | or true.executable not found in PATH: |
|
199 | or true.executable not found in PATH: | |
196 |
|
200 | |||
197 | $ beforemerge |
|
201 | $ beforemerge | |
198 | [merge-tools] |
|
202 | [merge-tools] | |
199 | false.whatever= |
|
203 | false.whatever= | |
200 | true.priority=1 |
|
204 | true.priority=1 | |
201 | # hg update -C 1 |
|
205 | # hg update -C 1 | |
202 | $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool |
|
206 | $ hg merge -r 2 --config merge-tools.true.executable=nonexistentmergetool | |
203 | merging f |
|
207 | merging f | |
204 | merging f failed! |
|
208 | merging f failed! | |
205 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
209 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
206 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
210 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
207 | [1] |
|
211 | [1] | |
208 | $ aftermerge |
|
212 | $ aftermerge | |
209 | # cat f |
|
213 | # cat f | |
210 | revision 1 |
|
214 | revision 1 | |
211 | space |
|
215 | space | |
212 | # hg stat |
|
216 | # hg stat | |
213 | M f |
|
217 | M f | |
214 | ? f.orig |
|
218 | ? f.orig | |
215 |
|
219 | |||
216 | or true.executable with bogus path: |
|
220 | or true.executable with bogus path: | |
217 |
|
221 | |||
218 | $ beforemerge |
|
222 | $ beforemerge | |
219 | [merge-tools] |
|
223 | [merge-tools] | |
220 | false.whatever= |
|
224 | false.whatever= | |
221 | true.priority=1 |
|
225 | true.priority=1 | |
222 | # hg update -C 1 |
|
226 | # hg update -C 1 | |
223 | $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool |
|
227 | $ hg merge -r 2 --config merge-tools.true.executable=/nonexistent/mergetool | |
224 | merging f |
|
228 | merging f | |
225 | merging f failed! |
|
229 | merging f failed! | |
226 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
230 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
227 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
231 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
228 | [1] |
|
232 | [1] | |
229 | $ aftermerge |
|
233 | $ aftermerge | |
230 | # cat f |
|
234 | # cat f | |
231 | revision 1 |
|
235 | revision 1 | |
232 | space |
|
236 | space | |
233 | # hg stat |
|
237 | # hg stat | |
234 | M f |
|
238 | M f | |
235 | ? f.orig |
|
239 | ? f.orig | |
236 |
|
240 | |||
237 | but true.executable set to cat found in PATH works: |
|
241 | but true.executable set to cat found in PATH works: | |
238 |
|
242 | |||
239 | $ echo "true.executable=cat" >> .hg/hgrc |
|
243 | $ echo "true.executable=cat" >> .hg/hgrc | |
240 | $ beforemerge |
|
244 | $ beforemerge | |
241 | [merge-tools] |
|
245 | [merge-tools] | |
242 | false.whatever= |
|
246 | false.whatever= | |
243 | true.priority=1 |
|
247 | true.priority=1 | |
244 | true.executable=cat |
|
248 | true.executable=cat | |
245 | # hg update -C 1 |
|
249 | # hg update -C 1 | |
246 | $ hg merge -r 2 |
|
250 | $ hg merge -r 2 | |
247 | merging f |
|
251 | merging f | |
248 | revision 1 |
|
252 | revision 1 | |
249 | space |
|
253 | space | |
250 | revision 0 |
|
254 | revision 0 | |
251 | space |
|
255 | space | |
252 | revision 2 |
|
256 | revision 2 | |
253 | space |
|
257 | space | |
254 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
258 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
255 | (branch merge, don't forget to commit) |
|
259 | (branch merge, don't forget to commit) | |
256 | $ aftermerge |
|
260 | $ aftermerge | |
257 | # cat f |
|
261 | # cat f | |
258 | revision 1 |
|
262 | revision 1 | |
259 | space |
|
263 | space | |
260 | # hg stat |
|
264 | # hg stat | |
261 | M f |
|
265 | M f | |
262 |
|
266 | |||
263 | and true.executable set to cat with path works: |
|
267 | and true.executable set to cat with path works: | |
264 |
|
268 | |||
265 | $ beforemerge |
|
269 | $ beforemerge | |
266 | [merge-tools] |
|
270 | [merge-tools] | |
267 | false.whatever= |
|
271 | false.whatever= | |
268 | true.priority=1 |
|
272 | true.priority=1 | |
269 | true.executable=cat |
|
273 | true.executable=cat | |
270 | # hg update -C 1 |
|
274 | # hg update -C 1 | |
271 | $ hg merge -r 2 --config merge-tools.true.executable=cat |
|
275 | $ hg merge -r 2 --config merge-tools.true.executable=cat | |
272 | merging f |
|
276 | merging f | |
273 | revision 1 |
|
277 | revision 1 | |
274 | space |
|
278 | space | |
275 | revision 0 |
|
279 | revision 0 | |
276 | space |
|
280 | space | |
277 | revision 2 |
|
281 | revision 2 | |
278 | space |
|
282 | space | |
279 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
283 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
280 | (branch merge, don't forget to commit) |
|
284 | (branch merge, don't forget to commit) | |
281 | $ aftermerge |
|
285 | $ aftermerge | |
282 | # cat f |
|
286 | # cat f | |
283 | revision 1 |
|
287 | revision 1 | |
284 | space |
|
288 | space | |
285 | # hg stat |
|
289 | # hg stat | |
286 | M f |
|
290 | M f | |
287 |
|
291 | |||
288 | #if unix-permissions |
|
292 | #if unix-permissions | |
289 |
|
293 | |||
290 | environment variables in true.executable are handled: |
|
294 | environment variables in true.executable are handled: | |
291 |
|
295 | |||
292 | $ echo 'echo "custom merge tool"' > .hg/merge.sh |
|
296 | $ echo 'echo "custom merge tool"' > .hg/merge.sh | |
293 | $ beforemerge |
|
297 | $ beforemerge | |
294 | [merge-tools] |
|
298 | [merge-tools] | |
295 | false.whatever= |
|
299 | false.whatever= | |
296 | true.priority=1 |
|
300 | true.priority=1 | |
297 | true.executable=cat |
|
301 | true.executable=cat | |
298 | # hg update -C 1 |
|
302 | # hg update -C 1 | |
299 | $ hg --config merge-tools.true.executable='sh' \ |
|
303 | $ hg --config merge-tools.true.executable='sh' \ | |
300 | > --config merge-tools.true.args=.hg/merge.sh \ |
|
304 | > --config merge-tools.true.args=.hg/merge.sh \ | |
301 | > merge -r 2 |
|
305 | > merge -r 2 | |
302 | merging f |
|
306 | merging f | |
303 | custom merge tool |
|
307 | custom merge tool | |
304 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
308 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
305 | (branch merge, don't forget to commit) |
|
309 | (branch merge, don't forget to commit) | |
306 | $ aftermerge |
|
310 | $ aftermerge | |
307 | # cat f |
|
311 | # cat f | |
308 | revision 1 |
|
312 | revision 1 | |
309 | space |
|
313 | space | |
310 | # hg stat |
|
314 | # hg stat | |
311 | M f |
|
315 | M f | |
312 |
|
316 | |||
313 | #endif |
|
317 | #endif | |
314 |
|
318 | |||
315 | Tool selection and merge-patterns |
|
319 | Tool selection and merge-patterns | |
316 |
|
320 | |||
317 | merge-patterns specifies new tool false: |
|
321 | merge-patterns specifies new tool false: | |
318 |
|
322 | |||
319 | $ beforemerge |
|
323 | $ beforemerge | |
320 | [merge-tools] |
|
324 | [merge-tools] | |
321 | false.whatever= |
|
325 | false.whatever= | |
322 | true.priority=1 |
|
326 | true.priority=1 | |
323 | true.executable=cat |
|
327 | true.executable=cat | |
324 | # hg update -C 1 |
|
328 | # hg update -C 1 | |
325 | $ hg merge -r 2 --config merge-patterns.f=false |
|
329 | $ hg merge -r 2 --config merge-patterns.f=false | |
326 | merging f |
|
330 | merging f | |
327 | merging f failed! |
|
331 | merging f failed! | |
328 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
332 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
329 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
333 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
330 | [1] |
|
334 | [1] | |
331 | $ aftermerge |
|
335 | $ aftermerge | |
332 | # cat f |
|
336 | # cat f | |
333 | revision 1 |
|
337 | revision 1 | |
334 | space |
|
338 | space | |
335 | # hg stat |
|
339 | # hg stat | |
336 | M f |
|
340 | M f | |
337 | ? f.orig |
|
341 | ? f.orig | |
338 |
|
342 | |||
339 | merge-patterns specifies executable not found in PATH and gets warning: |
|
343 | merge-patterns specifies executable not found in PATH and gets warning: | |
340 |
|
344 | |||
341 | $ beforemerge |
|
345 | $ beforemerge | |
342 | [merge-tools] |
|
346 | [merge-tools] | |
343 | false.whatever= |
|
347 | false.whatever= | |
344 | true.priority=1 |
|
348 | true.priority=1 | |
345 | true.executable=cat |
|
349 | true.executable=cat | |
346 | # hg update -C 1 |
|
350 | # hg update -C 1 | |
347 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool |
|
351 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistentmergetool | |
348 | couldn't find merge tool true specified for f |
|
352 | couldn't find merge tool true specified for f | |
349 | merging f |
|
353 | merging f | |
350 | merging f failed! |
|
354 | merging f failed! | |
351 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
355 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
352 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
356 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
353 | [1] |
|
357 | [1] | |
354 | $ aftermerge |
|
358 | $ aftermerge | |
355 | # cat f |
|
359 | # cat f | |
356 | revision 1 |
|
360 | revision 1 | |
357 | space |
|
361 | space | |
358 | # hg stat |
|
362 | # hg stat | |
359 | M f |
|
363 | M f | |
360 | ? f.orig |
|
364 | ? f.orig | |
361 |
|
365 | |||
362 | merge-patterns specifies executable with bogus path and gets warning: |
|
366 | merge-patterns specifies executable with bogus path and gets warning: | |
363 |
|
367 | |||
364 | $ beforemerge |
|
368 | $ beforemerge | |
365 | [merge-tools] |
|
369 | [merge-tools] | |
366 | false.whatever= |
|
370 | false.whatever= | |
367 | true.priority=1 |
|
371 | true.priority=1 | |
368 | true.executable=cat |
|
372 | true.executable=cat | |
369 | # hg update -C 1 |
|
373 | # hg update -C 1 | |
370 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool |
|
374 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexistent/mergetool | |
371 | couldn't find merge tool true specified for f |
|
375 | couldn't find merge tool true specified for f | |
372 | merging f |
|
376 | merging f | |
373 | merging f failed! |
|
377 | merging f failed! | |
374 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
378 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
375 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
379 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
376 | [1] |
|
380 | [1] | |
377 | $ aftermerge |
|
381 | $ aftermerge | |
378 | # cat f |
|
382 | # cat f | |
379 | revision 1 |
|
383 | revision 1 | |
380 | space |
|
384 | space | |
381 | # hg stat |
|
385 | # hg stat | |
382 | M f |
|
386 | M f | |
383 | ? f.orig |
|
387 | ? f.orig | |
384 |
|
388 | |||
385 | ui.merge overrules priority |
|
389 | ui.merge overrules priority | |
386 |
|
390 | |||
387 | ui.merge specifies false: |
|
391 | ui.merge specifies false: | |
388 |
|
392 | |||
389 | $ beforemerge |
|
393 | $ beforemerge | |
390 | [merge-tools] |
|
394 | [merge-tools] | |
391 | false.whatever= |
|
395 | false.whatever= | |
392 | true.priority=1 |
|
396 | true.priority=1 | |
393 | true.executable=cat |
|
397 | true.executable=cat | |
394 | # hg update -C 1 |
|
398 | # hg update -C 1 | |
395 | $ hg merge -r 2 --config ui.merge=false |
|
399 | $ hg merge -r 2 --config ui.merge=false | |
396 | merging f |
|
400 | merging f | |
397 | merging f failed! |
|
401 | merging f failed! | |
398 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
402 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
399 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
403 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
400 | [1] |
|
404 | [1] | |
401 | $ aftermerge |
|
405 | $ aftermerge | |
402 | # cat f |
|
406 | # cat f | |
403 | revision 1 |
|
407 | revision 1 | |
404 | space |
|
408 | space | |
405 | # hg stat |
|
409 | # hg stat | |
406 | M f |
|
410 | M f | |
407 | ? f.orig |
|
411 | ? f.orig | |
408 |
|
412 | |||
409 | ui.merge specifies internal:fail: |
|
413 | ui.merge specifies internal:fail: | |
410 |
|
414 | |||
411 | $ beforemerge |
|
415 | $ beforemerge | |
412 | [merge-tools] |
|
416 | [merge-tools] | |
413 | false.whatever= |
|
417 | false.whatever= | |
414 | true.priority=1 |
|
418 | true.priority=1 | |
415 | true.executable=cat |
|
419 | true.executable=cat | |
416 | # hg update -C 1 |
|
420 | # hg update -C 1 | |
417 | $ hg merge -r 2 --config ui.merge=internal:fail |
|
421 | $ hg merge -r 2 --config ui.merge=internal:fail | |
418 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
422 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
419 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
423 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
420 | [1] |
|
424 | [1] | |
421 | $ aftermerge |
|
425 | $ aftermerge | |
422 | # cat f |
|
426 | # cat f | |
423 | revision 1 |
|
427 | revision 1 | |
424 | space |
|
428 | space | |
425 | # hg stat |
|
429 | # hg stat | |
426 | M f |
|
430 | M f | |
427 |
|
431 | |||
428 | ui.merge specifies :local (without internal prefix): |
|
432 | ui.merge specifies :local (without internal prefix): | |
429 |
|
433 | |||
430 | $ beforemerge |
|
434 | $ beforemerge | |
431 | [merge-tools] |
|
435 | [merge-tools] | |
432 | false.whatever= |
|
436 | false.whatever= | |
433 | true.priority=1 |
|
437 | true.priority=1 | |
434 | true.executable=cat |
|
438 | true.executable=cat | |
435 | # hg update -C 1 |
|
439 | # hg update -C 1 | |
436 | $ hg merge -r 2 --config ui.merge=:local |
|
440 | $ hg merge -r 2 --config ui.merge=:local | |
437 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
441 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
438 | (branch merge, don't forget to commit) |
|
442 | (branch merge, don't forget to commit) | |
439 | $ aftermerge |
|
443 | $ aftermerge | |
440 | # cat f |
|
444 | # cat f | |
441 | revision 1 |
|
445 | revision 1 | |
442 | space |
|
446 | space | |
443 | # hg stat |
|
447 | # hg stat | |
444 | M f |
|
448 | M f | |
445 |
|
449 | |||
446 | ui.merge specifies internal:other: |
|
450 | ui.merge specifies internal:other: | |
447 |
|
451 | |||
448 | $ beforemerge |
|
452 | $ beforemerge | |
449 | [merge-tools] |
|
453 | [merge-tools] | |
450 | false.whatever= |
|
454 | false.whatever= | |
451 | true.priority=1 |
|
455 | true.priority=1 | |
452 | true.executable=cat |
|
456 | true.executable=cat | |
453 | # hg update -C 1 |
|
457 | # hg update -C 1 | |
454 | $ hg merge -r 2 --config ui.merge=internal:other |
|
458 | $ hg merge -r 2 --config ui.merge=internal:other | |
455 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
459 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
456 | (branch merge, don't forget to commit) |
|
460 | (branch merge, don't forget to commit) | |
457 | $ aftermerge |
|
461 | $ aftermerge | |
458 | # cat f |
|
462 | # cat f | |
459 | revision 2 |
|
463 | revision 2 | |
460 | space |
|
464 | space | |
461 | # hg stat |
|
465 | # hg stat | |
462 | M f |
|
466 | M f | |
463 |
|
467 | |||
464 | ui.merge specifies internal:prompt: |
|
468 | ui.merge specifies internal:prompt: | |
465 |
|
469 | |||
466 | $ beforemerge |
|
470 | $ beforemerge | |
467 | [merge-tools] |
|
471 | [merge-tools] | |
468 | false.whatever= |
|
472 | false.whatever= | |
469 | true.priority=1 |
|
473 | true.priority=1 | |
470 | true.executable=cat |
|
474 | true.executable=cat | |
471 | # hg update -C 1 |
|
475 | # hg update -C 1 | |
472 | $ hg merge -r 2 --config ui.merge=internal:prompt |
|
476 | $ hg merge -r 2 --config ui.merge=internal:prompt | |
473 | no tool found to merge f |
|
477 | no tool found to merge f | |
474 | keep (l)ocal or take (o)ther? l |
|
478 | keep (l)ocal or take (o)ther? l | |
475 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
479 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
476 | (branch merge, don't forget to commit) |
|
480 | (branch merge, don't forget to commit) | |
477 | $ aftermerge |
|
481 | $ aftermerge | |
478 | # cat f |
|
482 | # cat f | |
479 | revision 1 |
|
483 | revision 1 | |
480 | space |
|
484 | space | |
481 | # hg stat |
|
485 | # hg stat | |
482 | M f |
|
486 | M f | |
483 |
|
487 | |||
484 | ui.merge specifies internal:dump: |
|
488 | ui.merge specifies internal:dump: | |
485 |
|
489 | |||
486 | $ beforemerge |
|
490 | $ beforemerge | |
487 | [merge-tools] |
|
491 | [merge-tools] | |
488 | false.whatever= |
|
492 | false.whatever= | |
489 | true.priority=1 |
|
493 | true.priority=1 | |
490 | true.executable=cat |
|
494 | true.executable=cat | |
491 | # hg update -C 1 |
|
495 | # hg update -C 1 | |
492 | $ hg merge -r 2 --config ui.merge=internal:dump |
|
496 | $ hg merge -r 2 --config ui.merge=internal:dump | |
493 | merging f |
|
497 | merging f | |
494 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
498 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
495 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
499 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
496 | [1] |
|
500 | [1] | |
497 | $ aftermerge |
|
501 | $ aftermerge | |
498 | # cat f |
|
502 | # cat f | |
499 | revision 1 |
|
503 | revision 1 | |
500 | space |
|
504 | space | |
501 | # hg stat |
|
505 | # hg stat | |
502 | M f |
|
506 | M f | |
503 | ? f.base |
|
507 | ? f.base | |
504 | ? f.local |
|
508 | ? f.local | |
505 | ? f.orig |
|
509 | ? f.orig | |
506 | ? f.other |
|
510 | ? f.other | |
507 |
|
511 | |||
508 | f.base: |
|
512 | f.base: | |
509 |
|
513 | |||
510 | $ cat f.base |
|
514 | $ cat f.base | |
511 | revision 0 |
|
515 | revision 0 | |
512 | space |
|
516 | space | |
513 |
|
517 | |||
514 | f.local: |
|
518 | f.local: | |
515 |
|
519 | |||
516 | $ cat f.local |
|
520 | $ cat f.local | |
517 | revision 1 |
|
521 | revision 1 | |
518 | space |
|
522 | space | |
519 |
|
523 | |||
520 | f.other: |
|
524 | f.other: | |
521 |
|
525 | |||
522 | $ cat f.other |
|
526 | $ cat f.other | |
523 | revision 2 |
|
527 | revision 2 | |
524 | space |
|
528 | space | |
525 | $ rm f.base f.local f.other |
|
529 | $ rm f.base f.local f.other | |
526 |
|
530 | |||
527 | ui.merge specifies internal:other but is overruled by pattern for false: |
|
531 | ui.merge specifies internal:other but is overruled by pattern for false: | |
528 |
|
532 | |||
529 | $ beforemerge |
|
533 | $ beforemerge | |
530 | [merge-tools] |
|
534 | [merge-tools] | |
531 | false.whatever= |
|
535 | false.whatever= | |
532 | true.priority=1 |
|
536 | true.priority=1 | |
533 | true.executable=cat |
|
537 | true.executable=cat | |
534 | # hg update -C 1 |
|
538 | # hg update -C 1 | |
535 | $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false |
|
539 | $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false | |
536 | merging f |
|
540 | merging f | |
537 | merging f failed! |
|
541 | merging f failed! | |
538 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
542 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
539 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
543 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
540 | [1] |
|
544 | [1] | |
541 | $ aftermerge |
|
545 | $ aftermerge | |
542 | # cat f |
|
546 | # cat f | |
543 | revision 1 |
|
547 | revision 1 | |
544 | space |
|
548 | space | |
545 | # hg stat |
|
549 | # hg stat | |
546 | M f |
|
550 | M f | |
547 | ? f.orig |
|
551 | ? f.orig | |
548 |
|
552 | |||
549 | Premerge |
|
553 | Premerge | |
550 |
|
554 | |||
551 | ui.merge specifies internal:other but is overruled by --tool=false |
|
555 | ui.merge specifies internal:other but is overruled by --tool=false | |
552 |
|
556 | |||
553 | $ beforemerge |
|
557 | $ beforemerge | |
554 | [merge-tools] |
|
558 | [merge-tools] | |
555 | false.whatever= |
|
559 | false.whatever= | |
556 | true.priority=1 |
|
560 | true.priority=1 | |
557 | true.executable=cat |
|
561 | true.executable=cat | |
558 | # hg update -C 1 |
|
562 | # hg update -C 1 | |
559 | $ hg merge -r 2 --config ui.merge=internal:other --tool=false |
|
563 | $ hg merge -r 2 --config ui.merge=internal:other --tool=false | |
560 | merging f |
|
564 | merging f | |
561 | merging f failed! |
|
565 | merging f failed! | |
562 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
566 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
563 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
567 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
564 | [1] |
|
568 | [1] | |
565 | $ aftermerge |
|
569 | $ aftermerge | |
566 | # cat f |
|
570 | # cat f | |
567 | revision 1 |
|
571 | revision 1 | |
568 | space |
|
572 | space | |
569 | # hg stat |
|
573 | # hg stat | |
570 | M f |
|
574 | M f | |
571 | ? f.orig |
|
575 | ? f.orig | |
572 |
|
576 | |||
573 | HGMERGE specifies internal:other but is overruled by --tool=false |
|
577 | HGMERGE specifies internal:other but is overruled by --tool=false | |
574 |
|
578 | |||
575 | $ HGMERGE=internal:other ; export HGMERGE |
|
579 | $ HGMERGE=internal:other ; export HGMERGE | |
576 | $ beforemerge |
|
580 | $ beforemerge | |
577 | [merge-tools] |
|
581 | [merge-tools] | |
578 | false.whatever= |
|
582 | false.whatever= | |
579 | true.priority=1 |
|
583 | true.priority=1 | |
580 | true.executable=cat |
|
584 | true.executable=cat | |
581 | # hg update -C 1 |
|
585 | # hg update -C 1 | |
582 | $ hg merge -r 2 --tool=false |
|
586 | $ hg merge -r 2 --tool=false | |
583 | merging f |
|
587 | merging f | |
584 | merging f failed! |
|
588 | merging f failed! | |
585 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
589 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
586 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
590 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
587 | [1] |
|
591 | [1] | |
588 | $ aftermerge |
|
592 | $ aftermerge | |
589 | # cat f |
|
593 | # cat f | |
590 | revision 1 |
|
594 | revision 1 | |
591 | space |
|
595 | space | |
592 | # hg stat |
|
596 | # hg stat | |
593 | M f |
|
597 | M f | |
594 | ? f.orig |
|
598 | ? f.orig | |
595 |
|
599 | |||
596 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests |
|
600 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests | |
597 |
|
601 | |||
598 | update is a merge ... |
|
602 | update is a merge ... | |
599 |
|
603 | |||
600 | $ beforemerge |
|
604 | $ beforemerge | |
601 | [merge-tools] |
|
605 | [merge-tools] | |
602 | false.whatever= |
|
606 | false.whatever= | |
603 | true.priority=1 |
|
607 | true.priority=1 | |
604 | true.executable=cat |
|
608 | true.executable=cat | |
605 | # hg update -C 1 |
|
609 | # hg update -C 1 | |
606 | $ hg update -q 0 |
|
610 | $ hg update -q 0 | |
607 | $ hg revert -q -r 1 . |
|
611 | $ hg revert -q -r 1 . | |
608 | $ hg update -r 2 |
|
612 | $ hg update -r 2 | |
609 | merging f |
|
613 | merging f | |
610 | revision 1 |
|
614 | revision 1 | |
611 | space |
|
615 | space | |
612 | revision 0 |
|
616 | revision 0 | |
613 | space |
|
617 | space | |
614 | revision 2 |
|
618 | revision 2 | |
615 | space |
|
619 | space | |
616 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
620 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
617 | $ aftermerge |
|
621 | $ aftermerge | |
618 | # cat f |
|
622 | # cat f | |
619 | revision 1 |
|
623 | revision 1 | |
620 | space |
|
624 | space | |
621 | # hg stat |
|
625 | # hg stat | |
622 | M f |
|
626 | M f | |
623 |
|
627 | |||
624 | update should also have --tool |
|
628 | update should also have --tool | |
625 |
|
629 | |||
626 | $ beforemerge |
|
630 | $ beforemerge | |
627 | [merge-tools] |
|
631 | [merge-tools] | |
628 | false.whatever= |
|
632 | false.whatever= | |
629 | true.priority=1 |
|
633 | true.priority=1 | |
630 | true.executable=cat |
|
634 | true.executable=cat | |
631 | # hg update -C 1 |
|
635 | # hg update -C 1 | |
632 | $ hg update -q 0 |
|
636 | $ hg update -q 0 | |
633 | $ hg revert -q -r 1 . |
|
637 | $ hg revert -q -r 1 . | |
634 | $ hg update -r 2 --tool false |
|
638 | $ hg update -r 2 --tool false | |
635 | merging f |
|
639 | merging f | |
636 | merging f failed! |
|
640 | merging f failed! | |
637 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
641 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
638 | use 'hg resolve' to retry unresolved file merges |
|
642 | use 'hg resolve' to retry unresolved file merges | |
639 | [1] |
|
643 | [1] | |
640 | $ aftermerge |
|
644 | $ aftermerge | |
641 | # cat f |
|
645 | # cat f | |
642 | revision 1 |
|
646 | revision 1 | |
643 | space |
|
647 | space | |
644 | # hg stat |
|
648 | # hg stat | |
645 | M f |
|
649 | M f | |
646 | ? f.orig |
|
650 | ? f.orig | |
647 |
|
651 | |||
648 | Default is silent simplemerge: |
|
652 | Default is silent simplemerge: | |
649 |
|
653 | |||
650 | $ beforemerge |
|
654 | $ beforemerge | |
651 | [merge-tools] |
|
655 | [merge-tools] | |
652 | false.whatever= |
|
656 | false.whatever= | |
653 | true.priority=1 |
|
657 | true.priority=1 | |
654 | true.executable=cat |
|
658 | true.executable=cat | |
655 | # hg update -C 1 |
|
659 | # hg update -C 1 | |
656 | $ hg merge -r 3 |
|
660 | $ hg merge -r 3 | |
657 | merging f |
|
661 | merging f | |
658 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
662 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
659 | (branch merge, don't forget to commit) |
|
663 | (branch merge, don't forget to commit) | |
660 | $ aftermerge |
|
664 | $ aftermerge | |
661 | # cat f |
|
665 | # cat f | |
662 | revision 1 |
|
666 | revision 1 | |
663 | space |
|
667 | space | |
664 | revision 3 |
|
668 | revision 3 | |
665 | # hg stat |
|
669 | # hg stat | |
666 | M f |
|
670 | M f | |
667 |
|
671 | |||
668 | .premerge=True is same: |
|
672 | .premerge=True is same: | |
669 |
|
673 | |||
670 | $ beforemerge |
|
674 | $ beforemerge | |
671 | [merge-tools] |
|
675 | [merge-tools] | |
672 | false.whatever= |
|
676 | false.whatever= | |
673 | true.priority=1 |
|
677 | true.priority=1 | |
674 | true.executable=cat |
|
678 | true.executable=cat | |
675 | # hg update -C 1 |
|
679 | # hg update -C 1 | |
676 | $ hg merge -r 3 --config merge-tools.true.premerge=True |
|
680 | $ hg merge -r 3 --config merge-tools.true.premerge=True | |
677 | merging f |
|
681 | merging f | |
678 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
682 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
679 | (branch merge, don't forget to commit) |
|
683 | (branch merge, don't forget to commit) | |
680 | $ aftermerge |
|
684 | $ aftermerge | |
681 | # cat f |
|
685 | # cat f | |
682 | revision 1 |
|
686 | revision 1 | |
683 | space |
|
687 | space | |
684 | revision 3 |
|
688 | revision 3 | |
685 | # hg stat |
|
689 | # hg stat | |
686 | M f |
|
690 | M f | |
687 |
|
691 | |||
688 | .premerge=False executes merge-tool: |
|
692 | .premerge=False executes merge-tool: | |
689 |
|
693 | |||
690 | $ beforemerge |
|
694 | $ beforemerge | |
691 | [merge-tools] |
|
695 | [merge-tools] | |
692 | false.whatever= |
|
696 | false.whatever= | |
693 | true.priority=1 |
|
697 | true.priority=1 | |
694 | true.executable=cat |
|
698 | true.executable=cat | |
695 | # hg update -C 1 |
|
699 | # hg update -C 1 | |
696 | $ hg merge -r 3 --config merge-tools.true.premerge=False |
|
700 | $ hg merge -r 3 --config merge-tools.true.premerge=False | |
697 | merging f |
|
701 | merging f | |
698 | revision 1 |
|
702 | revision 1 | |
699 | space |
|
703 | space | |
700 | revision 0 |
|
704 | revision 0 | |
701 | space |
|
705 | space | |
702 | revision 0 |
|
706 | revision 0 | |
703 | space |
|
707 | space | |
704 | revision 3 |
|
708 | revision 3 | |
705 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
709 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
706 | (branch merge, don't forget to commit) |
|
710 | (branch merge, don't forget to commit) | |
707 | $ aftermerge |
|
711 | $ aftermerge | |
708 | # cat f |
|
712 | # cat f | |
709 | revision 1 |
|
713 | revision 1 | |
710 | space |
|
714 | space | |
711 | # hg stat |
|
715 | # hg stat | |
712 | M f |
|
716 | M f | |
713 |
|
717 | |||
714 | premerge=keep keeps conflict markers in: |
|
718 | premerge=keep keeps conflict markers in: | |
715 |
|
719 | |||
716 | $ beforemerge |
|
720 | $ beforemerge | |
717 | [merge-tools] |
|
721 | [merge-tools] | |
718 | false.whatever= |
|
722 | false.whatever= | |
719 | true.priority=1 |
|
723 | true.priority=1 | |
720 | true.executable=cat |
|
724 | true.executable=cat | |
721 | # hg update -C 1 |
|
725 | # hg update -C 1 | |
722 | $ hg merge -r 4 --config merge-tools.true.premerge=keep |
|
726 | $ hg merge -r 4 --config merge-tools.true.premerge=keep | |
723 | merging f |
|
727 | merging f | |
724 | <<<<<<< local: ef83787e2614 - test: revision 1 |
|
728 | <<<<<<< local: ef83787e2614 - test: revision 1 | |
725 | revision 1 |
|
729 | revision 1 | |
726 | space |
|
730 | space | |
727 | ======= |
|
731 | ======= | |
728 | revision 4 |
|
732 | revision 4 | |
729 | >>>>>>> other: 81448d39c9a0 - test: revision 4 |
|
733 | >>>>>>> other: 81448d39c9a0 - test: revision 4 | |
730 | revision 0 |
|
734 | revision 0 | |
731 | space |
|
735 | space | |
732 | revision 4 |
|
736 | revision 4 | |
733 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
737 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
734 | (branch merge, don't forget to commit) |
|
738 | (branch merge, don't forget to commit) | |
735 | $ aftermerge |
|
739 | $ aftermerge | |
736 | # cat f |
|
740 | # cat f | |
737 | <<<<<<< local: ef83787e2614 - test: revision 1 |
|
741 | <<<<<<< local: ef83787e2614 - test: revision 1 | |
738 | revision 1 |
|
742 | revision 1 | |
739 | space |
|
743 | space | |
740 | ======= |
|
744 | ======= | |
741 | revision 4 |
|
745 | revision 4 | |
742 | >>>>>>> other: 81448d39c9a0 - test: revision 4 |
|
746 | >>>>>>> other: 81448d39c9a0 - test: revision 4 | |
743 | # hg stat |
|
747 | # hg stat | |
744 | M f |
|
748 | M f | |
745 |
|
749 | |||
746 | premerge=keep-merge3 keeps conflict markers with base content: |
|
750 | premerge=keep-merge3 keeps conflict markers with base content: | |
747 |
|
751 | |||
748 | $ beforemerge |
|
752 | $ beforemerge | |
749 | [merge-tools] |
|
753 | [merge-tools] | |
750 | false.whatever= |
|
754 | false.whatever= | |
751 | true.priority=1 |
|
755 | true.priority=1 | |
752 | true.executable=cat |
|
756 | true.executable=cat | |
753 | # hg update -C 1 |
|
757 | # hg update -C 1 | |
754 | $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3 |
|
758 | $ hg merge -r 4 --config merge-tools.true.premerge=keep-merge3 | |
755 | merging f |
|
759 | merging f | |
756 | <<<<<<< local: ef83787e2614 - test: revision 1 |
|
760 | <<<<<<< local: ef83787e2614 - test: revision 1 | |
757 | revision 1 |
|
761 | revision 1 | |
758 | space |
|
762 | space | |
759 | ||||||| base |
|
763 | ||||||| base | |
760 | revision 0 |
|
764 | revision 0 | |
761 | space |
|
765 | space | |
762 | ======= |
|
766 | ======= | |
763 | revision 4 |
|
767 | revision 4 | |
764 | >>>>>>> other: 81448d39c9a0 - test: revision 4 |
|
768 | >>>>>>> other: 81448d39c9a0 - test: revision 4 | |
765 | revision 0 |
|
769 | revision 0 | |
766 | space |
|
770 | space | |
767 | revision 4 |
|
771 | revision 4 | |
768 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
772 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
769 | (branch merge, don't forget to commit) |
|
773 | (branch merge, don't forget to commit) | |
770 | $ aftermerge |
|
774 | $ aftermerge | |
771 | # cat f |
|
775 | # cat f | |
772 | <<<<<<< local: ef83787e2614 - test: revision 1 |
|
776 | <<<<<<< local: ef83787e2614 - test: revision 1 | |
773 | revision 1 |
|
777 | revision 1 | |
774 | space |
|
778 | space | |
775 | ||||||| base |
|
779 | ||||||| base | |
776 | revision 0 |
|
780 | revision 0 | |
777 | space |
|
781 | space | |
778 | ======= |
|
782 | ======= | |
779 | revision 4 |
|
783 | revision 4 | |
780 | >>>>>>> other: 81448d39c9a0 - test: revision 4 |
|
784 | >>>>>>> other: 81448d39c9a0 - test: revision 4 | |
781 | # hg stat |
|
785 | # hg stat | |
782 | M f |
|
786 | M f | |
783 |
|
787 | |||
784 |
|
788 | |||
785 | Tool execution |
|
789 | Tool execution | |
786 |
|
790 | |||
787 | set tools.args explicit to include $base $local $other $output: |
|
791 | set tools.args explicit to include $base $local $other $output: | |
788 |
|
792 | |||
789 | $ beforemerge |
|
793 | $ beforemerge | |
790 | [merge-tools] |
|
794 | [merge-tools] | |
791 | false.whatever= |
|
795 | false.whatever= | |
792 | true.priority=1 |
|
796 | true.priority=1 | |
793 | true.executable=cat |
|
797 | true.executable=cat | |
794 | # hg update -C 1 |
|
798 | # hg update -C 1 | |
795 | $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \ |
|
799 | $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \ | |
796 | > | sed 's,==> .* <==,==> ... <==,g' |
|
800 | > | sed 's,==> .* <==,==> ... <==,g' | |
797 | merging f |
|
801 | merging f | |
798 | ==> ... <== |
|
802 | ==> ... <== | |
799 | revision 0 |
|
803 | revision 0 | |
800 | space |
|
804 | space | |
801 |
|
805 | |||
802 | ==> ... <== |
|
806 | ==> ... <== | |
803 | revision 1 |
|
807 | revision 1 | |
804 | space |
|
808 | space | |
805 |
|
809 | |||
806 | ==> ... <== |
|
810 | ==> ... <== | |
807 | revision 2 |
|
811 | revision 2 | |
808 | space |
|
812 | space | |
809 |
|
813 | |||
810 | ==> ... <== |
|
814 | ==> ... <== | |
811 | revision 1 |
|
815 | revision 1 | |
812 | space |
|
816 | space | |
813 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
817 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
814 | (branch merge, don't forget to commit) |
|
818 | (branch merge, don't forget to commit) | |
815 | $ aftermerge |
|
819 | $ aftermerge | |
816 | # cat f |
|
820 | # cat f | |
817 | revision 1 |
|
821 | revision 1 | |
818 | space |
|
822 | space | |
819 | # hg stat |
|
823 | # hg stat | |
820 | M f |
|
824 | M f | |
821 |
|
825 | |||
822 | Merge with "echo mergeresult > $local": |
|
826 | Merge with "echo mergeresult > $local": | |
823 |
|
827 | |||
824 | $ beforemerge |
|
828 | $ beforemerge | |
825 | [merge-tools] |
|
829 | [merge-tools] | |
826 | false.whatever= |
|
830 | false.whatever= | |
827 | true.priority=1 |
|
831 | true.priority=1 | |
828 | true.executable=cat |
|
832 | true.executable=cat | |
829 | # hg update -C 1 |
|
833 | # hg update -C 1 | |
830 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local' |
|
834 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local' | |
831 | merging f |
|
835 | merging f | |
832 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
836 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
833 | (branch merge, don't forget to commit) |
|
837 | (branch merge, don't forget to commit) | |
834 | $ aftermerge |
|
838 | $ aftermerge | |
835 | # cat f |
|
839 | # cat f | |
836 | mergeresult |
|
840 | mergeresult | |
837 | # hg stat |
|
841 | # hg stat | |
838 | M f |
|
842 | M f | |
839 |
|
843 | |||
840 | - and $local is the file f: |
|
844 | - and $local is the file f: | |
841 |
|
845 | |||
842 | $ beforemerge |
|
846 | $ beforemerge | |
843 | [merge-tools] |
|
847 | [merge-tools] | |
844 | false.whatever= |
|
848 | false.whatever= | |
845 | true.priority=1 |
|
849 | true.priority=1 | |
846 | true.executable=cat |
|
850 | true.executable=cat | |
847 | # hg update -C 1 |
|
851 | # hg update -C 1 | |
848 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f' |
|
852 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f' | |
849 | merging f |
|
853 | merging f | |
850 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
854 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
851 | (branch merge, don't forget to commit) |
|
855 | (branch merge, don't forget to commit) | |
852 | $ aftermerge |
|
856 | $ aftermerge | |
853 | # cat f |
|
857 | # cat f | |
854 | mergeresult |
|
858 | mergeresult | |
855 | # hg stat |
|
859 | # hg stat | |
856 | M f |
|
860 | M f | |
857 |
|
861 | |||
858 | Merge with "echo mergeresult > $output" - the variable is a bit magic: |
|
862 | Merge with "echo mergeresult > $output" - the variable is a bit magic: | |
859 |
|
863 | |||
860 | $ beforemerge |
|
864 | $ beforemerge | |
861 | [merge-tools] |
|
865 | [merge-tools] | |
862 | false.whatever= |
|
866 | false.whatever= | |
863 | true.priority=1 |
|
867 | true.priority=1 | |
864 | true.executable=cat |
|
868 | true.executable=cat | |
865 | # hg update -C 1 |
|
869 | # hg update -C 1 | |
866 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output' |
|
870 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output' | |
867 | merging f |
|
871 | merging f | |
868 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
872 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
869 | (branch merge, don't forget to commit) |
|
873 | (branch merge, don't forget to commit) | |
870 | $ aftermerge |
|
874 | $ aftermerge | |
871 | # cat f |
|
875 | # cat f | |
872 | mergeresult |
|
876 | mergeresult | |
873 | # hg stat |
|
877 | # hg stat | |
874 | M f |
|
878 | M f | |
875 |
|
879 | |||
876 | Merge using tool with a path that must be quoted: |
|
880 | Merge using tool with a path that must be quoted: | |
877 |
|
881 | |||
878 | $ beforemerge |
|
882 | $ beforemerge | |
879 | [merge-tools] |
|
883 | [merge-tools] | |
880 | false.whatever= |
|
884 | false.whatever= | |
881 | true.priority=1 |
|
885 | true.priority=1 | |
882 | true.executable=cat |
|
886 | true.executable=cat | |
883 | # hg update -C 1 |
|
887 | # hg update -C 1 | |
884 | $ cat <<EOF > 'my merge tool' |
|
888 | $ cat <<EOF > 'my merge tool' | |
885 | > cat "\$1" "\$2" "\$3" > "\$4" |
|
889 | > cat "\$1" "\$2" "\$3" > "\$4" | |
886 | > EOF |
|
890 | > EOF | |
887 | $ hg --config merge-tools.true.executable='sh' \ |
|
891 | $ hg --config merge-tools.true.executable='sh' \ | |
888 | > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \ |
|
892 | > --config merge-tools.true.args='"./my merge tool" $base $local $other $output' \ | |
889 | > merge -r 2 |
|
893 | > merge -r 2 | |
890 | merging f |
|
894 | merging f | |
891 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
895 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
892 | (branch merge, don't forget to commit) |
|
896 | (branch merge, don't forget to commit) | |
893 | $ rm -f 'my merge tool' |
|
897 | $ rm -f 'my merge tool' | |
894 | $ aftermerge |
|
898 | $ aftermerge | |
895 | # cat f |
|
899 | # cat f | |
896 | revision 0 |
|
900 | revision 0 | |
897 | space |
|
901 | space | |
898 | revision 1 |
|
902 | revision 1 | |
899 | space |
|
903 | space | |
900 | revision 2 |
|
904 | revision 2 | |
901 | space |
|
905 | space | |
902 | # hg stat |
|
906 | # hg stat | |
903 | M f |
|
907 | M f | |
904 |
|
908 | |||
905 | Issue3581: Merging a filename that needs to be quoted |
|
909 | Issue3581: Merging a filename that needs to be quoted | |
906 | (This test doesn't work on Windows filesystems even on Linux, so check |
|
910 | (This test doesn't work on Windows filesystems even on Linux, so check | |
907 | for Unix-like permission) |
|
911 | for Unix-like permission) | |
908 |
|
912 | |||
909 | #if unix-permissions |
|
913 | #if unix-permissions | |
910 | $ beforemerge |
|
914 | $ beforemerge | |
911 | [merge-tools] |
|
915 | [merge-tools] | |
912 | false.whatever= |
|
916 | false.whatever= | |
913 | true.priority=1 |
|
917 | true.priority=1 | |
914 | true.executable=cat |
|
918 | true.executable=cat | |
915 | # hg update -C 1 |
|
919 | # hg update -C 1 | |
916 | $ echo "revision 5" > '"; exit 1; echo "' |
|
920 | $ echo "revision 5" > '"; exit 1; echo "' | |
917 | $ hg commit -Am "revision 5" |
|
921 | $ hg commit -Am "revision 5" | |
918 | adding "; exit 1; echo " |
|
922 | adding "; exit 1; echo " | |
919 | warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' |
|
923 | warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' | |
920 | $ hg update -C 1 > /dev/null |
|
924 | $ hg update -C 1 > /dev/null | |
921 | $ echo "revision 6" > '"; exit 1; echo "' |
|
925 | $ echo "revision 6" > '"; exit 1; echo "' | |
922 | $ hg commit -Am "revision 6" |
|
926 | $ hg commit -Am "revision 6" | |
923 | adding "; exit 1; echo " |
|
927 | adding "; exit 1; echo " | |
924 | warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' |
|
928 | warning: filename contains '"', which is reserved on Windows: '"; exit 1; echo "' | |
925 | created new head |
|
929 | created new head | |
926 | $ hg merge --config merge-tools.true.executable="true" -r 5 |
|
930 | $ hg merge --config merge-tools.true.executable="true" -r 5 | |
927 | merging "; exit 1; echo " |
|
931 | merging "; exit 1; echo " | |
928 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
932 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
929 | (branch merge, don't forget to commit) |
|
933 | (branch merge, don't forget to commit) | |
930 | $ hg update -C 1 > /dev/null |
|
934 | $ hg update -C 1 > /dev/null | |
931 | #endif |
|
935 | #endif | |
932 |
|
936 | |||
933 | Merge post-processing |
|
937 | Merge post-processing | |
934 |
|
938 | |||
935 | cat is a bad merge-tool and doesn't change: |
|
939 | cat is a bad merge-tool and doesn't change: | |
936 |
|
940 | |||
937 | $ beforemerge |
|
941 | $ beforemerge | |
938 | [merge-tools] |
|
942 | [merge-tools] | |
939 | false.whatever= |
|
943 | false.whatever= | |
940 | true.priority=1 |
|
944 | true.priority=1 | |
941 | true.executable=cat |
|
945 | true.executable=cat | |
942 | # hg update -C 1 |
|
946 | # hg update -C 1 | |
943 | $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1 |
|
947 | $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1 | |
944 | merging f |
|
948 | merging f | |
945 | revision 1 |
|
949 | revision 1 | |
946 | space |
|
950 | space | |
947 | revision 0 |
|
951 | revision 0 | |
948 | space |
|
952 | space | |
949 | revision 2 |
|
953 | revision 2 | |
950 | space |
|
954 | space | |
951 | output file f appears unchanged |
|
955 | output file f appears unchanged | |
952 | was merge successful (yn)? n |
|
956 | was merge successful (yn)? n | |
953 | merging f failed! |
|
957 | merging f failed! | |
954 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
958 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
955 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
959 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
956 | [1] |
|
960 | [1] | |
957 | $ aftermerge |
|
961 | $ aftermerge | |
958 | # cat f |
|
962 | # cat f | |
959 | revision 1 |
|
963 | revision 1 | |
960 | space |
|
964 | space | |
961 | # hg stat |
|
965 | # hg stat | |
962 | M f |
|
966 | M f | |
963 | ? f.orig |
|
967 | ? f.orig | |
964 |
|
968 | |||
965 | #if symlink |
|
969 | #if symlink | |
966 |
|
970 | |||
967 | internal merge cannot handle symlinks and shouldn't try: |
|
971 | internal merge cannot handle symlinks and shouldn't try: | |
968 |
|
972 | |||
969 | $ hg update -q -C 1 |
|
973 | $ hg update -q -C 1 | |
970 | $ rm f |
|
974 | $ rm f | |
971 | $ ln -s symlink f |
|
975 | $ ln -s symlink f | |
972 | $ hg commit -qm 'f is symlink' |
|
976 | $ hg commit -qm 'f is symlink' | |
973 | $ hg merge -r 2 --tool internal:merge |
|
977 | $ hg merge -r 2 --tool internal:merge | |
974 | merging f |
|
978 | merging f | |
975 | warning: internal :merge cannot merge symlinks for f |
|
979 | warning: internal :merge cannot merge symlinks for f | |
976 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
980 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') | |
977 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
981 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
978 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
982 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
979 | [1] |
|
983 | [1] | |
980 |
|
984 | |||
981 | #endif |
|
985 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now