Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 22672:19903277f035
merge: use bid merge by default (BC)
In most cases merges will work exactly as before.
The only difference is in criss-cross merge situations where there is multiple
ancestors. Instead of picking an more or less arbitrary ancestor, it will
consider both ancestors and pick the best bids.
Bid merge can be disabled with --config merge.preferancestor='!'.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Wed, 01 Oct 2014 03:41:11 +0200 |
parents | 6f63c47cbb86 |
children | 16a46003b50c |
comparison
equal
deleted
inserted
replaced
22671:5220c12c43fd | 22672:19903277f035 |
---|---|
777 if len(ancestors) == 1: # default | 777 if len(ancestors) == 1: # default |
778 actions = manifestmerge(repo, wctx, mctx, ancestors[0], | 778 actions = manifestmerge(repo, wctx, mctx, ancestors[0], |
779 branchmerge, force, | 779 branchmerge, force, |
780 partial, acceptremote, followcopies) | 780 partial, acceptremote, followcopies) |
781 | 781 |
782 else: # only when merge.preferancestor=* - experimentalish code | 782 else: # only when merge.preferancestor=* - the default |
783 repo.ui.status( | 783 repo.ui.status( |
784 _("note: merging %s and %s using bids from ancestors %s\n") % | 784 _("note: merging %s and %s using bids from ancestors %s\n") % |
785 (wctx, mctx, _(' and ').join(str(anc) for anc in ancestors))) | 785 (wctx, mctx, _(' and ').join(str(anc) for anc in ancestors))) |
786 | 786 |
787 # Call for bids | 787 # Call for bids |
1046 | 1046 |
1047 overwrite = force and not branchmerge | 1047 overwrite = force and not branchmerge |
1048 | 1048 |
1049 p2 = repo[node] | 1049 p2 = repo[node] |
1050 if pas[0] is None: | 1050 if pas[0] is None: |
1051 if repo.ui.config("merge", "preferancestor") == '*': | 1051 if repo.ui.config("merge", "preferancestor", '*') == '*': |
1052 cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node()) | 1052 cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node()) |
1053 pas = [repo[anc] for anc in (sorted(cahs) or [nullid])] | 1053 pas = [repo[anc] for anc in (sorted(cahs) or [nullid])] |
1054 else: | 1054 else: |
1055 pas = [p1.ancestor(p2, warn=branchmerge)] | 1055 pas = [p1.ancestor(p2, warn=branchmerge)] |
1056 | 1056 |