~amanica/bzr/320119-log_exclusive_lower_bound

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_commit_builder.py

  • Committer: Johan Walles
  • Date: 2009-05-06 05:36:28 UTC
  • mfrom: (4332 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4343.
  • Revision ID: johan.walles@gmail.com-20090506053628-tbf1wz4a0m9t684g
MergeĀ fromĀ upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
735
735
            mini_commit=self.mini_commit_record_iter_changes)
736
736
 
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):
 
739
        if file_id is None:
 
740
            file_id = name + 'id'
 
741
        tree.add([name], [file_id])
 
742
        self._commit_change_check_changed(
 
743
            tree, name, file_id,
741
744
            changer, expect_fs_hash=expect_fs_hash, mini_commit=mini_commit)
742
745
 
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)
949
952
 
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):
 
955
        if file_id is None:
 
956
            file_id = link
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():
956
 
            os.unlink('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)
 
962
            os.unlink(link)
 
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,
 
967
            file_id=file_id)
 
968
 
 
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')
 
972
 
 
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',
 
977
 
 
978
            file_id=u'li\u1234nk'.encode('UTF-8'))
960
979
 
961
980
    def _commit_sprout(self, tree, name):
962
981
        tree.add([name], [name + 'id'])