BugDir.duplicate_bugdir() fix for when parent bugdir's sync_with_disk == False.
authorW. Trevor King <wking@drexel.edu>
Mon, 31 Aug 2009 17:54:09 +0000 (13:54 -0400)
committerW. Trevor King <wking@drexel.edu>
Mon, 31 Aug 2009 17:54:09 +0000 (13:54 -0400)
libbe/bugdir.py

index 3be579f6a709eeb0bf27ac2a479addeb1ec0298a..af4391739c3c6a58e7c299f880fe5a542361e056 100644 (file)
@@ -510,8 +510,14 @@ settings easy.  Don't set this attribute.  Set .vcs instead, and
         duplicate_path = self.vcs.duplicate_repo(revision)
 
         duplicate_version_path = os.path.join(duplicate_path, ".be", "version")
-        version = self.get_version(duplicate_version_path,
-                                   for_duplicate_bugdir=True)
+        try:
+            version = self.get_version(duplicate_version_path,
+                                       for_duplicate_bugdir=True)
+        except DiskAccessRequired:
+            self.sync_with_disk = True # temporarily allow access
+            version = self.get_version(duplicate_version_path,
+                                       for_duplicate_bugdir=True)
+            self.sync_with_disk = False
         if version != upgrade.BUGDIR_DISK_VERSION:
             upgrade.upgrade(duplicate_path, version)