diff mercurial/logcmdutil.py @ 45310:f3481e4fcc3a

templater: pass opened file-like object to templatespec I think I said earlier that I planned to create a special templatespec variant for built-in templates. That was true (I planned that), but I ended up (in this patch) just adding a file-like object to the `mapfile_templatespec()` variant instead. Differential Revision: https://phab.mercurial-scm.org/D8893
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 04 Aug 2020 13:22:00 -0700
parents 65a812ed9e9f
children 4aa484efc926
line wrap: on
line diff
--- a/mercurial/logcmdutil.py	Tue Aug 04 13:21:29 2020 -0700
+++ b/mercurial/logcmdutil.py	Tue Aug 04 13:22:00 2020 -0700
@@ -626,13 +626,14 @@
 
     if not tmpl and style:
         mapfile = style
+        fp = None
         if not os.path.split(mapfile)[0]:
             (mapname, fp) = templater.open_template(
                 b'map-cmdline.' + mapfile
             ) or templater.open_template(mapfile)
             if mapname:
                 mapfile = mapname
-        return formatter.mapfile_templatespec(b'changeset', mapfile)
+        return formatter.mapfile_templatespec(b'changeset', mapfile, fp)
 
     return formatter.lookuptemplate(ui, b'changeset', tmpl)