78
79
self.assertEqual(('missing', None, None, None), summary)
80
81
def test_file_content_summary_executable(self):
81
if not osutils.supports_executable():
82
raise tests.TestNotApplicable()
83
82
tree = self.make_branch_and_tree('tree')
84
83
self.build_tree(['tree/path'])
86
current_mode = os.stat('tree/path').st_mode
87
os.chmod('tree/path', current_mode | 0100)
85
tt = transform.TreeTransform(tree)
86
self.addCleanup(tt.finalize)
87
tt.set_executability(True, tt.trans_id_tree_path('path'))
88
89
summary = self._convert_tree(tree).path_content_summary('path')
89
90
self.assertEqual(4, len(summary))
90
91
self.assertEqual('file', summary[0])
95
96
self.assertSubset((summary[3],),
96
97
(None, '0c352290ae1c26ca7f97d5b2906c4624784abd60'))
99
def test_file_content_summary_not_versioned(self):
100
tree = self.make_branch_and_tree('tree')
101
self.build_tree(['tree/path'])
102
tree = self._convert_tree(tree)
103
summary = tree.path_content_summary('path')
104
self.assertEqual(4, len(summary))
105
if isinstance(tree, (per_tree.DirStateRevisionTree,
106
per_tree.RevisionTree)):
107
self.assertEqual('missing', summary[0])
108
self.assertIs(None, summary[2])
109
self.assertIs(None, summary[3])
110
elif isinstance(tree, transform._PreviewTree):
111
self.expectFailure('PreviewTree returns "missing" for unversioned'
112
'files', self.assertEqual, 'file', summary[0])
113
self.assertEqual('file', summary[0])
115
self.assertEqual('file', summary[0])
116
self.check_content_summary_size(tree, summary, 22)
117
self.assertEqual(False, summary[2])
118
self.assertSubset((summary[3],),
119
(None, '0c352290ae1c26ca7f97d5b2906c4624784abd60'))
98
121
def test_file_content_summary_non_exec(self):
99
122
tree = self.make_branch_and_tree('tree')
100
123
self.build_tree(['tree/path'])