# HG changeset patch # User RhodeCode Admin # Date 2023-02-28 15:42:00 # Node ID 89733dcee7f2c945ae0c7a706ec1a2f799e36799 # Parent b2b1b1e7721f9f37356a90efe03d927c006e7977 core: move git/svn/hg into submodule diff --git a/vcsserver/http_main.py b/vcsserver/http_main.py --- a/vcsserver/http_main.py +++ b/vcsserver/http_main.py @@ -35,7 +35,6 @@ import msgpack import configparser from pyramid.config import Configurator -from pyramid.settings import asbool, aslist from pyramid.wsgi import wsgiapp from pyramid.response import Response @@ -69,7 +68,7 @@ strict_vcs = True git_import_err = None try: - from vcsserver.git import GitFactory, GitRemote + from vcsserver.remote.git import GitFactory, GitRemote except ImportError as e: GitFactory = None GitRemote = None @@ -80,7 +79,7 @@ except ImportError as e: hg_import_err = None try: - from vcsserver.hg import MercurialFactory, HgRemote + from vcsserver.remote.hg import MercurialFactory, HgRemote except ImportError as e: MercurialFactory = None HgRemote = None @@ -91,7 +90,7 @@ except ImportError as e: svn_import_err = None try: - from vcsserver.svn import SubversionFactory, SvnRemote + from vcsserver.remote.svn import SubversionFactory, SvnRemote except ImportError as e: SubversionFactory = None SvnRemote = None diff --git a/vcsserver/remote/__init__.py b/vcsserver/remote/__init__.py new file mode 100644 --- /dev/null +++ b/vcsserver/remote/__init__.py @@ -0,0 +1,17 @@ +# RhodeCode VCSServer provides access to different vcs backends via network. +# Copyright (C) 2014-2020 RhodeCode GmbH +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + diff --git a/vcsserver/git.py b/vcsserver/remote/git.py rename from vcsserver/git.py rename to vcsserver/remote/git.py diff --git a/vcsserver/hg.py b/vcsserver/remote/hg.py rename from vcsserver/hg.py rename to vcsserver/remote/hg.py diff --git a/vcsserver/svn.py b/vcsserver/remote/svn.py rename from vcsserver/svn.py rename to vcsserver/remote/svn.py diff --git a/vcsserver/tests/test_git.py b/vcsserver/tests/test_git.py --- a/vcsserver/tests/test_git.py +++ b/vcsserver/tests/test_git.py @@ -21,8 +21,7 @@ import pytest import dulwich.errors from mock import Mock, patch -from vcsserver import git - +from vcsserver.remote import git SAMPLE_REFS = { 'HEAD': 'fd627b9e0dd80b47be81af07c4a98518244ed2f7', diff --git a/vcsserver/tests/test_hg.py b/vcsserver/tests/test_hg.py --- a/vcsserver/tests/test_hg.py +++ b/vcsserver/tests/test_hg.py @@ -21,9 +21,10 @@ import traceback import pytest from mercurial.error import LookupError -from mock import Mock, MagicMock, patch +from mock import Mock, patch -from vcsserver import exceptions, hg, hgcompat +from vcsserver import exceptions, hgcompat +from vcsserver.remote import hg class TestDiff(object): diff --git a/vcsserver/tests/test_svn.py b/vcsserver/tests/test_svn.py --- a/vcsserver/tests/test_svn.py +++ b/vcsserver/tests/test_svn.py @@ -44,7 +44,7 @@ INVALID_CERTIFICATE_STDERR = '\n'.join([ @pytest.mark.xfail(sys.platform == "cygwin", reason="SVN not packaged for Cygwin") def test_import_remote_repository_certificate_error(stderr, expected_reason): - from vcsserver import svn + from vcsserver.remote import svn factory = mock.Mock() factory.repo = mock.Mock(return_value=mock.Mock()) @@ -63,7 +63,6 @@ def test_import_remote_repository_certif def test_svn_libraries_can_be_imported(): - import svn import svn.client assert svn.client is not None @@ -76,7 +75,7 @@ def test_svn_libraries_can_be_imported() ('http://', (None, None, 'http://')), ]) def test_username_password_extraction_from_url(example_url, parts): - from vcsserver import svn + from vcsserver.remote import svn factory = mock.Mock() factory.repo = mock.Mock(return_value=mock.Mock())