146
146
self.assertEqual(a_time, t.stat('a').st_mtime)
147
147
self.assertEqual(b_time, t.stat('b').st_mtime)
149
def test_subdir_files_per_timestamps(self):
150
builder = self.make_branch_builder('source')
151
builder.start_series()
152
foo_time = time.mktime((1999, 12, 12, 0, 0, 0, 0, 0, 0))
153
builder.build_snapshot(None, None, [
154
('add', ('', 'root-id', 'directory', '')),
155
('add', ('subdir', 'subdir-id', 'directory', '')),
156
('add', ('subdir/foo.txt', 'foo-id', 'file', 'content\n'))],
158
builder.finish_series()
159
b = builder.get_branch()
161
self.addCleanup(b.unlock)
162
tree = b.basis_tree()
163
export.export(tree, 'target', format='dir', subdir='subdir',
164
per_file_timestamps=True)
165
t = self.get_transport('target')
166
self.assertEquals(foo_time, t.stat('foo.txt').st_mtime)
150
169
class TarExporterTests(tests.TestCaseWithTransport):