573 def applychange(self): |
573 def applychange(self): |
574 """Applies the changes from this action's rulectx onto the current |
574 """Applies the changes from this action's rulectx onto the current |
575 parentctx, but does not commit them.""" |
575 parentctx, but does not commit them.""" |
576 repo = self.repo |
576 repo = self.repo |
577 rulectx = repo[self.node] |
577 rulectx = repo[self.node] |
578 repo.ui.pushbuffer() |
578 with repo.ui.silent(): |
579 hg.update(repo, self.state.parentctxnode, quietempty=True) |
579 hg.update(repo, self.state.parentctxnode, quietempty=True) |
580 repo.ui.popbuffer() |
|
581 stats = applychanges(repo.ui, repo, rulectx, {}) |
580 stats = applychanges(repo.ui, repo, rulectx, {}) |
582 repo.dirstate.setbranch(rulectx.branch()) |
581 repo.dirstate.setbranch(rulectx.branch()) |
583 if stats.unresolvedcount: |
582 if stats.unresolvedcount: |
584 raise error.InterventionRequired( |
583 raise error.InterventionRequired( |
585 _(b'Fix up the change (%s %s)') % (self.verb, short(self.node)), |
584 _(b'Fix up the change (%s %s)') % (self.verb, short(self.node)), |
652 def applychanges(ui, repo, ctx, opts): |
651 def applychanges(ui, repo, ctx, opts): |
653 """Merge changeset from ctx (only) in the current working directory""" |
652 """Merge changeset from ctx (only) in the current working directory""" |
654 if ctx.p1().node() == repo.dirstate.p1(): |
653 if ctx.p1().node() == repo.dirstate.p1(): |
655 # edits are "in place" we do not need to make any merge, |
654 # edits are "in place" we do not need to make any merge, |
656 # just applies changes on parent for editing |
655 # just applies changes on parent for editing |
657 ui.pushbuffer() |
656 with ui.silent(): |
658 cmdutil.revert(ui, repo, ctx, all=True) |
657 cmdutil.revert(ui, repo, ctx, all=True) |
659 stats = mergemod.updateresult(0, 0, 0, 0) |
658 stats = mergemod.updateresult(0, 0, 0, 0) |
660 ui.popbuffer() |
|
661 else: |
659 else: |
662 try: |
660 try: |
663 # ui.forcemerge is an internal variable, do not document |
661 # ui.forcemerge is an internal variable, do not document |
664 repo.ui.setconfig( |
662 repo.ui.setconfig( |
665 b'ui', b'forcemerge', opts.get(b'tool', b''), b'histedit' |
663 b'ui', b'forcemerge', opts.get(b'tool', b''), b'histedit' |