Rev 6220: (jelmer) Several more fixes for running the tests against foreign format in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
Patch Queue Manager
pqm at pqm.ubuntu.com
Mon Oct 17 10:02:24 UTC 2011
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 6220 [merge]
revision-id: pqm at pqm.ubuntu.com-20111017100224-hm1pav0lqgzv7y2s
parent: pqm at pqm.ubuntu.com-20111017091926-yt7sbjmw6rz7v3mj
parent: jelmer at samba.org-20111016142003-tj73pagohoxp37y3
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2011-10-17 10:02:24 +0000
message:
(jelmer) Several more fixes for running the tests against foreign format
plugins. (Jelmer Vernooij)
modified:
bzrlib/tests/per_branch/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
bzrlib/tests/per_branch/test_reconcile.py test_reconcile.py-20080429161555-qlmccuyeyt6pvho7-1
bzrlib/tests/per_interbranch/test_push.py test_push.py-20090330192649-pca31sb2ubbtcs15-1
bzrlib/tests/per_repository/test_check.py test_check.py-20070824124512-38g4d135gcqxo4zb-1
bzrlib/tests/per_repository_vf/test_check.py test_check.py-20110419124438-wxrtlhv70k7rxhg3-1
=== modified file 'bzrlib/tests/per_branch/test_branch.py'
--- a/bzrlib/tests/per_branch/test_branch.py 2011-10-14 13:56:45 +0000
+++ b/bzrlib/tests/per_branch/test_branch.py 2011-10-15 00:10:14 +0000
@@ -442,8 +442,11 @@
tree_a = self.make_branch_and_tree('a')
rev_id = tree_a.commit('put some content in the branch')
# open the branch via a readonly transport
- source_branch = _mod_branch.Branch.open(self.get_readonly_url(
- urlutils.basename(tree_a.branch.base)))
+ url = self.get_readonly_url(urlutils.basename(tree_a.branch.base))
+ t = transport.get_transport_from_url(url)
+ if not tree_a.branch.bzrdir._format.supports_transport(t):
+ raise tests.TestNotApplicable("format does not support transport")
+ source_branch = _mod_branch.Branch.open(url)
# sanity check that the test will be valid
self.assertRaises((errors.LockError, errors.TransportNotPossible),
source_branch.lock_write)
=== modified file 'bzrlib/tests/per_branch/test_reconcile.py'
--- a/bzrlib/tests/per_branch/test_reconcile.py 2011-10-05 12:45:41 +0000
+++ b/bzrlib/tests/per_branch/test_reconcile.py 2011-10-16 14:20:03 +0000
@@ -17,6 +17,7 @@
"""Tests for branch implementations - test reconcile() functionality"""
from bzrlib import errors, reconcile
+from bzrlib.branch import BzrBranch
from bzrlib.symbol_versioning import deprecated_in
from bzrlib.tests.per_branch import TestCaseWithBranch
from bzrlib.tests import TestNotApplicable
@@ -25,6 +26,8 @@
class TestBranchReconcile(TestCaseWithBranch):
def test_reconcile_fixes_invalid_revhistory(self):
+ if not isinstance(self.branch_format, BzrBranch):
+ raise TestNotApplicable("test only applies to bzr formats")
# Different formats have different ways of handling invalid revision
# histories, so the setup portion is customized
tree = self.make_branch_and_tree('test')
=== modified file 'bzrlib/tests/per_interbranch/test_push.py'
--- a/bzrlib/tests/per_interbranch/test_push.py 2011-10-05 12:45:41 +0000
+++ b/bzrlib/tests/per_interbranch/test_push.py 2011-10-15 01:09:01 +0000
@@ -369,7 +369,7 @@
target.add('')
rev1 = target.commit('rev 1')
target.unlock()
- sourcedir = target.bzrdir.clone(self.get_url('source'))
+ sourcedir = target.branch.bzrdir.clone(self.get_url('source'))
source = MemoryTree.create_on_branch(sourcedir.open_branch())
rev2 = source.commit('rev 2')
Branch.hooks.install_named_hook('post_push',
=== modified file 'bzrlib/tests/per_repository/test_check.py'
--- a/bzrlib/tests/per_repository/test_check.py 2011-09-09 12:16:16 +0000
+++ b/bzrlib/tests/per_repository/test_check.py 2011-10-15 00:12:58 +0000
@@ -23,22 +23,6 @@
from bzrlib.tests.per_repository import TestCaseWithRepository
-class TestNoSpuriousInconsistentAncestors(TestCaseWithRepository):
-
- def test_two_files_different_versions_no_inconsistencies_bug_165071(self):
- """Two files, with different versions can be clean."""
- tree = self.make_branch_and_tree('.')
- self.build_tree(['foo'])
- tree.smart_add(['.'])
- revid1 = tree.commit('1')
- self.build_tree(['bar'])
- tree.smart_add(['.'])
- revid2 = tree.commit('2')
- check_object = tree.branch.repository.check([revid1, revid2])
- check_object.report_results(verbose=True)
- self.assertContainsRe(self.get_log(), "0 unreferenced text versions")
-
-
class TestCleanRepository(TestCaseWithRepository):
def test_new_repo(self):
=== modified file 'bzrlib/tests/per_repository_vf/test_check.py'
--- a/bzrlib/tests/per_repository_vf/test_check.py 2011-05-26 21:02:47 +0000
+++ b/bzrlib/tests/per_repository_vf/test_check.py 2011-10-15 00:12:58 +0000
@@ -117,3 +117,24 @@
def branch_callback(self, refs):
self.callbacks.append(('branch', refs))
return self.branch_check(refs)
+
+
+class TestNoSpuriousInconsistentAncestors(TestCaseWithRepository):
+
+ scenarios = all_repository_vf_format_scenarios()
+
+ def test_two_files_different_versions_no_inconsistencies_bug_165071(self):
+ """Two files, with different versions can be clean."""
+ tree = self.make_branch_and_tree('.')
+ self.build_tree(['foo'])
+ tree.smart_add(['.'])
+ revid1 = tree.commit('1')
+ self.build_tree(['bar'])
+ tree.smart_add(['.'])
+ revid2 = tree.commit('2')
+ check_object = tree.branch.repository.check([revid1, revid2])
+ check_object.report_results(verbose=True)
+ self.assertContainsRe(self.get_log(), "0 unreferenced text versions")
+
+
+
More information about the bazaar-commits
mailing list