Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 42410:a5b5ecff5f37
merge: simplify initialization of "pas"
Differential Revision: https://phab.mercurial-scm.org/D6472
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sat, 09 Mar 2019 22:13:06 -0800 |
parents | 72522fe7fb95 |
children | 127937874395 |
comparison
equal
deleted
inserted
replaced
42409:72522fe7fb95 | 42410:a5b5ecff5f37 |
---|---|
1976 if wc is None: | 1976 if wc is None: |
1977 wc = repo[None] | 1977 wc = repo[None] |
1978 pl = wc.parents() | 1978 pl = wc.parents() |
1979 p1 = pl[0] | 1979 p1 = pl[0] |
1980 p2 = repo[node] | 1980 p2 = repo[node] |
1981 pas = [None] | |
1982 if ancestor is not None: | 1981 if ancestor is not None: |
1983 pas = [repo[ancestor]] | 1982 pas = [repo[ancestor]] |
1984 if pas[0] is None: | 1983 else: |
1985 if repo.ui.configlist('merge', 'preferancestor') == ['*']: | 1984 if repo.ui.configlist('merge', 'preferancestor') == ['*']: |
1986 cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node()) | 1985 cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node()) |
1987 pas = [repo[anc] for anc in (sorted(cahs) or [nullid])] | 1986 pas = [repo[anc] for anc in (sorted(cahs) or [nullid])] |
1988 else: | 1987 else: |
1989 pas = [p1.ancestor(p2, warn=branchmerge)] | 1988 pas = [p1.ancestor(p2, warn=branchmerge)] |