git-annex/Database
Joey Hess cf260d9a15
Fix storing of filenames of v6 unlocked files when the filename is not representable in the current locale.
This is a mostly backwards compatable change. I broke backwards
compatability in the case where a filename starts with double-quote.
That seems likely to be very rare, and v6 unlocked files are a new feature
anyway, and fsck needs to fix missing associated file mappings anyway. So,
I decided that is good enough.

The encoding used is to just show the String when it contains a problem
character. While that adds some overhead to addAssociatedFile and
removeAssociatedFile, those are not called very often. This approach has
minimal decode overhead, because most filenames won't be encoded that way,
and it only has to look for the leading double-quote to skip the expensive
read. So, getAssociatedFiles remains fast.

I did consider using ByteString instead, but getting a FilePath converted
with all chars intact, even surrigates, is difficult, and it looks like
instance PersistField ByteString uses Text, which I don't trust for problem
encoded data. It would probably be slower too, and it would make the
database less easy to inspect manually.
2016-02-14 16:37:25 -04:00
..
Keys Fix storing of filenames of v6 unlocked files when the filename is not representable in the current locale. 2016-02-14 16:37:25 -04:00
Fsck.hs remove 163 lines of code without changing anything except imports 2016-01-20 16:36:33 -04:00
Handle.hs optimise read and write for Keys database (untested) 2015-12-23 19:18:52 -04:00
Keys.hs Fix storing of filenames of v6 unlocked files when the filename is not representable in the current locale. 2016-02-14 16:37:25 -04:00
Queue.hs fix build with pre-AMP GHC 2015-12-28 12:41:47 -04:00
Types.hs Fix storing of filenames of v6 unlocked files when the filename is not representable in the current locale. 2016-02-14 16:37:25 -04:00