summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests/forget-removes-nothing-by-default.script29
-rw-r--r--yarns/0040-generations.yarn19
-rw-r--r--yarns/9000-implements.yarn6
3 files changed, 25 insertions, 29 deletions
diff --git a/tests/forget-removes-nothing-by-default.script b/tests/forget-removes-nothing-by-default.script
deleted file mode 100755
index 6278df15..00000000
--- a/tests/forget-removes-nothing-by-default.script
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-# Copyright 2011 Lars Wirzenius
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-set -e
-
-echo aaa > "$DATADIR/data/aaa"
-echo ccc > "$DATADIR/data/ccc"
-
-$SRCDIR/tests/backup
-$SRCDIR/tests/backup
-
-$SRCDIR/tests/obnam genids > "$DATADIR/genids-1"
-$SRCDIR/tests/obnam forget
-$SRCDIR/tests/obnam genids > "$DATADIR/genids-2"
-diff -u "$DATADIR/genids-1" "$DATADIR/genids-2"
-
diff --git a/yarns/0040-generations.yarn b/yarns/0040-generations.yarn
index 7da4f1fb..f3de0536 100644
--- a/yarns/0040-generations.yarn
+++ b/yarns/0040-generations.yarn
@@ -100,6 +100,25 @@ We'll assume the diff works, we'll just check whether it's empty.
AND user U diffs generations 1 and 2 in repository R into D
THEN file D is not empty
+`obnam forget` does nothing by default
+----------------------
+
+`obnam forget` is the command to remove backup generations from the
+repository. It can be used to remove specific generations, or to
+remove generations according to a schedule. If neither is specified,
+it should do nothing.
+
+ SCENARIO forget does nothing by default
+ GIVEN 1K of new data in directory L
+ AND a manifest of L in M
+
+ WHEN user U backs up directory L to repository R
+ AND user U runs obnam forget without generations or keep policy on repository R
+ THEN user U sees 1 generation in repository R
+
+ WHEN user U restores their latest generation in repository R into X
+ THEN L, restored to X, matches manifest M
+
Forgetting a specific generation (`obnam forget`)
--------------------------------
diff --git a/yarns/9000-implements.yarn b/yarns/9000-implements.yarn
index 11d0fab3..b39976c2 100644
--- a/yarns/9000-implements.yarn
+++ b/yarns/9000-implements.yarn
@@ -258,6 +258,12 @@ We may need to restore only a single file.
Removing (forgetting) generations
---------------------------------
+Run `obnam forget` with neither a policy of what to keep, nor a
+specific list of generations.
+
+ IMPLEMENTS WHEN user (\S+) runs obnam forget without generations or keep policy on repository (\S+)
+ run_obnam "$MATCH_1" forget -r "$DATADIR/$MATCH_2"
+
Remove the oldest generation.
IMPLEMENTS WHEN user (\S+) forgets the oldest generation in repository (\S+)