cleanup stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 03 Jul 2009 10:27:03 +0200
branchstable
changeset 2252 dd9758cb77e1
parent 2251 799ff50ddfe8
child 2253 0727550c64e2
cleanup
devtools/apptest.py
schema.py
--- a/devtools/apptest.py	Fri Jul 03 10:26:19 2009 +0200
+++ b/devtools/apptest.py	Fri Jul 03 10:27:03 2009 +0200
@@ -462,14 +462,13 @@
         self.__close = repo.close
         self.cnxid = self.cnx.sessionid
         self.session = repo._sessions[self.cnxid]
-        # XXX copy schema since hooks may alter it and it may be not fully
-        #     cleaned (missing some schema synchronization support)
-        try:
-            origschema = repo.__schema
-        except AttributeError:
-            origschema = repo.schema
-            repo.__schema = origschema
         if self.copy_schema:
+            # XXX copy schema since hooks may alter it and it may be not fully
+            #     cleaned (missing some schema synchronization support)
+            try:
+                origschema = repo.__schema
+            except AttributeError:
+                repo.__schema = origschema = repo.schema
             repo.schema = deepcopy(origschema)
             repo.set_schema(repo.schema) # reset hooks
             repo.vreg.update_schema(repo.schema)
--- a/schema.py	Fri Jul 03 10:26:19 2009 +0200
+++ b/schema.py	Fri Jul 03 10:27:03 2009 +0200
@@ -356,6 +356,7 @@
         """rql expression factory"""
         return ERQLExpression(expression, mainvars, eid)
 
+
 class CubicWebRelationSchema(RelationSchema):
     RelationSchema._RPROPERTIES['eid'] = None
     _perms_checked = False