[debug] when a loop is detected in a tree, log the entity involved in it to ease repair
--- a/entities/adapters.py Mon Jul 26 12:06:58 2010 +0200
+++ b/entities/adapters.py Mon Jul 26 12:07:00 2010 +0200
@@ -294,7 +294,7 @@
_done = set()
for child in self.children():
if child.eid in _done:
- self.error('loop in %s tree', child.__regid__.lower())
+ self.error('loop in %s tree: %s', child.__regid__.lower(), child)
continue
yield child
_done.add(child.eid)
@@ -320,7 +320,7 @@
entity = adapter.entity
while entity is not None:
if entity.eid in path:
- self.error('loop in %s tree', entity.__regid__.lower())
+ self.error('loop in %s tree: %s', entity.__regid__.lower(), entity)
break
path.append(entity.eid)
try:
--- a/mixins.py Mon Jul 26 12:06:58 2010 +0200
+++ b/mixins.py Mon Jul 26 12:07:00 2010 +0200
@@ -71,7 +71,7 @@
_done = set()
for child in self.children():
if child.eid in _done:
- self.error('loop in %s tree', self.__regid__.lower())
+ self.error('loop in %s tree: %s', self.__regid__.lower(), child)
continue
yield child
_done.add(child.eid)
@@ -94,7 +94,7 @@
parent = self
while parent:
if parent.eid in path:
- self.error('loop in %s tree', self.__regid__.lower())
+ self.error('loop in %s tree: %s', self.__regid__.lower(), parent)
break
path.append(parent.eid)
try: