diff -r bb135a784b70 -r 5171937ad0f9 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sun Jun 23 20:58:01 2019 +0530 +++ b/mercurial/cmdutil.py Sun Jun 23 22:31:31 2019 +0530 @@ -3419,3 +3419,9 @@ except error.CorruptedState: nodes = repo.vfs.read('graftstate').splitlines() return {'nodes': nodes} + +def hgabortgraft(ui, repo): + """ abort logic for aborting graft using 'hg abort'""" + with repo.wlock(): + graftstate = statemod.cmdstate(repo, 'graftstate') + return abortgraft(ui, repo, graftstate)