Commit f1d4278e authored by Fabien Amarger's avatar Fabien Amarger
Browse files

fix(lint): fix black and flake8 errors

parent 393738261f4c
Pipeline #73994 passed with stage
in 1 minute and 1 second
......@@ -12,7 +12,7 @@ class RebaseAllMyMRs(NoMRCommand):
def modify_code(self, cube, repo, root_files, branches, other_args, apply=False):
all_my_topics = []
for mr in cube.mergerequests.list(all=True, as_list=False, state="opened"):
if mr.author["username"] == "cube-doctor" and mr.state == 'opened':
if mr.author["username"] == "cube-doctor" and mr.state == "opened":
topic = mr.source_branch.split("/", 2)[-1]
logger.info(f"select topic '{topic}' for rebasing")
all_my_topics.append(topic)
......@@ -20,17 +20,24 @@ class RebaseAllMyMRs(NoMRCommand):
for topic in all_my_topics:
try:
logger.info(f"see if I can rebase topic '{topic}'")
repo.run_command(f"hg rebase -d 'max(branch('default') and public())' -s 'min(topic('{topic}'))' --dry-run")
repo.run_command(
"hg rebase -d 'max(branch('default') and public())' "
f"-s 'min(topic('{topic}'))' --dry-run"
)
except subprocess.CalledProcessError as e:
if e.returncode == 255:
logger.info(f"no rebase needed on topic '{topic}', skip")
continue
else:
logger.warning(f"merge conflict when trying to rebase topic '{topic}'! skip")
logger.warning(
f"merge conflict when trying to rebase topic '{topic}'! skip"
)
continue
logger.warning(f"rebasing topic '{topic}'...")
repo.run_command(f"hg rebase -d 'max(branch('default') and public())' -s 'min(topic('{topic}'))'")
repo.run_command(
f"hg rebase -d 'max(branch('default') and public())' -s 'min(topic('{topic}'))'"
)
if apply:
repo.run_command(f"hg push -r {topic}")
else:
......
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