Rev 6449: (jelmer) Use 'development-subtree' format rather than in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
Patch Queue Manager
pqm at pqm.ubuntu.com
Fri Jan 27 20:19:14 UTC 2012
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 6449 [merge]
revision-id: pqm at pqm.ubuntu.com-20120127201913-dod5friqxdsfru9w
parent: pqm at pqm.ubuntu.com-20120127152356-p0jildfhjjauuu6j
parent: jelmer at samba.org-20120127184120-osvbbiwijy58hsah
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2012-01-27 20:19:13 +0000
message:
(jelmer) Use 'development-subtree' format rather than
'dirstate-with-subtree' in tests. (Jelmer Vernooij)
modified:
bzrlib/chk_serializer.py chk_serializer.py-20081002064345-2tofdfj2eqq01h4b-1
bzrlib/tests/blackbox/test_join.py test_join.py-20060928210902-95dkqa6boh8uq92b-1
bzrlib/tests/per_repository/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
bzrlib/tests/test_bzrdir.py test_bzrdir.py-20060131065654-deba40eef51cf220
bzrlib/tests/test_dirstate.py test_dirstate.py-20060728012006-d6mvoihjb3je9peu-2
bzrlib/tests/test_merge.py testmerge.py-20050905070950-c1b5aa49ff911024
bzrlib/tests/test_smart.py test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
bzrlib/tests/test_subsume.py test_subsume.py-20060927040024-tsvh4pchajoayymg-1
bzrlib/tests/test_testament.py testtestament.py-20051011100429-5df1657310caa929
bzrlib/tests/test_transform.py test_transaction.py-20060105172520-b3ffb3946550e6c4
bzrlib/tests/test_workingtree_4.py test_workingtree_4.p-20070223025758-531n3tznl3zacv2o-1
bzrlib/tests/test_xml.py test_xml.py-20050905091053-80b45588931a9b35
bzrlib/workingtree_4.py workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
bzrlib/xml7.py xml7.py-20061029182747-d5tiiny21bvrd2jj-1
bzrlib/xml_serializer.py xml.py-20050309040759-57d51586fdec365d
=== modified file 'bzrlib/chk_serializer.py'
--- a/bzrlib/chk_serializer.py 2011-12-19 13:23:58 +0000
+++ b/bzrlib/chk_serializer.py 2012-01-27 16:27:09 +0000
@@ -147,7 +147,7 @@
format_num = '9'
revision_format_num = None
support_altered_by_hack = False
- supported_kinds = set(['file', 'directory', 'symlink'])
+ supported_kinds = set(['file', 'directory', 'symlink', 'tree-reference'])
def __init__(self, node_size, search_key_name):
self.maximum_size = node_size
=== modified file 'bzrlib/tests/blackbox/test_join.py'
--- a/bzrlib/tests/blackbox/test_join.py 2011-06-14 02:21:41 +0000
+++ b/bzrlib/tests/blackbox/test_join.py 2012-01-27 16:27:26 +0000
@@ -30,7 +30,7 @@
def make_trees(self):
base_tree = self.make_branch_and_tree('tree',
- format='dirstate-with-subtree')
+ format='development-subtree')
base_tree.commit('empty commit')
self.build_tree(['tree/subtree/', 'tree/subtree/file1'])
sub_tree = self.make_branch_and_tree('tree/subtree')
=== modified file 'bzrlib/tests/per_repository/test_fetch.py'
--- a/bzrlib/tests/per_repository/test_fetch.py 2012-01-24 15:42:02 +0000
+++ b/bzrlib/tests/per_repository/test_fetch.py 2012-01-27 20:19:13 +0000
@@ -67,7 +67,7 @@
tree_a.add('foo', 'file1')
tree_a.commit('rev1', rev_id='rev1')
# create a knit-3 based format to fetch into
- f = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')
+ f = bzrdir.format_registry.make_bzrdir('development-subtree')
try:
format = tree_a.branch.repository._format
format.check_conversion_target(f.repository_format)
=== modified file 'bzrlib/tests/per_repository/test_repository.py'
--- a/bzrlib/tests/per_repository/test_repository.py 2011-12-07 14:16:12 +0000
+++ b/bzrlib/tests/per_repository/test_repository.py 2012-01-27 16:27:26 +0000
@@ -343,7 +343,7 @@
# This gives metadir branches something they can convert to.
# it would be nice to have a 'latest' vs 'default' concept.
format = controldir.format_registry.make_bzrdir(
- 'dirstate-with-subtree')
+ 'development-subtree')
upgrade.upgrade(repo.bzrdir.root_transport.base, format=format)
except errors.UpToDateFormat:
# this is in the most current format already.
=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py 2012-01-02 10:24:02 +0000
+++ b/bzrlib/tests/test_bzrdir.py 2012-01-27 16:27:26 +0000
@@ -824,9 +824,9 @@
def test_sprout_recursive(self):
tree = self.make_branch_and_tree('tree1',
- format='dirstate-with-subtree')
+ format='development-subtree')
sub_tree = self.make_branch_and_tree('tree1/subtree',
- format='dirstate-with-subtree')
+ format='development-subtree')
sub_tree.set_root_id('subtree-root')
tree.add_reference(sub_tree)
self.build_tree(['tree1/subtree/file'])
@@ -849,9 +849,9 @@
def test_sprout_recursive_treeless(self):
tree = self.make_branch_and_tree('tree1',
- format='dirstate-with-subtree')
+ format='development-subtree')
sub_tree = self.make_branch_and_tree('tree1/subtree',
- format='dirstate-with-subtree')
+ format='development-subtree')
tree.add_reference(sub_tree)
self.build_tree(['tree1/subtree/file'])
sub_tree.add('file')
@@ -863,7 +863,7 @@
# FIXME: subtree/.bzr is left here which allows the test to pass (or
# fail :-( ) -- vila 20100909
repo = self.make_repository('repo', shared=True,
- format='dirstate-with-subtree')
+ format='development-subtree')
repo.set_make_working_trees(False)
# FIXME: we just deleted the workingtree and now we want to use it ????
# At a minimum, we should use tree.branch below (but this fails too
@@ -1021,7 +1021,7 @@
otherdir = bzrdir.format_registry.make_bzrdir('knit')
self.assertEqual(otherdir, mydir)
self.assertFalse(otherdir != mydir)
- otherdir2 = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree')
+ otherdir2 = bzrdir.format_registry.make_bzrdir('development-subtree')
self.assertNotEqual(otherdir2, mydir)
self.assertFalse(otherdir2 == mydir)
=== modified file 'bzrlib/tests/test_dirstate.py'
--- a/bzrlib/tests/test_dirstate.py 2012-01-24 15:42:02 +0000
+++ b/bzrlib/tests/test_dirstate.py 2012-01-27 20:19:13 +0000
@@ -2210,9 +2210,9 @@
class TestDirstateTreeReference(TestCaseWithDirState):
def test_reference_revision_is_none(self):
- tree = self.make_branch_and_tree('tree', format='dirstate-with-subtree')
+ tree = self.make_branch_and_tree('tree', format='development-subtree')
subtree = self.make_branch_and_tree('tree/subtree',
- format='dirstate-with-subtree')
+ format='development-subtree')
subtree.set_root_id('subtree')
tree.add_reference(subtree)
tree.add('subtree')
=== modified file 'bzrlib/tests/test_merge.py'
--- a/bzrlib/tests/test_merge.py 2012-01-05 13:02:31 +0000
+++ b/bzrlib/tests/test_merge.py 2012-01-27 16:27:26 +0000
@@ -227,9 +227,9 @@
def test_nested_merge(self):
tree = self.make_branch_and_tree('tree',
- format='dirstate-with-subtree')
+ format='development-subtree')
sub_tree = self.make_branch_and_tree('tree/sub-tree',
- format='dirstate-with-subtree')
+ format='development-subtree')
sub_tree.set_root_id('sub-tree-root')
self.build_tree_contents([('tree/sub-tree/file', 'text1')])
sub_tree.add('file')
@@ -2634,11 +2634,11 @@
# Tested with a real WT, because BranchBuilder/MemoryTree don't handle
# 'tree-reference'
wt = self.make_branch_and_tree('tree',
- format='dirstate-with-subtree')
+ format='development-subtree')
wt.lock_write()
self.addCleanup(wt.unlock)
sub_tree = self.make_branch_and_tree('tree/sub-tree',
- format='dirstate-with-subtree')
+ format='development-subtree')
wt.set_root_id('a-root-id')
sub_tree.set_root_id('sub-tree-root')
self.build_tree_contents([('tree/sub-tree/file', 'text1')])
@@ -2669,11 +2669,11 @@
# Tested with a real WT, because BranchBuilder/MemoryTree don't handle
# 'tree-reference'
wt = self.make_branch_and_tree('tree',
- format='dirstate-with-subtree')
+ format='development-subtree')
wt.lock_write()
self.addCleanup(wt.unlock)
sub_tree = self.make_branch_and_tree('tree/sub',
- format='dirstate-with-subtree')
+ format='development-subtree')
wt.set_root_id('a-root-id')
sub_tree.set_root_id('sub-tree-root')
self.build_tree_contents([('tree/sub/file', 'text1')])
@@ -2708,11 +2708,11 @@
# Tested with a real WT, because BranchBuilder/MemoryTree don't handle
# 'tree-reference'
wt = self.make_branch_and_tree('tree',
- format='dirstate-with-subtree')
+ format='development-subtree')
wt.lock_write()
self.addCleanup(wt.unlock)
sub_tree = self.make_branch_and_tree('tree/sub',
- format='dirstate-with-subtree')
+ format='development-subtree')
wt.set_root_id('a-root-id')
sub_tree.set_root_id('sub-tree-root')
self.build_tree_contents([('tree/sub/file', 'text1')])
@@ -2751,11 +2751,11 @@
# Tested with a real WT, because BranchBuilder/MemoryTree don't handle
# 'tree-reference'
wt = self.make_branch_and_tree('tree',
- format='dirstate-with-subtree')
+ format='development-subtree')
wt.lock_write()
self.addCleanup(wt.unlock)
sub_tree = self.make_branch_and_tree('tree/sub',
- format='dirstate-with-subtree')
+ format='development-subtree')
wt.set_root_id('a-root-id')
sub_tree.set_root_id('sub-tree-root')
self.build_tree_contents([('tree/sub/file', 'text1')])
=== modified file 'bzrlib/tests/test_smart.py'
--- a/bzrlib/tests/test_smart.py 2012-01-19 19:18:47 +0000
+++ b/bzrlib/tests/test_smart.py 2012-01-27 20:19:13 +0000
@@ -419,7 +419,7 @@
backing = self.get_transport()
request = self._request_class(backing)
result = self._make_repository_and_result(
- format='dirstate-with-subtree')
+ format='development-subtree')
# check the test will be valid
self.assertEqual('yes', result.args[2])
self.assertEqual('yes', result.args[3])
@@ -430,9 +430,9 @@
backing = self.get_transport()
request = self._request_class(backing)
result = self._make_repository_and_result(
- format='dirstate-with-subtree')
+ format='development-subtree')
# check the test will be valid
- self.assertEqual('no', result.args[4])
+ self.assertEqual('yes', result.args[4])
self.assertEqual(result, request.execute(''))
=== modified file 'bzrlib/tests/test_subsume.py'
--- a/bzrlib/tests/test_subsume.py 2011-05-13 12:51:05 +0000
+++ b/bzrlib/tests/test_subsume.py 2012-01-27 16:27:26 +0000
@@ -21,7 +21,7 @@
def make_branch_and_tree(self, relpath, format=None):
if format is None:
- format = 'dirstate-with-subtree'
+ format = 'development-subtree'
return tests.TestCaseWithTransport.make_branch_and_tree(self, relpath,
format)
@@ -34,7 +34,7 @@
base_tree.add('file', 'file-id')
base_tree.commit('first commit', rev_id='tree-1')
sub_tree = self.make_branch_and_tree('tree/subtree',
- format='dirstate-with-subtree')
+ format='development-subtree')
if same_root is True:
sub_tree.set_root_id(base_tree.get_root_id())
sub_tree.add('file2', 'file2-id')
=== modified file 'bzrlib/tests/test_testament.py'
--- a/bzrlib/tests/test_testament.py 2011-06-14 01:26:41 +0000
+++ b/bzrlib/tests/test_testament.py 2012-01-27 16:27:26 +0000
@@ -37,7 +37,7 @@
def setUp(self):
super(TestamentSetup, self).setUp()
- self.wt = self.make_branch_and_tree('.', format='dirstate-with-subtree')
+ self.wt = self.make_branch_and_tree('.', format='development-subtree')
self.wt.set_root_id('TREE_ROT')
b = self.b = self.wt.branch
b.nick = "test branch"
=== modified file 'bzrlib/tests/test_transform.py'
--- a/bzrlib/tests/test_transform.py 2012-01-24 15:42:02 +0000
+++ b/bzrlib/tests/test_transform.py 2012-01-27 20:19:13 +0000
@@ -88,7 +88,7 @@
def setUp(self):
super(TestTreeTransform, self).setUp()
- self.wt = self.make_branch_and_tree('.', format='dirstate-with-subtree')
+ self.wt = self.make_branch_and_tree('.', format='development-subtree')
os.chdir('..')
def get_transform(self):
@@ -1898,9 +1898,9 @@
def test_build_with_references(self):
tree = self.make_branch_and_tree('source',
- format='dirstate-with-subtree')
+ format='development-subtree')
subtree = self.make_branch_and_tree('source/subtree',
- format='dirstate-with-subtree')
+ format='development-subtree')
tree.add_reference(subtree)
tree.commit('a revision')
tree.branch.create_checkout('target')
=== modified file 'bzrlib/tests/test_workingtree_4.py'
--- a/bzrlib/tests/test_workingtree_4.py 2011-12-05 17:57:53 +0000
+++ b/bzrlib/tests/test_workingtree_4.py 2012-01-27 16:27:26 +0000
@@ -516,7 +516,7 @@
def test_unique_root_id_per_tree(self):
# each time you initialize a new tree, it gets a different root id
- format_name = 'dirstate-with-subtree'
+ format_name = 'development-subtree'
tree1 = self.make_branch_and_tree('tree1',
format=format_name)
tree2 = self.make_branch_and_tree('tree2',
@@ -552,12 +552,12 @@
tree = self.make_branch_and_tree('tag', format='dirstate-tags')
self.assertEqual(inventory.ROOT_ID, tree.get_root_id())
tree = self.make_branch_and_tree('subtree',
- format='dirstate-with-subtree')
+ format='development-subtree')
self.assertNotEqual(inventory.ROOT_ID, tree.get_root_id())
def test_non_subtree_with_nested_trees(self):
# prior to dirstate, st/diff/commit ignored nested trees.
- # dirstate, as opposed to dirstate-with-subtree, should
+ # dirstate, as opposed to development-subtree, should
# behave the same way.
tree = self.make_branch_and_tree('.', format='dirstate')
self.assertFalse(tree.supports_tree_reference())
@@ -603,8 +603,8 @@
tree.unlock()
def test_with_subtree_supports_tree_references(self):
- # dirstate-with-subtree should support tree-references.
- tree = self.make_branch_and_tree('.', format='dirstate-with-subtree')
+ # development-subtree should support tree-references.
+ tree = self.make_branch_and_tree('.', format='development-subtree')
self.assertTrue(tree.supports_tree_reference())
# having checked this is on, the tree interface, and intertree
# interface tests, will proceed to test the subtree support of
=== modified file 'bzrlib/tests/test_xml.py'
--- a/bzrlib/tests/test_xml.py 2011-12-12 12:11:51 +0000
+++ b/bzrlib/tests/test_xml.py 2012-01-27 18:41:15 +0000
@@ -414,12 +414,6 @@
self.assertEqual('tree-root-321', inv2['nested-id'].parent_id)
self.assertEqual('rev-outer', inv2['nested-id'].revision)
self.assertEqual('rev-inner', inv2['nested-id'].reference_revision)
- self.assertRaises(errors.UnsupportedInventoryKind,
- s_v6.read_inventory_from_string,
- txt.replace('format="7"', 'format="6"'))
- self.assertRaises(errors.UnsupportedInventoryKind,
- s_v5.read_inventory_from_string,
- txt.replace('format="7"', 'format="5"'))
def test_roundtrip_inventory_v8(self):
inv = self.get_sample_inventory()
=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py 2012-01-27 15:23:56 +0000
+++ b/bzrlib/workingtree_4.py 2012-01-27 20:19:13 +0000
@@ -1599,7 +1599,7 @@
"""Overrideable method to get a bzrdir for testing."""
# please test against something that will let us do tree references
return bzrdir.format_registry.make_bzrdir(
- 'dirstate-with-subtree')
+ 'development-subtree')
_matchingbzrdir = property(__get_matchingbzrdir)
=== modified file 'bzrlib/xml7.py'
--- a/bzrlib/xml7.py 2011-12-18 15:28:38 +0000
+++ b/bzrlib/xml7.py 2012-01-27 18:41:20 +0000
@@ -30,20 +30,5 @@
supported_kinds = set(['file', 'directory', 'symlink', 'tree-reference'])
format_num = '7'
- def _unpack_entry(self, elt, entry_cache=None, return_from_cache=False):
- kind = elt.tag
- if not kind in self.supported_kinds:
- raise AssertionError('unsupported entry kind %s' % kind)
- if kind == 'tree-reference':
- file_id = elt.attrib['file_id']
- name = elt.attrib['name']
- parent_id = elt.attrib['parent_id']
- revision = elt.get('revision')
- reference_revision = elt.get('reference_revision')
- return inventory.TreeReference(file_id, name, parent_id, revision,
- reference_revision)
- else:
- return xml6.Serializer_v6._unpack_entry(self, elt,
- entry_cache=entry_cache, return_from_cache=return_from_cache)
serializer_v7 = Serializer_v7()
=== modified file 'bzrlib/xml_serializer.py'
--- a/bzrlib/xml_serializer.py 2012-01-05 12:16:05 +0000
+++ b/bzrlib/xml_serializer.py 2012-01-27 16:27:09 +0000
@@ -309,6 +309,14 @@
elt_get('name'),
parent_id)
ie.symlink_target = elt_get('symlink_target')
+ elif kind == 'tree-reference':
+ file_id = elt.attrib['file_id']
+ name = elt.attrib['name']
+ parent_id = elt.attrib['parent_id']
+ revision = elt.get('revision')
+ reference_revision = elt.get('reference_revision')
+ ie = inventory.TreeReference(file_id, name, parent_id, revision,
+ reference_revision)
else:
raise errors.UnsupportedInventoryKind(kind)
ie.revision = revision
More information about the bazaar-commits
mailing list