##// END OF EJS Templates
filemerge: use contexts rather than my and other
Matt Mackall -
r3299:e7abcf3a default
parent child Browse files
Show More
@@ -10,7 +10,7 b' from i18n import gettext as _'
10 from demandload import *
10 from demandload import *
11 demandload(globals(), "errno util os tempfile")
11 demandload(globals(), "errno util os tempfile")
12
12
13 def filemerge(repo, fw, fo, fd, my, other, wctx, mctx, move):
13 def filemerge(repo, fw, fo, fd, wctx, mctx, move):
14 """perform a 3-way merge in the working directory
14 """perform a 3-way merge in the working directory
15
15
16 fw = filename in the working directory and first parent
16 fw = filename in the working directory and first parent
@@ -34,8 +34,8 b' def filemerge(repo, fw, fo, fd, my, othe'
34 f.close()
34 f.close()
35 return name
35 return name
36
36
37 fcm = repo.filectx(fw, fileid=my)
37 fcm = wctx.filectx(fw)
38 fco = repo.filectx(fo, fileid=other)
38 fco = mctx.filectx(fo)
39 fca = fcm.ancestor(fco)
39 fca = fcm.ancestor(fco)
40 if not fca:
40 if not fca:
41 fca = repo.filectx(fw, fileid=-1)
41 fca = repo.filectx(fw, fileid=-1)
@@ -295,14 +295,14 b' def applyupdates(repo, action, wctx, mct'
295 elif m == "c": # copy
295 elif m == "c": # copy
296 f2, fd, my, other, flag, move = a[2:]
296 f2, fd, my, other, flag, move = a[2:]
297 repo.ui.status(_("merging %s and %s to %s\n") % (f, f2, fd))
297 repo.ui.status(_("merging %s and %s to %s\n") % (f, f2, fd))
298 if filemerge(repo, f, f2, fd, my, other, wctx, mctx, move):
298 if filemerge(repo, f, f2, fd, wctx, mctx, move):
299 unresolved += 1
299 unresolved += 1
300 util.set_exec(repo.wjoin(fd), flag)
300 util.set_exec(repo.wjoin(fd), flag)
301 merged += 1
301 merged += 1
302 elif m == "m": # merge
302 elif m == "m": # merge
303 flag, my, other = a[2:]
303 flag, my, other = a[2:]
304 repo.ui.status(_("merging %s\n") % f)
304 repo.ui.status(_("merging %s\n") % f)
305 if filemerge(repo, f, f, f, my, other, wctx, mctx, False):
305 if filemerge(repo, f, f, f, wctx, mctx, False):
306 unresolved += 1
306 unresolved += 1
307 util.set_exec(repo.wjoin(f), flag)
307 util.set_exec(repo.wjoin(f), flag)
308 merged += 1
308 merged += 1
@@ -27,7 +27,7 b' resolving manifests'
27 test.txt: versions differ -> m
27 test.txt: versions differ -> m
28 merging test.txt
28 merging test.txt
29 resolving test.txt
29 resolving test.txt
30 my test.txt@451c744aabcc other test.txt@a070d41e8360 ancestor test.txt@faaea63e63a9
30 my test.txt@. other test.txt@a070d41e8360 ancestor test.txt@faaea63e63a9
31 merging test.txt failed!
31 merging test.txt failed!
32 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
32 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
33 There are unresolved merges, you can redo the full merge using:
33 There are unresolved merges, you can redo the full merge using:
@@ -8,7 +8,7 b' resolving manifests'
8 b2: remote created -> g
8 b2: remote created -> g
9 merging a and b to b
9 merging a and b to b
10 resolving a
10 resolving a
11 my a@f26ec4fc3fa3 other b@8e765a822af2 ancestor a@af1939970a1c
11 my a@. other b@8e765a822af2 ancestor a@af1939970a1c
12 copying a to b
12 copying a to b
13 removing a
13 removing a
14 getting b2
14 getting b2
@@ -8,11 +8,11 b' resolving manifests'
8 a: remote copied -> c
8 a: remote copied -> c
9 merging a and b to b
9 merging a and b to b
10 resolving a
10 resolving a
11 my a@e300d1c794ec other b@735846fee2d7 ancestor a@924404dff337
11 my a@. other b@735846fee2d7 ancestor a@924404dff337
12 copying a to b
12 copying a to b
13 merging rev
13 merging rev
14 resolving rev
14 resolving rev
15 my rev@e300d1c794ec other rev@735846fee2d7 ancestor rev@924404dff337
15 my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
16 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
16 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
17 (branch merge, don't forget to commit)
17 (branch merge, don't forget to commit)
18 --------------
18 --------------
@@ -33,10 +33,10 b' resolving manifests'
33 getting a
33 getting a
34 merging b and a to b
34 merging b and a to b
35 resolving b
35 resolving b
36 my b@ac809aeed39a other a@f4db7e329e71 ancestor a@924404dff337
36 my b@. other a@f4db7e329e71 ancestor a@924404dff337
37 merging rev
37 merging rev
38 resolving rev
38 resolving rev
39 my rev@ac809aeed39a other rev@f4db7e329e71 ancestor rev@924404dff337
39 my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
40 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
40 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
41 (branch merge, don't forget to commit)
41 (branch merge, don't forget to commit)
42 --------------
42 --------------
@@ -55,12 +55,12 b' resolving manifests'
55 rev: versions differ -> m
55 rev: versions differ -> m
56 merging a and b to b
56 merging a and b to b
57 resolving a
57 resolving a
58 my a@e300d1c794ec other b@e03727d2d66b ancestor a@924404dff337
58 my a@. other b@e03727d2d66b ancestor a@924404dff337
59 copying a to b
59 copying a to b
60 removing a
60 removing a
61 merging rev
61 merging rev
62 resolving rev
62 resolving rev
63 my rev@e300d1c794ec other rev@e03727d2d66b ancestor rev@924404dff337
63 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
64 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
64 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
65 (branch merge, don't forget to commit)
65 (branch merge, don't forget to commit)
66 --------------
66 --------------
@@ -78,10 +78,10 b' resolving manifests'
78 rev: versions differ -> m
78 rev: versions differ -> m
79 merging b and a to b
79 merging b and a to b
80 resolving b
80 resolving b
81 my b@ecf3cb2a4219 other a@f4db7e329e71 ancestor a@924404dff337
81 my b@. other a@f4db7e329e71 ancestor a@924404dff337
82 merging rev
82 merging rev
83 resolving rev
83 resolving rev
84 my rev@ecf3cb2a4219 other rev@f4db7e329e71 ancestor rev@924404dff337
84 my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
85 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
85 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
86 (branch merge, don't forget to commit)
86 (branch merge, don't forget to commit)
87 --------------
87 --------------
@@ -99,11 +99,11 b' resolving manifests'
99 a: remote copied -> c
99 a: remote copied -> c
100 merging a and b to b
100 merging a and b to b
101 resolving a
101 resolving a
102 my a@924404dff337 other b@735846fee2d7 ancestor a@924404dff337
102 my a@. other b@735846fee2d7 ancestor a@924404dff337
103 copying a to b
103 copying a to b
104 merging rev
104 merging rev
105 resolving rev
105 resolving rev
106 my rev@94b33a1b7f2d other rev@735846fee2d7 ancestor rev@924404dff337
106 my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
107 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
107 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
108 (branch merge, don't forget to commit)
108 (branch merge, don't forget to commit)
109 --------------
109 --------------
@@ -122,10 +122,10 b' resolving manifests'
122 rev: versions differ -> m
122 rev: versions differ -> m
123 merging b and a to b
123 merging b and a to b
124 resolving b
124 resolving b
125 my b@ac809aeed39a other a@924404dff337 ancestor a@924404dff337
125 my b@. other a@97c705ade336 ancestor a@924404dff337
126 merging rev
126 merging rev
127 resolving rev
127 resolving rev
128 my rev@ac809aeed39a other rev@97c705ade336 ancestor rev@924404dff337
128 my rev@. other rev@97c705ade336 ancestor rev@924404dff337
129 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
129 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
130 (branch merge, don't forget to commit)
130 (branch merge, don't forget to commit)
131 --------------
131 --------------
@@ -144,12 +144,12 b' resolving manifests'
144 rev: versions differ -> m
144 rev: versions differ -> m
145 merging a and b to b
145 merging a and b to b
146 resolving a
146 resolving a
147 my a@924404dff337 other b@e03727d2d66b ancestor a@924404dff337
147 my a@. other b@e03727d2d66b ancestor a@924404dff337
148 copying a to b
148 copying a to b
149 removing a
149 removing a
150 merging rev
150 merging rev
151 resolving rev
151 resolving rev
152 my rev@94b33a1b7f2d other rev@e03727d2d66b ancestor rev@924404dff337
152 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
153 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
153 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
154 (branch merge, don't forget to commit)
154 (branch merge, don't forget to commit)
155 --------------
155 --------------
@@ -167,10 +167,10 b' resolving manifests'
167 rev: versions differ -> m
167 rev: versions differ -> m
168 merging b and a to b
168 merging b and a to b
169 resolving b
169 resolving b
170 my b@ecf3cb2a4219 other a@924404dff337 ancestor a@924404dff337
170 my b@. other a@97c705ade336 ancestor a@924404dff337
171 merging rev
171 merging rev
172 resolving rev
172 resolving rev
173 my rev@ecf3cb2a4219 other rev@97c705ade336 ancestor rev@924404dff337
173 my rev@. other rev@97c705ade336 ancestor rev@924404dff337
174 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
174 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
175 (branch merge, don't forget to commit)
175 (branch merge, don't forget to commit)
176 --------------
176 --------------
@@ -188,10 +188,10 b' resolving manifests'
188 rev: versions differ -> m
188 rev: versions differ -> m
189 merging b
189 merging b
190 resolving b
190 resolving b
191 my b@ec03c2ca8642 other b@79cc6877a3b7 ancestor a@924404dff337
191 my b@. other b@79cc6877a3b7 ancestor a@924404dff337
192 merging rev
192 merging rev
193 resolving rev
193 resolving rev
194 my rev@ec03c2ca8642 other rev@79cc6877a3b7 ancestor rev@924404dff337
194 my rev@. other rev@79cc6877a3b7 ancestor rev@924404dff337
195 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
195 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
196 (branch merge, don't forget to commit)
196 (branch merge, don't forget to commit)
197 --------------
197 --------------
@@ -209,7 +209,7 b' resolving manifests'
209 getting c
209 getting c
210 merging rev
210 merging rev
211 resolving rev
211 resolving rev
212 my rev@ecf3cb2a4219 other rev@e6abcc1a30c2 ancestor rev@924404dff337
212 my rev@. other rev@e6abcc1a30c2 ancestor rev@924404dff337
213 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
213 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
214 (branch merge, don't forget to commit)
214 (branch merge, don't forget to commit)
215 --------------
215 --------------
@@ -227,10 +227,10 b' resolving manifests'
227 rev: versions differ -> m
227 rev: versions differ -> m
228 merging b
228 merging b
229 resolving b
229 resolving b
230 my b@ac809aeed39a other b@af30c7647fc7 ancestor b@000000000000
230 my b@. other b@af30c7647fc7 ancestor b@000000000000
231 merging rev
231 merging rev
232 resolving rev
232 resolving rev
233 my rev@ac809aeed39a other rev@af30c7647fc7 ancestor rev@924404dff337
233 my rev@. other rev@af30c7647fc7 ancestor rev@924404dff337
234 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
234 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
235 (branch merge, don't forget to commit)
235 (branch merge, don't forget to commit)
236 --------------
236 --------------
@@ -250,10 +250,10 b' resolving manifests'
250 removing a
250 removing a
251 merging b
251 merging b
252 resolving b
252 resolving b
253 my b@59318016310c other b@e03727d2d66b ancestor b@000000000000
253 my b@. other b@e03727d2d66b ancestor b@000000000000
254 merging rev
254 merging rev
255 resolving rev
255 resolving rev
256 my rev@59318016310c other rev@e03727d2d66b ancestor rev@924404dff337
256 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
257 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
257 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
258 (branch merge, don't forget to commit)
258 (branch merge, don't forget to commit)
259 --------------
259 --------------
@@ -272,10 +272,10 b' resolving manifests'
272 getting a
272 getting a
273 merging b
273 merging b
274 resolving b
274 resolving b
275 my b@ac809aeed39a other b@8dbce441892a ancestor b@000000000000
275 my b@. other b@8dbce441892a ancestor b@000000000000
276 merging rev
276 merging rev
277 resolving rev
277 resolving rev
278 my rev@ac809aeed39a other rev@8dbce441892a ancestor rev@924404dff337
278 my rev@. other rev@8dbce441892a ancestor rev@924404dff337
279 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
279 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
280 (branch merge, don't forget to commit)
280 (branch merge, don't forget to commit)
281 --------------
281 --------------
@@ -295,10 +295,10 b' resolving manifests'
295 removing a
295 removing a
296 merging b
296 merging b
297 resolving b
297 resolving b
298 my b@59318016310c other b@e03727d2d66b ancestor b@000000000000
298 my b@. other b@e03727d2d66b ancestor b@000000000000
299 merging rev
299 merging rev
300 resolving rev
300 resolving rev
301 my rev@59318016310c other rev@e03727d2d66b ancestor rev@924404dff337
301 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
302 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
302 0 files updated, 2 files merged, 1 files removed, 0 files unresolved
303 (branch merge, don't forget to commit)
303 (branch merge, don't forget to commit)
304 --------------
304 --------------
@@ -317,10 +317,10 b' resolving manifests'
317 getting a
317 getting a
318 merging b
318 merging b
319 resolving b
319 resolving b
320 my b@ac809aeed39a other b@8dbce441892a ancestor b@000000000000
320 my b@. other b@8dbce441892a ancestor b@000000000000
321 merging rev
321 merging rev
322 resolving rev
322 resolving rev
323 my rev@ac809aeed39a other rev@8dbce441892a ancestor rev@924404dff337
323 my rev@. other rev@8dbce441892a ancestor rev@924404dff337
324 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
324 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
325 (branch merge, don't forget to commit)
325 (branch merge, don't forget to commit)
326 --------------
326 --------------
@@ -338,10 +338,10 b' resolving manifests'
338 rev: versions differ -> m
338 rev: versions differ -> m
339 merging b
339 merging b
340 resolving b
340 resolving b
341 my b@0b76e65c8289 other b@735846fee2d7 ancestor b@000000000000
341 my b@. other b@735846fee2d7 ancestor b@000000000000
342 merging rev
342 merging rev
343 resolving rev
343 resolving rev
344 my rev@0b76e65c8289 other rev@735846fee2d7 ancestor rev@924404dff337
344 my rev@. other rev@735846fee2d7 ancestor rev@924404dff337
345 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
345 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
346 (branch merge, don't forget to commit)
346 (branch merge, don't forget to commit)
347 --------------
347 --------------
@@ -361,10 +361,10 b' resolving manifests'
361 getting a
361 getting a
362 merging b
362 merging b
363 resolving b
363 resolving b
364 my b@ecf3cb2a4219 other b@8dbce441892a ancestor b@000000000000
364 my b@. other b@8dbce441892a ancestor b@000000000000
365 merging rev
365 merging rev
366 resolving rev
366 resolving rev
367 my rev@ecf3cb2a4219 other rev@8dbce441892a ancestor rev@924404dff337
367 my rev@. other rev@8dbce441892a ancestor rev@924404dff337
368 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
368 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
369 (branch merge, don't forget to commit)
369 (branch merge, don't forget to commit)
370 --------------
370 --------------
@@ -382,10 +382,10 b' resolving manifests'
382 rev: versions differ -> m
382 rev: versions differ -> m
383 merging b
383 merging b
384 resolving b
384 resolving b
385 my b@0b76e65c8289 other b@e03727d2d66b ancestor b@000000000000
385 my b@. other b@e03727d2d66b ancestor b@000000000000
386 merging rev
386 merging rev
387 resolving rev
387 resolving rev
388 my rev@0b76e65c8289 other rev@e03727d2d66b ancestor rev@924404dff337
388 my rev@. other rev@e03727d2d66b ancestor rev@924404dff337
389 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
389 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
390 (branch merge, don't forget to commit)
390 (branch merge, don't forget to commit)
391 --------------
391 --------------
@@ -403,12 +403,12 b' resolving manifests'
403 rev: versions differ -> m
403 rev: versions differ -> m
404 merging a and b to b
404 merging a and b to b
405 resolving a
405 resolving a
406 my a@e300d1c794ec other b@79cc6877a3b7 ancestor a@924404dff337
406 my a@. other b@79cc6877a3b7 ancestor a@924404dff337
407 copying a to b
407 copying a to b
408 removing a
408 removing a
409 merging rev
409 merging rev
410 resolving rev
410 resolving rev
411 my rev@e300d1c794ec other rev@79cc6877a3b7 ancestor rev@924404dff337
411 my rev@. other rev@79cc6877a3b7 ancestor rev@924404dff337
412 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
412 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
413 (branch merge, don't forget to commit)
413 (branch merge, don't forget to commit)
414 --------------
414 --------------
@@ -426,10 +426,10 b' resolving manifests'
426 rev: versions differ -> m
426 rev: versions differ -> m
427 merging b and a to b
427 merging b and a to b
428 resolving b
428 resolving b
429 my b@ec03c2ca8642 other a@f4db7e329e71 ancestor a@924404dff337
429 my b@. other a@f4db7e329e71 ancestor a@924404dff337
430 merging rev
430 merging rev
431 resolving rev
431 resolving rev
432 my rev@ec03c2ca8642 other rev@f4db7e329e71 ancestor rev@924404dff337
432 my rev@. other rev@f4db7e329e71 ancestor rev@924404dff337
433 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
433 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
434 (branch merge, don't forget to commit)
434 (branch merge, don't forget to commit)
435 --------------
435 --------------
@@ -448,11 +448,11 b' resolving manifests'
448 c: remote created -> g
448 c: remote created -> g
449 merging b and a to b
449 merging b and a to b
450 resolving b
450 resolving b
451 my b@ecf3cb2a4219 other a@2b958612230f ancestor a@924404dff337
451 my b@. other a@2b958612230f ancestor a@924404dff337
452 getting c
452 getting c
453 merging rev
453 merging rev
454 resolving rev
454 resolving rev
455 my rev@ecf3cb2a4219 other rev@2b958612230f ancestor rev@924404dff337
455 my rev@. other rev@2b958612230f ancestor rev@924404dff337
456 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
456 1 files updated, 2 files merged, 0 files removed, 0 files unresolved
457 (branch merge, don't forget to commit)
457 (branch merge, don't forget to commit)
458 --------------
458 --------------
@@ -21,7 +21,7 b' resolving manifests'
21 b: remote created -> g
21 b: remote created -> g
22 merging a
22 merging a
23 resolving a
23 resolving a
24 my a@33aaa84a386b other a@802f095af299 ancestor a@33aaa84a386b
24 my a@. other a@802f095af299 ancestor a@33aaa84a386b
25 getting b
25 getting b
26 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
26 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
27 changeset: 1:802f095af299
27 changeset: 1:802f095af299
@@ -55,7 +55,7 b' resolving manifests'
55 b: remote created -> g
55 b: remote created -> g
56 merging a
56 merging a
57 resolving a
57 resolving a
58 my a@33aaa84a386b other a@802f095af299 ancestor a@33aaa84a386b
58 my a@. other a@802f095af299 ancestor a@33aaa84a386b
59 getting b
59 getting b
60 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
60 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
61 changeset: 1:802f095af299
61 changeset: 1:802f095af299
@@ -106,10 +106,10 b' resolving manifests'
106 b: versions differ -> m
106 b: versions differ -> m
107 merging a
107 merging a
108 resolving a
108 resolving a
109 my a@802f095af299 other a@030602aee63d ancestor a@33aaa84a386b
109 my a@. other a@030602aee63d ancestor a@33aaa84a386b
110 merging b
110 merging b
111 resolving b
111 resolving b
112 my b@802f095af299 other b@030602aee63d ancestor b@000000000000
112 my b@. other b@030602aee63d ancestor b@000000000000
113 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
113 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
114 (branch merge, don't forget to commit)
114 (branch merge, don't forget to commit)
115 changeset: 1:802f095af299
115 changeset: 1:802f095af299
General Comments 0
You need to be logged in to leave comments. Login now