summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2014-03-29 12:30:50 +0000
committerLars Wirzenius <liw@liw.fi>2014-03-29 12:30:50 +0000
commitab9bd1346af936085ad8d986ad17f87df374f272 (patch)
tree10e31cf7ba8b2b91a37df1390db98a3d5cc4a60a /yarns
parent3a92a2b1d13d54b431b1ff1de77329aa919f043c (diff)
downloadobnam-ab9bd1346af936085ad8d986ad17f87df374f272.tar.gz
Fix "obnam diff latest"
Add test case. Fix code. Reported-by: Junyx
Diffstat (limited to 'yarns')
-rw-r--r--yarns/0040-generations.yarn6
-rw-r--r--yarns/9000-implements.yarn6
2 files changed, 12 insertions, 0 deletions
diff --git a/yarns/0040-generations.yarn b/yarns/0040-generations.yarn
index 871adcb7..8339d9a0 100644
--- a/yarns/0040-generations.yarn
+++ b/yarns/0040-generations.yarn
@@ -88,6 +88,12 @@ generations are identical:
AND user U backs up directory L to repository R
AND user U diffs generations 1 and 2 in repository R into D
THEN file D is empty
+
+`obnam diff` can be used with just one generation, and that compares
+it with the generation preceding the given one.
+
+ WHEN user U diffs latest generation in repository R into D
+ THEN file D is empty
If we make a change to the data, that should be reflected in the diff.
We'll assume the diff works, we'll just check whether it's empty.
diff --git a/yarns/9000-implements.yarn b/yarns/9000-implements.yarn
index f2dab5f4..300112bb 100644
--- a/yarns/9000-implements.yarn
+++ b/yarns/9000-implements.yarn
@@ -400,6 +400,12 @@ unpredictable.
id2=$(run_obnam "$MATCH_1" -r "$DATADIR/$MATCH_4" genids | awk -v "n=$MATCH_3" 'NR == n')
run_obnam "$MATCH_1" diff -r "$DATADIR/$MATCH_4" "$id1" "$id2" > "$DATADIR/$MATCH_5"
+Show the diff between the latest generation and the generation before
+that.
+
+ IMPLEMENTS WHEN user (\S+) diffs latest generation in repository (\S+) into (\S+)
+ run_obnam "$MATCH_1" diff -r "$DATADIR/$MATCH_2" latest > "$DATADIR/$MATCH_3"
+
Encryption key management
-------------------------