552
554
timestamp_1ms = round(timestamp, 3)
553
555
self.assertEqual(timestamp_1ms, timestamp)
557
def test_commit_kind_changes(self):
558
if not osutils.has_symlinks():
559
raise tests.TestSkipped('Test requires symlink support')
560
tree = self.make_branch_and_tree('.')
561
os.symlink('target', 'name')
562
tree.add('name', 'a-file-id')
563
tree.commit('Added a symlink')
564
self.assertEqual('symlink', tree.basis_tree().kind('a-file-id'))
567
self.build_tree(['name'])
568
tree.commit('Changed symlink to file')
569
self.assertEqual('file', tree.basis_tree().kind('a-file-id'))
572
os.symlink('target', 'name')
573
tree.commit('file to symlink')
574
self.assertEqual('symlink', tree.basis_tree().kind('a-file-id'))
578
tree.commit('symlink to directory')
579
self.assertEqual('directory', tree.basis_tree().kind('a-file-id'))
582
os.symlink('target', 'name')
583
tree.commit('directory to symlink')
584
self.assertEqual('symlink', tree.basis_tree().kind('a-file-id'))
586
# prepare for directory <-> file tests
589
tree.commit('symlink to directory')
590
self.assertEqual('directory', tree.basis_tree().kind('a-file-id'))
593
self.build_tree(['name'])
594
tree.commit('Changed directory to file')
595
self.assertEqual('file', tree.basis_tree().kind('a-file-id'))
599
tree.commit('file to directory')
600
self.assertEqual('directory', tree.basis_tree().kind('a-file-id'))
555
602
def test_commit_unversioned_specified(self):
556
603
"""Commit should raise if specified files isn't in basis or worktree"""
557
604
tree = self.make_branch_and_tree('.')