/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: Vincent Ladeuil
  • Date: 2010-01-25 15:55:48 UTC
  • mto: (4985.1.4 add-attr-cleanup)
  • mto: This revision was merged to the branch mainline in revision 4988.
  • Revision ID: v.ladeuil+lp@free.fr-20100125155548-0l352pujvt5bzl5e
Deploy addAttrCleanup on the whole test suite.

Several use case worth mentioning:

- setting a module or any other object attribute is the majority
by far. In some cases the setting itself is deferred but most of
the time we want to set at the same time we add the cleanup.

- there multiple occurrences of protecting hooks or ui factory
which are now useless (the test framework takes care of that now),

- there was some lambda uses that can now be avoided.

That first cleanup already simplifies things a lot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1179
1179
 
1180
1180
class InvalidRevisionSpec(BzrError):
1181
1181
 
1182
 
    _fmt = ("Requested revision: '%(spec)s' does not exist in branch:"
 
1182
    _fmt = ("Requested revision: %(spec)r does not exist in branch:"
1183
1183
            " %(branch)s%(extra)s")
1184
1184
 
1185
1185
    def __init__(self, spec, branch, extra=None):
1297
1297
class BoundBranchOutOfDate(BzrError):
1298
1298
 
1299
1299
    _fmt = ("Bound branch %(branch)s is out of date with master branch"
1300
 
            " %(master)s.%(extra_help)s")
 
1300
            " %(master)s.")
1301
1301
 
1302
1302
    def __init__(self, branch, master):
1303
1303
        BzrError.__init__(self)
1304
1304
        self.branch = branch
1305
1305
        self.master = master
1306
 
        self.extra_help = ''
1307
1306
 
1308
1307
 
1309
1308
class CommitToDoubleBoundBranch(BzrError):
2176
2175
 
2177
2176
    def __init__(self, repo):
2178
2177
        BzrError.__init__(self)
2179
 
        self.repo_path = repo.user_url
 
2178
        self.repo_path = repo.bzrdir.root_transport.base
2180
2179
 
2181
2180
 
2182
2181
class InconsistentDelta(BzrError):
2754
2753
 
2755
2754
    def __init__(self, bzrdir):
2756
2755
        import bzrlib.urlutils as urlutils
2757
 
        display_url = urlutils.unescape_for_display(bzrdir.user_url,
 
2756
        display_url = urlutils.unescape_for_display(bzrdir.root_transport.base,
2758
2757
                                                    'ascii')
2759
2758
        BzrError.__init__(self, bzrdir=bzrdir, display_url=display_url)
2760
2759
 
2835
2834
            more = ' ' + more
2836
2835
        import bzrlib.urlutils as urlutils
2837
2836
        display_url = urlutils.unescape_for_display(
2838
 
            tree.user_url, 'ascii')
 
2837
            tree.bzrdir.root_transport.base, 'ascii')
2839
2838
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2840
2839
 
2841
2840
 
3125
3124
 
3126
3125
    def __init__(self, path):
3127
3126
        self.path = path
3128
 
 
3129
 
 
3130
 
class NoColocatedBranchSupport(BzrError):
3131
 
 
3132
 
    _fmt = ("%(bzrdir)r does not support co-located branches.")
3133
 
 
3134
 
    def __init__(self, bzrdir):
3135
 
        self.bzrdir = bzrdir
3136