Patchwork [shelve-ext] shelve: fix use of unexpected working dirs in test-shelve.t

login
register
mail settings
Submitter Kostia Balytskyi
Date Nov. 29, 2016, 12:14 p.m.
Message ID <b4e28d31201c6af4c677.1480421672@dev1902.lla1.facebook.com>
Download mbox | patch
Permalink /patch/17783/
State Accepted
Headers show

Comments

Kostia Balytskyi - Nov. 29, 2016, 12:14 p.m.
# HG changeset patch
# User Kostia Balytskyi <ikostia@fb.com>
# Date 1480421465 28800
#      Tue Nov 29 04:11:05 2016 -0800
# Node ID b4e28d31201c6af4c677c53b42c140b3cfb3d352
# Parent  6d69c3708cf3b9a70403c3d3cb3c44ff1e8faf53
shelve: fix use of unexpected working dirs in test-shelve.t

Fixing some clowniness where we created ~four levels of nested repos
and once (my test case :( ) did not even cd into a created repo.
Jun Wu - Nov. 29, 2016, 1:05 p.m.
This looks good to me.

Excerpts from Kostia Balytskyi's message of 2016-11-29 04:14:32 -0800:
> # HG changeset patch
> # User Kostia Balytskyi <ikostia@fb.com>
> # Date 1480421465 28800
> #      Tue Nov 29 04:11:05 2016 -0800
> # Node ID b4e28d31201c6af4c677c53b42c140b3cfb3d352
> # Parent  6d69c3708cf3b9a70403c3d3cb3c44ff1e8faf53
> shelve: fix use of unexpected working dirs in test-shelve.t
> 
> Fixing some clowniness where we created ~four levels of nested repos
> and once (my test case :( ) did not even cd into a created repo.
> 
> diff --git a/tests/test-shelve.t b/tests/test-shelve.t
> --- a/tests/test-shelve.t
> +++ b/tests/test-shelve.t
> @@ -1383,6 +1383,7 @@ We expect that bare-shelve will not keep
>    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>    $ hg branch
>    default
> +  $ cd ..
>  
>  When i shelve commit on newly created branch i expect
>  that after unshelve newly created branch will be preserved.
> @@ -1416,6 +1417,7 @@ that after unshelve newly created branch
>    ? b
>    $ hg branch
>    test
> +  $ cd ..
>  
>  When i shelve commit on newly created branch, make
>  some changes, unshelve it and running into merge
> @@ -1489,6 +1491,7 @@ test branch.
>    A b
>    $ hg branch
>    default
> +  $ cd ..
>  
>  When i unshelve resulting in merge conflicts and makes saved
>  file shelvedstate looks like in previous versions in
> @@ -1551,6 +1554,7 @@ in previous versions) and running unshel
>    M a
>    $ hg branch
>    default
> +  $ cd ..
>  
>  On non bare shelve the branch information shouldn't be restored
>  
> @@ -1624,7 +1628,7 @@ progress
>    $ cd ..
>  
>  Unshelve respects --keep even if user intervention is needed
> -  $ hg init unshelvekeep
> +  $ hg init unshelvekeep && cd unshelvekeep
>    $ echo 1 > file && hg ci -Am 1
>    adding file
>    $ echo 2 >> file
> @@ -1637,7 +1641,7 @@ Unshelve respects --keep even if user in
>    $ hg unshelve --keep
>    unshelving change 'default'
>    rebasing shelved changes
> -  rebasing 3:1d24e58054c8 "changes to: 1" (tip)
> +  rebasing 2:3fbe6fbb0bef "changes to: 1" (tip)
>    merging file
>    warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
>    unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
> @@ -1646,7 +1650,7 @@ Unshelve respects --keep even if user in
>    (no more unresolved files)
>    continue: hg unshelve --continue
>    $ hg unshelve --continue
> -  rebasing 3:1d24e58054c8 "changes to: 1" (tip)
> +  rebasing 2:3fbe6fbb0bef "changes to: 1" (tip)
>    unshelve of 'default' complete
>    $ hg shelve --list
> -  default         (1s ago)    changes to: 1
> +  default         (*s ago)    changes to: 1 (glob)
Yuya Nishihara - Nov. 29, 2016, 1:59 p.m.
On Tue, 29 Nov 2016 04:14:32 -0800, Kostia Balytskyi wrote:
> # HG changeset patch
> # User Kostia Balytskyi <ikostia@fb.com>
> # Date 1480421465 28800
> #      Tue Nov 29 04:11:05 2016 -0800
> # Node ID b4e28d31201c6af4c677c53b42c140b3cfb3d352
> # Parent  6d69c3708cf3b9a70403c3d3cb3c44ff1e8faf53
> shelve: fix use of unexpected working dirs in test-shelve.t

Queued, thanks.

>  Unshelve respects --keep even if user intervention is needed
> -  $ hg init unshelvekeep
> +  $ hg init unshelvekeep && cd unshelvekeep
>    $ echo 1 > file && hg ci -Am 1
>    adding file
>    $ echo 2 >> file
> @@ -1637,7 +1641,7 @@ Unshelve respects --keep even if user in
>    $ hg unshelve --keep
>    unshelving change 'default'
>    rebasing shelved changes
> -  rebasing 3:1d24e58054c8 "changes to: 1" (tip)
> +  rebasing 2:3fbe6fbb0bef "changes to: 1" (tip)
>    merging file
>    warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
>    unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
> @@ -1646,7 +1650,7 @@ Unshelve respects --keep even if user in
>    (no more unresolved files)
>    continue: hg unshelve --continue
>    $ hg unshelve --continue
> -  rebasing 3:1d24e58054c8 "changes to: 1" (tip)
> +  rebasing 2:3fbe6fbb0bef "changes to: 1" (tip)
>    unshelve of 'default' complete
>    $ hg shelve --list
> -  default         (1s ago)    changes to: 1
> +  default         (*s ago)    changes to: 1 (glob)

I've added '$ cd ..' here so future tests won't have the same issue.

Patch

diff --git a/tests/test-shelve.t b/tests/test-shelve.t
--- a/tests/test-shelve.t
+++ b/tests/test-shelve.t
@@ -1383,6 +1383,7 @@  We expect that bare-shelve will not keep
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ hg branch
   default
+  $ cd ..
 
 When i shelve commit on newly created branch i expect
 that after unshelve newly created branch will be preserved.
@@ -1416,6 +1417,7 @@  that after unshelve newly created branch
   ? b
   $ hg branch
   test
+  $ cd ..
 
 When i shelve commit on newly created branch, make
 some changes, unshelve it and running into merge
@@ -1489,6 +1491,7 @@  test branch.
   A b
   $ hg branch
   default
+  $ cd ..
 
 When i unshelve resulting in merge conflicts and makes saved
 file shelvedstate looks like in previous versions in
@@ -1551,6 +1554,7 @@  in previous versions) and running unshel
   M a
   $ hg branch
   default
+  $ cd ..
 
 On non bare shelve the branch information shouldn't be restored
 
@@ -1624,7 +1628,7 @@  progress
   $ cd ..
 
 Unshelve respects --keep even if user intervention is needed
-  $ hg init unshelvekeep
+  $ hg init unshelvekeep && cd unshelvekeep
   $ echo 1 > file && hg ci -Am 1
   adding file
   $ echo 2 >> file
@@ -1637,7 +1641,7 @@  Unshelve respects --keep even if user in
   $ hg unshelve --keep
   unshelving change 'default'
   rebasing shelved changes
-  rebasing 3:1d24e58054c8 "changes to: 1" (tip)
+  rebasing 2:3fbe6fbb0bef "changes to: 1" (tip)
   merging file
   warning: conflicts while merging file! (edit, then use 'hg resolve --mark')
   unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
@@ -1646,7 +1650,7 @@  Unshelve respects --keep even if user in
   (no more unresolved files)
   continue: hg unshelve --continue
   $ hg unshelve --continue
-  rebasing 3:1d24e58054c8 "changes to: 1" (tip)
+  rebasing 2:3fbe6fbb0bef "changes to: 1" (tip)
   unshelve of 'default' complete
   $ hg shelve --list
-  default         (1s ago)    changes to: 1
+  default         (*s ago)    changes to: 1 (glob)