Hi,
I'm going to apply this, thanks!
Ignore thisrepo source.
-----------------------
> hunk ./src/Darcs/Repository/HashedRepo.hs 307
> - let repoCache = extractCache $ modifyCache repo dropGlobalCaches
> + let repoCache = extractCache $ modifyCache repo dropNonRepos
> appendBinFile (outr++"/"++darcsdir++"/prefs/sources") (show $ repo2cache inr `unionCaches` repoCache )
> where
> hunk ./src/Darcs/Repository/HashedRepo.hs 310
> - dropGlobalCaches (Ca cache) = Ca $ filter notGlobalCache cache
> - notGlobalCache xs = case xs of
> - Cache DarcsCache.Directory _ _ -> False
> - _ -> True
> + dropNonRepos (Ca cache) = Ca $ filter notRepo cache
> + notRepo xs = case xs of
> + Cache DarcsCache.Directory _ _ -> False
> + Cache _ DarcsCache.Writable _ -> False
> + _ -> True
I tend to like boolean checks to be expressed as affirmatives rather
than negatives. This is to avoid stupid Erics getting confused
when they do a mental not. Basically, instead of having to think about
what notFoo = False, better to ask about Foo = True
Also, is this overly aggressive? You pointed out that this only adds
one new case to notGlobalCache
> writeAndReadPatch :: RepoPatch p => Cache -> Compression -> PatchInfoAnd p C(x y)
> -> IO (PatchInfoAnd p C(x y))
> hunk ./src/Darcs/Repository/Prefs.hs 416
> where
> parsehs = mapMaybe readln . noncomments
> readln l | "repo:" `isPrefixOf` l = Just (Cache Repo NotWritable (drop 5 l))
> - | "thisrepo:" `isPrefixOf` l = Just (Cache Repo Writable (drop 9 l))
> | nocache = Nothing
> | "cache:" `isPrefixOf` l = Just (Cache Directory Writable (drop 6 l))
> | "readonly:" `isPrefixOf` l = Just (Cache Directory NotWritable (drop 9 l))
>
What happens if the entry exists?
Will Darcs barf because of parse failure?
AH! You told me live that the missing context line is | otherwise ->
Nothing
--
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, try +44 (0)1273 64 2905 or
xmpp:kowey@jabber.fr (Jabber or Google Talk only)
|