# HG changeset patch # User Martin von Zweigbergk # Date 2020-01-15 23:12:50 # Node ID faec51c76b7b52397765bd484d544e03be2600e8 # Parent ae9310709c13c53ad95cfa8204faf1a74c7e82c9 merge: avoid a negation in the definition of updatedirstate We only use `partial` in one place: the definition of `updatedirstate`. Let's simplify that a little. Differential Revision: https://phab.mercurial-scm.org/D7900 diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -2501,13 +2501,9 @@ def update( 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() + # the dirstate. + always = matcher is None or matcher.always() + updatedirstate = always 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