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

Re: Whither delta combiner

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2002-02-11 19:08:43 CET

Daniel Berlin <dan@dberlin.org> writes:
> One of the more interesting things about skiplists is that you never need
> to jump backwards, like you would in a regular binary search.
> Only forwards and down.

Yes; I used the words "back" and "backwards" because we're doing
reverse delta storage, even though the deltas are from something older
to something younger... I guess the language can go either way here,
sorry to be confusing. :-)

> You store a level number, and <level number> "pointers".
>
> However, checkpoint plaintexts was trivial by comparison.

Yah, they sure are quicker to implement. :-)

> Here's a checkpoint plaintext hack (note hack, not patch, as i'm sure this
> isn't the right place to do it, just the only place that seemed to
> intersect everything). Note the overloaded use of is_dir so that we
> don't execute the while loop for dirs. Hopefully that kind of obsfucation
> prevents anyone from thinking this is more than a hack.

Thanks, will take a look.

-K

> Index: ./deltify.c
> ===================================================================
> --- ./deltify.c
> +++ ./deltify.c Sun Feb 10 18:41:25 2002
> @@ -393,13 +393,31 @@
> {
> svn_fs_id_t *predecessor_id = svn_fs_predecessor_id (id, trail->pool);
> int is_dir = 0;
> + int dist = 0;
> dag_node_t *node;
> -
> + svn_fs_id_t *root_id = id;
> SVN_ERR (svn_fs__dag_get_node (&node, fs, id, trail));
> is_dir = svn_fs__dag_is_directory (node);
> + while (!is_dir)
> + {
> + if (svn_fs_predecessor_id (root_id, trail->pool) != NULL)
> + root_id = svn_fs_predecessor_id (root_id, trail->pool);
> + else
> + break;
> + }
> +
> + dist = svn_fs_id_distance (root_id, id);
> + if (!is_dir)
> + printf ("Distance to root is %d\n", dist);
> + if (predecessor_id != NULL && (is_dir || dist % 10 != 0))
> + {
> + SVN_ERR (deltify (predecessor_id, id, fs, is_dir ? 1 : 0,
> trail));
> + }
> + else if (!is_dir && predecessor_id != NULL && (dist % 10 == 0))
> + {
> + SVN_ERR (undeltify (id, fs, trail));
> + }
>
> - if (predecessor_id != NULL)
> - SVN_ERR (deltify (predecessor_id, id, fs, is_dir ? 1 : 0, trail));
>
> return SVN_NO_ERROR;
> }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:06 2006

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.