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

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

Comments

Martin von Zweigbergk - Dec. 8, 2014, 5:21 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1417827097 28800
#      Fri Dec 05 16:51:37 2014 -0800
# Node ID f6494fa74da32aa44727c049936a0b36e08867ce
# Parent  9fbabf34d2d18805b7d8932d7c883b62c813ada2
largefiles: don't use 'r' action for normal file that doesn't exist

When merging and the remote has turned a largefile into a normal file
and the user chooses to keep the local largefile, we use the 'r'
action for the remote normal file. 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.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -456,7 +456,7 @@ 
             if repo.ui.promptchoice(usermsg, 0) == 0: # keep local largefile
                 if branchmerge:
                     # largefile can be restored from standin safely
-                    actions['r'].append((lfile, None, 'replaced by standin'))
+                    actions['k'].append((lfile, None, 'replaced by standin'))
                 else:
                     # "lfile" should be marked as "removed" without
                     # removal of itself
diff --git a/tests/test-issue3084.t b/tests/test-issue3084.t
--- a/tests/test-issue3084.t
+++ b/tests/test-issue3084.t
@@ -116,8 +116,8 @@ 
   remote turned local largefile foo into a normal file
   keep (l)argefile or use (n)ormal file? l
   getting changed largefiles
-  1 largefiles updated, 0 removed
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  0 largefiles updated, 0 removed
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
   $ hg status
@@ -329,8 +329,8 @@ 
   remote turned local largefile f into a normal file
   keep (l)argefile or use (n)ormal file? l
   getting changed largefiles
-  1 largefiles updated, 0 removed
-  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  0 largefiles updated, 0 removed
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ cat f
   large
@@ -409,8 +409,8 @@ 
   remote turned local largefile f into a normal file
   keep (l)argefile or use (n)ormal file? l
   getting changed largefiles
-  1 largefiles updated, 0 removed
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  0 largefiles updated, 0 removed
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ cat f
   large2