Mercurial > hg
comparison hgext/transplant.py @ 42717:0a4303c77637
continue: added support for transplant
This creates a seperate function `continuetransplant()`
containing logic for resuming transplant from interrupted
state.
`continuetransplant()` is then registered as `continuefunc`
for state detection API.
Results are shown in tests.
Differential Revision: https://phab.mercurial-scm.org/D6689
author | Taapas Agrawal <taapas2897@gmail.com> |
---|---|
date | Wed, 24 Jul 2019 18:32:36 +0530 |
parents | 12243f15d53e |
children | ac6121a24f27 |
comparison
equal
deleted
inserted
replaced
42716:50c2c3eae64e | 42717:0a4303c77637 |
---|---|
732 tp.apply(repo, source, revmap, merges, opts) | 732 tp.apply(repo, source, revmap, merges, opts) |
733 finally: | 733 finally: |
734 if cleanupfn: | 734 if cleanupfn: |
735 cleanupfn() | 735 cleanupfn() |
736 | 736 |
737 def continuecmd(ui, repo): | |
738 """logic to resume an interrupted transplant using | |
739 'hg continue'""" | |
740 with repo.wlock(): | |
741 tp = transplanter(ui, repo, {}) | |
742 return tp.resume(repo, repo, {}) | |
743 | |
737 revsetpredicate = registrar.revsetpredicate() | 744 revsetpredicate = registrar.revsetpredicate() |
738 | 745 |
739 @revsetpredicate('transplanted([set])') | 746 @revsetpredicate('transplanted([set])') |
740 def revsettransplanted(repo, subset, x): | 747 def revsettransplanted(repo, subset, x): |
741 """Transplanted changesets in set, or all transplanted changesets. | 748 """Transplanted changesets in set, or all transplanted changesets. |
758 return n and nodemod.hex(n) or '' | 765 return n and nodemod.hex(n) or '' |
759 | 766 |
760 def extsetup(ui): | 767 def extsetup(ui): |
761 statemod.addunfinished ( | 768 statemod.addunfinished ( |
762 'transplant', fname='transplant/journal', clearable=True, | 769 'transplant', fname='transplant/journal', clearable=True, |
770 continuefunc=continuecmd, | |
763 statushint=_('To continue: hg transplant --continue\n' | 771 statushint=_('To continue: hg transplant --continue\n' |
764 'To abort: hg update'), | 772 'To abort: hg update'), |
765 cmdhint=_("use 'hg transplant --continue' or 'hg update' to abort") | 773 cmdhint=_("use 'hg transplant --continue' or 'hg update' to abort") |
766 ) | 774 ) |
767 | 775 |