mercurial/namespaces.py
changeset 28567 ca52512ac709
parent 25961 c0c89b2d07be
child 32291 bd872f64a8ba
equal deleted inserted replaced
28566:34f798bec3dc 28567:ca52512ac709
    28 
    28 
    29         # we need current mercurial named objects (bookmarks, tags, and
    29         # we need current mercurial named objects (bookmarks, tags, and
    30         # branches) to be initialized somewhere, so that place is here
    30         # branches) to be initialized somewhere, so that place is here
    31         bmknames = lambda repo: repo._bookmarks.keys()
    31         bmknames = lambda repo: repo._bookmarks.keys()
    32         bmknamemap = lambda repo, name: tolist(repo._bookmarks.get(name))
    32         bmknamemap = lambda repo, name: tolist(repo._bookmarks.get(name))
    33         bmknodemap = lambda repo, name: repo.nodebookmarks(name)
    33         bmknodemap = lambda repo, node: repo.nodebookmarks(node)
    34         n = namespace("bookmarks", templatename="bookmark",
    34         n = namespace("bookmarks", templatename="bookmark",
    35                       # i18n: column positioning for "hg log"
    35                       # i18n: column positioning for "hg log"
    36                       logfmt=_("bookmark:    %s\n"),
    36                       logfmt=_("bookmark:    %s\n"),
    37                       listnames=bmknames,
    37                       listnames=bmknames,
    38                       namemap=bmknamemap, nodemap=bmknodemap)
    38                       namemap=bmknamemap, nodemap=bmknodemap)
    39         self.addnamespace(n)
    39         self.addnamespace(n)
    40 
    40 
    41         tagnames = lambda repo: [t for t, n in repo.tagslist()]
    41         tagnames = lambda repo: [t for t, n in repo.tagslist()]
    42         tagnamemap = lambda repo, name: tolist(repo._tagscache.tags.get(name))
    42         tagnamemap = lambda repo, name: tolist(repo._tagscache.tags.get(name))
    43         tagnodemap = lambda repo, name: repo.nodetags(name)
    43         tagnodemap = lambda repo, node: repo.nodetags(node)
    44         n = namespace("tags", templatename="tag",
    44         n = namespace("tags", templatename="tag",
    45                       # i18n: column positioning for "hg log"
    45                       # i18n: column positioning for "hg log"
    46                       logfmt=_("tag:         %s\n"),
    46                       logfmt=_("tag:         %s\n"),
    47                       listnames=tagnames,
    47                       listnames=tagnames,
    48                       namemap=tagnamemap, nodemap=tagnodemap,
    48                       namemap=tagnamemap, nodemap=tagnodemap,
   147         colorname: the name to use for colored log output; if not specified
   147         colorname: the name to use for colored log output; if not specified
   148                    logname is used
   148                    logname is used
   149         logfmt: the format to use for (i18n-ed) log output; if not specified
   149         logfmt: the format to use for (i18n-ed) log output; if not specified
   150                 it is composed from logname
   150                 it is composed from logname
   151         listnames: function to list all names
   151         listnames: function to list all names
   152         namemap: function that inputs a node, output name(s)
   152         namemap: function that inputs a name, output node(s)
   153         nodemap: function that inputs a name, output node(s)
   153         nodemap: function that inputs a node, output name(s)
   154         deprecated: set of names to be masked for ordinary use
   154         deprecated: set of names to be masked for ordinary use
   155 
   155 
   156         """
   156         """
   157         self.name = name
   157         self.name = name
   158         self.templatename = templatename
   158         self.templatename = templatename