mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 14:58:03 +03:00
test-shelve: remove test cases about named branches
Summary: They won't pass with the new code. Differential Revision: D13993826 fbshipit-source-id: e5156da05ef922940198c2fcf7458a086ce23bb4
This commit is contained in:
parent
87b87d5490
commit
688f14a527
@ -1171,262 +1171,6 @@ And if I shelve, commit, then unshelve, does it become modified?
|
|||||||
$ hg commit -qm "Remove unknown"
|
$ hg commit -qm "Remove unknown"
|
||||||
$ cd ..
|
$ cd ..
|
||||||
|
|
||||||
We expects that non-bare shelve keeps newly created branch in
|
|
||||||
working directory.
|
|
||||||
$ hg init obs-shelve-preserve-new-branch
|
|
||||||
$ cd obs-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
|
|
||||||
$ cd ..
|
|
||||||
|
|
||||||
When i shelve commit on newly created branch i expect
|
|
||||||
that after unshelve newly created branch will be preserved.
|
|
||||||
$ hg init obs-shelve_on_new_branch_simple
|
|
||||||
$ cd obs-shelve_on_new_branch_simple
|
|
||||||
$ echo "aaa" >> a
|
|
||||||
$ hg commit -A -m "a"
|
|
||||||
adding a
|
|
||||||
$ hg branch
|
|
||||||
default
|
|
||||||
$ hg branch test
|
|
||||||
marked working directory as branch test
|
|
||||||
(branches are permanent and global, did you want a bookmark?)
|
|
||||||
$ echo "bbb" >> a
|
|
||||||
$ hg status
|
|
||||||
M a
|
|
||||||
$ hg shelve
|
|
||||||
shelved as default
|
|
||||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
||||||
$ hg branch
|
|
||||||
default
|
|
||||||
$ echo "bbb" >> b
|
|
||||||
$ hg status
|
|
||||||
? b
|
|
||||||
$ hg unshelve
|
|
||||||
unshelving change 'default'
|
|
||||||
marked working directory as branch test
|
|
||||||
$ hg status
|
|
||||||
M a
|
|
||||||
? b
|
|
||||||
$ hg branch
|
|
||||||
test
|
|
||||||
$ cd ..
|
|
||||||
|
|
||||||
When i shelve commit on newly created branch, make
|
|
||||||
some changes, unshelve it and running into merge
|
|
||||||
conflicts i expect that after fixing them and
|
|
||||||
running unshelve --continue newly created branch
|
|
||||||
will be preserved.
|
|
||||||
$ hg init obs-shelve_on_new_branch_conflict
|
|
||||||
$ cd obs-shelve_on_new_branch_conflict
|
|
||||||
$ echo "aaa" >> a
|
|
||||||
$ hg commit -A -m "a"
|
|
||||||
adding a
|
|
||||||
$ hg branch
|
|
||||||
default
|
|
||||||
$ hg branch test
|
|
||||||
marked working directory as branch test
|
|
||||||
(branches are permanent and global, did you want a bookmark?)
|
|
||||||
$ echo "bbb" >> a
|
|
||||||
$ hg status
|
|
||||||
M a
|
|
||||||
$ hg shelve
|
|
||||||
shelved as default
|
|
||||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
||||||
$ hg branch
|
|
||||||
default
|
|
||||||
$ echo "ccc" >> a
|
|
||||||
$ hg status
|
|
||||||
M a
|
|
||||||
$ hg unshelve
|
|
||||||
unshelving change 'default'
|
|
||||||
temporarily committing pending changes (restore with 'hg unshelve --abort')
|
|
||||||
rebasing shelved changes
|
|
||||||
rebasing 1:955d9868d567 "shelve changes to: a"
|
|
||||||
merging a
|
|
||||||
warning: 1 conflicts while merging a! (edit, then use 'hg resolve --mark')
|
|
||||||
unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
|
|
||||||
[1]
|
|
||||||
$ echo "aaabbbccc" > a
|
|
||||||
$ rm a.orig
|
|
||||||
$ hg resolve --mark a
|
|
||||||
(no more unresolved files)
|
|
||||||
continue: hg unshelve --continue
|
|
||||||
$ hg unshelve --continue
|
|
||||||
rebasing 1:955d9868d567 "shelve changes to: a"
|
|
||||||
marked working directory as branch test
|
|
||||||
unshelve of 'default' complete
|
|
||||||
$ cat a
|
|
||||||
aaabbbccc
|
|
||||||
$ hg status
|
|
||||||
M a
|
|
||||||
$ hg branch
|
|
||||||
test
|
|
||||||
$ hg commit -m "test-commit"
|
|
||||||
|
|
||||||
When i shelve on test branch, update to default branch
|
|
||||||
and unshelve i expect that it will not preserve previous
|
|
||||||
test branch.
|
|
||||||
$ echo "xxx" > b
|
|
||||||
$ hg add b
|
|
||||||
$ hg shelve
|
|
||||||
shelved as test
|
|
||||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
||||||
$ hg update -r default
|
|
||||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
||||||
$ hg unshelve
|
|
||||||
unshelving change 'test'
|
|
||||||
rebasing shelved changes
|
|
||||||
rebasing 5:7089b8bba8a3 "shelve changes to: test-commit" (tip)
|
|
||||||
$ hg status
|
|
||||||
A b
|
|
||||||
$ hg branch
|
|
||||||
default
|
|
||||||
$ cd ..
|
|
||||||
|
|
||||||
When i unshelve resulting in merge conflicts and makes saved
|
|
||||||
file shelvedstate looks like in previous versions in
|
|
||||||
mercurial(without restore branch information in 7th line) i
|
|
||||||
expect that after resolving conflicts and successfully
|
|
||||||
running 'shelve --continue' the branch information won't be
|
|
||||||
restored and branch will be unchanged.
|
|
||||||
|
|
||||||
shelve on new branch, conflict with previous shelvedstate
|
|
||||||
$ hg init obs-conflict
|
|
||||||
$ cd obs-conflict
|
|
||||||
$ echo "aaa" >> a
|
|
||||||
$ hg commit -A -m "a"
|
|
||||||
adding a
|
|
||||||
$ hg branch
|
|
||||||
default
|
|
||||||
$ hg branch test
|
|
||||||
marked working directory as branch test
|
|
||||||
(branches are permanent and global, did you want a bookmark?)
|
|
||||||
$ echo "bbb" >> a
|
|
||||||
$ hg status
|
|
||||||
M a
|
|
||||||
$ hg shelve
|
|
||||||
shelved as default
|
|
||||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
||||||
$ hg branch
|
|
||||||
default
|
|
||||||
$ echo "ccc" >> a
|
|
||||||
$ hg status
|
|
||||||
M a
|
|
||||||
$ hg unshelve
|
|
||||||
unshelving change 'default'
|
|
||||||
temporarily committing pending changes (restore with 'hg unshelve --abort')
|
|
||||||
rebasing shelved changes
|
|
||||||
rebasing 1:955d9868d567 "shelve changes to: a"
|
|
||||||
merging a
|
|
||||||
warning: 1 conflicts while merging a! (edit, then use 'hg resolve --mark')
|
|
||||||
unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
|
|
||||||
[1]
|
|
||||||
|
|
||||||
Removing restore branch information from shelvedstate file(making it looks like
|
|
||||||
in previous versions) and running unshelve --continue
|
|
||||||
$ cp .hg/shelvedstate .hg/shelvedstate_old
|
|
||||||
$ cat .hg/shelvedstate_old | grep -v 'branchtorestore' > .hg/shelvedstate
|
|
||||||
$ echo "aaabbbccc" > a
|
|
||||||
$ rm a.orig
|
|
||||||
$ hg resolve --mark a
|
|
||||||
(no more unresolved files)
|
|
||||||
continue: hg unshelve --continue
|
|
||||||
$ hg unshelve --continue
|
|
||||||
rebasing 1:955d9868d567 "shelve changes to: a"
|
|
||||||
unshelve of 'default' complete
|
|
||||||
$ cat a
|
|
||||||
aaabbbccc
|
|
||||||
$ hg status
|
|
||||||
M a
|
|
||||||
$ hg branch
|
|
||||||
default
|
|
||||||
$ cd ..
|
|
||||||
|
|
||||||
On non bare shelve the branch information shouldn't be restored
|
|
||||||
$ hg init obssh-bare_shelve_on_new_branch
|
|
||||||
$ cd obssh-bare_shelve_on_new_branch
|
|
||||||
$ echo "aaa" >> a
|
|
||||||
$ hg commit -A -m "a"
|
|
||||||
adding a
|
|
||||||
$ hg branch
|
|
||||||
default
|
|
||||||
$ hg branch test
|
|
||||||
marked working directory as branch test
|
|
||||||
(branches are permanent and global, did you want a bookmark?)
|
|
||||||
$ echo "bbb" >> a
|
|
||||||
$ hg status
|
|
||||||
M a
|
|
||||||
$ hg shelve a
|
|
||||||
shelved as default
|
|
||||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
||||||
$ hg branch
|
|
||||||
test
|
|
||||||
$ hg branch default
|
|
||||||
marked working directory as branch default
|
|
||||||
(branches are permanent and global, did you want a bookmark?)
|
|
||||||
$ echo "bbb" >> b
|
|
||||||
$ hg status
|
|
||||||
? b
|
|
||||||
$ hg unshelve
|
|
||||||
unshelving change 'default'
|
|
||||||
$ hg status
|
|
||||||
M a
|
|
||||||
? b
|
|
||||||
$ hg branch
|
|
||||||
default
|
|
||||||
$ cd ..
|
|
||||||
|
|
||||||
Prepare unshelve with a corrupted shelvedstate
|
Prepare unshelve with a corrupted shelvedstate
|
||||||
$ hg init obssh-r1 && cd obssh-r1
|
$ hg init obssh-r1 && cd obssh-r1
|
||||||
$ echo text1 > file && hg add file
|
$ echo text1 > file && hg add file
|
||||||
|
Loading…
Reference in New Issue
Block a user