Mercurial > hg
comparison tests/test-shelve.t @ 38462:61e4cf1be5b2
shelve: directly handle the abort process
Shelve is currently sub-contracting some of its work to the rebase extension.
In order to make shelve more independent and flexible we would like shelve to
handle the parent alignment directly.
This change starts with the simplest bits, handling the abort process. It
turns out we have all the necessary bits in the `shelvestate` file. So we do
not need anything from the interrupted rebase.
As a nice side effect, a test about missing `shelverebasestate` state file now
behave better.
Differential Revision: https://phab.mercurial-scm.org/D3688
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Mon, 28 May 2018 18:15:21 +0200 |
parents | 50f5fc232c16 |
children | f4776f8b98e0 |
comparison
equal
deleted
inserted
replaced
38461:8459e8d2f729 | 38462:61e4cf1be5b2 |
---|---|
404 M b.rename/b | 404 M b.rename/b |
405 M c.copy | 405 M c.copy |
406 R b/b | 406 R b/b |
407 ? a/a.orig | 407 ? a/a.orig |
408 $ hg unshelve -a | 408 $ hg unshelve -a |
409 rebase aborted | |
410 unshelve of 'default' aborted | 409 unshelve of 'default' aborted |
411 $ hg heads -q | 410 $ hg heads -q |
412 3:2e69b451d1ea | 411 3:2e69b451d1ea |
413 $ hg parents | 412 $ hg parents |
414 changeset: 3:2e69b451d1ea | 413 changeset: 3:2e69b451d1ea |
815 >>>>>>> source: 81152db69da7 - shelve: changes to: commit stuff | 814 >>>>>>> source: 81152db69da7 - shelve: changes to: commit stuff |
816 $ cat f.orig | 815 $ cat f.orig |
817 g | 816 g |
818 $ hg unshelve --abort -t false | 817 $ hg unshelve --abort -t false |
819 tool option will be ignored | 818 tool option will be ignored |
820 rebase aborted | |
821 unshelve of 'default' aborted | 819 unshelve of 'default' aborted |
822 $ hg st | 820 $ hg st |
823 M a | 821 M a |
824 ? f.orig | 822 ? f.orig |
825 $ cat f.orig | 823 $ cat f.orig |
859 f | 857 f |
860 >>>>>>> source: 81152db69da7 - shelve: changes to: commit stuff | 858 >>>>>>> source: 81152db69da7 - shelve: changes to: commit stuff |
861 $ cat f.orig | 859 $ cat f.orig |
862 g | 860 g |
863 $ hg unshelve --abort | 861 $ hg unshelve --abort |
864 rebase aborted | |
865 unshelve of 'default' aborted | 862 unshelve of 'default' aborted |
866 $ hg st | 863 $ hg st |
867 ? f.orig | 864 ? f.orig |
868 $ cat f.orig | 865 $ cat f.orig |
869 g | 866 g |
1269 --------------------------------------------------------------- | 1266 --------------------------------------------------------------- |
1270 Wreak havoc on the unshelve process | 1267 Wreak havoc on the unshelve process |
1271 $ rm .hg/unshelverebasestate | 1268 $ rm .hg/unshelverebasestate |
1272 $ hg unshelve --abort | 1269 $ hg unshelve --abort |
1273 unshelve of 'default' aborted | 1270 unshelve of 'default' aborted |
1274 abort: $ENOENT$* (glob) | |
1275 [255] | |
1276 Can the user leave the current state? | |
1277 $ hg up -C . | |
1278 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1279 | 1271 |
1280 Try again but with a corrupted shelve state file | 1272 Try again but with a corrupted shelve state file |
1281 $ hg strip -r 406ad6fb39eb -r e22bdf25c863 -q | |
1282 $ hg up -r 0 -q | 1273 $ hg up -r 0 -q |
1283 $ echo '' > root | 1274 $ echo '' > root |
1284 $ hg shelve -q | 1275 $ hg shelve -q |
1285 $ echo 'contADDent' > root | 1276 $ echo 'contADDent' > root |
1286 $ hg unshelve -q | 1277 $ hg unshelve -q |
1288 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') | 1279 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
1289 [1] | 1280 [1] |
1290 $ sed 's/ae8c668541e8/123456789012/' .hg/shelvedstate > ../corrupt-shelvedstate | 1281 $ sed 's/ae8c668541e8/123456789012/' .hg/shelvedstate > ../corrupt-shelvedstate |
1291 $ mv ../corrupt-shelvedstate .hg/histedit-state | 1282 $ mv ../corrupt-shelvedstate .hg/histedit-state |
1292 $ hg unshelve --abort 2>&1 | grep 'aborted' | 1283 $ hg unshelve --abort 2>&1 | grep 'aborted' |
1293 rebase aborted | |
1294 unshelve of 'default-01' aborted | 1284 unshelve of 'default-01' aborted |
1295 $ hg summary | 1285 $ hg summary |
1296 parent: 0:ae8c668541e8 tip | 1286 parent: 0:ae8c668541e8 tip |
1297 root | 1287 root |
1298 branch: default | 1288 branch: default |