##// END OF EJS Templates
mergestate._resolve: handle change/delete conflicts...
Siddharth Agarwal -
r27048:86290f6f default
parent child Browse files
Show More
@@ -414,8 +414,9 b' class mergestate(object):'
414 stateentry = self._state[dfile]
414 stateentry = self._state[dfile]
415 state, hash, lfile, afile, anode, ofile, onode, flags = stateentry
415 state, hash, lfile, afile, anode, ofile, onode, flags = stateentry
416 octx = self._repo[self._other]
416 octx = self._repo[self._other]
417 fcd = wctx[dfile]
417 fcd = self._filectxorabsent(hash, wctx, dfile)
418 fco = octx[ofile]
418 fco = self._filectxorabsent(onode, octx, ofile)
419 # TODO: move this to filectxorabsent
419 fca = self._repo.filectx(afile, fileid=anode)
420 fca = self._repo.filectx(afile, fileid=anode)
420 # "premerge" x flags
421 # "premerge" x flags
421 flo = fco.flags()
422 flo = fco.flags()
@@ -429,9 +430,12 b' class mergestate(object):'
429 flags = flo
430 flags = flo
430 if preresolve:
431 if preresolve:
431 # restore local
432 # restore local
432 f = self._repo.vfs('merge/' + hash)
433 if hash != nullhex:
433 self._repo.wwrite(dfile, f.read(), flags)
434 f = self._repo.vfs('merge/' + hash)
434 f.close()
435 self._repo.wwrite(dfile, f.read(), flags)
436 f.close()
437 else:
438 self._repo.wvfs.unlinkpath(dfile, ignoremissing=True)
435 complete, r, deleted = filemerge.premerge(self._repo, self._local,
439 complete, r, deleted = filemerge.premerge(self._repo, self._local,
436 lfile, fcd, fco, fca,
440 lfile, fcd, fco, fca,
437 labels=labels)
441 labels=labels)
@@ -462,6 +466,12 b' class mergestate(object):'
462
466
463 return complete, r, action
467 return complete, r, action
464
468
469 def _filectxorabsent(self, hexnode, ctx, f):
470 if hexnode == nullhex:
471 return filemerge.absentfilectx(ctx, f)
472 else:
473 return ctx[f]
474
465 def preresolve(self, dfile, wctx, labels=None):
475 def preresolve(self, dfile, wctx, labels=None):
466 """run premerge process for dfile
476 """run premerge process for dfile
467
477
General Comments 0
You need to be logged in to leave comments. Login now