##// END OF EJS Templates
merge: add a higher-level update() for the common `hg update` use case...
Martin von Zweigbergk -
r46150:c1b603cd default
parent child Browse files
Show More
@@ -642,13 +642,7 b' class rebaseruntime(object):'
642 cmdutil.bailifchanged(repo)
642 cmdutil.bailifchanged(repo)
643 self.inmemory = False
643 self.inmemory = False
644 self._assignworkingcopy()
644 self._assignworkingcopy()
645 mergemod._update(
645 mergemod.update(repo[p1], wc=self.wctx)
646 repo,
647 p1,
648 branchmerge=False,
649 force=False,
650 wc=self.wctx,
651 )
652 rebasenode(
646 rebasenode(
653 repo,
647 repo,
654 rev,
648 rev,
@@ -198,9 +198,7 b' class transplanter(object):'
198 if pulls:
198 if pulls:
199 if source != repo:
199 if source != repo:
200 exchange.pull(repo, source.peer(), heads=pulls)
200 exchange.pull(repo, source.peer(), heads=pulls)
201 merge._update(
201 merge.update(repo[pulls[-1]])
202 repo, pulls[-1], branchmerge=False, force=False
203 )
204 p1 = repo.dirstate.p1()
202 p1 = repo.dirstate.p1()
205 pulls = []
203 pulls = []
206
204
@@ -275,7 +273,7 b' class transplanter(object):'
275 tr.close()
273 tr.close()
276 if pulls:
274 if pulls:
277 exchange.pull(repo, source.peer(), heads=pulls)
275 exchange.pull(repo, source.peer(), heads=pulls)
278 merge._update(repo, pulls[-1], branchmerge=False, force=False)
276 merge.update(repo[pulls[-1]])
279 finally:
277 finally:
280 self.saveseries(revmap, merges)
278 self.saveseries(revmap, merges)
281 self.transplants.write()
279 self.transplants.write()
@@ -2056,6 +2056,28 b' def merge(ctx, labels=None, force=False,'
2056 )
2056 )
2057
2057
2058
2058
2059 def update(ctx, updatecheck=None, wc=None):
2060 """Do a regular update to the given commit, aborting if there are conflicts.
2061
2062 The 'updatecheck' argument can be used to control what to do in case of
2063 conflicts.
2064
2065 Note: This is a new, higher-level update() than the one that used to exist
2066 in this module. That function is now called _update(). You can hopefully
2067 replace your callers to use this new update(), or clean_update(), merge(),
2068 revert_to(), or graft().
2069 """
2070 return _update(
2071 ctx.repo(),
2072 ctx.rev(),
2073 branchmerge=False,
2074 force=False,
2075 labels=[b'working copy', b'destination'],
2076 updatecheck=updatecheck,
2077 wc=wc,
2078 )
2079
2080
2059 def clean_update(ctx, wc=None):
2081 def clean_update(ctx, wc=None):
2060 """Do a clean update to the given commit.
2082 """Do a clean update to the given commit.
2061
2083
General Comments 0
You need to be logged in to leave comments. Login now