/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 bzrlib/smart/bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-12-21 06:03:07 UTC
  • mfrom: (4665.7.3 serve-init)
  • Revision ID: pqm@pqm.ubuntu.com-20091221060307-uvja3vdy1o6dzzy0
(mbp) example debian init script

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
class SmartServerRequestOpenBzrDir(SmartServerRequest):
35
35
 
36
36
    def do(self, path):
37
 
        from bzrlib.bzrdir import BzrDirFormat
38
37
        try:
39
38
            t = self.transport_from_client_path(path)
40
39
        except errors.PathNotChild:
56
55
        return SuccessfulSmartServerResponse((answer,))
57
56
 
58
57
 
 
58
class SmartServerRequestOpenBzrDir_2_1(SmartServerRequest):
 
59
 
 
60
    def do(self, path):
 
61
        """Is there a BzrDir present, and if so does it have a working tree?
 
62
 
 
63
        New in 2.1.
 
64
        """
 
65
        try:
 
66
            t = self.transport_from_client_path(path)
 
67
        except errors.PathNotChild:
 
68
            # The client is trying to ask about a path that they have no access
 
69
            # to.
 
70
            return SuccessfulSmartServerResponse(('no',))
 
71
        try:
 
72
            bd = BzrDir.open_from_transport(t)
 
73
        except errors.NotBranchError:
 
74
            answer = ('no',)
 
75
        else:
 
76
            answer = ('yes',)
 
77
            if bd.has_workingtree():
 
78
                answer += ('yes',)
 
79
            else:
 
80
                answer += ('no',)
 
81
        return SuccessfulSmartServerResponse(answer)
 
82
 
 
83
 
59
84
class SmartServerRequestBzrDir(SmartServerRequest):
60
85
 
61
86
    def do(self, path, *args):