Skip to content

Commit

Permalink
Makes end attribute optional for revision ranges in patch info (#843)
Browse files Browse the repository at this point in the history
  • Loading branch information
LuAbelt authored Oct 6, 2023
1 parent d8d84bb commit 4601bce
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions varats-core/varats/provider/patch/patch_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,17 @@ def parse_revisions(
])

if "revision_range" in rev_dict:
if isinstance(rev_dict["revision_range"], list):
for rev_range in rev_dict["revision_range"]:
res.update(
get_all_revisions_between(
rev_range["start"], rev_range["end"],
ShortCommitHash, project_git_path
)
)
else:
rev_ranges = rev_dict["revision_range"]
if not isinstance(rev_ranges, list):
rev_ranges = [rev_ranges]
for rev_range in rev_ranges:
if "end" in rev_range:
end_rev = rev_range["end"]
else:
end_rev = ""
res.update(
get_all_revisions_between(
rev_dict["revision_range"]["start"],
rev_dict["revision_range"]["end"], ShortCommitHash,
rev_range["start"], end_rev, ShortCommitHash,
project_git_path
)
)
Expand Down

0 comments on commit 4601bce

Please sign in to comment.