D557: show: use consistent node lengths

quark (Jun Wu) phabricator at mercurial-scm.org
Tue Aug 29 00:06:30 EDT 2017


quark added inline comments.

INLINE COMMENTS

> show.py:428
>  
> +def longestshortest(repo, revs, minlen=5):
> +    """Return the length of the longest shortest node to identify revisions.

How about minlen=4? It could be useful in small repos.

> show.py:440
> +    """
> +    tmpl = formatter.maketemplater(repo.ui, '{shortest(node, %d)}' % minlen)
> +    lens = [minlen]

I'd call low level function without template and maintain a current minlen to reduce calculation.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D557

To: indygreg, #hg-reviewers
Cc: quark, mercurial-devel


More information about the Mercurial-devel mailing list