##// END OF EJS Templates
Fix and unify transplant and bookmarks revsets doc registration
Patrick Mezard -
r12822:f13acb96 stable
parent child Browse files
Show More
@@ -538,6 +538,9 b' def updatecurbookmark(orig, ui, repo, *a'
538 538 return res
539 539
540 540 def bmrevset(repo, subset, x):
541 """``bookmark([name])``
542 The named bookmark or all bookmarks.
543 """
541 544 args = revset.getargs(x, 0, 1, _('bookmark takes one or no arguments'))
542 545 if args:
543 546 bm = revset.getstring(args[0],
@@ -548,14 +551,9 b' def bmrevset(repo, subset, x):'
548 551 return [r for r in subset if r == bmrev]
549 552 bms = set([repo.changelog.rev(bin(r)) for r in listbookmarks(repo).values()])
550 553 return [r for r in subset if r in bms]
551 revset.symbols['bookmark'] = bmrevset
552 554
553 def revsetdoc():
554 doc = help.loaddoc('revsets')()
555 doc += _('\nAdded by the bookmarks extension:\n\n'
556 '``bookmark([name])``\n'
557 ' The named bookmark or all bookmarks.\n')
558 return doc
555 def extsetup(ui):
556 revset.symbols['bookmark'] = bmrevset
559 557
560 558 cmdtable = {
561 559 "bookmarks":
@@ -17,7 +17,7 b' from mercurial.i18n import _'
17 17 import os, tempfile
18 18 from mercurial import bundlerepo, cmdutil, hg, merge, match
19 19 from mercurial import patch, revlog, util, error
20 from mercurial import revset, help
20 from mercurial import revset
21 21
22 22 class transplantentry(object):
23 23 def __init__(self, lnode, rnode):
@@ -589,6 +589,9 b' def transplant(ui, repo, *revs, **opts):'
589 589 os.unlink(bundle)
590 590
591 591 def revsettransplanted(repo, subset, x):
592 """``transplanted(set)``
593 Transplanted changesets in set.
594 """
592 595 if x:
593 596 s = revset.getset(repo, subset, x)
594 597 else:
@@ -599,17 +602,7 b' def revsettransplanted(repo, subset, x):'
599 602 cs.add(r)
600 603 return [r for r in s if r in cs]
601 604
602 def revsetdoc():
603 doc = help.loaddoc('revsets')()
604 doc += _('\nAdded by the transplant extension:\n\n'
605 '``transplanted(set)``\n'
606 ' Transplanted changesets in set.\n')
607 return doc
608
609 def uisetup(ui):
610 'Add the transplanted revset predicate'
611 for i in (i for i, x in enumerate(help.helptable) if x[0] == ['revsets']):
612 help.helptable[i] = (['revsets'], _("Specifying Revision Sets"), revsetdoc)
605 def extsetup(ui):
613 606 revset.symbols['transplanted'] = revsettransplanted
614 607
615 608 cmdtable = {
@@ -83,6 +83,8 b' bookmarks revset'
83 83 date: Thu Jan 01 00:00:00 1970 +0000
84 84 summary: 1
85 85
86 $ hg help revsets | grep 'bookmark('
87 "bookmark([name])"
86 88
87 89 bookmarks X and X2 moved to rev 1, Y at rev -1
88 90
General Comments 0
You need to be logged in to leave comments. Login now