Rev 2868: Review feedback. in http://people.ubuntu.com/~robertc/baz2.0/wt.update_to_one_parent_via_delta
Robert Collins
robertc at robertcollins.net
Wed Oct 3 03:10:18 BST 2007
At http://people.ubuntu.com/~robertc/baz2.0/wt.update_to_one_parent_via_delta
------------------------------------------------------------
revno: 2868
revision-id: robertc at robertcollins.net-20071003021009-daffidrziwpcu9hx
parent: robertc at robertcollins.net-20071003015047-l3ji2gzmq31f0z0e
committer: Robert Collins <robertc at robertcollins.net>
branch nick: wt.update_to_one_parent_via_delta
timestamp: Wed 2007-10-03 12:10:09 +1000
message:
Review feedback.
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/inventory.py inventory.py-20050309040759-6648b84ca2005b37
bzrlib/mutabletree.py mutabletree.py-20060906023413-4wlkalbdpsxi2r4y-2
bzrlib/tests/workingtree_implementations/test_inv.py test_inv.py-20070311221604-ighlq8tbn5xq0kuo-1
bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
=== modified file 'NEWS'
--- a/NEWS 2007-10-02 06:13:56 +0000
+++ b/NEWS 2007-10-03 02:10:09 +0000
@@ -153,6 +153,10 @@
shorthand for deriving from BzrError and setting internal_error = True.
(Robert Collins)
+ * New method ``bzrlib.mutabletree.update_to_one_parent_via_delta`` for
+ moving the state of a parent tree to a new version via a delta rather than
+ a complete replacement tree. (Robert Collins)
+
* New method ``bzrlib.osutils.minimum_path_selection`` useful for removing
duplication from user input, when a user mentions both a path and an item
contained within that path. (Robert Collins)
=== modified file 'bzrlib/inventory.py'
--- a/bzrlib/inventory.py 2007-09-27 09:04:26 +0000
+++ b/bzrlib/inventory.py 2007-10-03 02:10:09 +0000
@@ -976,12 +976,12 @@
etc.
The children attribute of new_entry is ignored. This is because
- apply_inventory_delta preserves children automatically across
- alterations to the parent of the children, and cases where the
- parent id of a child is changing require the child to be passed in
- as a separate change regardless. E.g. in the recursive deletion of
- a directory - the directories children must be included in the
- delta, or the final inventory will be invalid.
+ this method preserves children automatically across alterations to
+ the parent of the children, and cases where the parent id of a
+ child is changing require the child to be passed in as a separate
+ change regardless. E.g. in the recursive deletion of a directory -
+ the directory's children must be included in the delta, or the
+ final inventory will be invalid.
"""
children = {}
# Remove all affected items which were in the original inventory,
=== modified file 'bzrlib/mutabletree.py'
--- a/bzrlib/mutabletree.py 2007-09-27 09:04:26 +0000
+++ b/bzrlib/mutabletree.py 2007-10-03 02:10:09 +0000
@@ -435,8 +435,8 @@
"""Update the parents of this tree after a commit.
This gives the tree one parent, with revision id new_revid. The
- inventory delta delta is applied ot the current basis tree to generate
- the inventory for the parent new_revid, and all other parent trees are
+ inventory delta is applied ot the current basis tree to generate the
+ inventory for the parent new_revid, and all other parent trees are
discarded.
:param new_revid: The new revision id for the trees parent.
=== modified file 'bzrlib/tests/workingtree_implementations/test_inv.py'
--- a/bzrlib/tests/workingtree_implementations/test_inv.py 2007-09-27 09:04:26 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_inv.py 2007-10-03 02:10:09 +0000
@@ -224,7 +224,7 @@
wt.add(['dir', 'dir/child', 'other'],
['dir-id', 'child-id', 'other-id'])
# this delta moves dir-id to dir2 and reparents
- # child-id wto a parent of other-id
+ # child-id to a parent of other-id
wt.apply_inventory_delta([('dir', 'dir2', 'dir-id',
inventory.InventoryDirectory('dir-id', 'dir2', root_id)),
('dir/child', 'other/child', 'child-id',
=== modified file 'bzrlib/tests/workingtree_implementations/test_parents.py'
--- a/bzrlib/tests/workingtree_implementations/test_parents.py 2007-09-27 09:04:26 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_parents.py 2007-10-03 02:10:09 +0000
@@ -440,7 +440,7 @@
right_shape = Inventory(root_id=None)
self.add_dir(right_shape, left_revid, 'root-id', None, '')
self.add_link(right_shape, right_revid, 'link-id', 'root-id', 'link',
- 'left-target')
+ 'some-target')
self.add_dir(right_shape, right_revid, 'subdir-id', 'root-id', 'dir')
self.add_file(right_shape, right_revid, 'file-id', 'subdir-id', 'file',
'2' * 32, 24)
@@ -453,7 +453,7 @@
new_shape, new_revid, right_revid)
def test_parent_id_changed(self):
- # test that when the only change to a entry is its parent id changing
+ # test that when the only change to an entry is its parent id changing
# that it is handled correctly (that is it keeps the same path)
old_revid = 'old-parent'
basis_shape = Inventory(root_id=None)
@@ -469,8 +469,8 @@
new_shape, new_revid)
def test_name_changed(self):
- # test that when the only change to a entry is its name changing
- # that it is handled correctly (that is it keeps the same parent id)
+ # test that when the only change to an entry is its name changing that
+ # it is handled correctly (that is it keeps the same parent id)
old_revid = 'old-parent'
basis_shape = Inventory(root_id=None)
self.add_dir(basis_shape, old_revid, 'root-id', None, '')
More information about the bazaar-commits
mailing list