~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Martin Pool
  • Date: 2005-09-16 03:32:44 UTC
  • mfrom: (1185.1.23)
  • mto: (1185.8.2) (974.1.91)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: mbp@sourcefrog.net-20050916033244-18c4f4bcba663e42
- merge in many integration fixes from Robert

  * xml escaping of unprintable characters

  * 'make clean'

  * new, more consistent Branch constructors 

  * RemoteBranch tests against local farmework

  * scott's non-verbose commit fix 

This seems to break this usage though 

  bzr diff -r 1207..1208 ../bzr.robertc-integration

robertc@robertcollins.net-20050915175953-a16fdc627ce7c541

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/env python
2
1
# -*- coding: UTF-8 -*-
3
2
 
4
3
# This program is free software; you can redistribute it and/or modify
25
24
class BzrError(StandardError):
26
25
    pass
27
26
 
 
27
 
28
28
class BzrCheckError(BzrError):
29
29
    pass
30
30
 
92
92
        BzrError.__init__(self, msg)
93
93
 
94
94
 
 
95
class DivergedBranches(BzrError):
 
96
    def __init__(self, branch1, branch2):
 
97
        BzrError.__init__(self, "These branches have diverged.")
 
98
        self.branch1 = branch1
 
99
        self.branch2 = branch2
 
100
 
95
101
class UnrelatedBranches(BzrCommandError):
96
102
    def __init__(self):
97
103
        msg = "Branches have no common ancestor, and no base revision"\
98
104
            " specified."
99
105
        BzrCommandError.__init__(self, msg)
100
106
 
 
107
class NoCommonAncestor(BzrError):
 
108
    def __init__(self, revision_a, revision_b):
 
109
        msg = "Revisions have no common ancestor: %s %s." \
 
110
            % (revision_a, revision_b) 
 
111
        BzrError.__init__(self, msg)
 
112
 
 
113
class NoCommonRoot(BzrError):
 
114
    def __init__(self, revision_a, revision_b):
 
115
        msg = "Revisions are not derived from the same root: %s %s." \
 
116
            % (revision_a, revision_b) 
 
117
        BzrError.__init__(self, msg)
101
118
 
102
119
class NotAncestor(BzrError):
103
120
    def __init__(self, rev_id, not_ancestor_id):
 
121
        msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id, 
 
122
                                                        rev_id)
 
123
        BzrError.__init__(self, msg)
104
124
        self.rev_id = rev_id
105
125
        self.not_ancestor_id = not_ancestor_id
106
 
        msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id, 
107
 
                                                        rev_id)
108
 
        BzrError.__init__(self, msg)
109
126
 
110
127
 
111
128
class InstallFailed(BzrError):
112
129
    def __init__(self, revisions):
 
130
        msg = "Could not install revisions:\n%s" % " ,".join(revisions)
 
131
        BzrError.__init__(self, msg)
113
132
        self.revisions = revisions
114
 
        msg = "Could not install revisions:\n%s" % " ,".join(revisions)
115
 
        BzrError.__init__(self, msg)
116
133
 
117
134
 
118
135
class AmbiguousBase(BzrError):
122
139
        BzrError.__init__(self, msg)
123
140
        self.bases = bases
124
141
 
 
142
class NoCommits(BzrError):
 
143
    def __init__(self, branch):
 
144
        msg = "Branch %s has no commits." % branch
 
145
        BzrError.__init__(self, msg)