Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 42582:5171937ad0f9
abort: added support for graft
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.
Differential Revision: https://phab.mercurial-scm.org/D6567
author | Taapas Agrawal <taapas2897@gmail.com> |
---|---|
date | Sun, 23 Jun 2019 22:31:31 +0530 |
parents | b8d54f4625cb |
children | 5162753c4c14 |
line wrap: on
line diff
--- 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)