merged oldstable bugfix stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Thu, 28 Apr 2011 10:11:14 +0200
branchstable
changeset 7262 373212d1fa33
parent 7259 f846f4f017b1 (current diff)
parent 7261 1d1446e9dfe2 (diff)
child 7263 33475a31c96c
child 7270 5a1e9b90b5c4
merged oldstable bugfix
--- a/misc/migration/3.10.9_Any.py	Thu Apr 28 08:19:42 2011 +0200
+++ b/misc/migration/3.10.9_Any.py	Thu Apr 28 10:11:14 2011 +0200
@@ -15,14 +15,14 @@
     nbops = rset.rowcount
     enabled = interactive_mode
     with progress(title=title, nbops=nbops, size=30, enabled=enabled) as pb:
-        with hooks_control(session, session.HOOKS_DENY_ALL, 'integrity'):
-            for i,  row in enumerate(rset):
+        for i,  row in enumerate(rset):
+            with hooks_control(session, session.HOOKS_DENY_ALL, 'integrity'):
                 data = {'eid': row[0], 'cwuri': row[1].replace(u'/eid', u'')}
                 rql('SET X cwuri %(cwuri)s WHERE X eid %(eid)s', data)
-                if not i % 100: # commit every 100 entities to limit memory consumption
-                    pb.text = "%i committed" % i
-                    commit(ask_confirm=False)
-                pb.update()
+            if not i % 100: # commit every 100 entities to limit memory consumption
+                pb.text = "%i committed" % i
+                commit(ask_confirm=False)
+            pb.update()
         commit(ask_confirm=False)
 
 try: