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