hgitaly 2.5.5__tar.gz → 2.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.
Files changed (296) hide show
  1. {hgitaly-2.5.5 → hgitaly-2.7.0}/.hgtags +1 -1
  2. {hgitaly-2.5.5 → hgitaly-2.7.0}/PKG-INFO +1 -1
  3. hgitaly-2.7.0/hgitaly/VERSION +1 -0
  4. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/diff.py +20 -47
  5. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/message.py +0 -4
  6. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/diff.py +1 -4
  7. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/operations.py +13 -1
  8. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/ref.py +3 -95
  9. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/repository.py +4 -2
  10. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/server.py +11 -0
  11. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_diff.py +1 -46
  12. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_operations.py +5 -3
  13. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_ref.py +0 -77
  14. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_repository_service.py +4 -4
  15. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_server.py +8 -0
  16. hgitaly-2.7.0/hgitaly/stub/commit_pb2.py +251 -0
  17. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/commit_pb2_grpc.py +2 -0
  18. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/errors_pb2.py +3 -1
  19. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/lint_pb2.py +4 -3
  20. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/operations_pb2.py +61 -59
  21. hgitaly-2.7.0/hgitaly/stub/repository_pb2.py +396 -0
  22. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/repository_pb2_grpc.py +2 -2
  23. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/shared_pb2.py +11 -9
  24. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_messages.py +0 -5
  25. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly.egg-info/PKG-INFO +1 -1
  26. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly.egg-info/SOURCES.txt +1 -0
  27. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/commit.proto +7 -0
  28. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/errors.proto +3 -0
  29. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/lint.proto +5 -0
  30. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/operations.proto +13 -0
  31. hgitaly-2.7.0/protos/partition.proto +62 -0
  32. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/repository.proto +12 -2
  33. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/shared.proto +6 -0
  34. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/ssh.proto +3 -0
  35. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/lib/hgitaly/version.rb +1 -1
  36. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/comparison.py +22 -88
  37. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/test_commit.py +1 -1
  38. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/test_diff.py +2 -26
  39. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/test_operations.py +48 -21
  40. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/test_ref.py +1 -127
  41. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/test_server.py +13 -0
  42. hgitaly-2.5.5/hgitaly/VERSION +0 -1
  43. hgitaly-2.5.5/hgitaly/stub/commit_pb2.py +0 -251
  44. hgitaly-2.5.5/hgitaly/stub/repository_pb2.py +0 -393
  45. {hgitaly-2.5.5 → hgitaly-2.7.0}/.coveragerc +0 -0
  46. {hgitaly-2.5.5 → hgitaly-2.7.0}/.gitlab-ci.yml +0 -0
  47. {hgitaly-2.5.5 → hgitaly-2.7.0}/.hgignore +0 -0
  48. {hgitaly-2.5.5 → hgitaly-2.7.0}/LICENSE +0 -0
  49. {hgitaly-2.5.5 → hgitaly-2.7.0}/MANIFEST.in +0 -0
  50. {hgitaly-2.5.5 → hgitaly-2.7.0}/README.md +0 -0
  51. {hgitaly-2.5.5 → hgitaly-2.7.0}/ci/heptapod-sftp-push +0 -0
  52. {hgitaly-2.5.5 → hgitaly-2.7.0}/ci/heptapod-sign-package +0 -0
  53. {hgitaly-2.5.5 → hgitaly-2.7.0}/ci/heptapod_known_hosts.ssh +0 -0
  54. {hgitaly-2.5.5 → hgitaly-2.7.0}/ci/upload-rhgitaly +0 -0
  55. {hgitaly-2.5.5 → hgitaly-2.7.0}/conftest.py +0 -0
  56. {hgitaly-2.5.5 → hgitaly-2.7.0}/dev-requirements.txt +0 -0
  57. {hgitaly-2.5.5 → hgitaly-2.7.0}/examples/client.py +0 -0
  58. {hgitaly-2.5.5 → hgitaly-2.7.0}/examples/client_list_lcft.py +0 -0
  59. {hgitaly-2.5.5 → hgitaly-2.7.0}/generate-stubs +0 -0
  60. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgext3rd/__init__.py +0 -0
  61. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgext3rd/hgitaly/__init__.py +0 -0
  62. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgext3rd/hgitaly/revset.py +0 -0
  63. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgext3rd/hgitaly/tests/__init__.py +0 -0
  64. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgext3rd/hgitaly/tests/test_revset.py +0 -0
  65. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgext3rd/hgitaly/tests/test_serve.py +0 -0
  66. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/__init__.py +0 -0
  67. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/branch.py +0 -0
  68. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/changelog.py +0 -0
  69. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/errors.py +0 -0
  70. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/feature.py +0 -0
  71. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/file_content.py +0 -0
  72. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/file_context.py +0 -0
  73. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/git.py +0 -0
  74. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/gitlab_ref.py +0 -0
  75. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/license_detector/GPL-2.sample +0 -0
  76. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/license_detector/__init__.py +0 -0
  77. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/license_detector/spdx-licenses.json +0 -0
  78. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/linguist/__init__.py +0 -0
  79. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/linguist/languages.json +0 -0
  80. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/logging.py +0 -0
  81. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/manifest.py +0 -0
  82. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/oid.py +0 -0
  83. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/pagination.py +0 -0
  84. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/path.py +0 -0
  85. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/peer.py +0 -0
  86. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/procutil.py +0 -0
  87. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/repository.py +0 -0
  88. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/revision.py +0 -0
  89. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/revset.py +0 -0
  90. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/scripts.py +0 -0
  91. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/server/__init__.py +0 -0
  92. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/server/address.py +0 -0
  93. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/server/mono.py +0 -0
  94. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/server/prefork.py +0 -0
  95. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/server/tests/__init__.py +0 -0
  96. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/server/tests/test_address.py +0 -0
  97. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/server/tests/test_mono.py +0 -0
  98. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/server/tests/test_prefork.py +0 -0
  99. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/server/tests/test_worker.py +0 -0
  100. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/server/worker.py +0 -0
  101. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/__init__.py +0 -0
  102. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/analysis.py +0 -0
  103. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/blob.py +0 -0
  104. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/commit.py +0 -0
  105. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/interceptors.py +0 -0
  106. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/mercurial_changeset.py +0 -0
  107. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/mercurial_operations.py +0 -0
  108. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/mercurial_repository.py +0 -0
  109. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/__init__.py +0 -0
  110. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/fixture.py +0 -0
  111. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_analysis.py +0 -0
  112. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_blob.py +0 -0
  113. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_commit.py +0 -0
  114. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_default_branch.py +0 -0
  115. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_mercurial_changeset.py +0 -0
  116. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_mercurial_operations.py +0 -0
  117. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/service/tests/test_mercurial_repository.py +0 -0
  118. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/servicer.py +0 -0
  119. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/ssh.py +0 -0
  120. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stream.py +0 -0
  121. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/__init__.py +0 -0
  122. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/analysis_pb2.py +0 -0
  123. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/analysis_pb2_grpc.py +0 -0
  124. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/blob_pb2.py +0 -0
  125. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/blob_pb2_grpc.py +0 -0
  126. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/diff_pb2.py +0 -0
  127. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/diff_pb2_grpc.py +0 -0
  128. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/errors_pb2_grpc.py +0 -0
  129. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/lint_pb2_grpc.py +0 -0
  130. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/mercurial_changeset_pb2.py +0 -0
  131. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/mercurial_changeset_pb2_grpc.py +0 -0
  132. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/mercurial_operations_pb2.py +0 -0
  133. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/mercurial_operations_pb2_grpc.py +0 -0
  134. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/mercurial_repository_pb2.py +0 -0
  135. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/mercurial_repository_pb2_grpc.py +0 -0
  136. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/operations_pb2_grpc.py +0 -0
  137. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/ref_pb2.py +0 -0
  138. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/ref_pb2_grpc.py +0 -0
  139. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/server_pb2.py +0 -0
  140. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/server_pb2_grpc.py +0 -0
  141. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/stub/shared_pb2_grpc.py +0 -0
  142. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tag.py +0 -0
  143. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/__init__.py +0 -0
  144. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/bundle.py +0 -0
  145. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/context.py +0 -0
  146. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/data/authorized_keys +0 -0
  147. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/data/backup_additional_no_git.tar +0 -0
  148. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/data/id_ecdsa_user +0 -0
  149. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/data/known_hosts +0 -0
  150. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/data/ssh_host_ecdsa_key +0 -0
  151. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/data/ssh_host_ecdsa_key.pub +0 -0
  152. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/data/sshd_config +0 -0
  153. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/grpc.py +0 -0
  154. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/ssh.py +0 -0
  155. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/sshd.py +0 -0
  156. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/tests/__init__.py +0 -0
  157. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/testing/tests/test_sshd.py +0 -0
  158. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/__init__.py +0 -0
  159. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/common.py +0 -0
  160. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_branch.py +0 -0
  161. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_diff.py +0 -0
  162. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_errors.py +0 -0
  163. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_feature.py +0 -0
  164. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_file_context.py +0 -0
  165. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_gitlab_ref.py +0 -0
  166. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_license_detector.py +0 -0
  167. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_linguist.py +0 -0
  168. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_manifest.py +0 -0
  169. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_oid.py +0 -0
  170. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_peer.py +0 -0
  171. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_repository.py +0 -0
  172. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_revision.py +0 -0
  173. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_revset.py +0 -0
  174. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_servicer.py +0 -0
  175. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_stream.py +0 -0
  176. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_tag.py +0 -0
  177. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/tests/test_workdir.py +0 -0
  178. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/util.py +0 -0
  179. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly/workdir.py +0 -0
  180. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly.egg-info/dependency_links.txt +0 -0
  181. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly.egg-info/entry_points.txt +0 -0
  182. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly.egg-info/requires.txt +0 -0
  183. {hgitaly-2.5.5 → hgitaly-2.7.0}/hgitaly.egg-info/top_level.txt +0 -0
  184. {hgitaly-2.5.5 → hgitaly-2.7.0}/install-requirements.txt +0 -0
  185. {hgitaly-2.5.5 → hgitaly-2.7.0}/lint +0 -0
  186. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/analysis.proto +0 -0
  187. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/blob.proto +0 -0
  188. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/cleanup.proto +0 -0
  189. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/cluster.proto +0 -0
  190. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/conflicts.proto +0 -0
  191. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/diff.proto +0 -0
  192. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/hook.proto +0 -0
  193. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/internal.proto +0 -0
  194. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/log.proto +0 -0
  195. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/mercurial-changeset.proto +0 -0
  196. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/mercurial-operations.proto +0 -0
  197. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/mercurial-repository.proto +0 -0
  198. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/namespace.proto +0 -0
  199. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/objectpool.proto +0 -0
  200. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/packfile.proto +0 -0
  201. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/praefect.proto +0 -0
  202. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/ref.proto +0 -0
  203. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/remote.proto +0 -0
  204. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/server.proto +0 -0
  205. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/service_config.proto +0 -0
  206. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/smarthttp.proto +0 -0
  207. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/transaction.proto +0 -0
  208. {hgitaly-2.5.5 → hgitaly-2.7.0}/protos/wiki.proto +0 -0
  209. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/.ruby-version +0 -0
  210. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/Gemfile +0 -0
  211. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/README.md +0 -0
  212. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/generate-grpc-lib +0 -0
  213. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/hgitaly.gemspec +0 -0
  214. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/lib/hgitaly/mercurial-changeset_pb.rb +0 -0
  215. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/lib/hgitaly/mercurial-changeset_services_pb.rb +0 -0
  216. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/lib/hgitaly/mercurial-operations_pb.rb +0 -0
  217. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/lib/hgitaly/mercurial-operations_services_pb.rb +0 -0
  218. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/lib/hgitaly/mercurial-repository_pb.rb +0 -0
  219. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/lib/hgitaly/mercurial-repository_services_pb.rb +0 -0
  220. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/lib/hgitaly.rb +0 -0
  221. {hgitaly-2.5.5 → hgitaly-2.7.0}/ruby/run.rb +0 -0
  222. {hgitaly-2.5.5 → hgitaly-2.7.0}/run-all-tests +0 -0
  223. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/Cargo.lock +0 -0
  224. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/Cargo.toml +0 -0
  225. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/Makefile +0 -0
  226. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/build-from-tarball.sh +0 -0
  227. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/check-line-width +0 -0
  228. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/README.md +0 -0
  229. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/mercurial.patch +0 -0
  230. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/any.proto +0 -0
  231. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/api.proto +0 -0
  232. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/compiler/plugin.proto +0 -0
  233. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/descriptor.proto +0 -0
  234. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/duration.proto +0 -0
  235. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/empty.proto +0 -0
  236. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/field_mask.proto +0 -0
  237. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/source_context.proto +0 -0
  238. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/struct.proto +0 -0
  239. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/timestamp.proto +0 -0
  240. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/type.proto +0 -0
  241. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/dependencies/proto/google/protobuf/wrappers.proto +0 -0
  242. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/go-enry.rev +0 -0
  243. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/lint +0 -0
  244. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/mercurial.rev +0 -0
  245. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/Cargo.toml +0 -0
  246. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/build.rs +0 -0
  247. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/clippy.toml +0 -0
  248. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/config.rs +0 -0
  249. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/errors.rs +0 -0
  250. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/generated/README.md +0 -0
  251. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/git.rs +0 -0
  252. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/gitlab/mod.rs +0 -0
  253. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/gitlab/reference.rs +0 -0
  254. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/gitlab/revision.rs +0 -0
  255. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/gitlab/state.rs +0 -0
  256. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/glob.rs +0 -0
  257. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/lib.rs +0 -0
  258. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/main.rs +0 -0
  259. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/mercurial.rs +0 -0
  260. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/message.rs +0 -0
  261. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/metadata.rs +0 -0
  262. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/oid.rs +0 -0
  263. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/process.rs +0 -0
  264. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/repository.rs +0 -0
  265. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/analysis.rs +0 -0
  266. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/blob.rs +0 -0
  267. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/commit/find_commits.rs +0 -0
  268. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/commit/get_tree_entries.rs +0 -0
  269. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/commit/last_commits.rs +0 -0
  270. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/commit/mod.rs +0 -0
  271. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/commit/tree_entry.rs +0 -0
  272. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/diff.rs +0 -0
  273. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/mercurial_repository.rs +0 -0
  274. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/mod.rs +0 -0
  275. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/ref.rs +0 -0
  276. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/repository.rs +0 -0
  277. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/service/server.rs +0 -0
  278. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/sidecar.rs +0 -0
  279. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/streaming.rs +0 -0
  280. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rhgitaly/src/util.rs +0 -0
  281. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/rs-enry.rev +0 -0
  282. {hgitaly-2.5.5 → hgitaly-2.7.0}/rust/src-tarball.sh +0 -0
  283. {hgitaly-2.5.5 → hgitaly-2.7.0}/setup.cfg +0 -0
  284. {hgitaly-2.5.5 → hgitaly-2.7.0}/setup.py +0 -0
  285. {hgitaly-2.5.5 → hgitaly-2.7.0}/test-requirements.txt +0 -0
  286. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/__init__.py +0 -0
  287. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/conftest.py +0 -0
  288. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/gitaly.py +0 -0
  289. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/hgitaly_rhgitaly_comparison.py +0 -0
  290. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/rhgitaly.py +0 -0
  291. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/test_blob_tree.py +0 -0
  292. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/test_comparison.py +0 -0
  293. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/test_gitaly_server.py +0 -0
  294. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/test_mercurial_repository.py +0 -0
  295. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/test_repository_service.py +0 -0
  296. {hgitaly-2.5.5 → hgitaly-2.7.0}/tests_with_gitaly/test_rhgitaly_server.py +0 -0
@@ -119,4 +119,4 @@ c1b00e1bc1bf0a2d41907b345c48cf795f910a4f 2.5.0
119
119
  136dff98ddc1315e6db9479d9b6dd2c2204c2e5f 2.5.1
120
120
  7dbcba18d83708ff81d8cec9696a86d24ed5d20a 2.5.2
121
121
  3a83836b7408f1318a80f1ba97051086596edd12 2.5.3
122
- 3c955f8f106db667acb67a1cc5fa06b4a7e218e6 2.5.4
122
+ b956f11f1342d8aada221b747ee16e1328037fcd 2.6.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hgitaly
3
- Version: 2.5.5
3
+ Version: 2.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
@@ -0,0 +1 @@
1
+ 2.7.0
@@ -46,19 +46,17 @@ Status_Type_Map = dict(
46
46
  added=ChangedPaths.Status.ADDED,
47
47
  modified=ChangedPaths.Status.MODIFIED,
48
48
  removed=ChangedPaths.Status.DELETED,
49
- renamed=ChangedPaths.Status.RENAMED,
50
49
  # Note: Mercurial includes TYPE_CHANGE
51
50
  # (symlink, regular file, submodule...etc) in MODIFIED status
52
51
  )
53
52
  """Mapping status object attributes to ChangedPaths enum."""
54
53
 
55
54
  COPIED = ChangedPaths.Status.COPIED
56
- RENAMED = ChangedPaths.Status.RENAMED
57
55
  DIFF_HUNKS_START_RX = re.compile(rb'^(--- )|^(Binary file)')
58
56
  """To match the header line right before hunks start getting dumped."""
59
57
 
60
58
 
61
- def changed_paths(repo, from_ctx, to_ctx, base_path, find_renames=False):
59
+ def changed_paths(repo, from_ctx, to_ctx, base_path):
62
60
  if base_path is None:
63
61
  matcher = None
64
62
  path_trim_at = 0
@@ -76,33 +74,26 @@ def changed_paths(repo, from_ctx, to_ctx, base_path, find_renames=False):
76
74
  patterns=[b'path:' + base_path])
77
75
  path_trim_at = len(base_path) + 1
78
76
 
79
- copy_info = copies.pathcopies(from_ctx, to_ctx, match=matcher)
80
- # copies do not distinguish actual copies from renames. The difference
81
- # will be that a rename goes with deletion of the original.
77
+ copied = list(copy_changed_paths(
78
+ from_ctx,
79
+ to_ctx,
80
+ copies.pathcopies(from_ctx, to_ctx, match=matcher),
81
+ trim_at=path_trim_at))
82
+ copied_paths = set(cp.path for cp in copied)
82
83
 
83
84
  status = from_ctx.status(to_ctx, match=matcher)
84
- # this will remove renames from copy_info, keeping only actual copies
85
- yield from status_changed_paths(from_ctx, to_ctx, status, copy_info,
86
- find_renames=find_renames,
87
- trim_at=path_trim_at)
88
- yield from copy_changed_paths(from_ctx,
89
- to_ctx,
90
- copy_info,
91
- trim_at=path_trim_at)
92
-
93
-
94
- def status_changed_paths(from_ctx, to_ctx, status, copy_info,
95
- find_renames=False, trim_at=0):
96
- rcopy_info = {v: k for k, v in copy_info.items()}
85
+ for path in status_changed_paths(from_ctx, to_ctx, status,
86
+ trim_at=path_trim_at):
87
+ if path.path not in copied_paths:
88
+ yield path
89
+
90
+ yield from iter(copied)
91
+
92
+
93
+ def status_changed_paths(from_ctx, to_ctx, status, trim_at=0):
97
94
  """Return ChangedPaths from Mercurial status object"""
98
95
  for stype in ['added', 'modified', 'removed']:
99
96
  for path in status.__getattribute__(stype):
100
- copied_from = copy_info.get(path)
101
- if copied_from is not None:
102
- if copied_from not in status.removed or find_renames:
103
- continue
104
-
105
- old_path = b''
106
97
  if stype == 'added':
107
98
  old_mode = OBJECT_MODE_DOES_NOT_EXIST
108
99
  old_blob_id = NULL_BLOB_OID
@@ -111,21 +102,8 @@ def status_changed_paths(from_ctx, to_ctx, status, copy_info,
111
102
  old_blob_id = ctx_blob_oid(from_ctx, path)
112
103
 
113
104
  if stype == 'removed':
114
- new_path = rcopy_info.get(path)
115
- if new_path is None:
116
- new_mode = OBJECT_MODE_DOES_NOT_EXIST
117
- new_blob_id = NULL_BLOB_OID
118
- else:
119
- del copy_info[new_path]
120
- if find_renames:
121
- stype = 'renamed'
122
- old_path = path
123
- path = new_path
124
- new_mode = git_perms(to_ctx.filectx(new_path))
125
- new_blob_id = ctx_blob_oid(to_ctx, new_path)
126
- else:
127
- new_mode = OBJECT_MODE_DOES_NOT_EXIST
128
- new_blob_id = NULL_BLOB_OID
105
+ new_mode = OBJECT_MODE_DOES_NOT_EXIST
106
+ new_blob_id = NULL_BLOB_OID
129
107
  else:
130
108
  new_mode = git_perms(to_ctx.filectx(path))
131
109
  new_blob_id = ctx_blob_oid(to_ctx, path)
@@ -136,13 +114,11 @@ def status_changed_paths(from_ctx, to_ctx, status, copy_info,
136
114
  new_mode=new_mode,
137
115
  old_blob_id=old_blob_id,
138
116
  new_blob_id=new_blob_id,
139
- old_path=old_path,
140
117
  status=Status_Type_Map[stype]
141
118
  )
142
119
 
143
120
 
144
- def copy_changed_paths(from_ctx, to_ctx, path_copies,
145
- trim_at=0, find_renames=False):
121
+ def copy_changed_paths(from_ctx, to_ctx, path_copies, trim_at=0):
146
122
  """Return ChangedPaths for the given paths, relative to base_path.
147
123
 
148
124
  Given that Gitaly currently (gitaly@c54d613d0) does not pass
@@ -153,11 +129,8 @@ def copy_changed_paths(from_ctx, to_ctx, path_copies,
153
129
  for target, source in path_copies.items():
154
130
  yield ChangedPaths(path=target[trim_at:],
155
131
  status=COPIED,
156
- old_mode=git_perms(from_ctx.filectx(source)),
157
- old_blob_id=ctx_blob_oid(from_ctx, source),
132
+ old_mode=git_perms(to_ctx.filectx(source)),
158
133
  new_mode=git_perms(to_ctx.filectx(target)),
159
- new_blob_id=ctx_blob_oid(to_ctx, target),
160
- old_path=source[trim_at:],
161
134
  )
162
135
 
163
136
 
@@ -87,10 +87,6 @@ def message_to_string(message):
87
87
  return result
88
88
 
89
89
 
90
- def as_dict(message):
91
- return {descr.name: value for descr, value in message.ListFields()}
92
-
93
-
94
90
  class Logging:
95
91
  """Wrapper of requests and responses for sensible logging.
96
92
 
@@ -521,11 +521,8 @@ class DiffServicer(DiffServiceServicer, HGitalyServicer):
521
521
  for cp in cids_paths]
522
522
  extracted.append((left_ctx, right_ctx, path))
523
523
 
524
- find_renames = request.find_renames
525
524
  for paths in chunked(path for extr in extracted
526
- for path in changed_paths(
527
- repo, *extr,
528
- find_renames=find_renames)):
525
+ for path in changed_paths(repo, *extr)):
529
526
  yield FindChangedPathsResponse(paths=paths)
530
527
 
531
528
  def GetPatchID(self, request: GetPatchIDRequest,
@@ -38,6 +38,7 @@ from ..servicer import HGitalyServicer
38
38
 
39
39
  from ..stub.operations_pb2 import (
40
40
  OperationBranchUpdate,
41
+ UserFFBranchError,
41
42
  UserFFBranchRequest,
42
43
  UserFFBranchResponse,
43
44
  UserSquashRequest,
@@ -45,6 +46,7 @@ from ..stub.operations_pb2 import (
45
46
  UserSquashError,
46
47
  )
47
48
  from ..stub.errors_pb2 import (
49
+ ReferenceUpdateError,
48
50
  ResolveRevisionError,
49
51
  )
50
52
  from ..stub.operations_pb2_grpc import OperationServiceServicer
@@ -214,7 +216,17 @@ class OperationServicer(OperationServiceServicer, HGitalyServicer):
214
216
  context.abort(StatusCode.INVALID_ARGUMENT,
215
217
  "cannot resolve expected old object ID: "
216
218
  "reference not found")
217
- return UserFFBranchResponse()
219
+ # no point trying to match the Gitaly error details: we
220
+ # have the much better structured error
221
+ structured_abort(context,
222
+ StatusCode.FAILED_PRECONDITION,
223
+ "expected_old_oid mismatch",
224
+ UserFFBranchError(
225
+ reference_update=ReferenceUpdateError(
226
+ # Gitaly doesn't fill in `reference_name`
227
+ old_oid=old_id,
228
+ new_oid=to_publish.hex().decode('ascii'),
229
+ )))
218
230
 
219
231
  if ancestor(to_publish, current_head) != current_head.rev():
220
232
  context.abort(StatusCode.FAILED_PRECONDITION,
@@ -28,8 +28,6 @@ from hgext3rd.heptapod.special_ref import (
28
28
  )
29
29
  from hgext3rd.heptapod.keep_around import (
30
30
  parse_keep_around_ref,
31
- iter_keep_arounds,
32
- init_keep_arounds,
33
31
  )
34
32
 
35
33
  from ..errors import (
@@ -42,8 +40,6 @@ from ..pagination import (
42
40
  )
43
41
  from ..revision import (
44
42
  CHANGESET_HASH_BYTES_REGEXP,
45
- ZERO_SHA,
46
- ZERO_SHA_STR,
47
43
  gitlab_revision_hash,
48
44
  )
49
45
  from ..stream import (
@@ -55,7 +51,6 @@ from ..stub.shared_pb2 import (
55
51
  )
56
52
  from ..stub.errors_pb2 import (
57
53
  ReferenceNotFoundError,
58
- ReferenceStateMismatchError,
59
54
  )
60
55
  from ..stub.ref_pb2 import (
61
56
  FindDefaultBranchNameRequest,
@@ -79,9 +74,6 @@ from ..stub.ref_pb2 import (
79
74
  FindBranchResponse,
80
75
  DeleteRefsRequest,
81
76
  DeleteRefsResponse,
82
- UpdateReferencesError,
83
- UpdateReferencesRequest,
84
- UpdateReferencesResponse,
85
77
  ListBranchNamesContainingCommitRequest,
86
78
  ListBranchNamesContainingCommitResponse,
87
79
  ListTagNamesContainingCommitRequest,
@@ -95,6 +87,9 @@ from ..stub.ref_pb2 import (
95
87
  )
96
88
  from ..stub.ref_pb2_grpc import RefServiceServicer
97
89
 
90
+ from ..revision import (
91
+ ZERO_SHA_STR,
92
+ )
98
93
  from ..branch import (
99
94
  BranchSortBy,
100
95
  gitlab_branch_head,
@@ -278,93 +273,6 @@ class RefServicer(RefServiceServicer, HGitalyServicer):
278
273
  return FindBranchResponse(
279
274
  branch=Branch(name=name, target_commit=message.commit(head)))
280
275
 
281
- def UpdateReferences(self,
282
- request: UpdateReferencesRequest,
283
- context) -> UpdateReferencesResponse:
284
- self.STATUS_CODE_STORAGE_NOT_FOUND = StatusCode.INVALID_ARGUMENT
285
- first = True
286
- special_changes = []
287
- ka_changes = []
288
- for req in request:
289
- if first:
290
- # blobs are given by oid, hence as in direct changeset Node
291
- # IDs, the unfiltered repo is the right one for the task
292
- repo = self.load_repo(req.repository, context).unfiltered()
293
- first = False
294
-
295
- for upd in req.updates:
296
- if len(upd.new_object_id) != 40:
297
- oid = upd.new_object_id.decode('ascii', 'replace')
298
- context.abort(StatusCode.INVALID_ARGUMENT,
299
- "validating new object ID: "
300
- f'invalid object ID: "{oid}", '
301
- f"expected length 40, got {len(oid)}")
302
-
303
- ref_path = upd.reference
304
- change = (upd.old_object_id, upd.new_object_id)
305
- if change[0] == change[1]:
306
- # let's not waste resources for this
307
- continue
308
-
309
- # consider only special refs and keep-arounds, as other refs
310
- # (branches and tags) are only reflecting changesets content,
311
- # setting them independently makes no sense with Mercurial
312
- special_ref = parse_special_ref(ref_path)
313
- if special_ref is not None:
314
- special_changes.append((special_ref, change))
315
- continue
316
-
317
- ka = parse_keep_around_ref(upd.reference)
318
- if ka is not None:
319
- if (
320
- upd.new_object_id != ZERO_SHA
321
- and ka != upd.new_object_id
322
- ):
323
- context.abort(StatusCode.INVALID_ARGUMENT,
324
- "Inconsistent keep-around.")
325
- ka_changes.append(change)
326
-
327
- with repo.lock():
328
- # keeping promise of atomicity of this method
329
- special_existing = special_refs(repo)
330
- if special_existing is GITLAB_TYPED_REFS_MISSING:
331
- special_existing = {}
332
- for name, (old_id, new_id) in special_changes:
333
- existing = special_existing.get(name)
334
- if old_id == ZERO_SHA and existing is not None:
335
- context.abort(StatusCode.INTERNAL,
336
- "committing update: "
337
- "reference already exists")
338
- elif old_id and old_id != ZERO_SHA and existing != old_id:
339
- Mismatch = ReferenceStateMismatchError # just too long!
340
- structured_abort(
341
- context, StatusCode.ABORTED,
342
- "reference does not point to expected object",
343
- UpdateReferencesError(
344
- reference_state_mismatch=Mismatch(
345
- reference_name=b'refs/' + name,
346
- expected_object_id=old_id,
347
- actual_object_id=existing)))
348
- elif new_id == ZERO_SHA:
349
- del special_existing[name]
350
- else:
351
- special_existing[name] = new_id
352
-
353
- # TODO make a collect_keep_arounds() or keep_arounds_set()
354
- ka_existing = set(iter_keep_arounds(repo))
355
- ka_existing.discard(GITLAB_TYPED_REFS_MISSING)
356
- for old_id, new_id in ka_changes:
357
- # bogus requests have already been prohibited
358
- if new_id == ZERO_SHA:
359
- ka_existing.discard(old_id)
360
- else:
361
- ka_existing.add(new_id)
362
-
363
- write_special_refs(repo, special_existing)
364
- init_keep_arounds(repo, ka_existing)
365
-
366
- return UpdateReferencesResponse()
367
-
368
276
  def DeleteRefs(self,
369
277
  request: DeleteRefsRequest,
370
278
  context) -> DeleteRefsResponse:
@@ -768,10 +768,12 @@ def render_git_grep_matches(buf, ref, path, enum_lines):
768
768
  :param enum_lines: iterable of pairs `(line_no, line)`
769
769
  """
770
770
  for lineno, line in enum_lines:
771
- buf.write(b'%s:%s\x00%d\x00%s\n' % (ref, path, lineno, line))
771
+ buf.write(b'%s:%s\x00%d\x00%s' % (ref, path, lineno, line))
772
+ if not line.endswith(b'\n'):
773
+ buf.write(b'\n')
772
774
 
773
775
 
774
- SPLITLINES_RX = re.compile(br'(.*?)(\r\n?|\n|\Z)', re.MULTILINE)
776
+ SPLITLINES_RX = re.compile(br'(.*?(\r\n?|\n|\Z))', re.MULTILINE)
775
777
 
776
778
 
777
779
  def grep_file(rx, data, context_width=2):
@@ -11,6 +11,8 @@ from ..servicer import HGitalyServicer
11
11
  from ..stub.server_pb2 import (
12
12
  ServerInfoRequest,
13
13
  ServerInfoResponse,
14
+ ServerSignatureRequest,
15
+ ServerSignatureResponse,
14
16
  )
15
17
  from ..stub.server_pb2_grpc import ServerServiceServicer
16
18
 
@@ -23,3 +25,12 @@ class ServerServicer(ServerServiceServicer, HGitalyServicer):
23
25
  request: ServerInfoRequest,
24
26
  context) -> ServerInfoResponse:
25
27
  return ServerInfoResponse(server_version=__version__)
28
+
29
+ def ServerSignature(self,
30
+ request: ServerSignatureRequest,
31
+ context) -> ServerSignatureResponse:
32
+ # Gitaly's signing key path configuration is optional (defaults to
33
+ # empty string, see `gitaly.toml.example`). We return the same value
34
+ # as Gitaly does in that case, since Mercurial signing is currently
35
+ # not implemented.
36
+ return ServerSignatureResponse()
@@ -127,7 +127,7 @@ class DiffFixture(ServiceFixture):
127
127
  (changed.status, perm_change))
128
128
  return by_file
129
129
 
130
- def find_changed_paths_commits(self, commits, compare_to=(), **kw):
130
+ def find_changed_paths_commits(self, commits, compare_to=()):
131
131
  """Wrap FindChangedPaths used with CommitRequest.
132
132
 
133
133
  :param compare_to: if given, will be used in all requests, hoping
@@ -141,7 +141,6 @@ class DiffFixture(ServiceFixture):
141
141
  commit_revision=c,
142
142
  parent_commit_revisions=compare_to))
143
143
  for c in commits],
144
- **kw
145
144
  )
146
145
 
147
146
  def find_changed_paths_tree(self, left_oid, right_oid):
@@ -687,50 +686,6 @@ def test_find_changed_paths_copy_in_tree(diff_fixture):
687
686
  }
688
687
 
689
688
 
690
- def test_find_changed_paths_rename(diff_fixture):
691
- wrapper = diff_fixture.repo_wrapper
692
-
693
- (wrapper.path / 'subdir').mkdir() # avoid all lengths to be 3
694
- (wrapper.path / 'subdir/bar').write_text('some bar')
695
- ctx0 = wrapper.commit(rel_paths=['subdir'], add_remove=True)
696
-
697
- wrapper.command(b'mv', wrapper.repo.root + b'/subdir/bar',
698
- wrapper.repo.root + b'/subdir/baz')
699
- ctx1 = wrapper.commit(rel_paths=['subdir'])
700
-
701
- repo = wrapper.repo
702
-
703
- sub0_oid, sub1_oid = [tree_oid(repo, ctx.hex().decode('ascii'), b'subdir')
704
- for ctx in (ctx0, ctx1)]
705
- ret = diff_fixture.find_changed_paths_commits(
706
- [ctx1.hex()],
707
- compare_to=[ctx0.hex()],
708
- find_renames=False,
709
- )
710
- assert ret == {
711
- b'subdir/baz': [(ChangedPaths.Status.ADDED,
712
- (OBJECT_MODE_DOES_NOT_EXIST,
713
- OBJECT_MODE_NON_EXECUTABLE),
714
- )],
715
- b'subdir/bar': [(ChangedPaths.Status.DELETED,
716
- (OBJECT_MODE_NON_EXECUTABLE,
717
- OBJECT_MODE_DOES_NOT_EXIST)
718
- )],
719
- }
720
-
721
- ret = diff_fixture.find_changed_paths_commits(
722
- [ctx1.hex()],
723
- compare_to=[ctx0.hex()],
724
- find_renames=True,
725
- )
726
- assert ret == {
727
- b'subdir/baz': [(ChangedPaths.Status.RENAMED, None)],
728
- }
729
-
730
- # TODO test the case of rename with duplication:
731
- # hg cp foo bar; hg mv foo bar2
732
-
733
-
734
689
  def test_get_patch_id(diff_fixture):
735
690
  wrapper = diff_fixture.repo_wrapper
736
691
  patch_id = diff_fixture.get_patch_id
@@ -23,7 +23,6 @@ from hgext3rd.heptapod.branch import (
23
23
  from hgitaly.stub.operations_pb2 import (
24
24
  OperationBranchUpdate,
25
25
  UserFFBranchRequest,
26
- UserFFBranchResponse,
27
26
  UserSquashRequest,
28
27
  )
29
28
  from hgitaly.stub.operations_pb2_grpc import (
@@ -256,8 +255,11 @@ def test_user_ff_branch(operations_fixture, project_mode):
256
255
  assert 'parse commit ID' in exc_info.value.details()
257
256
 
258
257
  # old oid mismatch
259
- assert ff_branch(branch=gl_branch, commit_id=sha2,
260
- expected_old_oid=sha0) == UserFFBranchResponse()
258
+ with pytest.raises(RpcError) as exc_info:
259
+ ff_branch(branch=gl_branch, commit_id=sha2, expected_old_oid=sha0)
260
+ assert exc_info.value.code() == StatusCode.FAILED_PRECONDITION
261
+ assert exc_info.value.details() == "expected_old_oid mismatch"
262
+
261
263
  assert fixture.list_refs() == before_refs
262
264
 
263
265
  # Actual call expected to succeed
@@ -30,7 +30,6 @@ from hgext3rd.heptapod.keep_around import (
30
30
  from hgitaly import feature
31
31
  from hgitaly.errors import parse_assert_structured_error
32
32
  from hgitaly.revision import (
33
- ZERO_SHA,
34
33
  ZERO_SHA_STR,
35
34
  )
36
35
  from hgitaly.tests.common import (
@@ -57,7 +56,6 @@ from hgitaly.stub.ref_pb2 import (
57
56
  FindRefsByOIDRequest,
58
57
  FindTagError,
59
58
  FindTagRequest,
60
- UpdateReferencesRequest,
61
59
  )
62
60
  from hgitaly.stub.ref_pb2_grpc import RefServiceStub
63
61
 
@@ -87,10 +85,6 @@ class RefFixture(ServiceFixture):
87
85
  metadata=feature.as_grpc_metadata(self.feature_flags),
88
86
  )
89
87
 
90
- def ref_exists(self, ref, **kw):
91
- kw.setdefault('repository', self.grpc_repo)
92
- return self.stub.RefExists(RefExistsRequest(ref=ref, **kw)).value
93
-
94
88
  def list_refs(self, patterns=(b"refs/", ), **kw):
95
89
  return [(ref.name, ref.target)
96
90
  for resp in self.stub.ListRefs(
@@ -103,22 +97,6 @@ class RefFixture(ServiceFixture):
103
97
  kw.setdefault('repository', self.grpc_repo)
104
98
  return self.stub.FindRefsByOID(FindRefsByOIDRequest(**kw)).refs
105
99
 
106
- def update_refs(self, updates, **kw):
107
- Update = UpdateReferencesRequest.Update
108
- kw.setdefault('repository', self.grpc_repo)
109
-
110
- update_messages = []
111
- for ref_path, old_id, new_id in updates:
112
- upd_kw = dict(reference=ref_path, new_object_id=new_id)
113
- if old_id is not None:
114
- upd_kw['old_object_id'] = old_id
115
- update_messages.append(Update(**upd_kw))
116
-
117
- return self.stub.UpdateReferences(
118
- iter([UpdateReferencesRequest(updates=[upd], **kw)
119
- for upd in update_messages])
120
- )
121
-
122
100
 
123
101
  @pytest.fixture
124
102
  def ref_fixture(grpc_channel, server_repos_root):
@@ -655,58 +633,3 @@ def test_list_refs(ref_fixture):
655
633
  assert fixture.find_refs_by_oid(
656
634
  oid=sha1, sort_field='refname', limit=1
657
635
  ) == ['refs/heads/branch/default']
658
-
659
-
660
- def test_update_references(ref_fixture):
661
- fixture = ref_fixture
662
- wrapper = fixture.repo_wrapper
663
-
664
- sha0 = wrapper.write_commit('afoo', message="Some foo").hex()
665
- sha1 = wrapper.write_commit('afoo', message="Some foo").hex()
666
-
667
- pipeline_1 = b'refs/pipelines/1'
668
- ka_0 = b'refs/keep-around/' + sha0
669
- fixture.update_refs([(pipeline_1, ZERO_SHA, sha1),
670
- (ka_0, ZERO_SHA, sha0),
671
- ])
672
- assert fixture.ref_exists(ka_0)
673
- assert fixture.ref_exists(pipeline_1)
674
- assert fixture.list_refs(patterns=[b'refs/pipelines/']) == [
675
- (pipeline_1, sha1.decode())
676
- ]
677
-
678
- fixture.update_refs([(pipeline_1, sha1, sha0),
679
- (ka_0, sha0, ZERO_SHA),
680
- ])
681
- assert not fixture.ref_exists(ka_0)
682
- assert fixture.list_refs(patterns=[b'refs/pipelines/']) == [
683
- (pipeline_1, sha0.decode())
684
- ]
685
-
686
- # edge case equivalent to no-op
687
- fixture.update_refs([(pipeline_1, sha0, sha0)])
688
- assert fixture.list_refs(patterns=[b'refs/pipelines/']) == [
689
- (pipeline_1, sha0.decode())
690
- ]
691
-
692
- # error cases
693
- with pytest.raises(grpc.RpcError) as exc_info:
694
- fixture.update_refs([(pipeline_1, None, b'branch/default')])
695
- assert exc_info.value.code() == grpc.StatusCode.INVALID_ARGUMENT
696
-
697
- with pytest.raises(grpc.RpcError) as exc_info:
698
- fixture.update_refs([(ka_0, None, sha1)])
699
- assert exc_info.value.code() == grpc.StatusCode.INVALID_ARGUMENT
700
-
701
- with pytest.raises(grpc.RpcError) as exc_info:
702
- fixture.update_refs([(pipeline_1, ZERO_SHA, sha1)])
703
- assert exc_info.value.code() == grpc.StatusCode.INTERNAL
704
- assert 'reference already exists' in exc_info.value.details()
705
-
706
- with pytest.raises(grpc.RpcError) as exc_info:
707
- fixture.update_refs([(pipeline_1, sha1, sha0)])
708
- assert exc_info.value.code() == grpc.StatusCode.ABORTED
709
-
710
- # deletions
711
- fixture.update_refs([(pipeline_1, sha0, ZERO_SHA)])
712
- assert not fixture.ref_exists(pipeline_1)
@@ -772,8 +772,8 @@ def test_search_files_by_content(fixture_with_repo):
772
772
 
773
773
  # more than two lines before match
774
774
  assert search(query="^ba4.c") == [
775
- [b'branch/default:sub/ba4\x002\x00l2',
776
- b'branch/default:sub/ba4\x003\x00l3',
775
+ [b'branch/default:sub/ba4\x002\x00l2\r',
776
+ b'branch/default:sub/ba4\x003\x00l3\r',
777
777
  b'branch/default:sub/ba4\x004\x00ba4 content',
778
778
  b'branch/default:sub/ba4\x005\x00l5',
779
779
  b'',
@@ -784,8 +784,8 @@ def test_search_files_by_content(fixture_with_repo):
784
784
  # two matches, with overlapping context or not
785
785
  assert search(query="^l1|ba4.c") == [
786
786
  [b'branch/default:sub/ba4\x001\x00l1',
787
- b'branch/default:sub/ba4\x002\x00l2',
788
- b'branch/default:sub/ba4\x003\x00l3',
787
+ b'branch/default:sub/ba4\x002\x00l2\r',
788
+ b'branch/default:sub/ba4\x003\x00l3\r',
789
789
  b'branch/default:sub/ba4\x004\x00ba4 content',
790
790
  b'branch/default:sub/ba4\x005\x00l5',
791
791
  b'',
@@ -9,6 +9,7 @@ from pkg_resources import parse_version
9
9
 
10
10
  from hgitaly.stub.server_pb2 import (
11
11
  ServerInfoRequest,
12
+ ServerSignatureRequest,
12
13
  )
13
14
  from hgitaly.stub.server_pb2_grpc import ServerServiceStub
14
15
 
@@ -21,3 +22,10 @@ def test_server_info(grpc_channel):
21
22
  assert version
22
23
  assert re.match(r'\d+[.]\d+[.]\d+',
23
24
  parse_version(version).base_version) is not None
25
+
26
+
27
+ def test_server_signature(grpc_channel):
28
+ grpc_stub = ServerServiceStub(grpc_channel)
29
+
30
+ resp = grpc_stub.ServerSignature(ServerSignatureRequest())
31
+ assert resp.public_key == b''