[MERGE][Bug #50582] Pushing into a local no-trees repo no longer creates a working tree

John Arbash Meinel john at arbash-meinel.com
Wed Nov 14 14:46:25 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel Watkins wrote:
> BzrDir.clone seemed to be under the impression that being able to
> create a working tree meant it should go ahead and do so.  The attached
> should disabuse it of this notion by checking that the target repo
> wants it to make a working tree before it does so.
> 
> I'm not entirely convinced that my test is ideal, but I wasn't sure how
> to improve it so I thought I'd get it looked at in review.
> 
> 

I think this part:
+        try:
+            repo = self.make_repository('repo', shared=True)
+        except errors.IncompatibleFormat:
+            return

Should be:

+        try:
+            repo = self.make_repository('repo', shared=True)
+        except errors.IncompatibleFormat:
+            raise tests.TestNotApplicable('must support shared repositories')



I would also say that the end of the test should be:

+        # We should have a branch, but no working tree
+        a_dir = tree.bzrdir.clone(self.get_url('repo/a'))
+        a_dir.open_branch()
+        self.assertRaises(errors.NoWorkingTree, a_dir.open_workingtree())


Also, I guess there was a way for result.find_repository() to not find a repo.
(hence your result_repo = None path). It would be good to have a test for that.

Otherwise it looks good.

BB:tweak

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHOwpBJdeBCYSNAAMRAkIgAJ9xtQ1x3nyeJeBVnqXvqbDWHj1wTwCgr7lo
vpNjGc4bB7hqlzO4+M+Rofs=
=wyrg
-----END PGP SIGNATURE-----



More information about the bazaar mailing list