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

Eric Y. Kow eric.kow at gmail.com
Sat Mar 31 11:09:29 PST 2007


> Fri Mar 30 08:43:25 PDT 2007  David Roundy <droundy at darcs.net>
>   * fix checkpoint handling with hashed inventories.

Accepting, with some possible things to double-check

Generalities
------------
There's two things going on in this code,

1) The checkpoint-related functions are migrated to their own module,
   presumably so that they can be shared by other kinds of darcs
   repository, not just the vanilla plain inventory darcs ones.

2) The code is generalised to works with --with-repo or other such
   flags.

I gather that the fix in question is #2.  The former really just makes
things tidier and twiddles a few imports in the commands.  All the code
in Checkpoint is basically moved over from DarcsRepo, with s/liftM/fmap/
(*) and the repo generalisation.  There is a get_checkpoint_sloppily
function, but that's a DarcsRepo-specific version of Checkpoint.
get_check_internal, which we probably don't want to export.

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?

> +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?

(*) 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.

-- 
Eric Kow                     http://www.loria.fr/~kow
PGP Key ID: 08AC04F9         Merci de corriger mon français.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20070331/d06a0e4f/attachment.pgp


More information about the darcs-devel mailing list