~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_export.py

  • Committer: Martin Pool
  • Date: 2011-06-19 02:24:39 UTC
  • mfrom: (5985 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6001.
  • Revision ID: mbp@canonical.com-20110619022439-u68683yb2bw302x0
resolve conflicts against trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
        self.assertEqual(a_time, t.stat('a').st_mtime)
147
147
        self.assertEqual(b_time, t.stat('b').st_mtime)
148
148
 
 
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'))],
 
157
            timestamp=foo_time)
 
158
        builder.finish_series()
 
159
        b = builder.get_branch()
 
160
        b.lock_read()
 
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)
 
167
 
149
168
 
150
169
class TarExporterTests(tests.TestCaseWithTransport):
151
170