~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2006-06-15 05:36:34 UTC
  • mto: This revision was merged to the branch mainline in revision 1797.
  • Revision ID: mbp@sourcefrog.net-20060615053634-4fd52ba691855659
Clean up many exception classes.

Errors indicating a user error are now shown with is_user_error on the
exception; use this rather than hardcoding a list of exceptions that should be
handled this way.

Exceptions now inherit from BzrNewException where possible to use consistent
formatting method.

Remove rather obsolete docstring test on Branch.missing_revisions.

Remove dead code from find_merge_base.


Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
import bzrlib.config
82
82
import bzrlib.errors as errors
83
83
from bzrlib.errors import (BzrError, PointlessCommit,
84
 
                           HistoryMissing,
85
84
                           ConflictsInTree,
86
85
                           StrictCommitFailed
87
86
                           )
498
497
            if not self.branch.repository.has_revision(parent_id):
499
498
                if parent_id == self.branch.last_revision():
500
499
                    warning("parent is missing %r", parent_id)
501
 
                    raise HistoryMissing(self.branch, 'revision', parent_id)
502
 
                else:
503
 
                    mutter("commit will ghost revision %r", parent_id)
 
500
                    raise BzrCheckError("branch %s is missing revision {%s}"
 
501
                            % (self.branch, parent_id))
504
502
            
505
503
    def _make_revision(self):
506
504
        """Record a new revision object for this commit."""