← Back to team overview

harvest-dev team mailing list archive

[Merge] lp:~dholbach/harvest/918150 into lp:harvest

 

Daniel Holbach has proposed merging lp:~dholbach/harvest/918150 into lp:harvest.

Requested reviews:
  harvest-dev (harvest-dev)
Related bugs:
  Bug #918150 in harvest: "We need to set BZR_LOG for the updatelists command"
  https://bugs.launchpad.net/harvest/+bug/918150

For more details, see:
https://code.launchpad.net/~dholbach/harvest/918150/+merge/89053
-- 
https://code.launchpad.net/~dholbach/harvest/918150/+merge/89053
Your team harvest-dev is requested to review the proposed merge of lp:~dholbach/harvest/918150 into lp:harvest.
=== modified file 'harvest/common/opportunity_lists.py'
--- harvest/common/opportunity_lists.py	2010-12-08 08:15:50 +0000
+++ harvest/common/opportunity_lists.py	2012-01-18 14:51:30 +0000
@@ -88,8 +88,18 @@
 
 def pull_lists(data_dir):
     list_dir = settings.LIST_PATH
-    if not os.path.exists(list_dir):
-        os.system("cd %s; bzr checkout %s lists -q" % (data_dir, LIST_BRANCH_URL))
+    old_bzr_log = None
+    new_bzr_log = os.path.join(settings.DATA_PATH, ".bzr.log")
+    if not os.environ.has_key("BZR_LOG"):
+        os.environ["BZR_LOG"] = new_bzr_log
     else:
-        os.system("cd %s; bzr update -q" % list_dir)
+        old_bzr_log = os.environ["BZR_LOG"]
+    try:
+        if not os.path.exists(list_dir):
+            os.system("cd %s; bzr checkout %s lists -q" % (data_dir, LIST_BRANCH_URL))
+        else:
+            os.system("cd %s; bzr update -q" % list_dir)
+    finally:
+        if not old_bzr_log:
+            os.environ.pop("BZR_LOG")
     return list_dir