~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

recommit 1527 PEP8 fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
class PointlessCommit(BzrNewError):
258
258
    """No changes to commit"""
259
259
 
 
260
 
260
261
class StrictCommitFailed(Exception):
261
262
    """Commit refused because there are unknowns in the tree."""
262
263
 
 
264
 
263
265
class NoSuchRevision(BzrError):
264
266
    def __init__(self, branch, revision):
265
267
        self.branch = branch
289
291
            " specified."
290
292
        BzrCommandError.__init__(self, msg)
291
293
 
 
294
 
292
295
class NoCommonAncestor(BzrError):
293
296
    def __init__(self, revision_a, revision_b):
294
297
        msg = "Revisions have no common ancestor: %s %s." \
295
298
            % (revision_a, revision_b) 
296
299
        BzrError.__init__(self, msg)
297
300
 
 
301
 
298
302
class NoCommonRoot(BzrError):
299
303
    def __init__(self, revision_a, revision_b):
300
304
        msg = "Revisions are not derived from the same root: %s %s." \
301
305
            % (revision_a, revision_b) 
302
306
        BzrError.__init__(self, msg)
303
307
 
 
308
 
304
309
class NotAncestor(BzrError):
305
310
    def __init__(self, rev_id, not_ancestor_id):
306
311
        msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id, 
324
329
        BzrError.__init__(self, msg)
325
330
        self.bases = bases
326
331
 
 
332
 
327
333
class NoCommits(BzrError):
328
334
    def __init__(self, branch):
329
335
        msg = "Branch %s has no commits." % branch
330
336
        BzrError.__init__(self, msg)
331
337
 
 
338
 
332
339
class UnlistableStore(BzrError):
333
340
    def __init__(self, store):
334
341
        BzrError.__init__(self, "Store %s is not listable" % store)
335
342
 
 
343
 
336
344
class UnlistableBranch(BzrError):
337
345
    def __init__(self, br):
338
346
        BzrError.__init__(self, "Stores for branch %s are not listable" % br)
394
402
        self.msg = msg
395
403
        self.orig_error = orig_error
396
404
 
 
405
 
397
406
# A set of semi-meaningful errors which can be thrown
398
407
class TransportNotPossible(TransportError):
399
408
    """This is for transports where a specific function is explicitly not
415
424
    """The connection has been closed."""
416
425
    pass
417
426
 
 
427
 
418
428
class ConflictsInTree(BzrError):
419
429
    def __init__(self):
420
430
        BzrError.__init__(self, "Working tree has conflicts.")
421
431
 
 
432
 
422
433
class ParseConfigError(BzrError):
423
434
    def __init__(self, errors, filename):
424
435
        if filename is None:
427
438
            (filename, ('\n'.join(e.message for e in errors)))
428
439
        BzrError.__init__(self, message)
429
440
 
 
441
 
430
442
class SigningFailed(BzrError):
431
443
    def __init__(self, command_line):
432
444
        BzrError.__init__(self, "Failed to gpg sign data with command '%s'"
433
445
                               % command_line)
434
446
 
 
447
 
435
448
class WorkingTreeNotRevision(BzrError):
436
449
    def __init__(self, tree):
437
450
        BzrError.__init__(self, "The working tree for %s has changed since"
438
451
                          " last commit, but weave merge requires that it be"
439
452
                          " unchanged." % tree.basedir)
440
453
 
 
454
 
441
455
class CantReprocessAndShowBase(BzrNewError):
442
456
    """Can't reprocess and show base.
443
457
Reprocessing obscures relationship of conflicting lines to base."""
444
458
 
 
459
 
445
460
class GraphCycleError(BzrNewError):
446
461
    """Cycle in graph %(graph)r"""
447
462
    def __init__(self, graph):
506
521
 
507
522
    def __init__(self, error):
508
523
        DependencyNotPresent.__init__(self, 'paramiko', error)
509
 
 
510