Patchwork D7899: merge: define updatedirstate a little earlier and reuse it

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2020, 2:21 p.m.
Message ID <1510d6377302cfe81c1cbe9684bc8a26@localhost.localdomain>
Download mbox | patch
Permalink /patch/44607/
State Not Applicable
Headers show

Comments

phabricator - Jan. 24, 2020, 2:21 p.m.
Closed by commit rHGd1c0f239193f: merge: define updatedirstate a little earlier and reuse it (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7899?vs=19335&id=19550

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7899/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7899

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -2507,7 +2507,8 @@ 
         ### apply phase
         if not branchmerge:  # just jump to the new rev
             fp1, fp2, xp1, xp2 = fp2, nullid, xp2, b''
-        if not partial and not wc.isinmemory():
+        updatedirstate = not partial and not wc.isinmemory()
+        if updatedirstate:
             repo.hook(b'preupdate', throw=True, parent1=xp1, parent2=xp2)
             # note that we're in the middle of an update
             repo.vfs.write(b'updatestate', p2.hex())
@@ -2553,7 +2554,6 @@ 
                 )
             )
 
-        updatedirstate = not partial and not wc.isinmemory()
         wantfiledata = updatedirstate and not branchmerge
         stats, getfiledata = applyupdates(
             repo, actions, wc, p2, overwrite, wantfiledata, labels=labels