Mercurial > hg-stable
diff tests/test-shelve.t @ 28571:3f0e25e89e28
shelve: preserve newly created branch on non-bare shelve in wctx (BC)
Before this patch current branch in working context wasnt preserved
after shelve, this patch makes it restore after update.
author | liscju <piotr.listkiewicz@gmail.com> |
---|---|
date | Sat, 12 Mar 2016 18:36:31 +0100 |
parents | 983365382465 |
children | 6a42564081cb |
line wrap: on
line diff
--- a/tests/test-shelve.t Fri Mar 18 16:14:57 2016 -0400 +++ b/tests/test-shelve.t Sat Mar 12 18:36:31 2016 +0100 @@ -1318,3 +1318,62 @@ $ hg commit -qm "Remove unknown" $ cd .. + +We expects that non-bare shelve keeps newly created branch in +working directory. + + $ hg init shelve-preserve-new-branch + $ cd shelve-preserve-new-branch + $ echo "a" >> a + $ hg add a + $ echo "b" >> b + $ hg add b + $ hg commit -m "ab" + $ echo "aa" >> a + $ echo "bb" >> b + $ hg branch new-branch + marked working directory as branch new-branch + (branches are permanent and global, did you want a bookmark?) + $ hg status + M a + M b + $ hg branch + new-branch + $ hg shelve a + shelved as default + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg branch + new-branch + $ hg status + M b + $ touch "c" >> c + $ hg add c + $ hg status + M b + A c + $ hg shelve --exclude c + shelved as default-01 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg branch + new-branch + $ hg status + A c + $ hg shelve --include c + shelved as default-02 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg branch + new-branch + $ hg status + $ echo "d" >> d + $ hg add d + $ hg status + A d + +We expect that bare-shelve will not keep branch in current working directory. + + $ hg shelve + shelved as default-03 + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg branch + default +