Export-to-branch script fails on lp-hosted protocol

Bug #399415 reported by Jeroen T. Vermeulen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Jeroen T. Vermeulen

Bug Description

The translations-export-to-branch.py script fails while trying to access a branch.

The message is: Failure: Unsupported protocol for url "lp-hosted:///~jtv/+junk/test"

Full output: https://pastebin.canonical.com/19744/

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Notes from call with mwhudson:
 * This may be the first LP script that writes to branches. As if DirectBranchCommit wasn't breaking enough new ground...
 * lp-hosted is acessible only from the code-hosting server, so that's where the script must run.
 * The script may need to call requestMirror (sp?) after writing to a hosted branch.
 * Need to set up a server created by get_multi_server(write_hosted=True). Tear it down after use.
 * There may be problems with stacked branches, which will become a lot more popular with bzr 2.0.
 * Instead of BzrBranch.open(self.db_branch.getPullURL()), say BranchMirrorer(HostedBranchPolicy(), None, None).open(self.db_branch.getPullURL())
 * Various parts of the codehosting stuff we use here need refactoring.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

HostedBranchPolicy is internal to the puller worker, so currently I can't get at it. Also, the BranchMirrorer and its policy classes are in the puller, when here I'm trying to use them for very different purposes.

So I propose to build a BranchMirrorer factory that takes a BranchType (plus BranchMirrorer constructor arguments) and returns a BranchMirrorer with the right policy. The policy classes can live inside the factory's module. It's to be based on PullerWorker._checkerForBranchType but also let me do what I need here.

jml says to build it in branchfs.py, and reexport it from vfs/__init__.py.

Changed in rosetta:
status: New → In Progress
Revision history for this message
Данило Шеган (danilo) wrote :

Landed in devel/8939.

Changed in rosetta:
status: In Progress → Fix Committed
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Merged into db-devel 8289. Not on staging yet.

Changed in rosetta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.