D6472: merge: simplify initialization of "pas"

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sat Jun 1 07:32:40 UTC 2019


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

REPOSITORY
  rHG Mercurial

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

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
@@ -1978,10 +1978,9 @@
         pl = wc.parents()
         p1 = pl[0]
         p2 = repo[node]
-        pas = [None]
         if ancestor is not None:
             pas = [repo[ancestor]]
-        if pas[0] is None:
+        else:
             if repo.ui.configlist('merge', 'preferancestor') == ['*']:
                 cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node())
                 pas = [repo[anc] for anc in (sorted(cahs) or [nullid])]



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


More information about the Mercurial-devel mailing list