/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 errors.py

mention the requirement to install Dulwich.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
 
18
17
"""A grouping of Exceptions for bzr-git"""
19
18
 
20
 
 
 
19
from bzrlib import errors as bzr_errors
21
20
from dulwich import errors as git_errors
22
21
 
23
 
from bzrlib import errors as bzr_errors
24
 
 
25
22
 
26
23
class BzrGitError(bzr_errors.BzrError):
27
24
    """The base-level exception for bzr-git errors."""
39
36
 
40
37
 
41
38
class NoSuchRef(BzrGitError):
42
 
    """Raised when a ref can not be found."""
 
39
    """Raised when a ref can not be found.""" 
43
40
 
44
41
    _fmt = "The ref %(ref)s was not found."
45
 
 
46
 
    def __init__(self, ref, present_refs=None):
 
42
    
 
43
    def __init__(self, ref):
47
44
        self.ref = ref
48
 
        self.present_refs = present_refs
49
 
 
50
 
 
51
 
def convert_dulwich_error(error):
52
 
    """Convert a Dulwich error to a Bazaar error."""
53
 
 
54
 
    if isinstance(error, git_errors.HangupException):
55
 
        raise bzr_errors.ConnectionReset(error.msg, "")
56
 
    raise error
57
 
 
58
 
 
59
 
class NoPushSupport(bzr_errors.BzrError):
60
 
    _fmt = "Push is not yet supported for bzr-git. Try dpush instead."
61
 
 
62
 
 
63
 
class GitSmartRemoteNotSupported(bzr_errors.BzrError):
64
 
    _fmt = "This operation is not supported by the Git smart server protocol."
 
45
 
 
46
class LightWeightCheckoutsNotSupported(BzrGitError):
 
47
    _fmt = "bzr-git does not support creating lightweight checkouts at the moment."