moduleStorage.Hashed(-- * Obtaining Trees.---- | Please note that Trees obtained this way will contain Stub-- items. These need to be executed (they are IO actions) in order to be-- accessed. Use 'expand' to do this. However, many operations are-- perfectly fine to be used on a stubbed Tree (and it is often more-- efficient to do everything that can be done before expanding a Tree).readPlainTree,readDarcsHashed-- * Blob access.,readBlob-- * Writing trees.,writePlainTree,writeDarcsHashed-- * Unsafe functions for the curious explorer.---- | These are more useful for playing within ghci than for real, serious-- programs. They generally trade safety for conciseness. Please use-- responsibly. Don't kill innocent kittens.,floatPath,printPath)whereimportStorage.Hashed.AnchoredPathimportqualifiedData.ByteString.Char8asBSimportqualifiedData.ByteString.Lazy.Char8asBLimportStorage.Hashed.Tree(Tree,TreeItem(..),listImmediate,find,readBlob)-- For re-exports.importStorage.Hashed.Darcs(readDarcsHashed,writeDarcsHashed)importStorage.Hashed.Plain(readPlainTree,writePlainTree)-------------------------- For explorers---- | Take a relative FilePath within a Tree and print the contents of the-- object there. Useful for exploration, less so for serious programming.printPath::TreeIO->FilePath->IO()printPathtp=print'$findt(floatPathp)whereprint'Nothing=putStrLn$"ERROR: No object at "++pprint'(Just(Fileb))=doputStrLn$"== Contents of file "++p++":"BL.unpack`fmap`readBlobb>>=putStrprint'(Just(SubTreet'))=doputStrLn$"== Listing Tree "++p++" (immediates only):"putStr$unlines$mapBS.unpack$listNamest'print'(Just(Stub__))=putStrLn$"== (not listing stub at "++p++")"listNamest'=[n|(Namen,_)<-listImmediatet']