diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-12-30 15:06:30 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-12-30 15:25:49 +0200 |
commit | 6bc74795a009a35a0c1a27426b619b9f20a2db8e (patch) | |
tree | 682655b00b49a3ad477cfee0b4271344e30b3170 /subplot/client.py | |
parent | 776b2c134c3096b8a7cf1742cbcda13f0527e415 (diff) | |
download | obnam2-6bc74795a009a35a0c1a27426b619b9f20a2db8e.tar.gz |
feat: allow restoring latest generation
Diffstat (limited to 'subplot/client.py')
-rw-r--r-- | subplot/client.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/subplot/client.py b/subplot/client.py index 1dcbe8c..0a09d31 100644 --- a/subplot/client.py +++ b/subplot/client.py @@ -24,9 +24,17 @@ def configure_client(ctx, filename=None): def run_obnam_restore(ctx, filename=None, genid=None, todir=None): + genid = ctx["vars"][genid] + run_obnam_restore_with_genref(ctx, filename=filename, genref=genid, todir=todir) + + +def run_obnam_restore_latest(ctx, filename=None, todir=None): + run_obnam_restore_with_genref(ctx, filename=filename, genref="latest", todir=todir) + + +def run_obnam_restore_with_genref(ctx, filename=None, genref=None, todir=None): runcmd_run = globals()["runcmd_run"] - genid = ctx["vars"][genid] runcmd_run( ctx, [ @@ -36,7 +44,7 @@ def run_obnam_restore(ctx, filename=None, genid=None, todir=None): "--config", filename, "restore", - genid, + genref, todir, ], ) |