Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 44246:faec51c76b7b
merge: avoid a negation in the definition of updatedirstate
We only use `partial` in one place: the definition of
`updatedirstate`. Let's simplify that a little.
Differential Revision: https://phab.mercurial-scm.org/D7900
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 15 Jan 2020 15:12:50 -0800 |
parents | ae9310709c13 |
children | 8ad263c3a358 |
comparison
equal
deleted
inserted
replaced
44245:ae9310709c13 | 44246:faec51c76b7b |
---|---|
2499 | 2499 |
2500 ### apply phase | 2500 ### apply phase |
2501 if not branchmerge: # just jump to the new rev | 2501 if not branchmerge: # just jump to the new rev |
2502 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 | 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 | 2504 # the dirstate. |
2505 # update here. | 2505 always = matcher is None or matcher.always() |
2506 if matcher is None or matcher.always(): | 2506 updatedirstate = always and not wc.isinmemory() |
2507 partial = False | |
2508 else: | |
2509 partial = True | |
2510 updatedirstate = not partial and not wc.isinmemory() | |
2511 if updatedirstate: | 2507 if updatedirstate: |
2512 repo.hook(b'preupdate', throw=True, parent1=xp1, parent2=xp2) | 2508 repo.hook(b'preupdate', throw=True, parent1=xp1, parent2=xp2) |
2513 # note that we're in the middle of an update | 2509 # note that we're in the middle of an update |
2514 repo.vfs.write(b'updatestate', p2.hex()) | 2510 repo.vfs.write(b'updatestate', p2.hex()) |
2515 | 2511 |