Mercurial > public > mercurial-scm > hg
diff tests/test-histedit-arguments.t @ 26584:e28102403d1b
histedit: delete histedit statefile on any exception during abort
When an user aborts a histedit, many things could go wrong. At a minimum, after
a histedit abort failure, their repository should be out of that state. We've
found situations where the user could not exit the histedit state without
manually deleting the histedit state file. This patch ensures that if any
exception happens during an abort, the histedit statefile will be deleted so
that users are out of the histedit state and can at least manually get the repo
back to a workable condition.
author | Christian Delahousse <cdelahousse@fb.com> |
---|---|
date | Mon, 05 Oct 2015 16:44:45 -0700 |
parents | 5706d130ec16 |
children | 50fc80e46786 |
line wrap: on
line diff
--- a/tests/test-histedit-arguments.t Tue Oct 06 15:09:28 2015 -0700 +++ b/tests/test-histedit-arguments.t Mon Oct 05 16:44:45 2015 -0700 @@ -324,3 +324,25 @@ | o 0:6058cbb6cfd7 one + +Test that abort fails gracefully on exception +---------------------------------------------- + $ hg histedit . -q --commands - << EOF + > edit 8fda0c726bf2 6 x + > EOF + Make changes as needed, you may commit or record as needed now. + When you are finished, run hg histedit --continue to resume. + [1] +Corrupt histedit state file + $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit + $ mv ../corrupt-histedit .hg/histedit-state + $ hg histedit --abort + warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up + abort: No such file or directory: * (glob) + [255] +Histedit state has been exited + $ hg summary -q + parent: 5:63379946892c + commit: 1 added, 1 unknown (new branch head) + update: 4 new changesets (update) +