# HG changeset patch # User Julien Cristau # Date 1423824493 -3600 # Node ID e38b8d37c5d8e99d2c06bdbb97db18c44bdea9bb # Parent 131275d6c268c8b1bc8754ec538d3d623bae0c88 [rqlrewrite] sort possible types when turning is_instance_of into is Helps get predictable output even with python -R. Related to #4959402. diff -r 131275d6c268 -r e38b8d37c5d8 rqlrewrite.py --- a/rqlrewrite.py Fri Feb 13 11:47:34 2015 +0100 +++ b/rqlrewrite.py Fri Feb 13 11:48:13 2015 +0100 @@ -89,7 +89,7 @@ mytyperel.r_type = 'is' if len(possibletypes) > 1: node = n.Function('IN') - for etype in possibletypes: + for etype in sorted(possibletypes): node.append(n.Constant(etype, 'etype')) else: etype = iter(possibletypes).next() diff -r 131275d6c268 -r e38b8d37c5d8 server/test/unittest_security.py --- a/server/test/unittest_security.py Fri Feb 13 11:47:34 2015 +0100 +++ b/server/test/unittest_security.py Fri Feb 13 11:48:13 2015 +0100 @@ -519,7 +519,7 @@ plan.preprocess(rqlst) self.assertEqual( rqlst.as_string(), - '(Any X WHERE X is IN(SubDivision, Societe)) UNION ' + '(Any X WHERE X is IN(Societe, SubDivision)) UNION ' '(Any X WHERE X is Division, EXISTS(X owned_by %(B)s))')