Commit 74ec1645 authored by Georges Racinet on mutations.racinet.fr's avatar Georges Racinet on mutations.racinet.fr
Browse files

Abid to some Rubocop rules

--HG--
branch : heptapod
parent fe858e3cf137
......@@ -407,9 +407,8 @@ def hg_changeset_publish(user, hgsha, notify_gitlab: false)
# returns Mercurial SHA
def hg_commit(path, username, message, env, add_remove = false)
cmd = [Gitlab.config.mercurial.bin_path, 'commit',
'--config', 'ui.username=' + username,
'-m', message,
]
'--config', 'ui.username=' + username,
'-m', message]
cmd.append('--addremove') if add_remove
output, status = popen(cmd, path, env)
raise HgError, "Could not commit: #{output}" if status != 0
......@@ -723,7 +722,6 @@ def squash_in_progress?(squash_id)
has_tmp_workdir?("squash-#{squash_id}")
end
# Perform a rebase, only for topics.
#
# We may be subject to the same race condition than explained in
......@@ -732,8 +730,10 @@ def squash_in_progress?(squash_id)
# before the resulting commit is written in the database.
# That's the kind of thing we will be able to fix once these
# methods are reimplemented in HGitaly (should be after Heptapod 1.0)
def rebase(user, rebase_id, branch:, branch_sha:,
remote_repository:, remote_branch:, push_options: [])
def rebase(
user, rebase_id, branch:, branch_sha:,
remote_repository:, remote_branch:, push_options: [])
logprefix = "hg_rebase for #{@relative_path} of git #{branch_sha} "\
"(branch #{branch}) onto #{remote_branch}"
logger = Rails.logger
......
......@@ -219,7 +219,7 @@
# we need to disable hooks, because there's no obvious internal
# API to call for, hence this lower level call to #hg_commit
repo = project.repository.raw_repository
hg_env = repo.hg_env_for_write(project.creator) # yes, disables hooks
hg_env = repo.hg_env_for_write(project.creator) # yes, disables hooks
repo.hg_tmp_workdir(nil) do |share_path|
Pathname(share_path).join('README').write("this is Mercurial\n")
repo.hg_commit(share_path, "John Doe1 <jdoe1@heptapod.example>",
......
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