Mercurial > hg
comparison mercurial/merge.py @ 44151:d1c0f239193f
merge: define updatedirstate a little earlier and reuse it
Differential Revision: https://phab.mercurial-scm.org/D7899
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 15 Jan 2020 15:08:42 -0800 |
parents | ff22c76825b9 |
children | ae9310709c13 |
comparison
equal
deleted
inserted
replaced
44150:ff22c76825b9 | 44151:d1c0f239193f |
---|---|
2505 repo.ui.warn(b" %s\n" % nf) | 2505 repo.ui.warn(b" %s\n" % nf) |
2506 | 2506 |
2507 ### apply phase | 2507 ### apply phase |
2508 if not branchmerge: # just jump to the new rev | 2508 if not branchmerge: # just jump to the new rev |
2509 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, b'' | 2509 fp1, fp2, xp1, xp2 = fp2, nullid, xp2, b'' |
2510 if not partial and not wc.isinmemory(): | 2510 updatedirstate = not partial and not wc.isinmemory() |
2511 if updatedirstate: | |
2511 repo.hook(b'preupdate', throw=True, parent1=xp1, parent2=xp2) | 2512 repo.hook(b'preupdate', throw=True, parent1=xp1, parent2=xp2) |
2512 # note that we're in the middle of an update | 2513 # note that we're in the middle of an update |
2513 repo.vfs.write(b'updatestate', p2.hex()) | 2514 repo.vfs.write(b'updatestate', p2.hex()) |
2514 | 2515 |
2515 # Advertise fsmonitor when its presence could be useful. | 2516 # Advertise fsmonitor when its presence could be useful. |
2551 b'fsmonitor enabled; enable fsmonitor to improve performance; ' | 2552 b'fsmonitor enabled; enable fsmonitor to improve performance; ' |
2552 b'see "hg help -e fsmonitor")\n' | 2553 b'see "hg help -e fsmonitor")\n' |
2553 ) | 2554 ) |
2554 ) | 2555 ) |
2555 | 2556 |
2556 updatedirstate = not partial and not wc.isinmemory() | |
2557 wantfiledata = updatedirstate and not branchmerge | 2557 wantfiledata = updatedirstate and not branchmerge |
2558 stats, getfiledata = applyupdates( | 2558 stats, getfiledata = applyupdates( |
2559 repo, actions, wc, p2, overwrite, wantfiledata, labels=labels | 2559 repo, actions, wc, p2, overwrite, wantfiledata, labels=labels |
2560 ) | 2560 ) |
2561 | 2561 |