/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/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:
778
778
        self.to_file.write(proc.stdout.read())
779
779
        return proc.wait()
780
780
 
781
 
    def _write_file(self, file_id, tree, prefix, old_path):
782
 
        full_old_path = osutils.pathjoin(self._root, prefix, old_path)
783
 
        parent_dir = osutils.dirname(full_old_path)
 
781
    def _write_file(self, file_id, tree, prefix, relpath):
 
782
        full_path = osutils.pathjoin(self._root, prefix, relpath)
 
783
        parent_dir = osutils.dirname(full_path)
784
784
        try:
785
785
            os.makedirs(parent_dir)
786
786
        except OSError, e:
788
788
                raise
789
789
        source = tree.get_file(file_id)
790
790
        try:
791
 
            target = open(full_old_path, 'wb')
 
791
            target = open(full_path, 'wb')
792
792
            try:
793
793
                osutils.pumpfile(source, target)
794
794
            finally:
795
795
                target.close()
796
796
        finally:
797
797
            source.close()
798
 
        return full_old_path
 
798
        mtime = tree.get_file_mtime(file_id)
 
799
        os.utime(full_path, (mtime, mtime))
 
800
        return full_path
799
801
 
800
802
    def _prepare_files(self, file_id, old_path, new_path):
801
803
        old_disk_path = self._write_file(file_id, self.old_tree, 'old',