← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:fix-make-dummy-hosted-branches into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:fix-make-dummy-hosted-branches into launchpad:master.

Commit message:
Fix make-dummy-hosted-branches regression

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/451687

I broke this untested utility script a couple of months ago when converting `Branch` to Storm.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:fix-make-dummy-hosted-branches into launchpad:master.
diff --git a/utilities/make-dummy-hosted-branches b/utilities/make-dummy-hosted-branches
index 2b40eb8..866213e 100755
--- a/utilities/make-dummy-hosted-branches
+++ b/utilities/make-dummy-hosted-branches
@@ -29,7 +29,7 @@ from lp.code.model.branch import Branch
 from lp.codehosting.tests.helpers import create_branch_with_one_revision
 from lp.codehosting.vfs import branch_id_to_path
 from lp.services.config import config
-from lp.services.database.sqlbase import sqlvalues
+from lp.services.database.interfaces import IStore
 from lp.services.scripts import execute_zcml_for_scripts
 
 
@@ -51,8 +51,8 @@ def main(argv):
         shutil.rmtree(config.codehosting.mirrored_branches_root)
     execute_zcml_for_scripts()
     try:
-        branches = Branch.select(
-            "Branch.branch_type = %s" % sqlvalues(BranchType.HOSTED)
+        branches = IStore(Branch).find(
+            Branch, Branch.branch_type == BranchType.HOSTED
         )
         for branch in branches:
             make_bazaar_branch_and_tree(branch)