Patchwork [3,of,4,stable] largefiles: systematic testing of merges to/from largefiles

login
register
mail settings
Submitter Mads Kiilerich
Date Oct. 28, 2013, 10 p.m.
Message ID <ba3857969dfc62a9b117.1382997654@mk-desktop>
Download mbox | patch
Permalink /patch/2831/
State Superseded
Commit 9bfa86746c9c1f6ab51deb8f174ffc482417d09f
Headers show

Comments

Mads Kiilerich - Oct. 28, 2013, 10 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1382996045 -3600
#      Mon Oct 28 22:34:05 2013 +0100
# Branch stable
# Node ID ba3857969dfc62a9b11777fd60f0137297fbbdb5
# Parent  9c6257e4e2027d5e6a13f4cbb5df567ffc2ca497
largefiles: systematic testing of merges to/from largefiles

427ce5633c1c fixed one problem with update and added a test case for it. The
test coverage was thus insufficient before that.

To make sure we have good test coverage in this area we add systematic testing
of all cases of merges that may or may not change normal files to largefiles or
vice versa.

The tests shows some annoying extra merge prompts in some cases, but these
prompts are hard to avoid and they are now "safe" - they do not leave the
system in a confused inconsistent state.

Patch

diff --git a/tests/test-issue3084.t b/tests/test-issue3084.t
--- a/tests/test-issue3084.t
+++ b/tests/test-issue3084.t
@@ -137,3 +137,221 @@ 
   large
 
   $ cd ..
+
+
+Systematic testing of merges involving largefiles:
+
+Ancestor: normal  Parent: normal=  Parent: large   result: large
+Ancestor: normal  Parent: normal2  Parent: large   result: ?
+Ancestor: large   Parent: large=   Parent: normal  result: normal
+Ancestor: large   Parent: large2   Parent: normal  result: ?
+
+All cases should try merging both ways.
+"=" means same file content.
+
+Prepare test repo:
+
+  $ hg init merges
+  $ cd merges
+  $ touch f1
+  $ hg ci -Aqm "0-root"
+
+ancestor is "normal":
+  $ echo normal > f
+  $ hg ci -Aqm "1-normal-ancestor"
+  $ touch f2
+  $ hg ci -Aqm "2-normal-unchanged"
+  $ hg tag -l "normal="
+  $ echo normal2 > f
+  $ hg ci -m "3-normal2"
+  $ hg tag -l "normal2"
+  $ hg up -qr 1
+  $ hg rm f
+  $ echo large > f
+  $ hg add --large f
+  $ hg ci -qm "4-normal-to-large"
+  $ hg tag -l "large"
+
+  $ hg up -qr null
+
+ancestor is "large":
+  $ echo large > f
+  $ hg add --large f
+  $ hg ci -qm "5-large-ancestor"
+  $ touch f2
+  $ hg ci -Aqm "6-large-unchanged"
+  $ hg tag -l "large="
+  $ echo large2 > f
+  $ hg ci -m "7-large2"
+  $ hg tag -l "large2"
+  $ hg up -qr 5
+  $ hg rm f
+  $ echo normal > f
+  $ hg ci -qAm "8-large-to-normal"
+  $ hg tag -l "normal"
+
+Ancestor: normal  Parent: normal=  Parent: large   result: large
+
+  $ hg up -Cqr normal=
+  $ hg merge -r large
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  $ cat f
+  large
+
+swap
+
+  $ hg up -Cqr large
+  $ hg merge -r normal=
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  0 largefiles updated, 0 removed
+  $ cat f
+  large
+
+Ancestor: normal  Parent: normal2  Parent: large   result: ?
+(annoying extra prompt ... but it do not do any serious harm)
+
+  $ hg up -Cqr normal2
+  $ hg merge -r large
+  local changed f which remote deleted
+  use (c)hanged version or (d)elete? c
+  f has been turned into a largefile
+  use (l)argefile or keep as (n)ormal file? l
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  $ cat f
+  large
+
+  $ hg up -Cqr normal2
+  $ ( echo c; echo n ) | hg merge -r large --config ui.interactive=Yes
+  local changed f which remote deleted
+  use (c)hanged version or (d)elete? f has been turned into a largefile
+  use (l)argefile or keep as (n)ormal file? 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  0 largefiles updated, 0 removed
+  $ cat f
+  normal2
+
+  $ hg up -Cqr normal2
+  $ echo d | hg merge -r large --config ui.interactive=Yes
+  local changed f which remote deleted
+  use (c)hanged version or (d)elete? 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  $ cat f
+  large
+
+swap
+
+  $ hg up -Cqr large
+  $ hg merge -r normal2
+  remote changed f which local deleted
+  use (c)hanged version or leave (d)eleted? c
+  f has been turned into a normal file
+  keep as (l)argefile or use (n)ormal file? l
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  $ cat f
+  large
+
+  $ hg up -Cqr large
+  $ ( echo c; echo n ) | hg merge -r normal2 --config ui.interactive=Yes
+  remote changed f which local deleted
+  use (c)hanged version or leave (d)eleted? f has been turned into a normal file
+  keep as (l)argefile or use (n)ormal file? 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  0 largefiles updated, 0 removed
+  $ cat f
+  normal2
+
+  $ hg up -Cqr large
+  $ echo d | hg merge -r normal2 --config ui.interactive=Yes
+  remote changed f which local deleted
+  use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  0 largefiles updated, 0 removed
+  $ cat f
+  large
+
+Ancestor: large   Parent: large=   Parent: normal  result: normal
+
+  $ hg up -Cqr large=
+  $ hg merge -r normal
+  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  0 largefiles updated, 0 removed
+  $ cat f
+  normal
+
+swap
+
+  $ hg up -Cqr normal
+  $ hg merge -r large=
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ cat f
+  normal
+
+Ancestor: large   Parent: large2   Parent: normal  result: ?
+(annoying extra prompt ... but it do not do any serious harm)
+
+  $ hg up -Cqr large2
+  $ hg merge -r normal
+  local changed .hglf/f which remote deleted
+  use (c)hanged version or (d)elete? c
+  f has been turned into a normal file
+  keep as (l)argefile or use (n)ormal file? l
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  $ cat f
+  large2
+
+  $ hg up -Cqr large2
+  $ echo d | hg merge -r normal --config ui.interactive=Yes
+  local changed .hglf/f which remote deleted
+  use (c)hanged version or (d)elete? 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  0 largefiles updated, 0 removed
+  $ cat f
+  normal
+
+swap
+
+  $ hg up -Cqr normal
+  $ hg merge -r large2
+  remote changed .hglf/f which local deleted
+  use (c)hanged version or leave (d)eleted? c
+  f has been turned into a largefile
+  use (l)argefile or keep as (n)ormal file? l
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  $ cat f
+  large2
+
+  $ hg up -Cqr normal
+  $ echo d | hg merge -r large2 --config ui.interactive=Yes
+  remote changed .hglf/f which local deleted
+  use (c)hanged version or leave (d)eleted? 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ cat f
+  normal
+
+  $ cd ..