D4307: dagutil: remove internalize() and internalizeall()

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Sat Aug 18 04:06:34 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9539553f6d17: dagutil: remove internalize() and internalizeall() (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4307?vs=10401&id=10431

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