##// END OF EJS Templates
filemerge: raise InMemoryMergeConflictsError if we hit merge conflicts in IMM...
Phil Cohen -
r35283:46d7f071 default
parent child Browse files
Show More
@@ -241,6 +241,12 b' def _iprompt(repo, mynode, orig, fcd, fc'
241 ui = repo.ui
241 ui = repo.ui
242 fd = fcd.path()
242 fd = fcd.path()
243
243
244 # Avoid prompting during an in-memory merge since it doesn't support merge
245 # conflicts.
246 if fcd.changectx().isinmemory():
247 raise error.InMemoryMergeConflictsError('in-memory merge does not '
248 'support file conflicts')
249
244 prompts = partextras(labels)
250 prompts = partextras(labels)
245 prompts['fd'] = fd
251 prompts['fd'] = fd
246 try:
252 try:
@@ -465,11 +471,10 b' def _idump(repo, mynode, orig, fcd, fco,'
465 a = _workingpath(repo, fcd)
471 a = _workingpath(repo, fcd)
466 fd = fcd.path()
472 fd = fcd.path()
467
473
468 # Run ``flushall()`` to make any missing folders the following wwrite
469 # calls might be depending on.
470 from . import context
474 from . import context
471 if isinstance(fcd, context.overlayworkingfilectx):
475 if isinstance(fcd, context.overlayworkingfilectx):
472 fcd.changectx().flushall()
476 raise error.InMemoryMergeConflictsError('in-memory merge does not '
477 'support the :dump tool.')
473
478
474 util.writefile(a + ".local", fcd.decodeddata())
479 util.writefile(a + ".local", fcd.decodeddata())
475 repo.wwrite(fd + ".other", fco.data(), fco.flags())
480 repo.wwrite(fd + ".other", fco.data(), fco.flags())
@@ -688,10 +693,10 b' def _filemerge(premerge, repo, wctx, myn'
688 onfailure = _("merging %s failed!\n")
693 onfailure = _("merging %s failed!\n")
689 precheck = None
694 precheck = None
690
695
691 # If using deferred writes, must flush any deferred contents if running
696 if wctx.isinmemory():
692 # an external merge tool since it has arbitrary access to the working
697 raise error.InMemoryMergeConflictsError('in-memory merge does not '
693 # copy.
698 'support external merge '
694 wctx.flushall()
699 'tools')
695
700
696 toolconf = tool, toolpath, binary, symlink
701 toolconf = tool, toolpath, binary, symlink
697
702
@@ -710,6 +715,10 b' def _filemerge(premerge, repo, wctx, myn'
710 if precheck and not precheck(repo, mynode, orig, fcd, fco, fca,
715 if precheck and not precheck(repo, mynode, orig, fcd, fco, fca,
711 toolconf):
716 toolconf):
712 if onfailure:
717 if onfailure:
718 if wctx.isinmemory():
719 raise error.InMemoryMergeConflictsError('in-memory merge does '
720 'not support merge '
721 'conflicts')
713 ui.warn(onfailure % fd)
722 ui.warn(onfailure % fd)
714 return True, 1, False
723 return True, 1, False
715
724
@@ -736,6 +745,10 b' def _filemerge(premerge, repo, wctx, myn'
736
745
737 if r:
746 if r:
738 if onfailure:
747 if onfailure:
748 if wctx.isinmemory():
749 raise error.InMemoryMergeConflictsError('in-memory merge '
750 'does not support '
751 'merge conflicts')
739 ui.warn(onfailure % fd)
752 ui.warn(onfailure % fd)
740 _onfilemergefailure(ui)
753 _onfilemergefailure(ui)
741
754
General Comments 0
You need to be logged in to leave comments. Login now