Commit f1d33eb9320 by Georges Racinet

New test for slashes in named branches

branch : heptapod-0-7
parent 137af5a6c7e
Pipeline #2203 passed with stage
in 14 seconds
......@@ -40,7 +40,7 @@ def prepare_topic(repo, needing_rebase=True):
return topic_name
def prepare_named_branch(repo, needing_rebase=True):
def prepare_named_branch(repo, needing_rebase=True, branch_name=None):
"""Prepare a named branch to submit merge request.
Here's the produced graph if `needing_rebase` is True::
......@@ -52,7 +52,8 @@ def prepare_named_branch(repo, needing_rebase=True):
o 0:1fd69a3d35ba Initial sentence
branch_name = 'gnu'
if branch_name is None:
branch_name = 'gnu'
repo.path.join('kitten').write("A lion is stronger than a kitten\n")
repo.hg('commit', '-Am', "Initial sentence")
if needing_rebase:
......@@ -387,6 +388,28 @@ def test_mergerequest_cli_named_branch(public_project, tmpdir):
assert_merge_detected(public_project, mr_id, named_branch=branch)
def test_mergerequest_cli_named_branch_slash(public_project, tmpdir):
"""Test for forward slash in branch name.
More than just the MR, this tests also regular Mercurial operation,
see heptapod#133
repo = hg.LocalRepo.init(tmpdir.join('repo'),
branch = prepare_named_branch(repo, branch_name="gr/gnu")
mr_id = public_project.api_create_merge_request(
source='branch/' + branch)
repo.hg('update', 'default')
repo.hg('merge', 'gr/gnu')
repo.hg('commit', '-m', "Merged gr/gnu into default through CLI")
repo.hg('phase', '-p', '.')
print("Graph after API merge:")
assert_merge_detected(public_project, mr_id, named_branch=branch)
def test_mergerequest_child_amend_publish(test_project, tmpdir):
"""Here we produce a child, amend it, then push/publish in one shot.
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