hashed-storage-0.3.9: Hashed file storage support code.

Storage.Hashed.Darcs

Description

A few darcs-specific utility functions. These are used for reading and writing darcs and darcs-compatible hashed trees.

Synopsis

Documentation

darcsDecodeWhite :: String -> FilePathSource

decode_white interprets the Darcs-specific "encoded" filenames produced by darcsEncodeWhite

 darcsDecodeWhite "hello\32\there" == "hello there"
 darcsDecodeWhite "hello\92\there" == "hello\there"
 darcsDecodeWhite "hello\there"    == error "malformed filename"

darcsEncodeWhite :: FilePath -> StringSource

encode_white translates whitespace in filenames to a darcs-specific format (backslash followed by numerical representation according to ord). Note that backslashes are also escaped since they are used in the encoding.

 darcsEncodeWhite "hello there" == "hello\32\there"
 darcsEncodeWhite "hello\there" == "hello\92\there"

darcsTreeHash :: Tree -> HashSource

Compute a darcs-compatible hash value for a tree-like structure.