[darcs-users] [patch279] Drop global cache entries from _darcs/prefs/sources

Petr Rockai me at mornfall.net
Tue Jun 15 09:28:25 UTC 2010


Adolfo Builes <bugs at darcs.net> writes:

> hunk ./src/Darcs/Repository/HashedRepo.hs 297
> -    dropLocalCache globalCache (Ca cache) = Ca $ filter (/= globalCache) cache
> +    dropGlobalCaches (Ca cache) = Ca $ filter notGlobalCache cache
> +    notGlobalCache xs = case xs of
> +                         Cache DarcsCache.Directory _ _ -> False
> +                         _                              -> True
You could more concisely write

repoCachesOnly (Ca cache) = Ca [ c | c@(Cache Repo _ _) <- cache ]

also in your version, the case is redundant, you can write
notGlobalCache (Cache DarcsCache.Directory _ _) = False
notGlobalCache _                                = True

On the other hand, these are stylistic tweaks, and if you like to do
them, you can post a separate patch. I am pushing this one...

Yours,
   Petr.



More information about the darcs-users mailing list