Code review comment for lp:~nmb/bzr/893470-dedupe-list-branches

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

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):
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.

Cheers,

Jelmer

« Back to merge proposal