D724: templater: extract shortest() logic from template function

2017-09-17 Thread yuja (Yuya Nishihara)
yuja added a comment. > \What I originally thought was `shortest` may have alternative implementation if the changelog is not backed by revlog (in the far far future). Okay, got it. Even if it's backed by revlog, shortest can be implemented as a one-pass lookup of prefix tree.

D724: templater: extract shortest() logic from template function

2017-09-16 Thread quark (Jun Wu)
quark added a comment. Oops. What I originally thought was `shortest` may have alternative implementation if the changelog is not backed by revlog (in the far far future). So it feels the current implementation (using revlog's partialmatch) belongs to revlog itself. REPOSITORY rHG

D724: templater: extract shortest() logic from template function

2017-09-16 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG9a137d15d146: templater: extract shortest() logic from template function (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D724: templater: extract shortest() logic from template function

2017-09-16 Thread yuja (Yuya Nishihara)
yuja accepted this revision. yuja added a comment. This revision is now accepted and ready to land. Queued, thanks. I slightly prefer moving shortest() to scmutil as it seems not a core function of revlog, but that's just my preference. REPOSITORY rHG Mercurial REVISION DETAIL

D724: templater: extract shortest() logic from template function

2017-09-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz added a comment. In https://phab.mercurial-scm.org/D724#12091, @quark wrote: > It might make sense to be a revlog method if we don't really care about the "cleanness" of revlog class. I slightly prefer that. Heh, that's what I decided to do. I apparently forgot to send

D724: templater: extract shortest() logic from template function

2017-09-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz updated this revision to Diff 1860. martinvonz edited the summary of this revision. Herald added a reviewer: indygreg. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D724?vs=1859=1860 REVISION DETAIL https://phab.mercurial-scm.org/D724

D724: templater: extract shortest() logic from template function

2017-09-15 Thread quark (Jun Wu)
quark accepted this revision. quark added a comment. It might make sense to be a revlog method if we don't really care about the "cleanness" of revlog class. I slightly prefer that. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D724 To: martinvonz,

D724: templater: extract shortest() logic from template function

2017-09-15 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It can be useful for extensions to be able to produce the shortest unambiguous hash. That logic is currently inside the shortest() template function. Let's