openmicroscopy/bioformats — pull request #646 by melissalinkert (2013-08-20 23:57:43+00:00)
Title: Save current revision number in memo file

The memo file is then invalidated if the saved revision number does not
match the current revision number. This required bumping the internal
memo file version number from 1 to 2.

To test, pick any file and generate the memo file without this PR:

```
Memoizer memo = new Memoizer(Memoizer.DEFAULT_MINIMUM_ELAPSED, new File("."));
memo.setId(filename);
memo.close();
```

Record the hash of the memo file (```.*.bfmemo``` in the same directory as the data file).

Then rebuild this PR and reinitialize the file (turning on ```TRACE```-level logging may be helpful):

```
DebugTools.enableLogging("TRACE");
Memoizer memo = new Memoizer(Memoizer.DEFAULT_MINIMUM_ELAPSED, new File("."));
memo.setId(filename);
memo.close();
```

The ```TRACE``` output should show that the versions mismatched, and that a new memo file was written. The hash of the memo file should now be different from the original hash.

Now make a trivial commit on top of this PR's changes, rebuild, and re-read the same file as above. The ```TRACE``` output should show that the Git revision mismatched causing the memo file to be overwritten again. The hash of the memo file should be different from both previous hashes.