[darcs-devel] darcs patch: Add "darcs inventory"

Ian Lynagh igloo at earth.li
Sat May 7 12:12:38 PDT 2005


On Sat, May 07, 2005 at 06:39:21PM +0200, Florian Weimer wrote:
> 
> +manifest_cmd :: [DarcsFlag] -> [String] -> IO ()
> +manifest_cmd opts _ | Verbose `elem` opts = do
> +    files_and_dirs <- list_registered_files
> +    mapM_ putStrLn files_and_dirs
> +
> +manifest_cmd _ _ = do
> +    files <- list_slurpy_files `liftM` slurp_pending "."
> +    mapM_ putStrLn files

I'm not sure --verbose is the right way to distinguish between these.
Perhaps new flags --files/--no-files/--directories/--no-directories or
something (we should make it easy to cope with symlinks in the future)?
Default to listing everything is probably simplest.

Also, I think that by default it should only list files that are added
in the current repo state, not those just added in pending. A
--after-pending flag would then give you what you want.

A --null/-0 to separate filenames by NULs rather than newlines would
probably also be sensible for safe scripting purposes. We might also
want to escape odd characters in filenames for when it's being read by
humans.

Better flag names welcomed  :-)
(--null/-0 matches xargs though, so I think those are good)


Thanks
Ian





More information about the darcs-devel mailing list