~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Marius Kruger
  • Date: 2007-01-19 09:47:38 UTC
  • mto: This revision was merged to the branch mainline in revision 2241.
  • Revision ID: amanic@gmail.com-20070119094738-zzjsna2p0lupx92a
* bzrlib/errors.py
  Changed "FilesExist" to more specific "RenameFailedFilesExist"

Show diffs side-by-side

added added

removed removed

Lines of Context:
334
334
    _fmt = "File exists: %(path)r%(extra)s"
335
335
 
336
336
 
337
 
class FilesExist(PathError):
338
 
    """Used when reporting that files do exist"""
339
 
 
340
 
    _fmt = "File%(plural)s exist: %(paths_as_string)s%(extra)s"
341
 
 
342
 
    def __init__(self, paths, extra=None):
343
 
        # circular import
344
 
        from bzrlib.osutils import quotefn
 
337
class RenameFailedFilesExist(BzrError):
 
338
    """Used when renaming and both source and dest exist."""
 
339
 
 
340
    _fmt = ("Could not rename %(source)s to %(dest)s because both files exist."
 
341
         "%(extra)s")
 
342
 
 
343
    def __init__(self, source, dest, extra=None):
345
344
        BzrError.__init__(self)
346
 
        self.paths = paths
347
 
        self.paths_as_string = ' '.join(paths)
 
345
        self.source = str(source)
 
346
        self.dest = str(dest)
348
347
        if extra:
349
 
            self.extra = ': ' + str(extra)
 
348
            self.extra = ' ' + str(extra)
350
349
        else:
351
350
            self.extra = ''
352
 
        if len(paths) > 1:
353
 
            self.plural = 's'
354
 
        else:
355
 
            self.plural = ''
356
351
 
357
352
 
358
353
class NotADirectory(PathError):