~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/atomicfile.py

  • Committer: Martin von Gagern
  • Date: 2011-06-01 12:53:56 UTC
  • mto: This revision was merged to the branch mainline in revision 6009.
  • Revision ID: martin.vgagern@gmx.net-20110601125356-lwozv2vecea6hxfz
Change from no_decorate to classify as name for the argument.

The command line switch remains as --no-classify, to keep backwards
compatibility.  Users are free to include --no-classify in an alias, and
still use --classify to change back.

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
            if stat.S_IMODE(st.st_mode) != new_mode:
81
81
                os.chmod(self.tmpfilename, new_mode)
82
82
 
 
83
    def _get_closed(self):
 
84
        symbol_versioning.warn('AtomicFile.closed deprecated in bzr 0.10',
 
85
                               DeprecationWarning, stacklevel=2)
 
86
        return self._fd is None
 
87
 
 
88
    closed = property(_get_closed)
 
89
 
83
90
    def __repr__(self):
84
91
        return '%s(%r)' % (self.__class__.__name__,
85
92
                           self.realfilename)
111
118
        """Discard the file unless already committed."""
112
119
        if self._fd is not None:
113
120
            self.abort()
 
121
 
 
122
    def __del__(self):
 
123
        if self._fd is not None:
 
124
            warnings.warn("%r leaked" % self)