/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/smart/bzrdir.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from __future__ import absolute_import
20
20
 
21
 
from bzrlib import (
 
21
from .. import (
22
22
    bencode,
23
23
    branch,
24
24
    errors,
25
25
    repository,
26
26
    urlutils,
27
27
    )
28
 
from bzrlib.bzrdir import (
 
28
from ..bzrdir import (
29
29
    BzrDir,
30
30
    BzrDirFormat,
31
31
    BzrProber,
32
32
    )
33
 
from bzrlib.controldir import (
 
33
from ..controldir import (
34
34
    network_format_registry,
35
35
    )
36
 
from bzrlib.smart.request import (
 
36
from .request import (
37
37
    FailedSmartServerResponse,
38
38
    SmartServerRequest,
39
39
    SuccessfulSmartServerResponse,
96
96
        try:
97
97
            self._bzrdir = BzrDir.open_from_transport(
98
98
                self.transport_from_client_path(path))
99
 
        except errors.NotBranchError, e:
 
99
        except errors.NotBranchError as e:
100
100
            return FailedSmartServerResponse(('nobranch',))
101
101
        return self.do_bzrdir_request(*args)
102
102
 
137
137
        """
138
138
        try:
139
139
            self._bzrdir.destroy_branch(name)
140
 
        except errors.NotBranchError, e:
 
140
        except errors.NotBranchError as e:
141
141
            return FailedSmartServerResponse(('nobranch',))
142
142
        return SuccessfulSmartServerResponse(('ok',))
143
143
 
169
169
        """
170
170
        try:
171
171
            self._bzrdir.destroy_repository()
172
 
        except errors.NoRepositoryPresent, e:
 
172
        except errors.NoRepositoryPresent as e:
173
173
            return FailedSmartServerResponse(('norepository',))
174
174
        return SuccessfulSmartServerResponse(('ok',))
175
175
 
572
572
                return SuccessfulSmartServerResponse(('ok', ''))
573
573
            else:
574
574
                return SuccessfulSmartServerResponse(('ok', reference_url))
575
 
        except errors.NotBranchError, e:
 
575
        except errors.NotBranchError as e:
576
576
            return FailedSmartServerResponse(('nobranch',))
577
577
 
578
578
 
588
588
                return SuccessfulSmartServerResponse(('branch', format))
589
589
            else:
590
590
                return SuccessfulSmartServerResponse(('ref', reference_url))
591
 
        except errors.NotBranchError, e:
 
591
        except errors.NotBranchError as e:
592
592
            return FailedSmartServerResponse(('nobranch',))
593
593
 
594
594
 
612
612
                return SuccessfulSmartServerResponse(('branch', format))
613
613
            else:
614
614
                return SuccessfulSmartServerResponse(('ref', reference_url))
615
 
        except errors.NotBranchError, e:
 
615
        except errors.NotBranchError as e:
616
616
            # Stringify the exception so that its .detail attribute will be
617
617
            # filled out.
618
618
            str(e)