##// END OF EJS Templates
merge: replace calls to hg.updaterepo() by merge.update()...
Martin von Zweigbergk -
r46151:5c8230ca default
parent child Browse files
Show More
@@ -881,8 +881,7 class fold(histeditaction):
881 return False
881 return False
882
882
883 def finishfold(self, ui, repo, ctx, oldctx, newnode, internalchanges):
883 def finishfold(self, ui, repo, ctx, oldctx, newnode, internalchanges):
884 parent = ctx.p1().node()
884 mergemod.update(ctx.p1())
885 hg.updaterepo(repo, parent, overwrite=False)
886 ### prepare new commit data
885 ### prepare new commit data
887 commitopts = {}
886 commitopts = {}
888 commitopts[b'user'] = ctx.user()
887 commitopts[b'user'] = ctx.user()
@@ -926,7 +925,7 class fold(histeditaction):
926 )
925 )
927 if n is None:
926 if n is None:
928 return ctx, []
927 return ctx, []
929 hg.updaterepo(repo, n, overwrite=False)
928 mergemod.update(repo[n])
930 replacements = [
929 replacements = [
931 (oldctx.node(), (newnode,)),
930 (oldctx.node(), (newnode,)),
932 (ctx.node(), (n,)),
931 (ctx.node(), (n,)),
@@ -2050,7 +2049,7 def _continuehistedit(ui, repo, state):
2050
2049
2051 def _finishhistedit(ui, repo, state, fm):
2050 def _finishhistedit(ui, repo, state, fm):
2052 """This action runs when histedit is finishing its session"""
2051 """This action runs when histedit is finishing its session"""
2053 hg.updaterepo(repo, state.parentctxnode, overwrite=False)
2052 mergemod.update(repo[state.parentctxnode])
2054
2053
2055 mapping, tmpnodes, created, ntm = processreplacement(state)
2054 mapping, tmpnodes, created, ntm = processreplacement(state)
2056 if mapping:
2055 if mapping:
@@ -34,7 +34,6 from mercurial import (
34 dirstateguard,
34 dirstateguard,
35 error,
35 error,
36 extensions,
36 extensions,
37 hg,
38 merge as mergemod,
37 merge as mergemod,
39 mergestate as mergestatemod,
38 mergestate as mergestatemod,
40 mergeutil,
39 mergeutil,
@@ -750,7 +749,7 class rebaseruntime(object):
750 newwd = self.originalwd
749 newwd = self.originalwd
751 if newwd not in [c.rev() for c in repo[None].parents()]:
750 if newwd not in [c.rev() for c in repo[None].parents()]:
752 ui.note(_(b"update back to initial working directory parent\n"))
751 ui.note(_(b"update back to initial working directory parent\n"))
753 hg.updaterepo(repo, newwd, overwrite=False)
752 mergemod.update(repo[newwd])
754
753
755 collapsedas = None
754 collapsedas = None
756 if self.collapsef and not self.keepf:
755 if self.collapsef and not self.keepf:
@@ -80,9 +80,9 from mercurial import (
80 dirstate,
80 dirstate,
81 error,
81 error,
82 extensions,
82 extensions,
83 hg,
84 logcmdutil,
83 logcmdutil,
85 match as matchmod,
84 match as matchmod,
85 merge as mergemod,
86 pycompat,
86 pycompat,
87 registrar,
87 registrar,
88 sparse,
88 sparse,
@@ -173,9 +173,9 def _clonesparsecmd(orig, ui, repo, *arg
173 # clone
173 # clone
174 if not narrow_pat and (include or exclude or enableprofile):
174 if not narrow_pat and (include or exclude or enableprofile):
175
175
176 def clonesparse(orig, self, node, overwrite, *args, **kwargs):
176 def clonesparse(orig, ctx, *args, **kwargs):
177 sparse.updateconfig(
177 sparse.updateconfig(
178 self.unfiltered(),
178 ctx.repo().unfiltered(),
179 pat,
179 pat,
180 {},
180 {},
181 include=include,
181 include=include,
@@ -183,9 +183,9 def _clonesparsecmd(orig, ui, repo, *arg
183 enableprofile=enableprofile,
183 enableprofile=enableprofile,
184 usereporootpaths=True,
184 usereporootpaths=True,
185 )
185 )
186 return orig(self, node, overwrite, *args, **kwargs)
186 return orig(ctx, *args, **kwargs)
187
187
188 extensions.wrapfunction(hg, b'updaterepo', clonesparse)
188 extensions.wrapfunction(mergemod, b'update', clonesparse)
189 return orig(ui, repo, *args, **opts)
189 return orig(ui, repo, *args, **opts)
190
190
191
191
@@ -1061,7 +1061,7 def updaterepo(repo, node, overwrite, up
1061
1061
1062 def update(repo, node, quietempty=False, updatecheck=None):
1062 def update(repo, node, quietempty=False, updatecheck=None):
1063 """update the working directory to node"""
1063 """update the working directory to node"""
1064 stats = updaterepo(repo, node, False, updatecheck=updatecheck)
1064 stats = mergemod.update(repo[node], updatecheck=updatecheck)
1065 _showstats(repo, stats, quietempty)
1065 _showstats(repo, stats, quietempty)
1066 if stats.unresolvedcount:
1066 if stats.unresolvedcount:
1067 repo.ui.status(_(b"use 'hg resolve' to retry unresolved file merges\n"))
1067 repo.ui.status(_(b"use 'hg resolve' to retry unresolved file merges\n"))
@@ -839,7 +839,7 def unshelvecontinue(ui, repo, state, op
839 state.nodestoremove.append(newnode)
839 state.nodestoremove.append(newnode)
840 shelvectx = repo[newnode]
840 shelvectx = repo[newnode]
841
841
842 hg.updaterepo(repo, pendingctx.node(), overwrite=False)
842 merge.update(pendingctx)
843 mergefiles(ui, repo, state.wctx, shelvectx)
843 mergefiles(ui, repo, state.wctx, shelvectx)
844 restorebranch(ui, repo, state.branchtorestore)
844 restorebranch(ui, repo, state.branchtorestore)
845
845
@@ -1031,7 +1031,7 def _rebaserestoredcommit(
1031 ui.status(msg)
1031 ui.status(msg)
1032 else:
1032 else:
1033 shelvectx = repo[newnode]
1033 shelvectx = repo[newnode]
1034 hg.updaterepo(repo, tmpwctx.node(), False)
1034 merge.update(tmpwctx)
1035
1035
1036 return shelvectx, ispartialunshelve
1036 return shelvectx, ispartialunshelve
1037
1037
@@ -787,7 +787,7 class hgsubrepo(abstractsubrepo):
787 if overwrite:
787 if overwrite:
788 merge.clean_update(repo[revision])
788 merge.clean_update(repo[revision])
789 else:
789 else:
790 hg.updaterepo(repo, revision, False)
790 merge.update(repo[revision])
791
791
792 @annotatesubrepoerror
792 @annotatesubrepoerror
793 def merge(self, state):
793 def merge(self, state):
General Comments 0
You need to be logged in to leave comments. Login now