321
321
tree2 = self.make_to_branch_and_tree('tree2')
322
322
tree2.set_root_id(tree1.get_root_id())
323
323
self.build_tree(['tree2/file', 'tree2/dir/'])
325
os.symlink('target', 'tree2/link')
326
links_supported = True
328
# links_supported = False
325
os.symlink('target', 'tree2/link')
326
links_supported = True
328
links_supported = False
329
329
tree1, tree2 = self.mutable_trees_to_test_trees(tree1, tree2)
330
330
d = self.intertree_class(tree1, tree2).compare(want_unversioned=True)
331
331
self.assertEqual([], d.added)
333
333
self.assertEqual([], d.removed)
334
334
self.assertEqual([], d.renamed)
335
335
self.assertEqual([], d.unchanged)
336
self.assertEqual([(u'dir', None, 'directory'), (u'file', None, 'file'),
337
(u'link', None, 'symlink')], d.unversioned)
336
expected_unversioned = [(u'dir', None, 'directory'),
337
(u'file', None, 'file')]
339
expected_unversioned.append((u'link', None, 'symlink'))
340
self.assertEqual(expected_unversioned, d.unversioned)
340
343
class TestIterChanges(TestCaseWithTwoTrees):
776
779
tree2 = self.make_to_branch_and_tree('tree2')
777
780
tree2.set_root_id(tree1.get_root_id())
778
781
self.build_tree(['tree2/file', 'tree2/dir/'])
780
os.symlink('target', 'tree2/link')
781
links_supported = True
783
# links_supported = False
783
os.symlink('target', 'tree2/link')
784
links_supported = True
786
links_supported = False
784
787
tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
786
789
self.unversioned(tree2, 'file'),
796
799
tree1 = self.make_branch_and_tree('tree1')
797
800
tree2 = self.make_to_branch_and_tree('tree2')
798
801
self.build_tree(['tree2/file', 'tree2/dir/'])
800
os.symlink('target', 'tree2/link')
801
links_supported = True
803
# links_supported = False
803
os.symlink('target', 'tree2/link')
804
links_supported = True
806
links_supported = False
804
807
tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
806
809
self.unversioned(tree2, 'file'),
829
832
self.build_tree(['tree2/file', 'tree2/dir/',
830
833
'tree1/file', 'tree2/movedfile',
831
834
'tree1/dir/', 'tree2/moveddir/'])
833
os.symlink('target', 'tree1/link')
834
os.symlink('target', 'tree2/link')
835
os.symlink('target', 'tree2/movedlink')
836
links_supported = True
838
# links_supported = False
839
tree1.add(['file', 'dir', 'link'], ['file-id', 'dir-id', 'link-id'])
840
tree2.add(['movedfile', 'moveddir', 'movedlink'],
841
['file-id', 'dir-id', 'link-id'])
836
os.symlink('target', 'tree1/link')
837
os.symlink('target', 'tree2/link')
838
os.symlink('target', 'tree2/movedlink')
839
links_supported = True
841
links_supported = False
842
tree1.add(['file', 'dir'], ['file-id', 'dir-id'])
843
tree2.add(['movedfile', 'moveddir'], ['file-id', 'dir-id'])
845
tree1.add(['link'], ['link-id'])
846
tree2.add(['movedlink'], ['link-id'])
842
847
tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
843
848
root_id = tree1.path2id('')