hgext/transplant.py
changeset 14308 e7ea3e38fea8
parent 14260 00a881581400
child 14319 b33f3e35efb0
equal deleted inserted replaced
14307:d5a65e3ee6b1 14308:e7ea3e38fea8
    16 from mercurial.i18n import _
    16 from mercurial.i18n import _
    17 import os, tempfile
    17 import os, tempfile
    18 from mercurial import bundlerepo, cmdutil, hg, merge, match
    18 from mercurial import bundlerepo, cmdutil, hg, merge, match
    19 from mercurial import patch, revlog, scmutil, util, error
    19 from mercurial import patch, revlog, scmutil, util, error
    20 from mercurial import revset, templatekw
    20 from mercurial import revset, templatekw
       
    21 
       
    22 cmdtable = {}
       
    23 command = cmdutil.command(cmdtable)
    21 
    24 
    22 class transplantentry(object):
    25 class transplantentry(object):
    23     def __init__(self, lnode, rnode):
    26     def __init__(self, lnode, rnode):
    24         self.lnode = lnode
    27         self.lnode = lnode
    25         self.rnode = rnode
    28         self.rnode = rnode
   448             merges = ()
   451             merges = ()
   449             break
   452             break
   450     displayer.close()
   453     displayer.close()
   451     return (transplants, merges)
   454     return (transplants, merges)
   452 
   455 
       
   456 @command('transplant',
       
   457     [('s', 'source', '', _('pull patches from REPO'), _('REPO')),
       
   458     ('b', 'branch', [],
       
   459      _('pull patches from branch BRANCH'), _('BRANCH')),
       
   460     ('a', 'all', None, _('pull all changesets up to BRANCH')),
       
   461     ('p', 'prune', [], _('skip over REV'), _('REV')),
       
   462     ('m', 'merge', [], _('merge at REV'), _('REV')),
       
   463     ('', 'log', None, _('append transplant info to log message')),
       
   464     ('c', 'continue', None, _('continue last transplant session '
       
   465                               'after repair')),
       
   466     ('', 'filter', '',
       
   467      _('filter changesets through command'), _('CMD'))],
       
   468     _('hg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] '
       
   469       '[-m REV] [REV]...'))
   453 def transplant(ui, repo, *revs, **opts):
   470 def transplant(ui, repo, *revs, **opts):
   454     '''transplant changesets from another branch
   471     '''transplant changesets from another branch
   455 
   472 
   456     Selected changesets will be applied on top of the current working
   473     Selected changesets will be applied on top of the current working
   457     directory with the log of the original changeset. The changesets
   474     directory with the log of the original changeset. The changesets
   609 
   626 
   610 def extsetup(ui):
   627 def extsetup(ui):
   611     revset.symbols['transplanted'] = revsettransplanted
   628     revset.symbols['transplanted'] = revsettransplanted
   612     templatekw.keywords['transplanted'] = kwtransplanted
   629     templatekw.keywords['transplanted'] = kwtransplanted
   613 
   630 
   614 cmdtable = {
       
   615     "transplant":
       
   616         (transplant,
       
   617          [('s', 'source', '',
       
   618            _('pull patches from REPO'), _('REPO')),
       
   619           ('b', 'branch', [],
       
   620            _('pull patches from branch BRANCH'), _('BRANCH')),
       
   621           ('a', 'all', None, _('pull all changesets up to BRANCH')),
       
   622           ('p', 'prune', [],
       
   623            _('skip over REV'), _('REV')),
       
   624           ('m', 'merge', [],
       
   625            _('merge at REV'), _('REV')),
       
   626           ('', 'log', None, _('append transplant info to log message')),
       
   627           ('c', 'continue', None, _('continue last transplant session '
       
   628                                     'after repair')),
       
   629           ('', 'filter', '',
       
   630            _('filter changesets through command'), _('CMD'))],
       
   631          _('hg transplant [-s REPO] [-b BRANCH [-a]] [-p REV] '
       
   632            '[-m REV] [REV]...'))
       
   633 }
       
   634 
       
   635 # tell hggettext to extract docstrings from these functions:
   631 # tell hggettext to extract docstrings from these functions:
   636 i18nfunctions = [revsettransplanted, kwtransplanted]
   632 i18nfunctions = [revsettransplanted, kwtransplanted]