Show More
@@ -24,10 +24,6 b' class basedag(object):' | |||||
24 | def __init__(self): |
|
24 | def __init__(self): | |
25 | self._inverse = None |
|
25 | self._inverse = None | |
26 |
|
26 | |||
27 | def heads(self): |
|
|||
28 | '''list of head ixs''' |
|
|||
29 | raise NotImplementedError |
|
|||
30 |
|
||||
31 | def parents(self, ix): |
|
27 | def parents(self, ix): | |
32 | '''list of parents ixs of ix''' |
|
28 | '''list of parents ixs of ix''' | |
33 | raise NotImplementedError |
|
29 | raise NotImplementedError | |
@@ -65,22 +61,12 b' class revlogbaseddag(basedag):' | |||||
65 | def __init__(self, revlog): |
|
61 | def __init__(self, revlog): | |
66 | basedag.__init__(self) |
|
62 | basedag.__init__(self) | |
67 | self._revlog = revlog |
|
63 | self._revlog = revlog | |
68 | self._heads = None |
|
|||
69 |
|
||||
70 | def heads(self): |
|
|||
71 | if self._heads is None: |
|
|||
72 | self._heads = self._getheads() |
|
|||
73 | return self._heads |
|
|||
74 |
|
64 | |||
75 | class revlogdag(revlogbaseddag): |
|
65 | class revlogdag(revlogbaseddag): | |
76 | '''dag interface to a revlog''' |
|
66 | '''dag interface to a revlog''' | |
77 |
|
67 | |||
78 |
def __init__(self, revlog |
|
68 | def __init__(self, revlog): | |
79 | revlogbaseddag.__init__(self, revlog) |
|
69 | revlogbaseddag.__init__(self, revlog) | |
80 | self._heads = localsubset |
|
|||
81 |
|
||||
82 | def _getheads(self): |
|
|||
83 | return [r for r in self._revlog.headrevs() if r != nullrev] |
|
|||
84 |
|
70 | |||
85 | def parents(self, ix): |
|
71 | def parents(self, ix): | |
86 | rlog = self._revlog |
|
72 | rlog = self._revlog | |
@@ -173,10 +159,6 b' class inverserevlogdag(revlogbaseddag, g' | |||||
173 | rev -= 1 |
|
159 | rev -= 1 | |
174 | self._walkfrom = rev |
|
160 | self._walkfrom = rev | |
175 |
|
161 | |||
176 | def _getheads(self): |
|
|||
177 | self._walkto(nullrev) |
|
|||
178 | return self._roots |
|
|||
179 |
|
||||
180 | def parents(self, ix): |
|
162 | def parents(self, ix): | |
181 | if ix is None: |
|
163 | if ix is None: | |
182 | return [] |
|
164 | return [] |
@@ -152,7 +152,7 b' def findcommonheads(ui, local, remote,' | |||||
152 | else: |
|
152 | else: | |
153 | ownheads = [rev for rev in cl.headrevs() if rev != nullrev] |
|
153 | ownheads = [rev for rev in cl.headrevs() if rev != nullrev] | |
154 |
|
154 | |||
155 |
dag = dagutil.revlogdag(cl |
|
155 | dag = dagutil.revlogdag(cl) | |
156 |
|
156 | |||
157 | # early exit if we know all the specified remote heads already |
|
157 | # early exit if we know all the specified remote heads already | |
158 | ui.debug("query 1; heads\n") |
|
158 | ui.debug("query 1; heads\n") |
General Comments 0
You need to be logged in to leave comments.
Login now