changeset 27655:af13eaf9ab8c

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.
author Siddharth Agarwal <sid0@fb.com>
date Sat, 02 Jan 2016 03:02:57 -0800
parents 95dc67f10239
children 57c0d4888ca8
files hgext/largefiles/overrides.py mercurial/merge.py
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Sat Jan 02 03:02:57 2016 -0800
+++ b/hgext/largefiles/overrides.py	Sat Jan 02 03:02:57 2016 -0800
@@ -483,7 +483,7 @@
         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 @@
         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'
--- a/mercurial/merge.py	Sat Jan 02 03:02:57 2016 -0800
+++ b/mercurial/merge.py	Sat Jan 02 03:02:57 2016 -0800
@@ -588,7 +588,8 @@
 
     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 @@
                 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 @@
                     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 @@
                 _("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()):