Rev 3447: Move the test to a branch_implementations test in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/missing
John Arbash Meinel
john at arbash-meinel.com
Wed May 21 16:46:08 BST 2008
At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/missing
------------------------------------------------------------
revno: 3447
revision-id: john at arbash-meinel.com-20080521154556-2d5q6xqlailg6d1j
parent: john at arbash-meinel.com-20080521154247-sqpkv9um9grku9e1
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: missing
timestamp: Wed 2008-05-21 10:45:56 -0500
message:
Move the test to a branch_implementations test
modified:
bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
bzrlib/tests/test_branch.py test_branch.py-20060116013032-97819aa07b8ab3b5
-------------- next part --------------
=== modified file 'bzrlib/tests/branch_implementations/test_branch.py'
--- a/bzrlib/tests/branch_implementations/test_branch.py 2008-05-02 07:31:24 +0000
+++ b/bzrlib/tests/branch_implementations/test_branch.py 2008-05-21 15:45:56 +0000
@@ -40,6 +40,7 @@
)
from bzrlib.osutils import getcwd
import bzrlib.revision
+from bzrlib.symbol_versioning import deprecated_in
from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
from bzrlib.tests.branch_implementations import TestCaseWithBranch
from bzrlib.tests.http_server import HttpServer
@@ -304,6 +305,36 @@
self.assertEqual(repo.get_signature_text('A'),
d2.open_repository().get_signature_text('A'))
+ def test_missing_revisions(self):
+ t1 = self.make_branch_and_tree('b1')
+ rev1 = t1.commit('one')
+ t2 = t1.bzrdir.sprout('b2').open_workingtree()
+ rev2 = t1.commit('two')
+ rev3 = t1.commit('three')
+
+ self.assertEqual([rev2, rev3],
+ self.applyDeprecated(deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch))
+
+ self.assertEqual([],
+ self.applyDeprecated(deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch, stop_revision=1))
+ self.assertEqual([rev2],
+ self.applyDeprecated(deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch, stop_revision=2))
+ self.assertEqual([rev2, rev3],
+ self.applyDeprecated(deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch, stop_revision=3))
+
+ self.assertRaises(errors.NoSuchRevision,
+ self.applyDeprecated, deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch, stop_revision=4)
+
+ rev4 = t2.commit('four')
+ self.assertRaises(errors.DivergedBranches,
+ self.applyDeprecated, deprecated_in((1, 6, 0)),
+ t2.branch.missing_revisions, t1.branch)
+
def test_nicks(self):
"""Test explicit and implicit branch nicknames.
=== modified file 'bzrlib/tests/test_branch.py'
--- a/bzrlib/tests/test_branch.py 2008-05-21 15:42:47 +0000
+++ b/bzrlib/tests/test_branch.py 2008-05-21 15:45:56 +0000
@@ -50,7 +50,6 @@
UnsupportedFormatError,
)
-from bzrlib.symbol_versioning import deprecated_in
from bzrlib.tests import TestCase, TestCaseWithTransport
from bzrlib.transport import get_transport
@@ -130,38 +129,6 @@
# TODO RBC 20051029 test getting a push location from a branch in a
# recursive section - that is, it appends the branch name.
- def test_missing_revisions(self):
- t1 = self.make_branch_and_tree('b1', format='knit')
- rev1 = t1.commit('one')
- t2 = t1.bzrdir.sprout('b2').open_workingtree()
- rev2 = t1.commit('two')
- rev3 = t1.commit('three')
-
- self.assertEqual([rev2, rev3],
- self.applyDeprecated(deprecated_in((1, 6, 0)),
- t2.branch.missing_revisions, t1.branch))
-
- self.assertEqual([],
- self.applyDeprecated(deprecated_in((1, 6, 0)),
- t2.branch.missing_revisions, t1.branch, stop_revision=1))
- self.assertEqual([rev2],
- self.applyDeprecated(deprecated_in((1, 6, 0)),
- t2.branch.missing_revisions, t1.branch, stop_revision=2))
- self.assertEqual([rev2, rev3],
- self.applyDeprecated(deprecated_in((1, 6, 0)),
- t2.branch.missing_revisions, t1.branch, stop_revision=3))
-
- self.assertRaises(errors.NoSuchRevision,
- self.applyDeprecated, deprecated_in((1, 6, 0)),
- t2.branch.missing_revisions, t1.branch, stop_revision=4)
-
- rev4 = t2.commit('four')
- self.assertRaises(errors.DivergedBranches,
- self.applyDeprecated, deprecated_in((1, 6, 0)),
- t2.branch.missing_revisions, t1.branch)
-
-
-
class SampleBranchFormat(BranchFormat):
"""A sample format
More information about the bazaar-commits
mailing list