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

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri Jan 24 16:43:30 UTC 2020


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

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)



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


More information about the Mercurial-devel mailing list