D4307: dagutil: remove internalize() and internalizeall()
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Thu Aug 16 20:44:06 UTC 2018
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
The previous commit removed the last consumer.
.. api:: removed internalize() and internalizeall() from dagutil
Use .rev(node) on storage objects to convert nodes to revisions.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D4307
AFFECTED FILES
mercurial/dagutil.py
CHANGE DETAILS
diff --git a/mercurial/dagutil.py b/mercurial/dagutil.py
--- a/mercurial/dagutil.py
+++ b/mercurial/dagutil.py
@@ -8,7 +8,6 @@
from __future__ import absolute_import
-from .i18n import _
from .node import nullrev
class basedag(object):
@@ -62,18 +61,6 @@
'''
raise NotImplementedError
- def internalize(self, id):
- '''return a node ix'''
- return self._internalize(id)
-
- def internalizeall(self, ids, filterunknown=False):
- '''return a list of (or set if given a set) of node ixs'''
- ixs = self._internalizeall(ids, filterunknown)
- if isinstance(ids, set):
- return set(ixs)
- return list(ixs)
-
-
class genericdag(basedag):
'''generic implementations for DAGs'''
@@ -119,21 +106,6 @@
self._heads = self._getheads()
return self._heads
- def _internalize(self, id):
- ix = self._revlog.rev(id)
- if ix == nullrev:
- raise LookupError(id, self._revlog.indexfile, _('nullid'))
- return ix
- def _internalizeall(self, ids, filterunknown):
- rl = self._revlog
- if filterunknown:
- return [r for r in map(rl.nodemap.get, ids)
- if (r is not None
- and r != nullrev
- and r not in rl.filteredrevs)]
- return [self._internalize(i) for i in ids]
-
-
class revlogdag(revlogbaseddag):
'''dag interface to a revlog'''
To: indygreg, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list