~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/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:
778
778
        self.to_file.write(proc.stdout.read())
779
779
        return proc.wait()
780
780
 
 
781
    def _try_symlink_root(self, tree, prefix):
 
782
        if not (getattr(tree, 'abspath', None) is not None
 
783
                and osutils.has_symlinks()):
 
784
            return False
 
785
        try:
 
786
            os.symlink(tree.abspath(''), osutils.pathjoin(self._root, prefix))
 
787
        except OSError, e:
 
788
            if e.errno != errno.EEXIST:
 
789
                raise
 
790
        return True
 
791
 
781
792
    def _write_file(self, file_id, tree, prefix, relpath):
782
793
        full_path = osutils.pathjoin(self._root, prefix, relpath)
 
794
        if self._try_symlink_root(tree, prefix):
 
795
            return full_path
783
796
        parent_dir = osutils.dirname(full_path)
784
797
        try:
785
798
            os.makedirs(parent_dir)