Skip to content

Commit

Permalink
vcs: don't assume that the base rev has a single child (#640)
Browse files Browse the repository at this point in the history
In case of branching or history rewrite, `{base_rev}~-1` is ambiguous
and causes an error.
  • Loading branch information
jcristau authored Jan 30, 2025
1 parent 7e01bbb commit 67b54dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/taskgraph/util/vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def get_changed_files(
return self.run("status", "--no-status", f"-{df}").splitlines()
else:
template = self._files_template(diff_filter)
revision_argument = rev if base_rev is None else f"{base_rev}~-1::{rev}"
revision_argument = rev if base_rev is None else f"{rev} % {base_rev}"
return self.run("log", "-r", revision_argument, "-T", template).splitlines()

def get_outgoing_files(self, diff_filter="ADM", upstream=None):
Expand Down

0 comments on commit 67b54dc

Please sign in to comment.