equal
deleted
inserted
replaced
59 _filepath = 'evoext-firstmerge-00' |
59 _filepath = 'evoext-firstmerge-00' |
60 _cachename = 'evo-ext-firstmerge' |
60 _cachename = 'evo-ext-firstmerge' |
61 |
61 |
62 def __init__(self): |
62 def __init__(self): |
63 super(firstmergecache, self).__init__() |
63 super(firstmergecache, self).__init__() |
64 self._data = array.array('l') |
64 self._data = array.array(r'l') |
65 |
65 |
66 def get(self, rev): |
66 def get(self, rev): |
67 if len(self._data) <= rev: |
67 if len(self._data) <= rev: |
68 raise error.ProgrammingError('firstmergecache must be warmed before use') |
68 raise error.ProgrammingError('firstmergecache must be warmed before use') |
69 return self._data[rev] |
69 return self._data[rev] |
106 recomputed. |
106 recomputed. |
107 |
107 |
108 Subclasses MUST overide this method to actually affect the cache data. |
108 Subclasses MUST overide this method to actually affect the cache data. |
109 """ |
109 """ |
110 super(firstmergecache, self).clear() |
110 super(firstmergecache, self).clear() |
111 self._data = array.array('l') |
111 self._data = array.array(r'l') |
112 |
112 |
113 # crude version of a cache, to show the kind of information we have to store |
113 # crude version of a cache, to show the kind of information we have to store |
114 |
114 |
115 def load(self, repo): |
115 def load(self, repo): |
116 """load data from disk""" |
116 """load data from disk""" |
117 assert repo.filtername is None |
117 assert repo.filtername is None |
118 |
118 |
119 data = repo.cachevfs.tryread(self._filepath) |
119 data = repo.cachevfs.tryread(self._filepath) |
120 self._data = array.array('l') |
120 self._data = array.array(r'l') |
121 if not data: |
121 if not data: |
122 self._cachekey = self.emptykey |
122 self._cachekey = self.emptykey |
123 else: |
123 else: |
124 headerdata = data[:self._cachekeysize] |
124 headerdata = data[:self._cachekeysize] |
125 self._cachekey = self._deserializecachekey(headerdata) |
125 self._cachekey = self._deserializecachekey(headerdata) |