Mercurial > hg
comparison hgext/transplant.py @ 45576:c1b603cdc95a
merge: add a higher-level update() for the common `hg update` use case
This is different from the `update()` function that I just made
private. The new function is specifically for the normal `hg update`
use case. It doesn't do a merge and it doesn't do a clean (forced)
update.
Differential Revision: https://phab.mercurial-scm.org/D9066
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 21 Sep 2020 09:57:29 -0700 |
parents | 2c86b9587740 |
children | 527ce85c2e60 |
comparison
equal
deleted
inserted
replaced
45575:147fb889278b | 45576:c1b603cdc95a |
---|---|
196 p1 = node | 196 p1 = node |
197 continue | 197 continue |
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 |
207 domerge = False | 205 domerge = False |
208 if node in merges: | 206 if node in merges: |
273 if patchfile: | 271 if patchfile: |
274 os.unlink(patchfile) | 272 os.unlink(patchfile) |
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() |
282 if tr: | 280 if tr: |
283 tr.release() | 281 tr.release() |