[darcs-devel] darcs patch: add test that unrecord of tag removes ch... (and 1 more)

Eric Y. Kow eric.kow at gmail.com
Wed Oct 18 23:25:19 PDT 2006


Hi,

On Sat, Oct 07, 2006 at 20:32:22 +0200, ptp at lysator.liu.se wrote:
> Here is a fix for the somewhat serious bug in issue281
> (unrecording a tag with a checkpoint).

Ok, after reading this bug report and patch, I think I understand the
issue (thanks to Kartik for nice, clear reporting and easy
reproducability)

> Sat Oct  7 19:48:37 CEST 2006  Tommy Pettersson <ptp at lysator.liu.se>
>   * remove unrecorded tags from the checkpoint inventory (issue281)
>   The commands Check, Get and Repair all can make use of the checkpoint
>   inventory. Unrecord, Unpull and Obliterate forgot to remove deleted patches
>   from that inventory.

The part that affects the commands themselves is quite clearly ok (but
it makes me glad that David has refactored all that inventory stuff!).
As for remove_from_checkpoint_inventory, the fix seems correct to me:
 - only pay attention to tags
 - read the checkpoint inventory
 - write it back, filtering out the ones that are in the list of tags to remove

Some questions/comments:
 1. How come remove_from_checkpoint_inventory takes a repodir and
    write_checkpoint_patch does not?
 2. What if repodir is "" -- can that ever happen? perhaps (///) is a
    better choice than (++)
 3. (minor and silly) Maybe mapMaybe is better than catMaybes . map
 4. I notice that we're creating the checkpoint directory if it's
    missing.  Is this so that read_checkpoints doesn't blow up?
    Shouldn't this be read_checkpoints' job, then?

Cheers,


-------------- 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/20061019/32071739/attachment.pgp


More information about the darcs-devel mailing list