D3502: shortest: move revnum-disambiguation out of revlog
yuja (Yuya Nishihara)
phabricator at mercurial-scm.org
Fri May 11 15:31:57 EDT 2018
yuja added a comment.
> + def disambiguate(prefix):
> + """Disambiguate against revnums."""
> + hexnode = hex(node)
> + for length in range(len(prefix), 41):
Nit: `range(len(prefix), len(hexnode) + 1)` seems slightly better than
using a magic number outside the revlog module.
> + prefix = hexnode[:length]
> + if not isrev(prefix):
> + return prefix
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D3502
To: martinvonz, indygreg, #hg-reviewers
Cc: yuja, mercurial-devel
More information about the Mercurial-devel
mailing list