606
619
remote_branch_tip = remote_branch.last_revision()
607
620
inter_branch = InterBranch.get(remote_branch, bazaar_branch)
608
621
self._logger.info("Importing branch.")
609
inter_branch.fetch(limit=self.getRevisionLimit())
610
if bazaar_branch.repository.has_revision(remote_branch_tip):
611
pull_result = inter_branch.pull(overwrite=True)
612
if pull_result.old_revid != pull_result.new_revid:
613
result = CodeImportWorkerExitCode.SUCCESS
615
result = CodeImportWorkerExitCode.SUCCESS_NOCHANGE
617
result = CodeImportWorkerExitCode.SUCCESS_PARTIAL
623
inter_branch.fetch(limit=self.getRevisionLimit())
624
if bazaar_branch.repository.has_revision(remote_branch_tip):
625
pull_result = inter_branch.pull(overwrite=True)
626
if pull_result.old_revid != pull_result.new_revid:
627
result = CodeImportWorkerExitCode.SUCCESS
629
result = CodeImportWorkerExitCode.SUCCESS_NOCHANGE
631
result = CodeImportWorkerExitCode.SUCCESS_PARTIAL
633
if e.__class__ in self.unsupported_feature_exceptions:
635
"Unable to import branch because of limitations in Bazaar.")
636
self._logger.info(str(e))
637
result = CodeImportWorkerExitCode.FAILURE_UNSUPPORTED_FEATURE
638
elif e.__class__ in self.invalid_branch_exceptions:
639
self._logger.info("Branch invalid: %s", e(str))
640
result = CodeImportWorkerExitCode.FAILURE_INVALID
618
643
self._logger.info("Pushing local import branch to central store.")
619
644
self.pushBazaarBranch(bazaar_branch)
620
645
self._logger.info("Job complete.")