[darcs-devel] unstable doesn't get consistently with 1.0.3

David Roundy droundy at darcs.net
Fri Aug 12 05:24:52 PDT 2005


On Thu, Aug 11, 2005 at 05:49:35PM +0100, Ian Lynagh wrote:
> On Thu, Aug 11, 2005 at 12:29:21PM -0400, David Roundy wrote:
> > 
> > Argh.  That's an annoying bug.  I've got a fix (which I'll send in soon)
> > that fixes the problems that show up in the cabal repository, but I think
> > there may still be problems with patches that delete the end of a file and
> > then replace with a new end (in separate hunks).
> > 
> > A different fix (and perhaps both simpler and more correct) might be to
> > coalesce before applying, which would eliminate overlapping or touching
> > hunks.
> 
> That won't help converting to the new hunk format, though.
> 
> In fact, one way forward would be to add the new hunk format internally,
> write the new apply function for it (trivial) and translate the old hunks
> to the new format when we apply. I'm not sure if this will be easier or
> harder to do for 1.0.4, though.

I've always assumed that the new format would use the same format
internally as the old... I really don't want to have two different internal
formats.  When we talked about the new patch format, I had actually
pictured parsing it into the old internal format (although I now realize
that that would be a bit silly--best to also store the "pre-unlinesed"
version.

The new format will still have the issue, which is that *between* lines we
need to include newlines, but *after* the last line we don't want a
newline.  So when applying, we need to behave differently, depending on
whether our patch is modifying the end of the file.

I'd prefer a more minimal change for 1.0.4.  After that, a rewrite with a
better internal patch format would sound like a good idea.  I guess we'd
want to store perhaps both the number of lines and the number of
characters, and perhaps optionally the block of text? It could be expensive
to compute the block of text itself when parsing an old-style patch... :(
Which is part of the reason for the new-style patch format, but most users
are going to have to live with the existing patch format for quite some
time.
-- 
David Roundy
http://www.darcs.net




More information about the darcs-devel mailing list