server/sources/datafeed.py
changeset 7534 d58a9d96aad8
parent 7533 43835fbdf97d
child 7548 92fd4b777016
--- a/server/sources/datafeed.py	Fri Jun 17 18:49:55 2011 +0200
+++ b/server/sources/datafeed.py	Fri Jun 17 18:50:13 2011 +0200
@@ -259,9 +259,14 @@
         """return an entity for the given uri. May return None if it should be
         skipped
         """
+        # if cwsource is specified and repository has a source with the same
+        # name, call extid2eid on that source so entity will be properly seen as
+        # coming from this source
+        source = self._cw.repo.sources_by_uri.get(
+            sourceparams.pop('cwsource', None), self.source)
         sourceparams['parser'] = self
-        eid = self.source.extid2eid(str(uri), etype, self._cw,
-                                    sourceparams=sourceparams)
+        eid = source.extid2eid(str(uri), etype, self._cw,
+                               sourceparams=sourceparams)
         if eid < 0:
             # entity has been moved away from its original source
             #