Patchwork [6,of,6,misc] tests: make unshelve tests more tricky - don't depend on size change

login
register
mail settings
Submitter Mads Kiilerich
Date April 7, 2014, 9:11 p.m.
Message ID <2d78efe6d3adae592b7d.1396905098@mk-desktop>
Download mbox | patch
Permalink /patch/4251/
State Accepted
Commit 6c40ea34ecc19b25d3670783ae059c557a0e7f30
Headers show

Comments

Mads Kiilerich - April 7, 2014, 9:11 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1396905020 -7200
#      Mon Apr 07 23:10:20 2014 +0200
# Node ID 2d78efe6d3adae592b7dbea02b013e8e50da4c2f
# Parent  133a99eb8d0aef2c1f2a9cb69ea14f09985639b9
tests: make unshelve tests more tricky - don't depend on size change

One reason shelve and largefiles doesn't work could be rapidly changing standin
files. Prove that shelve in general doesn't have problems with that.
David Soria Parra - April 8, 2014, 6:08 p.m.
Mads Kiilerich <mads@kiilerich.com> writes:

> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1396905020 -7200
> #      Mon Apr 07 23:10:20 2014 +0200
> # Node ID 2d78efe6d3adae592b7dbea02b013e8e50da4c2f
> # Parent  133a99eb8d0aef2c1f2a9cb69ea14f09985639b9
> tests: make unshelve tests more tricky - don't depend on size change

Queued 3-6 for default. Thank you. I left out 2 because I have no clue
about largefiles and 1 because I think this might need a discussion.
Durham Goode - April 8, 2014, 6:38 p.m.
On 4/7/14, 2:11 PM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1396905020 -7200
> #      Mon Apr 07 23:10:20 2014 +0200
> # Node ID 2d78efe6d3adae592b7dbea02b013e8e50da4c2f
> # Parent  133a99eb8d0aef2c1f2a9cb69ea14f09985639b9
> tests: make unshelve tests more tricky - don't depend on size change
>
> One reason shelve and largefiles doesn't work could be rapidly changing standin
> files. Prove that shelve in general doesn't have problems with that.
Patches 1 through 5 look good to me (I'd queue them but my importer is 
broken).  One inline comment on this patch 6.
> diff --git a/tests/test-shelve.t b/tests/test-shelve.t
> --- a/tests/test-shelve.t
> +++ b/tests/test-shelve.t
> @@ -531,7 +531,7 @@ unshelve should keep a copy of unknown f
>     z
>   
>   
> -unshelve and conflicts with untracked files
> +unshelve and conflicts with tracked and untracked files
>   
>    preparing:
>   
> @@ -546,7 +546,7 @@ unshelve and conflicts with untracked fi
>     $ hg shelve
>     shelved as default
>     0 files updated, 0 files merged, 1 files removed, 0 files unresolved
> -  $ echo gold > f
> +  $ echo g > f
This seems like an awfully subtle change.  Perhaps a comment explaining 
why these particular strings are useful?
>     $ hg unshelve
>     unshelving change 'default'
>     $ hg st
> @@ -555,7 +555,7 @@ unshelve and conflicts with untracked fi
>     $ cat f
>     f
>     $ cat f.orig
> -  gold
> +  g
>   
>    other uncommitted changes - merge:
>   
> @@ -576,7 +576,7 @@ unshelve and conflicts with untracked fi
>     o  0  a  test
>     
>     $ mv f.orig f
> -  $ echo other change >> a
> +  $ echo 1 > a
>     $ hg unshelve --date '1073741824 0'
>     unshelving change 'default'
>     temporarily committing pending changes (restore with 'hg unshelve --abort')
> @@ -602,12 +602,12 @@ unshelve and conflicts with untracked fi
>     ? f.orig
>     $ cat f
>     <<<<<<< local
> -  gold
> +  g
>     =======
>     f
>     >>>>>>> other
>     $ cat f.orig
> -  gold
> +  g
>     $ hg unshelve --abort
>     rebase aborted
>     unshelve of 'default' aborted
> @@ -615,7 +615,7 @@ unshelve and conflicts with untracked fi
>     M a
>     ? f.orig
>     $ cat f.orig
> -  gold
> +  g
>     $ hg unshelve
>     unshelving change 'default'
>     temporarily committing pending changes (restore with 'hg unshelve --abort')
> @@ -645,18 +645,22 @@ unshelve and conflicts with untracked fi
>     ? f.orig
>     $ cat f
>     <<<<<<< local
> -  gold
> +  g
>     =======
>     f
>     >>>>>>> other
>     $ cat f.orig
> -  gold
> +  g
>     $ hg unshelve --abort
>     rebase aborted
>     no changes needed to a
>     no changes needed to d
>     no changes needed to e
>     unshelve of 'default' aborted
> +  $ hg st
> +  ? f.orig
> +  $ cat f.orig
> +  g
>     $ hg shelve --delete default
>   
>     $ cd ..
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Durham Goode - April 8, 2014, 6:43 p.m.
On 4/8/14, 11:38 AM, Durham Goode wrote:
> On 4/7/14, 2:11 PM, Mads Kiilerich wrote:
>> # HG changeset patch
>> # User Mads Kiilerich <madski@unity3d.com>
>> # Date 1396905020 -7200
>> #      Mon Apr 07 23:10:20 2014 +0200
>> # Node ID 2d78efe6d3adae592b7dbea02b013e8e50da4c2f
>> # Parent  133a99eb8d0aef2c1f2a9cb69ea14f09985639b9
>> tests: make unshelve tests more tricky - don't depend on size change
>>
>> One reason shelve and largefiles doesn't work could be rapidly 
>> changing standin
>> files. Prove that shelve in general doesn't have problems with that.
> Patches 1 through 5 look good to me (I'd queue them but my importer is 
> broken).  One inline comment on this patch 6.
Bah, stupid mail client didn't show me dsop's email.  Feel free to 
ignore my comment, since it's already queued.

Patch

diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -531,7 +531,7 @@  unshelve should keep a copy of unknown f
   z
 
 
-unshelve and conflicts with untracked files
+unshelve and conflicts with tracked and untracked files
 
  preparing:
 
@@ -546,7 +546,7 @@  unshelve and conflicts with untracked fi
   $ hg shelve
   shelved as default
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ echo gold > f
+  $ echo g > f
   $ hg unshelve
   unshelving change 'default'
   $ hg st
@@ -555,7 +555,7 @@  unshelve and conflicts with untracked fi
   $ cat f
   f
   $ cat f.orig
-  gold
+  g
 
  other uncommitted changes - merge:
 
@@ -576,7 +576,7 @@  unshelve and conflicts with untracked fi
   o  0  a  test
   
   $ mv f.orig f
-  $ echo other change >> a
+  $ echo 1 > a
   $ hg unshelve --date '1073741824 0'
   unshelving change 'default'
   temporarily committing pending changes (restore with 'hg unshelve --abort')
@@ -602,12 +602,12 @@  unshelve and conflicts with untracked fi
   ? f.orig
   $ cat f
   <<<<<<< local
-  gold
+  g
   =======
   f
   >>>>>>> other
   $ cat f.orig
-  gold
+  g
   $ hg unshelve --abort
   rebase aborted
   unshelve of 'default' aborted
@@ -615,7 +615,7 @@  unshelve and conflicts with untracked fi
   M a
   ? f.orig
   $ cat f.orig
-  gold
+  g
   $ hg unshelve
   unshelving change 'default'
   temporarily committing pending changes (restore with 'hg unshelve --abort')
@@ -645,18 +645,22 @@  unshelve and conflicts with untracked fi
   ? f.orig
   $ cat f
   <<<<<<< local
-  gold
+  g
   =======
   f
   >>>>>>> other
   $ cat f.orig
-  gold
+  g
   $ hg unshelve --abort
   rebase aborted
   no changes needed to a
   no changes needed to d
   no changes needed to e
   unshelve of 'default' aborted
+  $ hg st
+  ? f.orig
+  $ cat f.orig
+  g
   $ hg shelve --delete default
 
   $ cd ..