Functions for handling of indiviual struct estat
s.
More...
#include "global.h"
#include "waa.h"
#include "props.h"
#include "options.h"
Go to the source code of this file.
Defines | |
#define | SHADOWED_BY_REMOTE (1) |
#define | SHADOWED_BY_LOCAL (2) |
#define | ops__mark_childchanged(start, field) |
#define | ops__mark_parent_cc(changed_entry, field) ops__mark_childchanged(changed_entry->parent, field) |
#define | ops__mark_changed_parentcc(changed_entry, field) |
Functions | |
int | ops__build_path (char **path, struct estat *sts) |
Return the path of this entry. | |
int | ops__calc_path_len (struct estat *sts) |
Calculate the length of the path for this entry. | |
int | ops__stat_to_action (struct estat *sts, struct sstat_t *new) |
Compare the struct sstat_t , and set the entry_status . | |
int | ops__allocate (int needed, struct estat **where, int *count) |
This function returns blocks of (struct estat), possibly smaller than wanted by the caller. | |
int | ops__free_entry (struct estat **sts_p) |
Frees the memory associated with this entry and all its children. | |
int | ops__free_marked (struct estat *dir, int fast_mode) |
Frees all "marked" entries in the given directory at once. | |
int | ops__new_entries (struct estat *dir, int count, struct estat **new_entries) |
Appends the array of count new_entries as children to dir. | |
int | ops__save_1entry (struct estat *sts, ino_t parent_ino, int filehandle) |
Writes a textual description of the given sts to the filehandle. | |
int | ops__load_1entry (char **where, struct estat *sts, char **filename, ino_t *parent_i) |
Fills sts from a buffer where. | |
int | ops__update_single_entry (struct estat *sts, struct sstat_t *output) |
Does a lstat() on the given entry, and sets the entry_status . | |
int | ops__update_filter_set_bits (struct estat *sts) |
Wrapper for ops__update_single_entry and some more. | |
int | ops__string_to_dev (struct estat *sts, char *data, char **info) |
Converts a string describing a special node to the struct sstat_t data. | |
char * | ops__dev_to_waa_string (struct estat *sts) |
Converts a device entry into a string suitable for storage in the WAA area (using a : separator). | |
char * | ops__dev_to_filedata (struct estat *sts) |
See ops__dev_to_waa_string() , but uses a space character (\x20 ) for subversion compatibility. | |
int | ops__read_special_entry (apr_file_t *a_stream, char **data, int max, ssize_t *real_len, char *filename, apr_pool_t *pool) |
Reads a file. | |
int | ops__link_to_string (struct estat *sts, char *filename, char **erg) |
Reads a symlink and returns a pointer to its destination. | |
char * | ops__get_filename (char *path) |
Returns the filename. | |
void | ops__copy_single_entry (struct estat *src, struct estat *dest) |
Copies the data of a single struct estat. | |
int | ops__traverse (struct estat *parent, char *relative_path, int flags, int sts_flags, struct estat **ret) |
Create or find an entry below parent. | |
void | ops__set_todo_bits (struct estat *sts) |
Set the estat::do_userselected and estat::do_this_entry attributes depending on opt_recursive and the parent's bits. | |
int | ops__are_children_interesting (struct estat *dir) |
Determines whether child entries of this entry should be done, based on the recursive settings and dir's todo-bits. | |
int | ops__apply_group (struct estat *sts, hash_t *props, apr_pool_t *pool) |
Applies the defined group to the entry sts. | |
int | ops__make_shadow_entry (struct estat *sts, int flags) |
Creates a copy of sts, and keeps it referenced by sts->old . | |
void | DEBUGP_dump_estat (struct estat *sts) |
-. | |
static int | ops__allowed_by_filter (struct estat *sts) |
static int | ops__calc_filter_bit (struct estat *sts) |
static int | ops__should_entry_be_written_in_list (struct estat *sts) |
Do we want this entry written in the entry list? | |
static int | ops__has_children (struct estat *sts) |
Variables | |
const char | link_spec [] |
Startstrings for links in the repository. | |
const char | cdev_spec [] |
const char | bdev_spec [] |
Finding entries | |
| |
#define | UNKNOWN_INDEX (-1) |
Value for unknown indizes in ops__delete_entry() . | |
int | ops__find_entry_byname (struct estat *dir, char *name, struct estat **sts, int ignored_too) |
Find an entry in the dir by bname. | |
int | ops__find_entry_byinode (struct estat *dir, dev_t dev, ino_t inode, struct estat **sts) |
Find an entry in dir by the inode. | |
int | ops__delete_entry (struct estat *dir, struct estat *sts, int index_byinode, int index_byname) |
Delete an entry by either index_byinode, or index_byname, or sts. | |
| |
typedef int(* | ops__correlate_fn1_t )(struct estat *, struct estat **) |
Correlating entries from two directories dir_a and dir_B. | |
typedef int(* | ops__correlate_fn2_t )(struct estat *, struct estat *) |
int | ops__correlate_dirs (struct estat *dir_A, struct estat *dir_B, ops__correlate_fn1_t only_A, ops__correlate_fn2_t both, ops__correlate_fn1_t only_B, ops__correlate_fn2_t for_every) |
The function to go through the lists. |
Functions for handling of indiviual struct estat
s.
Definition in file est_ops.h.
#define ops__mark_changed_parentcc | ( | changed_entry, | |||
field | ) |
do { \ changed_entry->field |= FS_CHANGED; \ ops__mark_parent_cc(changed_entry, field); \ } while (0)
Definition at line 187 of file est_ops.h.
Referenced by cb___apply_textdelta(), cb___remover(), waa__build_tree(), and waa__update_dir().
#define ops__mark_childchanged | ( | start, | |||
field | ) |
do { \ register struct estat *_s=(start); \ while (_s && !(_s->field & FS_CHILD_CHANGED)) \ { \ _s->field |= FS_CHILD_CHANGED; \ _s=_s->parent; \ } \ } while (0)
#define ops__mark_parent_cc | ( | changed_entry, | |||
field | ) | ops__mark_childchanged(changed_entry->parent, field) |
Definition at line 184 of file est_ops.h.
Referenced by cb___delete_entry(), cb___store_prop(), cb__add_entry(), ci__action(), waa__update_dir(), and waa__update_tree().
#define SHADOWED_BY_LOCAL (2) |
Definition at line 122 of file est_ops.h.
Referenced by ops__make_shadow_entry().
#define SHADOWED_BY_REMOTE (1) |
Definition at line 121 of file est_ops.h.
Referenced by cb__add_entry(), and ops__make_shadow_entry().
#define UNKNOWN_INDEX (-1) |
Value for unknown indizes in ops__delete_entry()
.
Definition at line 42 of file est_ops.h.
Referenced by au__action(), and ops__delete_entry().
typedef int(* ops__correlate_fn1_t)(struct estat *, struct estat **) |
Correlating entries from two directories dir_a and dir_B.
Callback function type for A-only and B-only elements. The first parameter is a pointer to the current struct estat; the other is the pointer to the pointer in the directory structure. Not often needed ... could be done by var_args.
typedef int(* ops__correlate_fn2_t)(struct estat *, struct estat *) |
void DEBUGP_dump_estat | ( | struct estat * | sts | ) |
-.
We don't want that in a release build; but debug (and default) uses DEBUGP()
, so we might need this.
Definition at line 1843 of file est_ops.c.
References cs__md5tohex_buffered(), DEBUGP, estat::decoder, estat::decoder_is_correct, estat::do_child_wanted, estat::do_filter_allows, estat::do_filter_allows_done, estat::do_this_entry, estat::do_userselected, estat::entry_count, estat::entry_status, estat::flags, sstat_t::gid, sstat_t::ino, estat::local_mode_packed, estat::md5, sstat_t::mode, estat::name, estat::new_rev_mode_packed, estat::old, estat::old_rev_mode_packed, ops__build_path(), PACKED_to_MODE_T, estat::parent, estat::remote_status, sstat_t::size, estat::st, st__flags_string_fromint(), st__status_string_fromint(), st__type_string(), estat::to_be_ignored, sstat_t::uid, and estat::was_output.
Referenced by df___diff_wc_remote(), rev___undo_change(), sync___recurse(), and up__set_meta_data().
int ops__allocate | ( | int | needed, | |
struct estat ** | where, | |||
int * | count | |||
) |
This function returns blocks of (struct estat), possibly smaller than wanted by the caller.
This function returns blocks of (struct estat), possibly smaller than wanted by the caller.
The returned area is zeroed.
Definition at line 877 of file est_ops.c.
References BUG_ON, free_estat::count, DEBUGP, hlp__calloc(), free_estat::next, STOPIF, and VALGRIND_MAKE_MEM_DEFINED.
Referenced by cb__add_entry(), dir__enumerator(), ops__make_shadow_entry(), ops__traverse(), waa__copy_entries(), and waa__input_tree().
static int ops__allowed_by_filter | ( | struct estat * | sts | ) | [inline, static] |
Definition at line 131 of file est_ops.h.
References BUG_ON, estat::do_filter_allows, estat::do_filter_allows_done, and estat::name.
Referenced by ac__dispatch(), ci__work(), rev___local_revert(), waa___check_dir_for_update(), waa___finish_directory(), and waa___recurse_tree().
Applies the defined group to the entry sts.
Applies the defined group to the entry sts.
This means applying the target URL, and storing the auto-properties.
Optionally the property database can be returned in props.
Definition at line 1754 of file est_ops.c.
References grouping_t::auto_props, BUG_ON, DEBUGP, estat::flags, global_pool, ignore_t::group_def, ignore_t::group_name, HASH_REMEMBER_FILENAME, grouping_t::is_ignore, estat::match_pattern, estat::name, prp__open_byestat(), prp__set_from_aprhash(), RF_PUSHPROPS, STOPIF, STORE_IN_FS, estat::to_be_ignored, grouping_t::url, and estat::url.
Referenced by au__action(), ci___send_user_props(), ops__save_1entry(), and prp__s_work().
int ops__are_children_interesting | ( | struct estat * | dir | ) |
Determines whether child entries of this entry should be done, based on the recursive settings and dir's todo-bits.
Definition at line 1735 of file est_ops.c.
References estat::do_child_wanted, estat::do_this_entry, estat::do_userselected, ops___set_todo_bits(), and estat::parent.
Referenced by waa___check_dir_for_update(), waa__build_tree(), and waa__update_dir().
int ops__build_path | ( | char ** | value, | |
struct estat * | sts | |||
) |
Return the path of this entry.
Return the path of this entry.
This function uses a rotating array of cache_entry_t
. This means that a few paths will be usable at once; if some path has to be stored for a (possibly indefinite) time it should be strdup()ed
, or re-built upon need.
A LRU eviction scheme is used - with last one marked.
If some function modifies that memory, it should set the first char to \0
, to signal that it's no longer valid for other users.
The cache_entry_t::id
member is used as a pointer to the struct estat.
Definition at line 696 of file est_ops.c.
References BUG, estat::cache_index, cch__add(), cch__set_active(), cache_entry_t::data, DEBUGP, cache_t::entries, cache_entry_t::id, cache_t::lru, cache_t::max, ops__build_path2(), ops__calc_path_len(), estat::path_len, and STOPIF.
Referenced by ac___up_set_paths(), cb___report_path_rev(), ci__action(), ci__nondir(), cm___get_base_source(), cm___match(), cm__find_file_source(), cs___update_manber(), cs__compare_file(), cs__new_manber_filter(), cs__read_manber_hashes(), DEBUGP_dump_estat(), df___diff_wc_remote(), df___direct_diff(), df___repos_repos(), df___type_def_diff(), df__do_diff(), ign___test_all_patterns(), ign___test_single_pattern(), ign__is_ignore(), log__work(), ops__link_to_string(), ops__update_single_entry(), prp__open_byestat(), prp__unlink_db_for_estat(), res__mark_conflict(), res__remove_aux_files(), rev___handle_dir_mtime(), rev___revert_to_base(), rev___undo_change(), rev__get_props(), rev__install_file(), rev__merge(), st__print_entry_info(), st__rm_status(), st__status(), sync___recurse(), sync__progress(), up__apply_textdelta(), up__close_directory(), up__parse_prop(), up__rmdir(), up__set_meta_data(), up__unlink(), url__other_full_url(), and waa__update_dir().
static int ops__calc_filter_bit | ( | struct estat * | sts | ) | [inline, static] |
Definition at line 140 of file est_ops.h.
References estat::do_filter_allows, estat::do_filter_allows_done, estat::entry_status, FILTER__ALL, and OPT__FILTER.
Referenced by ops__update_filter_set_bits(), waa___check_dir_for_update(), and waa__partial_update().
int ops__calc_path_len | ( | struct estat * | sts | ) |
Calculate the length of the path for this entry.
Calculate the length of the path for this entry.
This function returns the number of characters needed. We don't return success or failure; there should never be a problem, and if we'd return 0 for success someone might put a STOPIF()
in the recursive call below, which would double the size of this function :-)
We don't include the trailing \0
, as that would be counted on each level.
Definition at line 660 of file est_ops.c.
References estat::name, ops__calc_path_len(), estat::parent, and estat::path_len.
Referenced by ops__build_path(), ops__calc_path_len(), and waa__output_tree().
Copies the data of a single struct estat.
Copies the data of a single struct estat.
We have to preserve the parent
pointer and the name
of dest.
Definition at line 1500 of file est_ops.c.
References estat::arg, estat::by_inode, estat::by_name, estat::cache_index, CF_NOTCHANGED, estat::change_flag, estat::child_index, estat::decoder, estat::decoder_is_correct, estat::do_child_wanted, estat::do_this_entry, estat::do_userselected, estat::entry_count, estat::entry_status, estat::flags, FS_NEW, estat::has_orig_md5, estat::md5, sstat_t::mode, estat::other_revs, estat::path_len, estat::remote_status, estat::repos_rev, RF_COPY_SUB, RF_ISNEW, estat::st, estat::strings, estat::to_be_sorted, estat::url, and estat::was_output.
Referenced by waa__copy_entries().
int ops__correlate_dirs | ( | struct estat * | dir_A, | |
struct estat * | dir_B, | |||
ops__correlate_fn1_t | only_A, | |||
ops__correlate_fn2_t | both, | |||
ops__correlate_fn1_t | only_B, | |||
ops__correlate_fn2_t | for_every | |||
) |
The function to go through the lists.
The function to go through the lists.
only_A, both, and only_B are called, then for_every (if not NULL
).
This builds and loops throught the sts::by_name lists, so modifying them must be done carefully, to change only the elements already processed.
Returning an error from any function stops the loop.
Definition at line 1572 of file est_ops.c.
References estat::by_name, DEBUGP, dir___f_sort_by_name(), dir__sortbyname(), estat::name, and STOPIF.
Referenced by cm___match_children(), waa__copy_entries(), and waa__update_dir().
int ops__delete_entry | ( | struct estat * | dir, | |
struct estat * | sts, | |||
int | index_byinode, | |||
int | index_byname | |||
) |
Delete an entry by either index_byinode, or index_byname, or sts.
Delete an entry by either index_byinode, or index_byname, or sts.
Only one the 3 specifications my be given; the other 2 values must be a NULL
resp. UNKNOWN_INDEX.
If the entry is given via sts, but is not found, ENOENT
is returned.
If an invalid index is given, we mark a BUG().
by_inode
and by_name
arrays. Definition at line 1067 of file est_ops.c.
References BUG_ON, estat::by_inode, estat::by_name, DEBUGP, estat::entry_count, sstat_t::mode, ops___move_array(), ops__free_entry(), estat::st, STOPIF, and UNKNOWN_INDEX.
Referenced by au__action().
char* ops__dev_to_filedata | ( | struct estat * | sts | ) |
See ops__dev_to_waa_string()
, but uses a space character (\x20
) for subversion compatibility.
Definition at line 207 of file est_ops.c.
References ops___dev_to_string().
Referenced by ci__nondir(), df___type_def_diff(), and up__apply_textdelta().
char* ops__dev_to_waa_string | ( | struct estat * | sts | ) |
Converts a device entry into a string suitable for storage in the WAA area (using a : separator).
Definition at line 199 of file est_ops.c.
References ops___dev_to_string().
Referenced by ops__save_1entry().
Find an entry in dir by the inode.
Definition at line 831 of file est_ops.c.
References BUG_ON, estat::by_inode, sstat_t::dev, dir___f_sort_by_inode(), dir__sortbyinode(), estat::entry_count, sstat_t::ino, sstat_t::mode, estat::st, and STOPIF.
int ops__find_entry_byname | ( | struct estat * | dir, | |
char * | name, | |||
struct estat ** | sts, | |||
int | ignored_too | |||
) |
Find an entry in the dir by bname.
Find an entry in the dir by bname.
This function doesn't return ENOENT
, if no entry is found; *sts will just be NULL
.
Definition at line 787 of file est_ops.c.
References BUG_ON, estat::by_name, DEBUGP, dir___f_sort_by_nameCS(), dir__sortbyname(), estat::entry_count, filename, sstat_t::mode, ops__get_filename(), estat::st, STOPIF, and estat::to_be_ignored.
Referenced by cb___delete_entry(), cb__add_entry(), and ops__traverse().
int ops__free_entry | ( | struct estat ** | sts_p | ) |
Frees the memory associated with this entry and all its children.
Frees the memory associated with this entry and all its children.
The pointer to the entry is set to NULL
, to avoid re-using.
Definition at line 959 of file est_ops.c.
References BUG_ON, estat::by_inode, estat::by_name, free_estat::count, DEBUGP, estat::entry_count, IF_FREE, sstat_t::mode, free_estat::next, estat::old, ops__free_entry(), estat::st, STOPIF, estat::strings, VALGRIND_MAKE_MEM_DEFINED, and VALGRIND_MAKE_MEM_NOACCESS.
Referenced by ops__delete_entry(), ops__free_entry(), ops__free_marked(), and waa__update_dir().
int ops__free_marked | ( | struct estat * | dir, | |
int | fast_mode | |||
) |
Frees all "marked" entries in the given directory at once.
Frees all "marked" entries in the given directory at once.
An entry is marked by having estat::to_be_ignored set; and such entries are removed here.
If fast_mode is set, the entries are get removed from the list are not free()d, nor do the pointer arrays get resized.
Definition at line 1156 of file est_ops.c.
References BUG_ON, estat::by_inode, estat::by_name, estat::entry_count, hlp__realloc(), IF_FREE, sstat_t::mode, ops__free_entry(), estat::st, and STOPIF.
Referenced by rev___local_revert(), rev__do_changed(), and waa__build_tree().
char* ops__get_filename | ( | char * | path | ) |
Returns the filename.
Returns the filename.
If no PATH_SEPARATOR
is found in the path, the path itself is returned.
Definition at line 583 of file est_ops.c.
References PATH_SEPARATOR.
Referenced by cb__add_entry(), and ops__find_entry_byname().
static int ops__has_children | ( | struct estat * | sts | ) | [inline, static] |
Definition at line 202 of file est_ops.h.
References estat::entry_count, sstat_t::mode, and estat::st.
Referenced by cb___remover(), ci___unset_copyflags(), cm___ignore_impl_copied(), and waa__output_tree().
int ops__link_to_string | ( | struct estat * | sts, | |
char * | filename, | |||
char ** | erg | |||
) |
Reads a symlink and returns a pointer to its destination.
Reads a symlink and returns a pointer to its destination.
The subversion header string for special nodes is prepended.
The returned pointer in *erg must not be free()d.
Definition at line 141 of file est_ops.c.
References BUG_ON, cch__add(), link_spec, sstat_t::mode, ops__build_path(), sstat_t::size, estat::st, STOPIF, and STOPIF_CODE_ERR.
Referenced by ci__nondir(), cs__compare_file(), df___type_def_diff(), and up__apply_textdelta().
int ops__load_1entry | ( | char ** | mem_pos, | |
struct estat * | sts, | |||
char ** | filename, | |||
ino_t * | parent_i | |||
) |
Fills sts from a buffer where.
Fills sts from a buffer where.
The filename still points into the buffer (mmap()ed
area) and must be copied.
mem_pos is advanced, and points after the \0
. If a \n
is seen immediately afterwards, it is skipped, too.
parent_i gets set to the stored value; the translation to a parent
pointer must be done in the caller.
EOF
cannot be reliable detected here; but we are guaranteed a \0\n
at the end of the string, to have a filename termination.
Definition at line 331 of file est_ops.c.
References BUG_ON, cs__char2md5(), sstat_t::ctim, sstat_t::dev, estat::entry_count, estat::flags, sstat_t::gid, hlp__get_word(), hlp__skip_ws(), sstat_t::ino, estat::local_mode_packed, estat::md5, sstat_t::mode, MODE_T_to_PACKED, sstat_t::mtim, estat::new_rev_mode_packed, estat::old_rev, estat::old_rev_mode_packed, ops__string_to_dev(), estat::repos_rev, sstat_t::size, estat::st, STOPIF, sstat_t::uid, estat::url, url__find_by_intnum(), urllist, and urllist_count.
Referenced by waa__input_tree().
int ops__make_shadow_entry | ( | struct estat * | sts, | |
int | flags | |||
) |
Creates a copy of sts, and keeps it referenced by sts->old
.
Definition at line 1806 of file est_ops.c.
References BUG_ON, estat::cache_index, FS_REMOVED, FS_REPLACED, estat::old, ops__allocate(), estat::remote_status, SHADOWED_BY_LOCAL, SHADOWED_BY_REMOTE, and STOPIF.
Referenced by cb__add_entry().
Appends the array of count new_entries as children to dir.
Appends the array of count new_entries as children to dir.
The directory gets by_name removed; by_inode is extended and sorted.
Definition at line 755 of file est_ops.c.
References estat::by_inode, estat::by_name, estat::entry_count, hlp__realloc(), IF_FREE, STOPIF, and estat::to_be_sorted.
Referenced by cb__add_entry(), ops__traverse(), waa__copy_entries(), and waa__update_dir().
int ops__read_special_entry | ( | apr_file_t * | a_stream, | |
char ** | data, | |||
int | max, | |||
ssize_t * | real_len, | |||
char * | filename, | |||
apr_pool_t * | pool | |||
) |
Reads a file.
Reads a file.
The specified stream gets rewound, read up to max bytes (sane default for 0), and returned (zero-terminated) in *buffer allocated in pool.
The real length can be seen via real_len.
If filename is given, the file is removed.
If pool is NULL
, the space is malloc()ed
and must be free()d
by the caller.
Definition at line 1670 of file est_ops.c.
References DEBUGP, hlp__alloc(), STOPIF, and STOPIF_CODE_ERR.
Referenced by rev__install_file().
int ops__save_1entry | ( | struct estat * | sts, | |
ino_t | parent_ino, | |||
int | filehandle | |||
) |
Writes a textual description of the given sts to the filehandle.
Writes a textual description of the given sts to the filehandle.
The parameter parent_ino is a(n integer) reference to the parent directory - the line number in which it was written. The format is fixed (see ops__dir_info_format_p
); the string includes a \0
for filename termination, and a \n
at the end.
Any other characters that are allowed in a filename can be written - even control characters like \n
, \r
, \f
and so on.
Definition at line 491 of file est_ops.c.
References BUG_ON, cs__md5tohex_buffered(), sstat_t::ctim, url_t::current_rev, DEBUGP, sstat_t::dev, estat::flags, sstat_t::gid, sstat_t::ino, url_t::internal_number, estat::match_pattern, estat::md5, sstat_t::mode, sstat_t::mtim, estat::name, ops___entries_to_write(), ops__apply_group(), ops__dev_to_waa_string(), ops__dir_info_format_p, estat::parent, estat::repos_rev, RF___SAVE_MASK, RF_ADD, RF_COPY_BASE, RF_COPY_SUB, SET_REVNUM, sstat_t::size, estat::st, STOPIF, STOPIF_CODE_ERR, sstat_t::uid, estat::url, and WAA_MAX_DIR_INFO_CHARS.
Referenced by waa__output_tree().
void ops__set_todo_bits | ( | struct estat * | sts | ) |
Set the estat::do_userselected and estat::do_this_entry attributes depending on opt_recursive and the parent's bits.
Set the estat::do_userselected and estat::do_this_entry attributes depending on opt_recursive and the parent's bits.
Should not be called for the root.
Definition at line 1442 of file est_ops.c.
References DEBUGP, estat::do_filter_allows, estat::do_filter_allows_done, estat::do_this_entry, estat::do_userselected, ops___set_todo_bits(), and estat::parent.
Referenced by ops__update_filter_set_bits(), waa__build_tree(), and waa__update_dir().
static int ops__should_entry_be_written_in_list | ( | struct estat * | sts | ) | [inline, static] |
Do we want this entry written in the entry list?
Definition at line 195 of file est_ops.h.
References estat::flags, RF_DONT_WRITE, and estat::to_be_ignored.
Referenced by ops___entries_to_write(), and waa__output_tree().
Compare the struct
sstat_t
, and set the entry_status
.
Compare the struct
sstat_t
, and set the entry_status
.
Returns the change mask as a binary OR of the various FS_*
constants, see fs_bits.
Definition at line 216 of file est_ops.c.
References BUG_ON, sstat_t::ctim, DEBUGP, estat::flags, FS_CHANGED, FS_LIKELY, FS_META_GROUP, FS_META_MTIME, FS_META_OWNER, FS_META_UMODE, FS_NO_CHANGE, FS_REPLACED, sstat_t::gid, sstat_t::mode, sstat_t::mtim, sstat_t::rdev, RF___IS_COPY, sstat_t::size, estat::st, st__status_string_fromint(), estat::to_be_ignored, and sstat_t::uid.
Referenced by ops__update_single_entry().
int ops__string_to_dev | ( | struct estat * | sts, | |
char * | data, | |||
char ** | info | |||
) |
Converts a string describing a special node to the struct
sstat_t
data.
Converts a string describing a special node to the struct
sstat_t
data.
info
, if not NULL
, gets the pointer to the first character after the parsed text: For a symlink it is returned as the path it points to, devices are fully decoded and should a pointer to \0
.
Definition at line 82 of file est_ops.c.
References bdev_spec, cdev_spec, link_spec, estat::local_mode_packed, sstat_t::mode, MODE_T_to_PACKED, sstat_t::rdev, estat::st, and STOPIF_CODE_ERR.
Referenced by ops__load_1entry(), sync___recurse(), and up__handle_special().
int ops__traverse | ( | struct estat * | current, | |
char * | fullpath, | |||
int | flags, | |||
int | sts_flags, | |||
struct estat ** | ret | |||
) |
Create or find an entry below parent.
Create or find an entry below parent.
Does not modify path.
The flags parameter tells about the policy regarding tree walking.
For add, unversion we need to create the given path with the specified flags; in add it should exist, for unversion is needs not. For diff / info we only walk the tree without creating or checking for current status (info, repos/repos diff for removed files). For prop_set / prop_get / prop_list we need an existing path, which might be not versioned currently. For revert we need to look in the tree, and find removed entries, too. In waa__partial_update() (status check with given subtrees) we create the paths as necessary. If they do not exist we'd like to print them as removed.
So we need to know:
Definition at line 1228 of file est_ops.c.
References BUG, BUG_ON, estat::entry_count, estat::flags, hlp__strdup(), IF_FREE, sstat_t::mode, estat::name, ops___split_fnpart(), ops__allocate(), OPS__CREATE, OPS__FAIL_NOT_LIST, ops__find_entry_byname(), ops__new_entries(), OPS__ON_UPD_LIST, estat::parent, RF_ISNEW, sstat_t::size, estat::st, STOPIF, STOPIF_CODE_ERR, and waa__insert_entry_block().
Referenced by cat__work(), cm___make_copy(), cm__uncopy(), hlp__match_path_envs(), log__work(), prp__s_work(), and waa__partial_update().
int ops__update_filter_set_bits | ( | struct estat * | sts | ) |
Wrapper for ops__update_single_entry
and some more.
Wrapper for ops__update_single_entry
and some more.
Calls ops__set_to_handle_bits()
and maybe ops__update_single_entry()
, and depending on the filter settings sts->do_this_entry
might be cleared.
Definition at line 1467 of file est_ops.c.
References action, DEBUGP, estat::do_filter_allows, estat::do_this_entry, estat::entry_status, FS_REMOVED, FS_REPLACED, ops__calc_filter_bit(), ops__set_todo_bits(), ops__update_single_entry(), actionlist_t::overwrite_sts_st, estat::parent, estat::st, and STOPIF.
Referenced by waa__update_tree().
Does a lstat()
on the given entry, and sets the entry_status
.
Does a lstat()
on the given entry, and sets the entry_status
.
The parent directory should already be done, so that removal of whole trees is done without doing unneeded lstat()s
.
Depending on o_chcheck
a file might be checked for changes by a MD5 comparision.
Per default only_check_status
is not set, and the data from lstat()
is written into sts. Some functions need the old values and can set this flag; then only entry_status
is modified.
If output is not NULL, then it is overwritten, and sts->st is not changed - independent of only_check_status
. In case of a removed entry *output is not changed.
Definition at line 1336 of file est_ops.c.
References action, CHCHECK_ALLFILES, CHCHECK_FILE, cs__compare_file(), DEBUGP, estat::entry_status, estat::flags, FS_CHANGED, FS_LIKELY, FS_REMOVED, hlp__lstat(), estat::local_mode_packed, sstat_t::mode, MODE_T_to_PACKED, ops__build_path(), ops__stat_to_action(), OPT__CHANGECHECK, actionlist_t::overwrite_sts_st, estat::parent, estat::st, and STOPIF.
Referenced by ops__update_filter_set_bits(), and waa__partial_update().
const char bdev_spec[] |
Definition at line 71 of file est_ops.c.
Referenced by ops___dev_to_string(), and ops__string_to_dev().
const char cdev_spec[] |
Definition at line 70 of file est_ops.c.
Referenced by ops___dev_to_string(), and ops__string_to_dev().
const char link_spec[] |
Startstrings for links in the repository.
Startstrings for links in the repository.
It's a bit unaesthetical that devices use a " " for the repository data, but a ":" in the waa as delimiter. But "link " is specified in subversion, and having the repository data different would not be better. So we just allow both at parsing, and use the "right" for each target.
Definition at line 69 of file est_ops.c.
Referenced by ops__link_to_string(), ops__string_to_dev(), and sync___recurse().