This instance will be upgraded to Heptapod 0.25.0 (final) on 2021-09-22 at 15:00 UTC+2 (a few minutes of down time)

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

HgGitRepository#hg_call: fix for user=nil

hg_call is now used in the methods supporting backup and
restoration (`#bundle_to_disk` and `#create_from_bundle`).

There's no obvious GitLab user for these callers, and it
should be irrelevant for Mercurial anyway.

branch : heptapod
parent aa083d55dd26
......@@ -502,6 +502,7 @@ def hg_changeset_publish(user, hgsha, notify_gitlab: false, for_mr_iid: nil)
def hg_call(args, user, path, env: nil, for_write: false,
success_code_can_be_one: false,
force_system_user: false)
if env.nil?
if for_write
env = hg_env_for_write(user, force_system_user: force_system_user)
......@@ -509,9 +510,21 @@ def hg_call(args, user, path, env: nil, for_write: false,
env = hg_env_minimal
username = hg_prepare_user_encoding(env, user, "")
cmd = [Gitlab.config.mercurial.bin_path,
'--config', 'ui.username=' + username] + args
cmd = [Gitlab.config.mercurial.bin_path] + args
username =
if force_system_user
"Heptapod system"
elsif !user.nil?
hg_prepare_user_encoding(env, user, "")
unless username.nil?
cmd.extend(['--config', 'ui.username=' + username])
output, status = popen(cmd, path, env)
if for_write
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