# HG changeset patch # User Yuya Nishihara # Date 2016-01-16 04:53:32 # Node ID 83aef8d5bc1bd05027b1f18fe9b986a264aa6951 # Parent ac8c0ee5c3b8c96c4054cbb7b83abfb110b51e6a templater: make get(dict, key) return a single value This is necessary to obtain a _hybrid object from a dict. If get() yields a value, it would be stringified. I see no benefit to make get() lazy, so this patch just changes "yield" to "return". diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -432,7 +432,7 @@ def get(context, mapping, args): raise error.ParseError(_("get() expects a dict as first argument")) key = args[1][0](context, mapping, args[1][1]) - yield dictarg.get(key) + return dictarg.get(key) def if_(context, mapping, args): """:if(expr, then[, else]): Conditionally execute based on the result of