~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transform.py

Merge serialize-transform into prepare-shelf

Show diffs side-by-side

added added

removed removed

Lines of Context:
2014
2014
        resolve_conflicts(tt)
2015
2015
 
2016
2016
 
 
2017
A_ENTRY = ('a-id', ('a', 'a'), True, (True, True),
 
2018
                  ('TREE_ROOT', 'TREE_ROOT'), ('a', 'a'), ('file', 'file'),
 
2019
                  (False, False))
 
2020
ROOT_ENTRY = ('TREE_ROOT', ('', ''), False, (True, True), (None, None),
 
2021
              ('', ''), ('directory', 'directory'), (False, None))
 
2022
 
 
2023
 
2017
2024
class TestTransformPreview(tests.TestCaseWithTransport):
2018
2025
 
2019
2026
    def create_tree(self):
2091
2098
                          (False, False))],
2092
2099
                          list(preview_tree.iter_changes(revision_tree)))
2093
2100
 
2094
 
    def test_include_unchanged_value_error(self):
 
2101
    def test_include_unchanged_succeeds(self):
2095
2102
        revision_tree, preview_tree = self.get_tree_and_preview_tree()
2096
 
        e = self.assertRaises(ValueError, preview_tree.iter_changes,
2097
 
                              revision_tree, include_unchanged=True)
2098
 
        self.assertEqual('include_unchanged is not supported', str(e))
 
2103
        changes = preview_tree.iter_changes(revision_tree,
 
2104
                                            include_unchanged=True)
 
2105
        root = revision_tree.inventory.root.file_id
 
2106
 
 
2107
        self.assertEqual([ROOT_ENTRY, A_ENTRY], list(changes))
2099
2108
 
2100
2109
    def test_specific_files(self):
2101
2110
        revision_tree, preview_tree = self.get_tree_and_preview_tree()
2102
 
        e = self.assertRaises(ValueError, preview_tree.iter_changes,
2103
 
                              revision_tree, specific_files=['pete'])
2104
 
        self.assertEqual('specific_files is not supported', str(e))
 
2111
        changes = preview_tree.iter_changes(revision_tree,
 
2112
                                            specific_files=[''])
 
2113
        self.assertEqual([ROOT_ENTRY, A_ENTRY], list(changes))
2105
2114
 
2106
 
    def test_want_unversioned_value_error(self):
 
2115
    def test_want_unversioned(self):
2107
2116
        revision_tree, preview_tree = self.get_tree_and_preview_tree()
2108
 
        e = self.assertRaises(ValueError, preview_tree.iter_changes,
2109
 
                              revision_tree, want_unversioned=True)
2110
 
        self.assertEqual('want_unversioned is not supported', str(e))
 
2117
        changes = preview_tree.iter_changes(revision_tree,
 
2118
                                            want_unversioned=True)
 
2119
        self.assertEqual([ROOT_ENTRY, A_ENTRY], list(changes))
2111
2120
 
2112
2121
    def test_ignore_extra_trees_no_specific_files(self):
2113
2122
        # extra_trees is harmless without specific_files, so we'll silently