[darcs-devel] Darcs behaviour during apply

Eric Y. Kow eric.kow at gmail.com
Sat Jul 21 10:18:02 PDT 2007


Hi,

> I've read some of the source code, but I have one question for the
> more experienced hackers: during the apply of a patch, darcs load the
> whole file in memory and then writes it back, or it uses smart
> "offset" tricks to read and write only specific parts of the file?

I haven't had a very deep look, so this is my best guess: the former.
I say this because hunk modifications end up calling

 Darcs.Patch.Apply.applyFL, which calls

 Darcs.IO.WriteableDirectory.modifyFilePS, which by default, is
   implemented by reading the file in as a PackedString, doing
   something to it and writing it back out.

I don't notice any other implementation overriding this default
behaviour (grep -r mModifyFilePS src), so I conclude that it must always
work that way.

Hope that helps,

-- 
Eric Kow                     http://www.loria.fr/~kow
PGP Key ID: 08AC04F9         Merci de corriger mon français.
-------------- 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/20070721/ae94e9da/attachment.pgp


More information about the darcs-devel mailing list