commit dafde2167d6d9601f10ba33f421079f3fb236095
parent 1627a32bbb190bc880602d85be8938f929e73816
Author: Jamie Nicol <jnicol@mozilla.com>
Date: Tue, 21 Oct 2025 14:46:00 +0000
Bug 1995557 - Ensure jujutsu tracks changed files when creating try commit r=ahochheiden
If the user's configuration is not set to automatically track the
changed files then try_commit() will create an empty commit without
the modified try_task_config.json, and as a result no tasks will be
executed. This patch fixes this by manually tracking changed files
when creating the try commit.
Differential Revision: https://phabricator.services.mozilla.com/D269409
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/python/mozversioncontrol/mozversioncontrol/repo/jj.py b/python/mozversioncontrol/mozversioncontrol/repo/jj.py
@@ -437,6 +437,9 @@ class JujutsuRepository(Repository):
p = self.path / Path(path)
p.parent.mkdir(parents=True, exist_ok=True)
p.write_text(content)
+ # Manually track the file in case it is not automatically,
+ # e.g. because `snapshot.auto-track` has been configured.
+ self._run("file", "track", p)
# Update the jj commit with the changes we just made.
self._snapshot()
yield self._resolve_to_change("@")