[MERGE] Improve tests for the behaviour of Tree.iter_changes for missing paths that are only present in one tree, and fix found bugs. (Robert Collins)

Andrew Bennetts andrew at canonical.com
Wed Aug 13 08:14:24 BST 2008


Robert Collins wrote:
> This makes the behaviour of missing files that are only in one tree
> consistent for all our InterTree implementations.
[...]

bb:tweak

> +    def test_only_in_source_and_missing(self):
> +        tree1 = self.make_branch_and_tree('tree1')
> +        tree2 = self.make_to_branch_and_tree('tree2')
> +        tree2.set_root_id(tree1.get_root_id())
> +        self.build_tree(['tree1/file'])
> +        tree1.add(['file'], ['file-id'])
> +        os.unlink('tree1/file')
> +        tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
> +        root_id = tree1.path2id('')
> +        if not tree1.path2id('file'):
> +            # The locked test trees conversion could not preserve the missing
> +            # file status. This is normal (e.g. InterDirstateTree falls back
> +            # to InterTree if the basis is not a DirstateRevisionTree, and
> +            # revision trees cannot have missing files. 
> +            return

Hmm, wouldn't raising TestNotApplicable be more appropriate than just returning?

-Andrew.




More information about the bazaar mailing list