def do(self, path): try: t = self.transport_from_client_path(path) except errors.PathNotChild: # The client is trying to ask about a path that they have no access # to. # Ideally we'd return a FailedSmartServerResponse here rather than # a "successful" negative, but we want to be compatibile with # clients that don't anticipate errors from this method. answer = 'no' else: bzr_prober = BzrProber() try: bzr_prober.probe_transport(t) except (errors.NotBranchError, errors.UnknownFormatError): answer = 'no' else: answer = 'yes' return SuccessfulSmartServerResponse((answer,))
def do(self, path): try: t = self.transport_from_client_path(path) except errors.PathNotChild: # The client is trying to ask about a path that they have no access # to. # Ideally we'd return a FailedSmartServerResponse here rather than # a "successful" negative, but we want to be compatibile with # clients that don't anticipate errors from this method. answer = 'no' else: bzr_prober = BzrProber() try: bzr_prober.probe_transport(t) except (errors.NotBranchError, errors.UnknownFormatError): answer = 'no' else: answer = 'yes' return SuccessfulSmartServerResponse((answer, ))
def probe_transport(klass, transport): klass.seen_urls.append(transport.base) return BzrProber.probe_transport(transport)