# HG changeset patch
# User Denis Laxalde <denis.laxalde@logilab.fr>
# Date 1436452269 -7200
#      Thu Jul 09 16:31:09 2015 +0200
# Node ID 7a8a295a22861c0cd1638a43e37efc569ef9a478
# Parent  ad28c783ec1646990cac9bc64032335c5eecb5d9
Set `skiprtypes`/`skipetypes` on IClonable adapter

diff --git a/entities.py b/entities.py
--- a/entities.py
+++ b/entities.py
@@ -156,6 +156,8 @@
     __abstract__ = True
     __select__ = partial_relation_possible()
     rtype, role = None, 'object'  # relation between the clone and the original.
+    skiprtypes = ()
+    skipetypes = ()
 
     def clone_into(self, clone):
         """Recursivily clone the container graph of this entity into `clone`."""
@@ -164,7 +166,9 @@
                 clone.cw_etype, self.entity.cw_etype)
         clone.copy_relations(self.entity.eid)
         clones = {self.entity: clone}
-        for child, (rtype, role), parent in composite_entities_graph(self.entity):
+        graph = composite_entities_graph(self.entity, skiprtypes=self.skiprtypes,
+                                         skipetypes=self.skipetypes)
+        for child, (rtype, role), parent in graph:
             rel = rtype if role == 'subject' else 'reverse_' + rtype
             kwargs = {rel: clones[parent]}
             clone = clones.get(child)