# HG changeset patch # User Martin von Zweigbergk # Date 2019-03-10 06:11:27 # Node ID 72522fe7fb9549c2aca8aaae001303792d0e4217 # Parent 4e4fa3a954069cc9f7cac35751e40d554af3346e merge: reorder some initialization to make more sense This puts the closely related definitions of "pl", "p1", "p2", "pas" close together, and moves the definition of "overwrite" away and closer to where it's first used. Differential Revision: https://phab.mercurial-scm.org/D6471 diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -1977,13 +1977,10 @@ def update(repo, node, branchmerge, forc wc = repo[None] pl = wc.parents() p1 = pl[0] + p2 = repo[node] pas = [None] if ancestor is not None: pas = [repo[ancestor]] - - overwrite = force and not branchmerge - - p2 = repo[node] if pas[0] is None: if repo.ui.configlist('merge', 'preferancestor') == ['*']: cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node()) @@ -1993,6 +1990,7 @@ def update(repo, node, branchmerge, forc fp1, fp2, xp1, xp2 = p1.node(), p2.node(), bytes(p1), bytes(p2) + overwrite = force and not branchmerge ### check phase if not overwrite: if len(pl) > 1: