Show More
@@ -17,6 +17,7 b' from mercurial.i18n import _' | |||
|
17 | 17 | import os, tempfile |
|
18 | 18 | from mercurial import bundlerepo, changegroup, cmdutil, hg, merge, match |
|
19 | 19 | from mercurial import patch, revlog, util, error, discovery |
|
20 | from mercurial import revset, help | |
|
20 | 21 | |
|
21 | 22 | class transplantentry(object): |
|
22 | 23 | def __init__(self, lnode, rnode): |
@@ -603,6 +604,30 b' def transplant(ui, repo, *revs, **opts):' | |||
|
603 | 604 | source.close() |
|
604 | 605 | os.unlink(bundle) |
|
605 | 606 | |
|
607 | def revsettransplanted(repo, subset, x): | |
|
608 | if x: | |
|
609 | s = revset.getset(repo, subset, x) | |
|
610 | else: | |
|
611 | s = subset | |
|
612 | cs = set() | |
|
613 | for r in xrange(0, len(repo)): | |
|
614 | if repo[r].extra().get('transplant_source'): | |
|
615 | cs.add(r) | |
|
616 | return [r for r in s if r in cs] | |
|
617 | ||
|
618 | def revsetdoc(): | |
|
619 | doc = help.loaddoc('revsets')() | |
|
620 | doc += _('\nAdded by the transplant extension:\n\n' | |
|
621 | '``transplanted(set)``\n' | |
|
622 | ' Transplanted changesets in set.\n') | |
|
623 | return doc | |
|
624 | ||
|
625 | def uisetup(ui): | |
|
626 | 'Add the transplanted revset predicate' | |
|
627 | for i in (i for i, x in enumerate(help.helptable) if x[0] == ['revsets']): | |
|
628 | help.helptable[i] = (['revsets'], _("Specifying Revision Sets"), revsetdoc) | |
|
629 | revset.symbols['transplanted'] = revsettransplanted | |
|
630 | ||
|
606 | 631 | cmdtable = { |
|
607 | 632 | "transplant": |
|
608 | 633 | (transplant, |
General Comments 0
You need to be logged in to leave comments.
Login now