D5097: logcmdutil: add a helpful assertion to catch mistyped templates early

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sun Oct 14 06:14:17 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG96164fb9b913: logcmdutil: add a helpful assertion to catch mistyped templates early (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5097?vs=12113&id=12118

REVISION DETAIL
  https://phab.mercurial-scm.org/D5097

AFFECTED FILES
  mercurial/logcmdutil.py

CHANGE DETAILS

diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py
+++ b/mercurial/logcmdutil.py
@@ -460,6 +460,8 @@
                 self.footer = self.t.render(self._parts['footer'], props)
 
 def templatespec(tmpl, mapfile):
+    if pycompat.ispy3:
+        assert not isinstance(tmpl, str), 'tmpl must not be a str'
     if mapfile:
         return formatter.templatespec('changeset', tmpl, mapfile)
     else:



To: durin42, #hg-reviewers, pulkit
Cc: mjpieters, mercurial-devel


More information about the Mercurial-devel mailing list