win32: Cache-directory should be in "Local Settings\Application Data"

Bug #231041 reported by Mirko Friedenhagen
4
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
Low
Jelmer Vernooij

Bug Description

Right now bzr-svn stores caching info in Application Data (or it's internationalized name). If you use server-replicated profiles, this directory will be transfered every time you log in and out.

We have several SVN-Repo with more than 200000 revisions and the sqlite3-files have more than 300MB.

Thunderbird, Firefox et al. put their caches in "Local Settings\Application Data" which will not be transfered.

C:\Dokumente und Einstellungen\mifr\Anwendungsdaten\bazaar\2.0\plugins\svn>bzr version-info
revision-id: <email address hidden>
date: 2008-05-15 04:58:16 +0200
build-date: 2008-05-16 13:15:09 +0200
revno: 1169
branch-nick: svn

Related branches

Revision history for this message
Mirko Friedenhagen (mfriedenhagen) wrote :

The README states the recoverablility of the information, so maybe TEMP or TMPDIR would be preferable.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 231041] Re: win32: Cache-directory should be in "Local Settings\Application Data"

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mirko Friedenhagen wrote:
> The README states the recoverablility of the information, so maybe TEMP
> or TMPDIR would be preferable.
Recovering the data requires quite some time so you wouldn't want to
throw away this data unless absolutely necessary.

The directory where the cache is being stored is determined in
cache.py. Any chance you can provide a patch that changes it to use an
appropriate patch on Windows? I don't use Windows myself so I'm unable
to test this sort of thing.

Cheers,

Jelmer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBSC2e2gy0JeEGD2blAQIWAwQAkwfB3RfpUrcHNQpRZlfojkOjUt9vT2fb
pEUhKB3S5HYY2CRXojMBwWpxgvRqvaPTEW7AOH5wULI1FO3m7/WKVKX3782omXLP
8XzQf0Uhw5zgd7kmqGcIdHwsoL49yKtn0J5s/q79sJYhdl8JdbTLXfT519r+Nbrv
PggzymE4hH0=
=ep/Z
-----END PGP SIGNATURE-----

Revision history for this message
Mirko Friedenhagen (mfriedenhagen) wrote :

Do you have an objections about making this either an option or setting an alternative location using an environment variable, e.g. BZR_SVN_CACHEDIR?

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mirko Friedenhagen wrote:
> Do you have an objections about making this either an option or
> setting an alternative location using an environment variable, e.g.
> BZR_SVN_CACHEDIR?
I would prefer just using sys.platform to select the location that is
being used rather than adding more configuration options. Is there any
particular reason this should be configurable rather than just always
"Local Settings\Application Data\bzr-svn" or something on Windows?

Cheers,

Jelmer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBSDV9tQy0JeEGD2blAQJvawP9Fj+NAtTluIOPWTpmvj8l20/XKg5SDFQd
sxefH04UxqFdroWIHfAmds2G0RYPZD4bPtdHrBBvTRX2h0ws0jSQ8YoVtWjlcDuM
+3K07KKqrYCBIK5OeAV2qqSPiXnJtM1k3/pH+LDgWorYlq5WZ1VtdcTtJ94ttXtC
v6zjYVmoxIo=
=lBgi
-----END PGP SIGNATURE-----

Revision history for this message
Mirko Friedenhagen (mfriedenhagen) wrote :

Hello,

I have taken a look into bzrlib.config.config_dir() and without win32tools installed, there seems to be no way to determine the localized version of "Local Settings" (in Germany it is called "Lokale Einstellungen" e.g.). Only APP_DATA (i.e. "Application Data" resp. "Anwendungsdaten") is available as an environment variable.

Regards
Mirko

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Hi Mirko,

One of the options would be to only override the cache path if win32tools is available. That should do the right thing in a lot of cases but may be confusing to users in some cases. What do you think?

Cheers,

Jelmer

Changed in bzr-svn:
status: New → Confirmed
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
importance: Undecided → Low
milestone: none → 0.4.12
status: Confirmed → Triaged
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Mark, any chance you can comment on this?

Revision history for this message
Mark Hammond (mhammond) wrote :

I agree with the sentiment of this bug. I think win32utils should grow a new function get_local_appdata_location(), which for most platforms, and possibly Windows in some cases, just returns get_appdata_location(). In some cases, non-Windows developers may be confused about which one they should use, but I think that's workable with good docstrings.

get_appdata_location() and get_local_appdata_location() should probably both grow support for pywin32, meaning that so long as you have either ctypes or pywin32 available, Windows will do the right thing. As ctypes comes with 2.5, I think this will cover the vast majority of cases now and all cases moving forward.

If this sounds good I could probably make the patch to win32utils.py

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks, Mark.

Yeah, that sounds good. I'm happy to apply any patches, it's just very hard for me to test them on Win32 since I'm on Linux :-)

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Fix has landed that makes us use the local app data, will work once Mark's helper function lands in bzr.dev.

Changed in bzr-svn:
assignee: nobody → jelmer
status: Triaged → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.