[darcs-users] darcs patch: Move a couple of low-level pending bits ... (and 2 more)
dagit at codersbase.com
Wed Oct 14 06:53:09 UTC 2009
On Tue, Oct 13, 2009 at 9:29 AM, Petr Rockai <me at mornfall.net> wrote:
> this is first part of a larger change, but I thought I'd send it rather
> than later. With darcs-hs, we are maybe halfway through removing
> 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
> 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),
> (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
> do away with most of the tricky IO interleaving that darcs does, too.
> I'll work on this as time permits.
> 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
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the darcs-users