Rev 3385: Stacking and knits don't play nice for annotation yet. in http://people.ubuntu.com/~robertc/baz2.0/shallow-branch

Robert Collins robertc at robertcollins.net
Mon Jun 23 03:35:22 BST 2008


At http://people.ubuntu.com/~robertc/baz2.0/shallow-branch

------------------------------------------------------------
revno: 3385
revision-id: robertc at robertcollins.net-20080623023518-1zae3rsj8h0npnt1
parent: robertc at robertcollins.net-20080623011320-c5952pwuvi9m6hpp
committer: Robert Collins <robertc at robertcollins.net>
branch nick: stacking-knits
timestamp: Mon 2008-06-23 12:35:18 +1000
message:
  Stacking and knits don't play nice for annotation yet.
modified:
  bzrlib/tests/test_knit.py      test_knit.py-20051212171302-95d4c00dd5f11f2b
=== modified file 'bzrlib/tests/test_knit.py'
--- a/bzrlib/tests/test_knit.py	2008-06-23 01:13:20 +0000
+++ b/bzrlib/tests/test_knit.py	2008-06-23 02:35:18 +0000
@@ -51,6 +51,7 @@
 from bzrlib.symbol_versioning import one_four
 from bzrlib.tests import (
     Feature,
+    KnownFailure,
     TestCase,
     TestCaseWithMemoryTransport,
     TestCaseWithTransport,
@@ -1397,7 +1398,24 @@
         pass
 
     def test_annotate(self):
-        pass
+        # annotations from the test knit are answered without asking the basis
+        basis, test = self.get_basis_and_test_knit()
+        key = ('foo',)
+        key_basis = ('bar',)
+        key_missing = ('missing',)
+        test.add_lines(key, (), ['foo\n'])
+        details = test.annotate(key)
+        self.assertEqual([(key, 'foo\n')], details)
+        self.assertEqual([], basis.calls)
+        # But texts that are not in the test knit are looked for in the basis
+        # directly.
+        basis.add_lines(key_basis, (), ['foo\n', 'bar\n'])
+        basis.calls = []
+        self.assertRaises(RevisionNotPresent, test.annotate, key_basis)
+        raise KnownFailure("Annotation on stacked knits currently fails.")
+        details = test.annotate(key_basis)
+        self.assertEqual([(key_basis, 'foo\n'), (key_basis, 'bar\n')], details)
+        self.assertEqual([("annotate", key_basis)], basis.calls)
 
     def test_check(self):
         # check() must not check the fallback files, its none of its business.




More information about the bazaar-commits mailing list