##// END OF EJS Templates
merge: migrate to context manager for changing dirstate parents
Augie Fackler -
r32351:c568c187 default
parent child Browse files
Show More
@@ -1696,15 +1696,14 b' def update(repo, node, branchmerge, forc'
1696 1696 stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
1697 1697
1698 1698 if not partial:
1699 repo.dirstate.beginparentchange()
1700 repo.setparents(fp1, fp2)
1701 recordupdates(repo, actions, branchmerge)
1702 # update completed, clear state
1703 util.unlink(repo.vfs.join('updatestate'))
1699 with repo.dirstate.parentchange():
1700 repo.setparents(fp1, fp2)
1701 recordupdates(repo, actions, branchmerge)
1702 # update completed, clear state
1703 util.unlink(repo.vfs.join('updatestate'))
1704 1704
1705 if not branchmerge:
1706 repo.dirstate.setbranch(p2.branch())
1707 repo.dirstate.endparentchange()
1705 if not branchmerge:
1706 repo.dirstate.setbranch(p2.branch())
1708 1707
1709 1708 if not partial:
1710 1709 repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3])
@@ -1742,10 +1741,9 b' def graft(repo, ctx, pctx, labels, keepp'
1742 1741 parents.remove(pctx)
1743 1742 pother = parents[0].node()
1744 1743
1745 repo.dirstate.beginparentchange()
1746 repo.setparents(repo['.'].node(), pother)
1747 repo.dirstate.write(repo.currenttransaction())
1748 # fix up dirstate for copies and renames
1749 copies.duplicatecopies(repo, ctx.rev(), pctx.rev())
1750 repo.dirstate.endparentchange()
1744 with repo.dirstate.parentchange():
1745 repo.setparents(repo['.'].node(), pother)
1746 repo.dirstate.write(repo.currenttransaction())
1747 # fix up dirstate for copies and renames
1748 copies.duplicatecopies(repo, ctx.rev(), pctx.rev())
1751 1749 return stats
General Comments 0
You need to be logged in to leave comments. Login now