682
def test_unsupported_symlink_commit(self):
683
self.requireFeature(SymlinkFeature)
684
tree = self.make_branch_and_tree('.')
685
self.build_tree(['hello'])
687
tree.commit('added hello', rev_id=b'hello_id')
688
os.symlink('hello', 'foo')
690
tree.commit('added foo', rev_id=b'foo_id')
692
trace.push_log_file(log)
693
os_symlink = getattr(os, 'symlink', None)
696
# At this point as bzr thinks symlinks are not supported
697
# we should get a warning about symlink foo and bzr should
698
# not think its removed.
700
self.build_tree(['world'])
702
tree.commit('added world', rev_id=b'world_id')
705
os.symlink = os_symlink
706
self.assertContainsRe(
708
b'Ignoring "foo" as symlinks are not '
709
b'supported on this filesystem\\.')
711
679
def test_commit_kind_changes(self):
712
680
self.requireFeature(SymlinkFeature)
713
681
tree = self.make_branch_and_tree('.')
896
864
def test_add_file_not_excluded(self):
899
'fid', (None, 'newpath'),
900
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
901
('file', 'file'), (True, True))]
866
('fid', (None, 'newpath'),
867
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
868
('file', 'file'), (True, True))]
902
869
self.assertEqual(changes, list(
903
870
filter_excluded(changes, ['otherpath'])))
905
872
def test_add_file_excluded(self):
908
'fid', (None, 'newpath'),
909
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
910
('file', 'file'), (True, True))]
874
('fid', (None, 'newpath'),
875
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
876
('file', 'file'), (True, True))]
911
877
self.assertEqual([], list(filter_excluded(changes, ['newpath'])))
913
879
def test_delete_file_excluded(self):
916
'fid', ('somepath', None),
917
0, (False, None), ('pid', None), ('newpath', None),
918
('file', None), (True, None))]
881
('fid', ('somepath', None),
882
0, (False, None), ('pid', None), ('newpath', None),
883
('file', None), (True, None))]
919
884
self.assertEqual([], list(filter_excluded(changes, ['somepath'])))
921
886
def test_move_from_or_to_excluded(self):
924
'fid', ('oldpath', 'newpath'),
925
0, (False, False), ('pid', 'pid'), ('oldpath', 'newpath'),
926
('file', 'file'), (True, True))]
888
('fid', ('oldpath', 'newpath'),
889
0, (False, False), ('pid', 'pid'), ('oldpath', 'newpath'),
890
('file', 'file'), (True, True))]
927
891
self.assertEqual([], list(filter_excluded(changes, ['oldpath'])))
928
892
self.assertEqual([], list(filter_excluded(changes, ['newpath'])))