~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Vincent Ladeuil
  • Date: 2010-04-15 15:03:15 UTC
  • mfrom: (4797.42.3 2.1-integration)
  • mto: This revision was merged to the branch mainline in revision 5160.
  • Revision ID: v.ladeuil+lp@free.fr-20100415150315-y2bbh2tzvshyzet0
Merge 2.1 into bzr.dev including fixes for #262450, #373898, #498409

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import difflib
18
18
import os
19
19
import re
 
20
import shutil
20
21
import string
21
22
import sys
22
23
 
797
798
                target.close()
798
799
        finally:
799
800
            source.close()
 
801
        if not allow_write:
 
802
            osutils.make_readonly(full_path)
800
803
        try:
801
804
            mtime = tree.get_file_mtime(file_id)
802
805
        except errors.FileTimestampUnavailable:
803
 
            pass
804
 
        else:
805
 
            os.utime(full_path, (mtime, mtime))
806
 
        if not allow_write:
807
 
            osutils.make_readonly(full_path)
 
806
            mtime = 0
 
807
        os.utime(full_path, (mtime, mtime))
808
808
        return full_path
809
809
 
810
810
    def _prepare_files(self, file_id, old_path, new_path, force_temp=False,