Work around bzr filelocking issue on Windows.
authorW. Trevor King <wking@drexel.edu>
Thu, 24 Feb 2011 22:34:40 +0000 (17:34 -0500)
committerChris Ball <cjb@laptop.org>
Fri, 25 Feb 2011 16:23:23 +0000 (11:23 -0500)
libbe/storage/vcs/base.py
libbe/storage/vcs/bzr.py

index 570af17d203e3e62fcdb9efbc8c80a963174eb34..aba6159da47b04e280997f55afde3a914443ba29 100644 (file)
@@ -575,7 +575,7 @@ class VCS (libbe.storage.base.VersionedStorage):
         if self._detect(self.repo) == False:
             raise VCSUnableToRoot(self)
         root = self._vcs_root(self.repo)
-        self.repo = os.path.abspath(root)
+        self.repo = os.path.realpath(root)
         if os.path.isdir(self.repo) == False:
             self.repo = os.path.dirname(self.repo)
         self.be_dir = os.path.join(
index a00e3ac03b67af42b7dc838938bc756f028bf036..9464d1db64412e5c2fe3958b4e4b4e0c904afa70 100644 (file)
@@ -156,7 +156,12 @@ class Bzr(base.VCS):
         path = os.path.join(self.repo, path)
         cmd = bzrlib.builtins.cmd_add()
         cmd.outf = StringIO.StringIO()
-        cmd.run(file_list=[path], file_ids_from=self.repo)
+        kwargs = {'file_ids_from': self.repo}
+        if self.repo == os.path.realpath(os.getcwd()):
+            # Work around bzr file locking on Windows.
+            # See: https://lists.ubuntu.com/archives/bazaar/2011q1/071705.html
+            kwargs.pop('file_ids_from')
+        cmd.run(file_list=[path], **kwargs)
         if self.version_cmp(2,2,0) < 0:
             cmd.cleanup_now()