Skip to content

Commit

Permalink
Added parent spawning results helper method
Browse files Browse the repository at this point in the history
Signed-off-by: JonahSussman <sussmanjonah@gmail.com>
  • Loading branch information
JonahSussman committed Sep 25, 2024
1 parent e98e9bb commit d90d550
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions playpen/repo_level_awareness/git_vfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ def msg(self) -> str:

return stdout.strip()

@functools.cached_property
def parent_spawning_results(self) -> list[Any]:
"""
Returns a list of spawning results from the parent snapshots, including
itself, in order from oldest to newest.
"""

if self.parent is None:
return [self.spawning_result]

return self.parent.parent_spawning_results + [self.spawning_result]

def git(self, args: list[str], popen_kwargs: dict[str, Any] | None = None):
"""
Execute a git command with the given arguments. Returns a tuple of the
Expand Down

0 comments on commit d90d550

Please sign in to comment.