# HG changeset patch # User Siddharth Agarwal # Date 2016-01-02 11:02:57 # Node ID af13eaf9ab8cb8668dd68b74416aa5bba51d343b # Parent 95dc67f10239e659b47798c6bd137ec0ecc51075 merge: add a new 'backup' argument to get actions We're going to use this in an upcoming patch to back untracked files up when they're replaced by tracked ones. diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -483,7 +483,7 @@ def overridecalculateupdates(origfn, rep if sm in ('g', 'dc') and lm != 'r': if sm == 'dc': f1, f2, fa, move, anc = sargs - sargs = (p2[f2].flags(),) + sargs = (p2[f2].flags(), False) # Case 1: normal file in the working copy, largefile in # the second parent usermsg = _('remote turned local normal file %s into a largefile\n' @@ -501,7 +501,7 @@ def overridecalculateupdates(origfn, rep elif lm in ('g', 'dc') and sm != 'r': if lm == 'dc': f1, f2, fa, move, anc = largs - largs = (p2[f2].flags(),) + largs = (p2[f2].flags(), False) # Case 2: largefile in the working copy, normal file in # the second parent usermsg = _('remote turned local largefile %s into a normal file\n' diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -588,7 +588,8 @@ def _checkunknownfiles(repo, wctx, mctx, for f, (m, args, msg) in actions.iteritems(): if m == 'c': - actions[f] = ('g', args, msg) + flags, = args + actions[f] = ('g', (flags, False), msg) elif m == 'cm': fl2, anc = args different = _checkunknownfile(repo, wctx, mctx, f) @@ -596,7 +597,7 @@ def _checkunknownfiles(repo, wctx, mctx, actions[f] = ('m', (f, f, None, False, anc), "remote differs from untracked local") else: - actions[f] = ('g', (fl2,), "remote created") + actions[f] = ('g', (fl2, False), "remote created") def _forgetremoved(wctx, mctx, branchmerge): """ @@ -748,11 +749,11 @@ def manifestmerge(repo, wctx, p2, pa, br if n1 == n2: # optimization: keep local content actions[f] = ('e', (fl2,), "update permissions") else: - actions[f] = ('g', (fl2,), "remote is newer") + actions[f] = ('g', (fl2, False), "remote is newer") elif nol and n2 == a: # remote only changed 'x' actions[f] = ('e', (fl2,), "update permissions") elif nol and n1 == a: # local only changed 'x' - actions[f] = ('g', (fl1,), "remote is newer") + actions[f] = ('g', (fl1, False), "remote is newer") else: # both changed something actions[f] = ('m', (f, f, f, False, pa.node()), "versions differ") @@ -1459,7 +1460,7 @@ def update(repo, node, branchmerge, forc _("remote changed %s which local deleted\n" "use (c)hanged version or leave (d)eleted?" "$$ &Changed $$ &Deleted") % f, 0) == 0: - actions['g'].append((f, (flags,), "prompt recreating")) + actions['g'].append((f, (flags, False), "prompt recreating")) # divergent renames for f, fl in sorted(diverge.iteritems()):