← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jelmer/launchpad/update-bzr-hg into lp:launchpad/devel

 

Jelmer Vernooij has proposed merging lp:~jelmer/launchpad/update-bzr-hg into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers): code
Related bugs:
  #599397 code imports break when tdb is installed
  https://bugs.launchpad.net/bugs/599397


This updates bzr-hg to a newer upstream revision, one that makes it use directories for caches rather than individual files. I've made matching changes to lp.codehosting to cope with the fact that the bzr-hg cache is now stored differently.

These changes make it possible to run the lp codehosting tests with success when python-tdb is installed. It should also make it easier to install python-tdb on the production machines later (there are some advantages to using python-tdb; it's quicker and allows multiple concurrent writers).
-- 
https://code.launchpad.net/~jelmer/launchpad/update-bzr-hg/+merge/32974
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jelmer/launchpad/update-bzr-hg into lp:launchpad/devel.
=== modified file 'lib/lp/codehosting/codeimport/worker.py'
--- lib/lp/codehosting/codeimport/worker.py	2010-04-28 23:33:48 +0000
+++ lib/lp/codehosting/codeimport/worker.py	2010-08-18 10:16:14 +0000
@@ -650,8 +650,6 @@
     The only behaviour we add is preserving the id-sha map between runs.
     """
 
-    db_file = 'hg-v2.db'
-
     @property
     def format_classes(self):
         """See `PullingImportWorker.opening_format`."""
@@ -667,8 +665,17 @@
         it in the Bazaar tree, that is at '.bzr/repository/hg-v2.db'.
         """
         branch = PullingImportWorker.getBazaarBranch(self)
+        # Fetch the legacy cache from the store, if present.
         self.import_data_store.fetch(
-            self.db_file, branch.repository._transport)
+            'hg-v2.db', branch.repository._transport)
+        # The cache dir from newer bzr-hgs is stored as a tarball.
+        local_name = 'hg-cache.tar.gz'
+        if self.import_data_store.fetch(local_name):
+            repo_transport = branch.repository._transport
+            repo_transport.mkdir('hg')
+            hg_db_dir = os.path.join(
+                local_path_from_url(repo_transport.base), 'hg')
+            extract_tarball(local_name, hg_db_dir)
         return branch
 
     def pushBazaarBranch(self, bazaar_branch):
@@ -680,8 +687,11 @@
         """
         non_trivial = PullingImportWorker.pushBazaarBranch(
             self, bazaar_branch)
-        self.import_data_store.put(
-            self.db_file, bazaar_branch.repository._transport)
+        repo_base = bazaar_branch.repository._transport.base
+        hg_db_dir = os.path.join(local_path_from_url(repo_base), 'hg')
+        local_name = 'hg-cache.tar.gz'
+        create_tarball(hg_db_dir, local_name)
+        self.import_data_store.put(local_name)
         return non_trivial
 
 

=== modified file 'utilities/sourcedeps.conf'
--- utilities/sourcedeps.conf	2010-08-17 04:40:01 +0000
+++ utilities/sourcedeps.conf	2010-08-18 10:16:14 +0000
@@ -1,7 +1,12 @@
 bzr-builder lp:~launchpad-pqm/bzr-builder/trunk;revno=65
 bzr-git lp:~launchpad-pqm/bzr-git/devel;revno=257
+<<<<<<< TREE
 bzr-hg lp:~launchpad-pqm/bzr-hg/devel;revno=282
 bzr-loom lp:~launchpad-pqm/bzr-loom/trunk;revno=48
+=======
+bzr-hg lp:~launchpad-pqm/bzr-hg/devel;revno=282
+bzr-loom lp:~launchpad-pqm/bzr-loom/trunk;revno=47
+>>>>>>> MERGE-SOURCE
 bzr-svn lp:~launchpad-pqm/bzr-svn/devel;revno=2709
 cscvs lp:~launchpad-pqm/launchpad-cscvs/devel;revno=432
 dulwich lp:~launchpad-pqm/dulwich/devel;revno=423

=== modified file 'versions.cfg'
--- versions.cfg	2010-08-12 21:02:08 +0000
+++ versions.cfg	2010-08-18 10:16:14 +0000
@@ -41,7 +41,7 @@
 martian = 0.11
 mechanize = 0.1.11
 meliae = 0.2.0.final.0
-mercurial = 1.3.1
+mercurial = 1.6.2
 mocker = 0.10.1
 mozrunner = 1.3.4
 numpy = 1.3.0