735
735
mini_commit=self.mini_commit_record_iter_changes)
737
737
def _add_commit_change_check_changed(self, tree, name, changer,
738
expect_fs_hash=False, mini_commit=None):
739
tree.add([name], [name + 'id'])
740
self._commit_change_check_changed(tree, name, name + 'id',
738
expect_fs_hash=False, mini_commit=None, file_id=None):
740
file_id = name + 'id'
741
tree.add([name], [file_id])
742
self._commit_change_check_changed(
741
744
changer, expect_fs_hash=expect_fs_hash, mini_commit=mini_commit)
743
746
def _commit_change_check_changed(self, tree, name, file_id, changer,
947
950
os.symlink('newtarget', 'link')
948
951
self._add_commit_change_check_changed(tree, 'link', change_link)
950
def test_last_modified_revision_after_content_link_changes_ric(self):
953
def _test_last_mod_rev_after_content_link_changes_ric(
954
self, link, target, newtarget, file_id=None):
951
957
# changing a link changes the last modified.
952
958
self.requireFeature(tests.SymlinkFeature)
953
959
tree = self.make_branch_and_tree('.')
954
os.symlink('target', 'link')
960
os.symlink(target, link)
955
961
def change_link():
957
os.symlink('newtarget', 'link')
958
self._add_commit_change_check_changed(tree, 'link', change_link,
959
mini_commit=self.mini_commit_record_iter_changes)
963
os.symlink(newtarget, link)
964
self._add_commit_change_check_changed(
965
tree, link, change_link,
966
mini_commit=self.mini_commit_record_iter_changes,
969
def test_last_modified_rev_after_content_link_changes_ric(self):
970
self._test_last_mod_rev_after_content_link_changes_ric(
971
'link', 'target', 'newtarget')
973
def test_last_modified_rev_after_content_unicode_link_changes_ric(self):
974
self.requireFeature(tests.UnicodeFilenameFeature)
975
self._test_last_mod_rev_after_content_link_changes_ric(
976
u'li\u1234nk', u'targ\N{Euro Sign}t', u'n\N{Euro Sign}wtarget',
978
file_id=u'li\u1234nk'.encode('UTF-8'))
961
980
def _commit_sprout(self, tree, name):
962
981
tree.add([name], [name + 'id'])