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