changeset 45292:3c2fae87bd5a

templatespec: use new factory functions in hooklib Differential Revision: https://phab.mercurial-scm.org/D8853
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 30 Jul 2020 12:22:41 -0700
parents c1915cfa8080
children 8bc9d045005a
files hgext/hooklib/changeset_obsoleted.py hgext/hooklib/changeset_published.py
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/hooklib/changeset_obsoleted.py	Mon Jul 20 22:43:33 2020 -0700
+++ b/hgext/hooklib/changeset_obsoleted.py	Thu Jul 30 12:22:41 2020 -0700
@@ -26,6 +26,7 @@
 from mercurial import (
     encoding,
     error,
+    formatter,
     logcmdutil,
     mail,
     obsutil,
@@ -62,7 +63,7 @@
         b'notify_obsoleted', b'messageidseed'
     ) or ui.config(b'notify', b'messageidseed')
     template = ui.config(b'notify_obsoleted', b'template')
-    spec = logcmdutil.templatespec(template, None)
+    spec = formatter.literal_templatespec(template)
     templater = logcmdutil.changesettemplater(ui, repo, spec)
     ui.pushbuffer()
     n = notify.notifier(ui, repo, b'incoming')
--- a/hgext/hooklib/changeset_published.py	Mon Jul 20 22:43:33 2020 -0700
+++ b/hgext/hooklib/changeset_published.py	Thu Jul 30 12:22:41 2020 -0700
@@ -26,6 +26,7 @@
 from mercurial import (
     encoding,
     error,
+    formatter,
     logcmdutil,
     mail,
     pycompat,
@@ -61,7 +62,7 @@
         b'notify_published', b'messageidseed'
     ) or ui.config(b'notify', b'messageidseed')
     template = ui.config(b'notify_published', b'template')
-    spec = logcmdutil.templatespec(template, None)
+    spec = formatter.literal_templatespec(template)
     templater = logcmdutil.changesettemplater(ui, repo, spec)
     ui.pushbuffer()
     n = notify.notifier(ui, repo, b'incoming')