~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-31 18:27:04 UTC
  • mfrom: (1948.4.36 revspec-errors-55420)
  • Revision ID: pqm@pqm.ubuntu.com-20060831182704-2de4cd234a448ed1
(jam) improve revision spec errors

Show diffs side-by-side

added added

removed removed

Lines of Context:
505
505
        self.format = format
506
506
 
507
507
 
508
 
 
509
508
class StrictCommitFailed(Exception):
510
509
    """Commit refused because there are unknowns in the tree."""
511
510
 
516
515
    is_user_error = False
517
516
 
518
517
    def __init__(self, branch, revision):
519
 
        self.branch = branch
520
 
        self.revision = revision
 
518
        BzrNewError.__init__(self, branch=branch, revision=revision)
 
519
 
 
520
 
 
521
class NoSuchRevisionSpec(BzrNewError):
 
522
    """No namespace registered for string: %(spec)r"""
 
523
 
 
524
    def __init__(self, spec):
 
525
        BzrNewError.__init__(self, spec=spec)
 
526
 
 
527
 
 
528
class InvalidRevisionSpec(BzrNewError):
 
529
    """Requested revision: '%(spec)s' does not exist in branch:
 
530
%(branch)s%(extra)s"""
 
531
 
 
532
    def __init__(self, spec, branch, extra=None):
 
533
        BzrNewError.__init__(self, branch=branch, spec=spec)
 
534
        if extra:
 
535
            self.extra = '\n' + str(extra)
 
536
        else:
 
537
            self.extra = ''
521
538
 
522
539
 
523
540
class HistoryMissing(BzrError):
586
603
        self.bases = bases
587
604
 
588
605
 
589
 
class NoCommits(BzrError):
 
606
class NoCommits(BzrNewError):
 
607
    """Branch %(branch)s has no commits."""
 
608
 
590
609
    def __init__(self, branch):
591
 
        msg = "Branch %s has no commits." % branch
592
 
        BzrError.__init__(self, msg)
 
610
        BzrNewError.__init__(self, branch=branch)
593
611
 
594
612
 
595
613
class UnlistableStore(BzrError):