Commit 1dd4ce02 authored by Georges Racinet's avatar Georges Racinet 🎸

GitLab pre-receive: pass new vcs='hg' parameter

Related to heptapod#295: this parameter will make it
possible to differentiate between calls to the `/allowed` internal
API endpoint for pre-receive checks (common among supported VCSes)
and for Git client SSH operation.

Since it'll make the pre-receive call use the `HgAccess` class
instead of the previously used `GitAccess`, we need now also to
pass the corresponding Mercurial wire protocol command name for
parent 32051030fbba
Pipeline #7794 passed with stages
in 2 minutes and 30 seconds
...@@ -306,12 +306,11 @@ class PreReceive(Hook): ...@@ -306,12 +306,11 @@ class PreReceive(Hook):
if env is None: if env is None:
env = self.environ() env = self.environ()
git_changes = changes[1] git_changes = changes[1]
params = dict(action='git-receive-pack', params = dict(action='unbundle',
changes=git_hook_format_changes(git_changes), changes=git_hook_format_changes(git_changes),
gl_repository=env['GL_REPOSITORY'], gl_repository=env['GL_REPOSITORY'],
project=sanitize_path(self.repo_path), project=sanitize_path(self.repo_path),
# TODO use a dedicated 'hg-git' protocol, and also vcs='hg',
# internally
protocol=env['GL_PROTOCOL'], protocol=env['GL_PROTOCOL'],
) )
actor_symb, actor = parse_actor(env['GL_ID']) actor_symb, actor = parse_actor(env['GL_ID'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment