Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 44245:ae9310709c13
merge: move definition of `partial` closer to where it's used
Differential Revision: https://phab.mercurial-scm.org/D7983
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 24 Jan 2020 08:32:35 -0800 |
parents | d1c0f239193f |
children | faec51c76b7b |
comparison
equal
deleted
inserted
replaced
44244:45192589555c | 44245:ae9310709c13 |
---|---|
2286 UPDATECHECK_LINEAR, | 2286 UPDATECHECK_LINEAR, |
2287 UPDATECHECK_NO_CONFLICT, | 2287 UPDATECHECK_NO_CONFLICT, |
2288 ), | 2288 ), |
2289 ) | 2289 ) |
2290 ) | 2290 ) |
2291 # If we're doing a partial update, we need to skip updating | |
2292 # the dirstate, so make a note of any partial-ness to the | |
2293 # update here. | |
2294 if matcher is None or matcher.always(): | |
2295 partial = False | |
2296 else: | |
2297 partial = True | |
2298 with repo.wlock(): | 2291 with repo.wlock(): |
2299 if wc is None: | 2292 if wc is None: |
2300 wc = repo[None] | 2293 wc = repo[None] |
2301 pl = wc.parents() | 2294 pl = wc.parents() |
2302 p1 = pl[0] | 2295 p1 = pl[0] |
2505 repo.ui.warn(b" %s\n" % nf) | 2498 repo.ui.warn(b" %s\n" % nf) |
2506 | 2499 |
2507 ### apply phase | 2500 ### apply phase |
2508 if not branchmerge: # just jump to the new rev | 2501 if not branchmerge: # just jump to the new rev |
2509 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, b'' | 2502 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, b'' |
2503 # If we're doing a partial update, we need to skip updating | |
2504 # the dirstate, so make a note of any partial-ness to the | |
2505 # update here. | |
2506 if matcher is None or matcher.always(): | |
2507 partial = False | |
2508 else: | |
2509 partial = True | |
2510 updatedirstate = not partial and not wc.isinmemory() | 2510 updatedirstate = not partial and not wc.isinmemory() |
2511 if updatedirstate: | 2511 if updatedirstate: |
2512 repo.hook(b'preupdate', throw=True, parent1=xp1, parent2=xp2) | 2512 repo.hook(b'preupdate', throw=True, parent1=xp1, parent2=xp2) |
2513 # note that we're in the middle of an update | 2513 # note that we're in the middle of an update |
2514 repo.vfs.write(b'updatestate', p2.hex()) | 2514 repo.vfs.write(b'updatestate', p2.hex()) |