~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Martin Pool
  • Date: 2009-07-17 10:38:41 UTC
  • mfrom: (4536 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4558.
  • Revision ID: mbp@sourcefrog.net-20090717103841-z35onk04bkiw7zb6
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
636
636
        self.url = url
637
637
 
638
638
 
 
639
class UnstackableLocationError(BzrError):
 
640
 
 
641
    _fmt = "The branch '%(branch_url)s' cannot be stacked on '%(target_url)s'."
 
642
 
 
643
    def __init__(self, branch_url, target_url):
 
644
        BzrError.__init__(self)
 
645
        self.branch_url = branch_url
 
646
        self.target_url = target_url
 
647
 
 
648
 
639
649
class UnstackableRepositoryFormat(BzrError):
640
650
 
641
651
    _fmt = ("The repository '%(url)s'(%(format)s) is not a stackable format. "
2083
2093
 
2084
2094
class OutOfDateTree(BzrError):
2085
2095
 
2086
 
    _fmt = "Working tree is out of date, please run 'bzr update'."
 
2096
    _fmt = "Working tree is out of date, please run 'bzr update'.%(more)s"
2087
2097
 
2088
 
    def __init__(self, tree):
 
2098
    def __init__(self, tree, more=None):
 
2099
        if more is None:
 
2100
            more = ''
 
2101
        else:
 
2102
            more = ' ' + more
2089
2103
        BzrError.__init__(self)
2090
2104
        self.tree = tree
 
2105
        self.more = more
2091
2106
 
2092
2107
 
2093
2108
class PublicBranchOutOfDate(BzrError):
2147
2162
        self.reason = reason
2148
2163
 
2149
2164
 
 
2165
class InconsistentDeltaDelta(InconsistentDelta):
 
2166
    """Used when we get a delta that is not valid."""
 
2167
 
 
2168
    _fmt = ("An inconsistent delta was supplied: %(delta)r"
 
2169
            "\nreason: %(reason)s")
 
2170
 
 
2171
    def __init__(self, delta, reason):
 
2172
        BzrError.__init__(self)
 
2173
        self.delta = delta
 
2174
        self.reason = reason
 
2175
 
 
2176
 
2150
2177
class UpgradeRequired(BzrError):
2151
2178
 
2152
2179
    _fmt = "To use this feature you must upgrade your branch at %(path)s."
2768
2795
 
2769
2796
class UncommittedChanges(BzrError):
2770
2797
 
2771
 
    _fmt = 'Working tree "%(display_url)s" has uncommitted changes.'
 
2798
    _fmt = ('Working tree "%(display_url)s" has uncommitted changes'
 
2799
            ' (See bzr status).%(more)s')
2772
2800
 
2773
 
    def __init__(self, tree):
 
2801
    def __init__(self, tree, more=None):
 
2802
        if more is None:
 
2803
            more = ''
 
2804
        else:
 
2805
            more = ' ' + more
2774
2806
        import bzrlib.urlutils as urlutils
2775
2807
        display_url = urlutils.unescape_for_display(
2776
2808
            tree.bzrdir.root_transport.base, 'ascii')
2777
 
        BzrError.__init__(self, tree=tree, display_url=display_url)
 
2809
        BzrError.__init__(self, tree=tree, display_url=display_url, more=more)
2778
2810
 
2779
2811
 
2780
2812
class MissingTemplateVariable(BzrError):