Mercurial > public > mercurial-scm > hg
comparison mercurial/dagutil.py @ 39160:0e46b92b37b1
dagutil: remove externalize() and externalizeall()
They are unused after the previous commit.
.. api:: externalize() and externalizeall() removed from dagutil
Use .node() on a storage primitive to perform revision to node
conversions.
Differential Revision: https://phab.mercurial-scm.org/D4305
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 16 Aug 2018 19:40:46 +0000 |
parents | f77121b6bf1b |
children | 9539553f6d17 |
comparison
equal
deleted
inserted
replaced
39159:5b32b3c618b2 | 39160:0e46b92b37b1 |
---|---|
59 | 59 |
60 By "connected list" we mean that if an ancestor and a descendant are in | 60 By "connected list" we mean that if an ancestor and a descendant are in |
61 the list, then so is at least one path connecting them. | 61 the list, then so is at least one path connecting them. |
62 ''' | 62 ''' |
63 raise NotImplementedError | 63 raise NotImplementedError |
64 | |
65 def externalize(self, ix): | |
66 '''return a node id''' | |
67 return self._externalize(ix) | |
68 | |
69 def externalizeall(self, ixs): | |
70 '''return a list of (or set if given a set) of node ids''' | |
71 ids = self._externalizeall(ixs) | |
72 if isinstance(ixs, set): | |
73 return set(ids) | |
74 return list(ids) | |
75 | 64 |
76 def internalize(self, id): | 65 def internalize(self, id): |
77 '''return a node ix''' | 66 '''return a node ix''' |
78 return self._internalize(id) | 67 return self._internalize(id) |
79 | 68 |
127 | 116 |
128 def heads(self): | 117 def heads(self): |
129 if self._heads is None: | 118 if self._heads is None: |
130 self._heads = self._getheads() | 119 self._heads = self._getheads() |
131 return self._heads | 120 return self._heads |
132 | |
133 def _externalize(self, ix): | |
134 return self._revlog.index[ix][7] | |
135 def _externalizeall(self, ixs): | |
136 idx = self._revlog.index | |
137 return [idx[i][7] for i in ixs] | |
138 | 121 |
139 def _internalize(self, id): | 122 def _internalize(self, id): |
140 ix = self._revlog.rev(id) | 123 ix = self._revlog.rev(id) |
141 if ix == nullrev: | 124 if ix == nullrev: |
142 raise LookupError(id, self._revlog.indexfile, _('nullid')) | 125 raise LookupError(id, self._revlog.indexfile, _('nullid')) |