Cherry-pick bzr 0.9 commit