/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Martin Pool
  • Date: 2009-06-05 23:21:51 UTC
  • mfrom: (4415 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4416.
  • Revision ID: mbp@sourcefrog.net-20090605232151-luwmyyl95siraqyz
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Exceptions for bzr, and reporting of them.
18
18
"""
1003
1003
 
1004
1004
class LockContention(LockError):
1005
1005
 
1006
 
    _fmt = 'Could not acquire lock "%(lock)s"'
 
1006
    _fmt = 'Could not acquire lock "%(lock)s": %(msg)s'
1007
1007
    # TODO: show full url for lock, combining the transport and relative
1008
1008
    # bits?
1009
1009
 
1010
1010
    internal_error = False
1011
1011
 
1012
 
    def __init__(self, lock):
 
1012
    def __init__(self, lock, msg=''):
1013
1013
        self.lock = lock
 
1014
        self.msg = msg
1014
1015
 
1015
1016
 
1016
1017
class LockBroken(LockError):
1172
1173
class DivergedBranches(BzrError):
1173
1174
 
1174
1175
    _fmt = ("These branches have diverged."
1175
 
            " Use the merge command to reconcile them.")
 
1176
            " Use the missing command to see how.\n"
 
1177
            "Use the merge command to reconcile them.")
1176
1178
 
1177
1179
    def __init__(self, branch1, branch2):
1178
1180
        self.branch1 = branch1
1226
1228
            not_ancestor_id=not_ancestor_id)
1227
1229
 
1228
1230
 
1229
 
class InstallFailed(BzrError):
1230
 
 
1231
 
    def __init__(self, revisions):
1232
 
        revision_str = ", ".join(str(r) for r in revisions)
1233
 
        msg = "Could not install revisions:\n%s" % revision_str
1234
 
        BzrError.__init__(self, msg)
1235
 
        self.revisions = revisions
1236
 
 
1237
 
 
1238
1231
class AmbiguousBase(BzrError):
1239
1232
 
1240
1233
    def __init__(self, bases):
2308
2301
        self.transport = transport
2309
2302
 
2310
2303
 
2311
 
class NoSmartServer(NotBranchError):
2312
 
 
2313
 
    _fmt = "No smart server available at %(url)s"
2314
 
 
2315
 
    @symbol_versioning.deprecated_method(symbol_versioning.one_four)
2316
 
    def __init__(self, url):
2317
 
        self.url = url
2318
 
 
2319
 
 
2320
2304
class UnknownSSH(BzrError):
2321
2305
 
2322
2306
    _fmt = "Unrecognised value for BZR_SSH environment variable: %(vendor)s"
2503
2487
 
2504
2488
class MalformedBugIdentifier(BzrError):
2505
2489
 
2506
 
    _fmt = "Did not understand bug identifier %(bug_id)s: %(reason)s"
 
2490
    _fmt = ('Did not understand bug identifier %(bug_id)s: %(reason)s. '
 
2491
            'See "bzr help bugs" for more information on this feature.')
2507
2492
 
2508
2493
    def __init__(self, bug_id, reason):
2509
2494
        self.bug_id = bug_id
2530
2515
        self.branch = branch
2531
2516
 
2532
2517
 
 
2518
class InvalidLineInBugsProperty(BzrError):
 
2519
 
 
2520
    _fmt = ("Invalid line in bugs property: '%(line)s'")
 
2521
 
 
2522
    def __init__(self, line):
 
2523
        self.line = line
 
2524
 
 
2525
 
 
2526
class InvalidBugStatus(BzrError):
 
2527
 
 
2528
    _fmt = ("Invalid bug status: '%(status)s'")
 
2529
 
 
2530
    def __init__(self, status):
 
2531
        self.status = status
 
2532
 
 
2533
 
2533
2534
class UnexpectedSmartServerResponse(BzrError):
2534
2535
 
2535
2536
    _fmt = "Could not understand response from smart server: %(response_tuple)r"
2841
2842
    pass
2842
2843
 
2843
2844
 
2844
 
class NotATerminal(BzrError):
2845
 
 
2846
 
    _fmt = 'Unable to ask for a password without real terminal.'
2847
 
 
2848
 
 
2849
2845
class UnableEncodePath(BzrError):
2850
2846
 
2851
2847
    _fmt = ('Unable to encode %(kind)s path %(path)r in '
2956
2952
        BzrError.__init__(self, invalid_id=invalid_id)
2957
2953
 
2958
2954
 
 
2955
class JailBreak(BzrError):
 
2956
 
 
2957
    _fmt = "An attempt to access a url outside the server jail was made: '%(url)s'."
 
2958
 
 
2959
    def __init__(self, url):
 
2960
        BzrError.__init__(self, url=url)
 
2961
 
 
2962
 
2959
2963
class UserAbort(BzrError):
2960
2964
 
2961
2965
    _fmt = 'The user aborted the operation.'
3021
3025
 
3022
3026
    def __init__(self, repository):
3023
3027
        self.repository = repository
 
3028
 
 
3029
 
 
3030
class LossyPushToSameVCS(BzrError):
 
3031
 
 
3032
    _fmt = ("Lossy push not possible between %(source_branch)r and "
 
3033
            "%(target_branch)r that are in the same VCS.")
 
3034
 
 
3035
    internal_error = True
 
3036
 
 
3037
    def __init__(self, source_branch, target_branch):
 
3038
        self.source_branch = source_branch
 
3039
        self.target_branch = target_branch