Skip to content

Commit

Permalink
feat(forget)!: Make keep-* Options and add keep-none (#238)
Browse files Browse the repository at this point in the history
Breaking Change: The keep-options for `forget` are now real `Options`.

This also adds an additional check which enforces that at least one
`keep-*` option is set and adds a new `keep-none` option which can be
use as single valid `keep-` option (if you want to remove all
snapshots).

closes rustic-rs/rustic#1191
  • Loading branch information
aawsome authored Aug 18, 2024
1 parent cfdff01 commit 0f08abd
Show file tree
Hide file tree
Showing 47 changed files with 7,854 additions and 136 deletions.
542 changes: 407 additions & 135 deletions crates/core/src/commands/forget.rs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
---
source: crates/core/src/commands/forget.rs
expression: result
---
ForgetResult([
("2016-01-18T12:02:03Z", true, [
"daily",
]),
("2016-01-12T21:08:03Z", true, [
"daily",
]),
("2016-01-12T21:02:03Z", false, []),
("2016-01-09T21:02:03Z", true, [
"daily",
]),
("2016-01-08T20:02:03Z", true, [
"daily",
]),
("2016-01-07T10:02:03Z", true, [
"daily",
]),
("2016-01-06T08:02:03Z", true, [
"daily",
]),
("2016-01-05T09:02:03Z", true, [
"daily",
]),
("2016-01-04T16:23:03Z", true, [
"daily",
]),
("2016-01-04T12:30:03Z", false, []),
("2016-01-04T12:28:03Z", false, []),
("2016-01-04T12:24:03Z", false, []),
("2016-01-04T12:23:03Z", false, []),
("2016-01-04T11:23:03Z", false, []),
("2016-01-04T10:23:03Z", false, []),
("2016-01-03T07:02:03Z", true, [
"daily",
]),
("2016-01-01T07:08:03Z", true, [
"daily",
]),
("2016-01-01T01:03:03Z", false, []),
("2016-01-01T01:02:03Z", false, []),
("2015-11-22T10:20:30Z", false, []),
("2015-11-21T10:20:30Z", false, []),
("2015-11-20T10:20:30Z", false, []),
("2015-11-18T10:20:30Z", false, []),
("2015-11-15T10:20:30Z", false, []),
("2015-11-13T10:20:30Z", false, []),
("2015-11-12T10:20:30Z", false, []),
("2015-11-10T10:20:30Z", false, []),
("2015-11-08T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-20T10:20:30Z", false, []),
("2015-10-11T10:20:30Z", false, []),
("2015-10-10T10:20:30Z", false, []),
("2015-10-09T10:20:30Z", false, []),
("2015-10-08T10:20:30Z", false, []),
("2015-10-06T10:20:30Z", false, []),
("2015-10-05T10:20:30Z", false, []),
("2015-10-02T10:20:30Z", false, []),
("2015-10-01T10:20:30Z", false, []),
("2015-09-22T10:20:30Z", false, []),
("2015-09-20T10:20:30Z", false, []),
("2015-09-11T10:20:30Z", false, []),
("2015-09-10T10:20:30Z", false, []),
("2015-09-09T10:20:30Z", false, []),
("2015-09-08T10:20:30Z", false, []),
("2015-09-06T10:20:30Z", false, []),
("2015-09-05T10:20:30Z", false, []),
("2015-09-02T10:20:30Z", false, []),
("2015-09-01T10:20:30Z", false, []),
("2015-08-22T10:20:30Z", false, []),
("2015-08-21T10:20:30Z", false, []),
("2015-08-20T10:20:30Z", false, []),
("2015-08-18T10:20:30Z", false, []),
("2015-08-15T10:20:30Z", false, []),
("2015-08-13T10:20:30Z", false, []),
("2015-08-12T10:20:30Z", false, []),
("2015-08-10T10:20:30Z", false, []),
("2015-08-08T10:20:30Z", false, []),
("2014-11-22T10:20:30Z", false, []),
("2014-11-21T10:20:30Z", false, []),
("2014-11-20T10:20:30Z", false, []),
("2014-11-18T10:20:30Z", false, []),
("2014-11-15T10:20:30Z", false, []),
("2014-11-13T10:20:30Z", false, []),
("2014-11-12T10:20:30Z", false, []),
("2014-11-10T10:20:30Z", false, []),
("2014-11-08T10:20:30Z", false, []),
("2014-10-22T10:20:30Z", false, []),
("2014-10-20T10:20:30Z", false, []),
("2014-10-11T10:20:30Z", false, []),
("2014-10-10T10:20:30Z", false, []),
("2014-10-09T10:20:30Z", false, []),
("2014-10-08T10:20:30Z", false, []),
("2014-10-06T10:20:30Z", false, []),
("2014-10-05T10:20:30Z", false, []),
("2014-10-02T10:20:30Z", false, []),
("2014-10-01T10:20:30Z", false, []),
("2014-09-22T10:20:30Z", false, []),
("2014-09-20T10:20:30Z", false, []),
("2014-09-11T10:20:30Z", false, []),
("2014-09-10T10:20:30Z", false, []),
("2014-09-09T10:20:30Z", false, []),
("2014-09-08T10:20:30Z", false, []),
("2014-09-06T10:20:30Z", false, []),
("2014-09-05T10:20:30Z", false, []),
("2014-09-02T10:20:30Z", false, []),
("2014-09-01T10:29:37Z", true, [
"snapshot",
]),
("2014-09-01T10:28:37Z", false, [
"snapshot",
]),
("2014-09-01T10:25:37Z", true, [
"snapshot",
]),
("2014-09-01T10:20:30Z", false, []),
("2014-08-22T10:20:30Z", false, []),
("2014-08-21T10:20:30Z", false, []),
("2014-08-20T10:20:30Z", false, []),
("2014-08-18T10:20:30Z", false, []),
("2014-08-15T10:20:30Z", false, []),
("2014-08-13T10:20:30Z", false, []),
("2014-08-12T10:20:30Z", false, []),
("2014-08-10T10:20:30Z", false, []),
("2014-08-08T10:20:30Z", false, []),
])
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
source: crates/core/src/commands/forget.rs
expression: result
---
ForgetResult([
("2016-01-18T12:02:03Z", true, [
"daily",
"weekly",
"monthly",
]),
("2016-01-12T21:08:03Z", true, [
"daily",
"weekly",
]),
("2016-01-12T21:02:03Z", false, []),
("2016-01-09T21:02:03Z", false, []),
("2016-01-08T20:02:03Z", false, []),
("2016-01-07T10:02:03Z", false, []),
("2016-01-06T08:02:03Z", false, []),
("2016-01-05T09:02:03Z", false, []),
("2016-01-04T16:23:03Z", false, []),
("2016-01-04T12:30:03Z", false, []),
("2016-01-04T12:28:03Z", false, []),
("2016-01-04T12:24:03Z", false, []),
("2016-01-04T12:23:03Z", false, []),
("2016-01-04T11:23:03Z", false, []),
("2016-01-04T10:23:03Z", false, []),
("2016-01-03T07:02:03Z", false, []),
("2016-01-01T07:08:03Z", false, []),
("2016-01-01T01:03:03Z", false, []),
("2016-01-01T01:02:03Z", false, []),
("2015-11-22T10:20:30Z", true, [
"monthly",
]),
("2015-11-21T10:20:30Z", false, []),
("2015-11-20T10:20:30Z", false, []),
("2015-11-18T10:20:30Z", false, []),
("2015-11-15T10:20:30Z", false, []),
("2015-11-13T10:20:30Z", false, []),
("2015-11-12T10:20:30Z", false, []),
("2015-11-10T10:20:30Z", false, []),
("2015-11-08T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", true, [
"monthly",
]),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-20T10:20:30Z", false, []),
("2015-10-11T10:20:30Z", false, []),
("2015-10-10T10:20:30Z", false, []),
("2015-10-09T10:20:30Z", false, []),
("2015-10-08T10:20:30Z", false, []),
("2015-10-06T10:20:30Z", false, []),
("2015-10-05T10:20:30Z", false, []),
("2015-10-02T10:20:30Z", false, []),
("2015-10-01T10:20:30Z", false, []),
("2015-09-22T10:20:30Z", true, [
"monthly",
]),
("2015-09-20T10:20:30Z", false, []),
("2015-09-11T10:20:30Z", false, []),
("2015-09-10T10:20:30Z", false, []),
("2015-09-09T10:20:30Z", false, []),
("2015-09-08T10:20:30Z", false, []),
("2015-09-06T10:20:30Z", false, []),
("2015-09-05T10:20:30Z", false, []),
("2015-09-02T10:20:30Z", false, []),
("2015-09-01T10:20:30Z", false, []),
("2015-08-22T10:20:30Z", true, [
"monthly",
]),
("2015-08-21T10:20:30Z", false, []),
("2015-08-20T10:20:30Z", false, []),
("2015-08-18T10:20:30Z", false, []),
("2015-08-15T10:20:30Z", false, []),
("2015-08-13T10:20:30Z", false, []),
("2015-08-12T10:20:30Z", false, []),
("2015-08-10T10:20:30Z", false, []),
("2015-08-08T10:20:30Z", false, []),
("2014-11-22T10:20:30Z", true, [
"monthly",
]),
("2014-11-21T10:20:30Z", false, []),
("2014-11-20T10:20:30Z", false, []),
("2014-11-18T10:20:30Z", false, []),
("2014-11-15T10:20:30Z", false, []),
("2014-11-13T10:20:30Z", false, []),
("2014-11-12T10:20:30Z", false, []),
("2014-11-10T10:20:30Z", false, []),
("2014-11-08T10:20:30Z", false, []),
("2014-10-22T10:20:30Z", false, []),
("2014-10-20T10:20:30Z", false, []),
("2014-10-11T10:20:30Z", false, []),
("2014-10-10T10:20:30Z", false, []),
("2014-10-09T10:20:30Z", false, []),
("2014-10-08T10:20:30Z", false, []),
("2014-10-06T10:20:30Z", false, []),
("2014-10-05T10:20:30Z", false, []),
("2014-10-02T10:20:30Z", false, []),
("2014-10-01T10:20:30Z", false, []),
("2014-09-22T10:20:30Z", false, []),
("2014-09-20T10:20:30Z", false, []),
("2014-09-11T10:20:30Z", false, []),
("2014-09-10T10:20:30Z", false, []),
("2014-09-09T10:20:30Z", false, []),
("2014-09-08T10:20:30Z", false, []),
("2014-09-06T10:20:30Z", false, []),
("2014-09-05T10:20:30Z", false, []),
("2014-09-02T10:20:30Z", false, []),
("2014-09-01T10:29:37Z", true, [
"snapshot",
]),
("2014-09-01T10:28:37Z", false, [
"snapshot",
]),
("2014-09-01T10:25:37Z", true, [
"snapshot",
]),
("2014-09-01T10:20:30Z", false, []),
("2014-08-22T10:20:30Z", false, []),
("2014-08-21T10:20:30Z", false, []),
("2014-08-20T10:20:30Z", false, []),
("2014-08-18T10:20:30Z", false, []),
("2014-08-15T10:20:30Z", false, []),
("2014-08-13T10:20:30Z", false, []),
("2014-08-12T10:20:30Z", false, []),
("2014-08-10T10:20:30Z", false, []),
("2014-08-08T10:20:30Z", false, []),
])
Loading

0 comments on commit 0f08abd

Please sign in to comment.