comparison tests/test-rebase-abort.t @ 19848:577f4c562d52 stable

rebase: catch RepoLookupError at restoring rebase state for abort/continue Before this patch, "rebase --abort"/"--continue" may fail, when rebase state is inconsistent: for example, the root of rebase destination revisions recorded in rebase state file is already stripped manually. Mercurial earlier than 2.7 allows users to do anything other than starting new rebase, even though current rebase is not finished or aborted yet. So, such inconsistent rebase states may be left and forgotten in repositories. This patch catches RepoLookupError at restoring rebase state for abort/continue, and treat such state as "broken".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 01 Oct 2013 00:35:07 +0900
parents e5d9441ec281
children e7fa36d2ad3a
comparison
equal deleted inserted replaced
19847:45c3086880c7 19848:577f4c562d52
73 |/ 73 |/
74 o 1:draft 'C2' 74 o 1:draft 'C2'
75 | 75 |
76 o 0:draft 'C1' 76 o 0:draft 'C1'
77 77
78 Test safety for inconsistent rebase state, which may be created (and
79 forgotten) by Mercurial earlier than 2.7. This emulates Mercurial
80 earlier than 2.7 by renaming ".hg/rebasestate" temporarily.
81
82 $ hg rebase -s 3 -d 2
83 merging common
84 warning: conflicts during merge.
85 merging common incomplete! (edit conflicts, then use 'hg resolve --mark')
86 unresolved conflicts (see hg resolve, then hg rebase --continue)
87 [1]
88
89 $ mv .hg/rebasestate .hg/rebasestate.back
90 $ hg update --quiet --clean 2
91 $ hg --config extensions.mq= strip --quiet "destination()"
92 $ mv .hg/rebasestate.back .hg/rebasestate
93
94 $ hg rebase --continue
95 abort: cannot continue inconsistent rebase
96 (use "hg rebase --abort" to clear borken state)
97 [255]
98 $ hg rebase --abort
99 rebase aborted (no revision is removed, only broken state is cleared)
100
78 $ cd .. 101 $ cd ..
79 102
80 103
81 Construct new repo: 104 Construct new repo:
82 105