D360: log: add a "graphwidth" template variable

2017-08-21 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment. > it may make sense to have a more generic "textwidth" Good idea! That seems like what one usually wants. Can we not simply add that (defined as "termwidth - graphwidth")? If we had that, when would one want termwidth or graphwidth themselves? REPOSITORY rH

D360: log: add a "graphwidth" template variable

2017-08-17 Thread hooper (Danny Hooper)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG6f6c87888b22: log: add a "graphwidth" template variable (authored by hooper). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D360?vs=1009&id=1026#toc REPOSITORY rHG Mercurial CHANGES SINCE

D360: log: add a "graphwidth" template variable

2017-08-17 Thread yuja (Yuya Nishihara)
yuja accepted this revision. yuja added a comment. This revision is now accepted and ready to land. Slightly adjusted the commit message for new version, and queued, thanks. INLINE COMMENTS > hooper wrote in cmdutil.py:2557 > There can be many of them. E.g. in the hg repo it looks like a cou

D360: log: add a "graphwidth" template variable

2017-08-16 Thread hooper (Danny Hooper)
hooper updated this revision to Diff 1009. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D360?vs=941&id=1009 REVISION DETAIL https://phab.mercurial-scm.org/D360 AFFECTED FILES mercurial/cmdutil.py mercurial/graphmod.py mercurial/templatekw.py te

D360: log: add a "graphwidth" template variable

2017-08-16 Thread hooper (Danny Hooper)
hooper marked 2 inline comments as done. hooper added inline comments. INLINE COMMENTS > yuja wrote in cmdutil.py:2557 > Just a nit. Is there any practical benefit to compute edges lazy? > I think `edges` can be simply converted to a list. There can be many of them. E.g. in the hg repo it looks

D360: log: add a "graphwidth" template variable

2017-08-15 Thread yuja (Yuya Nishihara)
yuja added inline comments. INLINE COMMENTS > cmdutil.py:2557 > displayer.flush(ctx) > -edges = edgefn(type, char, lines, state, rev, parents) > -for type, char, lines, coldata in edges: > +for type, char, width, coldata in itertools.chain([firstedge], > edges):

D360: log: add a "graphwidth" template variable

2017-08-15 Thread hooper (Danny Hooper)
hooper updated this revision to Diff 941. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D360?vs=940&id=941 REVISION DETAIL https://phab.mercurial-scm.org/D360 AFFECTED FILES mercurial/cmdutil.py mercurial/graphmod.py mercurial/templatekw.py test

D360: log: add a "graphwidth" template variable

2017-08-15 Thread hooper (Danny Hooper)
hooper added inline comments. INLINE COMMENTS > yuja wrote in templatekw.py:768 > s/graphwidth/showgraphwidth/, and functions should be sorted alphabetically. Can you explain why it should be renamed? I thought it should mirror termwidth. They both return an integer for computations in template

D360: log: add a "graphwidth" template variable

2017-08-15 Thread hooper (Danny Hooper)
hooper updated this revision to Diff 940. hooper edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D360?vs=822&id=940 REVISION DETAIL https://phab.mercurial-scm.org/D360 AFFECTED FILES mercurial/cmdutil.py mercurial/

D360: log: add a "graphwidth" template variable

2017-08-14 Thread yuja (Yuya Nishihara)
yuja added a comment. > I had avoided this change because it might break extensions with their own edgefns. Do you think that's a concern? It's probably okay to change the function interface. I don't think the current `edgefn` is any useful for extensions. And I heard no problem after

D360: log: add a "graphwidth" template variable

2017-08-14 Thread hooper (Danny Hooper)
hooper added a comment. In https://phab.mercurial-scm.org/D360#5639, @yuja wrote: > > The edge > > drawing function needs to know the number of lines in the template output, so > > we need to also determine how wide that drawing would be before we call the > > edgefn or evaluate

D360: log: add a "graphwidth" template variable

2017-08-13 Thread yuja (Yuya Nishihara)
yuja added a comment. > The edge > drawing function needs to know the number of lines in the template output, so > we need to also determine how wide that drawing would be before we call the > edgefn or evaluate the template. Actually `asciiedges()` doesn't need the `lines` to be

D360: log: add a "graphwidth" template variable

2017-08-11 Thread hooper (Danny Hooper)
hooper updated this revision to Diff 822. hooper edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D360?vs=821&id=822 REVISION DETAIL https://phab.mercurial-scm.org/D360 AFFECTED FILES hgext/show.py mercurial/cmdutil

D360: log: add a "graphwidth" template variable

2017-08-11 Thread hooper (Danny Hooper)
hooper created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Wrapping text in templates for 'hg log --graph' can't be done very well, because the template doesn't know how wide the graph drawing is. The edge drawing functio