Show More
@@ -482,9 +482,9 b' def unshelveabort(ui, repo, state, opts)' | |||
|
482 | 482 | mergefiles(ui, repo, state.wctx, state.pendingctx) |
|
483 | 483 | |
|
484 | 484 | repair.strip(ui, repo, state.stripnodes, backup=False, topic='shelve') |
|
485 | finally: | |
|
485 | 486 | shelvedstate.clear(repo) |
|
486 | 487 | ui.warn(_("unshelve of '%s' aborted\n") % state.name) |
|
487 | finally: | |
|
488 | 488 | lockmod.release(lock, wlock) |
|
489 | 489 | |
|
490 | 490 | def mergefiles(ui, repo, wctx, shelvectx): |
@@ -1010,3 +1010,43 b' with general delta' | |||
|
1010 | 1010 | changegroup -- "{'version': '02'}" |
|
1011 | 1011 | 7e30d8ac6f23cfc84330fd7e698730374615d21a |
|
1012 | 1012 | $ cd .. |
|
1013 | ||
|
1014 | test Abort unshelve always gets user out of the unshelved state | |
|
1015 | --------------------------------------------------------------- | |
|
1016 | $ hg init salvage | |
|
1017 | $ cd salvage | |
|
1018 | $ echo 'content' > root | |
|
1019 | $ hg commit -A -m 'root' -q | |
|
1020 | $ echo '' > root | |
|
1021 | $ hg shelve -q | |
|
1022 | $ echo 'contADDent' > root | |
|
1023 | $ hg unshelve -q | |
|
1024 | warning: conflicts while merging root! (edit, then use 'hg resolve --mark') | |
|
1025 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') | |
|
1026 | [1] | |
|
1027 | Wreak havoc on the unshelve process | |
|
1028 | $ rm .hg/unshelverebasestate | |
|
1029 | $ hg unshelve --abort | |
|
1030 | unshelve of 'default' aborted | |
|
1031 | abort: No such file or directory | |
|
1032 | [255] | |
|
1033 | Can the user leave the current state? | |
|
1034 | $ hg up -C . | |
|
1035 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
1036 | ||
|
1037 | Try again but with a corrupted shelve state file | |
|
1038 | $ hg strip -r 2 -r 1 -q | |
|
1039 | $ hg up -r 0 -q | |
|
1040 | $ echo '' > root | |
|
1041 | $ hg shelve -q | |
|
1042 | $ echo 'contADDent' > root | |
|
1043 | $ hg unshelve -q | |
|
1044 | warning: conflicts while merging root! (edit, then use 'hg resolve --mark') | |
|
1045 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') | |
|
1046 | [1] | |
|
1047 | $ sed 's/ae8c668541e8/123456789012/' .hg/shelvedstate > ../corrupt-shelvedstate | |
|
1048 | $ mv ../corrupt-shelvedstate .hg/histedit-state | |
|
1049 | $ hg unshelve --abort |& grep 'rebase aborted' | |
|
1050 | rebase aborted | |
|
1051 | $ hg up -C . | |
|
1052 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
General Comments 0
You need to be logged in to leave comments.
Login now