~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Robert Collins
  • Date: 2008-01-25 10:46:10 UTC
  • mto: This revision was merged to the branch mainline in revision 3211.
  • Revision ID: robertc@robertcollins.net-20080125104610-4qweeqqch2feyxdv
 * The ``register-branch`` command will now use the public url of the branch
   containing the current directory, if one has been set and no explicit branch is provided.
   (Robert Collins)

 * New error ``NoPublicBranch`` for commands that need a public branch to
   operate. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
267
267
        "record_entry_contents.")
268
268
 
269
269
 
 
270
class NoPublicBranch(BzrError):
 
271
 
 
272
    _fmt = 'There is no public branch set for "%(branch_url)s".'
 
273
 
 
274
    def __init__(self, branch):
 
275
        import bzrlib.urlutils as urlutils
 
276
        public_location = urlutils.unescape_for_display(branch.base, 'ascii')
 
277
        BzrError.__init__(self, branch_url=public_location)
 
278
 
 
279
 
270
280
class NoHelpTopic(BzrError):
271
281
 
272
282
    _fmt = ("No help could be found for '%(topic)s'. "