[darcs-users] darcs patch: Move a couple of low-level pending bits ... (and 2 more)

Jason Dagit dagit at codersbase.com
Wed Oct 14 06:53:09 UTC 2009


Hi Petr,

On Tue, Oct 13, 2009 at 9:29 AM, Petr Rockai <me at mornfall.net> wrote:

> Hi,
>
> this is first part of a larger change, but I thought I'd send it rather
> sooner
> than later. With darcs-hs, we are maybe halfway through removing
> SlurpDirectory
> from darcs code altogether (maybe a little more).
>

Yay!  I like the sooner rather than later approach.


>
> These patches make another few steps toward that goal. There's still a
> bunch of
> code that needs to be converted:
>
> - Record and Rollback use slurps to do a check on filenames passed, similar
> to
>  WhatsNew; this code should ideally be refactored to use a common function
>  (seems to be a result of copy&paste programming)
> - read_checkpoints, which is only used in remove_from_checkpoint_inventory
>  which *may* be redundant now
> - the MatchMonad which I don't quite understand, but it doesn't seem to do
>  anything too involved wrt slurpies
> - Repository.Internal: make_new_pending (should be easy),
> setScriptsExecutable
>  (should be easy, too)
> - darcs optimize --relink
> - darcs move
> - darcs add
> - darcs diff to copy unrecorded state
>
> Out of these, darcs move and darcs add are going to be the most
> tricky. However, when this is done, another big block of code can be
> obliterated: slurp_* in Repository.* and the SlurpDirectory modules. This
> would
> do away with most of the tricky IO interleaving that darcs does, too.
>
> I'll work on this as time permits.
>
> Yours,
>   Petr.
>
> Tue Oct 13 12:28:53 CEST 2009  Petr Rockai <me at mornfall.net>
>  * Move a couple of low-level pending bits to (new) Repository.LowLevel.
>

What is the distinction between LowLevel and Internal?  I don't understand
how this change improves things.  Internal is already meant to be private
and whatnot.  Now I'm confused by the distinction between LowLevel and
Internal.  Could you clarify the rationale?


>
> Tue Oct 13 12:45:23 CEST 2009  Petr Rockai <me at mornfall.net>
>  * Port list_* in Darcs.Arguments to Tree (away from Slurpy).
>

Merely a suggestion, but if you're going to reimplement the list_*
functions, then you should camelCase them :)  I'm not really sure if the new
implementations do the same thing; although they seem reasonable enough.



>
> Tue Oct 13 14:02:42 CEST 2009  Petr Rockai <me at mornfall.net>
>  * Convert contextual patch printing from Slurpy to TreeIO.
>
>  This obliterates another major source of SlurpDirectory usage in darcs. I
> agree
>  the code has become a little more hairy, although this should be
> addressable by
>  a slight refactor of virtualTreeIO and friends in hashed-storage (there's
>  currently no reasonable way to create a sub-monad in TreeIO).
>

The only hairiness that I saw was some functions that used to be pure are
now IO.  I don't think that's so bad though.

Would it be possible to see before and after benchmark numbers for this
patch?  Of course the hard part is probably finding test cases that exercise
the code which is changing here.  Maybe someone besides Petr could volunteer
to do this?  I think it's mainly the construction of patch bundles and the
pretty printer that need to be benchmarked.

Thanks,
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20091013/de363cbd/attachment.htm>


More information about the darcs-users mailing list