It seems simpler to just use .open_branch() in ControlDir.get_branches() rather than list_branches(), which doesn't necessarily return the branch with the name None as first element.
I wonder if we should deprecate list_branches now that we have get_branches? Is there any reason to still use list_branches?
75 + def test_get_branches(self):
76 + repo = self.make_repository('branch-1')
77 + target_branch = repo.bzrdir.create_branch(name='foo')
78 + reference = branch.BranchReferenceFormat().initialize(
79 + repo.bzrdir, target_branch=target_branch)
^^ These tests are not bzr-specific, they can be run against e.g. svn as well, where BranchReferenceFormat won't work. To test references, we should instead add (another) test in bzrlib/tests/per_bzrdir.
Thanks, that looks reasonable.
It seems simpler to just use .open_branch() in ControlDir. get_branches( ) rather than list_branches(), which doesn't necessarily return the branch with the name None as first element.
I wonder if we should deprecate list_branches now that we have get_branches? Is there any reason to still use list_branches?
75 + def test_get_ branches( self): repository( 'branch- 1') create_ branch( name='foo' ) BranchReference Format( ).initialize( branch= target_ branch) Format won't work. To test references, we should instead add (another) test in bzrlib/ tests/per_ bzrdir.
76 + repo = self.make_
77 + target_branch = repo.bzrdir.
78 + reference = branch.
79 + repo.bzrdir, target_
^^ These tests are not bzr-specific, they can be run against e.g. svn as well, where BranchReference
Cheers,
Jelmer