D3852: namespaces: let namespaces override singlenode() definition
yuja (Yuya Nishihara)
phabricator at mercurial-scm.org
Thu Jun 28 08:59:53 EDT 2018
yuja added a comment.
Makes sense. One nit.
> + if not singlenode:
> + def singlenode(repo, name):
> + n = self.namemap(repo, name)
> + if n:
> + # return max revision number
> + if len(n) > 1:
> + cl = repo.changelog
> + maxrev = max(cl.rev(node) for node in n)
> + return cl.node(maxrev)
> + return n[0]
> + return None
> + self.singlenode = singlenode
The default implementation has to be defined as an unbound method to avoid
reference cycle: self.singlenode -> singlenode -> self.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D3852
To: martinvonz, #hg-reviewers
Cc: yuja, mercurial-devel
More information about the Mercurial-devel
mailing list