hgitaly 18.6.1__tar.gz → 18.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hgitaly-18.6.1/hgitaly.egg-info → hgitaly-18.7.0}/PKG-INFO +11 -6
- {hgitaly-18.6.1 → hgitaly-18.7.0}/README.md +9 -4
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/rhgitaly.py +8 -1
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_blob_tree.py +4 -5
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_commit.py +11 -15
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_ref.py +1 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_repository_service.py +12 -11
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgext3rd/hgitaly/__init__.py +2 -13
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgext3rd/hgitaly/tests/test_serve.py +0 -31
- hgitaly-18.7.0/hgitaly/VERSION +1 -0
- hgitaly-18.7.0/hgitaly/git.py +34 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/gitlab_ref.py +3 -39
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/manifest.py +0 -13
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/message.py +0 -11
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/procutil.py +2 -10
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/server/__init__.py +6 -3
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/server/worker.py +1 -1
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/commit.py +9 -499
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/repository.py +0 -86
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/fixture.py +0 -12
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_commit.py +26 -622
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_mercurial_operations.py +13 -53
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_operations.py +5 -25
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_repository_service.py +0 -156
- hgitaly-18.7.0/hgitaly/stub/commit_pb2.py +265 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/operations_pb2.py +52 -52
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/testing/storage.py +17 -3
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_gitlab_ref.py +1 -23
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_servicer.py +16 -8
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_workdir.py +18 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0/hgitaly.egg-info}/PKG-INFO +11 -6
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly.egg-info/SOURCES.txt +21 -23
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly.egg-info/requires.txt +1 -1
- hgitaly-18.7.0/hgitaly.egg-info/top_level.txt +3 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/install-requirements.txt +1 -1
- hgitaly-18.6.1/hgitaly/VERSION +0 -1
- hgitaly-18.6.1/hgitaly/git.py +0 -137
- hgitaly-18.6.1/hgitaly/server/prefork.py +0 -215
- hgitaly-18.6.1/hgitaly/server/tests/test_prefork.py +0 -288
- hgitaly-18.6.1/hgitaly/stub/commit_pb2.py +0 -265
- hgitaly-18.6.1/hgitaly.egg-info/top_level.txt +0 -3
- {hgitaly-18.6.1 → hgitaly-18.7.0}/LICENSE +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/MANIFEST.in +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/__init__.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/comparison.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/conftest.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/gitaly.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/hgitaly_rhgitaly_comparison.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_comparison.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_diff.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_gitaly_server.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_mercurial_aux_git.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_mercurial_operations.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_mercurial_repository.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_operations.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_remote.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_rhgitaly_server.py +0 -0
- {hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_server.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgext3rd/__init__.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgext3rd/hgitaly/revset.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgext3rd/hgitaly/tests/__init__.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgext3rd/hgitaly/tests/test_revset.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/__init__.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/branch.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/changelog.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/diff.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/errors.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/feature.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/file_content.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/file_context.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/identification.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/logging.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/oid.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/pagination.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/path.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/peer.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/repository.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/revision.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/revset.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/scripts.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/server/address.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/server/mono.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/server/tests/__init__.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/server/tests/test_address.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/server/tests/test_mono.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/server/tests/test_worker.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/__init__.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/analysis.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/blob.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/diff.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/interceptors.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/mercurial_changeset.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/mercurial_namespace.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/mercurial_operations.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/mercurial_repository.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/operations.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/ref.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/server.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/__init__.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_analysis.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_blob.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_default_branch.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_diff.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_mercurial_changeset.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_mercurial_namespace.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_mercurial_repository.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_ref.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/service/tests/test_server.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/servicer.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/ssh.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stream.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/__init__.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/analysis_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/analysis_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/blob_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/blob_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/commit_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/diff_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/diff_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/errors_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/errors_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/lint_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/lint_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/mercurial_aux_git_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/mercurial_aux_git_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/mercurial_changeset_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/mercurial_changeset_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/mercurial_namespace_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/mercurial_namespace_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/mercurial_operations_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/mercurial_operations_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/mercurial_repository_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/mercurial_repository_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/operations_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/ref_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/ref_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/remote_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/remote_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/repository_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/repository_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/server_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/server_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/shared_pb2.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/stub/shared_pb2_grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tag.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/testing/__init__.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/testing/bundle.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/testing/context.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/testing/grpc.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/testing/multiprocessing.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/testing/repo.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/testing/ssh.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/testing/sshd.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/testing/tests/__init__.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/testing/tests/test_sshd.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/__init__.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/common.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_branch.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_diff.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_errors.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_feature.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_file_context.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_identification.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_manifest.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_messages.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_oid.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_peer.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_repository.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_revision.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_revset.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_stream.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/tests/test_tag.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/util.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly/workdir.py +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly.egg-info/dependency_links.txt +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/hgitaly.egg-info/entry_points.txt +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/setup.cfg +0 -0
- {hgitaly-18.6.1 → hgitaly-18.7.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hgitaly
|
|
3
|
-
Version: 18.
|
|
3
|
+
Version: 18.7.0
|
|
4
4
|
Summary: Server-side implementation of Gitaly protocol for Mercurial
|
|
5
5
|
Home-page: https://foss.heptapod.net/heptapod/hgitaly
|
|
6
6
|
Author: Georges Racinet
|
|
@@ -10,7 +10,7 @@ Keywords: hg mercurial heptapod gitlab
|
|
|
10
10
|
Requires-Python: >=3.8
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
|
13
|
-
Requires-Dist: heptapod~=5.
|
|
13
|
+
Requires-Dist: heptapod~=5.5.0
|
|
14
14
|
Requires-Dist: protobuf~=6.31.1
|
|
15
15
|
Requires-Dist: grpcio~=1.76.0
|
|
16
16
|
Requires-Dist: grpcio-status~=1.76.0
|
|
@@ -278,16 +278,21 @@ actually a mix of:
|
|
|
278
278
|
- Gitaly documentation and source code.
|
|
279
279
|
- sampling of Gitaly responses.
|
|
280
280
|
|
|
281
|
-
#### Gitaly comparison tests
|
|
281
|
+
#### Gitaly comparison and other functional tests
|
|
282
282
|
|
|
283
283
|
If an appropriate Gitaly installation is found, `run-all-tests` will also
|
|
284
|
-
run the tests from the `
|
|
284
|
+
run the tests from the `functional_tests` package. This happens automatically
|
|
285
285
|
from within a [HDK] workspace.
|
|
286
286
|
|
|
287
287
|
These are precisely meant for what the Mercurial integration tests can't do:
|
|
288
288
|
check that HGitaly responses take the form expected by the various Gitaly
|
|
289
289
|
clients, by comparing directly with the reference Gitaly implementation.
|
|
290
290
|
|
|
291
|
+
Some of the included tests also compare the output of RHGitaly and HGitaly,
|
|
292
|
+
when both implementations exist or just test RHGitaly standalone (when
|
|
293
|
+
comparison with Gitaly makes no sense, e.g. because the method is defined
|
|
294
|
+
in the HGitaly protocol, and there is no Python implementation).
|
|
295
|
+
|
|
291
296
|
The comparisons work by using the conversions to Git provided by
|
|
292
297
|
`py-heptapod`, which are precisely what HGitaly aims to replace as a mean
|
|
293
298
|
to expose Mercurial content to GitLab.
|
|
@@ -368,10 +373,10 @@ In some rare cases, the drop in coverage could be due to an actual change
|
|
|
368
373
|
between Mercurial versions. If that happens, there are good chances that an
|
|
369
374
|
actual bug is lurking around.
|
|
370
375
|
|
|
371
|
-
#### How to run the tests with coverage of the
|
|
376
|
+
#### How to run the tests with coverage of the functional tests
|
|
372
377
|
|
|
373
378
|
```
|
|
374
|
-
./run-all-tests --cov
|
|
379
|
+
./run-all-tests --cov functional_tests --cov-report html
|
|
375
380
|
```
|
|
376
381
|
|
|
377
382
|
The HTML report will be nice if you don't have 100% coverage. To display it,
|
|
@@ -255,16 +255,21 @@ actually a mix of:
|
|
|
255
255
|
- Gitaly documentation and source code.
|
|
256
256
|
- sampling of Gitaly responses.
|
|
257
257
|
|
|
258
|
-
#### Gitaly comparison tests
|
|
258
|
+
#### Gitaly comparison and other functional tests
|
|
259
259
|
|
|
260
260
|
If an appropriate Gitaly installation is found, `run-all-tests` will also
|
|
261
|
-
run the tests from the `
|
|
261
|
+
run the tests from the `functional_tests` package. This happens automatically
|
|
262
262
|
from within a [HDK] workspace.
|
|
263
263
|
|
|
264
264
|
These are precisely meant for what the Mercurial integration tests can't do:
|
|
265
265
|
check that HGitaly responses take the form expected by the various Gitaly
|
|
266
266
|
clients, by comparing directly with the reference Gitaly implementation.
|
|
267
267
|
|
|
268
|
+
Some of the included tests also compare the output of RHGitaly and HGitaly,
|
|
269
|
+
when both implementations exist or just test RHGitaly standalone (when
|
|
270
|
+
comparison with Gitaly makes no sense, e.g. because the method is defined
|
|
271
|
+
in the HGitaly protocol, and there is no Python implementation).
|
|
272
|
+
|
|
268
273
|
The comparisons work by using the conversions to Git provided by
|
|
269
274
|
`py-heptapod`, which are precisely what HGitaly aims to replace as a mean
|
|
270
275
|
to expose Mercurial content to GitLab.
|
|
@@ -345,10 +350,10 @@ In some rare cases, the drop in coverage could be due to an actual change
|
|
|
345
350
|
between Mercurial versions. If that happens, there are good chances that an
|
|
346
351
|
actual bug is lurking around.
|
|
347
352
|
|
|
348
|
-
#### How to run the tests with coverage of the
|
|
353
|
+
#### How to run the tests with coverage of the functional tests
|
|
349
354
|
|
|
350
355
|
```
|
|
351
|
-
./run-all-tests --cov
|
|
356
|
+
./run-all-tests --cov functional_tests --cov-report html
|
|
352
357
|
```
|
|
353
358
|
|
|
354
359
|
The HTML report will be nice if you don't have 100% coverage. To display it,
|
|
@@ -69,11 +69,18 @@ class RHGitalyServer:
|
|
|
69
69
|
if rhgitaly_exe is None: # pragma no cover
|
|
70
70
|
subprocess.check_call(('cargo', 'build', '--locked'),
|
|
71
71
|
cwd=rhgitaly_dir)
|
|
72
|
-
run_cmd =
|
|
72
|
+
run_cmd = ['cargo', 'run', '--']
|
|
73
73
|
else: # pragma no cover
|
|
74
74
|
# Popen would not run a relative binary so easily
|
|
75
75
|
run_cmd = [Path(rhgitaly_exe).resolve()]
|
|
76
76
|
|
|
77
|
+
conf = self.home_dir / 'rhgitaly.toml'
|
|
78
|
+
conf.write_text('\n'.join((
|
|
79
|
+
"[sidecar]",
|
|
80
|
+
"managed = false",
|
|
81
|
+
)))
|
|
82
|
+
run_cmd.extend(("--config", conf))
|
|
83
|
+
|
|
77
84
|
with open(self.home_dir / 'rhgitaly.log', 'w') as logf:
|
|
78
85
|
rhgitaly = subprocess.Popen(
|
|
79
86
|
run_cmd,
|
|
@@ -108,9 +108,9 @@ def oid_normalizer(oid2git):
|
|
|
108
108
|
return normalizer
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
def test_compare_tree_entry_request(gitaly_rhgitaly_comparison, hg_server):
|
|
111
|
+
def test_compare_tree_entry_request(gitaly_rhgitaly_comparison):
|
|
113
112
|
fixture = gitaly_rhgitaly_comparison
|
|
113
|
+
hg_server = 'rhgitaly'
|
|
114
114
|
|
|
115
115
|
wrapper = fixture.hg_repo_wrapper
|
|
116
116
|
wrapper.write_commit('foo', message="Some foo")
|
|
@@ -302,10 +302,9 @@ def test_compare_tree_entry_request(gitaly_rhgitaly_comparison, hg_server):
|
|
|
302
302
|
)
|
|
303
303
|
|
|
304
304
|
|
|
305
|
-
|
|
306
|
-
def test_compare_get_tree_entries_pagination(gitaly_rhgitaly_comparison,
|
|
307
|
-
hg_server):
|
|
305
|
+
def test_compare_get_tree_entries_pagination(gitaly_rhgitaly_comparison):
|
|
308
306
|
fixture = gitaly_rhgitaly_comparison
|
|
307
|
+
hg_server = 'rhgitaly'
|
|
309
308
|
|
|
310
309
|
wrapper = fixture.hg_repo_wrapper
|
|
311
310
|
wrapper.write_commit('foo', message="Some foo")
|
|
@@ -41,8 +41,7 @@ if skip_comparison_tests(): # pragma no cover
|
|
|
41
41
|
parametrize = pytest.mark.parametrize
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
def test_compare_last_commit_for(gitaly_rhgitaly_comparison, hg_server):
|
|
44
|
+
def test_compare_last_commit_for(gitaly_rhgitaly_comparison):
|
|
46
45
|
fixture = gitaly_rhgitaly_comparison
|
|
47
46
|
git_repo = fixture.git_repo
|
|
48
47
|
|
|
@@ -80,7 +79,7 @@ def test_compare_last_commit_for(gitaly_rhgitaly_comparison, hg_server):
|
|
|
80
79
|
normalize_commit_message(commit_for_tree.commit)
|
|
81
80
|
|
|
82
81
|
rpc_helper = fixture.rpc_helper(stub_cls=CommitServiceStub,
|
|
83
|
-
hg_server=
|
|
82
|
+
hg_server='rhgitaly',
|
|
84
83
|
method_name='ListLastCommitsForTree',
|
|
85
84
|
streaming=True,
|
|
86
85
|
request_cls=ListLastCommitsForTreeRequest,
|
|
@@ -131,7 +130,7 @@ def test_compare_last_commit_for(gitaly_rhgitaly_comparison, hg_server):
|
|
|
131
130
|
normalize_commit_message(response.commit)
|
|
132
131
|
|
|
133
132
|
rpc_helper = fixture.rpc_helper(stub_cls=CommitServiceStub,
|
|
134
|
-
hg_server=
|
|
133
|
+
hg_server='rhgitaly',
|
|
135
134
|
method_name='LastCommitForPath',
|
|
136
135
|
request_cls=LastCommitForPathRequest,
|
|
137
136
|
request_sha_attrs=['revision'],
|
|
@@ -407,8 +406,7 @@ def test_compare_list_files(gitaly_comparison):
|
|
|
407
406
|
rpc_helper.assert_compare(revision=rev)
|
|
408
407
|
|
|
409
408
|
|
|
410
|
-
|
|
411
|
-
def test_compare_find_commit(gitaly_rhgitaly_comparison, hg_server):
|
|
409
|
+
def test_compare_find_commit(gitaly_rhgitaly_comparison):
|
|
412
410
|
fixture = gitaly_rhgitaly_comparison
|
|
413
411
|
wrapper = fixture.hg_repo_wrapper
|
|
414
412
|
|
|
@@ -417,7 +415,7 @@ def test_compare_find_commit(gitaly_rhgitaly_comparison, hg_server):
|
|
|
417
415
|
normalize_commit_message(response.commit)
|
|
418
416
|
|
|
419
417
|
rpc_helper = fixture.rpc_helper(
|
|
420
|
-
hg_server=
|
|
418
|
+
hg_server='rhgitaly',
|
|
421
419
|
stub_cls=CommitServiceStub,
|
|
422
420
|
method_name='FindCommit',
|
|
423
421
|
request_cls=FindCommitRequest,
|
|
@@ -763,7 +761,8 @@ def test_compare_list_commits(gitaly_comparison):
|
|
|
763
761
|
request_defaults=dict(
|
|
764
762
|
pagination_params=PaginationParameter(limit=10)),
|
|
765
763
|
request_sha_attrs=['revision'],
|
|
766
|
-
response_sha_attrs=['commits[].id', 'commits[].parent_ids[]'
|
|
764
|
+
response_sha_attrs=['commits[].id', 'commits[].parent_ids[]',
|
|
765
|
+
'pagination_cursor.next_cursor'],
|
|
767
766
|
normalizer=normalizer,
|
|
768
767
|
)
|
|
769
768
|
rpc_helper.sorted = False
|
|
@@ -922,8 +921,7 @@ def test_compare_list_commits(gitaly_comparison):
|
|
|
922
921
|
same_details=False)
|
|
923
922
|
|
|
924
923
|
|
|
925
|
-
|
|
926
|
-
def test_compare_list_commits_by_oid(gitaly_rhgitaly_comparison, hg_server):
|
|
924
|
+
def test_compare_list_commits_by_oid(gitaly_rhgitaly_comparison):
|
|
927
925
|
fixture = gitaly_rhgitaly_comparison
|
|
928
926
|
wrapper = fixture.hg_repo_wrapper
|
|
929
927
|
|
|
@@ -944,7 +942,7 @@ def test_compare_list_commits_by_oid(gitaly_rhgitaly_comparison, hg_server):
|
|
|
944
942
|
del response.commits[:]
|
|
945
943
|
|
|
946
944
|
rpc_helper = fixture.rpc_helper(
|
|
947
|
-
hg_server=
|
|
945
|
+
hg_server='rhgitaly',
|
|
948
946
|
stub_cls=CommitServiceStub,
|
|
949
947
|
method_name='ListCommitsByOid',
|
|
950
948
|
request_cls=ListCommitsByOidRequest,
|
|
@@ -980,9 +978,7 @@ def test_compare_list_commits_by_oid(gitaly_rhgitaly_comparison, hg_server):
|
|
|
980
978
|
rpc_helper.assert_compare(oid=[NULL_HEX, hexes[0]])
|
|
981
979
|
|
|
982
980
|
|
|
983
|
-
|
|
984
|
-
def test_compare_list_commits_by_ref_name(gitaly_rhgitaly_comparison,
|
|
985
|
-
hg_server):
|
|
981
|
+
def test_compare_list_commits_by_ref_name(gitaly_rhgitaly_comparison):
|
|
986
982
|
fixture = gitaly_rhgitaly_comparison
|
|
987
983
|
wrapper = fixture.hg_repo_wrapper
|
|
988
984
|
|
|
@@ -996,7 +992,7 @@ def test_compare_list_commits_by_ref_name(gitaly_rhgitaly_comparison,
|
|
|
996
992
|
)
|
|
997
993
|
|
|
998
994
|
rpc_helper = fixture.rpc_helper(
|
|
999
|
-
hg_server=
|
|
995
|
+
hg_server='rhgitaly',
|
|
1000
996
|
stub_cls=CommitServiceStub,
|
|
1001
997
|
method_name='ListCommitsByRefName',
|
|
1002
998
|
request_cls=ListCommitsByRefNameRequest,
|
|
@@ -122,6 +122,7 @@ def test_update_references(gitaly_rhgitaly_comparison,
|
|
|
122
122
|
normalize_commit_message(response.commit)
|
|
123
123
|
|
|
124
124
|
find_commit_helper = fixture.rpc_helper(
|
|
125
|
+
hg_server='rhgitaly',
|
|
125
126
|
stub_cls=CommitServiceStub,
|
|
126
127
|
method_name='FindCommit',
|
|
127
128
|
request_cls=FindCommitRequest,
|
{hgitaly-18.6.1/tests_with_gitaly → hgitaly-18.7.0/functional_tests}/test_repository_service.py
RENAMED
|
@@ -77,8 +77,7 @@ TESTS_DATA_DIR = Path(__file__).parent / 'data'
|
|
|
77
77
|
TIP_TAG_NAME = b'tip'
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
def test_compare_find_merge_base(gitaly_rhgitaly_comparison, hg_server):
|
|
80
|
+
def test_compare_find_merge_base(gitaly_rhgitaly_comparison):
|
|
82
81
|
fixture = gitaly_rhgitaly_comparison
|
|
83
82
|
gitaly_repo = fixture.gitaly_repo
|
|
84
83
|
git_repo = fixture.git_repo
|
|
@@ -112,10 +111,7 @@ def test_compare_find_merge_base(gitaly_rhgitaly_comparison, hg_server):
|
|
|
112
111
|
parent=node_mod.nullid).hex()
|
|
113
112
|
git_shas[sha4] = git_repo.branches()[b'branch/other']['sha']
|
|
114
113
|
|
|
115
|
-
|
|
116
|
-
hgitaly_channel = fixture.rhgitaly_channel
|
|
117
|
-
else:
|
|
118
|
-
hgitaly_channel = fixture.hgitaly_channel
|
|
114
|
+
hgitaly_channel = fixture.rhgitaly_channel
|
|
119
115
|
diff_stubs = dict(
|
|
120
116
|
git=RepositoryServiceStub(fixture.gitaly_channel),
|
|
121
117
|
hg=RepositoryServiceStub(hgitaly_channel),
|
|
@@ -365,11 +361,10 @@ def test_repository_size(gitaly_comparison,
|
|
|
365
361
|
relative_path='/some/path'))
|
|
366
362
|
|
|
367
363
|
|
|
368
|
-
@parametrize('hg_server', ('hgitaly', 'rhgitaly'))
|
|
369
364
|
def test_has_local_branches(gitaly_rhgitaly_comparison,
|
|
370
|
-
server_repos_root
|
|
371
|
-
hg_server):
|
|
365
|
+
server_repos_root):
|
|
372
366
|
fixture = gitaly_rhgitaly_comparison
|
|
367
|
+
hg_server = 'rhgitaly'
|
|
373
368
|
grpc_repo = fixture.gitaly_repo
|
|
374
369
|
rpc_helper = fixture.rpc_helper(
|
|
375
370
|
hg_server=hg_server,
|
|
@@ -382,6 +377,11 @@ def test_has_local_branches(gitaly_rhgitaly_comparison,
|
|
|
382
377
|
|
|
383
378
|
assert_compare(repository=grpc_repo)
|
|
384
379
|
|
|
380
|
+
wrapper = fixture.hg_repo_wrapper
|
|
381
|
+
wrapper.commit_file('foo')
|
|
382
|
+
wrapper.command('gitlab-mirror')
|
|
383
|
+
assert_compare(repository=grpc_repo)
|
|
384
|
+
|
|
385
385
|
# repo does not exist
|
|
386
386
|
assert_compare_errors(
|
|
387
387
|
same_details=False,
|
|
@@ -657,9 +657,9 @@ def test_create_bundle_from_ref_list(
|
|
|
657
657
|
assert not target_repo_path(vcs, 'broken-bundle').exists()
|
|
658
658
|
|
|
659
659
|
|
|
660
|
-
|
|
661
|
-
def test_search_files_by_name(gitaly_rhgitaly_comparison, hg_server):
|
|
660
|
+
def test_search_files_by_name(gitaly_rhgitaly_comparison):
|
|
662
661
|
fixture = gitaly_rhgitaly_comparison
|
|
662
|
+
hg_server = 'rhgitaly'
|
|
663
663
|
|
|
664
664
|
wrapper = fixture.hg_repo_wrapper
|
|
665
665
|
ctx0 = wrapper.write_commit('afoo', message="Some foo")
|
|
@@ -841,6 +841,7 @@ def test_write_ref(gitaly_rhgitaly_comparison, server_repos_root, hg_server):
|
|
|
841
841
|
normalize_commit_message(response.commit)
|
|
842
842
|
|
|
843
843
|
find_commit_helper = fixture.rpc_helper(
|
|
844
|
+
hg_server='rhgitaly',
|
|
844
845
|
stub_cls=CommitServiceStub,
|
|
845
846
|
method_name='FindCommit',
|
|
846
847
|
request_cls=FindCommitRequest,
|
|
@@ -73,7 +73,7 @@ def reraise_abort(msg, exc):
|
|
|
73
73
|
b'repeated to listen on several addresses' % DEFAULT_LISTEN_URL),
|
|
74
74
|
_(b'ADDRESS')),
|
|
75
75
|
(b'', b'mono-process',
|
|
76
|
-
|
|
76
|
+
True,
|
|
77
77
|
_(b'Mono process mode (useful for debugging, notably with pdb).'
|
|
78
78
|
b'No forking occurs, the main process is the single worker. '
|
|
79
79
|
b'In particular the hgitaly.workers configuration item is '
|
|
@@ -125,18 +125,7 @@ def serve(ui, **opts):
|
|
|
125
125
|
client_id_slug = opts.get('client_id_file_name', DEFAULT_CLIENT_ID_SLUG)
|
|
126
126
|
client_id_path = Path(config_root) / '+hgitaly' / os.fsdecode(client_id_slug)
|
|
127
127
|
ensure_client_id(client_id_path)
|
|
128
|
-
|
|
129
|
-
run_opts = dict(nb_workers=nb_workers,
|
|
130
|
-
restart_done_workers=True,
|
|
131
|
-
mono_process=opts.get('mono_process'))
|
|
132
|
-
max_rss_mib = ui.configint(b'hgitaly', b'worker.max-rss-mib')
|
|
133
|
-
if max_rss_mib is not None:
|
|
134
|
-
run_opts['max_rss_mib'] = max_rss_mib
|
|
135
|
-
monitoring_interval = ui.configint(b'hgitaly',
|
|
136
|
-
b'worker.monitoring-interval-seconds')
|
|
137
|
-
if monitoring_interval is not None:
|
|
138
|
-
run_opts['monitoring_interval'] = monitoring_interval
|
|
139
|
-
|
|
128
|
+
run_opts = {}
|
|
140
129
|
shutdown_timeout = ui.configint(
|
|
141
130
|
b'hgitaly',
|
|
142
131
|
b'worker.graceful-shutdown-timeout-seconds')
|
|
@@ -69,37 +69,6 @@ def test_serve_default_url(tmpdir, monkeypatch):
|
|
|
69
69
|
assert kwargs.get('nb_workers') is None
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
def test_serve_workers_config(tmpdir, monkeypatch):
|
|
73
|
-
ui, records = mock_run_forever(
|
|
74
|
-
tmpdir, monkeypatch,
|
|
75
|
-
config=dict(hgitaly={'workers': '47',
|
|
76
|
-
'configuration-root': str(tmpdir / 'config')}),
|
|
77
|
-
)
|
|
78
|
-
hgitaly_ext.serve(ui, listen=[], repositories_root=b'/some/path')
|
|
79
|
-
kwargs = records[0][1]
|
|
80
|
-
assert kwargs.get('nb_workers') == 47
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
def test_serve_max_rss_mb(tmpdir, monkeypatch):
|
|
84
|
-
ui, records = mock_run_forever(
|
|
85
|
-
tmpdir, monkeypatch,
|
|
86
|
-
config=dict(hgitaly={'worker.max-rss-mib': '128'}))
|
|
87
|
-
repositories_root = repos_root(tmpdir)
|
|
88
|
-
hgitaly_ext.serve(ui, listen=[], repositories_root=repositories_root)
|
|
89
|
-
kwargs = records[0][1]
|
|
90
|
-
assert kwargs.get('max_rss_mib') == 128
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
def test_serve_monitoring_interval(tmpdir, monkeypatch):
|
|
94
|
-
ui, records = mock_run_forever(
|
|
95
|
-
tmpdir, monkeypatch,
|
|
96
|
-
config=dict(hgitaly={'worker.monitoring-interval-seconds': '13'}))
|
|
97
|
-
repositories_root = repos_root(tmpdir)
|
|
98
|
-
hgitaly_ext.serve(ui, listen=[], repositories_root=repositories_root)
|
|
99
|
-
kwargs = records[0][1]
|
|
100
|
-
assert kwargs.get('monitoring_interval') == 13
|
|
101
|
-
|
|
102
|
-
|
|
103
72
|
def test_serve_graceful_shutdown(tmpdir, monkeypatch):
|
|
104
73
|
ui, records = mock_run_forever(
|
|
105
74
|
tmpdir, monkeypatch,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
18.7.0
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright 2020 Georges Racinet <georges.racinet@octobus.net>
|
|
2
|
+
#
|
|
3
|
+
# This software may be used and distributed according to the terms of the
|
|
4
|
+
# GNU General Public License version 2 or any later version.
|
|
5
|
+
#
|
|
6
|
+
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
7
|
+
"""Git specific things, mostly constants."""
|
|
8
|
+
|
|
9
|
+
ZERO_SHA_1 = '0' * 40
|
|
10
|
+
|
|
11
|
+
NULL_COMMIT_ID = ZERO_SHA_1
|
|
12
|
+
NULL_BLOB_OID = ZERO_SHA_1
|
|
13
|
+
|
|
14
|
+
# from `sha1-file.c` in Git 2.28 sources
|
|
15
|
+
# we're not dealing for now with the fact that there will be
|
|
16
|
+
# two kinds of OIDs with SHA-1 and SHA-256 soon.
|
|
17
|
+
|
|
18
|
+
# The Git tree object hash that corresponds to an empty tree (directory)
|
|
19
|
+
EMPTY_TREE_OID = '4b825dc642cb6eb9a060e54bf8d69288fbee4904'
|
|
20
|
+
|
|
21
|
+
# The Git blob object hash that corresponds to an empty blob (file)
|
|
22
|
+
EMPTY_BLOB_OID = 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
|
|
23
|
+
|
|
24
|
+
OBJECT_MODE_DOES_NOT_EXIST = 0 # see, e.g, ChangedPaths in diff.proto
|
|
25
|
+
OBJECT_MODE_LINK = 0o120000 # symlink to file or directory
|
|
26
|
+
OBJECT_MODE_EXECUTABLE = 0o100755 # for blobs only
|
|
27
|
+
OBJECT_MODE_NON_EXECUTABLE = 0o100644 # for blobs only
|
|
28
|
+
OBJECT_MODE_TREE = 0o40000
|
|
29
|
+
|
|
30
|
+
FILECTX_FLAGS_TO_GIT_MODE_BYTES = {
|
|
31
|
+
b'l': b'%o' % OBJECT_MODE_LINK,
|
|
32
|
+
b'x': b'%o' % OBJECT_MODE_EXECUTABLE,
|
|
33
|
+
b'': b'%o' % OBJECT_MODE_NON_EXECUTABLE,
|
|
34
|
+
}
|
|
@@ -13,7 +13,6 @@ utilities about refs, i.e, anything about a full ref path, such as
|
|
|
13
13
|
or tags.
|
|
14
14
|
"""
|
|
15
15
|
from fnmatch import fnmatch
|
|
16
|
-
import os
|
|
17
16
|
import re
|
|
18
17
|
|
|
19
18
|
from heptapod.gitlab.branch import gitlab_branch_ref
|
|
@@ -23,8 +22,6 @@ from hgext3rd.heptapod.branch import (
|
|
|
23
22
|
get_default_gitlab_branch,
|
|
24
23
|
)
|
|
25
24
|
from hgext3rd.heptapod.tag import gitlab_tags
|
|
26
|
-
from hgext3rd.heptapod import ensure_gitlab_special_refs
|
|
27
|
-
from hgext3rd.heptapod import ensure_gitlab_keep_arounds
|
|
28
25
|
from hgext3rd.heptapod.special_ref import (
|
|
29
26
|
GITLAB_TYPED_REFS_MISSING,
|
|
30
27
|
parse_special_ref,
|
|
@@ -40,33 +37,6 @@ from hgext3rd.heptapod.keep_around import (
|
|
|
40
37
|
DOT_HG_RX = re.compile(br'\.hg$')
|
|
41
38
|
|
|
42
39
|
|
|
43
|
-
def has_legacy_git_repo(repo):
|
|
44
|
-
"""Return whether there is a legacy Git repo for this Mercurial repo.
|
|
45
|
-
|
|
46
|
-
With "legacy" here is meant the Git repository for a non-native project.
|
|
47
|
-
Git repositories meant for mirroring are *not* included in this scope.
|
|
48
|
-
|
|
49
|
-
As of Heptapod 17.6, this is the best way to know without direct indication
|
|
50
|
-
(from the inside) that a repository is not legacy (hg-git based).
|
|
51
|
-
The reverse implication is false, as there are loopholes:
|
|
52
|
-
|
|
53
|
-
- leftover Git repositories for Projects that have migrated to native
|
|
54
|
-
- native projects with addition conversion for mirrors whose Git
|
|
55
|
-
repositories have not been moved yet (bug, time to run the migration,
|
|
56
|
-
etc.)
|
|
57
|
-
|
|
58
|
-
The caller must be aware of these loopholes and avoid overwriting existing
|
|
59
|
-
data based on the legacy Git repo. In the intended case where this is to
|
|
60
|
-
decide on calling the `ensure` methods, this means it is ok only if there
|
|
61
|
-
is no existing data.
|
|
62
|
-
"""
|
|
63
|
-
# if a repository is legacy, based on hg-git conversion, is whether
|
|
64
|
-
# it has a `.git` repository at the same location. Git repositories
|
|
65
|
-
# for mirroring are in a different place
|
|
66
|
-
git_path = DOT_HG_RX.sub(b'', repo.root) + b'.git'
|
|
67
|
-
return os.path.exists(git_path)
|
|
68
|
-
|
|
69
|
-
|
|
70
40
|
def gitlab_special_ref_target(repo, ref_path):
|
|
71
41
|
"""Return the changeset for a special ref.
|
|
72
42
|
|
|
@@ -135,8 +105,6 @@ def iter_gitlab_special_refs_as_refs(repo, deref=True, patterns=None):
|
|
|
135
105
|
"""
|
|
136
106
|
all_special_refs = special_refs(repo)
|
|
137
107
|
if all_special_refs is GITLAB_TYPED_REFS_MISSING:
|
|
138
|
-
# transitional while we still have an inner Git repo
|
|
139
|
-
# would still be the best we can do near the end of HGitaly2 milestone
|
|
140
108
|
all_special_refs = ensure_special_refs(repo)
|
|
141
109
|
|
|
142
110
|
for sref, sha in all_special_refs.items():
|
|
@@ -147,22 +115,18 @@ def iter_gitlab_special_refs_as_refs(repo, deref=True, patterns=None):
|
|
|
147
115
|
|
|
148
116
|
|
|
149
117
|
def ensure_special_refs(repo):
|
|
150
|
-
if has_legacy_git_repo(repo):
|
|
151
|
-
return ensure_gitlab_special_refs(repo.ui, repo)
|
|
152
118
|
return {}
|
|
153
119
|
|
|
154
120
|
|
|
155
121
|
def ensure_keep_arounds(repo, init_empty=False):
|
|
156
|
-
"""Ensure keep around
|
|
122
|
+
"""Ensure keep around file by creating it if needed
|
|
157
123
|
|
|
158
124
|
An empty file is created so that the keep-arounds file is no
|
|
159
125
|
more missing, but only if `init_empty` is `True`, so that
|
|
160
|
-
responsibility is handed to the caller,
|
|
126
|
+
responsibility is handed to the caller, that must use the
|
|
161
127
|
option only after having obtained the missing marker.
|
|
162
128
|
"""
|
|
163
|
-
if
|
|
164
|
-
ensure_gitlab_keep_arounds(repo.ui, repo)
|
|
165
|
-
elif init_empty:
|
|
129
|
+
if init_empty:
|
|
166
130
|
init_keep_arounds(repo, ())
|
|
167
131
|
|
|
168
132
|
|
|
@@ -234,19 +234,6 @@ class ManifestMiner:
|
|
|
234
234
|
prefix + b'/'.join(flat_path) if flat_path else dir_path
|
|
235
235
|
)
|
|
236
236
|
|
|
237
|
-
def file_names_by_regexp(self, rx, subdir=b''):
|
|
238
|
-
manifest = self.changeset.manifest()
|
|
239
|
-
subdir_prefix = subdir + b'/' if subdir else b''
|
|
240
|
-
|
|
241
|
-
for file_path in manifest.iterkeys():
|
|
242
|
-
if not file_path.startswith(subdir_prefix):
|
|
243
|
-
continue
|
|
244
|
-
|
|
245
|
-
if rx is not None and rx.search(file_path) is None:
|
|
246
|
-
continue
|
|
247
|
-
|
|
248
|
-
yield file_path
|
|
249
|
-
|
|
250
237
|
def iter_files_with_content(self, exclude_binary=False):
|
|
251
238
|
manifest = self.changeset.manifest()
|
|
252
239
|
repo = self.changeset.repo().unfiltered()
|
|
@@ -21,9 +21,6 @@ from .stub.shared_pb2 import (
|
|
|
21
21
|
Tag,
|
|
22
22
|
User,
|
|
23
23
|
)
|
|
24
|
-
from .stub.commit_pb2 import (
|
|
25
|
-
ListLastCommitsForTreeResponse,
|
|
26
|
-
)
|
|
27
24
|
from .stub.mercurial_changeset_pb2 import (
|
|
28
25
|
MercurialChangeset,
|
|
29
26
|
MercurialChangesetField,
|
|
@@ -272,14 +269,6 @@ def tag(name, target, tagging=None, signature_type=None):
|
|
|
272
269
|
)
|
|
273
270
|
|
|
274
271
|
|
|
275
|
-
CommitForTree = ListLastCommitsForTreeResponse.CommitForTree
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
def commit_for_tree(changeset, path):
|
|
279
|
-
"""Message indicating the last changeset having modified a path"""
|
|
280
|
-
return CommitForTree(commit=commit(changeset), path_bytes=path)
|
|
281
|
-
|
|
282
|
-
|
|
283
272
|
def mercurial_changeset(changeset, fields=None) -> MercurialChangeset:
|
|
284
273
|
"""Serialize changeset information.
|
|
285
274
|
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import psutil
|
|
3
3
|
|
|
4
|
-
IS_CHILD_PROCESS = False
|
|
5
|
-
|
|
6
4
|
|
|
7
5
|
def is_current_service_process(pid):
|
|
8
6
|
"""Determine whether the given pid is part of the current HGitaly service.
|
|
9
7
|
|
|
10
8
|
For now, the logic is that other processes from the same HGitaly service
|
|
11
9
|
are expected to be siblings of the current process, unless in the special
|
|
12
|
-
case where HGitaly is
|
|
13
|
-
|
|
10
|
+
case where HGitaly is started direcly (not from RHGitaly's sidecar),
|
|
11
|
+
hence for debugging purposes or from tests.
|
|
14
12
|
"""
|
|
15
|
-
this_pid = os.getpid()
|
|
16
|
-
|
|
17
|
-
if not IS_CHILD_PROCESS:
|
|
18
|
-
return pid == this_pid
|
|
19
|
-
|
|
20
13
|
try:
|
|
21
14
|
proc = psutil.Process(pid)
|
|
22
15
|
except psutil.NoSuchProcess:
|
|
23
16
|
return False
|
|
24
|
-
|
|
25
17
|
return proc.ppid() == os.getppid()
|
|
@@ -11,7 +11,10 @@ from .address import (
|
|
|
11
11
|
)
|
|
12
12
|
from .mono import (
|
|
13
13
|
BindError,
|
|
14
|
+
server_process,
|
|
14
15
|
)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
|
|
17
|
+
def run_forever(listen_urls, storages, **process_kwargs):
|
|
18
|
+
return server_process(0, listen_urls, storages,
|
|
19
|
+
mono_process=True,
|
|
20
|
+
**process_kwargs)
|
|
@@ -61,7 +61,7 @@ class WorkerProcess:
|
|
|
61
61
|
return self.process.pid
|
|
62
62
|
|
|
63
63
|
def __str__(self):
|
|
64
|
-
pid = 'no process' if self.process is None else self.
|
|
64
|
+
pid = 'no process' if self.process is None else self.pid
|
|
65
65
|
return f"Worker {self.process_args[0]} (pid: {pid})"
|
|
66
66
|
|
|
67
67
|
def init_process(self):
|