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
=== modified file 'lib/lp/codehosting/codeimport/worker.py'
--- lib/lp/codehosting/codeimport/worker.py 2010-03-12 02:29:19 +0000
+++ lib/lp/codehosting/codeimport/worker.py 2010-03-15 23:30:35 +0000
@@ -548,12 +548,13 @@
548 else:548 else:
549 raise NotBranchError(self.source_details.url)549 raise NotBranchError(self.source_details.url)
550 foreign_branch = format.open(transport).open_branch()550 foreign_branch = format.open(transport).open_branch()
551 foreign_branch_tip = foreign_branch.last_revision()
551 inter_branch = InterBranch.get(foreign_branch, bazaar_tree.branch)552 inter_branch = InterBranch.get(foreign_branch, bazaar_tree.branch)
552 pull_result = inter_branch.pull(553 pull_result = inter_branch.pull(
553 overwrite=True, **self.getExtraPullArgs())554 overwrite=True, **self.getExtraPullArgs())
554 self.pushBazaarWorkingTree(bazaar_tree)555 self.pushBazaarWorkingTree(bazaar_tree)
555 last_imported_revison = bazaar_tree.branch.last_revision()556 last_imported_revison = bazaar_tree.branch.last_revision()
556 if last_imported_revison == foreign_branch.last_revision():557 if last_imported_revison == foreign_branch_tip:
557 if pull_result.old_revid != pull_result.new_revid:558 if pull_result.old_revid != pull_result.new_revid:
558 return CodeImportWorkerExitCode.SUCCESS559 return CodeImportWorkerExitCode.SUCCESS
559 else:560 else: