/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/per_intertree/test_compare.py

  • Committer: Jelmer Vernooij
  • Date: 2017-11-19 18:35:20 UTC
  • mfrom: (6809.4.27 swap-arguments)
  • Revision ID: jelmer@jelmer.uk-20171119183520-fmw89uw30e0tbhwz
Merge lp:~jelmer/brz/swap-arguments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
789
789
        tree1.mkdir('changing', 'parent-id')
790
790
        tree1.mkdir('changing/unchanging', 'mid-id')
791
791
        tree1.add(['changing/unchanging/file'], ['file-id'], ['file'])
792
 
        tree1.put_file_bytes_non_atomic('file-id', 'a file')
 
792
        tree1.put_file_bytes_non_atomic(
 
793
                'changing/unchanging/file', 'a file', file_id='file-id')
793
794
        tree2 = self.make_to_branch_and_tree('2')
794
795
        tree2.set_root_id(tree1.get_root_id())
795
796
        tree2.mkdir('changed', 'parent-id')
796
797
        tree2.mkdir('changed/unchanging', 'mid-id')
797
798
        tree2.add(['changed/unchanging/file'], ['file-id'], ['file'])
798
 
        tree2.put_file_bytes_non_atomic('file-id', 'changed content')
 
799
        tree2.put_file_bytes_non_atomic(
 
800
                'changed/unchanging/file', 'changed content', file_id='file-id')
799
801
        tree1, tree2 = self.mutable_trees_to_test_trees(self, tree1, tree2)
800
802
        # parent-id has changed, as has file-id
801
803
        root_id = tree1.path2id('')
814
816
        tree1.mkdir('changed', 'parent-id')
815
817
        tree1.mkdir('changed/unchanging', 'mid-id')
816
818
        tree1.add(['changed/unchanging/file'], ['file-id'], ['file'])
817
 
        tree1.put_file_bytes_non_atomic('file-id', 'a file')
 
819
        tree1.put_file_bytes_non_atomic(
 
820
                'changed/unchanging/file', 'a file',
 
821
                'file-id')
818
822
        tree2 = self.make_to_branch_and_tree('2')
819
823
        tree2.set_root_id('new')
820
824
        tree2.mkdir('changed', 'parent-id')
821
825
        tree2.mkdir('changed/unchanging', 'mid-id')
822
826
        tree2.add(['changed/unchanging/file'], ['file-id'], ['file'])
823
 
        tree2.put_file_bytes_non_atomic('file-id', 'changed content')
 
827
        tree2.put_file_bytes_non_atomic(
 
828
                'changed/unchanging/file', 'changed content', file_id='file-id')
824
829
        tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
825
830
        # old is gone, new is added, parent-id has changed(reparented), as has
826
831
        # file-id(content)
866
871
        # it must be emitted as a change.
867
872
        tree1 = self.make_branch_and_tree('1')
868
873
        tree1.add(['a'], ['a-id'], ['file'])
869
 
        tree1.put_file_bytes_non_atomic('a-id', 'a file')
 
874
        tree1.put_file_bytes_non_atomic('a', 'a file')
870
875
        tree2 = self.make_to_branch_and_tree('2')
871
876
        tree2.set_root_id(tree1.get_root_id())
872
877
        tree2.mkdir('a', 'b-id')
873
878
        tree2.add(['a/c'], ['c-id'], ['file'])
874
 
        tree2.put_file_bytes_non_atomic('c-id', 'another file')
 
879
        tree2.put_file_bytes_non_atomic('a/c', 'another file')
875
880
        tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
876
881
        # a-id is gone, b-id and c-id are added.
877
882
        self.assertEqualIterChanges(
892
897
        tree2.mkdir('a', 'a-new-id')
893
898
        tree2.mkdir('a/reparented', 'reparented-id')
894
899
        tree2.add(['b'], ['a-old-id'], ['file'])
895
 
        tree2.put_file_bytes_non_atomic('a-old-id', '')
 
900
        tree2.put_file_bytes_non_atomic('b', '')
896
901
        tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
897
902
        # a-old-id is kind-changed, a-new-id is added, reparented-id is renamed,
898
903
        # deleted-id is gone