Skip to content

Commit

Permalink
-k|--checkout: Improve information view about this PR, show diff
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardkaindl committed Oct 13, 2024
1 parent 729455c commit 006c144
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions build_pr_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,19 +743,18 @@ def checkout_pr_by_search_query(args: argparse.Namespace) -> ExitCode:
return exitcode or 1

# View the information about the PR:
exitcode, output = subprocess.getstatusoutput(f"gh pr view {number}")
if exitcode != 0:
print("Failed to view the PR:", output)
return exitcode
print(f'Found PR for "{args.checkout}":')
print(output)
spawn("gh", ["pr", "view", str(number)])

# Checkout the PR branch:
exitcode, output = subprocess.getstatusoutput(f"gh pr checkout {number}")
if exitcode != 0:
print("Failed to checkout the PR branch:", output)
return exitcode
print("Checked out the PR branch.")

# Show the changes in the PR:
spawn("gh", ["pr", "diff", str(number)])

# Clean the python and misc cache files:
exitcode, output = subprocess.getstatusoutput("bin/spack clean --misc-cache --python-cache")
if exitcode != 0:
Expand Down

0 comments on commit 006c144

Please sign in to comment.