Merge lp:~abentley/launchpad/fix-qa-ready into lp:launchpad

Proposed by Aaron Bentley on 2010-03-15
Status: Merged
Approved by: Graham Binns on 2010-03-16
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~abentley/launchpad/fix-qa-ready
Merge into: lp:launchpad
Diff against target: 12 lines (+1/-1)
1 file modified
utilities/qa-ready (+1/-1)
To merge this branch: bzr merge lp:~abentley/launchpad/fix-qa-ready
Reviewer Review Type Date Requested Status
Graham Binns (community) code 2010-03-15 Approve on 2010-03-16
Review via email: mp+21392@code.launchpad.net

Description of the Change

= Summary =
Stop displaying false data when fetching is required.

== Proposed fix ==
When two branches have copies of the same repository,
bzrlib.repository.Repository.get_graph will avoid data from one of the copies.
But it's possible for the two copies to hold different data if one was
read-locked and then the other was fetched into.

If the older copy is selected, then the results will be wrong. If the newer
copy is selected, the results will be right. This branch ensures newer copy
will be used in this situation, by swapping their relationship in the
get_graph.

== Pre-implementation notes ==
None

== Implementation details ==
None

== Tests ==
None

== Demo and Q/A ==
Create a shared repository with a target branch to run qa-ready against, and a local
mirror of stable/db-devel. The target must have been merged into stable/db-devel and be deployed, but the local mirror must not contain that merge revision. Configure ~/.bazaar/locations.conf to use this mirror. Run qa-ready. It should report that the branch has been deployed.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  utilities/qa-ready

To post a comment you must log in.
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utilities/qa-ready'
2--- utilities/qa-ready 2010-03-03 15:15:44 +0000
3+++ utilities/qa-ready 2010-03-15 19:05:42 +0000
4@@ -74,7 +74,7 @@
5 deployed_rev_id)
6 finally:
7 remote.unlock()
8- graph = local_branch.repository.get_graph(deployed_branch.repository)
9+ graph = deployed_branch.repository.get_graph(local_branch.repository)
10 return graph.is_ancestor(local_branch.last_revision(), deployed_rev_id)
11 finally:
12 deployed_branch.unlock()