Patchwork [5,of,8] templater: replace 'ctx._repo' with 'ctx.repo()'

login
register
mail settings
Submitter Matt Harbison
Date March 14, 2015, 1:28 a.m.
Message ID <6a973813de33a45db7ac.1426296516@Envy>
Download mbox | patch
Permalink /patch/8085/
State Accepted
Commit 696ab1a24ae0ba4b9012028b9e184c24e3fbf9dc
Headers show

Comments

Matt Harbison - March 14, 2015, 1:28 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1426216275 14400
#      Thu Mar 12 23:11:15 2015 -0400
# Node ID 6a973813de33a45db7ac7b762c2d53b7a71ad218
# Parent  46a0ddb787c9f07e06aec1947ced3d9243e3887d
templater: replace 'ctx._repo' with 'ctx.repo()'

Patch

diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -397,7 +397,7 @@ 
 def shownames(namespace, **args):
     """helper method to generate a template keyword for a namespace"""
     ctx = args['ctx']
-    repo = ctx._repo
+    repo = ctx.repo()
     ns = repo.names[namespace]
     names = ns.names(repo, ctx.node())
     return showlist(ns.templatename, names, plural=namespace, **args)
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -391,7 +391,7 @@ 
 
     raw = args[0][1]
     ctx = mapping['ctx']
-    repo = ctx._repo
+    repo = ctx.repo()
 
     def query(expr):
         m = revsetmod.match(repo.ui, expr)