diff --git a/treescript/src/treescript/gecko/merges.py b/treescript/src/treescript/gecko/merges.py index 035ef4b5d..0f9c53fc6 100644 --- a/treescript/src/treescript/gecko/merges.py +++ b/treescript/src/treescript/gecko/merges.py @@ -277,16 +277,19 @@ async def do_merge(config, task, repo_path, l10n_bump_action): async def _bump_l10n(config, task, repo_path, l10n_bump_action): if l10n_bump_action == "l10n_bump": - await l10n_bump(config, task, repo_path) + commits = await l10n_bump(config, task, repo_path) elif l10n_bump_action == "l10n_bump_github": - await l10n_bump_github(config, task, repo_path) + commits = await l10n_bump_github(config, task, repo_path) else: # This should be unreachable as we validate this before we get here, # but that may change in the future... raise TreeScriptError(f"Unknown l10n_bump_action: '{l10n_bump_action}'") - output = await run_hg_command(config, "log", "--patch", "--verbose", "-r", ".", repo_path=repo_path, return_output=True, expected_exit_codes=(0, 1)) - path = os.path.join(config["artifact_dir"], "public", "logs", "l10n_bump.diff") - makedirs(os.path.dirname(path)) - with open(path, "w") as fh: - fh.write(output) + if commits: + output = await run_hg_command( + config, "log", "--patch", "--verbose", "--follow", "--limit", f"{commits}", repo_path=repo_path, return_output=True, expected_exit_codes=(0, 1) + ) + path = os.path.join(config["artifact_dir"], "public", "logs", "l10n_bump.diff") + makedirs(os.path.dirname(path)) + with open(path, "w") as fh: + fh.write(output) diff --git a/treescript/tests/test_gecko_merges.py b/treescript/tests/test_gecko_merges.py index 49cc060d5..093a92cc3 100644 --- a/treescript/tests/test_gecko_merges.py +++ b/treescript/tests/test_gecko_merges.py @@ -280,6 +280,7 @@ async def mocked_run_hg_command(config, *arguments, repo_path=None, **kwargs): async def noop_l10n_bump(*arguments, **kwargs): called_args.append("l10n_bump") + return 1 orig_commit = merges.commit