Show More
@@ -16,8 +16,6 b' def filemerge(repo, fw, fo, fd, wctx, mc' | |||||
16 | fw = filename in the working directory and first parent |
|
16 | fw = filename in the working directory and first parent | |
17 | fo = filename in other parent |
|
17 | fo = filename in other parent | |
18 | fd = destination filename |
|
18 | fd = destination filename | |
19 | my = fileid in first parent |
|
|||
20 | other = fileid in second parent |
|
|||
21 | wctx, mctx = working and merge changecontexts |
|
19 | wctx, mctx = working and merge changecontexts | |
22 | move = whether to move or copy the file to the destination |
|
20 | move = whether to move or copy the file to the destination | |
23 |
|
21 | |||
@@ -212,7 +210,7 b' def manifestmerge(repo, p1, p2, pa, over' | |||||
212 | a = ma.get(f, nullid) |
|
210 | a = ma.get(f, nullid) | |
213 | # are both different from the ancestor? |
|
211 | # are both different from the ancestor? | |
214 | if not overwrite and n != a and m2[f] != a: |
|
212 | if not overwrite and n != a and m2[f] != a: | |
215 |
act("versions differ", f, "m", fmerge(f) |
|
213 | act("versions differ", f, "m", fmerge(f)) | |
216 | # are we clobbering? |
|
214 | # are we clobbering? | |
217 | # is remote's version newer? |
|
215 | # is remote's version newer? | |
218 | # or are we going back in time and clean? |
|
216 | # or are we going back in time and clean? | |
@@ -229,14 +227,14 b' def manifestmerge(repo, p1, p2, pa, over' | |||||
229 | f2 = copy[f] |
|
227 | f2 = copy[f] | |
230 | if f in ma: # case 3,20 A/B/A |
|
228 | if f in ma: # case 3,20 A/B/A | |
231 | act("remote moved", |
|
229 | act("remote moved", | |
232 |
f, "c", f2, f2 |
|
230 | f, "c", f2, f2, fmerge(f, f2, f), True) | |
233 | else: |
|
231 | else: | |
234 | if f2 in m1: # case 2 A,B/B/B |
|
232 | if f2 in m1: # case 2 A,B/B/B | |
235 | act("local copied", |
|
233 | act("local copied", | |
236 |
f, "c", f2, f |
|
234 | f, "c", f2, f, fmerge(f, f2, f2), False) | |
237 | else: # case 4,21 A/B/B |
|
235 | else: # case 4,21 A/B/B | |
238 | act("local moved", |
|
236 | act("local moved", | |
239 |
f, "c", f2, f |
|
237 | f, "c", f2, f, fmerge(f, f2, f2), False) | |
240 | elif f in ma: |
|
238 | elif f in ma: | |
241 | if n != ma[f] and not overwrite: |
|
239 | if n != ma[f] and not overwrite: | |
242 | if repo.ui.prompt( |
|
240 | if repo.ui.prompt( | |
@@ -260,8 +258,7 b' def manifestmerge(repo, p1, p2, pa, over' | |||||
260 | if f2 not in m2: # already seen |
|
258 | if f2 not in m2: # already seen | |
261 | continue |
|
259 | continue | |
262 | # rename case 1, A/A,B/A |
|
260 | # rename case 1, A/A,B/A | |
263 | act("remote copied", |
|
261 | act("remote copied", f2, "c", f, f, fmerge(f2, f, f2), False) | |
264 | f2, "c", f, f, m1[f2], m2[f], fmerge(f2, f, f2), False) |
|
|||
265 | elif f in ma: |
|
262 | elif f in ma: | |
266 | if overwrite or backwards: |
|
263 | if overwrite or backwards: | |
267 | act("recreating", f, "g", m2.execf(f), n) |
|
264 | act("recreating", f, "g", m2.execf(f), n) | |
@@ -293,14 +290,14 b' def applyupdates(repo, action, wctx, mct' | |||||
293 | (f, inst.strerror)) |
|
290 | (f, inst.strerror)) | |
294 | removed +=1 |
|
291 | removed +=1 | |
295 | elif m == "c": # copy |
|
292 | elif m == "c": # copy | |
296 |
f2, fd |
|
293 | f2, fd, flag, move = a[2:] | |
297 | repo.ui.status(_("merging %s and %s to %s\n") % (f, f2, fd)) |
|
294 | repo.ui.status(_("merging %s and %s to %s\n") % (f, f2, fd)) | |
298 | if filemerge(repo, f, f2, fd, wctx, mctx, move): |
|
295 | if filemerge(repo, f, f2, fd, wctx, mctx, move): | |
299 | unresolved += 1 |
|
296 | unresolved += 1 | |
300 | util.set_exec(repo.wjoin(fd), flag) |
|
297 | util.set_exec(repo.wjoin(fd), flag) | |
301 | merged += 1 |
|
298 | merged += 1 | |
302 | elif m == "m": # merge |
|
299 | elif m == "m": # merge | |
303 |
flag |
|
300 | flag = a[2] | |
304 | repo.ui.status(_("merging %s\n") % f) |
|
301 | repo.ui.status(_("merging %s\n") % f) | |
305 | if filemerge(repo, f, f, f, wctx, mctx, False): |
|
302 | if filemerge(repo, f, f, f, wctx, mctx, False): | |
306 | unresolved += 1 |
|
303 | unresolved += 1 | |
@@ -309,17 +306,17 b' def applyupdates(repo, action, wctx, mct' | |||||
309 | elif m == "g": # get |
|
306 | elif m == "g": # get | |
310 | flag, node = a[2:] |
|
307 | flag, node = a[2:] | |
311 | repo.ui.note(_("getting %s\n") % f) |
|
308 | repo.ui.note(_("getting %s\n") % f) | |
312 |
t = |
|
309 | t = mctx.filectx(f).data() | |
313 | repo.wwrite(f, t) |
|
310 | repo.wwrite(f, t) | |
314 | util.set_exec(repo.wjoin(f), flag) |
|
311 | util.set_exec(repo.wjoin(f), flag) | |
315 | updated += 1 |
|
312 | updated += 1 | |
316 | elif m == "e": # exec |
|
313 | elif m == "e": # exec | |
317 |
flag = a[2 |
|
314 | flag = a[2] | |
318 | util.set_exec(repo.wjoin(f), flag) |
|
315 | util.set_exec(repo.wjoin(f), flag) | |
319 |
|
316 | |||
320 | return updated, merged, removed, unresolved |
|
317 | return updated, merged, removed, unresolved | |
321 |
|
318 | |||
322 | def recordupdates(repo, action, branchmerge): |
|
319 | def recordupdates(repo, action, branchmerge, mctx): | |
323 | for a in action: |
|
320 | for a in action: | |
324 | f, m = a[:2] |
|
321 | f, m = a[:2] | |
325 | if m == "r": # remove |
|
322 | if m == "r": # remove | |
@@ -335,7 +332,7 b' def recordupdates(repo, action, branchme' | |||||
335 | else: |
|
332 | else: | |
336 | repo.dirstate.update([f], 'n') |
|
333 | repo.dirstate.update([f], 'n') | |
337 | elif m == "m": # merge |
|
334 | elif m == "m": # merge | |
338 |
flag |
|
335 | flag = a[2] | |
339 | if branchmerge: |
|
336 | if branchmerge: | |
340 | # We've done a branch merge, mark this file as merged |
|
337 | # We've done a branch merge, mark this file as merged | |
341 | # so that we properly record the merger later |
|
338 | # so that we properly record the merger later | |
@@ -347,10 +344,10 b' def recordupdates(repo, action, branchme' | |||||
347 | # merge will appear as a normal local file |
|
344 | # merge will appear as a normal local file | |
348 | # modification. |
|
345 | # modification. | |
349 | fl = repo.file(f) |
|
346 | fl = repo.file(f) | |
350 |
f_len = fl.size( |
|
347 | f_len = mctx.filectx(f).size() | |
351 | repo.dirstate.update([f], 'n', st_size=f_len, st_mtime=-1) |
|
348 | repo.dirstate.update([f], 'n', st_size=f_len, st_mtime=-1) | |
352 | elif m == "c": # copy |
|
349 | elif m == "c": # copy | |
353 |
f2, fd |
|
350 | f2, fd, flag, move = a[2:] | |
354 | if branchmerge: |
|
351 | if branchmerge: | |
355 | # We've done a branch merge, mark this file as merged |
|
352 | # We've done a branch merge, mark this file as merged | |
356 | # so that we properly record the merger later |
|
353 | # so that we properly record the merger later | |
@@ -362,7 +359,7 b' def recordupdates(repo, action, branchme' | |||||
362 | # merge will appear as a normal local file |
|
359 | # merge will appear as a normal local file | |
363 | # modification. |
|
360 | # modification. | |
364 | fl = repo.file(f) |
|
361 | fl = repo.file(f) | |
365 |
f_len = fl.size( |
|
362 | f_len = mctx.filectx(f).size() | |
366 | repo.dirstate.update([fd], 'n', st_size=f_len, st_mtime=-1) |
|
363 | repo.dirstate.update([fd], 'n', st_size=f_len, st_mtime=-1) | |
367 | if move: |
|
364 | if move: | |
368 | repo.dirstate.update([f], 'r') |
|
365 | repo.dirstate.update([f], 'r') | |
@@ -437,7 +434,7 b' def update(repo, node, branchmerge=False' | |||||
437 |
|
434 | |||
438 | # update dirstate |
|
435 | # update dirstate | |
439 | if not partial: |
|
436 | if not partial: | |
440 | recordupdates(repo, action, branchmerge) |
|
437 | recordupdates(repo, action, branchmerge, p2) | |
441 | repo.dirstate.setparents(fp1, fp2) |
|
438 | repo.dirstate.setparents(fp1, fp2) | |
442 | repo.hook('update', parent1=xp1, parent2=xp2, error=unresolved) |
|
439 | repo.hook('update', parent1=xp1, parent2=xp2, error=unresolved) | |
443 |
|
440 |
General Comments 0
You need to be logged in to leave comments.
Login now