822 # the backout should appear on the same branch |
821 # the backout should appear on the same branch |
823 branch = repo.dirstate.branch() |
822 branch = repo.dirstate.branch() |
824 bheads = repo.branchheads(branch) |
823 bheads = repo.branchheads(branch) |
825 rctx = scmutil.revsingle(repo, hex(parent)) |
824 rctx = scmutil.revsingle(repo, hex(parent)) |
826 if not opts.get(b'merge') and op1 != node: |
825 if not opts.get(b'merge') and op1 != node: |
827 with dirstateguard.dirstateguard(repo, b'backout'): |
826 with repo.transaction(b"backout"): |
828 overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')} |
827 overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')} |
829 with ui.configoverride(overrides, b'backout'): |
828 with ui.configoverride(overrides, b'backout'): |
830 stats = mergemod.back_out(ctx, parent=repo[parent]) |
829 stats = mergemod.back_out(ctx, parent=repo[parent]) |
831 repo.setparents(op1, op2) |
830 repo.setparents(op1, op2) |
832 hg._showstats(repo, stats) |
831 hg._showstats(repo, stats) |