##// END OF EJS Templates
update: clarify update() call sites by specifying argument names...
Martin von Zweigbergk -
r40721:b14fdf1f default
parent child Browse files
Show More
@@ -830,8 +830,7 b' class base(histeditaction):'
830
830
831 def run(self):
831 def run(self):
832 if self.repo['.'].node() != self.node:
832 if self.repo['.'].node() != self.node:
833 mergemod.update(self.repo, self.node, False, True)
833 mergemod.update(self.repo, self.node, branchmerge=False, force=True)
834 # branchmerge, force)
835 return self.continueclean()
834 return self.continueclean()
836
835
837 def continuedirty(self):
836 def continuedirty(self):
@@ -1188,7 +1188,7 b' def rebasenode(repo, rev, p1, base, coll'
1188 else:
1188 else:
1189 if repo['.'].rev() != p1:
1189 if repo['.'].rev() != p1:
1190 repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1]))
1190 repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1]))
1191 mergemod.update(repo, p1, False, True)
1191 mergemod.update(repo, p1, branchmerge=False, force=True)
1192 else:
1192 else:
1193 repo.ui.debug(" already in destination\n")
1193 repo.ui.debug(" already in destination\n")
1194 # This is, alas, necessary to invalidate workingctx's manifest cache,
1194 # This is, alas, necessary to invalidate workingctx's manifest cache,
@@ -1200,7 +1200,8 b' def rebasenode(repo, rev, p1, base, coll'
1200 repo.ui.debug(" detach base %d:%s\n" % (base, repo[base]))
1200 repo.ui.debug(" detach base %d:%s\n" % (base, repo[base]))
1201 # When collapsing in-place, the parent is the common ancestor, we
1201 # When collapsing in-place, the parent is the common ancestor, we
1202 # have to allow merging with it.
1202 # have to allow merging with it.
1203 stats = mergemod.update(repo, rev, True, True, base, collapse,
1203 stats = mergemod.update(repo, rev, branchmerge=True, force=True,
1204 ancestor=base, mergeancestor=collapse,
1204 labels=['dest', 'source'], wc=wctx)
1205 labels=['dest', 'source'], wc=wctx)
1205 if collapse:
1206 if collapse:
1206 copies.duplicatecopies(repo, wctx, rev, dest)
1207 copies.duplicatecopies(repo, wctx, rev, dest)
@@ -1643,7 +1644,7 b' def abort(repo, originalwd, destmap, sta'
1643
1644
1644 # Update away from the rebase if necessary
1645 # Update away from the rebase if necessary
1645 if shouldupdate or needupdate(repo, state):
1646 if shouldupdate or needupdate(repo, state):
1646 mergemod.update(repo, originalwd, False, True)
1647 mergemod.update(repo, originalwd, branchmerge=False, force=True)
1647
1648
1648 # Strip from the first rebased revision
1649 # Strip from the first rebased revision
1649 if rebased:
1650 if rebased:
@@ -656,7 +656,7 b' def unshelveabort(ui, repo, state, opts)'
656 try:
656 try:
657 checkparents(repo, state)
657 checkparents(repo, state)
658
658
659 merge.update(repo, state.pendingctx, False, True)
659 merge.update(repo, state.pendingctx, branchmerge=False, force=True)
660 if (state.activebookmark
660 if (state.activebookmark
661 and state.activebookmark in repo._bookmarks):
661 and state.activebookmark in repo._bookmarks):
662 bookmarks.activate(repo, state.activebookmark)
662 bookmarks.activate(repo, state.activebookmark)
@@ -184,7 +184,8 b' class transplanter(object):'
184 if pulls:
184 if pulls:
185 if source != repo:
185 if source != repo:
186 exchange.pull(repo, source.peer(), heads=pulls)
186 exchange.pull(repo, source.peer(), heads=pulls)
187 merge.update(repo, pulls[-1], False, False)
187 merge.update(repo, pulls[-1], branchmerge=False,
188 force=False)
188 p1, p2 = repo.dirstate.parents()
189 p1, p2 = repo.dirstate.parents()
189 pulls = []
190 pulls = []
190
191
@@ -249,7 +250,7 b' class transplanter(object):'
249 tr.close()
250 tr.close()
250 if pulls:
251 if pulls:
251 exchange.pull(repo, source.peer(), heads=pulls)
252 exchange.pull(repo, source.peer(), heads=pulls)
252 merge.update(repo, pulls[-1], False, False)
253 merge.update(repo, pulls[-1], branchmerge=False, force=False)
253 finally:
254 finally:
254 self.saveseries(revmap, merges)
255 self.saveseries(revmap, merges)
255 self.transplants.write()
256 self.transplants.write()
@@ -365,8 +365,8 b' def dorecord(ui, repo, commitfunc, cmdsu'
365 if backups:
365 if backups:
366 # Equivalent to hg.revert
366 # Equivalent to hg.revert
367 m = scmutil.matchfiles(repo, backups.keys())
367 m = scmutil.matchfiles(repo, backups.keys())
368 mergemod.update(repo, repo.dirstate.p1(),
368 mergemod.update(repo, repo.dirstate.p1(), branchmerge=False,
369 False, True, matcher=m)
369 force=True, matcher=m)
370
370
371 # 3b. (apply)
371 # 3b. (apply)
372 if dopatch:
372 if dopatch:
@@ -643,7 +643,9 b' def _dobackout(ui, repo, node=None, rev='
643 with dirstateguard.dirstateguard(repo, 'backout'):
643 with dirstateguard.dirstateguard(repo, 'backout'):
644 overrides = {('ui', 'forcemerge'): opts.get('tool', '')}
644 overrides = {('ui', 'forcemerge'): opts.get('tool', '')}
645 with ui.configoverride(overrides, 'backout'):
645 with ui.configoverride(overrides, 'backout'):
646 stats = mergemod.update(repo, parent, True, True, node, False)
646 stats = mergemod.update(repo, parent, branchmerge=True,
647 force=True, ancestor=node,
648 mergeancestor=False)
647 repo.setparents(op1, op2)
649 repo.setparents(op1, op2)
648 hg._showstats(repo, stats)
650 hg._showstats(repo, stats)
649 if stats.unresolvedcount:
651 if stats.unresolvedcount:
@@ -846,7 +846,7 b' def updaterepo(repo, node, overwrite, up'
846 When overwrite is set, changes are clobbered, merged else
846 When overwrite is set, changes are clobbered, merged else
847
847
848 returns stats (see pydoc mercurial.merge.applyupdates)"""
848 returns stats (see pydoc mercurial.merge.applyupdates)"""
849 return mergemod.update(repo, node, False, overwrite,
849 return mergemod.update(repo, node, branchmerge=False, force=overwrite,
850 labels=['working copy', 'destination'],
850 labels=['working copy', 'destination'],
851 updatecheck=updatecheck)
851 updatecheck=updatecheck)
852
852
@@ -949,8 +949,8 b' def merge(repo, node, force=None, remind'
949 """Branch merge with node, resolving changes. Return true if any
949 """Branch merge with node, resolving changes. Return true if any
950 unresolved conflicts."""
950 unresolved conflicts."""
951 if not abort:
951 if not abort:
952 stats = mergemod.update(repo, node, True, force, mergeforce=mergeforce,
952 stats = mergemod.update(repo, node, branchmerge=True, force=force,
953 labels=labels)
953 mergeforce=mergeforce, labels=labels)
954 else:
954 else:
955 ms = mergemod.mergestate.read(repo)
955 ms = mergemod.mergestate.read(repo)
956 if ms.active():
956 if ms.active():
@@ -22,10 +22,10 b' def addcommit(name, time):'
22 commit(name, time)
22 commit(name, time)
23
23
24 def update(rev):
24 def update(rev):
25 merge.update(repo, rev, False, True)
25 merge.update(repo, rev, branchmerge=False, force=True)
26
26
27 def merge_(rev):
27 def merge_(rev):
28 merge.update(repo, rev, True, False)
28 merge.update(repo, rev, branchmerge=True, force=False)
29
29
30 if __name__ == '__main__':
30 if __name__ == '__main__':
31 addcommit(b"A", 0)
31 addcommit(b"A", 0)
General Comments 0
You need to be logged in to leave comments. Login now