From aa7ffe837fe5e0739c32a633d2d02544ca5d72ba Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 10 Oct 2022 21:18:57 +0200 Subject: make fietsupdater status warn about unknown update --- fietsboek/updater/cli.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fietsboek/updater/cli.py b/fietsboek/updater/cli.py index 9a64a24..a6ea6c1 100644 --- a/fietsboek/updater/cli.py +++ b/fietsboek/updater/cli.py @@ -166,8 +166,17 @@ def status(config): heads = updater.heads() click.secho("Current versions:", fg="yellow") if current: + has_unknown = False for i in current: - click.echo(i) + if updater.exists(i): + click.echo(i) + else: + click.echo(f"{i} [unknown]") + has_unknown = True + if has_unknown: + click.echo("[*] Your version contains revisions that are unknown to me") + click.echo("[*] This can happen if you apply an update and then downgrade the code") + click.echo("[*] Make sure to keep your code and data in sync!") else: click.secho("No current version", fg="red") click.secho("Available updates:", fg="yellow") -- cgit v1.2.3