ContentsIndex
Darcs.Diff
Synopsis
unsafeDiffAtPaths :: (Bool, Bool, Bool) -> (FilePath -> FileType) -> Slurpy -> Slurpy -> [FilePath] -> FL Prim
diff_at_path :: (Bool, Bool, Bool) -> (FilePath -> FileType) -> Slurpy -> Slurpy -> FilePath -> Maybe (FL Prim)
make_nonoverlapping_path_set :: [FilePath] -> [FilePath]
unsafeDiff :: [DarcsFlag] -> (FilePath -> FileType) -> Slurpy -> Slurpy -> FL Prim
mk_filepath :: [FilePath] -> FilePath
gendiff :: (Bool, Bool, Bool) -> (FilePath -> FileType) -> [FilePath] -> Slurpy -> Slurpy -> FL Prim -> FL Prim
recur_diff :: (Bool, Bool, Bool) -> (FilePath -> FileType) -> [FilePath] -> [Slurpy] -> [Slurpy] -> FL Prim -> FL Prim
diff_regular_files :: Bool -> (FilePath -> FileType) -> FilePath -> Slurpy -> Slurpy -> FL Prim -> FL Prim
diff_added :: Bool -> (FilePath -> FileType) -> [FilePath] -> Slurpy -> FL Prim -> FL Prim
get_text :: FileContents -> [ByteString]
empt :: FileContents
diff_files :: FilePath -> FileContents -> FileContents -> FL Prim -> FL Prim
diff_from_empty :: (Prim -> Prim) -> FilePath -> FileContents -> FL Prim -> FL Prim
has_bin :: FileContents -> Bool
bin_patch :: FilePath -> ByteString -> ByteString -> FL Prim -> FL Prim
diff_removed :: (FilePath -> FileType) -> [FilePath] -> Slurpy -> FL Prim -> FL Prim
sync :: String -> Slurpy -> Slurpy -> IO ()
cmp :: FilePath -> FilePath -> IO Bool
cmpdir :: FilePath -> FilePath -> IO Bool
andIO :: [IO Bool] -> IO Bool
cmpfile :: FilePath -> FilePath -> IO Bool
Documentation
unsafeDiffAtPaths :: (Bool, Bool, Bool) -> (FilePath -> FileType) -> Slurpy -> Slurpy -> [FilePath] -> FL Prim

The unsafeDiffAtPaths function calls diff_at_path for a set of files and and directories, and returns all changes to those files. It recurses into given directories when searching for changes.

Comparing paths and not slurpies is useful when the user requests a diff for a file that is created or removed in the working copy: then there is no slurpy for the file in the current or working slurpy respectively.

The given paths must always be fixed repository paths starting with a .. It is safe to pass overlapping paths.

The booleans in the first argument tell whether to ignore mtimes, whether we must look for additions and if we're diffing for a summary only.

It returns an FL of patches, that contains all the changes that have been made at all those paths.

diff_at_path :: (Bool, Bool, Bool) -> (FilePath -> FileType) -> Slurpy -> Slurpy -> FilePath -> Maybe (FL Prim)
make_nonoverlapping_path_set :: [FilePath] -> [FilePath]
unsafeDiff :: [DarcsFlag] -> (FilePath -> FileType) -> Slurpy -> Slurpy -> FL Prim
mk_filepath :: [FilePath] -> FilePath
gendiff :: (Bool, Bool, Bool) -> (FilePath -> FileType) -> [FilePath] -> Slurpy -> Slurpy -> FL Prim -> FL Prim
recur_diff :: (Bool, Bool, Bool) -> (FilePath -> FileType) -> [FilePath] -> [Slurpy] -> [Slurpy] -> FL Prim -> FL Prim
diff_regular_files :: Bool -> (FilePath -> FileType) -> FilePath -> Slurpy -> Slurpy -> FL Prim -> FL Prim
diff_added :: Bool -> (FilePath -> FileType) -> [FilePath] -> Slurpy -> FL Prim -> FL Prim
get_text :: FileContents -> [ByteString]
empt :: FileContents
diff_files :: FilePath -> FileContents -> FileContents -> FL Prim -> FL Prim
diff_from_empty :: (Prim -> Prim) -> FilePath -> FileContents -> FL Prim -> FL Prim
has_bin :: FileContents -> Bool

We take a B.ByteString which represents a file's contents, and we check to see whether it is a binary file or a textual file. We define a textual file as any file which does not contain two magic characters, '\0' (the NULL character on Unix) and '^Z' (Control-Z, a DOS convention).

Note that to improve performance, we won't examine *all* of the string, because that falls down on large files, but just the first 4096 characters.

bin_patch :: FilePath -> ByteString -> ByteString -> FL Prim -> FL Prim
diff_removed :: (FilePath -> FileType) -> [FilePath] -> Slurpy -> FL Prim -> FL Prim
sync :: String -> Slurpy -> Slurpy -> IO ()
cmp :: FilePath -> FilePath -> IO Bool
cmpdir :: FilePath -> FilePath -> IO Bool
andIO :: [IO Bool] -> IO Bool
cmpfile :: FilePath -> FilePath -> IO Bool
Produced by Haddock version 2.4.2