Rev 6518: WorkingTreeFormat6._matchingbzrdir wasn't actually creating a matching bzrdir. in http://bazaar.launchpad.net/~jameinel/bzr/2.5-remote-wt-tests-1046697

John Arbash Meinel john at arbash-meinel.com
Thu Sep 6 10:27:41 UTC 2012


At http://bazaar.launchpad.net/~jameinel/bzr/2.5-remote-wt-tests-1046697

------------------------------------------------------------
revno: 6518
revision-id: john at arbash-meinel.com-20120906102716-0ctvttu7s9cjohl3
parent: john at arbash-meinel.com-20120906095253-xj3e8tbrs81ss2e7
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.5-remote-wt-tests-1046697
timestamp: Thu 2012-09-06 14:27:16 +0400
message:
  WorkingTreeFormat6._matchingbzrdir wasn't actually creating a matching bzrdir.
  
  The issue is it was just inheriting the value from WTFormat4, so stuff like views don't work.
  This may not fix everything, but it helps.
  Also, update one skip-the-test that really meant 'this permutation is not applicable'.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_workingtree/test_views.py'
--- a/bzrlib/tests/per_workingtree/test_views.py	2009-07-10 07:14:02 +0000
+++ b/bzrlib/tests/per_workingtree/test_views.py	2012-09-06 10:27:16 +0000
@@ -22,7 +22,7 @@
 
 
 from bzrlib import views, errors
-from bzrlib.tests import TestSkipped
+from bzrlib.tests import TestNotApplicable, TestSkipped
 from bzrlib.workingtree import WorkingTree
 
 from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
@@ -39,7 +39,7 @@
             raise TestSkipped("format %s doesn't declare whether it "
                 "supports views, assuming not" % fmt)
         if not f():
-            raise TestSkipped("format %s doesn't support views" % fmt)
+            raise TestNotApplicable("format %s doesn't support views" % fmt)
         TestCaseWithWorkingTree.setUp(self)
 
     def test_views_initially_empty(self):

=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py	2012-01-06 14:09:04 +0000
+++ b/bzrlib/workingtree_4.py	2012-09-06 10:27:16 +0000
@@ -1677,6 +1677,10 @@
     def supports_views(self):
         return True
 
+    def _get_matchingbzrdir(self):
+        """Overrideable method to get a bzrdir for testing."""
+        return bzrdir.format_registry.make_bzrdir('2a')
+
 
 class DirStateRevisionTree(InventoryTree):
     """A revision tree pulling the inventory from a dirstate.



More information about the bazaar-commits mailing list