[darcs-devel] darcs patch: fail on error in get_patches_beyond_tag. (and 6 more)

David Roundy droundy at darcs.net
Sat Mar 31 17:51:48 PST 2007


On Sat, Mar 31, 2007 at 09:09:29PM +0200, Eric Y. Kow wrote:
> Things to check
> ---------------
> > +get_check_internal :: [DarcsFlag] -> String -> IO (Maybe Patch)
> > +get_check_internal opts r = do
> > +  pis <- (map fst . concat) `fmap` (identifyRepository opts "." >>= read_repo)
> 
> Why "." here and not r?

I suspect this is a bug (perhaps not triggered, but a bug nonetheless), but
should really eat dinner now... so either I'll check it later, or someone
else could take a look at it.

> > +write_checkpoint :: Repository -> PatchInfo -> IO ()
> > +write_checkpoint repo pinfo = do
> [snip]
> > +    with_tag repo pinfo $ do
> > +      s <- mmap_slurp "."
> 
> Is it safe to assume "." here as well?

Hmmmm.  I suspect this is correct, because with_tag creates a temporary
directory, and it's the contents of that directory that we want to slurp.
But again, I've not got time just now, and I should look at the actual code
(or you should verify what I've guessed and write back that you did
so... or someone else could do this).

Thank you so much for reviewing this code for me! It's *so* nice to have
someone actually looking through the code to be certain that it makes
sense! Some day I'll be unstable maintainer again (I hope) and get to do
the reviewing.  It actually is fun--for me, anyhow--reviewing patches.

> (*) In case I haven't asked, why fmap?  Less to type? Increased
>     generality, i.e.  not requiring a monad specifically?
>     Some deeper reason?  Just curious.

fmap doesn't require an import statement, so it saves one line, and also
avoids the conflicts that can happen when modifying that import, import
statements being a good source of conflicts.

No real increased generality, but it does also avoid one capital letter,
which is always nice.
-- 
David Roundy
http://www.darcs.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20070331/27d321b2/attachment.pgp


More information about the darcs-devel mailing list