# HG changeset patch # User Martin von Zweigbergk # Date 2020-01-24 16:32:35 # Node ID ae9310709c13c53ad95cfa8204faf1a74c7e82c9 # Parent 45192589555c46b08e0810de28bd9bd7b9ed2ae4 merge: move definition of `partial` closer to where it's used Differential Revision: https://phab.mercurial-scm.org/D7983 diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -2288,13 +2288,6 @@ def update( ), ) ) - # 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 @@ def update( ### 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)