Show More
@@ -8,7 +8,6 b'' | |||||
8 |
|
8 | |||
9 | from __future__ import absolute_import |
|
9 | from __future__ import absolute_import | |
10 |
|
10 | |||
11 | from .i18n import _ |
|
|||
12 | from .node import nullrev |
|
11 | from .node import nullrev | |
13 |
|
12 | |||
14 | class basedag(object): |
|
13 | class basedag(object): | |
@@ -62,18 +61,6 b' class basedag(object):' | |||||
62 | ''' |
|
61 | ''' | |
63 | raise NotImplementedError |
|
62 | raise NotImplementedError | |
64 |
|
63 | |||
65 | def internalize(self, id): |
|
|||
66 | '''return a node ix''' |
|
|||
67 | return self._internalize(id) |
|
|||
68 |
|
||||
69 | def internalizeall(self, ids, filterunknown=False): |
|
|||
70 | '''return a list of (or set if given a set) of node ixs''' |
|
|||
71 | ixs = self._internalizeall(ids, filterunknown) |
|
|||
72 | if isinstance(ids, set): |
|
|||
73 | return set(ixs) |
|
|||
74 | return list(ixs) |
|
|||
75 |
|
||||
76 |
|
||||
77 | class genericdag(basedag): |
|
64 | class genericdag(basedag): | |
78 | '''generic implementations for DAGs''' |
|
65 | '''generic implementations for DAGs''' | |
79 |
|
66 | |||
@@ -119,21 +106,6 b' class revlogbaseddag(basedag):' | |||||
119 | self._heads = self._getheads() |
|
106 | self._heads = self._getheads() | |
120 | return self._heads |
|
107 | return self._heads | |
121 |
|
108 | |||
122 | def _internalize(self, id): |
|
|||
123 | ix = self._revlog.rev(id) |
|
|||
124 | if ix == nullrev: |
|
|||
125 | raise LookupError(id, self._revlog.indexfile, _('nullid')) |
|
|||
126 | return ix |
|
|||
127 | def _internalizeall(self, ids, filterunknown): |
|
|||
128 | rl = self._revlog |
|
|||
129 | if filterunknown: |
|
|||
130 | return [r for r in map(rl.nodemap.get, ids) |
|
|||
131 | if (r is not None |
|
|||
132 | and r != nullrev |
|
|||
133 | and r not in rl.filteredrevs)] |
|
|||
134 | return [self._internalize(i) for i in ids] |
|
|||
135 |
|
||||
136 |
|
||||
137 | class revlogdag(revlogbaseddag): |
|
109 | class revlogdag(revlogbaseddag): | |
138 | '''dag interface to a revlog''' |
|
110 | '''dag interface to a revlog''' | |
139 |
|
111 |
General Comments 0
You need to be logged in to leave comments.
Login now