[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Revision Reconciliation Algorithm

From: David Glasser <glasser_at_davidglasser.net>
Date: 2007-12-27 21:25:50 CET

On Dec 27, 2007 12:12 PM, Sharmarke Aden <aden.list@gmail.com> wrote:
> Hi, I'm trying to understand how Subversion determines the changes
> that have occurred between two revision and I was wondering if someone
> in here could help understand how it all works. For example, say the
> latest (head) revision in the svn repository is 210 and my working
> copy is 103. My question is how does subversion calculate all the
> adds/updates/removes my working copy needs to bring it's revision
> state to 210? What algorithm or techniques does subversion use to
> calculate deltas between two revisions and how efficient is it?

It's tough to answer this without knowing how much you're familiar
with the architecture. The filesystem is stored as a DAG. The update
algorithm essentially just takes the difference ("delta") between two
directories, by walking down the tree and comparing the contents of
each directory. If a node in the DAG (directory or file) hasn't
changed at all, it can be skipped without continuing down. The actual
algorithm can be found in libsvn_repos/reporter.c; a simpler algorithm
is in libsvn_repos/delta.c, but this isn't what we actually use (since
it doesn't deal with things like mixed-revision working copies).


David Glasser | glasser_at_davidglasser.net | http://www.davidglasser.net/
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Dec 27 21:25:59 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.