Rev 1681: Use local application data directory on Windows for bzr-svn cache. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk
Jelmer Vernooij
jelmer at samba.org
Sat Aug 30 23:02:26 BST 2008
At http://people.samba.org/bzr/jelmer/bzr-svn/trunk
------------------------------------------------------------
revno: 1681
revision-id: jelmer at samba.org-20080830220223-6s7zqpi7bwoz66pr
parent: jelmer at samba.org-20080830215319-3debvjvecj23xq1v
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sun 2008-08-31 00:02:23 +0200
message:
Use local application data directory on Windows for bzr-svn cache.
modified:
NEWS news-20061231030336-h9fhq245ie0de8bs-1
cache.py cache.py-20070520185908-qbtlcet08bllgs0f-1
=== modified file 'NEWS'
--- a/NEWS 2008-08-29 10:10:59 +0000
+++ b/NEWS 2008-08-30 22:02:23 +0000
@@ -8,6 +8,9 @@
* Fix compatibility with Bazaar 1.7.
+ * Use local application data directory on Windows for bzr-svn cache.
+ (#231041)
+
bzr-svn 0.4.11 2008-08-26
bzr-svn 0.4.11~rc2 2008-08-26
=== modified file 'cache.py'
--- a/cache.py 2008-08-23 14:55:24 +0000
+++ b/cache.py 2008-08-30 22:02:23 +0000
@@ -21,7 +21,7 @@
from bzrlib.trace import mutter, warning
from bzrlib.plugins.svn import version_info
-import os
+import os, sys
def create_cache_dir():
"""Create the top-level bzr-svn cache directory.
@@ -35,7 +35,17 @@
else:
name = 'svn-cache'
extra = ""
- cache_dir = os.path.join(config_dir(), name)
+ if sys.platform == "nt":
+ try:
+ from bzrlib.win32utils import get_local_appdata_location
+ except ImportError:
+ base_cache_dir = config_dir()
+ else:
+ base_cache_dir = get_local_appdata_location()
+ assert base_cache_dir is not None
+ else:
+ base_cache_dir = config_dir()
+ cache_dir = os.path.join(base_cache_dir, name)
if not os.path.exists(cache_dir):
os.mkdir(cache_dir)
More information about the bazaar-commits
mailing list