subversion/libsvn_wc/wc_db_pristine.c
/* If the pristine text referenced by SHA1_CHECKSUM in WCROOT/SDB, whose path
 * within the pristine store is PRISTINE_ABSPATH, has a reference count of
 * zero, delete it (both the database row and the disk file).
 *
 * This function expects to be executed inside a SQLite txn that has already
 * acquired a 'RESERVED' lock.
 */
If the pristine text referenced by SHA1_CHECKSUM in WCROOT/SDB, whose path
within the pristine store is PRISTINE_ABSPATH, has a reference count of
zero, delete it (both the database row and the disk file).

This function expects to be executed inside a SQLite txn that has already
acquired a 'RESERVED' lock.
If the pristine text referenced by SHA1_CHECKSUM in WCROOT / SDB whose path within the pristine store is PRISTINE_ABSPATH has a reference count of zero delete it ( both the database row and the disk file ) . This function expects to be executed inside a SQLite txn that has already acquired a ' RESERVED ' lock .
static svn_error_t *
pristine_remove_if_unreferenced_txn(svn_sqlite__db_t *sdb,
                                    svn_wc__db_wcroot_t *wcroot,
                                    const svn_checksum_t *sha1_checksum,
                                    const char *pristine_abspath,
                                    apr_pool_t *scratch_pool)
{
  svn_sqlite__stmt_t *stmt;
  int affected_rows;
  SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
                                    STMT_DELETE_PRISTINE_IF_UNREFERENCED));
  SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, sha1_checksum, scratch_pool));
  SVN_ERR(svn_sqlite__update(&affected_rows, stmt));
  if (affected_rows > 0)
    {
#ifdef SVN_DEBUG
      svn_boolean_t ignore_enoent = FALSE;
#else
      svn_boolean_t ignore_enoent = TRUE;
#endif
      SVN_ERR(remove_file(pristine_abspath, wcroot, ignore_enoent,
                          scratch_pool));
    }
  return SVN_NO_ERROR;
}
static svn_error_t * pristine_remove_if_unreferenced_txn ( svn_sqlite__db_t * sdb , svn_wc__db_wcroot_t * wcroot , const svn_checksum_t * sha1_checksum , const char * pristine_abspath , apr_pool_t * scratch_pool ) { svn_sqlite__stmt_t * stmt ; int affected_rows ; SVN_ERR ( svn_sqlite__get_statement ( & stmt , sdb , STMT_DELETE_PRISTINE_IF_UNREFERENCED ) ) ; SVN_ERR ( svn_sqlite__bind_checksum ( stmt , 1 , sha1_checksum , scratch_pool ) ) ; SVN_ERR ( svn_sqlite__update ( & affected_rows , stmt ) ) ; if ( affected_rows > 0 ) { #ifdef SVN_DEBUG svn_boolean_t ignore_enoent = FALSE ; #else svn_boolean_t ignore_enoent = TRUE ; #endif SVN_ERR ( remove_file ( pristine_abspath , wcroot , ignore_enoent , scratch_pool ) ) ; } return SVN_NO_ERROR ; }
If the pristine text referenced by SHA1_CHECKSUM in WCROOT/SDB, whose path
 within the pristine store is PRISTINE_ABSPATH, 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 / SDB whose path within the pristine store is PRISTINE_ABSPATH has a reference count of zero delete it ( both the database row and the disk file ) .
/* Remove the DB row, if refcount is 0. */ /* If we removed the DB row, then remove the file. */ /* If the file is not present, something has gone wrong, but at this
       * point it no longer matters.  In a debug build, raise an error, but
       * in a release build, it is more helpful to ignore it and continue. */