Patchwork D7983: merge: move definition of `partial` closer to where it's used

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2020, 11:27 p.m.
Message ID <6499a8fec2a2a6779158875494576813@localhost.localdomain>
Download mbox | patch
Permalink /patch/44632/
State Not Applicable
Headers show

Comments

phabricator - Jan. 24, 2020, 11:27 p.m.
Closed by commit rHGae9310709c13: merge: move definition of `partial` closer to where it&#039;s used (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/D7983?vs=19553&id=19576

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

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

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
@@ -2288,13 +2288,6 @@ 
                     ),
                 )
             )
-    # If we're doing a partial update, we need to skip updating
-    # the dirstate, so make a note of any partial-ness to the
-    # update here.
-    if matcher is None or matcher.always():
-        partial = False
-    else:
-        partial = True
     with repo.wlock():
         if wc is None:
             wc = repo[None]
@@ -2507,6 +2500,13 @@ 
         ### apply phase
         if not branchmerge:  # just jump to the new rev
             fp1, fp2, xp1, xp2 = fp2, nullid, xp2, b''
+        # If we're doing a partial update, we need to skip updating
+        # the dirstate, so make a note of any partial-ness to the
+        # update here.
+        if matcher is None or matcher.always():
+            partial = False
+        else:
+            partial = True
         updatedirstate = not partial and not wc.isinmemory()
         if updatedirstate:
             repo.hook(b'preupdate', throw=True, parent1=xp1, parent2=xp2)