[darcs-devel] darcs patch: refactor Repository to allow truly atomi... (and 11 more)

David Roundy droundy at darcs.net
Sun Jul 16 06:09:01 PDT 2006


Hi all,

This is some refactoring preparatory to implementing hashed inventories,
preparatory to implementing the new conflicts stuff.  Right now I'm just
trying to move the repo-changing logic into calls to Repository functions
(which are format-agnostic), and in the process make calls like optimize
--reorder and unpull more atomic.  They can't be atomic with the current
format, but we can at least set up an infrastructure where atomic updates
are natural.

I did this stuff while travelling yesterday, and now I'm at my sister's
where there's a new baby and lots of work to be done, so I'll be pretty out
of touch for a while.  I'll try to read the lists when I can, but won't
promise anything.

There are a couple of FIXMEs below for things that were not quite necesary
but would be nice to improve.  If anyone wants to join in on this
refactoring, I'll have more time for reviewing refactoring code than for
writing it myself, at least until Wednesday.  And review of my could would
also be very much appreciated.  I'd like to be able to handle pristine
better than I do, but suspect that just adding a

appendPatch :: Handle -> Patch -> IO ()

would be enough to make the pristine handling adequately efficient.

Basically the idea is to introduce some "tentative" functions to write
modifications to disk without activating them until
"finalizeRepositoryChanges" is called.  But with the current format we
can't tentatively remove out-of-order functions... but that's not a
decrease in atomicity.

More thoughts on semantics are welcome, but I think we're close enough (and
I realize we've got enough rewriting and refactoring to do that I'll be
focussing primarily on reworking the infrastructure and rewriting the
repository primitives with which the high level commands are written.

Baby is waking up...

David

Sat Jul 15 21:12:45 EDT 2006  David Roundy <droundy at darcs.net>
  * refactor Repository to allow truly atomic updates.

Sat Jul 15 21:18:53 EDT 2006  David Roundy <droundy at darcs.net>
  * refactor tag.

Sat Jul 15 21:51:50 EDT 2006  David Roundy <droundy at darcs.net>
  * refactor Unrecord, adding tentativelyRemovePatches.

Sat Jul 15 22:02:47 EDT 2006  David Roundy <droundy at darcs.net>
  * add TODO to refactor unrevert handling.

Sat Jul 15 22:10:03 EDT 2006  David Roundy <droundy at darcs.net>
  * refactor amend-record.

Sat Jul 15 23:16:05 EDT 2006  David Roundy <droundy at darcs.net>
  * partial refactoring of Get.

Sat Jul 15 23:29:34 EDT 2006  David Roundy <droundy at darcs.net>
  * partially refactor Optimize.

Sat Jul 15 23:31:09 EDT 2006  David Roundy <droundy at darcs.net>
  * I've now eliminated need to export DarcsRepo.write_patch.

Sat Jul 15 23:34:50 EDT 2006  David Roundy <droundy at darcs.net>
  * don't use DarcsRepo in list_authors.

Sat Jul 15 23:43:19 EDT 2006  David Roundy <droundy at darcs.net>
  * partial refactoring in annotate.

Sat Jul 15 23:43:39 EDT 2006  David Roundy <droundy at darcs.net>
  * add TODO for refactoring get_markedup_file.

Sat Jul 15 23:48:37 EDT 2006  David Roundy <droundy at darcs.net>
  * refactor Population.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-darcs-patch
Size: 27577 bytes
Desc: A darcs patch for your repository!
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20060716/fefff1e9/attachment.bin


More information about the darcs-devel mailing list