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

Re: svn:original-date

From: <cmpilato_at_collab.net>
Date: 2003-03-18 20:24:51 CET

=?UTF-8?B?QnJhbmtvIMSMaWJlag==?= <brane@xbc.nu> writes:

> Greg Stein wrote:
>
> >* is there a future scenario where revisions do not need to be time-ordered,
> > so maybe this points to a flow in the current implementation?
> >
> >
>
> <whimsical-mode>Points to a flow...hmmm...and flows to a point,
> too...<whimsical-mode>
>
> As far as I know, there is exactly one reason why our commits must be
> time-ordered: So that get_revision_by_date can do a binary search on
> revision numbers. If we added an extra date->revision index, this
> ordering wouldn't be necessary any more and we wouldn't need
> svn:original-date.
>
> I'd rather introduce this index and lift the restriction on svn:date
> than add another date property.

+1, almost. Would rather do DATE->TXN_ID (that way we can get both
committed and uncommitted transactions).

We can do so in a backwards-compatible fashion, too.
svn_fs_create_berkeley will create and populate this table.
svn_fs_open_berkeley will not. Then, we make a new public FS call,

   svn_error_t *svn_fs_dated_revision (svn_revnum_t *rev,
                                       svn_fs_t *fs,
                                       apr_time_t tm,
                                       int direction,
                                       apr_pool_t *pool);

(where direction is used to determine which way to search for a
revision when TM falls between two of them.)

This function can use cursors to find the closest transaction in the
transaction table that is of type "committed". Later, if we need
svn_fs_dated_transaction, it does the same thing, but looks for
"transaction"-typed transaction instead. The function also returns
SVN_ERR_UNSUPPORTED_FEATURE if the new table doesn't exist.

svn_repos_dated_revision() can try svn_fs_dated_revision, and then
fall back to its current brute-force method if
SVN_ERR_UNSUPPORTED_FEATURE is returned.

NOTE: If, however, we don't think we'll ever need the perfect sorting
of all transactions (including committed ones), ignore some of this
and just do DATE->REVNUM -- that'd be more efficient.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 18 20:27:33 2003

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.