racallback.c File Reference

Callback functions, and cb__record_changes() editor. More...

#include <errno.h>
#include <time.h>
#include <unistd.h>
#include <subversion-1/svn_ra.h>
#include <subversion-1/svn_auth.h>
#include <subversion-1/svn_client.h>
#include <subversion-1/svn_cmdline.h>
#include "global.h"
#include "helper.h"
#include "update.h"
#include "est_ops.h"
#include "checksum.h"
#include "status.h"
#include "cache.h"
#include "url.h"
#include "racallback.h"
Include dependency graph for racallback.c:

Go to the source code of this file.

Functions

svn_error_t * cb__init (apr_pool_t *pool)
 Initialize the callback functions.
svn_error_t * cb__open_tmp (apr_file_t **fp, void *callback_baton, apr_pool_t *pool)
 FSVS GCOV MARK: cb__open_tmp should not be executed.
svn_error_t * cb__txdelta_discard (svn_txdelta_window_t *window UNUSED, void *baton UNUSED)
 A txdelta consumer which ignores the data.
int cb__add_entry (struct estat *dir, const char *utf8_path, char **loc_path, const char *utf8_copy_path, svn_revnum_t copy_rev, int mode, int *has_existed, int may_create, void **new)
 If may_create is 0, ENOENT may be returned (ie.
int cb___store_prop (struct estat *sts, const char *utf8_name, const svn_string_t *value, apr_pool_t *pool)
svn_error_t * cb___set_target_revision (void *edit_baton, svn_revnum_t rev, apr_pool_t *pool)
svn_error_t * cb___open_root (void *edit_baton, svn_revnum_t base_revision, apr_pool_t *dir_pool UNUSED, void **root_baton)
svn_error_t * cb___delete_entry (const char *utf8_path, svn_revnum_t revision UNUSED, void *parent_baton, apr_pool_t *pool)
svn_error_t * cb___add_directory (const char *utf8_path, void *parent_baton, const char *utf8_copy_path, svn_revnum_t copy_rev, apr_pool_t *dir_pool, void **child_baton)
svn_error_t * cb___open_directory (const char *utf8_path, void *parent_baton, svn_revnum_t base_revision UNUSED, apr_pool_t *dir_pool, void **child_baton)
svn_error_t * cb___change_dir_prop (void *dir_baton, const char *utf8_name, const svn_string_t *value, apr_pool_t *pool)
int cb___close (struct estat *sts)
svn_error_t * cb___close_directory (void *dir_baton, apr_pool_t *pool)
svn_error_t * cb___absent_directory (const char *utf8_path, void *parent_baton, apr_pool_t *pool)
 FSVS GCOV MARK: cb___absent_directory should not be executed.
svn_error_t * cb___add_file (const char *utf8_path, void *parent_baton, const char *utf8_copy_path, svn_revnum_t copy_rev, apr_pool_t *file_pool, void **file_baton)
svn_error_t * cb___open_file (const char *utf8_path, void *parent_baton, svn_revnum_t base_revision, apr_pool_t *file_pool, void **file_baton)
svn_error_t * cb___apply_textdelta (void *file_baton, const char *base_checksum UNUSED, apr_pool_t *pool UNUSED, svn_txdelta_window_handler_t *handler, void **handler_baton)
svn_error_t * cb___change_file_prop (void *file_baton, const char *utf8_name, const svn_string_t *value, apr_pool_t *pool)
svn_error_t * cb___close_file (void *file_baton, const char *text_checksum, apr_pool_t *pool)
svn_error_t * cb___absent_file (const char *utf8_path, void *parent_baton, apr_pool_t *pool)
 FSVS GCOV MARK: cb___absent_file should not be executed.
svn_error_t * cb___close_edit (void *edit_baton, apr_pool_t *pool UNUSED)
svn_error_t * cb___abort_edit (void *edit_baton, apr_pool_t *pool UNUSED)
 FSVS GCOV MARK: cb___abort_edit should not be executed.
int cb___report_path_rev (struct estat *dir, const svn_ra_reporter2_t *reporter, void *report_baton, apr_pool_t *pool)
int cb___remover (struct estat *sts, struct url_t *to_remove, struct url_t **hp, int *has_changes)
 Helper function for cb__remove_from_url().
int cb__remove_from_url (struct estat *root, struct url_t *to_remove, int *was_changed)
 -.
int cb__remove_url (struct estat *root, struct url_t *to_remove)
 -.
int cb__record_changes (struct estat *root, svn_revnum_t target, apr_pool_t *pool)
 -.
int cb__record_changes_mixed (struct estat *root, svn_revnum_t target, char *other_paths[], svn_revnum_t other_revs, apr_pool_t *pool)
 -.
int cb__does_path_exist (svn_ra_session_t *session, char *path, svn_revnum_t rev, int *exists, apr_pool_t *pool)
 -.

Variables

struct svn_ra_callbacks_t cb__cb_table
 The callback table for cb__record_changes().
svn_revnum_t cb___dest_rev
const svn_delta_editor_t cb___change_recorder

Detailed Description

Callback functions, and cb__record_changes() editor.

Definition in file racallback.c.


Function Documentation

svn_error_t* cb___abort_edit ( void *  edit_baton,
apr_pool_t *pool  UNUSED 
)

FSVS GCOV MARK: cb___abort_edit should not be executed.

Definition at line 667 of file racallback.c.

svn_error_t* cb___absent_directory ( const char *  utf8_path,
void *  parent_baton,
apr_pool_t *  pool 
)

FSVS GCOV MARK: cb___absent_directory should not be executed.

Definition at line 512 of file racallback.c.

References DEBUGP, and UNUSED.

svn_error_t* cb___absent_file ( const char *  utf8_path,
void *  parent_baton,
apr_pool_t *  pool 
)

FSVS GCOV MARK: cb___absent_file should not be executed.

Definition at line 641 of file racallback.c.

References DEBUGP, and UNUSED.

svn_error_t* cb___add_directory ( const char *  utf8_path,
void *  parent_baton,
const char *  utf8_copy_path,
svn_revnum_t  copy_rev,
apr_pool_t *  dir_pool,
void **  child_baton 
)

Definition at line 412 of file racallback.c.

References estat::by_inode, estat::by_name, cb__add_entry(), estat::entry_count, estat::other_revs, RETURN_SVNERR, STOPIF, estat::strings, and estat::to_be_sorted.

Here is the call graph for this function:

svn_error_t* cb___add_file ( const char *  utf8_path,
void *  parent_baton,
const char *  utf8_copy_path,
svn_revnum_t  copy_rev,
apr_pool_t *  file_pool,
void **  file_baton 
)

Definition at line 524 of file racallback.c.

References cb__add_entry(), RETURN_SVNERR, and STOPIF.

Here is the call graph for this function:

svn_error_t* cb___apply_textdelta ( void *  file_baton,
const char *base_checksum  UNUSED,
apr_pool_t *pool  UNUSED,
svn_txdelta_window_handler_t *  handler,
void **  handler_baton 
)

Definition at line 581 of file racallback.c.

References cb__txdelta_discard(), ops__mark_changed_parentcc, estat::remote_status, RETURN_SVNERR, and url__current_has_precedence().

Here is the call graph for this function:

svn_error_t* cb___change_dir_prop ( void *  dir_baton,
const char *  utf8_name,
const svn_string_t *  value,
apr_pool_t *  pool 
)

Definition at line 463 of file racallback.c.

References cb___store_prop(), RETURN_SVNERR, and STOPIF.

Here is the call graph for this function:

svn_error_t* cb___change_file_prop ( void *  file_baton,
const char *  utf8_name,
const svn_string_t *  value,
apr_pool_t *  pool 
)

Definition at line 601 of file racallback.c.

References cb___store_prop(), RETURN_SVNERR, and STOPIF.

Here is the call graph for this function:

int cb___close ( struct estat sts  ) 

Definition at line 478 of file racallback.c.

References action, cb___dest_rev, actionlist_t::repos_feedback, estat::repos_rev, and STOPIF.

Referenced by cb___close_directory(), and cb___close_file().

Here is the caller graph for this function:

svn_error_t* cb___close_directory ( void *  dir_baton,
apr_pool_t *  pool 
)

Definition at line 493 of file racallback.c.

References estat::by_name, cb___close(), IF_FREE, RETURN_SVNERR, and STOPIF.

Here is the call graph for this function:

svn_error_t* cb___close_edit ( void *  edit_baton,
apr_pool_t *pool  UNUSED 
)

Definition at line 652 of file racallback.c.

References RETURN_SVNERR.

svn_error_t* cb___close_file ( void *  file_baton,
const char *  text_checksum,
apr_pool_t *  pool 
)

Definition at line 616 of file racallback.c.

References cb___close(), cs__char2md5(), DEBUGP, estat::decoder, estat::has_orig_md5, estat::md5, sstat_t::mode, RETURN_SVNERR, estat::st, and STOPIF.

Here is the call graph for this function:

svn_error_t* cb___delete_entry ( const char *  utf8_path,
svn_revnum_t revision  UNUSED,
void *  parent_baton,
apr_pool_t *  pool 
)

Todo:
conflict?

Definition at line 379 of file racallback.c.

References cb__remove_from_url(), current_url, DEBUGP, hlp__utf82local(), ops__find_entry_byname(), ops__mark_parent_cc, estat::remote_status, RETURN_SVNERR, and STOPIF.

Here is the call graph for this function:

svn_error_t* cb___open_directory ( const char *  utf8_path,
void *  parent_baton,
svn_revnum_t base_revision  UNUSED,
apr_pool_t *  dir_pool,
void **  child_baton 
)

Todo:
conflict - removed locally? added

Definition at line 445 of file racallback.c.

References cb__add_entry(), RETURN_SVNERR, and STOPIF.

Here is the call graph for this function:

svn_error_t* cb___open_file ( const char *  utf8_path,
void *  parent_baton,
svn_revnum_t  base_revision,
apr_pool_t *  file_pool,
void **  file_baton 
)

Definition at line 547 of file racallback.c.

References cb__add_entry(), estat::decoder_is_correct, RETURN_SVNERR, STOPIF, and up__fetch_decoder().

Here is the call graph for this function:

svn_error_t* cb___open_root ( void *  edit_baton,
svn_revnum_t  base_revision,
apr_pool_t *dir_pool  UNUSED,
void **  root_baton 
)

Definition at line 366 of file racallback.c.

int cb___remover ( struct estat sts,
struct url_t to_remove,
struct url_t **  hp,
int *  has_changes 
)

Helper function for cb__remove_from_url().

Returns the highest-priority URL that's used by an entry below sts and which has a lower priority than to_remove in hp; this must be initialized to NULL before calling.

Definition at line 750 of file racallback.c.

References action, BUG_ON, estat::by_inode, DEBUGP, FS_CHILD_CHANGED, FS_REMOVED, url_t::name, estat::name, ops__has_children(), ops__mark_changed_parentcc, estat::parent, estat::remote_status, actionlist_t::repos_feedback, STOPIF, estat::url, and url__sorter().

Referenced by cb__remove_from_url(), and cb__remove_url().

Here is the call graph for this function:

Here is the caller graph for this function:

int cb___report_path_rev ( struct estat dir,
const svn_ra_reporter2_t *  reporter,
void *  report_baton,
apr_pool_t *  pool 
)

Definition at line 705 of file racallback.c.

References estat::by_inode, DEBUGP, estat::entry_count, sstat_t::mode, ops__build_path(), estat::other_revs, estat::parent, estat::repos_rev, estat::st, STOPIF, and STOPIF_SVNERR.

Referenced by cb__record_changes_mixed().

Here is the call graph for this function:

Here is the caller graph for this function:

svn_error_t* cb___set_target_revision ( void *  edit_baton,
svn_revnum_t  rev,
apr_pool_t *  pool 
)

Definition at line 352 of file racallback.c.

References cb___dest_rev, DEBUGP, RETURN_SVNERR, and UNUSED.

int cb___store_prop ( struct estat sts,
const char *  utf8_name,
const svn_string_t *  value,
apr_pool_t *  pool 
) [inline]

Definition at line 291 of file racallback.c.

References action, DEBUGP, global_pool, actionlist_t::keep_user_prop, ops__mark_parent_cc, url_t::pool, STOPIF, up__parse_prop(), estat::url, url__current_has_precedence(), and estat::user_prop.

Referenced by cb___change_dir_prop(), and cb___change_file_prop().

Here is the call graph for this function:

Here is the caller graph for this function:

int cb__add_entry ( struct estat dir,
const char *  utf8_path,
char **  loc_path,
const char *  utf8_copy_path,
svn_revnum_t  copy_rev,
int  mode,
int *  has_existed,
int  may_create,
void **  new 
)

If may_create is 0, ENOENT may be returned (ie.

This function adds a new entry below dir, setting it to FS_NEW or FS_REPLACED.

was not found).

If mode doesn't include some permission bits, like 0700 or 0600, a default value is chosen.

If it didn't exist, or if this is a higher priority URL, the parents get FS_CHILD_CHANGED set.

path gets set (if not NULL) to utf8_path in local encoding.

Definition at line 130 of file racallback.c.

References estat::by_inode, estat::by_name, current_url, DEBUGP, estat::decoder, estat::entry_count, filename, FS_CHANGED, FS_NEW, FS_REMOVED, sstat_t::gid, estat::has_orig_md5, hlp__lstat(), hlp__strdup(), hlp__utf82local(), estat::local_mode_packed, estat::md5, sstat_t::mode, MODE_T_to_PACKED, sstat_t::mtim, estat::name, estat::new_rev_mode_packed, estat::old_rev_mode_packed, ops__allocate(), ops__find_entry_byname(), ops__get_filename(), ops__make_shadow_entry(), ops__mark_parent_cc, ops__new_entries(), PACKED_to_MODE_T, estat::parent, estat::remote_status, S_IFUNDEF, SHADOWED_BY_REMOTE, estat::st, st__type_string(), STOPIF, STOPIF_CODE_ERR, estat::strings, sstat_t::uid, estat::url, and url__current_has_precedence().

Referenced by cb___add_directory(), cb___add_file(), cb___open_directory(), cb___open_file(), sync___recurse(), up__add_directory(), and up__add_file().

Here is the call graph for this function:

Here is the caller graph for this function:

int cb__does_path_exist ( svn_ra_session_t *  session,
char *  path,
svn_revnum_t  rev,
int *  exists,
apr_pool_t *  pool 
)

-.

Checks whether a given remote path exists.

We need a valid revision number, SVN_INVALID_REVNUM (for HEAD) isn't.

Definition at line 1010 of file racallback.c.

References STOPIF_SVNERR.

Referenced by url__open_session().

Here is the caller graph for this function:

svn_error_t* cb__init ( apr_pool_t *  pool  ) 

Initialize the callback functions.

Todo:
Authentication providers.

Definition at line 36 of file racallback.c.

References BUG_ON, cb__cb_table, hlp__get_svn_config(), OPT__AUTHOR, OPT__CONFIG_DIR, RETURN_SVNERR, STOPIF, and STOPIF_SVNERR.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

svn_error_t* cb__open_tmp ( apr_file_t **  fp,
void *  callback_baton,
apr_pool_t *  pool 
)

FSVS GCOV MARK: cb__open_tmp should not be executed.

This function has to be defined, but gets called only with http-URLs.

Definition at line 78 of file racallback.c.

References RETURN_SVNERR, STOPIF, and waa__get_tmp_name().

Here is the call graph for this function:

int cb__record_changes ( struct estat root,
svn_revnum_t  target,
apr_pool_t *  pool 
)

-.

A change-recording editor.

Just a proxy; calls cb__record_changes_mixed() with the root, target and pool, and default values for the rest.

Definition at line 859 of file racallback.c.

References cb__record_changes_mixed(), and STOPIF.

Referenced by df__work(), rev__work(), sync__work(), and up__work().

Here is the call graph for this function:

Here is the caller graph for this function:

int cb__record_changes_mixed ( struct estat root,
svn_revnum_t  target,
char *  other_paths[],
svn_revnum_t  other_revs,
apr_pool_t *  pool 
)

-.

Like cb__record_changes(), but allowing mixed reporting.

Calls the svn libraries and records which entries would be changed on this update on current_url.

Parameters:
root The root entry of this wc tree
target The target revision. SVN_INVALID_REVNUM is not valid.
other_paths A NULL-terminated list of paths that are sent to the svn_ra_reporter2_t::set_path().
other_revs The revision to be sent for other_paths.
pool An APR-pool.

When a non-directory entry gets replaced by a directory, its MD5 is lost (because the directory is initialized to entry_count=0 , by_inode=by_name=NULL ); that should not matter, since we have modification flags in entry_status .

If a non-directory gets replaced by a directory, entry_count and by_inode are kept - we need them for up__rmdir() to remove known child entries.

Please note that it's not possible to run invisible entries (that are not seen because some higher priority URL overlays them) to run as baton==NULL (although that would save quite a bit of url__current_has_precedence() calls), because it's possible that some file in a directory below can be seen.

other_paths is a NULL -terminated list of pathnames (which may have the "./" in front, ie. the normalized paths) that are to be reported at revision other_revs.

If other_paths is NULL, or doesn't include an "." entry, the WC root is reported to be at current_url->current_rev or, if this is 0, to be at target, but empty.

Definition at line 905 of file racallback.c.

References cb___change_recorder, cb___dest_rev, cb___report_path_rev(), url_t::current_rev, current_url, DEBUGP, global_pool, PATH_SEPARATOR, url_t::session, STOPIF, and STOPIF_SVNERR.

Referenced by cb__record_changes(), and df__work().

Here is the call graph for this function:

Here is the caller graph for this function:

int cb__remove_from_url ( struct estat root,
struct url_t to_remove,
int *  was_changed 
)

-.

Removes all entries belonging to to_remove from the tree root.

While recursion we look for the highest priority URL in the children (within each level); if there is one, we mark the directory as belonging to that URL.

Will be easier with mixed-WC operation; currently it's not correct if there are overlayed non-directory entries.

Definition at line 825 of file racallback.c.

References cb___remover(), url_t::current_rev, and STOPIF.

Referenced by cb___delete_entry().

Here is the call graph for this function:

Here is the caller graph for this function:

int cb__remove_url ( struct estat root,
struct url_t to_remove 
)

-.

Remove all entries from the given URL, and mark it for deletion.

Definition at line 841 of file racallback.c.

References cb___remover(), url_t::current_rev, STOPIF, and url__must_write_defs.

Referenced by up__work().

Here is the call graph for this function:

Here is the caller graph for this function:

svn_error_t* cb__txdelta_discard ( svn_txdelta_window_t *window  UNUSED,
void *baton  UNUSED 
)

A txdelta consumer which ignores the data.

Definition at line 113 of file racallback.c.

Referenced by cb___apply_textdelta().

Here is the caller graph for this function:


Variable Documentation

const svn_delta_editor_t cb___change_recorder
Initial value:
 
{
    .set_target_revision    = cb___set_target_revision,

    .open_root                      = cb___open_root,

    .delete_entry                   = cb___delete_entry,
    .add_directory              = cb___add_directory,
    .open_directory             = cb___open_directory,
    .change_dir_prop            = cb___change_dir_prop,
    .close_directory            = cb___close_directory,
    .absent_directory       = cb___absent_directory,

    .add_file                       = cb___add_file,
    .open_file                      = cb___open_file,
    .apply_textdelta            = cb___apply_textdelta,
    .change_file_prop       = cb___change_file_prop,
    .close_file                     = cb___close_file,
    .absent_file                    = cb___absent_file,

    .close_edit                     = cb___close_edit,
    .abort_edit                     = cb___abort_edit,
}

Definition at line 678 of file racallback.c.

Referenced by cb__record_changes_mixed().

svn_revnum_t cb___dest_rev

Definition at line 110 of file racallback.c.

Referenced by cb___close(), cb___set_target_revision(), and cb__record_changes_mixed().

struct svn_ra_callbacks_t cb__cb_table
Initial value:
{
    .open_tmp_file = cb__open_tmp,
    .auth_baton = NULL,

    .get_wc_prop = NULL,
    .set_wc_prop=NULL,
    .push_wc_prop=NULL,
    .invalidate_wc_props=NULL,
}

The callback table for cb__record_changes().

Definition at line 92 of file racallback.c.

Referenced by cb__init(), and url__open_session().


Generated for fsvs by  doxygen 1.6.1