Rev 3789: CommitBuilder.record_iter_changes handles reparented directories. in http://people.ubuntu.com/~robertc/baz2.0/commit-iterchanges

Robert Collins robertc at robertcollins.net
Tue Dec 2 01:28:28 GMT 2008


At http://people.ubuntu.com/~robertc/baz2.0/commit-iterchanges

------------------------------------------------------------
revno: 3789
revision-id: robertc at robertcollins.net-20081202012824-h11qtap88dp9kgso
parent: robertc at robertcollins.net-20081202012530-6sw4ttk7memrflv6
committer: Robert Collins <robertc at robertcollins.net>
branch nick: commit-iterchanges
timestamp: Tue 2008-12-02 12:28:24 +1100
message:
  CommitBuilder.record_iter_changes handles reparented directories.
modified:
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/per_repository/test_commit_builder.py test_commit_builder.py-20060606110838-76e3ra5slucqus81-1
=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-12-02 01:25:30 +0000
+++ b/bzrlib/repository.py	2008-12-02 01:28:24 +0000
@@ -608,7 +608,6 @@
                         import pdb;pdb.set_trace()
                     else:
                         raise AssertionError('unknown kind %r' % kind)
-                
                 entry.revision = modified_rev
             else:
                 entry = None

=== modified file 'bzrlib/tests/per_repository/test_commit_builder.py'
--- a/bzrlib/tests/per_repository/test_commit_builder.py	2008-12-02 01:25:30 +0000
+++ b/bzrlib/tests/per_repository/test_commit_builder.py	2008-12-02 01:28:24 +0000
@@ -575,13 +575,13 @@
             mini_commit=self.mini_commit_record_iter_changes)
 
     def _add_commit_reparent_check_changed(self, tree, name,
-        expect_fs_hash=False):
+        expect_fs_hash=False, mini_commit=None):
         self.build_tree(['newparent/'])
         tree.add(['newparent'])
         def reparent():
             tree.rename_one(name, 'newparent/new_' + name)
         self._add_commit_change_check_changed(tree, name, reparent,
-            expect_fs_hash=expect_fs_hash)
+            expect_fs_hash=expect_fs_hash, mini_commit=mini_commit)
 
     def test_last_modified_revision_after_reparent_dir_changes(self):
         # reparenting a dir changes the last modified.
@@ -589,6 +589,13 @@
         self.build_tree(['dir/'])
         self._add_commit_reparent_check_changed(tree, 'dir')
 
+    def test_last_modified_revision_after_reparent_dir_changes_ric(self):
+        # reparenting a dir changes the last modified.
+        tree = self.make_branch_and_tree('.')
+        self.build_tree(['dir/'])
+        self._add_commit_reparent_check_changed(tree, 'dir',
+            mini_commit=self.mini_commit_record_iter_changes)
+
     def test_last_modified_revision_after_reparent_file_changes(self):
         # reparenting a file changes the last modified.
         tree = self.make_branch_and_tree('.')




More information about the bazaar-commits mailing list