Commit 45d5e90d authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Merged heptapod branch in release branch

--HG--
branch : heptapod-0-13
......@@ -824,6 +824,7 @@ def mergeable_state?(skip_ci_check: false, skip_discussions_check: false)
end
def ff_merge_possible?
return false if project.mercurial? && target_branch.start_with?('topic/')
project.repository.ancestor?(target_branch_sha, diff_head_sha)
end
......
......@@ -12,10 +12,10 @@
%small= "(GitLab CE #{Gitlab::VERSION})"
= version_status_badge
- py_versions = Gitlab.python_versions
%p
= "Mercurial #{py_versions['mercurial']} / Python #{py_versions['python']} / hg-evolve #{py_versions['evolve']}"
- if user_signed_in?
- py_versions = Gitlab.python_versions
%p
= "Mercurial #{py_versions['mercurial']} / Python #{py_versions['python']} / hg-evolve #{py_versions['evolve']}"
%hr
......
......@@ -361,10 +361,17 @@ def hg_merge_changeset(user, source_hgsha, target_hgsha, message,
end
end
# A temporary protection against unwanted publication, see heptapod#284.
def forbid_merge_in_topic(target_branch)
target_topic = parse_gitlab_branch_for_hg(target_branch)[1]
raise ArgumentError, "Merge Requests targeting topics aren't supported yet" unless target_topic.nil?
end
def merge(user, source_sha, target_branch, message)
logprefix = "hg_merge for #{@relative_path} "\
"source_sha=#{source_sha} target_branch=#{target_branch}"
logger = Rails.logger # could need to be adapted for gitaly-ruby (see initialize())
forbid_merge_in_topic(target_branch)
logger.info("#{logprefix} starting")
begin
......@@ -417,6 +424,9 @@ def merge(user, source_sha, target_branch, message)
end
def can_be_merged?(source_sha, target_branch)
target_topic = parse_gitlab_branch_for_hg(target_branch)[1]
return false unless target_topic.nil?
logprefix = "Mercurial.can_be_merged? for #{@relative_path} "\
"source_sha=#{source_sha} target_branch=#{target_branch}"
logger = Rails.logger # could need to be adapted for gitaly-ruby (see initialize())
......@@ -459,6 +469,8 @@ def can_be_merged?(source_sha, target_branch)
end
def ff_merge(user, source_sha, target_branch)
forbid_merge_in_topic(target_branch)
source_hgsha = hg_sha_map[source_sha]
raise ArgumentError, 'Invalid merge target' unless find_branch(target_branch).target
......
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