Skip to content
Snippets Groups Projects
Commit 4cf3f54c authored by Gregory Szorc's avatar Gregory Szorc
Browse files

dagutil: remove unused classes

We only directly use revlogdag in changegroup code. We don't need
all this abstraction. So remove various classes and levels
of inheritance.

Differential Revision: https://phab.mercurial-scm.org/D4325
parent fec01c69
No related branches found
No related tags found
No related merge requests found
......@@ -10,52 +10,7 @@
from .node import nullrev
class basedag(object):
'''generic interface for DAGs
terms:
"ix" (short for index) identifies a nodes internally,
"id" identifies one externally.
All params are ixs unless explicitly suffixed otherwise.
Pluralized params are lists or sets.
'''
def parents(self, ix):
'''list of parents ixs of ix'''
raise NotImplementedError
def headsetofconnecteds(self, ixs):
'''
subset of connected list of ixs so that no node has a descendant in it
By "connected list" we mean that if an ancestor and a descendant are in
the list, then so is at least one path connecting them.
'''
raise NotImplementedError
class genericdag(basedag):
'''generic implementations for DAGs'''
def headsetofconnecteds(self, ixs):
hds = set(ixs)
if not hds:
return hds
for n in ixs:
for p in self.parents(n):
hds.discard(p)
assert hds
return hds
class revlogbaseddag(basedag):
'''generic dag interface to a revlog'''
def __init__(self, revlog):
basedag.__init__(self)
self._revlog = revlog
class revlogdag(revlogbaseddag):
class revlogdag(object):
'''dag interface to a revlog'''
def __init__(self, revlog):
......@@ -59,7 +14,7 @@
'''dag interface to a revlog'''
def __init__(self, revlog):
revlogbaseddag.__init__(self, revlog)
self._revlog = revlog
def parents(self, ix):
rlog = self._revlog
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment