hgitaly 18.0.1__tar.gz → 18.0.2__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 (176) hide show
  1. {hgitaly-18.0.1/hgitaly.egg-info → hgitaly-18.0.2}/PKG-INFO +1 -1
  2. hgitaly-18.0.2/hgitaly/VERSION +1 -0
  3. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/ref.py +4 -1
  4. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_ref.py +1 -1
  5. {hgitaly-18.0.1 → hgitaly-18.0.2/hgitaly.egg-info}/PKG-INFO +1 -1
  6. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_ref.py +115 -5
  7. hgitaly-18.0.1/hgitaly/VERSION +0 -1
  8. {hgitaly-18.0.1 → hgitaly-18.0.2}/LICENSE +0 -0
  9. {hgitaly-18.0.1 → hgitaly-18.0.2}/MANIFEST.in +0 -0
  10. {hgitaly-18.0.1 → hgitaly-18.0.2}/README.md +0 -0
  11. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgext3rd/__init__.py +0 -0
  12. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgext3rd/hgitaly/__init__.py +0 -0
  13. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgext3rd/hgitaly/revset.py +0 -0
  14. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgext3rd/hgitaly/tests/__init__.py +0 -0
  15. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgext3rd/hgitaly/tests/test_revset.py +0 -0
  16. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgext3rd/hgitaly/tests/test_serve.py +0 -0
  17. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/__init__.py +0 -0
  18. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/branch.py +0 -0
  19. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/changelog.py +0 -0
  20. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/diff.py +0 -0
  21. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/errors.py +0 -0
  22. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/feature.py +0 -0
  23. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/file_content.py +0 -0
  24. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/file_context.py +0 -0
  25. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/git.py +0 -0
  26. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/gitlab_ref.py +0 -0
  27. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/identification.py +0 -0
  28. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/license_detector/__init__.py +0 -0
  29. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/license_detector/spdx-licenses.json +0 -0
  30. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/linguist/__init__.py +0 -0
  31. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/linguist/languages.json +0 -0
  32. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/logging.py +0 -0
  33. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/manifest.py +0 -0
  34. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/message.py +0 -0
  35. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/oid.py +0 -0
  36. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/pagination.py +0 -0
  37. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/path.py +0 -0
  38. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/peer.py +0 -0
  39. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/procutil.py +0 -0
  40. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/repository.py +0 -0
  41. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/revision.py +0 -0
  42. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/revset.py +0 -0
  43. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/scripts.py +0 -0
  44. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/server/__init__.py +0 -0
  45. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/server/address.py +0 -0
  46. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/server/mono.py +0 -0
  47. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/server/prefork.py +0 -0
  48. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/server/tests/__init__.py +0 -0
  49. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/server/tests/test_address.py +0 -0
  50. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/server/tests/test_mono.py +0 -0
  51. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/server/tests/test_prefork.py +0 -0
  52. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/server/tests/test_worker.py +0 -0
  53. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/server/worker.py +0 -0
  54. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/__init__.py +0 -0
  55. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/analysis.py +0 -0
  56. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/blob.py +0 -0
  57. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/commit.py +0 -0
  58. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/diff.py +0 -0
  59. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/interceptors.py +0 -0
  60. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/mercurial_changeset.py +0 -0
  61. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/mercurial_operations.py +0 -0
  62. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/mercurial_repository.py +0 -0
  63. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/operations.py +0 -0
  64. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/repository.py +0 -0
  65. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/server.py +0 -0
  66. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/__init__.py +0 -0
  67. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/fixture.py +0 -0
  68. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_analysis.py +0 -0
  69. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_blob.py +0 -0
  70. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_commit.py +0 -0
  71. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_default_branch.py +0 -0
  72. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_diff.py +0 -0
  73. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_mercurial_changeset.py +0 -0
  74. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_mercurial_operations.py +0 -0
  75. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_mercurial_repository.py +0 -0
  76. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_operations.py +0 -0
  77. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_repository_service.py +0 -0
  78. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/service/tests/test_server.py +0 -0
  79. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/servicer.py +0 -0
  80. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/ssh.py +0 -0
  81. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stream.py +0 -0
  82. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/__init__.py +0 -0
  83. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/analysis_pb2.py +0 -0
  84. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/analysis_pb2_grpc.py +0 -0
  85. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/blob_pb2.py +0 -0
  86. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/blob_pb2_grpc.py +0 -0
  87. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/commit_pb2.py +0 -0
  88. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/commit_pb2_grpc.py +0 -0
  89. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/diff_pb2.py +0 -0
  90. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/diff_pb2_grpc.py +0 -0
  91. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/errors_pb2.py +0 -0
  92. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/errors_pb2_grpc.py +0 -0
  93. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/lint_pb2.py +0 -0
  94. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/lint_pb2_grpc.py +0 -0
  95. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/mercurial_aux_git_pb2.py +0 -0
  96. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/mercurial_aux_git_pb2_grpc.py +0 -0
  97. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/mercurial_changeset_pb2.py +0 -0
  98. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/mercurial_changeset_pb2_grpc.py +0 -0
  99. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/mercurial_operations_pb2.py +0 -0
  100. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/mercurial_operations_pb2_grpc.py +0 -0
  101. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/mercurial_repository_pb2.py +0 -0
  102. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/mercurial_repository_pb2_grpc.py +0 -0
  103. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/operations_pb2.py +0 -0
  104. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/operations_pb2_grpc.py +0 -0
  105. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/ref_pb2.py +0 -0
  106. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/ref_pb2_grpc.py +0 -0
  107. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/remote_pb2.py +0 -0
  108. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/remote_pb2_grpc.py +0 -0
  109. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/repository_pb2.py +0 -0
  110. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/repository_pb2_grpc.py +0 -0
  111. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/server_pb2.py +0 -0
  112. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/server_pb2_grpc.py +0 -0
  113. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/shared_pb2.py +0 -0
  114. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/stub/shared_pb2_grpc.py +0 -0
  115. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tag.py +0 -0
  116. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/testing/__init__.py +0 -0
  117. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/testing/bundle.py +0 -0
  118. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/testing/context.py +0 -0
  119. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/testing/grpc.py +0 -0
  120. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/testing/multiprocessing.py +0 -0
  121. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/testing/ssh.py +0 -0
  122. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/testing/sshd.py +0 -0
  123. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/testing/storage.py +0 -0
  124. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/testing/tests/__init__.py +0 -0
  125. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/testing/tests/test_sshd.py +0 -0
  126. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/__init__.py +0 -0
  127. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/common.py +0 -0
  128. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_branch.py +0 -0
  129. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_diff.py +0 -0
  130. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_errors.py +0 -0
  131. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_feature.py +0 -0
  132. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_file_context.py +0 -0
  133. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_gitlab_ref.py +0 -0
  134. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_identification.py +0 -0
  135. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_license_detector.py +0 -0
  136. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_linguist.py +0 -0
  137. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_manifest.py +0 -0
  138. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_messages.py +0 -0
  139. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_oid.py +0 -0
  140. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_peer.py +0 -0
  141. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_repository.py +0 -0
  142. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_revision.py +0 -0
  143. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_revset.py +0 -0
  144. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_servicer.py +0 -0
  145. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_stream.py +0 -0
  146. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_tag.py +0 -0
  147. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/tests/test_workdir.py +0 -0
  148. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/util.py +0 -0
  149. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly/workdir.py +0 -0
  150. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly.egg-info/SOURCES.txt +0 -0
  151. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly.egg-info/dependency_links.txt +0 -0
  152. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly.egg-info/entry_points.txt +0 -0
  153. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly.egg-info/requires.txt +0 -0
  154. {hgitaly-18.0.1 → hgitaly-18.0.2}/hgitaly.egg-info/top_level.txt +0 -0
  155. {hgitaly-18.0.1 → hgitaly-18.0.2}/install-requirements.txt +0 -0
  156. {hgitaly-18.0.1 → hgitaly-18.0.2}/setup.cfg +0 -0
  157. {hgitaly-18.0.1 → hgitaly-18.0.2}/setup.py +0 -0
  158. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/__init__.py +0 -0
  159. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/comparison.py +0 -0
  160. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/conftest.py +0 -0
  161. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/gitaly.py +0 -0
  162. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/hgitaly_rhgitaly_comparison.py +0 -0
  163. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/rhgitaly.py +0 -0
  164. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_blob_tree.py +0 -0
  165. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_commit.py +0 -0
  166. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_comparison.py +0 -0
  167. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_diff.py +0 -0
  168. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_gitaly_server.py +0 -0
  169. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_mercurial_aux_git.py +0 -0
  170. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_mercurial_operations.py +0 -0
  171. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_mercurial_repository.py +0 -0
  172. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_operations.py +0 -0
  173. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_remote.py +0 -0
  174. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_repository_service.py +0 -0
  175. {hgitaly-18.0.1 → hgitaly-18.0.2}/tests_with_gitaly/test_rhgitaly_server.py +0 -0
  176. {hgitaly-18.0.1 → hgitaly-18.0.2}/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.0.1
3
+ Version: 18.0.2
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
@@ -0,0 +1 @@
1
+ 18.0.2
@@ -193,7 +193,10 @@ class RefServicer(RefServiceServicer, HGitalyServicer):
193
193
  context) -> FindAllBranchesResponse:
194
194
  Branch = FindAllBranchesResponse.Branch
195
195
  repo = self.load_repo(request.repository, context)
196
- for chunk in chunked(iter_gitlab_branches(repo)):
196
+ for chunk in chunked(sorted_gitlab_branches_as_refs(
197
+ repo,
198
+ sort_by=BranchSortBy.FULL_REF_NAME
199
+ )):
197
200
  yield FindAllBranchesResponse(
198
201
  branches=(Branch(name=name, target=message.commit(head))
199
202
  for name, head in chunk))
@@ -187,7 +187,7 @@ def test_find_branch(grpc_channel, server_repos_root):
187
187
  FindAllBranchesRequest(repository=grpc_repo))
188
188
  branches = [br for chunk in resp for br in chunk.branches]
189
189
  assert len(branches) == 1
190
- assert branches[0].name == b'branch/default'
190
+ assert branches[0].name == b'refs/heads/branch/default'
191
191
  assert branches[0].target == branch.target_commit
192
192
 
193
193
  resp = list(ref_stub.FindAllRemoteBranches(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hgitaly
3
- Version: 18.0.1
3
+ Version: 18.0.2
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
@@ -4,6 +4,7 @@
4
4
  # GNU General Public License version 2 or any later version.
5
5
  #
6
6
  # SPDX-License-Identifier: GPL-2.0-or-later
7
+ from base64 import b64encode, b64decode
7
8
  import pytest
8
9
  import time
9
10
 
@@ -30,6 +31,8 @@ from hgitaly.stub.ref_pb2 import (
30
31
  FindRefsByOIDRequest,
31
32
  FindTagError,
32
33
  FindTagRequest,
34
+ FindAllBranchesRequest,
35
+ FindAllTagsRequest,
33
36
  FindLocalBranchesRequest,
34
37
  ListRefsRequest,
35
38
  UpdateReferencesError,
@@ -53,8 +56,10 @@ if skip_comparison_tests(): # pragma no cover
53
56
  parametrize = pytest.mark.parametrize
54
57
 
55
58
 
56
- def test_compare_find_branch(gitaly_comparison):
57
- fixture = gitaly_comparison
59
+ @parametrize('hg_server', ('hgitaly', 'rhgitaly'))
60
+ def test_compare_find_branch(gitaly_rhgitaly_comparison,
61
+ hg_server):
62
+ fixture = gitaly_rhgitaly_comparison
58
63
  git_repo = fixture.git_repo
59
64
 
60
65
  fixture.hg_repo_wrapper.write_commit('foo', message="Some foo")
@@ -67,6 +72,7 @@ def test_compare_find_branch(gitaly_comparison):
67
72
  normalize_commit_message(resp.branch.target_commit)
68
73
 
69
74
  rpc_helper = fixture.rpc_helper(
75
+ hg_server=hg_server,
70
76
  stub_cls=RefServiceStub,
71
77
  method_name='FindBranch',
72
78
  request_cls=FindBranchRequest,
@@ -75,6 +81,7 @@ def test_compare_find_branch(gitaly_comparison):
75
81
  )
76
82
 
77
83
  rpc_helper.assert_compare(name=gl_branch)
84
+ rpc_helper.assert_compare(name=b'unknown')
78
85
 
79
86
  # invalid case
80
87
  rpc_helper.assert_compare_errors(name=gl_branch, repository=None,
@@ -314,8 +321,9 @@ def test_compare_ref_exists(gitaly_rhgitaly_comparison, hg_server):
314
321
  assert_compare_errors(ref=b'notrefs/something')
315
322
 
316
323
 
317
- def test_compare_find_local_branches(gitaly_comparison):
318
- fixture = gitaly_comparison
324
+ @parametrize('hg_server', ('hgitaly', 'rhgitaly'))
325
+ def test_compare_find_local_branches(gitaly_rhgitaly_comparison, hg_server):
326
+ fixture = gitaly_rhgitaly_comparison
319
327
  wrapper = fixture.hg_repo_wrapper
320
328
 
321
329
  # make three branches with the 3 possible orderings differ
@@ -334,6 +342,7 @@ def test_compare_find_local_branches(gitaly_comparison):
334
342
  normalize_commit_message(branch.target_commit)
335
343
 
336
344
  rpc_helper = fixture.rpc_helper(
345
+ hg_server=hg_server,
337
346
  stub_cls=RefServiceStub,
338
347
  method_name='FindLocalBranches',
339
348
  request_cls=FindLocalBranchesRequest,
@@ -359,13 +368,114 @@ def test_compare_find_local_branches(gitaly_comparison):
359
368
  # case without any pagination parameters
360
369
  assert_compare(123, pagination=False)
361
370
 
362
- assert_compare(10, page_token='refs/heads/branch/br01')
371
+ orig_kwargs_to_git = rpc_helper.request_kwargs_to_git
372
+
373
+ def pagination_kwargs_to_git(hg_kwargs):
374
+ git_kwargs = orig_kwargs_to_git(hg_kwargs)
375
+ hg_pagination = hg_kwargs['pagination_params']
376
+ git_kwargs['pagination_params'] = PaginationParameter(
377
+ limit=hg_pagination.limit,
378
+ page_token=('refs/heads/'
379
+ + b64decode(hg_pagination.page_token).decode()),
380
+ )
381
+ return git_kwargs
382
+
383
+ if hg_server == 'hgitaly':
384
+ page_token = 'refs/heads/branch/br01'
385
+ else:
386
+ page_token = b64encode(b'branch/br01').decode('ascii')
387
+ rpc_helper.request_kwargs_to_git = pagination_kwargs_to_git
388
+
389
+ assert_compare(10, page_token=page_token)
390
+ rpc_helper.request_kwargs_to_git = orig_kwargs_to_git
363
391
 
364
392
  # sort options
365
393
  for sort_by in FindLocalBranchesRequest.SortBy.values():
366
394
  assert_compare(10, sort_by=sort_by)
367
395
 
368
396
 
397
+ @parametrize('hg_server', ('hgitaly', 'rhgitaly'))
398
+ def test_compare_find_all_branches(gitaly_rhgitaly_comparison, hg_server):
399
+ fixture = gitaly_rhgitaly_comparison
400
+ wrapper = fixture.hg_repo_wrapper
401
+
402
+ # make three branches with the 3 possible orderings differ
403
+ now = time.time()
404
+ commit_ages = {0: 30, 1: 40, 2: 20}
405
+ for i in range(3):
406
+ wrapper.commit_file('foo', branch='br%02d' % i, return_ctx=False,
407
+ utc_timestamp=now - commit_ages[i])
408
+ # mirror worked
409
+ assert set(fixture.git_repo.branch_titles().keys()) == {
410
+ b'branch/br%02d' % i for i in range(3)}
411
+
412
+ def normalize_response(rpc_helper, resp, **kw):
413
+ for chunk in resp:
414
+ for branch in chunk.branches:
415
+ normalize_commit_message(branch.target)
416
+
417
+ rpc_helper = fixture.rpc_helper(
418
+ hg_server=hg_server,
419
+ stub_cls=RefServiceStub,
420
+ method_name='FindAllBranches',
421
+ request_cls=FindAllBranchesRequest,
422
+ streaming=True,
423
+ response_sha_attrs=['branches[].target.id',
424
+ 'branches[].target.parent_ids[]',
425
+ ],
426
+ normalizer=normalize_response,
427
+ )
428
+
429
+ rpc_helper.assert_compare()
430
+
431
+
432
+ # Testing just RHGitaly, as we would otherwise need to implement
433
+ # sorting in Python impl, that will be deprecated immediately by Rust impl
434
+ def test_find_all_tags(gitaly_rhgitaly_comparison):
435
+ fixture = gitaly_rhgitaly_comparison
436
+ hg_wrapper = fixture.hg_repo_wrapper
437
+
438
+ # make three branches with the 3 possible orderings differ
439
+ now = time.time()
440
+ commit_ages = {0: 30, 1: 40, 2: 20}
441
+ commit_tags = {0: b'1.2', 1: b'v0.8', 2: b'not-a-version'}
442
+ for i in range(3):
443
+ hg_wrapper.commit_file('foo', return_ctx=False,
444
+ utc_timestamp=now - commit_ages[i])
445
+ hg_wrapper.command('tag', commit_tags[i], rev=b'.')
446
+ hg_wrapper.command('gitlab-mirror')
447
+
448
+ # mirror worked
449
+ assert fixture.git_repo.tags() == {b'1.2', b'v0.8', b'not-a-version'}
450
+
451
+ def normalize_response(rpc_helper, resp, **kw):
452
+ for chunk in resp:
453
+ for tag in chunk.tags:
454
+ normalize_commit_message(tag.target_commit)
455
+
456
+ rpc_helper = fixture.rpc_helper(
457
+ hg_server='rhgitaly',
458
+ stub_cls=RefServiceStub,
459
+ method_name='FindAllTags',
460
+ request_cls=FindAllTagsRequest,
461
+ streaming=True,
462
+ response_sha_attrs=['tags[].target_commit.id',
463
+ 'tags[].target_commit.parent_ids[]',
464
+ 'tags[].id',
465
+ ],
466
+ normalizer=normalize_response,
467
+ )
468
+
469
+ rpc_helper.assert_compare()
470
+
471
+ SortBy = FindAllTagsRequest.SortBy
472
+ for direction in (SortDirection.ASCENDING, SortDirection.DESCENDING):
473
+ for key in SortBy.Key.values():
474
+ rpc_helper.assert_compare(
475
+ sort_by=SortBy(key=key, direction=direction),
476
+ )
477
+
478
+
369
479
  @parametrize('hg_server', ('hgitaly', 'rhgitaly'))
370
480
  def test_find_tag(gitaly_rhgitaly_comparison, hg_server):
371
481
  fixture = gitaly_rhgitaly_comparison
@@ -1 +0,0 @@
1
- 18.0.1
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