diff hgext/bookmarks.py @ 13359:87f248e78173

bookmarks: move revset support to core
author Matt Mackall <mpm@selenic.com>
date Thu, 10 Feb 2011 13:46:28 -0600
parents f26a51857dc7
children bab5490eb2bc
line wrap: on
line diff
--- a/hgext/bookmarks.py	Thu Feb 10 13:46:27 2011 -0600
+++ b/hgext/bookmarks.py	Thu Feb 10 13:46:28 2011 -0600
@@ -31,7 +31,7 @@
 from mercurial.i18n import _
 from mercurial.node import nullid, nullrev, bin, hex, short
 from mercurial import util, commands, repair, extensions, pushkey, hg, url
-from mercurial import revset, encoding
+from mercurial import encoding
 from mercurial import bookmarks
 import os
 
@@ -353,27 +353,6 @@
     bookmarks.setcurrent(repo, rev)
     return res
 
-def bmrevset(repo, subset, x):
-    """``bookmark([name])``
-    The named bookmark or all bookmarks.
-    """
-    # i18n: "bookmark" is a keyword
-    args = revset.getargs(x, 0, 1, _('bookmark takes one or no arguments'))
-    if args:
-        bm = revset.getstring(args[0],
-                              # i18n: "bookmark" is a keyword
-                              _('the argument to bookmark must be a string'))
-        bmrev = bookmarks.listbookmarks(repo).get(bm, None)
-        if bmrev:
-            bmrev = repo.changelog.rev(bin(bmrev))
-        return [r for r in subset if r == bmrev]
-    bms = set([repo.changelog.rev(bin(r))
-               for r in bookmarks.listbookmarks(repo).values()])
-    return [r for r in subset if r in bms]
-
-def extsetup(ui):
-    revset.symbols['bookmark'] = bmrevset
-
 cmdtable = {
     "bookmarks":
         (bookmark,
@@ -385,6 +364,3 @@
 }
 
 colortable = {'bookmarks.current': 'green'}
-
-# tell hggettext to extract docstrings from these functions:
-i18nfunctions = [bmrevset]