D4320: dagutil: remove heads() and localsubset from revlogdag.__init__

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Fri Aug 17 21:31:01 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 of this API.
  
  I'm not going to mark as API incompatible because I doubt anybody
  used this functionality (outside of possibly passing an argument
  to revlogdag.__init__). I intend to remove revlogdag later in
  this series and its API annotation will cover this one.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/dagutil.py
  mercurial/setdiscovery.py

CHANGE DETAILS

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -152,7 +152,7 @@
     else:
         ownheads = [rev for rev in cl.headrevs() if rev != nullrev]
 
-    dag = dagutil.revlogdag(cl, localsubset=ownheads)
+    dag = dagutil.revlogdag(cl)
 
     # early exit if we know all the specified remote heads already
     ui.debug("query 1; heads\n")
diff --git a/mercurial/dagutil.py b/mercurial/dagutil.py
--- a/mercurial/dagutil.py
+++ b/mercurial/dagutil.py
@@ -24,10 +24,6 @@
     def __init__(self):
         self._inverse = None
 
-    def heads(self):
-        '''list of head ixs'''
-        raise NotImplementedError
-
     def parents(self, ix):
         '''list of parents ixs of ix'''
         raise NotImplementedError
@@ -65,22 +61,12 @@
     def __init__(self, revlog):
         basedag.__init__(self)
         self._revlog = revlog
-        self._heads = None
-
-    def heads(self):
-        if self._heads is None:
-            self._heads = self._getheads()
-        return self._heads
 
 class revlogdag(revlogbaseddag):
     '''dag interface to a revlog'''
 
-    def __init__(self, revlog, localsubset=None):
+    def __init__(self, revlog):
         revlogbaseddag.__init__(self, revlog)
-        self._heads = localsubset
-
-    def _getheads(self):
-        return [r for r in self._revlog.headrevs() if r != nullrev]
 
     def parents(self, ix):
         rlog = self._revlog
@@ -173,10 +159,6 @@
             rev -= 1
         self._walkfrom = rev
 
-    def _getheads(self):
-        self._walkto(nullrev)
-        return self._roots
-
     def parents(self, ix):
         if ix is None:
             return []



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


More information about the Mercurial-devel mailing list