From adf5b8df5bd4986f59715b97e23ca9d4d9aa0747 Mon Sep 17 00:00:00 2001 From: Vignesh Raman Date: Tue, 25 Feb 2025 18:58:52 +0530 Subject: [PATCH] checkout: print treeid and checkout nodeid by default Print treeid and checkout nodeid by default to help scripts calling kci-dev parse the checkout response. This allows retrieving the build nodeid for a given checkout nodeid. Signed-off-by: Vignesh Raman --- kcidev/subcommands/checkout.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kcidev/subcommands/checkout.py b/kcidev/subcommands/checkout.py index 5566b4a..39e10cb 100644 --- a/kcidev/subcommands/checkout.py +++ b/kcidev/subcommands/checkout.py @@ -147,6 +147,16 @@ def checkout( if resp and "message" in resp: click.secho(resp["message"], fg="green") + if resp and "node" in resp: + node = resp.get("node") + treeid = node.get("treeid") + checkout_nodeid = node.get("id") + + if treeid: + click.secho(f"treeid: {treeid}", fg="green") + if checkout_nodeid: + click.secho(f"checkout_nodeid: {checkout_nodeid}", fg="green") + if watch and isinstance(resp, dict): node = resp.get("node") treeid = node.get("treeid")