Rev 6581: Add a *failing* test that is directly testing update_basis_from_delta. in http://bazaar.launchpad.net/~jameinel/bzr/dirstate-invalid-delta-855155
John Arbash Meinel
john at arbash-meinel.com
Tue May 28 07:50:28 UTC 2013
At http://bazaar.launchpad.net/~jameinel/bzr/dirstate-invalid-delta-855155
------------------------------------------------------------
revno: 6581
revision-id: john at arbash-meinel.com-20130528075020-5u95xjgqiw3pjoja
parent: bsd at acm.org-20130527190827-fy1t6c5dzeguuwap
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate-invalid-delta-855155
timestamp: Tue 2013-05-28 08:50:20 +0100
message:
Add a *failing* test that is directly testing update_basis_from_delta.
Unfortunately, it still fails, so we need a bit more investigating.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_workingtree/test_parents.py'
--- a/bzrlib/tests/per_workingtree/test_parents.py 2012-09-19 07:58:27 +0000
+++ b/bzrlib/tests/per_workingtree/test_parents.py 2013-05-28 07:50:20 +0000
@@ -450,7 +450,7 @@
self.add_dir(new_shape, new_revid, 'root-id', None, '')
def assertTransitionFromBasisToShape(self, basis_shape, basis_revid,
- new_shape, new_revid, extra_parent=None):
+ new_shape, new_revid, extra_parent=None, set_current_inventory=True):
# set the inventory revision ids.
basis_shape.revision_id = basis_revid
new_shape.revision_id = new_revid
@@ -465,8 +465,9 @@
parents.append(extra_parent)
tree.set_parent_ids(parents)
self.fake_up_revision(tree, new_revid, new_shape)
- # give tree an inventory of new_shape
- tree._write_inventory(new_shape)
+ if set_current_inventory:
+ # give tree an inventory of new_shape
+ tree._write_inventory(new_shape)
self.assertDeltaApplicationResultsInExpectedBasis(tree, new_revid,
delta, new_shape)
# The tree should be internally consistent; while this is a moderately
@@ -764,3 +765,19 @@
self.add_link(new_shape, old_revid, 'link-id-C', 'dir-id-B', 'C', 'D')
self.assertTransitionFromBasisToShape(basis_shape, old_revid,
new_shape, new_revid)
+
+ def test_add_files_to_empty_directory(self):
+ old_revid = 'old-parent'
+ basis_shape = Inventory(root_id=None)
+ self.add_dir(basis_shape, old_revid, 'root-id', None, '')
+ self.add_dir(basis_shape, old_revid, 'dir-id-A', 'root-id', 'A')
+ new_revid = 'new-parent'
+ new_shape = Inventory(root_id=None)
+ self.add_new_root(new_shape, old_revid, new_revid)
+ self.add_dir(new_shape, old_revid, 'dir-id-A', 'root-id', 'A')
+ self.add_file(new_shape, new_revid, 'file-id-B', 'dir-id-A', 'B',
+ '1' * 32, 24)
+ self.add_file(new_shape, new_revid, 'file-id-C', 'dir-id-A', 'C',
+ '2' * 32, 24)
+ self.assertTransitionFromBasisToShape(basis_shape, old_revid,
+ new_shape, new_revid, set_current_inventory=False)
More information about the bazaar-commits
mailing list