~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Aaron Bentley
  • Date: 2012-07-19 19:27:22 UTC
  • mto: This revision was merged to the branch mainline in revision 6540.
  • Revision ID: aaron@aaronbentley.com-20120719192722-5sadhjwr3kaby7b7
Support foreign branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2893
2893
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2894
2894
 
2895
2895
 
 
2896
class StoringUncommittedNotSupported(BzrError):
 
2897
 
 
2898
    _fmt = ('Branch "%(display_url)s" does not support storing uncommitted'
 
2899
            ' changes.')
 
2900
 
 
2901
    def __init__(self, branch):
 
2902
        import bzrlib.urlutils as urlutils
 
2903
        user_url = getattr(branch, "user_url", None)
 
2904
        if user_url is None:
 
2905
            display_url = str(branch)
 
2906
        else:
 
2907
            display_url = urlutils.unescape_for_display(user_url, 'ascii')
 
2908
        BzrError.__init__(self, branch=branch, display_url=display_url)
 
2909
 
 
2910
 
2896
2911
class ShelvedChanges(UncommittedChanges):
2897
2912
 
2898
2913
    _fmt = ('Working tree "%(display_url)s" has shelved changes'