/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/errors.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-08 02:08:01 UTC
  • mto: This revision was merged to the branch mainline in revision 1937.
  • Revision ID: john@arbash-meinel.com-20060808020801-b179d1851b6c45a9
Delay evaluating PathError.extra, and use fstat() instead of seek + tell, and we can check if we need to chmod(). Saves about 3/90 seconds of commit time

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
class PathError(BzrNewError):
217
217
    """Generic path error: %(path)r%(extra)s)"""
218
218
 
 
219
    extra = ''
 
220
 
219
221
    def __init__(self, path, extra=None):
220
222
        BzrNewError.__init__(self)
221
223
        self.path = path
222
 
        if extra:
223
 
            self.extra = ': ' + str(extra)
224
 
        else:
225
 
            self.extra = ''
 
224
        # evaluate extra later, because we raise NoSuchFile a lot
 
225
        # and most times we don't care about this yet.
 
226
        self._extra = extra
 
227
 
 
228
    def __str__(self):
 
229
        if self._extra:
 
230
            self.extra = ': ' + str(self._extra)
 
231
        return BzrNewError.__str__(self)
226
232
 
227
233
 
228
234
class NoSuchFile(PathError):