Esempio n. 1
0
                self.local_site_name = m.group(1)
                base = base.replace(m.group(0), '')
            else:
                self.local_site_name = None

            super(RBRemoteSSHTransport, self).__init__(
                base.encode('ascii'), *args, **kwargs)

        def _build_medium(self):
            client_medium, auth = \
                super(RBRemoteSSHTransport, self)._build_medium()
            client_medium._vendor = RBSSHVendor(self.local_site_name)
            return client_medium, auth

    vendor = RBSSHVendor()
    register_ssh_vendor("rbssh", vendor)
    register_default_ssh_vendor(vendor)
    sshutils.register_rbssh('BZR_SSH')
    register_lazy_transport('bzr+ssh://', 'reviewboard.scmtools.bzr',
                            'RBRemoteSSHTransport')


class BZRTool(SCMTool):
    """An interface to the Bazaar SCM (http://bazaar-vcs.org/)"""
    name = "Bazaar"
    dependencies = {
        'modules': ['bzrlib'],
    }

    # Timestamp format in bzr diffs.
    # This isn't totally accurate: there should be a %z at the end.
Esempio n. 2
0
            subsystem (unicode, optional):
                The SSH subsystem to use.

            command (unicode, optional):
                The command to invoke through the SSH connection.

        Returns:
            list of unicode:
            The list of arguments to pass to :command:`rbssh`.
        """
        args = [self.executable_path]

        if port is not None:
            args.extend(['-p', six.text_type(port)])

        if username is not None:
            args.extend(['-l', username])

        if subsystem is not None:
            args.extend(['-s', host, subsystem])
        else:
            args.extend([host] + command)

        return args


vendor = RBSSHVendor()
register_ssh_vendor('rbssh', vendor)
register_default_ssh_vendor(vendor)
Esempio n. 3
0
            if m:
                self.local_site_name = m.group(1)
                base = base.replace(m.group(0), '')
            else:
                self.local_site_name = None

            super(RBRemoteSSHTransport, self).__init__(base, *args, **kwargs)

        def _build_medium(self):
            client_medium, auth = \
                super(RBRemoteSSHTransport, self)._build_medium()
            client_medium._vendor = RBSSHVendor(self.local_site_name)
            return client_medium, auth

    vendor = RBSSHVendor()
    register_ssh_vendor("rbssh", vendor)
    register_default_ssh_vendor(vendor)
    sshutils.register_rbssh('BZR_SSH')
    register_lazy_transport('bzr+ssh://', 'reviewboard.scmtools.bzr',
                            'RBRemoteSSHTransport')

# BZRTool: An interface to Bazaar SCM Tool (http://bazaar-vcs.org/)


class BZRTool(SCMTool):
    name = "Bazaar"
    dependencies = {
        'modules': ['bzrlib'],
    }

    # Timestamp format in bzr diffs.
Esempio n. 4
0
            subsystem (unicode, optional):
                The SSH subsystem to use.

            command (unicode, optional):
                The command to invoke through the SSH connection.

        Returns:
            list of unicode:
            The list of arguments to pass to :command:`rbssh`.
        """
        args = [self.executable_path]

        if port is not None:
            args.extend(['-p', six.text_type(port)])

        if username is not None:
            args.extend(['-l', username])

        if subsystem is not None:
            args.extend(['-s', host, subsystem])
        else:
            args.extend([host] + command)

        return args


vendor = RBSSHVendor()
register_ssh_vendor('rbssh', vendor)
register_default_ssh_vendor(vendor)