[darcs-users] darcs patch: Export read_pending from Darcs.Repository.Internal.
me at mornfall.net
Thu Feb 12 15:43:49 UTC 2009
I have made a first attempt at integrating hashed-storage into darcs
somehow. However, after fighting with WhatsNew.lhs and various other modules, I
have given up on that idea. What I have done instead is writing darcs-wh that
uses darcslib and hashed-storage.
It now can use hashed-storage to do indexed (fast) diffing, and it can also use
darcslib to read pending, so if you have adds pending, they will eventually
show up in output of darcs-wh. Moreover, darcs-wh uses the darcs file diffing
algorithm (sort of, anyway, but it's an ugly mess) and darcs printing routines.
It currently doesn't produce addfile patches nor sorts the output, but neither
should be hard to fix. Moreover, it doesn't do look-for-adds or summary,
although summary should be quite trivial anyway, while look-for-adds is less so
(it has more code in WhatsNew.lhs than the other case). Still, it shouldn't be
too hard as it should boil down to:
- use readPlainTree to read in the working directory
- list working \\ list unrecorded -> list of possible additions
- filter the result through the boring regexps
- use the result to produce and apply a "temporary pending" of sorts
- proceed as usual
What it doesn't do (and can't) is automatic maintenance of the index wrt
pending. This means that new files won't show up until you rebuild index with
darcs-wh -b. Well, bummer. However, there is a way to remedy that, and I'm more
and more inclined to take that route instead of keeping pending indexed, that
is we can overlay addfiles onto the indexed tree at runtime. Oh, that's smart!
One more problem solved.
Anyway, this would limit the required index maintenance to applying/unapplying
patches (ie. it becomes strictly parallel to pristine maintenance). I suppose
this is overally quite acceptable.
Ah, right, back to the attached patch. To make darcs-wh possible, I need to
read the pending file, and this seems to be the easiest way around. I don't
think there are any adverse effects this could have...
Thu Feb 12 16:16:01 CET 2009 Petr Rockai <me at mornfall.net>
* Export read_pending from Darcs.Repository.Internal.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 104833 bytes
Desc: A darcs patch for your repository!
More information about the darcs-users