úÎ Ľîžčk      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij k>Requires NULL-terminated bytestring -> unsafe! Use with care. lmnopqrstk mnopqrstk experimentaluu v,Pointer to a filesystem, possibly with start/end offsets. Supposed to be 1 fed to (uncurry mmapFileByteString) or similar. w2Bad and ugly. Only works well with single-chunk BL's. FRead in a FileSegment into a Lazy ByteString. Implemented using mmap. xRun an IO action with path) as a working directory. Does neccessary  bracketing. vyz{|}wx~€vyz{|}wx~€ (Append an element to the end of a path. Take a root9 directory and an anchored path and produce a full path.     "Abstraction of a filesystem tree. K Please note that the Tree returned by the respective read operations will F have TreeStub items in it. To obtain a Tree without such stubs, call  unfold on it, eg.:  * tree <- readDarcsPristine "." >>= unfold $When a Tree is unfolded, it becomes final. All stubs are forced and the J Tree can be traversed purely. Access to actual file contents stays in IO  though. 9A Tree may have a Hash associated with it. A pair of Tree's is identical K whenever their hashes are (the reverse need not hold, since not all Trees  come equipped with a hash). 3Get hash of a Tree. This is guaranteed to uniquely ; identify the Tree (including any blob content), as far as < cryptographic hashes are concerned. Sha256 is recommended. 4When implementing a Tree that has complex unfolding  semantics, the finish$ IO action lets you do arbitrary IO = transform on the Tree after it is unfolded but before it is 7 given to the user by unfold. (Used to implement Index  updates, eg.) *Get a hash of a TreeItem. May be Nothing. &ACompute a darcs-compatible hash value for a tree-like structure. ' Look up a & item (an immediate subtree or blob). (Find a  by its path. Gives   if the path is invalid. )Find a  by its path. Gives  ! if the path is invalid, or does  not point to a Blob. *Find a  by its path. Gives  ! if the path is invalid, or does  not point to a Tree. +List all contents of a . ,HUnfold a stubbed Tree into a one with no stubs in it. You might want to . filter the tree before unfolding to save IO. -JUnfold a path in a (stubbed) Tree, such that the leaf node of the path is ' reachable without crossing any stubs. .Given two Trees, a guide and a tree , produces a new Tree that is a  identical to tree4, but only has those items that are present in both  tree and guide. The guide! Tree may not contain any stubs. /FGiven a predicate of the form AnchoredPath -> TreeItem -> Bool, and a K Tree, produce a Tree that only has items for which the predicate returned M True. The tree might contain stubs. When unfolded, these will be subject to  filtering as well. 0IRead a Blob into a Lazy ByteString. Might be backed by an mmap, use with  care. 1CFor every pair of corresponding blobs from the two supplied trees, L evaluate the supplied function and accumulate the results in a list. Hint: E to get IO actions through, just use sequence on the resulting list.  NB. This won't unfold any stubs. 2GFor each file in each of the two supplied trees, evaluate the supplied M function (supplying the corresponding file from the other tree, or Nothing) M and accumulate the results in a list. Hint: to get IO actions through, just 2 use sequence on the resulting list. NB. This won't unfold any stubs. 4KCautiously extracts differing subtrees from a pair of Trees. It will never N do any unneccessary unfolding. Tree hashes are used to cut the comparison as N high up the Tree branches as possible. The result is a pair of trees that do N not share any identical subtrees. They are derived from the first and second I parameters respectively and they are always fully unfolded. It might be & advantageous to feed the result into 2. ' !"#$%&'()*+,-./012345+#$&%!",-+'()* 12340/.5% !"#$%&'()*+,-./0123456LA recursive-ish index structure (as opposed to flat-ish structure, which is $ used by git... It turns out that it'(s hard to efficiently read a flat index L with our internal data structures -- we need to turn the flat index into a J recursive Tree object, which is rather expensive...). As a bonus, we can F also efficiently implement subtree queries this way (cf. readIndex). CIUpdate an existing item with new hash and optionally mtime (give Nothing # when updating directory entries). FSee  readIndex<. This version also gives a map from paths to items, so the L extra per-item data can be used (hash and mtime) directly. The map is in a L form of IORef, since the data is not available until the tree is unfolded. GGRead an index and build up a Tree object from it, referring to current L working directory. Any parts of the index that are out of date are updated N in-place. The result is always an up-to-date index. Also, the Tree is stubby N and only the pieces of the index that are unfolded will be actually updated! + To implement a subtree query, you can use  Tree.filter and then unfold the L result. Otherwise just unfold the whole tree to avoid unexpected problems. HJWill add and remove files in index to make it match the Tree object given K (it is an error for the Tree to contain a file or directory that does not ( exist in a plain form under FilePath). 6789:;<=>?@ABCDEFGH=6789:;<>?@ABCDEFGH6789:;<789:;<=>?@ABCDEFGH ISort of a sub-weave. JGA weave -- two files woven together, with common and differing regions  marked up. Cf. K. SFProduce unified diff (in a string form, ie. formatted) from a pair of  bytestrings. TJWeave two bytestrings. Intermediate data structure for the actual unidiff ( implementation. No skips are produced. UBreak up a Weave into hunks. VFReformat a Hunk into a format suitable for unified diff. Replaces are  turned into add/3remove pairs, all removals in a hunk go before all J adds. Hunks of Common lines are left intact. Produces input suitable for  reduceContext. W Break up a J into unified hunks, leaving n lines of context around L every hunk. Consecutive Common lines not used as context are replaced with  Skips. XFormat a Weave for printing. YPrint a hunked7 weave in form of an unified diff. Hunk boundaries are  marked up as Skip lines. Cf.  reduceContext. IJKLMNOPQRSTUVWXYRQKPONMLJISTUVWXYIJKPONMLLMNOPQRSTUVWXY ‚KA TreeIO monad. A sort of like IO but it keeps a TreeState around as well, K which is a sort of virtual filesystem. Depending on how you obtained your M TreeIO, the actions in your virtual filesystem get somehow reflected in the  actual real filesystem. For  virtualTreeIO, nothing happens in real  filesystem, however with  plainTreeIO', the plain tree will be updated every  now and then, and with  hashedTreeIO$ a darcs-style hashed tree will get  updated. ]IRun a TreeIO action without dumping anything to disk. Useful for running G tree mutations just for the purpose of getting the resulting Tree and  throwing it away. ƒJCreate a hashed file from a filepath and content. In case the file exists L it is kept untouched and is assumed to have the right content. XXX Corrupt L files should be probably renamed out of the way automatically or something - (probably when they are being read though). ^ Run a TreeIO action in a hashed setting. The initial tree is assumed  to be fully available from the  directory", and any changes will be written J out to same. Please note that actual filesystem files are never removed. 4XXX This somehow manages to leak memory, somewhere. _GRun a TreeIO action in a plain tree setting. Writes out changes to the L plain tree every now and then (after the action is finished, the last tree G state is always flushed to disk). XXX Modify the tree with filesystem N reading and put it back into st (ie. replace the in-memory Blobs with normal " ones, so the memory can be GCd). `>Grab content of a file in the current Tree at the given path. „HInternal. Mark a given path as changed, so the next sync will flush the  modified object to disk. aHChange content of a file at a given path. The change will be eventually 7 flushed to disk, but might be buffered for some time. …;If buffers are becoming large, sync, otherwise do nothing. Z[\]^_`abcd ^_]`abdc\[Z[\ Z[\[\]^_`abcdeITake a relative FilePath and turn it into an AnchoredPath. The operation F is unsafe and if you break it, you keep both pieces. More useful for ; exploratory purposes (ghci) than for serious programming. fETake a relative FilePath within a Tree and print the contents of the H object there. Useful for exploration, less so for serious programming. g?Read in a plain directory hierarchy from a filesystem. NB. The 0 C function on Blobs with such a Tree is susceptible to file content  changes. Since we use mmap in 0, this will break referential K transparency and produce unexpected results. Please always make sure that E all parallel access to the underlying filesystem tree never mutates B files. Unlink + recreate is fine though (in other words, the sync/write  operations below are safe). †CRead and parse a darcs-style hashed directory listing from a given dir  and with a given hash. hERead in a darcs-style hashed tree. This is mainly useful for reading  "pristine.hashed":. You need to provide the root hash you are interested in  (found in _darcs/hashed_inventory). iERead in a darcs pristine tree. Handles the plain and hashed pristine H cases. Does not (and will not) handle the no-pristine case, since that ! requires replaying patches. Cf. h and g that  are used to do the actual  construction. jJWrite out *full* tree to a plain directory structure. If you instead want ' to make incremental updates, refer to Monad.plainTreeIO. 0efghijghi0jefefghij ‡ˆ‰Š    !"#$%&''()*+,-./0123456789:;<=>??@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrs tuvwxyz{|}~  ~ €  ‚ ƒ „ … † ‡ ˆ ‰Š‹ŒŽ   ‘’hashed-storage-0.3Storage.Hashed.TreeStorage.HashedStorage.Hashed.AnchoredPathStorage.Hashed.IndexStorage.Hashed.DiffStorage.Hashed.Monad Bundled.PosixBundled.SHA256Storage.Hashed.Utilsbase Data.MaybeStorage.Hashed.TestHash readSegment AnchoredPathNamenameToFilePathnameFromFilePathisPrefix appendPathcatPathsparentparents anchorPathfloatBSanchorBSTreeitems listImmediatetreeHashfinishItemTypeTreeTypeBlobTypeTreeItemStubSubTreeFileBlobitemHashitemType emptyTree emptyBlobmakeTreemakeTreeWithHashdarcsFormatDir darcsTreeHashlookupfindfindFilefindTreelistunfold unfoldPathrestrictfilterreadzipCommonFileszipFileszipTrees diffTrees modifyTreeItemiPathiNameiHashiSizeiAux hashToStringitemSize itemSizeI itemIsDir createItempeekItemupdateiHash' mmapIndex readIndex' readIndexupdateIndexFromHunkWeave WeaveLineSkipReplaceAddRemoveCommonLineunidiff unifiedDiffweavehunks unifyHunk reduceContextdeweave printUnified TreeStatecwdtree virtualTreeIO hashedTreeIO plainTreeIOreadFile writeFilecreateDirectoryunlinkrename floatPath printPath readPlainTreereadDarcsHashedreadDarcsPristinewritePlainTreegetFileStatusBSSystem.Posix.Types EpochTime FileStatus getFdStatus isDirectorymodificationTimefileSize fileExistsgetSymbolicLinkStatus getFileStatussha256 FileSegmentwithCurrentDirectorymakeHash hashSetSizedarcsFormatSizedarcsFormatHashdarcsDecodeWhite? makeAbsolutepokeBSNothingTreeIOfs_createHashedFile markChanged maybeSyncreadDarcsHashedDirtests_darcs_basictests_tree_index tests_generic