/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: Neil Martinsen-Burrell
  • Date: 2010-07-19 15:11:18 UTC
  • mto: (5353.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5354.
  • Revision ID: nmb@wartburg.edu-20100719151118-ytll8dl53vz4huba
use a computed URL member rather than a custom __str__ method as suggested by JAM in review

Show diffs side-by-side

added added

removed removed

Lines of Context:
1177
1177
 
1178
1178
class InvalidRevisionSpec(BzrError):
1179
1179
 
 
1180
    _fmt = ("Requested revision: '%(spec)s' does not exist in branch:"
 
1181
            " %(branch_url)s%(extra)s")
 
1182
 
1180
1183
    def __init__(self, spec, branch, extra=None):
1181
1184
        BzrError.__init__(self, branch=branch, spec=spec)
 
1185
        self.branch_url = getattr(branch, 'user_url', str(branch))
1182
1186
        if extra:
1183
1187
            self.extra = '\n' + str(extra)
1184
1188
        else:
1185
1189
            self.extra = ''
1186
1190
 
1187
 
    def __str__(self):
1188
 
        _fmt = ("Requested revision: '%s' does not exist in branch:"
1189
 
                " %s%s"
1190
 
                % (self.spec, self.branch.user_url, self.extra))
1191
 
 
1192
 
        return str(_fmt)
1193
 
 
1194
1191
 
1195
1192
class HistoryMissing(BzrError):
1196
1193