[MERGE] Even faster branching
James Westby
jw+debian at jameswestby.net
Wed Dec 19 21:38:27 GMT 2007
On (19/12/07 13:21), Aaron Bentley wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
Hi Aaron,
This patch sounds great. I have a question.
> + def test_build_tree_accelerator_tree(self):
> + source = self.make_branch_and_tree('source')
> + self.build_tree_contents([('source/file1', 'A')])
> + self.build_tree_contents([('source/file2', 'B')])
> + source.add(['file1', 'file2'], ['file1-id', 'file2-id'])
> + source.commit('commit files')
> + self.build_tree_contents([('source/file2', 'C')])
> + calls = []
> + real_source_get_file = source.get_file
> + def get_file(file_id, path=None):
> + calls.append(file_id)
> + return real_source_get_file(file_id, path)
> + source.get_file = get_file
> + source.lock_read()
> + self.addCleanup(source.unlock)
> + target = self.make_branch_and_tree('target')
> + build_tree(source.basis_tree(), target, source)
> + self.assertEqual(['file1-id'], calls)
> +
> + def test_build_tree_accelerator_tree_missing_file(self):
> + source = self.make_branch_and_tree('source')
> + self.build_tree_contents([('source/file1', 'A')])
> + self.build_tree_contents([('source/file2', 'B')])
> + source.add(['file1', 'file2'])
> + source.commit('commit files')
> + os.unlink('source/file1')
> + source.remove(['file2'])
> + target = self.make_branch_and_tree('target')
> + build_tree(source.basis_tree(), target, source)
> +
It appears there is no test with a tree being created that will contain
a file that has been modified in the source tree, is that correct? I
would think that it would be important to have a test for that situation
that ensures that the contents of the file are correct in the new tree.
Also there are no tests for symlinks and directories. I would think they
would be important for regression purposes. Symlink issues seem to have
regressed a couple of times.
Thanks,
James
--
James Westby -- GPG Key ID: B577FE13 -- http://jameswestby.net/
seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256
More information about the bazaar
mailing list