templatespec: use new factory functions in hooklib
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 30 Jul 2020 12:22:41 -0700
changeset 45268 3c2fae87bd5a
parent 45267 c1915cfa8080
child 45269 8bc9d045005a
templatespec: use new factory functions in hooklib Differential Revision: https://phab.mercurial-scm.org/D8853
hgext/hooklib/changeset_obsoleted.py
hgext/hooklib/changeset_published.py
--- 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')