cmdstate: introduce a "saver" contextmanager and use it in place of save()
Previously, the state was only saved in some paths out of these functions. This
can be problematic, if the user ctrl-c's (or `kill -9`'s) the process, or we
exit out of `relocate` for anything besides the "expected" reason, we won't
record that we were in the middle of an evolve.
One of our users has discovered that this leaves hg in a weird state; the user
did something like this:
```
$ hg evolve
<something goes wrong with the merge tool, hits ctrl-c>
<deals with the merge conflicts>
$ hg evolve --continue
abort: no interrupted evolve to continue
$ hg evolve
abort: uncommitted changes
# Note: commands.status.verbose=True is set.
$ hg status
M foo
# The repository is in an unfinished *update* state.
# No unresolved merge conflicts
# To continue: hg update
```
The user did an `hg update`, but it didn't actually do anything besides take it
out of the unfinished update state (the files were still dirty in the working
directory).
.. Copyright © 2017 Pierre-Yves David <pierre-yves.david@octobus.net>
==============================================
Known limitations of the current documentation
==============================================
Features not covered by tutorials
=================================
Some of the *newer* features of evolution might not be reflected in the
documentation yet. You can directly check the inline documentation of the
extension itself for fresher details using `hg help -e evolve`.
Known undocumented features are:
* `hg prev`,
* `hg next`,
* `hg next --evolve`,
* `hg evolve --rev`,
* `hg evolve --list`,
* `hg obslog`,
* `hg split`,
* `hg metaedit`,
* `hg touch`,
* `hg amend --extract`,
* `hg pdiff`,
* `hg pstatus`,
* `hg amend -i`,
* various topic related elements (in particular `hg stack`),
Unreferenced Documents
======================
There are documents with content not linked in the flow of the main
documentation. Some might be outdated and some are too fresh to be integrated in
the main flow yet.
.. toctree::
:maxdepth: 1
evolve-faq
evolve-good-practice
obs-terms
tutorials/topic-tutorial
tutorials/tutorial