Show More
@@ -945,7 +945,7 class fold(histeditaction): | |||
|
945 | 945 | class base(histeditaction): |
|
946 | 946 | def run(self): |
|
947 | 947 | if self.repo[b'.'].node() != self.node: |
|
948 |
mergemod.update(self.repo |
|
|
948 | mergemod.clean_update(self.repo[self.node]) | |
|
949 | 949 | return self.continueclean() |
|
950 | 950 | |
|
951 | 951 | def continuedirty(self): |
@@ -800,9 +800,7 class rebaseruntime(object): | |||
|
800 | 800 | |
|
801 | 801 | # Update away from the rebase if necessary |
|
802 | 802 | if shouldupdate: |
|
803 | mergemod.update( | |
|
804 | repo, self.originalwd, branchmerge=False, force=True | |
|
805 | ) | |
|
803 | mergemod.clean_update(repo[self.originalwd]) | |
|
806 | 804 | |
|
807 | 805 | # Strip from the first rebased revision |
|
808 | 806 | if rebased: |
@@ -1477,7 +1475,7 def rebasenode(repo, rev, p1, base, coll | |||
|
1477 | 1475 | else: |
|
1478 | 1476 | if repo[b'.'].rev() != p1: |
|
1479 | 1477 | repo.ui.debug(b" update to %d:%s\n" % (p1, p1ctx)) |
|
1480 | mergemod.update(repo, p1, branchmerge=False, force=True) | |
|
1478 | mergemod.clean_update(p1ctx) | |
|
1481 | 1479 | else: |
|
1482 | 1480 | repo.ui.debug(b" already in destination\n") |
|
1483 | 1481 | # This is, alas, necessary to invalidate workingctx's manifest cache, |
@@ -1173,7 +1173,7 def abortmerge(ui, repo): | |||
|
1173 | 1173 | node = repo[b'.'].hex() |
|
1174 | 1174 | |
|
1175 | 1175 | repo.ui.status(_(b"aborting the merge, updating back to %s\n") % node[:12]) |
|
1176 |
stats = mergemod.update(repo |
|
|
1176 | stats = mergemod.clean_update(repo[node]) | |
|
1177 | 1177 | assert stats.unresolvedcount == 0 |
|
1178 | 1178 | _showstats(repo, stats) |
|
1179 | 1179 |
@@ -2597,6 +2597,15 def update( | |||
|
2597 | 2597 | return stats |
|
2598 | 2598 | |
|
2599 | 2599 | |
|
2600 | def clean_update(ctx, wc=None): | |
|
2601 | """Do a clean update to the given commit. | |
|
2602 | ||
|
2603 | This involves updating to the commit and discarding any changes in the | |
|
2604 | working copy. | |
|
2605 | """ | |
|
2606 | return update(ctx.repo(), ctx.rev(), branchmerge=False, force=True, wc=wc) | |
|
2607 | ||
|
2608 | ||
|
2600 | 2609 | def graft( |
|
2601 | 2610 | repo, |
|
2602 | 2611 | ctx, |
@@ -745,7 +745,7 def unshelveabort(ui, repo, state): | |||
|
745 | 745 | try: |
|
746 | 746 | checkparents(repo, state) |
|
747 | 747 | |
|
748 |
merge.update( |
|
|
748 | merge.clean_update(state.pendingctx) | |
|
749 | 749 | if state.activebookmark and state.activebookmark in repo._bookmarks: |
|
750 | 750 | bookmarks.activate(repo, state.activebookmark) |
|
751 | 751 | mergefiles(ui, repo, state.wctx, state.pendingctx) |
General Comments 0
You need to be logged in to leave comments.
Login now