Patchwork D6471: merge: reorder some initialization to make more sense

login
register
mail settings
Submitter phabricator
Date June 3, 2019, 2:07 p.m.
Message ID <ff16056bb7347cc00fd3d967353cf68f@localhost.localdomain>
Download mbox | patch
Permalink /patch/40305/
State Not Applicable
Headers show

Comments

phabricator - June 3, 2019, 2:07 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG72522fe7fb95: merge: reorder some initialization to make more sense (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6471?vs=15319&id=15329

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

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
@@ -1977,13 +1977,10 @@ 
             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 @@ 
 
         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: