Code review comment for lp:~mwhudson/launchpad/code-import-paranoia

Revision history for this message
Tim Penhey (thumper) wrote :

  review approve

> It's a shame that only the LocalGitBzrDirFormat format is exercised in the
> tests whereas only the RemoteGitBzrDirFormat will be used in production.
> Not sure what we can do about that though.

Yeah, that's a bit of a question that needs an answer...

> === modified file 'lib/lp/codehosting/codeimport/worker.py'
> --- lib/lp/codehosting/codeimport/worker.py 2009-11-19 04:22:10 +0000
> +++ lib/lp/codehosting/codeimport/worker.py 2009-12-01 03:20:33 +0000
> @@ -504,8 +509,16 @@
> bzrlib.ui.ui_factory = LoggingUIFactory(
> writer=lambda m: self._logger.info('%s', m))
> try:
> - bazaar_tree.branch.pull(
> - Branch.open(self.pull_url), overwrite=True)
> + transport = get_transport(self.pull_url)
> + for format_class in self.format_classes:
> + try:
> + format = format_class.probe_transport(transport)
> + except NotBranchError:
> + pass
> + else:
> + raise NotBranchError(self.pull_url)
> + foreign_branch = format.open(transport).open_branch()
> + bazaar_tree.branch.pull(foreign_branch, overwrite=True)
> finally:
> bzrlib.ui.ui_factory = saved_factory
> self.pushBazaarWorkingTree(bazaar_tree)

This hunk looks wrong. The else clause is hanging wrongly.

review: Approve

« Back to merge proposal