~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/atomicfile.py

  • Committer: Martin Pool
  • Date: 2005-05-09 04:59:00 UTC
  • Revision ID: mbp@sourcefrog.net-20050509045900-7c01ab1bd6cfeb4a
- Fix ignore command and add tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        self.write = self.f.write
42
42
 
43
43
    def commit(self):
 
44
        import sys, os
 
45
        
44
46
        self.f.close()
45
47
        if sys.platform == 'win32':
46
48
            os.remove(self.realfilename)
47
49
        os.rename(self.tmpfilename, self.realfilename)
48
50
 
49
51
    def abort(self):
 
52
        import os
50
53
        self.f.close()
51
54
        os.remove(self.tmpfilename)
52
55