~jeanfrancois.roy/bzr/url-safe-escape

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Robert Collins
  • Date: 2005-09-27 07:24:40 UTC
  • mfrom: (1185.1.41)
  • Revision ID: robertc@robertcollins.net-20050927072440-1bf4d99c3e1db5b3
pair programming worx... merge integration and weave

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
105
104
                          % (branch, object_type, object_id))
106
105
 
107
106
 
 
107
class DivergedBranches(BzrError):
 
108
    def __init__(self, branch1, branch2):
 
109
        BzrError.__init__(self, "These branches have diverged.")
 
110
        self.branch1 = branch1
 
111
        self.branch2 = branch2
 
112
 
 
113
 
108
114
class UnrelatedBranches(BzrCommandError):
109
115
    def __init__(self):
110
116
        msg = "Branches have no common ancestor, and no base revision"\
111
117
            " specified."
112
118
        BzrCommandError.__init__(self, msg)
113
119
 
 
120
class NoCommonAncestor(BzrError):
 
121
    def __init__(self, revision_a, revision_b):
 
122
        msg = "Revisions have no common ancestor: %s %s." \
 
123
            % (revision_a, revision_b) 
 
124
        BzrError.__init__(self, msg)
 
125
 
 
126
class NoCommonRoot(BzrError):
 
127
    def __init__(self, revision_a, revision_b):
 
128
        msg = "Revisions are not derived from the same root: %s %s." \
 
129
            % (revision_a, revision_b) 
 
130
        BzrError.__init__(self, msg)
114
131
 
115
132
class NotAncestor(BzrError):
116
133
    def __init__(self, rev_id, not_ancestor_id):
 
134
        msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id, 
 
135
                                                        rev_id)
 
136
        BzrError.__init__(self, msg)
117
137
        self.rev_id = rev_id
118
138
        self.not_ancestor_id = not_ancestor_id
119
 
        msg = "Revision %s is not an ancestor of %s" % (not_ancestor_id, 
120
 
                                                        rev_id)
121
 
        BzrError.__init__(self, msg)
122
139
 
123
140
 
124
141
class InstallFailed(BzrError):
125
142
    def __init__(self, revisions):
 
143
        msg = "Could not install revisions:\n%s" % " ,".join(revisions)
 
144
        BzrError.__init__(self, msg)
126
145
        self.revisions = revisions
127
 
        msg = "Could not install revisions:\n%s" % " ,".join(revisions)
128
 
        BzrError.__init__(self, msg)
129
146
 
130
147
 
131
148
class AmbiguousBase(BzrError):
135
152
        BzrError.__init__(self, msg)
136
153
        self.bases = bases
137
154
 
 
155
class NoCommits(BzrError):
 
156
    def __init__(self, branch):
 
157
        msg = "Branch %s has no commits." % branch
 
158
        BzrError.__init__(self, msg)