From 3260eed4ea6a17bab8a587c35da7d597cfff6c1e Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Wed, 20 May 2009 17:39:37 +0200 Subject: [PATCH] undo: always collect history of the file Commit b9a33d3fb1235626615b96b4b586ce7a7b8386fd added file histories based on the history of the parent directory, in order to list history fragments even when the inode changed. However it failed to collect the history for the most recent version of the file. As a result, if all versions of the parent directory happened to preceed the oldest version of the file, undo would not collect any history for the file and fail with error 0. Unconditionally include the history of the file to fix this problem. --- usr.bin/undo/undo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/undo/undo.c b/usr.bin/undo/undo.c index 3313333b9c..10f9ae9ece 100644 --- a/usr.bin/undo/undo.c +++ b/usr.bin/undo/undo.c @@ -268,6 +268,10 @@ doiterate(const char *filename, const char *outFileName, close(fd); } } + if ((fd = open(filename, O_RDONLY)) > 0) { + collect_history(fd, &error, &tse_tree); + close(fd); + } if (cmd == CMD_DUMP) { if ((ts1.tid == 0 || flags & (UNDO_FLAG_SETTID1|UNDO_FLAG_SETTID2)) && -- 2.11.4.GIT