[Updated] D8847: templatespec: move check for non-unicode to lower-level function

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sun Aug 2 16:34:36 UTC 2020


Closed by commit rHG215f08c8006c: templatespec: move check for non-unicode to lower-level function (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8847?vs=22151&id=22188

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8847/new/

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

AFFECTED FILES
  mercurial/formatter.py
  mercurial/logcmdutil.py

CHANGE DETAILS

diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py
+++ b/mercurial/logcmdutil.py
@@ -607,8 +607,6 @@
     if mapfile:
         return formatter.mapfile_templatespec(b'changeset', mapfile)
     else:
-        if pycompat.ispy3:
-            assert not isinstance(tmpl, str), b'tmpl must not be a str'
         return formatter.literal_templatespec(tmpl)
 
 
diff --git a/mercurial/formatter.py b/mercurial/formatter.py
--- a/mercurial/formatter.py
+++ b/mercurial/formatter.py
@@ -551,6 +551,8 @@
 
 
 def literal_templatespec(tmpl):
+    if pycompat.ispy3:
+        assert not isinstance(tmpl, str), b'tmpl must not be a str'
     return templatespec(b'', tmpl, None)
 
 



To: martinvonz, #hg-reviewers, indygreg
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200802/edac98b6/attachment-0002.html>


More information about the Mercurial-patches mailing list