Patchwork [2,of,4] templatekw: update namespace calls

login
register
mail settings
Submitter Sean Farley
Date Jan. 2, 2015, 11:42 p.m.
Message ID <13a462c900a74cae0973.1420242123@laptop.local>
Download mbox | patch
Permalink /patch/7304/
State Accepted
Commit b56400eeefaf4f7afb857dc5a1ca17d1e0838378
Headers show

Comments

Sean Farley - Jan. 2, 2015, 11:42 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1419199312 28800
#      Sun Dec 21 14:01:52 2014 -0800
# Node ID 13a462c900a74cae0973571857f455c7dd54d0c0
# Parent  165fc028b31c989af76a944c5ecfbbbb19579629
templatekw: update namespace calls

Previous patches changed the namespace api to be more of an object-oriented
approach. This patch updates the template function to use said api changes.

Patch

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -376,13 +376,13 @@  def showsubrepos(**args):
 
 def shownames(namespace, **args):
     """helper method to generate a template keyword for a namespace"""
     ctx = args['ctx']
     repo = ctx._repo
-    names = repo.names.names(repo, namespace, ctx.node())
-    return showlist(repo.names.templatename(namespace), names,
-                    plural=namespace, **args)
+    ns = repo.names[namespace]
+    names = ns.names(repo, ctx.node())
+    return showlist(ns.templatename, names, plural=namespace, **args)
 
 # keywords are callables like:
 # fn(repo, ctx, templ, cache, revcache, **args)
 # with:
 # repo - current repository instance