##// END OF EJS Templates
merge: update dirstate correctly for non-branchmerge updates...
Matt Mackall -
r3372:ba7c7408 default
parent child Browse files
Show More
@@ -312,7 +312,7 b' def applyupdates(repo, action, wctx, mct'
312
312
313 return updated, merged, removed, unresolved
313 return updated, merged, removed, unresolved
314
314
315 def recordupdates(repo, action, branchmerge, mctx):
315 def recordupdates(repo, action, branchmerge):
316 "record merge actions to the dirstate"
316 "record merge actions to the dirstate"
317
317
318 for a in action:
318 for a in action:
@@ -335,21 +335,22 b' def recordupdates(repo, action, branchme'
335 # We've done a branch merge, mark this file as merged
335 # We've done a branch merge, mark this file as merged
336 # so that we properly record the merger later
336 # so that we properly record the merger later
337 repo.dirstate.update([fd], 'm')
337 repo.dirstate.update([fd], 'm')
338 if f != f2: # copy/rename
339 if move:
340 repo.dirstate.update([f], 'r')
341 if f != fd:
342 repo.dirstate.copy(f, fd)
343 else:
344 repo.dirstate.copy(f2, fd)
338 else:
345 else:
339 # We've update-merged a locally modified file, so
346 # We've update-merged a locally modified file, so
340 # we set the dirstate to emulate a normal checkout
347 # we set the dirstate to emulate a normal checkout
341 # of that file some time in the past. Thus our
348 # of that file some time in the past. Thus our
342 # merge will appear as a normal local file
349 # merge will appear as a normal local file
343 # modification.
350 # modification.
344 f_len = mctx.filectx(f).size()
351 repo.dirstate.update([fd], 'n', st_size=-1, st_mtime=-1)
345 repo.dirstate.update([fd], 'n', st_size=f_len, st_mtime=-1)
346 if f != f2: # copy/rename
347 if move:
352 if move:
348 repo.dirstate.update([f], 'r')
353 repo.dirstate.forget([f])
349 if f != fd:
350 repo.dirstate.copy(f, fd)
351 else:
352 repo.dirstate.copy(f2, fd)
353
354
354 def update(repo, node, branchmerge, force, partial, wlock):
355 def update(repo, node, branchmerge, force, partial, wlock):
355 """
356 """
@@ -403,7 +404,7 b' def update(repo, node, branchmerge, forc'
403 stats = applyupdates(repo, action, wc, p2)
404 stats = applyupdates(repo, action, wc, p2)
404
405
405 if not partial:
406 if not partial:
406 recordupdates(repo, action, branchmerge, p2)
407 recordupdates(repo, action, branchmerge)
407 repo.dirstate.setparents(fp1, fp2)
408 repo.dirstate.setparents(fp1, fp2)
408 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3])
409 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3])
409
410
General Comments 0
You need to be logged in to leave comments. Login now