This adds support of graft to hg continue plan.
The patch creates a seperate function cmdutil.continuegraft
so that continue logic for graft can be called independently.
This logic is registered to the statedetection API as continuefunc.
Results are shown as tests.
It looks like pretty much this entire function is copies commands.graft() and then all this code is left dead here (since cont = True above). I'd prefer to de-queue this commit and let you clean this up and then submit a new patch, but maybe other reviewers are less picky or stubborn than I am, so I'll leave it queued until I hear from someone else.