Branko =?iso-8859-2?Q?=C8ibej?= <email@example.com> writes:
> Jim Blandy wrote:
> > This is vague future stuff, though. In particular, notice that the
> > deltas in the filesystem point from younger to older, but the diffs
> > the clients will usually want go from older to younger; is it really
> > feasible to reverse the deltas just using index arithmetic? I don't
> > know.
> I think not. The delta is not a bijective source->target mapping,
> it's injective. So in general you can't invert it. I think you can
> only do that when copy ops in the delta cover all of the source,
> i.e., when the change is only pure insertions.
I think you're confusing the true assertion:
"Given a target string and a delta, you can't reconstruct the source string"
with the false assertion:
"Given a source string and a delta, you can't construct the inverse delta"
The latter is the situation I'm in. And I know I can do it: at the
very worst, I could apply the delta to the source string to produce
the target string and then run the delta algorithm again with the
arguments reversed. However, I'm hoping that with fancy arithmetic I
could do better.
Received on Sat Oct 21 14:36:08 2006