<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px">What is this about? adding a new template directory for evolve?</span><br></blockquote><div><br></div><div>Exactly, i didnt find other way for the extension to add template paths</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px">As an unrelated notes, we should probaly improve core to make this more straight forward.</span></blockquote><div><br></div><div>Easy way to make adding templates for extension easier would be to add new  extensiontemplatespaths list in mercurial/templater.py file and add those additional paths in templatepaths function: <a href="https://selenic.com/hg/file/3.9.1/mercurial/templater.py#l1106">https://selenic.com/hg/file/3.9.1/mercurial/templater.py#l1106</a> - in this case extensions would add templates paths to this list.</div><div><br></div><div>What do you think?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px">Having the data in the formatter data would be useful to (so that is show up in -T json in all case.</span></blockquote><div><br></div><div>I dont understand it, what do you mean by formatter data and how it would show up in -T json in all case </div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-07 12:15 GMT+02:00 Pierre-Yves David <span dir="ltr"><<a href="mailto:pierre-yves.david@ens-lyon.org" target="_blank">pierre-yves.david@ens-lyon.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On 09/06/2016 10:32 AM, liscju 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 liscju <<a href="mailto:piotr.listkiewicz@gmail.com" target="_blank">piotr.listkiewicz@gmail.com</a>><br>
# Date 1473150616 -7200<br>
#      Tue Sep 06 10:30:16 2016 +0200<br>
# Branch stable<br>
# Node ID 5273ba1d2b0027ce48238adfcf272a<wbr>dbfde9ddfe<br>
# Parent  7a2e0629bdee8cd842bb884094cef9<wbr>683ed49520<br>
evolve: add template to show evolution troubles (issue4686)<br>
</blockquote>
<br></span>
You should use the 'evolve-ext' flag when submitting patch for evolve.<br>
<br>
(also having more than one line of description is usually a good idea)<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
diff --git a/hgext/evolve.py b/hgext/evolve.py<br>
--- a/hgext/evolve.py<br>
+++ b/hgext/evolve.py<br>
@@ -4048,6 +4048,14 @@ def clean(orig, repo, *args, **kwargs):<br>
     util.unlinkpath(repo.join('ev<wbr>olvestate'), ignoremissing=True)<br>
     return ret<br>
<br>
+@eh.wrapfunction(mercurial.te<wbr>mplater, 'templatepaths')<br>
+def wraptemplatepaths(origfn):<br>
+    origtemplatepaths = origfn()<br>
+    datapath = os.path.dirname(__file__)<br>
+    origtemplatepaths.append(<br>
+        os.path.normpath(os.path.join(<wbr>datapath, 'templates')))<br>
+    return origtemplatepaths<br>
</blockquote>
<br></span>
What is this about? adding a new template directory for evolve?<br>
<br>
As an unrelated notes, we should probaly improve core to make this more straight forward.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 def _evolvestatewrite(repo, state):<br>
     # [version]<br>
     # [type][length][content]<br>
diff --git a/hgext/templates/map-cmdline.<wbr>evolution b/hgext/templates/map-cmdline.<wbr>evolution<br>
new file mode 100644<br>
--- /dev/null<br>
+++ b/hgext/templates/map-cmdline.<wbr>evolution<br>
@@ -0,0 +1,6 @@<br>
+%include map-cmdline.default<br>
+changeset = '{cset}{levolution}{branches}{<wbr>bookmarks}{tags}{parents}{user<wbr>}{ldate}{summary}\n'<br>
+changeset_verbose = '{cset}{levolution}{branches}{<wbr>bookmarks}{tags}{parents}{user<wbr>}{ldate}{lfiles}{lfile_copies_<wbr>switch}{description}\n'<br>
+<br>
+levolution = '{label("log.evolution",<br>
+                     "evolution:   {join(troubles, ', ')}")}\n'<br>
</blockquote>
<br></span>
We should probably call this "troubles" and as someone else mention, skip it when empty.<br>
<br>
Having the data in the formatter data would be useful to (so that is show up in -T json in all case.<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
\ No newline at end of file<br>
diff --git a/tests/test-evolve-list.t b/tests/test-evolve-list.t<br>
--- a/tests/test-evolve-list.t<br>
+++ b/tests/test-evolve-list.t<br>
@@ -77,4 +77,42 @@ Test the divergence listing<br>
   c882616e9d84: b<br>
     divergent: a922b3733e98 (public) (precursor d2ae7f538514)<br>
<br>
+Show evolution troubles in log with evolution template<br>
+<br>
+  $ hg log -T evolution<br>
+  changeset:   5:a922b3733e98<br>
+  evolution:<br>
+  tag:         tip<br>
+  parent:      3:980f7dc84c29<br>
+  user:        test<br>
+  date:        Thu Jan 01 00:00:00 1970 +0000<br>
+  summary:     b<br>
+<br>
+  changeset:   4:c882616e9d84<br>
+  evolution:   divergent<br>
+  parent:      2:d36c0562f908<br>
+  user:        test<br>
+  date:        Thu Jan 01 00:00:00 1970 +0000<br>
+  summary:     b<br>
+<br>
+  changeset:   3:980f7dc84c29<br>
+  evolution:<br>
+  parent:      0:cb9a9f314b8b<br>
+  user:        test<br>
+  date:        Thu Jan 01 00:00:00 1970 +0000<br>
+  summary:     d<br>
+<br>
+  changeset:   2:d36c0562f908<br>
+  evolution:<br>
+  parent:      0:cb9a9f314b8b<br>
+  user:        test<br>
+  date:        Thu Jan 01 00:00:00 1970 +0000<br>
+  summary:     c<br>
+<br>
+  changeset:   0:cb9a9f314b8b<br>
+  evolution:<br>
+  user:        test<br>
+  date:        Thu Jan 01 00:00:00 1970 +0000<br>
+  summary:     a<br>
</blockquote>
<br>
<br></div></div><span class="HOEnZb"><font color="#888888">
-- <br>
Pierre-Yves David<br>
</font></span></blockquote></div><br></div>