Merge lp:~mwhudson/launchpad/fewer-spurious-partial-code-imports-bug-532402 into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~mwhudson/launchpad/fewer-spurious-partial-code-imports-bug-532402
Merge into: lp:launchpad
Diff against target: 18 lines (+2/-1)
1 file modified
lib/lp/codehosting/codeimport/worker.py (+2/-1)
To merge this branch: bzr merge lp:~mwhudson/launchpad/fewer-spurious-partial-code-imports-bug-532402
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+21416@code.launchpad.net

Commit message

Capture the revision id used for determining whether all revisions were imported before running the import, to avoid semi-spurious reports of partial success.

Description of the change

Hi, see the linked bug for the explanation.

Do you think this needs a test?

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Umm, gut says we should have a test, but damn hard to get it right, so... my answer is no.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/codehosting/codeimport/worker.py'
2--- lib/lp/codehosting/codeimport/worker.py 2010-03-12 02:29:19 +0000
3+++ lib/lp/codehosting/codeimport/worker.py 2010-03-15 23:30:35 +0000
4@@ -548,12 +548,13 @@
5 else:
6 raise NotBranchError(self.source_details.url)
7 foreign_branch = format.open(transport).open_branch()
8+ foreign_branch_tip = foreign_branch.last_revision()
9 inter_branch = InterBranch.get(foreign_branch, bazaar_tree.branch)
10 pull_result = inter_branch.pull(
11 overwrite=True, **self.getExtraPullArgs())
12 self.pushBazaarWorkingTree(bazaar_tree)
13 last_imported_revison = bazaar_tree.branch.last_revision()
14- if last_imported_revison == foreign_branch.last_revision():
15+ if last_imported_revison == foreign_branch_tip:
16 if pull_result.old_revid != pull_result.new_revid:
17 return CodeImportWorkerExitCode.SUCCESS
18 else: