Subject: [Instant] [MERGE] One can now overrule the default instant cache directory,

From: Johan Hake <[email-masked]>
Date: Wed, 25 Nov 2009 00:28:33 +0100

Hello!

I am trying the 

  bzr send 

command to send a patch with commits. 

The handed patch should add a check for the environmental variable 
INSTANT_CACHE_DIR, when setting the default directory for the instant cache.

Johan
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: [email-masked]
# target_branch: bzr+ssh://bazaar.launchpad.net/~instant-\
#   core/instant/main/
# testament_sha1: 708c18770ab22e9888e8a5c5eaf234fb32946cbe
# timestamp: 2009-11-24 15:25:13 -0800
# base_revision_id: [email-masked]
# 
# Begin patch
=== modified file '.bzrignore'
--- .bzrignore	2009-11-24 11:10:36 +0000
+++ .bzrignore	2009-11-24 23:17:58 +0000
@@ -1,3 +1,2 @@
-(^|/)\.svn($|/)
-(^|/)\.hg($|/)
-(^|/)\.hgtags($|/)
+build
+tests/**/

=== modified file 'src/instant/paths.py'
--- src/instant/paths.py	2008-10-20 12:12:00 +0000
+++ src/instant/paths.py	2009-11-24 23:18:37 +0000
@@ -41,7 +41,10 @@
 
 def get_default_cache_dir():
     "Return the default cache directory."
-    cache_dir = os.path.join(get_instant_dir(), "cache")
+    if "INSTANT_CACHE_DIR" in os.environ:
+        cache_dir = os.environ["INSTANT_CACHE_DIR"]
+    else:
+        cache_dir = os.path.join(get_instant_dir(), "cache")
     if not os.path.isdir(cache_dir):
         instant_debug("Creating cache directory '%s'." % cache_dir)
         os.mkdir(cache_dir)

# Begin bundle

---

From: "Garth N. Wells" <[email-masked]>
Date: Wed, 25 Nov 2009 11:50:15 +0000

> INSTANT_CACHE_DIR, when setting the default directory for the instant cache.

I've applied this.

It would be good to try the 'merge request' feature on Launchpad. Not
sure yet how it works.

Garth

> Johan
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~instant
> Post to     : [email-masked]
> Unsubscribe : https://launchpad.net/~instant
> More help   : https://help.launchpad.net/ListHelp