Commits (5)
......@@ -71,6 +71,11 @@ def test_import_small(public_project, tmpdir):
"draft non-topic changeset should not become public "
"in imported repo")
assert hg_log_set(clone) == hg_log_set(src_repo)
resp = project.owner_api_get()
assert resp.status_code == 200
assert resp.json()['default_branch'] == 'branch/default'
if project is not None:
......@@ -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:
......@@ -394,6 +395,27 @@ 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 = create_mr(public_project, named_branch='gr/gnu')
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.
......@@ -48,6 +48,11 @@ def test_owner_push_pull(test_project, tmpdir):
ssh_clone.hg('pull', '--ssh', ssh_cmd, ssh_url)
# Testing that trailing slash is ignored (heptapod#151)
ssh_clone_slash = LocalRepo.init(tmpdir.join('ssh_clone_slash'))
ssh_clone_slash.hg('pull', '--ssh', ssh_cmd, ssh_url + '/')
def test_permissions(test_project, tmpdir):
repo = make_repo(tmpdir, 'repo1')