FreeBSD/contrib/subversion/subversion/libsvn_wc/wc_db_pristine.c
/* If the pristine text referenced by SHA1_CHECKSUM in WCROOT has a
 * reference count of zero, delete it (both the database row and the disk
 * file).
 *
 * Implements 'notes/wc-ng/pristine-store' section A-3(b). */
If the pristine text referenced by SHA1_CHECKSUM in WCROOT has a
reference count of zero, delete it (both the database row and the disk
file).


If the pristine text referenced by SHA1_CHECKSUM in WCROOT has a reference count of zero delete it ( both the database row and the disk file ) .
static svn_error_t *
pristine_remove_if_unreferenced(svn_wc__db_wcroot_t *wcroot,
                                const svn_checksum_t *sha1_checksum,
                                apr_pool_t *scratch_pool)
{
  const char *pristine_abspath;
  SVN_ERR(get_pristine_fname(&pristine_abspath, wcroot->abspath,
                             sha1_checksum, scratch_pool, scratch_pool));
  SVN_SQLITE__WITH_IMMEDIATE_TXN(
    pristine_remove_if_unreferenced_txn(
      wcroot->sdb, wcroot, sha1_checksum, pristine_abspath, scratch_pool),
    wcroot->sdb);
  return SVN_NO_ERROR;
}
static svn_error_t * pristine_remove_if_unreferenced ( svn_wc__db_wcroot_t * wcroot , const svn_checksum_t * sha1_checksum , apr_pool_t * scratch_pool ) { const char * pristine_abspath ; SVN_ERR ( get_pristine_fname ( & pristine_abspath , wcroot -> abspath , sha1_checksum , scratch_pool , scratch_pool ) ) ; SVN_SQLITE__WITH_IMMEDIATE_TXN ( pristine_remove_if_unreferenced_txn ( wcroot -> sdb , wcroot , sha1_checksum , pristine_abspath , scratch_pool ) , wcroot -> sdb ) ; return SVN_NO_ERROR ; }
If the pristine text referenced by SHA1_CHECKSUM in WCROOT has a
 reference count of zero, delete it (both the database row and the disk
 file).
If the pristine text referenced by SHA1_CHECKSUM in WCROOT has a reference count of zero delete it ( both the database row and the disk file ) .
/* Ensure the SQL txn has at least a 'RESERVED' lock before we start looking
   * at the disk, to ensure no concurrent pristine install/delete txn. */