mercurial/templatekw.py
changeset 27894 a94f7eef3199
parent 27893 b42b2e86ef02
child 28177 ab8107c923b4
equal deleted inserted replaced
27893:b42b2e86ef02 27894:a94f7eef3199
   419     repo = ctx.repo()
   419     repo = ctx.repo()
   420     ns = repo.names[namespace]
   420     ns = repo.names[namespace]
   421     names = ns.names(repo, ctx.node())
   421     names = ns.names(repo, ctx.node())
   422     return showlist(ns.templatename, names, plural=namespace, **args)
   422     return showlist(ns.templatename, names, plural=namespace, **args)
   423 
   423 
       
   424 def shownamespaces(**args):
       
   425     """:namespaces: Dict of lists. Names attached to this changeset per
       
   426     namespace."""
       
   427     ctx = args['ctx']
       
   428     repo = ctx.repo()
       
   429     namespaces = util.sortdict((k, showlist('name', ns.names(repo, ctx.node()),
       
   430                                             **args))
       
   431                                for k, ns in repo.names.iteritems())
       
   432     f = _showlist('namespace', list(namespaces), **args)
       
   433     return _hybrid(f, namespaces,
       
   434                    lambda k: {'namespace': k, 'names': namespaces[k]},
       
   435                    lambda x: x['namespace'])
       
   436 
   424 def shownode(repo, ctx, templ, **args):
   437 def shownode(repo, ctx, templ, **args):
   425     """:node: String. The changeset identification hash, as a 40 hexadecimal
   438     """:node: String. The changeset identification hash, as a 40 hexadecimal
   426     digit string.
   439     digit string.
   427     """
   440     """
   428     return ctx.hex()
   441     return ctx.hex()
   535     'files': showfiles,
   548     'files': showfiles,
   536     'graphnode': showgraphnode,
   549     'graphnode': showgraphnode,
   537     'latesttag': showlatesttag,
   550     'latesttag': showlatesttag,
   538     'latesttagdistance': showlatesttagdistance,
   551     'latesttagdistance': showlatesttagdistance,
   539     'manifest': showmanifest,
   552     'manifest': showmanifest,
       
   553     'namespaces': shownamespaces,
   540     'node': shownode,
   554     'node': shownode,
   541     'p1rev': showp1rev,
   555     'p1rev': showp1rev,
   542     'p1node': showp1node,
   556     'p1node': showp1node,
   543     'p2rev': showp2rev,
   557     'p2rev': showp2rev,
   544     'p2node': showp2node,
   558     'p2node': showp2node,