Beispiel #1
0
    def setUp(self):
        register_urlparse_netloc_protocol(_hooked_scheme)
        register_transport(_hooked_scheme, ConnectionHookedTransport)

        def unregister():
            unregister_transport(_hooked_scheme, ConnectionHookedTransport)
            _unregister_urlparse_netloc_protocol(_hooked_scheme)

        self.addCleanup(unregister)
        super(TestCaseWithConnectionHookedTransport, self).setUp()
        self.reset_connections()
Beispiel #2
0
    def setUp(self):
        """Set up the test environment."""
        super(BranchTestCase, self).setUp()

        register_urlparse_netloc_protocol('lp')
        directories.register('lp:',
                             TarmacDirectoryFactory(self.TEST_ROOT),
                             'Fake factory for lp: urls',
                             override_existing=True)

        self.branch1, self.branch2 = self.make_two_branches_to_merge()
    DEPRECATED_PARAMETER,
    deprecated_in,
    deprecated_passed,
    warn,
    )
from bzrlib.trace import mutter, warning
from bzrlib.transport import (
    AppendBasedFileStream,
    ConnectedTransport,
    _file_streams,
    register_urlparse_netloc_protocol,
    Server,
    )


register_urlparse_netloc_protocol('aftp')


class FtpPathError(errors.PathError):
    """FTP failed for path: %(path)s%(extra)s"""


class FtpStatResult(object):

    def __init__(self, f, abspath):
        try:
            self.st_size = f.size(abspath)
            self.st_mode = stat.S_IFREG
        except ftplib.error_perm:
            pwd = f.pwd()
            try:
Beispiel #4
0
__version__ = '1.12.2'
version_info = tuple(int(n) for n in __version__.split('.'))

import bzrlib

# Don't go further if we are not compatible
if bzrlib.version_info < (1, 12):
    # We need bzr 1.12
    from bzrlib import trace
    trace.note('not installing http[s]+webdav:// support'
               ' (only supported for bzr 1.12 and above)')
else:
    from bzrlib import transport

    transport.register_urlparse_netloc_protocol('http+webdav')
    transport.register_urlparse_netloc_protocol('https+webdav')

    transport.register_lazy_transport('https+webdav://',
                                      'bzrlib.plugins.webdav.webdav',
                                      'HttpDavTransport')
    transport.register_lazy_transport('http+webdav://',
                                      'bzrlib.plugins.webdav.webdav',
                                      'HttpDavTransport')


    def load_tests(basic_tests, module, loader):
        testmod_names = [
            'tests',
            ]
        basic_tests.addTest(loader.loadTestsFromModuleNames(
from bzrlib import (
    debug,
    errors,
    trace,
    transport,
    )
from bzrlib.i18n import gettext

from bzrlib.plugins.launchpad.lp_registration import (
    LaunchpadService, ResolveLaunchpadPathRequest)
from bzrlib.plugins.launchpad.account import get_lp_login


# As bzrlib.transport.remote may not be loaded yet, make sure bzr+ssh
# is counted as a netloc protocol.
transport.register_urlparse_netloc_protocol('bzr+ssh')
transport.register_urlparse_netloc_protocol('lp')

_ubuntu_series_shortcuts = {
    'n': 'natty',
    'm': 'maverick',
    'l': 'lucid',
    'k': 'karmic',
    'j': 'jaunty',
    'h': 'hardy',
    'd': 'dapper',
    }


class LaunchpadDirectory(object):
Beispiel #6
0
from bzrlib import (
    debug,
    errors,
    trace,
    transport,
)
from bzrlib.i18n import gettext

from bzrlib.plugins.launchpad.lp_registration import (
    LaunchpadService, ResolveLaunchpadPathRequest)
from bzrlib.plugins.launchpad.account import get_lp_login

# As bzrlib.transport.remote may not be loaded yet, make sure bzr+ssh
# is counted as a netloc protocol.
transport.register_urlparse_netloc_protocol('bzr+ssh')
transport.register_urlparse_netloc_protocol('lp')

_ubuntu_series_shortcuts = {
    'n': 'natty',
    'm': 'maverick',
    'l': 'lucid',
    'k': 'karmic',
    'j': 'jaunty',
    'h': 'hardy',
    'd': 'dapper',
}


class LaunchpadDirectory(object):
    def _requires_launchpad_login(self, scheme, netloc, path, query, fragment):
Beispiel #7
0
    trace,
    urlutils,
    )
from bzrlib.transport import (
    get_transport,
    register_urlparse_netloc_protocol,
    )

from bzrlib.plugins.launchpad.lp_registration import (
    LaunchpadService, ResolveLaunchpadPathRequest)
from bzrlib.plugins.launchpad.account import get_lp_login


# As bzrlib.transport.remote may not be loaded yet, make sure bzr+ssh
# is counted as a netloc protocol.
register_urlparse_netloc_protocol('bzr+ssh')
register_urlparse_netloc_protocol('lp')


class LaunchpadDirectory(object):

    def _requires_launchpad_login(self, scheme, netloc, path, query,
                                  fragment):
        """Does the URL require a Launchpad login in order to be reached?

        The URL is specified by its parsed components, as returned from
        urlsplit.
        """
        return (scheme in ('bzr+ssh', 'sftp')
                and (netloc.endswith('launchpad.net')
                     or netloc.endswith('launchpad.dev')))
Beispiel #8
0
    errors,
    osutils,
    urlutils,
)
from bzrlib.trace import mutter, warning
from bzrlib.transport import (
    AppendBasedFileStream,
    ConnectedTransport,
    _file_streams,
    register_urlparse_netloc_protocol,
    Server,
)
from bzrlib.transport.local import LocalURLServer
import bzrlib.ui

register_urlparse_netloc_protocol('aftp')


class FtpPathError(errors.PathError):
    """FTP failed for path: %(path)s%(extra)s"""


class FtpStatResult(object):
    def __init__(self, f, relpath):
        try:
            self.st_size = f.size(relpath)
            self.st_mode = stat.S_IFREG
        except ftplib.error_perm:
            pwd = f.pwd()
            try:
                f.cwd(relpath)