Show More
@@ -545,6 +545,13 b' class mergestate(object):' | |||||
545 |
|
545 | |||
546 | return hex(hashutil.sha1(path).digest()) |
|
546 | return hex(hashutil.sha1(path).digest()) | |
547 |
|
547 | |||
|
548 | def _make_backup(self, fctx, localkey): | |||
|
549 | self._repo.vfs.write(b'merge/' + localkey, fctx.data()) | |||
|
550 | ||||
|
551 | def _restore_backup(self, fctx, localkey, flags): | |||
|
552 | with self._repo.vfs(b'merge/' + localkey) as f: | |||
|
553 | fctx.write(f.read(), flags) | |||
|
554 | ||||
548 | def add(self, fcl, fco, fca, fd): |
|
555 | def add(self, fcl, fco, fca, fd): | |
549 | """add a new (potentially?) conflicting file the merge state |
|
556 | """add a new (potentially?) conflicting file the merge state | |
550 | fcl: file context for local, |
|
557 | fcl: file context for local, | |
@@ -558,7 +565,7 b' class mergestate(object):' | |||||
558 | localkey = nullhex |
|
565 | localkey = nullhex | |
559 | else: |
|
566 | else: | |
560 | localkey = mergestate.getlocalkey(fcl.path()) |
|
567 | localkey = mergestate.getlocalkey(fcl.path()) | |
561 | self._repo.vfs.write(b'merge/' + localkey, fcl.data()) |
|
568 | self._make_backup(fcl, localkey) | |
562 | self._state[fd] = [ |
|
569 | self._state[fd] = [ | |
563 | MERGE_RECORD_UNRESOLVED, |
|
570 | MERGE_RECORD_UNRESOLVED, | |
564 | localkey, |
|
571 | localkey, | |
@@ -664,9 +671,7 b' class mergestate(object):' | |||||
664 | if preresolve: |
|
671 | if preresolve: | |
665 | # restore local |
|
672 | # restore local | |
666 | if localkey != nullhex: |
|
673 | if localkey != nullhex: | |
667 |
|
|
674 | self._restore_backup(wctx[dfile], localkey, flags) | |
668 | wctx[dfile].write(f.read(), flags) |
|
|||
669 | f.close() |
|
|||
670 | else: |
|
675 | else: | |
671 | wctx[dfile].remove(ignoremissing=True) |
|
676 | wctx[dfile].remove(ignoremissing=True) | |
672 | complete, merge_ret, deleted = filemerge.premerge( |
|
677 | complete, merge_ret, deleted = filemerge.premerge( |
General Comments 0
You need to be logged in to leave comments.
Login now