You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alon Ziv <al...@nolaviz.org> on 2002/12/19 08:58:55 UTC

Another thought on Subversion as a changeset engine

It has occured to me that Subversion is already "almost" a changeset database, as the "deltas" it stores are equivalent to changesets---only they are reversed (i.e. they create the preceeding version from the following one, instead of the other way around).
Now, if we could just create an algorithm for reversing deltas, Subversion can become a "real" changeset database without almost any change in the existing semantics.
Is this possible? Or are deltas fundamentally irreversible? (I do recall something was said about it on the list once, but I can't remember what... And couldn't find it in the archives :-( )

    -az

Re: Another thought on Subversion as a changeset engine

Posted by Branko Čibej <br...@xbc.nu>.
Alon Ziv wrote:

> It has occured to me that Subversion is already "almost" a changeset
> database, as the "deltas" it stores are equivalent to
> changesets---only they are reversed (i.e. they create the preceeding
> version from the following one, instead of the other way around).
> Now, if we could just create an algorithm for reversing deltas,
> Subversion can become a "real" changeset database without almost any
> change in the existing semantics.
> Is this possible? Or are deltas fundamentally irreversible? (I do
> recall something was said about it on the list once, but I can't
> remember what... And couldn't find it in the archives :-( )


1) Deltas are reversible in general, provided you have both source and
target text at hand. Which we don't, obviously, because we have deltas.

2) You've totally missed the point. The storage format has nothing
whatsoever to do with whether Subversion is a changeset engine or not.
Being a changeset engine is about semantics, not about physically
storing changesets.

3) A changeset is not the same as a set of diffs.

-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Another thought on Subversion as a changeset engine

Posted by Greg Hudson <gh...@MIT.EDU>.
On Thu, 2002-12-19 at 03:58, Alon Ziv wrote:
> It has occured to me that Subversion is already "almost" a changeset
> database, as the "deltas" it stores are equivalent to
> changesets---only they are reversed (i.e. they create the preceeding
> version from the following one, instead of the other way around).

The details of storage aren't relevant; it is the access model which is
important.  Deltas are stored in this reversed style deliberately, so
that it is faster to access the most recent revisions.  (It's fast to
access any revision, due to delta combination and skip-deltas, but it's
even faster to access the more recent ones.)

When a client asks for a delta between two revisions, we don't pull
deltas out of the repository and feed them to the client; we reconstruct
both revisions and diff them.

> Is this possible? Or are deltas fundamentally irreversible? (I do
> recall something was said about it on the list once, but I can't
> remember what... And couldn't find it in the archives :-( )

You can't look at a delta and reverse it (simple proof: if the target
file is empty, the delta will contain no instructions, and thus no
information about the source file).  However, given a source file and a
delta, there may be a relatively efficient way to create a reversed
delta--that is, more efficient than simply reconstructing the target
file and then recomputing the delta backwards.  As noted above, though,
we don't currently have a need for such an operation.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org