679
def test_unsupported_symlink_commit(self):
680
self.requireFeature(SymlinkFeature)
681
tree = self.make_branch_and_tree('.')
682
self.build_tree(['hello'])
684
tree.commit('added hello', rev_id=b'hello_id')
685
os.symlink('hello', 'foo')
687
tree.commit('added foo', rev_id=b'foo_id')
689
trace.push_log_file(log)
690
os_symlink = getattr(os, 'symlink', None)
693
# At this point as bzr thinks symlinks are not supported
694
# we should get a warning about symlink foo and bzr should
695
# not think its removed.
697
self.build_tree(['world'])
699
tree.commit('added world', rev_id=b'world_id')
702
os.symlink = os_symlink
703
self.assertContainsRe(
705
b'Ignoring "foo" as symlinks are not '
706
b'supported on this filesystem\\.')
708
679
def test_commit_kind_changes(self):
709
680
self.requireFeature(SymlinkFeature)
710
681
tree = self.make_branch_and_tree('.')
893
864
def test_add_file_not_excluded(self):
896
'fid', (None, 'newpath'),
897
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
898
('file', 'file'), (True, True))]
866
('fid', (None, 'newpath'),
867
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
868
('file', 'file'), (True, True))]
899
869
self.assertEqual(changes, list(
900
870
filter_excluded(changes, ['otherpath'])))
902
872
def test_add_file_excluded(self):
905
'fid', (None, 'newpath'),
906
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
907
('file', 'file'), (True, True))]
874
('fid', (None, 'newpath'),
875
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
876
('file', 'file'), (True, True))]
908
877
self.assertEqual([], list(filter_excluded(changes, ['newpath'])))
910
879
def test_delete_file_excluded(self):
913
'fid', ('somepath', None),
914
0, (False, None), ('pid', None), ('newpath', None),
915
('file', None), (True, None))]
881
('fid', ('somepath', None),
882
0, (False, None), ('pid', None), ('newpath', None),
883
('file', None), (True, None))]
916
884
self.assertEqual([], list(filter_excluded(changes, ['somepath'])))
918
886
def test_move_from_or_to_excluded(self):
921
'fid', ('oldpath', 'newpath'),
922
0, (False, False), ('pid', 'pid'), ('oldpath', 'newpath'),
923
('file', 'file'), (True, True))]
888
('fid', ('oldpath', 'newpath'),
889
0, (False, False), ('pid', 'pid'), ('oldpath', 'newpath'),
890
('file', 'file'), (True, True))]
924
891
self.assertEqual([], list(filter_excluded(changes, ['oldpath'])))
925
892
self.assertEqual([], list(filter_excluded(changes, ['newpath'])))