[repo] cleanup
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 23 Apr 2010 17:56:01 +0200
changeset 5398 b9e1abe1bdfe
parent 5397 cdbf823450aa
child 5408 120db445c179
[repo] cleanup
server/repository.py
server/sources/storages.py
--- a/server/repository.py	Fri Apr 23 17:55:46 2010 +0200
+++ b/server/repository.py	Fri Apr 23 17:56:01 2010 +0200
@@ -875,6 +875,7 @@
         if eid is not None:
             self._extid_cache[cachekey] = eid
             self._type_source_cache[eid] = (etype, source.uri, extid)
+            # XXX used with extlite (eg vcsfile), probably not needed anymore
             if recreate:
                 entity = source.before_entity_insertion(session, extid, etype, eid)
                 entity._cw_recreating = True
@@ -903,10 +904,8 @@
             self._extid_cache[cachekey] = eid
             self._type_source_cache[eid] = (etype, source.uri, extid)
             entity = source.before_entity_insertion(session, extid, etype, eid)
-            if not hasattr(entity, 'edited_attributes'):
-                entity.edited_attributes = set()
+            entity.edited_attributes = set(entity)
             if source.should_call_hooks:
-                entity.edited_attributes = set(entity)
                 self.hm.call_hooks('before_add_entity', session, entity=entity)
             # XXX call add_info with complete=False ?
             self.add_info(session, entity, source, extid)
--- a/server/sources/storages.py	Fri Apr 23 17:55:46 2010 +0200
+++ b/server/sources/storages.py	Fri Apr 23 17:56:01 2010 +0200
@@ -75,6 +75,7 @@
             return path
     return None
 
+
 class BytesFileSystemStorage(Storage):
     """store Bytes attribute value on the file system"""
     def __init__(self, defaultdir, fsencoding='utf-8'):