Read about our upcoming Code of Conduct on this issue

This instance will be upgraded to Heptapod 0.28.1 on 2022-01-26 at 16:00 UTC+1 (a few minutes of down time)

Commit 242c0946 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Mercurial native mode: case where topic still visible after publication

The branchmap rules make it so that if it's useful for visualisation
of instabilities, in stack topics case, the older one is still
visible after publication (because it's base of the one that now
has to be rebased).

Hoping this can change at some point in the future, though.
parent dc2a28b750f8
......@@ -147,7 +147,10 @@ def rebase_publish_push(repo, topic):
return sha
def assert_merge_detected(project, mr_id, named_branch=None, timeout=10):
def assert_merge_detected(project, mr_id,
named_branch=None,
timeout=10,
check_source_branch_removal=True):
"""Checks that merge has been detected in given MR and a bit more
:param named_branch: if not passed, the source GitLab branch is assumed to
......@@ -169,12 +172,13 @@ def assert_merge_detected(project, mr_id, named_branch=None, timeout=10):
source_branch = mr['source_branch']
if named_branch is None:
# and the Git branch for the topic has been rightfully removed
# but first, let's read it from the MR, and check that it's still
# meaningful (e.g., not replaced by an empty string or such)
# First, let's read the source branch it from the MR, and check that it's
# still meaningful (e.g., not replaced by an empty string or such)
assert source_branch.startswith('topic/')
project.wait_assert_api_branches(
lambda branches: source_branch not in branches)
# now check GitLab branch for the topic has been rightfully removed
if check_source_branch_removal:
project.wait_assert_api_branches(
lambda branches: source_branch not in branches)
else:
assert source_branch == 'branch/' + named_branch
......@@ -383,7 +387,14 @@ def test_mergerequest_stacked_amend_publish_first(test_project, tmpdir):
repo.hg('push', '-r', '.', '--publish')
# and merge has been detected
assert_merge_detected(test_project, mr_id)
# in the case of native Mercurial, the topic is still visible in the
# branchmap because it has orphan descendent. We could add the same kind
# of filtering in HGitaly than multiple heads detection and py_heptapod's mirror
# perform, but that is slow for a read operation that happens all the time
# (listing branches). Better to say in the short term that we don't care.
assert_merge_detected(
test_project, mr_id,
check_source_branch_removal=not test_project.hg_native)
expected = "Même une antilope !"
commit_links = test_project.webdriver_get_merge_request_commits(mr_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