Merge lp:~maxb/udd/lockcontention into lp:udd

Proposed by Max Bowsher on 2012-05-03
Status: Merged
Approved by: Martin Packman on 2012-05-03
Approved revision: 588
Merged at revision: 588
Proposed branch: lp:~maxb/udd/lockcontention
Merge into: lp:udd
Diff against target: 40 lines (+7/-7)
1 file modified
udd/scripts/import_package.py (+7/-7)
To merge this branch: bzr merge lp:~maxb/udd/lockcontention
Reviewer Review Type Date Requested Status
Martin Packman 2012-05-03 Approve on 2012-05-03
Review via email: mp+104500@code.launchpad.net

Description of the Change

Fixes:

80 packages failed with key bzrlib.errors.LockContention:<module>:main:_import_package:handle_collisions:clean_collision:check_same:run:_do_with_cleanups:_check_same:import_package:_import_normal_package:import_upstream:import_component_tarball:tag_version:set_tag:lock_write:lock_write:lock_write:wait_lock

    The importer appears to be contending with its own locks

    aqsis armagetronad aspell-sv at-spi billard-gl cgiemail cl-md5 fraqtive gcc-4.5 gpe-login gpe-what gtk2-engines-aurora gw-fonts-ttf heartbeat icoutils isight-firmware-tools joy2key jxplorer kepas libcontactsdb libcpuset libgcal libgnome libgnome-media-profiles libgpelaunch libgpeschedule libgpevtype libgpewidget libgphoto2 libhandoff liboop libprawn-ruby librpcsecgss libsoundgen libtext-charwidth-perl libtext-iconv-perl libtododb lp-solve m2crypto mpack nfs4-acl-tools phpunit pidentd plib-doc poppler-data python-cloudfiles qimageblitz rpcbind rss-glx rstatd samtools squeeze talloc tnftp torsocks tslib ttf-century-catalogue ttf-evertype-conakry ttf-kochi ttf-kochi-naga10 ttf-levien-museum ttf-levien-typoscript ttf-liberation ttf-paktype ttf-sazanami ttf-sil-zaghawa-beria ttf-unikurdweb tv-fonts u-boot-linaro wavpack webissues webissues-server wmaker-data xfce4-dict xfce4-mailwatch-plugin xfce4-mount-plugin xfce4-places-plugin xfprint4 xmms2 zope.browser

To post a comment you must log in.
Martin Packman (gz) wrote :

Changes look fine.

Is it expected that this create_branch helper also makes a tree as a side effect?

If not, that step could be done just before the DistributionBranch only.

If so, you may still want to only create a tree `if repo.make_working_trees()`, even though I imagine the importer just uses one style.

review: Approve
Max Bowsher (maxb) wrote :

Thanks for the review; merged. Even though this code *looks* like a library module, as it's udd.scripts.*, the code there is only used within that single file. As such, the only pressing concern for create_branch is that it does whatever the code in the same file wants it to. Indeed, as you say, the importer only wants these branches with trees, because it needs to import changes into them.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'udd/scripts/import_package.py'
2--- udd/scripts/import_package.py 2012-04-21 23:52:23 +0000
3+++ udd/scripts/import_package.py 2012-05-03 08:25:22 +0000
4@@ -263,17 +263,18 @@
5 format = bzrdir.format_registry.make_bzrdir("2a")
6 to_transport.ensure_base()
7 new_branch = bzrdir.BzrDir.create_branch_convenience(
8- to_transport.base, format=format,
9+ to_transport.base, force_new_tree=False, format=format,
10 possible_transports=[to_transport])
11 new_branch.set_append_revisions_only(False)
12- return new_branch
13+ new_wt = new_branch.bzrdir.create_workingtree(from_branch=new_branch)
14+ return new_branch, new_wt
15
16 def create_updates_branch(updates_branch_path, importp, bstore,
17 possible_transports=None):
18 br_from = bstore.get_branch(importp,
19 possible_transports=possible_transports)
20 if br_from is None:
21- updates_branch = create_branch(updates_branch_path)
22+ updates_branch, unused_wt = create_branch(updates_branch_path)
23 return updates_branch
24 to_transport = transport.get_transport(updates_branch_path+"-origin")
25 # Branch the branch in to the updates area as -origin for safe keeping
26@@ -857,11 +858,10 @@
27 op.add_cleanup(lp_tree.lock_read().unlock)
28 testdir = tempfile.mkdtemp(dir=temp_dir)
29 op.add_cleanup(shutil.rmtree, testdir)
30- test_branch = create_branch(os.path.join(testdir, name))
31- test_up_branch = create_branch(os.path.join(testdir, "%s-upstream" % name))
32+ test_branch, test_wt = create_branch(os.path.join(testdir, name))
33+ test_up_branch, test_up_wt = create_branch(os.path.join(testdir, "%s-upstream" % name))
34 test_db = import_dsc.DistributionBranch(
35- test_branch, test_up_branch, tree=test_branch.bzrdir.open_workingtree(),
36- pristine_upstream_tree=test_up_branch.bzrdir.open_workingtree())
37+ test_branch, test_up_branch, test_wt, test_up_wt)
38 test_db_set = import_dsc.DistributionBranchSet()
39 test_db_set.add_branch(db)
40 test_db_set.add_branch(test_db)

Subscribers

People subscribed via source and target branches