~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-17 03:20:35 UTC
  • mfrom: (4792.4.3 456036)
  • Revision ID: pqm@pqm.ubuntu.com-20091117032035-s3sgtlixj1lrminn
(Gordon Tyler) Fix IndexError during 'bzr ignore /' (#456036)

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    timestamp,
40
40
    views,
41
41
    )
42
 
 
43
 
from bzrlib.workingtree import WorkingTree
44
42
""")
45
43
 
46
44
from bzrlib.symbol_versioning import (
724
722
 
725
723
    def _write_file(self, file_id, tree, prefix, relpath, force_temp=False,
726
724
                    allow_write=False):
727
 
        if not force_temp and isinstance(tree, WorkingTree):
728
 
            return tree.abspath(tree.id2path(file_id))
729
 
        
730
725
        full_path = osutils.pathjoin(self._root, prefix, relpath)
731
726
        if not force_temp and self._try_symlink_root(tree, prefix):
732
727
            return full_path
771
766
    def diff(self, file_id, old_path, new_path, old_kind, new_kind):
772
767
        if (old_kind, new_kind) != ('file', 'file'):
773
768
            return DiffPath.CANNOT_DIFF
774
 
        (old_disk_path, new_disk_path) = self._prepare_files(
775
 
                                                file_id, old_path, new_path)
776
 
        self._execute(old_disk_path, new_disk_path)
 
769
        self._prepare_files(file_id, old_path, new_path)
 
770
        self._execute(osutils.pathjoin('old', old_path),
 
771
                      osutils.pathjoin('new', new_path))
777
772
 
778
773
    def edit_file(self, file_id):
779
774
        """Use this tool to edit a file.