--- a/hooks/metadata.py Thu Jun 27 08:30:46 2013 +0200
+++ b/hooks/metadata.py Tue Jan 21 18:11:30 2014 +0100
@@ -159,11 +159,8 @@
extid = entity.cw_metainformation()['extid']
repo._type_source_cache[entity.eid] = (
entity.cw_etype, self.newsource.uri, None, self.newsource.uri)
- if self.oldsource.copy_based_source:
- uri = 'system'
- else:
- uri = self.oldsource.uri
- repo._extid_cache[(extid, uri)] = -entity.eid
+ repo._extid_cache[(extid, 'system')] = -entity.eid
+
class ChangeEntitySourceDeleteHook(MetaDataHook):
"""support for moving an entity from an external source by watching 'Any
@@ -197,16 +194,6 @@
syssource = newsource.repo_source
oldsource = self._cw.entity_from_eid(schange[self.eidfrom])
entity = self._cw.entity_from_eid(self.eidfrom)
- # copy entity if necessary
- if not oldsource.repo_source.copy_based_source:
- entity.complete(skip_bytes=False, skip_pwd=False)
- if not entity.creation_date:
- entity.cw_attr_cache['creation_date'] = datetime.now()
- if not entity.modification_date:
- entity.cw_attr_cache['modification_date'] = datetime.now()
- entity.cw_attr_cache['cwuri'] = u'%s%s' % (self._cw.base_url(), entity.eid)
- entity.cw_edited = EditedEntity(entity, **entity.cw_attr_cache)
- syssource.add_entity(self._cw, entity)
# we don't want the moved entity to be reimported later. To
# distinguish this state, the trick is to change the associated
# record in the 'entities' system table with eid=-eid while leaving