devtools/__init__.py
changeset 7514 32081892850e
parent 7398 26695dd703d8
parent 7506 c8cda2aca92e
child 7536 29961a416faa
--- a/devtools/__init__.py	Sat Jun 11 09:22:25 2011 +0200
+++ b/devtools/__init__.py	Wed Jun 15 17:16:19 2011 +0200
@@ -601,15 +601,18 @@
     def _backup_database(self, db_id):
         """Actual backup the current database.
 
-        return a value to be stored in db_cache to allow restoration"""
+        return a value to be stored in db_cache to allow restoration
+        """
         from cubicweb.server.serverctl import createdb
         orig_name = self.system_source['db-name']
         try:
             backup_name = self._backup_name(db_id)
             self._drop(backup_name)
             self.system_source['db-name'] = backup_name
+            self._repo.turn_repo_off()
             createdb(self.helper, self.system_source, self.dbcnx, self.cursor, template=orig_name)
             self.dbcnx.commit()
+            self._repo.turn_repo_on()
             return backup_name
         finally:
             self.system_source['db-name'] = orig_name