Web · Wiki · Activities · Blog · Lists · Chat · Meeting · Bugs · Git · Translate · Archive · People · Donate

Commit de83019b12aa3ec7e39f8dd69d9fb5b418db9dde

get completely rid of in-memory metadata storage

Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
  
242242 logging.debug('max_versions=%r', self._max_versions)
243243 self._index = Index(os.path.join(self._base_dir, 'index'))
244244 self._migrate()
245 self._metadata = {}
246245
247246 def change_metadata(self, object_id, metadata):
248247 logging.debug('change_metadata(%r, %r)', object_id, metadata)
249248 metadata['tree_id'], metadata['version_id'] = object_id
250249 if 'creation_time' not in metadata:
251 old_metadata = self._metadata[object_id]
250 old_metadata = self._index.retrieve(object_id)
252251 metadata['creation_time'] = old_metadata['creation_time']
253252
254253 self._index.store(object_id, metadata)
255 self._metadata[object_id] = metadata
256254
257255 def delete(self, object_id):
258256 logging.debug('delete(%r)', object_id)
259257 self._index.delete(object_id)
260 del self._metadata[object_id]
261258 self._git_call('update-ref', ['-d', _format_ref(*object_id)])
262259
263260 def get_data_path(self, (tree_id, version_id), sender=None):
347347
348348 # TODO: check metadata for validity first (index?)
349349 self._store_entry(tree_id, child_id, parent_id, path, metadata)
350 self._metadata[(tree_id, child_id)] = metadata
351350 self._index.store((tree_id, child_id), metadata)
352351 async_cb(tree_id, child_id)
353352
  
302302
303303 return entries, total_count
304304
305 def retrieve(self, object_id):
306 postings = self._database.postlist(_object_id_term(object_id))
307 document = self._database.get_document(postings.next().docid)
308 return deserialise_metadata(document.get_data())
309
305310 def store(self, object_id, properties):
306311 logging.debug('store(%r, %r)', object_id, properties)
307312 assert (properties['tree_id'], properties['version_id']) == object_id