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

Pristine store - using it

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Fri, 05 Mar 2010 14:11:23 +0000

I've been looking at how to convert libsvn_wc to use the pristine store,
starting with Hyrum's "#if SVN_EXPERIMENTAL" code in update_editor.c.

STARTING POINT

  The "#if SVN_EXPERIMENTAL" parts duplicate the storage, storing the
new text-base into the new store as well as the old location. There is
no code to read from the new store, yet.

A NEW TEXT-BASE IS CREATED IN ...

  add_file_with_history(), apply_textdelta(), svn_wc_add_repos_file4()

COMMON FUNCTION TO CREATE A TEMP BASE ...

  svn_wc__open_writable_base()

  We should use this function (or something like it) every time we want
to write a new pristine file (wc-1 and wc-ng). Then we can do the
migration to the WC-NG pristine store inside it. Presently it's used in
only one place (apply_textdelta()). I'll change add_file_with_history()
to use it as well, if I can.

  The "need_revert_base" parameter (which determines the exact path of
the temp file) can go away, because nothing cares where this temp file
is [1]. Evidence that nothing cares: SVN_WC__REVERT_EXT occurs in only 3
other places: svn_wc__text_revert_path() - but that's not looking in the
*temporary* area; svn_wc__prop_path - but that's looking for
*properties*; upgrade.c:migrate_props(). None of these are relevant,
which means nothing can be finding the *revert base* file except by the
path that svn_wc__open_writable_base() returns.

  [1] We mustn't write the temp-revert-base file to WC-1's special
temp-normal-base path. I tried, and it caused test failures. Perhaps it
overwrites a temp-normal-base that's being used at the same time, or
perhaps something looks there and thinks it's found a temp-normal-base
and does something with it - I don't know and didn't bother to
investigate.

  I've converted svn_wc__open_writable_base() to use a generic temp dir
and unique file name, rather than a WC-1-specific path, and made all
three places use it for their WC-1 temp base file, it all still works.

  OK, that bit works. That's a bit neater. Committed in r919413.

Next I can probably move the simultaneous creation of a WC-NG text-base
into that function.

- Julian
Received on 2010-03-05 15:12:02 CET

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