hgitaly 18.4.0__tar.gz → 18.4.1__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.
Files changed (171) hide show
  1. {hgitaly-18.4.0/hgitaly.egg-info → hgitaly-18.4.1}/PKG-INFO +2 -2
  2. hgitaly-18.4.1/hgitaly/VERSION +1 -0
  3. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/repository.py +6 -3
  4. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_repository_service.py +2 -0
  5. {hgitaly-18.4.0 → hgitaly-18.4.1/hgitaly.egg-info}/PKG-INFO +2 -2
  6. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly.egg-info/requires.txt +1 -1
  7. {hgitaly-18.4.0 → hgitaly-18.4.1}/install-requirements.txt +1 -1
  8. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_repository_service.py +51 -5
  9. hgitaly-18.4.0/hgitaly/VERSION +0 -1
  10. {hgitaly-18.4.0 → hgitaly-18.4.1}/LICENSE +0 -0
  11. {hgitaly-18.4.0 → hgitaly-18.4.1}/MANIFEST.in +0 -0
  12. {hgitaly-18.4.0 → hgitaly-18.4.1}/README.md +0 -0
  13. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgext3rd/__init__.py +0 -0
  14. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgext3rd/hgitaly/__init__.py +0 -0
  15. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgext3rd/hgitaly/revset.py +0 -0
  16. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgext3rd/hgitaly/tests/__init__.py +0 -0
  17. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgext3rd/hgitaly/tests/test_revset.py +0 -0
  18. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgext3rd/hgitaly/tests/test_serve.py +0 -0
  19. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/__init__.py +0 -0
  20. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/branch.py +0 -0
  21. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/changelog.py +0 -0
  22. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/diff.py +0 -0
  23. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/errors.py +0 -0
  24. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/feature.py +0 -0
  25. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/file_content.py +0 -0
  26. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/file_context.py +0 -0
  27. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/git.py +0 -0
  28. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/gitlab_ref.py +0 -0
  29. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/identification.py +0 -0
  30. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/logging.py +0 -0
  31. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/manifest.py +0 -0
  32. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/message.py +0 -0
  33. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/oid.py +0 -0
  34. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/pagination.py +0 -0
  35. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/path.py +0 -0
  36. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/peer.py +0 -0
  37. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/procutil.py +0 -0
  38. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/repository.py +0 -0
  39. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/revision.py +0 -0
  40. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/revset.py +0 -0
  41. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/scripts.py +0 -0
  42. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/server/__init__.py +0 -0
  43. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/server/address.py +0 -0
  44. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/server/mono.py +0 -0
  45. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/server/prefork.py +0 -0
  46. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/server/tests/__init__.py +0 -0
  47. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/server/tests/test_address.py +0 -0
  48. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/server/tests/test_mono.py +0 -0
  49. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/server/tests/test_prefork.py +0 -0
  50. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/server/tests/test_worker.py +0 -0
  51. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/server/worker.py +0 -0
  52. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/__init__.py +0 -0
  53. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/analysis.py +0 -0
  54. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/blob.py +0 -0
  55. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/commit.py +0 -0
  56. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/diff.py +0 -0
  57. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/interceptors.py +0 -0
  58. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/mercurial_changeset.py +0 -0
  59. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/mercurial_operations.py +0 -0
  60. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/mercurial_repository.py +0 -0
  61. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/operations.py +0 -0
  62. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/ref.py +0 -0
  63. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/server.py +0 -0
  64. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/__init__.py +0 -0
  65. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/fixture.py +0 -0
  66. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_analysis.py +0 -0
  67. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_blob.py +0 -0
  68. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_commit.py +0 -0
  69. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_default_branch.py +0 -0
  70. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_diff.py +0 -0
  71. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_mercurial_changeset.py +0 -0
  72. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_mercurial_operations.py +0 -0
  73. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_mercurial_repository.py +0 -0
  74. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_operations.py +0 -0
  75. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_ref.py +0 -0
  76. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/service/tests/test_server.py +0 -0
  77. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/servicer.py +0 -0
  78. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/ssh.py +0 -0
  79. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stream.py +0 -0
  80. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/__init__.py +0 -0
  81. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/analysis_pb2.py +0 -0
  82. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/analysis_pb2_grpc.py +0 -0
  83. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/blob_pb2.py +0 -0
  84. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/blob_pb2_grpc.py +0 -0
  85. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/commit_pb2.py +0 -0
  86. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/commit_pb2_grpc.py +0 -0
  87. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/diff_pb2.py +0 -0
  88. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/diff_pb2_grpc.py +0 -0
  89. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/errors_pb2.py +0 -0
  90. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/errors_pb2_grpc.py +0 -0
  91. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/lint_pb2.py +0 -0
  92. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/lint_pb2_grpc.py +0 -0
  93. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/mercurial_aux_git_pb2.py +0 -0
  94. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/mercurial_aux_git_pb2_grpc.py +0 -0
  95. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/mercurial_changeset_pb2.py +0 -0
  96. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/mercurial_changeset_pb2_grpc.py +0 -0
  97. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/mercurial_operations_pb2.py +0 -0
  98. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/mercurial_operations_pb2_grpc.py +0 -0
  99. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/mercurial_repository_pb2.py +0 -0
  100. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/mercurial_repository_pb2_grpc.py +0 -0
  101. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/operations_pb2.py +0 -0
  102. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/operations_pb2_grpc.py +0 -0
  103. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/ref_pb2.py +0 -0
  104. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/ref_pb2_grpc.py +0 -0
  105. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/remote_pb2.py +0 -0
  106. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/remote_pb2_grpc.py +0 -0
  107. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/repository_pb2.py +0 -0
  108. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/repository_pb2_grpc.py +0 -0
  109. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/server_pb2.py +0 -0
  110. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/server_pb2_grpc.py +0 -0
  111. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/shared_pb2.py +0 -0
  112. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/stub/shared_pb2_grpc.py +0 -0
  113. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tag.py +0 -0
  114. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/testing/__init__.py +0 -0
  115. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/testing/bundle.py +0 -0
  116. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/testing/context.py +0 -0
  117. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/testing/grpc.py +0 -0
  118. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/testing/multiprocessing.py +0 -0
  119. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/testing/repo.py +0 -0
  120. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/testing/ssh.py +0 -0
  121. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/testing/sshd.py +0 -0
  122. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/testing/storage.py +0 -0
  123. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/testing/tests/__init__.py +0 -0
  124. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/testing/tests/test_sshd.py +0 -0
  125. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/__init__.py +0 -0
  126. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/common.py +0 -0
  127. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_branch.py +0 -0
  128. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_diff.py +0 -0
  129. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_errors.py +0 -0
  130. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_feature.py +0 -0
  131. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_file_context.py +0 -0
  132. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_gitlab_ref.py +0 -0
  133. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_identification.py +0 -0
  134. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_manifest.py +0 -0
  135. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_messages.py +0 -0
  136. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_oid.py +0 -0
  137. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_peer.py +0 -0
  138. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_repository.py +0 -0
  139. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_revision.py +0 -0
  140. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_revset.py +0 -0
  141. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_servicer.py +0 -0
  142. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_stream.py +0 -0
  143. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_tag.py +0 -0
  144. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/tests/test_workdir.py +0 -0
  145. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/util.py +0 -0
  146. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly/workdir.py +0 -0
  147. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly.egg-info/SOURCES.txt +0 -0
  148. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly.egg-info/dependency_links.txt +0 -0
  149. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly.egg-info/entry_points.txt +0 -0
  150. {hgitaly-18.4.0 → hgitaly-18.4.1}/hgitaly.egg-info/top_level.txt +0 -0
  151. {hgitaly-18.4.0 → hgitaly-18.4.1}/setup.cfg +0 -0
  152. {hgitaly-18.4.0 → hgitaly-18.4.1}/setup.py +0 -0
  153. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/__init__.py +0 -0
  154. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/comparison.py +0 -0
  155. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/conftest.py +0 -0
  156. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/gitaly.py +0 -0
  157. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/hgitaly_rhgitaly_comparison.py +0 -0
  158. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/rhgitaly.py +0 -0
  159. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_blob_tree.py +0 -0
  160. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_commit.py +0 -0
  161. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_comparison.py +0 -0
  162. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_diff.py +0 -0
  163. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_gitaly_server.py +0 -0
  164. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_mercurial_aux_git.py +0 -0
  165. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_mercurial_operations.py +0 -0
  166. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_mercurial_repository.py +0 -0
  167. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_operations.py +0 -0
  168. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_ref.py +0 -0
  169. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_remote.py +0 -0
  170. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_rhgitaly_server.py +0 -0
  171. {hgitaly-18.4.0 → hgitaly-18.4.1}/tests_with_gitaly/test_server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hgitaly
3
- Version: 18.4.0
3
+ Version: 18.4.1
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.3.0dev0
13
+ Requires-Dist: heptapod>=5.4.0
14
14
  Requires-Dist: protobuf~=6.31.1
15
15
  Requires-Dist: grpcio~=1.74.0
16
16
  Requires-Dist: grpcio-status~=1.74.0
@@ -0,0 +1 @@
1
+ 18.4.1
@@ -36,6 +36,7 @@ from hgext3rd.heptapod.branch import set_default_gitlab_branch
36
36
  from hgext3rd.heptapod.special_ref import write_gitlab_special_ref
37
37
  from hgext3rd.heptapod.keep_around import (
38
38
  create_keep_around,
39
+ delete_keep_around,
39
40
  parse_keep_around_ref,
40
41
  )
41
42
 
@@ -337,7 +338,9 @@ class RepositoryServicer(RepositoryServiceServicer, HGitalyServicer):
337
338
 
338
339
  keep_around = parse_keep_around_ref(ref)
339
340
  if keep_around is not None:
340
- if (CHANGESET_HASH_BYTES_REGEXP.match(keep_around) is None
341
+ if target == ZERO_SHA:
342
+ delete_keep_around(repo, keep_around)
343
+ elif (CHANGESET_HASH_BYTES_REGEXP.match(keep_around) is None
341
344
  or target != keep_around):
342
345
  context.abort(
343
346
  StatusCode.INVALID_ARGUMENT,
@@ -346,8 +349,8 @@ class RepositoryServicer(RepositoryServiceServicer, HGitalyServicer):
346
349
  "target must "
347
350
  "match the ref name" % (target, ref)
348
351
  )
349
-
350
- create_keep_around(repo, target)
352
+ else:
353
+ create_keep_around(repo, target)
351
354
  return WriteRefResponse()
352
355
  except Exception:
353
356
  # TODO this is a stop-gap measure to prevent repository breakage
@@ -456,6 +456,8 @@ def test_write_ref(fixture_with_repo):
456
456
  create_keep_around(repo, existing_ka)
457
457
  fixture.write_ref(b'refs/keep-around/' + sha, sha)
458
458
  assert set(iter_keep_arounds(repo)) == {sha, existing_ka}
459
+ fixture.write_ref(b'refs/keep-around/' + existing_ka, ZERO_SHA)
460
+ assert set(iter_keep_arounds(repo)) == {sha}
459
461
 
460
462
 
461
463
  def test_write_special_refs_exceptions(fixture_with_repo):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hgitaly
3
- Version: 18.4.0
3
+ Version: 18.4.1
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.3.0dev0
13
+ Requires-Dist: heptapod>=5.4.0
14
14
  Requires-Dist: protobuf~=6.31.1
15
15
  Requires-Dist: grpcio~=1.74.0
16
16
  Requires-Dist: grpcio-status~=1.74.0
@@ -1,4 +1,4 @@
1
- heptapod>=5.3.0dev0
1
+ heptapod>=5.4.0
2
2
  protobuf~=6.31.1
3
3
  grpcio~=1.74.0
4
4
  grpcio-status~=1.74.0
@@ -1,4 +1,4 @@
1
- heptapod>=5.3.0dev0
1
+ heptapod>=5.4.0
2
2
  protobuf~=6.31.1
3
3
  grpcio~=1.74.0
4
4
  grpcio-status~=1.74.0
@@ -13,6 +13,10 @@ from mercurial import (
13
13
  import pytest
14
14
  import grpc
15
15
  import itertools
16
+
17
+ from hgext3rd.heptapod.keep_around import (
18
+ iter_keep_arounds,
19
+ )
16
20
  # from hgitaly.git import EMPTY_TREE_OID
17
21
  from hgitaly.testing import license_content
18
22
  from hgitaly.revision import ZERO_SHA
@@ -816,14 +820,17 @@ def test_find_license(gitaly_rhgitaly_comparison):
816
820
  rpc_helper.assert_compare()
817
821
 
818
822
 
819
- def test_write_ref(gitaly_comparison, server_repos_root):
820
- fixture = gitaly_comparison
823
+ @parametrize('hg_server', ('hgitaly', 'rhgitaly'))
824
+ def test_write_ref(gitaly_rhgitaly_comparison, server_repos_root, hg_server):
825
+ fixture = gitaly_rhgitaly_comparison
821
826
  rpc_helper = fixture.rpc_helper(
827
+ hg_server=hg_server,
822
828
  stub_cls=RepositoryServiceStub,
823
829
  method_name='WriteRef',
824
830
  request_sha_attrs=['revision', 'old_revision'],
825
831
  request_cls=WriteRefRequest,
826
832
  )
833
+ rpc_helper.feature_flags = [('rhgitaly-write-ref', True)]
827
834
 
828
835
  def commit_normalizer(rpc_helper, response, **kw):
829
836
  if response.HasField('commit'):
@@ -843,11 +850,18 @@ def test_write_ref(gitaly_comparison, server_repos_root):
843
850
  wrapper = fixture.hg_repo_wrapper
844
851
  sha0 = wrapper.write_commit('afoo', message="Some foo").hex()
845
852
  sha1 = wrapper.write_commit('afoo', message="Some foo").hex()
853
+ sha2 = wrapper.write_commit('afoo', message="Other foo",
854
+ branch='other').hex()
846
855
  default_rev = b'branch/default'
856
+ default_ref = b'refs/heads/' + default_rev
857
+ other_rev = b'branch/other'
858
+ other_ref = b'refs/heads/' + other_rev
847
859
 
848
860
  # precondition for the test: mirror worked
849
- assert fixture.git_repo.branch_titles() == {default_rev: b"Some foo"}
861
+ assert fixture.git_repo.branch_titles() == {default_rev: b"Some foo",
862
+ other_rev: b"Other foo"}
850
863
 
864
+ # a special ref, insertion then removal
851
865
  pipeline_1 = b'refs/pipelines/1'
852
866
  assert_compare(ref=pipeline_1, revision=default_rev)
853
867
  find_commit_helper.assert_compare(revision=pipeline_1)
@@ -858,10 +872,42 @@ def test_write_ref(gitaly_comparison, server_repos_root):
858
872
  old_revision=ZERO_SHA)
859
873
  assert_compare_errors(ref=pipeline_1, revision=sha0, old_revision=sha1)
860
874
 
875
+ # removal
876
+ assert_compare_errors(ref=pipeline_1, revision=ZERO_SHA, old_revision=sha1)
877
+ find_commit_helper.assert_compare(revision=pipeline_1)
878
+ assert_compare(ref=pipeline_1, revision=ZERO_SHA)
879
+ find_commit_helper.assert_compare(revision=pipeline_1)
880
+ # removal of unknown is not an error
881
+ assert_compare(ref=b'refs/merge-requests/unknown', revision=ZERO_SHA)
882
+
883
+ # Default branch
884
+ assert_compare(ref=b'HEAD', revision=other_ref)
885
+ assert find_commit_helper.rpc('hg',
886
+ revision=b'HEAD').commit.id == sha2.decode()
887
+ find_commit_helper.assert_compare(revision=b'HEAD')
888
+
861
889
  # old_revision is not honoured for symrefs by Gitaly:
862
890
  assert_compare(ref=b'HEAD',
863
- revision=b"refs/heads/something",
864
- old_revision=b"refs/heads/other")
891
+ revision=default_ref,
892
+ old_revision=b"refs/heads/something")
893
+ assert find_commit_helper.rpc('hg',
894
+ revision=b'HEAD').commit.id == sha1.decode()
895
+ find_commit_helper.assert_compare(revision=b'HEAD')
896
+
897
+ # keep-arounds
898
+ ka = b'refs/keep-around/' + sha1
899
+ assert_compare(ref=ka, revision=sha1)
900
+
901
+ find_commit_helper.assert_compare(revision=ka)
902
+ assert_compare(ref=ka, revision=sha1) # no error if already there
903
+
904
+ # removal (FindCommit having a shortcut to resolve keep-arounds
905
+ # without reading the file, we check the content directly (Gitaly would
906
+ # return an empty response for this, a very very minor discrepancy that
907
+ # we tolerate).
908
+ assert_compare(ref=ka, revision=ZERO_SHA)
909
+ assert not find_commit_helper.rpc('git', revision=ka).commit.id
910
+ assert not list(iter_keep_arounds(wrapper.repo))
865
911
 
866
912
  # HGitaly is stricter than Gitaly with this (notably keep-arounds
867
913
  # consistency checks), and we don't want to downgrade that.
@@ -1 +0,0 @@
1
- 18.4.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes