##// END OF EJS Templates
merge: use merge.clean_update() when applicable...
Martin von Zweigbergk -
r46133:03726f5b default
parent child Browse files
Show More
@@ -1099,7 +1099,7 def rebase(ui, repo, **opts):
1099 1099 )
1100 1100 # update to the current working revision
1101 1101 # to clear interrupted merge
1102 hg.updaterepo(repo, rbsrt.originalwd, overwrite=True)
1102 mergemod.clean_update(repo[rbsrt.originalwd])
1103 1103 rbsrt._finishrebase()
1104 1104 return 0
1105 1105 elif inmemory:
@@ -476,7 +476,7 class transplanter(object):
476 476 """logic to stop an interrupted transplant"""
477 477 if self.canresume():
478 478 startctx = repo[b'.']
479 hg.updaterepo(repo, startctx.node(), overwrite=True)
479 merge.clean_update(startctx)
480 480 ui.status(_(b"stopped the interrupted transplant\n"))
481 481 ui.status(
482 482 _(b"working directory is now at %s\n") % startctx.hex()[:12]
@@ -4154,7 +4154,6 def abortgraft(ui, repo, graftstate):
4154 4154 startctx = repo[b'.']
4155 4155 # whether to strip or not
4156 4156 cleanup = False
4157 from . import hg
4158 4157
4159 4158 if newnodes:
4160 4159 newnodes = [repo[r].rev() for r in newnodes]
@@ -4182,7 +4181,7 def abortgraft(ui, repo, graftstate):
4182 4181
4183 4182 if cleanup:
4184 4183 with repo.wlock(), repo.lock():
4185 hg.updaterepo(repo, startctx.node(), overwrite=True)
4184 mergemod.clean_update(startctx)
4186 4185 # stripping the new nodes created
4187 4186 strippoints = [
4188 4187 c.node() for c in repo.set(b"roots(%ld)", newnodes)
@@ -4192,7 +4191,7 def abortgraft(ui, repo, graftstate):
4192 4191 if not cleanup:
4193 4192 # we don't update to the startnode if we can't strip
4194 4193 startctx = repo[b'.']
4195 hg.updaterepo(repo, startctx.node(), overwrite=True)
4194 mergemod.clean_update(startctx)
4196 4195
4197 4196 ui.status(_(b"graft aborted\n"))
4198 4197 ui.status(_(b"working directory is now at %s\n") % startctx.hex()[:12])
@@ -3247,7 +3247,7 def _stopgraft(ui, repo, graftstate):
3247 3247 if not graftstate.exists():
3248 3248 raise error.Abort(_(b"no interrupted graft found"))
3249 3249 pctx = repo[b'.']
3250 hg.updaterepo(repo, pctx.node(), overwrite=True)
3250 mergemod.clean_update(pctx)
3251 3251 graftstate.delete()
3252 3252 ui.status(_(b"stopped the interrupted graft\n"))
3253 3253 ui.status(_(b"working directory is now at %s\n") % pctx.hex()[:12])
@@ -1074,7 +1074,7 def update(repo, node, quietempty=False,
1074 1074
1075 1075 def clean(repo, node, show_stats=True, quietempty=False):
1076 1076 """forcibly switch the working directory to node, clobbering changes"""
1077 stats = updaterepo(repo, node, True)
1077 stats = mergemod.clean_update(repo[node])
1078 1078 assert stats.unresolvedcount == 0
1079 1079 if show_stats:
1080 1080 _showstats(repo, stats, quietempty)
@@ -25,6 +25,7 from . import (
25 25 exchange,
26 26 logcmdutil,
27 27 match as matchmod,
28 merge as merge,
28 29 node,
29 30 pathutil,
30 31 phases,
@@ -783,7 +784,10 class hgsubrepo(abstractsubrepo):
783 784 % (revision[0:12], self._path)
784 785 )
785 786 repo = urepo
786 hg.updaterepo(repo, revision, overwrite)
787 if overwrite:
788 merge.clean_update(repo[revision])
789 else:
790 hg.updaterepo(repo, revision, False)
787 791
788 792 @annotatesubrepoerror
789 793 def merge(self, state):
General Comments 0
You need to be logged in to leave comments. Login now