Rev 3462: Add a test for wants_revision_history in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/revno_no_history
John Arbash Meinel
john at arbash-meinel.com
Fri May 30 02:03:35 BST 2008
At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/revno_no_history
------------------------------------------------------------
revno: 3462
revision-id: john at arbash-meinel.com-20080530010318-z02yqa2mz048jwb4
parent: john at arbash-meinel.com-20080530004224-1zq421goscvxm6o1
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: revno_no_history
timestamp: Thu 2008-05-29 20:03:18 -0500
message:
Add a test for wants_revision_history
modified:
bzrlib/tests/test_revisionspec.py testrevisionnamespaces.py-20050711050225-8b4af89e6b1efe84
-------------- next part --------------
=== modified file 'bzrlib/tests/test_revisionspec.py'
--- a/bzrlib/tests/test_revisionspec.py 2008-03-29 21:16:20 +0000
+++ b/bzrlib/tests/test_revisionspec.py 2008-05-30 01:03:18 +0000
@@ -90,6 +90,35 @@
spec.as_revision_id(self.tree.branch))
+class RevisionSpecMatchOnTrap(RevisionSpec):
+
+ def _match_on(self, branch, revs):
+ self.last_call = (branch, revs)
+ return super(RevisionSpecMatchOnTrap, self)._match_on(branch, revs)
+
+
+class TestRevisionSpecBase(TestRevisionSpec):
+
+ def test_wants_revision_history(self):
+ # If wants_revision_history = True, then _match_on should get the
+ # branch revision history
+ spec = RevisionSpecMatchOnTrap('foo', _internal=True)
+ spec.in_history(self.tree.branch)
+
+ self.assertEqual((self.tree.branch, ['r1' ,'r2']),
+ spec.last_call)
+
+ def test_wants_no_revision_history(self):
+ # If wants_revision_history = False, then _match_on should get None for
+ # the branch revision history
+ spec = RevisionSpecMatchOnTrap('foo', _internal=True)
+ spec.wants_revision_history = False
+ spec.in_history(self.tree.branch)
+
+ self.assertEqual((self.tree.branch, None), spec.last_call)
+
+
+
class TestOddRevisionSpec(TestRevisionSpec):
"""Test things that aren't normally thought of as revision specs"""
More information about the bazaar-commits
mailing list