graft: start using the cmdstate class to read and write data to graftstate...
graft: start using the cmdstate class to read and write data to graftstate
This patch replaces the logic to read and write data to graftstate file to use
the state.cmdstate() class.
The previous graftstate format didn't had any version number on top of that, so
we have to catch the CorruptedState error and then read the graftstate in case
of old state files.
This will help us to implement nice additions to graft commands like
`--no-commit`, `--abort`, `--stop` flags.
Passing on test-graft.t shows that things are working fine.
Differential Revision:
https://phab.mercurial-scm.org/D3654