Mercurial > hg
comparison hgext/transplant.py @ 42530:dc3fdd1b5af4
state: created new class statecheck to handle unfinishedstates
For the purpose of handling states for various multistep operations like
`hg graft`, `hg histedit`, `hg bisect` et al a new class called statecheck
is created .This will help in having a unified approach towards these commands
and handle them with ease.
The class takes in 4 basic arguments which include the name of the command, the
name of the state file associated with it , clearable flag , allowcommit flag.
This also also adds the support of`checkunfinished()` and
`clearunfinished()` to the class.
Tests remain unchanged.
Differential Revision: https://phab.mercurial-scm.org/D6501
author | Taapas Agrawal <taapas2897@gmail.com> |
---|---|
date | Sun, 09 Jun 2019 00:43:36 +0530 |
parents | 5f2f6912c9e6 |
children | 12243f15d53e |
comparison
equal
deleted
inserted
replaced
42529:5f2f6912c9e6 | 42530:dc3fdd1b5af4 |
---|---|
756 ctx = context.resource(mapping, 'ctx') | 756 ctx = context.resource(mapping, 'ctx') |
757 n = ctx.extra().get('transplant_source') | 757 n = ctx.extra().get('transplant_source') |
758 return n and nodemod.hex(n) or '' | 758 return n and nodemod.hex(n) or '' |
759 | 759 |
760 def extsetup(ui): | 760 def extsetup(ui): |
761 statemod.unfinishedstates.append( | 761 statemod.addunfinished ( |
762 ['transplant/journal', True, False, _('transplant in progress'), | 762 'transplant', fname='transplant/journal', clearable=True, |
763 _("use 'hg transplant --continue' or 'hg update' to abort")]) | 763 cmdhint=_("use 'hg transplant --continue' or 'hg update' to abort") |
764 ) | |
764 | 765 |
765 # tell hggettext to extract docstrings from these functions: | 766 # tell hggettext to extract docstrings from these functions: |
766 i18nfunctions = [revsettransplanted, kwtransplanted] | 767 i18nfunctions = [revsettransplanted, kwtransplanted] |