Creating a branch reference without opening

David Allouche ddaa at canonical.com
Wed Sep 12 14:30:56 BST 2007


Hello,

In the Launchpad test suite, I want to create branch references that
point to locations that cannot be opened (e.g. file://local/branch and
http://example.com/branch). However the bzrlib API does not seem to
provide a way to create a branch reference without opening it.

Those tests are feature tests, so they should not use mocks and need to
operate on branch references on disk. Since they test input validation
that is done using bzrdir.get_branch_reference before opening the
branch, so they do not need to open the branch references, and they
should fail if they do try to open it.

The code to create branch references is
bzrdir.branch.BranchReferenceFormat.initialize, it ends with a
self.open that calls BzrDir.open(location) on the referenced location.

I filed a bug on this issue:
https://bugs.edge.launchpad.net/bzr/+bug/139109
No API to create a branch reference without opening it

If you have a non-hackish solution that does not involve modifying
bzrlib, I would like to hear about it.

-- 
                                                            -- ddaa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070912/1745780c/attachment.pgp 


More information about the bazaar mailing list