/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

Add finished() notifications to transactions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
fullstop.
54
54
"""
55
55
 
56
 
from warnings import warn
57
 
 
58
56
# based on Scott James Remnant's hct error classes
59
57
 
60
58
# TODO: is there any value in providing the .args field used by standard
174
172
 
175
173
class PathError(BzrNewError):
176
174
    """Generic path error: %(path)r%(extra)s)"""
177
 
 
178
175
    def __init__(self, path, extra=None):
179
176
        BzrNewError.__init__(self)
180
177
        self.path = path
196
193
    """Directory not empty: %(path)r%(extra)s"""
197
194
 
198
195
 
199
 
class ResourceBusy(PathError):
200
 
    """Device or resource busy: %(path)r%(extra)s"""
201
 
 
202
 
 
203
196
class PermissionDenied(PathError):
204
197
    """Permission denied: %(path)r%(extra)s"""
205
198
 
216
209
            self.extra = ''
217
210
 
218
211
 
219
 
class NotBranchError(PathError):
 
212
class NotBranchError(BzrNewError):
220
213
    """Not a branch: %(path)s"""
221
 
 
222
 
 
223
 
class AlreadyBranchError(PathError):
224
 
    """Already a branch: %(path)s. Use `bzr checkout` to build a working tree."""
 
214
    def __init__(self, path):
 
215
        BzrNewError.__init__(self)
 
216
        self.path = path
225
217
 
226
218
 
227
219
class NoRepositoryPresent(BzrNewError):
269
261
        self.path = path
270
262
 
271
263
 
272
 
class PathsNotVersionedError(BzrNewError):
273
 
    # used when reporting several paths are not versioned
274
 
    """Path(s) are not versioned: %(paths_as_string)s"""
275
 
 
276
 
    def __init__(self, paths):
277
 
        from bzrlib.osutils import quotefn
278
 
        BzrNewError.__init__(self)
279
 
        self.paths = paths
280
 
        self.paths_as_string = ' '.join([quotefn(p) for p in paths])
281
 
 
282
 
 
283
264
class BadFileKindError(BzrError):
284
265
    """Specified file is of a kind that cannot be added.
285
266
 
319
300
        self.obj = obj
320
301
 
321
302
 
322
 
class OutSideTransaction(BzrNewError):
323
 
    """A transaction related operation was attempted after the transaction finished."""
324
 
 
325
 
 
326
303
class ObjectNotLocked(LockError):
327
304
    """%(obj)r is not locked"""
328
305
    # this can indicate that any particular object is not locked; see also
409
386
 
410
387
 
411
388
class DivergedBranches(BzrError):
412
 
 
413
389
    def __init__(self, branch1, branch2):
414
390
        BzrError.__init__(self, "These branches have diverged.  Try merge.")
415
391
        self.branch1 = branch1
456
432
 
457
433
class AmbiguousBase(BzrError):
458
434
    def __init__(self, bases):
459
 
        warn("BzrError AmbiguousBase has been deprecated as of bzrlib 0.8.",
460
 
                DeprecationWarning)
461
435
        msg = "The correct base is unclear, becase %s are all equally close" %\
462
436
            ", ".join(bases)
463
437
        BzrError.__init__(self, msg)
765
739
 
766
740
 
767
741
class DependencyNotPresent(BzrNewError):
768
 
    """Unable to import library "%(library)s": %(error)s"""
 
742
    """Unable to import library: %(library)s, %(error)s"""
769
743
 
770
744
    def __init__(self, library, error):
771
745
        BzrNewError.__init__(self, library=library, error=error)
822
796
    """Error in merge modified format"""
823
797
 
824
798
 
825
 
class ConflictFormatError(BzrNewError):
826
 
    """Format error in conflict listings"""
827
 
 
828
 
 
829
799
class CorruptRepository(BzrNewError):
830
800
    """An error has been detected in the repository %(repo_path)s.
831
801
Please run bzr reconcile on this repository."""
849
819
 
850
820
class MissingProgressBarFinish(BzrNewError):
851
821
    """A nested progress bar was not 'finished' correctly."""
852
 
 
853
 
 
854
 
class UnsupportedOperation(BzrNewError):
855
 
    """The method %(mname)s is not supported on objects of type %(tname)s."""
856
 
    def __init__(self, method, method_self):
857
 
        self.method = method
858
 
        self.mname = method.__name__
859
 
        self.tname = type(method_self).__name__