Mercurial > public > mercurial-scm > hg-stable
diff mercurial/merge.py @ 28020:cffa46cbdb8f
merge: tell _checkunknownfiles about whether this was merge --force
In an upcoming patch we'll have different behavior here for when 'merge
--force' is used as opposed to when other kinds of force operations are
performed, like rebases.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Mon, 01 Feb 2016 20:28:32 -0800 |
parents | e81d11794036 |
children | e397b58c0563 |
line wrap: on
line diff
--- a/mercurial/merge.py Mon Feb 01 20:28:32 2016 -0800 +++ b/mercurial/merge.py Mon Feb 01 20:28:32 2016 -0800 @@ -603,7 +603,7 @@ and repo.dirstate.normalize(f) not in repo.dirstate and mctx[f2].cmp(wctx[f])) -def _checkunknownfiles(repo, wctx, mctx, force, actions): +def _checkunknownfiles(repo, wctx, mctx, force, actions, mergeforce): """ Considers any actions that care about the presence of conflicting unknown files. For some actions, the result is to abort; for others, it is to @@ -905,13 +905,14 @@ del actions[f] # don't get = keep local deleted def calculateupdates(repo, wctx, mctx, ancestors, branchmerge, force, - acceptremote, followcopies, matcher=None): + acceptremote, followcopies, matcher=None, + mergeforce=False): "Calculate the actions needed to merge mctx into wctx using ancestors" if len(ancestors) == 1: # default actions, diverge, renamedelete = manifestmerge( repo, wctx, mctx, ancestors[0], branchmerge, force, matcher, acceptremote, followcopies) - _checkunknownfiles(repo, wctx, mctx, force, actions) + _checkunknownfiles(repo, wctx, mctx, force, actions, mergeforce) else: # only when merge.preferancestor=* - the default repo.ui.note( @@ -926,7 +927,7 @@ actions, diverge1, renamedelete1 = manifestmerge( repo, wctx, mctx, ancestor, branchmerge, force, matcher, acceptremote, followcopies) - _checkunknownfiles(repo, wctx, mctx, force, actions) + _checkunknownfiles(repo, wctx, mctx, force, actions, mergeforce) # Track the shortest set of warning on the theory that bid # merge will correctly incorporate more information @@ -1344,7 +1345,7 @@ repo.dirstate.normal(f) def update(repo, node, branchmerge, force, ancestor=None, - mergeancestor=False, labels=None, matcher=None): + mergeancestor=False, labels=None, matcher=None, mergeforce=False): """ Perform a merge between the working directory and the given node @@ -1358,6 +1359,8 @@ between different named branches. This flag is used by rebase extension as a temporary fix and should be avoided in general. labels = labels to use for base, local and other + mergeforce = whether the merge was run with 'merge --force' (deprecated): if + this is True, then 'force' should be True as well. The table below shows all the behaviors of the update command given the -c and -C or no options, whether the working directory @@ -1493,7 +1496,7 @@ ### calculate phase actionbyfile, diverge, renamedelete = calculateupdates( repo, wc, p2, pas, branchmerge, force, mergeancestor, - followcopies, matcher=matcher) + followcopies, matcher=matcher, mergeforce=mergeforce) # Prompt and create actions. Most of this is in the resolve phase # already, but we can't handle .hgsubstate in filemerge or