HPSS: Other test changes

Andrew Bennetts andrew at canonical.com
Wed Apr 18 12:15:23 BST 2007


Robert Collins wrote:
> On Wed, 2007-04-18 at 15:38 +1000, Andrew Bennetts wrote:
> > > > -
> > tree.bzrdir.open_repository().copy_content_into(shared_repo)
> > > > +
> > tree.branch.bzrdir.open_repository().copy_content_into(shared_repo)
> > > 
> > > ^- This looks rather bogus no matter which form it was using. Why
> > not just
> > > 
> > > tree.branch.repository.copy_content_into()?
> >
> > No idea.  Changed.
> 
> IIRC it was to ensure we had a completely clean repository object. I
> think putting it back and adding a comment might be nice.

Can you remember a reason for that?  It would have helped if the tests had
comments explaining why in the first place...

I just looked at test_clone_bzrdir_repository_branch_both_under_shared, and
after spending a solid ten minutes figuring out exactly what it actually does
and writing the comments it should have had in the first place, I've found:

  * the name of the test doesn't actually correspond to what it does,
  * parts of the test still don't make sense to me, and I suspect it's because
    it's not doing what the author thought it was, and
  * it's entirely reasonable for this test to use "tree.branch.repository"
    rather than "tree.branch.bzrdir.open_repository()" as far as I can tell.

I can do a similar audit of the other tests in this file, but it'll take a
little while.  Are you sure there's a reason to worry here?

-Andrew.




More information about the bazaar mailing list