Python API - can't open worknig tree/branch.

Bug #1910860 reported by Gustav Hartvigsson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Breezy
Fix Released
Undecided
Unassigned

Bug Description

Hello,
I'm trying to figure out how to open a working tree/branch using python, but when I try to follow the instructions in the documentation, I get an error.

Please consider the following code:

--- clip ---
#!/usr/bin/env python3

import breezy
from breezy import workingtree

breezy.initialize ()

wt = workingtree.WorkingTree.open ('/home/gego/svn/brz/') # where I store have a Breezy branch.
--- end clip ---

This code should work, but it dose not. instead what we get an error of type 'Breezy.errors.NotBranchError'.

Either the documentation is wrong or the API does not work.

breezy version: Breezy (brz) 3.1.0

// Gustav.

Related branches

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

which documentation are you following?

You also need to import either "breezy.bzr" or "breezy.git"

Revision history for this message
Gustav Hartvigsson (gustav-hartvigsson) wrote :

The documentation is available here:
https://www.breezy-vcs.org/doc/en/developers/integration.html

I was hoping for some kind of magic auto resolver for this, but that is probably a non-trivial thing to do.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

We could just add "import breezy.bzr" and "import breezy.git" to breezy.initialize(), that would address it.

Revision history for this message
Gustav Hartvigsson (gustav-hartvigsson) wrote :

Ah, I see, that did work. I'm a bit daft at times.

I'll amend the docs, and that should be enough for the moment.

// Gustav.

Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Fix Committed
Jelmer Vernooij (jelmer)
Changed in brz:
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