Rev 3793: CommitBuilder.record_iter_changes handles changed symlinks. in http://people.ubuntu.com/~robertc/baz2.0/commit-iterchanges

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


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

------------------------------------------------------------
revno: 3793
revision-id: robertc at robertcollins.net-20081202015850-izprtzmz0sxm0q19
parent: robertc at robertcollins.net-20081202013938-9h21myml6z0ku8th
committer: Robert Collins <robertc at robertcollins.net>
branch nick: commit-iterchanges
timestamp: Tue 2008-12-02 12:58:50 +1100
message:
  CommitBuilder.record_iter_changes handles changed symlinks.
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:39:38 +0000
+++ b/bzrlib/repository.py	2008-12-02 01:58:50 +0000
@@ -586,7 +586,9 @@
                         entry.text_sha1, entry.text_size = self._add_text_to_weave(
                             file_id, lines, heads, None)
                     elif kind == 'symlink':
-                        import pdb;pdb.set_trace()
+                        # Wants a path hint?
+                        entry.symlink_target = tree.get_symlink_target(file_id)
+                        self._add_text_to_weave(change[0], [], heads, None)
                     elif kind == 'directory':
                         # Nothing to set.
                         import pdb;pdb.set_trace()

=== modified file 'bzrlib/tests/per_repository/test_commit_builder.py'
--- a/bzrlib/tests/per_repository/test_commit_builder.py	2008-12-02 01:39:38 +0000
+++ b/bzrlib/tests/per_repository/test_commit_builder.py	2008-12-02 01:58:50 +0000
@@ -817,6 +817,17 @@
             os.symlink('newtarget', 'link')
         self._add_commit_change_check_changed(tree, 'link', change_link)
 
+    def test_last_modified_revision_after_content_link_changes_ric(self):
+        # changing a link changes the last modified.
+        self.requireFeature(tests.SymlinkFeature)
+        tree = self.make_branch_and_tree('.')
+        os.symlink('target', 'link')
+        def change_link():
+            os.unlink('link')
+            os.symlink('newtarget', 'link')
+        self._add_commit_change_check_changed(tree, 'link', change_link,
+            mini_commit=self.mini_commit_record_iter_changes)
+
     def _commit_sprout(self, tree, name):
         tree.add([name], [name + 'id'])
         rev_id = tree.commit('')




More information about the bazaar-commits mailing list