This adds support of graft to hg abort plan.
The patch creates a seperate function cmdutil.hgabortgraft
so that abort logic for graft can be called independently.
This logic is registered to the statedetection API as abortfunc.
Results are shown as tests.
let's move this function to cmdutil.py. Should move _readgraftstate, _abortgraftstate to cmdutil.py too. Movement can be done as a separate patch before this patch.