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\\.')
679
708
def test_commit_kind_changes(self):
680
709
self.requireFeature(SymlinkFeature)
681
710
tree = self.make_branch_and_tree('.')
864
893
def test_add_file_not_excluded(self):
866
('fid', (None, 'newpath'),
867
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
868
('file', 'file'), (True, True))]
896
'fid', (None, 'newpath'),
897
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
898
('file', 'file'), (True, True))]
869
899
self.assertEqual(changes, list(
870
900
filter_excluded(changes, ['otherpath'])))
872
902
def test_add_file_excluded(self):
874
('fid', (None, 'newpath'),
875
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
876
('file', 'file'), (True, True))]
905
'fid', (None, 'newpath'),
906
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
907
('file', 'file'), (True, True))]
877
908
self.assertEqual([], list(filter_excluded(changes, ['newpath'])))
879
910
def test_delete_file_excluded(self):
881
('fid', ('somepath', None),
882
0, (False, None), ('pid', None), ('newpath', None),
883
('file', None), (True, None))]
913
'fid', ('somepath', None),
914
0, (False, None), ('pid', None), ('newpath', None),
915
('file', None), (True, None))]
884
916
self.assertEqual([], list(filter_excluded(changes, ['somepath'])))
886
918
def test_move_from_or_to_excluded(self):
888
('fid', ('oldpath', 'newpath'),
889
0, (False, False), ('pid', 'pid'), ('oldpath', 'newpath'),
890
('file', 'file'), (True, True))]
921
'fid', ('oldpath', 'newpath'),
922
0, (False, False), ('pid', 'pid'), ('oldpath', 'newpath'),
923
('file', 'file'), (True, True))]
891
924
self.assertEqual([], list(filter_excluded(changes, ['oldpath'])))
892
925
self.assertEqual([], list(filter_excluded(changes, ['newpath'])))