/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 15:11:03 UTC
  • mto: This revision was merged to the branch mainline in revision 3159.
  • Revision ID: abentley@panoramicfeedback.com-20071227151103-s6vuss3n63b6933a
Symlink to real files if possible

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
import os
 
18
import os.path
18
19
from cStringIO import StringIO
19
20
import errno
20
21
import subprocess
1261
1262
    def test_prepare_files(self):
1262
1263
        output = StringIO()
1263
1264
        tree = self.make_branch_and_tree('tree')
1264
 
        self.build_tree_contents([('tree/file', 'oldcontent')])
1265
 
        tree.add('file', 'file-id')
 
1265
        self.build_tree_contents([('tree/oldname', 'oldcontent')])
 
1266
        tree.add('oldname', 'file-id')
1266
1267
        tree.commit('old tree', timestamp=0)
1267
 
        self.build_tree_contents([('tree/file', 'newcontent')])
 
1268
        tree.rename_one('oldname', 'newname')
 
1269
        self.build_tree_contents([('tree/newname', 'newcontent')])
1268
1270
        old_tree = tree.basis_tree()
1269
1271
        old_tree.lock_read()
1270
1272
        self.addCleanup(old_tree.unlock)
1282
1284
        self.assertContainsRe(new_path, 'new/newname$')
1283
1285
        self.assertFileEqual('oldcontent', old_path)
1284
1286
        self.assertFileEqual('newcontent', new_path)
 
1287
        if osutils.has_symlinks():
 
1288
            self.assertTrue(os.path.samefile('tree/newname', new_path))
1285
1289
        # make sure we can create files with the same parent directories
1286
1290
        diff_obj._prepare_files('file-id', 'oldname2', 'newname2')