Commit c29bbec5 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Mercurial native mode: passing environment var to spawned `hg`

Of course the value is `no` for `HgGitRepository` and `yes` for
`HgitalyRepository`

Closes #364 and leaving us with lots of small fixes
to make it work, as the functional tests already told us.

--HG--
branch : heptapod
parent cc7d9fe48dd4
Pipeline #12741 passed with stage
in 42 minutes and 31 seconds
......@@ -399,6 +399,7 @@ def hg_env_for_write(user, force_system_user: false)
'HEPTAPOD_USERINFO_USERNAME' => user&.username,
'HEPTAPOD_USERINFO_NAME' => user&.name,
'HEPTAPOD_USERINFO_EMAIL' => user&.email,
'HEPTAPOD_HG_NATIVE' => 'no',
'GL_REPOSITORY' => @gl_repository,
'HGUSER' => nil,
'HGRCPATH' => Gitlab::Mercurial.hgrc_path
......
......@@ -82,6 +82,13 @@ def vcs_storage_clone(vcs)
)
end
override :hg_env_for_write
def hg_env_for_write(*args, **kwargs)
res = super
res['HEPTAPOD_HG_NATIVE'] = 'yes'
res
end
def list_last_commits_for_tree(sha, path, **kwargs)
commits = super(gitsha_from_sha(sha), path, **kwargs)
commits.each_value { |c| c.hpd_back_convert!(self) }
......
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