Patchwork [2,of,2] largefiles: don't use 'r' action for standin that doesn't exist

login
register
mail settings
Submitter Martin von Zweigbergk
Date Dec. 8, 2014, 5:21 p.m.
Message ID <8a72facf2a370071df53.1418059283@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/7018/
State Accepted
Commit 28f01c318c05132dddf9bb1da92fc8b3e6269100
Headers show

Comments

Martin von Zweigbergk - Dec. 8, 2014, 5:21 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1417826752 28800
#      Fri Dec 05 16:45:52 2014 -0800
# Node ID 8a72facf2a370071df538f7d184b61f50ec06e46
# Parent  f6494fa74da32aa44727c049936a0b36e08867ce
largefiles: don't use 'r' action for standin that doesn't exist

When merging and the remote has turned a normal file into a largefile
and the user chooses to keep the local largefile, we use the 'r'
action for the remote largefile standin. This is wrong, since that
file does not exist in the parent of the working copy. Use 'k', which
does nothing but debug logging, instead.
Matt Mackall - Dec. 8, 2014, 11:02 p.m.
On Mon, 2014-12-08 at 09:21 -0800, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1417826752 28800
> #      Fri Dec 05 16:45:52 2014 -0800
> # Node ID 8a72facf2a370071df538f7d184b61f50ec06e46
> # Parent  f6494fa74da32aa44727c049936a0b36e08867ce
> largefiles: don't use 'r' action for standin that doesn't exist

These are queued for default, thanks.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -444,7 +444,12 @@ 
                 actions['r'].append((lfile, None, 'replaced by standin'))
                 newglist.append((standin, (p2.flags(standin),), msg))
             else: # keep local normal file
-                actions['r'].append((standin, None, 'replaced by non-standin'))
+                if branchmerge:
+                    actions['k'].append((standin, None,
+                                         'replaced by non-standin'))
+                else:
+                    actions['r'].append((standin, None,
+                                         'replaced by non-standin'))
         elif lfutil.standin(f) in p1 and lfutil.standin(f) not in removes:
             # Case 2: largefile in the working copy, normal file in
             # the second parent
diff --git a/tests/test-issue3084.t b/tests/test-issue3084.t
--- a/tests/test-issue3084.t
+++ b/tests/test-issue3084.t
@@ -42,9 +42,7 @@ 
   $ echo "n" | hg merge --config ui.interactive=Yes
   remote turned local normal file foo into a largefile
   use (l)argefile or keep (n)ormal file? n
-  getting changed largefiles
-  0 largefiles updated, 0 removed
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
   $ hg status
@@ -302,9 +300,7 @@ 
   use (c)hanged version or (d)elete? c
   remote turned local normal file f into a largefile
   use (l)argefile or keep (n)ormal file? n
-  getting changed largefiles
-  0 largefiles updated, 0 removed
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ cat f
   normal2