Commit bc72938b authored by Laurent Peuch's avatar Laurent Peuch
Browse files

fix(regenerate-gitlab-ci): hg add .gitlab-ci.yml if it's generated for the first time

parent 2ce6258785b6
Pipeline #77521 failed with stage
in 27 seconds
......@@ -21,7 +21,7 @@ class RebaseAllMyMRs(NoMRCommand):
logger.info(f"see if I can rebase topic '{topic}'")
repo.run_command(
"hg rebase -d 'max(branch('default') and public())' "
f"-s 'min(topic('{topic}'))' --dry-run"
f"-s 'min(topic({topic}))' --dry-run"
)
except subprocess.CalledProcessError as e:
if e.returncode == 255:
......@@ -35,7 +35,7 @@ class RebaseAllMyMRs(NoMRCommand):
logger.warning(f"rebasing topic '{topic}'...")
repo.run_command(
f"hg rebase -d 'max(branch('default') and public())' -s 'min(topic('{topic}'))'"
f"hg rebase -d 'max(branch('default') and public())' -s 'min(topic({topic}))'"
)
if apply:
repo.run_command(f"hg push -r {topic}")
......
......@@ -107,8 +107,10 @@ class RegenerateGitlabCI(Command):
uses_gitlab_ci_extended = ".gitlab-ci-extended.yml" in loaded_gitlab_ci.get(
"include", []
)
hg_add_gitlab_ci = False
else:
uses_gitlab_ci_extended = False
hg_add_gitlab_ci = True
new_gitlab_ci = jinja2_env.from_string(GITLAB_CI_TEMPLATE).render(
files_to_include=files_to_include,
......@@ -116,6 +118,9 @@ class RegenerateGitlabCI(Command):
)
repo.write_file(".gitlab-ci.yml", new_gitlab_ci)
if hg_add_gitlab_ci:
repo.run_command("hg add .gitlab-ci.yml")
if "MANIFEST.in" in root_files and ".gitlab-ci.yml" not in repo.read_file(
"MANIFEST.in"
):
......
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