From ab9bd1346af936085ad8d986ad17f87df374f272 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 29 Mar 2014 12:30:50 +0000 Subject: Fix "obnam diff latest" Add test case. Fix code. Reported-by: Junyx --- yarns/0040-generations.yarn | 6 ++++++ yarns/9000-implements.yarn | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'yarns') 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 ------------------------- -- cgit v1.2.1