[multi-sources] closes #1918120: drop behaviour leading to wrong result as demonstrated by the ticket
The formerly implemented behaviour doesn't seems to be useful,
nor to have a chance to be correct. At least no test case demonstrate
the opposite, so I've dropped it.
try:
rtype, = __args__
except ValueError:
print 'USAGE: cubicweb-ctl shell <instance> detect_cycle.py -- <relation type>'
print
graph = {}
for fromeid, toeid in rql('Any X,Y WHERE X %s Y' % rtype):
graph.setdefault(fromeid, []).append(toeid)
from logilab.common.graph import get_cycles
for cycle in get_cycles(graph):
print 'cycle', '->'.join(str(n) for n in cycle)