<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, May 5, 2018 at 7:54 PM, Yuya Nishihara <span dir="ltr"><<a href="mailto:yuya@tcha.org" target="_blank">yuya@tcha.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Yuya Nishihara <<a href="mailto:yuya@tcha.org">yuya@tcha.org</a>><br>
# Date 1525327696 -32400<br>
#      Thu May 03 15:08:16 2018 +0900<br>
# Node ID bebe0c7559fa5015d636a73be9fba9<wbr>88911ff760<br>
# Parent  9ae8a72dec358d33c96725e1f94c63<wbr>1e869deb80<br>
formatter: ditch namedtuple in favor of attr<br></blockquote><div><br></div><div>Queued. Many thanks for getting rid of namedtuple usage!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
diff --git a/mercurial/formatter.py b/mercurial/formatter.py<br>
--- a/mercurial/formatter.py<br>
+++ b/mercurial/formatter.py<br>
@@ -107,7 +107,6 @@ baz: foo, bar<br>
<br>
 from __future__ import absolute_import, print_function<br>
<br>
-import collections<br>
 import contextlib<br>
 import itertools<br>
 import os<br>
@@ -117,6 +116,9 @@ from .node import (<br>
     hex,<br>
     short,<br>
 )<br>
+from .thirdparty import (<br>
+    attr,<br>
+)<br>
<br>
 from . import (<br>
     error,<br>
@@ -413,8 +415,11 @@ class templateformatter(<wbr>baseformatter):<br>
         baseformatter.end(self)<br>
         self._renderitem('docfooter', {})<br>
<br>
-templatespec = collections.namedtuple(r'<wbr>templatespec',<br>
-                                      r'ref tmpl mapfile')<br>
+@attr.s(frozen=True)<br>
+class templatespec(object):<br>
+    ref = attr.ib()<br>
+    tmpl = attr.ib()<br>
+    mapfile = attr.ib()<br>
<br>
 def lookuptemplate(ui, topic, tmpl):<br>
     """Find the template matching the given -T/--template spec 'tmpl'<br>
______________________________<wbr>_________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org">Mercurial-devel@mercurial-scm.<wbr>org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/<wbr>mailman/listinfo/mercurial-<wbr>devel</a><br>
</blockquote></div><br></div></div>