/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_diff.py

  • Committer: Aaron Bentley
  • Date: 2007-12-27 14:49:39 UTC
  • mto: This revision was merged to the branch mainline in revision 3159.
  • Revision ID: abentley@panoramicfeedback.com-20071227144939-ubtewvnji522xtxk
Set mtime (and atime) on files for --using

Show diffs side-by-side

added added

removed removed

Lines of Context:
1263
1263
        tree = self.make_branch_and_tree('tree')
1264
1264
        self.build_tree_contents([('tree/file', 'oldcontent')])
1265
1265
        tree.add('file', 'file-id')
1266
 
        tree.commit('old tree')
 
1266
        tree.commit('old tree', timestamp=0)
1267
1267
        self.build_tree_contents([('tree/file', 'newcontent')])
1268
1268
        old_tree = tree.basis_tree()
1269
1269
        old_tree.lock_read()
1270
1270
        self.addCleanup(old_tree.unlock)
 
1271
        tree.lock_read()
 
1272
        self.addCleanup(tree.unlock)
1271
1273
        diff_obj = DiffFromTool(['python', '-c',
1272
1274
                                 'print "%(old_path)s %(new_path)s"'],
1273
1275
                                old_tree, tree, output)
1276
1278
        old_path, new_path = diff_obj._prepare_files('file-id', 'oldname',
1277
1279
                                                     'newname')
1278
1280
        self.assertContainsRe(old_path, 'old/oldname$')
 
1281
        self.assertEqual(0, os.stat(old_path).st_mtime)
1279
1282
        self.assertContainsRe(new_path, 'new/newname$')
1280
1283
        self.assertFileEqual('oldcontent', old_path)
1281
1284
        self.assertFileEqual('newcontent', new_path)