这篇教程C++ svn_error_trace函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中svn_error_trace函数的典型用法代码示例。如果您正苦于以下问题:C++ svn_error_trace函数的具体用法?C++ svn_error_trace怎么用?C++ svn_error_trace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了svn_error_trace函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: svn_wc_copy3svn_error_t *svn_wc_copy3(svn_wc_context_t *wc_ctx, const char *src_abspath, const char *dst_abspath, svn_boolean_t metadata_only, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, void *notify_baton, apr_pool_t *scratch_pool){ /* Verify that we have the required write lock. */ SVN_ERR(svn_wc__write_check(wc_ctx->db, svn_dirent_dirname(dst_abspath, scratch_pool), scratch_pool)); return svn_error_trace(copy_or_move(NULL, wc_ctx, src_abspath, dst_abspath, metadata_only, FALSE /* is_move */, TRUE /* allow_mixed_revisions */, cancel_func, cancel_baton, notify_func, notify_baton, scratch_pool));}
开发者ID:geofft,项目名称:subversion,代码行数:23,
示例2: svn_fs_apply_textdeltasvn_error_t *svn_fs_apply_textdelta(svn_txdelta_window_handler_t *contents_p, void **contents_baton_p, svn_fs_root_t *root, const char *path, const char *base_checksum, const char *result_checksum, apr_pool_t *pool){ svn_checksum_t *base, *result; /* TODO: If we ever rev this API, we should make the supplied checksums svn_checksum_t structs. */ SVN_ERR(svn_checksum_parse_hex(&base, svn_checksum_md5, base_checksum, pool)); SVN_ERR(svn_checksum_parse_hex(&result, svn_checksum_md5, result_checksum, pool)); return svn_error_trace(root->vtable->apply_textdelta(contents_p, contents_baton_p, root, path, base, result, pool));}
开发者ID:ChaosJohn,项目名称:freebsd,代码行数:23,
示例3: svn_cl__time_cstring_to_human_cstringsvn_error_t *svn_cl__time_cstring_to_human_cstring(const char **human_cstring, const char *data, apr_pool_t *pool){ svn_error_t *err; apr_time_t when; err = svn_time_from_cstring(&when, data, pool); if (err && err->apr_err == SVN_ERR_BAD_DATE) { svn_error_clear(err); *human_cstring = _("(invalid date)"); return SVN_NO_ERROR; } else if (err) return svn_error_trace(err); *human_cstring = svn_time_to_human_cstring(when, pool); return SVN_NO_ERROR;}
开发者ID:lucianacuarelli,项目名称:xxxx,代码行数:23,
示例4: svn_wc__db_pristine_get_sha1svn_error_t *svn_wc__db_pristine_get_sha1(const svn_checksum_t **sha1_checksum, svn_wc__db_t *db, const char *wri_abspath, const svn_checksum_t *md5_checksum, apr_pool_t *result_pool, apr_pool_t *scratch_pool){ svn_wc__db_wcroot_t *wcroot; const char *local_relpath; svn_sqlite__stmt_t *stmt; svn_boolean_t have_row; SVN_ERR_ASSERT(svn_dirent_is_absolute(wri_abspath)); SVN_ERR_ASSERT(sha1_checksum != NULL); SVN_ERR_ASSERT(md5_checksum->kind == svn_checksum_md5); SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db, wri_abspath, scratch_pool, scratch_pool)); VERIFY_USABLE_WCROOT(wcroot); SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_SELECT_PRISTINE_BY_MD5)); SVN_ERR(svn_sqlite__bind_checksum(stmt, 1, md5_checksum, scratch_pool)); SVN_ERR(svn_sqlite__step(&have_row, stmt)); if (!have_row) return svn_error_createf(SVN_ERR_WC_DB_ERROR, svn_sqlite__reset(stmt), _("The pristine text with MD5 checksum '%s' was " "not found"), svn_checksum_to_cstring_display(md5_checksum, scratch_pool)); SVN_ERR(svn_sqlite__column_checksum(sha1_checksum, stmt, 0, result_pool)); SVN_ERR_ASSERT((*sha1_checksum)->kind == svn_checksum_sha1); return svn_error_trace(svn_sqlite__reset(stmt));}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:37,
示例5: svn_client__get_inheritable_propssvn_error_t *svn_client__get_inheritable_props(apr_hash_t **wcroot_iprops, const char *local_abspath, svn_revnum_t revision, svn_depth_t depth, svn_ra_session_t *ra_session, svn_client_ctx_t *ctx, apr_pool_t *result_pool, apr_pool_t *scratch_pool){ const char *old_session_url; svn_error_t *err; if (!SVN_IS_VALID_REVNUM(revision)) return SVN_NO_ERROR; if (ra_session) SVN_ERR(svn_ra_get_session_url(ra_session, &old_session_url, scratch_pool)); /* We just wrap a simple helper function, as it is to easy to leave the ra session rooted at some wrong path without a wrapper like this. During development we had problems where some now deleted switched path made the update try to update to that url instead of the intended url */ err = get_inheritable_props(wcroot_iprops, local_abspath, revision, depth, ra_session, ctx, result_pool, scratch_pool); if (ra_session) { err = svn_error_compose_create( err, svn_ra_reparent(ra_session, old_session_url, scratch_pool)); } return svn_error_trace(err);}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:37,
示例6: empty/* (Note: All arguments are in the baton above.) Attempt to revert LOCAL_ABSPATH. If DEPTH is svn_depth_empty, revert just the properties on the directory; else if svn_depth_files, revert the properties and any files immediately under the directory; else if svn_depth_immediates, revert all of the preceding plus properties on immediate subdirectories; else if svn_depth_infinity, revert path and everything under it fully recursively. CHANGELISTS is an array of const char * changelist names, used as a restrictive filter on items reverted; that is, don't revert any item unless it's a member of one of those changelists. If CHANGELISTS is empty (or altogether NULL), no changelist filtering occurs. Consult CTX to determine whether or not to revert timestamp to the time of last commit ('use-commit-times = yes'). If PATH is unversioned, return SVN_ERR_UNVERSIONED_RESOURCE. */static svn_error_t *revert(void *baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool){ struct revert_with_write_lock_baton *b = baton; svn_error_t *err; err = svn_wc_revert4(b->ctx->wc_ctx, b->local_abspath, b->depth, b->use_commit_times, b->changelists, b->ctx->cancel_func, b->ctx->cancel_baton, b->ctx->notify_func2, b->ctx->notify_baton2, scratch_pool); if (err) { /* If target isn't versioned, just send a 'skip' notification and move on. */ if (err->apr_err == SVN_ERR_ENTRY_NOT_FOUND || err->apr_err == SVN_ERR_UNVERSIONED_RESOURCE || err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND) { if (b->ctx->notify_func2) (*b->ctx->notify_func2)( b->ctx->notify_baton2, svn_wc_create_notify(b->local_abspath, svn_wc_notify_skip, scratch_pool), scratch_pool); svn_error_clear(err); } else return svn_error_trace(err); } return SVN_NO_ERROR;}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:57,
示例7: svn_subst_translate_stream3svn_error_t *svn_subst_translate_stream3(svn_stream_t *src_stream, svn_stream_t *dst_stream, const char *eol_str, svn_boolean_t repair, apr_hash_t *keywords, svn_boolean_t expand, apr_pool_t *pool){ /* The docstring requires that *some* translation be requested. */ SVN_ERR_ASSERT(eol_str || keywords); /* We don't want the copy3 to close the provided streams. */ src_stream = svn_stream_disown(src_stream, pool); dst_stream = svn_stream_disown(dst_stream, pool); /* Wrap the destination stream with our translation stream. It is more efficient than wrapping the source stream. */ dst_stream = svn_subst_stream_translated(dst_stream, eol_str, repair, keywords, expand, pool); return svn_error_trace(svn_stream_copy3(src_stream, dst_stream, NULL, NULL, pool));}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:24,
示例8: recursive_proplist_receiver/* An implementation of svn_wc__proplist_receiver_t. */static svn_error_t *recursive_proplist_receiver(void *baton, const char *local_abspath, apr_hash_t *props, apr_pool_t *scratch_pool){ struct recursive_proplist_receiver_baton *b = baton; const char *path; /* Attempt to convert absolute paths to relative paths for * presentation purposes, if needed. */ if (b->anchor && b->anchor_abspath) { path = svn_dirent_join(b->anchor, svn_dirent_skip_ancestor(b->anchor_abspath, local_abspath), scratch_pool); } else path = local_abspath; return svn_error_trace(b->wrapped_receiver(b->wrapped_receiver_baton, path, props, scratch_pool));}
开发者ID:DJEX93,项目名称:dsploit,代码行数:25,
示例9: abort_cb/* This implements svn_editor_cb_abort_t */static svn_error_t *abort_cb(void *baton, apr_pool_t *scratch_pool){ struct edit_baton *eb = baton; svn_error_t *err; /* Don't allow a following call to svn_fs_editor_commit(). */ eb->completed = TRUE; if (eb->root != NULL) { svn_fs_close_root(eb->root); eb->root = NULL; } /* ### should we examine the error and attempt svn_fs_purge_txn() ? */ err = svn_fs_abort_txn(eb->txn, scratch_pool); /* For safety, clear the now-useless txn. */ eb->txn = NULL; return svn_error_trace(err);}
开发者ID:Ranga123,项目名称:test1,代码行数:25,
示例10: hotcopy_io_dir_file_copy/* Like svn_io_dir_file_copy(), but doesn't copy files that exist at * the destination and do not differ in terms of kind, size, and mtime. * Set *SKIPPED_P to FALSE only if the file was copied, do not change * the value in *SKIPPED_P otherwise. SKIPPED_P may be NULL if not * required. */static svn_error_t *hotcopy_io_dir_file_copy(svn_boolean_t *skipped_p, const char *src_path, const char *dst_path, const char *file, apr_pool_t *scratch_pool){ const svn_io_dirent2_t *src_dirent; const svn_io_dirent2_t *dst_dirent; const char *src_target; const char *dst_target; /* Does the destination already exist? If not, we must copy it. */ dst_target = svn_dirent_join(dst_path, file, scratch_pool); SVN_ERR(svn_io_stat_dirent2(&dst_dirent, dst_target, FALSE, TRUE, scratch_pool, scratch_pool)); if (dst_dirent->kind != svn_node_none) { /* If the destination's stat information indicates that the file * is equal to the source, don't bother copying the file again. */ src_target = svn_dirent_join(src_path, file, scratch_pool); SVN_ERR(svn_io_stat_dirent2(&src_dirent, src_target, FALSE, FALSE, scratch_pool, scratch_pool)); if (src_dirent->kind == dst_dirent->kind && src_dirent->special == dst_dirent->special && src_dirent->filesize == dst_dirent->filesize && src_dirent->mtime <= dst_dirent->mtime) return SVN_NO_ERROR; } if (skipped_p) *skipped_p = FALSE; return svn_error_trace(svn_io_dir_file_copy(src_path, dst_path, file, scratch_pool));}
开发者ID:2asoft,项目名称:freebsd,代码行数:41,
示例11: fetch_base_funcstatic svn_error_t *fetch_base_func(const char **filename, void *baton, const char *path, svn_revnum_t base_revision, apr_pool_t *result_pool, apr_pool_t *scratch_pool){ struct revision_baton *rb = baton; svn_stream_t *fstream; svn_error_t *err; if (! SVN_IS_VALID_REVNUM(base_revision)) base_revision = rb->rev - 1; SVN_ERR(svn_stream_open_unique(&fstream, filename, NULL, svn_io_file_del_on_pool_cleanup, result_pool, scratch_pool)); err = svn_ra_get_file(rb->pb->aux_session, path, base_revision, fstream, NULL, NULL, scratch_pool); if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND) { svn_error_clear(err); SVN_ERR(svn_stream_close(fstream)); *filename = NULL; return SVN_NO_ERROR; } else if (err) return svn_error_trace(err); SVN_ERR(svn_stream_close(fstream)); return SVN_NO_ERROR;}
开发者ID:ngkaho1234,项目名称:freebsd,代码行数:36,
示例12: base_hotcopy//.........这里部分代码省略......... /* use the largest multiple of BDB pagesize we can. */ int multiple = SVN__STREAM_CHUNK_SIZE / pagesize; pagesize *= multiple; }#else /* default to 128K chunks, which should be safe. BDB almost certainly uses a power-of-2 pagesize. */ pagesize = (4096 * 32);#endif /* Copy the databases. */ SVN_ERR(copy_db_file_safely(src_path, dest_path, "nodes", pagesize, FALSE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "transactions", pagesize, FALSE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "revisions", pagesize, FALSE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "copies", pagesize, FALSE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "changes", pagesize, FALSE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "representations", pagesize, FALSE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "strings", pagesize, FALSE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "uuids", pagesize, TRUE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "locks", pagesize, TRUE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "lock-tokens", pagesize, TRUE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "node-origins", pagesize, TRUE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "checksum-reps", pagesize, TRUE, pool)); SVN_ERR(copy_db_file_safely(src_path, dest_path, "miscellaneous", pagesize, TRUE, pool)); { apr_array_header_t *logfiles; int idx; apr_pool_t *subpool; SVN_ERR(base_bdb_logfiles(&logfiles, src_path, FALSE, /* All logs */ pool)); /* Process log files. */ subpool = svn_pool_create(pool); for (idx = 0; idx < logfiles->nelts; idx++) { svn_pool_clear(subpool); err = svn_io_dir_file_copy(src_path, dest_path, APR_ARRAY_IDX(logfiles, idx, const char *), subpool); if (err) { if (log_autoremove) return svn_error_quick_wrap (err, _("Error copying logfile; the DB_LOG_AUTOREMOVE feature/n" "may be interfering with the hotcopy algorithm. If/n" "the problem persists, try deactivating this feature/n" "in DB_CONFIG")); else return svn_error_trace(err); } } svn_pool_destroy(subpool); } /* Since this is a copy we will have exclusive access to the repository. */ err = bdb_recover(dest_path, TRUE, pool); if (err) { if (log_autoremove) return svn_error_quick_wrap (err, _("Error running catastrophic recovery on hotcopy; the/n" "DB_LOG_AUTOREMOVE feature may be interfering with the/n" "hotcopy algorithm. If the problem persists, try deactivating/n" "this feature in DB_CONFIG")); else return svn_error_trace(err); } /* Only now that the hotcopied filesystem is complete, stamp it with a format file. */ SVN_ERR(svn_io_write_version_file( svn_dirent_join(dest_path, FORMAT_FILE, pool), format, pool)); if (clean_logs) SVN_ERR(svn_fs_base__clean_logs(src_path, dest_path, pool)); return SVN_NO_ERROR;}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:101,
示例13: handle_external_item_removal/* Called when an external that is in the EXTERNALS table is no longer referenced from an svn:externals property */static svn_error_t *handle_external_item_removal(const svn_client_ctx_t *ctx, const char *defining_abspath, const char *local_abspath, apr_pool_t *scratch_pool){ svn_error_t *err; svn_node_kind_t external_kind; svn_node_kind_t kind; svn_boolean_t removed = FALSE; /* local_abspath should be a wcroot or a file external */ SVN_ERR(svn_wc__read_external_info(&external_kind, NULL, NULL, NULL, NULL, ctx->wc_ctx, defining_abspath, local_abspath, FALSE, scratch_pool, scratch_pool)); SVN_ERR(svn_wc_read_kind2(&kind, ctx->wc_ctx, local_abspath, TRUE, FALSE, scratch_pool)); if (external_kind != kind) external_kind = svn_node_none; /* Only remove the registration */ err = remove_external(&removed, ctx->wc_ctx, defining_abspath, local_abspath, external_kind, ctx->cancel_func, ctx->cancel_baton, scratch_pool); if (err && err->apr_err == SVN_ERR_WC_NOT_LOCKED && removed) { svn_error_clear(err); err = NULL; /* We removed the working copy, so we can't release the lock that was stored inside */ } if (ctx->notify_func2) { svn_wc_notify_t *notify = svn_wc_create_notify(local_abspath, svn_wc_notify_update_external_removed, scratch_pool); notify->kind = kind; notify->err = err; (ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool); if (err && err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD) { notify = svn_wc_create_notify(local_abspath, svn_wc_notify_left_local_modifications, scratch_pool); notify->kind = svn_node_dir; notify->err = err; (ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool); } } if (err && err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD) { svn_error_clear(err); err = NULL; } return svn_error_trace(err);}
开发者ID:ngkaho1234,项目名称:freebsd,代码行数:70,
示例14: ensure_state/* Recursively opens directories on the stack in EB, until LOCAL_ABSPATH is reached. If RECURSIVE_SKIP is TRUE, don't open LOCAL_ABSPATH itself, but create it marked with skip+skip_children. */static svn_error_t *ensure_state(struct diff_baton *eb, const char *local_abspath, svn_boolean_t recursive_skip, apr_pool_t *scratch_pool){ struct node_state_t *ns; apr_pool_t *ns_pool; if (!eb->cur) { if (!svn_dirent_is_ancestor(eb->anchor_abspath, local_abspath)) return SVN_NO_ERROR; SVN_ERR(ensure_state(eb, svn_dirent_dirname(local_abspath,scratch_pool), FALSE, scratch_pool)); } else if (svn_dirent_is_child(eb->cur->local_abspath, local_abspath, NULL)) SVN_ERR(ensure_state(eb, svn_dirent_dirname(local_abspath,scratch_pool), FALSE, scratch_pool)); else return SVN_NO_ERROR; if (eb->cur && eb->cur->skip_children) return SVN_NO_ERROR; ns_pool = svn_pool_create(eb->cur ? eb->cur->pool : eb->pool); ns = apr_pcalloc(ns_pool, sizeof(*ns)); ns->pool = ns_pool; ns->local_abspath = apr_pstrdup(ns_pool, local_abspath); ns->relpath = svn_dirent_skip_ancestor(eb->anchor_abspath, ns->local_abspath); ns->parent = eb->cur; eb->cur = ns; if (recursive_skip) { ns->skip = TRUE; ns->skip_children = TRUE; return SVN_NO_ERROR; } { svn_revnum_t revision; svn_error_t *err; err = svn_wc__db_base_get_info(NULL, NULL, &revision, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, eb->db, local_abspath, scratch_pool, scratch_pool); if (err) { if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND) return svn_error_trace(err); svn_error_clear(err); revision = 0; /* Use original revision? */ } ns->left_src = svn_diff__source_create(revision, ns->pool); ns->right_src = svn_diff__source_create(SVN_INVALID_REVNUM, ns->pool); SVN_ERR(eb->processor->dir_opened(&ns->baton, &ns->skip, &ns->skip_children, ns->relpath, ns->left_src, ns->right_src, NULL /* copyfrom_source */, ns->parent ? ns->parent->baton : NULL, eb->processor, ns->pool, scratch_pool)); } return SVN_NO_ERROR;}
开发者ID:Galiro,项目名称:freebsd,代码行数:82,
示例15: svn_cl__get_log_message//.........这里部分代码省略......... msg_string->len = tmp_message->len; /* Use the external edit to get a log message. */ if (! lmb->non_interactive) { err = svn_cmdline__edit_string_externally(&msg_string, &lmb->tmpfile_left, lmb->editor_cmd, lmb->base_dir ? lmb->base_dir : "", msg_string, "svn-commit", lmb->config, TRUE, lmb->message_encoding, pool); } else /* non_interactive flag says we can't pop up an editor, so error */ { return svn_error_create (SVN_ERR_CL_INSUFFICIENT_ARGS, NULL, _("Cannot invoke editor to get log message " "when non-interactive")); } /* Dup the tmpfile path into its baton's pool. */ *tmp_file = lmb->tmpfile_left = apr_pstrdup(lmb->pool, lmb->tmpfile_left); /* If the edit returned an error, handle it. */ if (err) { if (err->apr_err == SVN_ERR_CL_NO_EXTERNAL_EDITOR) err = svn_error_quick_wrap (err, _("Could not use external editor to fetch log message; " "consider setting the $SVN_EDITOR environment variable " "or using the --message (-m) or --file (-F) options")); return svn_error_trace(err); } if (msg_string) message = svn_stringbuf_create_from_string(msg_string, pool); /* Strip off the EOF marker text and the junk that follows it. */ if (message) truncate_buffer_at_prefix(&message->len, message->data, EDITOR_EOF_PREFIX); /* * Since we're adding freebsd-specific tokens to the log message, * clean out any leftovers to avoid accidently sending them to other * projects that won't be expecting them. */ if (message) cleanmsg(&message->len, message->data); if (message) { /* We did get message, now check if it is anything more than just white space as we will consider white space only as empty */ apr_size_t len; for (len = 0; len < message->len; len++) { /* FIXME: should really use an UTF-8 whitespace test rather than svn_ctype_isspace, which is ASCII only */ if (! svn_ctype_isspace(message->data[len])) break; } if (len == message->len) message = NULL;
开发者ID:2asoft,项目名称:freebsd,代码行数:67,
示例16: relegate_dir_external/* Remove the directory at LOCAL_ABSPATH from revision control, and do the * same to any revision controlled directories underneath LOCAL_ABSPATH * (including directories not referred to by parent svn administrative areas); * then if LOCAL_ABSPATH is empty afterwards, remove it, else rename it to a * unique name in the same parent directory. * * Pass CANCEL_FUNC, CANCEL_BATON to svn_wc_remove_from_revision_control. * * Use SCRATCH_POOL for all temporary allocation. */static svn_error_t *relegate_dir_external(svn_wc_context_t *wc_ctx, const char *wri_abspath, const char *local_abspath, svn_cancel_func_t cancel_func, void *cancel_baton, svn_wc_notify_func2_t notify_func, void *notify_baton, apr_pool_t *scratch_pool){ svn_error_t *err = SVN_NO_ERROR; SVN_ERR(svn_wc__acquire_write_lock(NULL, wc_ctx, local_abspath, FALSE, scratch_pool, scratch_pool)); err = svn_wc__external_remove(wc_ctx, wri_abspath, local_abspath, FALSE, cancel_func, cancel_baton, scratch_pool); if (err && (err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD)) { const char *parent_dir; const char *dirname; const char *new_path; svn_error_clear(err); err = SVN_NO_ERROR; svn_dirent_split(&parent_dir, &dirname, local_abspath, scratch_pool); /* Reserve the new dir name. */ SVN_ERR(svn_io_open_uniquely_named(NULL, &new_path, parent_dir, dirname, ".OLD", svn_io_file_del_none, scratch_pool, scratch_pool)); /* Sigh... We must fall ever so slightly from grace. Ideally, there would be no window, however brief, when we don't have a reservation on the new name. Unfortunately, at least in the Unix (Linux?) version of apr_file_rename(), you can't rename a directory over a file, because it's just calling stdio rename(), which says: ENOTDIR A component used as a directory in oldpath or newpath path is not, in fact, a directory. Or, oldpath is a directory, and newpath exists but is not a directory So instead, we get the name, then remove the file (ugh), then rename the directory, hoping that nobody has gotten that name in the meantime -- which would never happen in real life, so no big deal. */ /* Do our best, but no biggy if it fails. The rename will fail. */ svn_error_clear(svn_io_remove_file2(new_path, TRUE, scratch_pool)); /* Rename. If this is still a working copy we should use the working copy rename function (to release open handles) */ err = svn_wc__rename_wc(wc_ctx, local_abspath, new_path, scratch_pool); if (err && err->apr_err == SVN_ERR_WC_PATH_UNEXPECTED_STATUS) { svn_error_clear(err); /* And if it is no longer a working copy, we should just rename it */ err = svn_io_file_rename(local_abspath, new_path, scratch_pool); } /* ### TODO: We should notify the user about the rename */ if (notify_func) { svn_wc_notify_t *notify; notify = svn_wc_create_notify(err ? local_abspath : new_path, svn_wc_notify_left_local_modifications, scratch_pool); notify->kind = svn_node_dir; notify->err = err; notify_func(notify_baton, notify, scratch_pool); } } return svn_error_trace(err);}
开发者ID:ngkaho1234,项目名称:freebsd,代码行数:96,
示例17: svn_ra_svn__stream_writesvn_error_t *svn_ra_svn__stream_write(svn_ra_svn__stream_t *stream, const char *data, apr_size_t *len){ return svn_error_trace(svn_stream_write(stream->out_stream, data, len));}
开发者ID:2asoft,项目名称:freebsd,代码行数:6,
示例18: copy_one_versioned_file//.........这里部分代码省略......... scratch_pool, scratch_pool)); if (source == NULL) return SVN_NO_ERROR; SVN_ERR(svn_wc_get_pristine_props(&props, wc_ctx, from_abspath, scratch_pool, scratch_pool)); } else { svn_wc_status3_t *status; /* ### hmm. this isn't always a specialfile. this will simply open ### the file readonly if it is a regular file. */ SVN_ERR(svn_subst_read_specialfile(&source, from_abspath, scratch_pool, scratch_pool)); SVN_ERR(svn_wc_prop_list2(&props, wc_ctx, from_abspath, scratch_pool, scratch_pool)); SVN_ERR(svn_wc_status3(&status, wc_ctx, from_abspath, scratch_pool, scratch_pool)); if (status->text_status != svn_wc_status_normal) local_mod = TRUE; } /* We can early-exit if we're creating a special file. */ special = apr_hash_get(props, SVN_PROP_SPECIAL, APR_HASH_KEY_STRING); if (special != NULL) { /* Create the destination as a special file, and copy the source details into the destination stream. */ SVN_ERR(svn_subst_create_specialfile(&dst_stream, to_abspath, scratch_pool, scratch_pool)); return svn_error_trace( svn_stream_copy3(source, dst_stream, NULL, NULL, scratch_pool)); } eol_style = apr_hash_get(props, SVN_PROP_EOL_STYLE, APR_HASH_KEY_STRING); keywords = apr_hash_get(props, SVN_PROP_KEYWORDS, APR_HASH_KEY_STRING); executable = apr_hash_get(props, SVN_PROP_EXECUTABLE, APR_HASH_KEY_STRING); if (eol_style) SVN_ERR(get_eol_style(&style, &eol, eol_style->data, native_eol)); if (local_mod) { /* Use the modified time from the working copy of the file */ SVN_ERR(svn_io_file_affected_time(&tm, from_abspath, scratch_pool)); } else { SVN_ERR(svn_wc__node_get_changed_info(NULL, &tm, NULL, wc_ctx, from_abspath, scratch_pool, scratch_pool)); } if (keywords) { svn_revnum_t changed_rev; const char *suffix; const char *url;
开发者ID:DJEX93,项目名称:dsploit,代码行数:67,
示例19: handle_external_item_change//.........这里部分代码省略......... { (*ctx->notify_func2)( ctx->notify_baton2, svn_wc_create_notify(local_abspath, svn_wc_notify_update_external, scratch_pool), scratch_pool); } if (! old_defining_abspath) { /* The target dir might have multiple components. Guarantee the path leading down to the last component. */ SVN_ERR(svn_io_make_dir_recursively(svn_dirent_dirname(local_abspath, scratch_pool), scratch_pool)); } switch (ext_kind) { case svn_node_dir: SVN_ERR(switch_dir_external(local_abspath, new_loc->url, new_item->url, &(new_item->peg_revision), &(new_item->revision), parent_dir_abspath, timestamp_sleep, ctx, scratch_pool)); break; case svn_node_file: if (strcmp(repos_root_url, new_loc->repos_root_url)) { const char *local_repos_root_url; const char *local_repos_uuid; const char *ext_repos_relpath; svn_error_t *err; /* * The working copy library currently requires that all files * in the working copy have the same repository root URL. * The URL from the file external's definition differs from the * one used by the working copy. As a workaround, replace the * root URL portion of the file external's URL, after making * sure both URLs point to the same repository. See issue #4087. */ err = svn_wc__node_get_repos_info(NULL, NULL, &local_repos_root_url, &local_repos_uuid, ctx->wc_ctx, parent_dir_abspath, scratch_pool, scratch_pool); if (err) { if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND && err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY) return svn_error_trace(err); svn_error_clear(err); local_repos_root_url = NULL; local_repos_uuid = NULL; } ext_repos_relpath = svn_uri_skip_ancestor(new_loc->repos_root_url, new_url, scratch_pool); if (local_repos_uuid == NULL || local_repos_root_url == NULL || ext_repos_relpath == NULL || strcmp(local_repos_uuid, new_loc->repos_uuid) != 0) return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL, _("Unsupported external: URL of file external '%s' " "is not in repository '%s'"), new_url, repos_root_url); new_url = svn_path_url_add_component2(local_repos_root_url, ext_repos_relpath, scratch_pool); SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &new_loc, new_url, NULL, &(new_item->peg_revision), &(new_item->revision), ctx, scratch_pool)); } SVN_ERR(switch_file_external(local_abspath, new_url, &new_item->peg_revision, &new_item->revision, parent_dir_abspath, ra_session, ctx, scratch_pool)); break; default: SVN_ERR_MALFUNCTION(); break; } return SVN_NO_ERROR;}
开发者ID:ngkaho1234,项目名称:freebsd,代码行数:101,
示例20: svn_client__handle_externals//.........这里部分代码省略......... iterpool = svn_pool_create(scratch_pool); SVN_ERR(svn_wc__externals_defined_below(&old_external_defs, ctx->wc_ctx, target_abspath, scratch_pool, iterpool)); for (hi = apr_hash_first(scratch_pool, externals_new); hi; hi = apr_hash_next(hi)) { const char *local_abspath = svn__apr_hash_index_key(hi); const char *desc_text = svn__apr_hash_index_val(hi); svn_depth_t ambient_depth = svn_depth_infinity; svn_pool_clear(iterpool); if (ambient_depths) { const char *ambient_depth_w; ambient_depth_w = apr_hash_get(ambient_depths, local_abspath, svn__apr_hash_index_klen(hi)); if (ambient_depth_w == NULL) { return svn_error_createf( SVN_ERR_WC_CORRUPT, NULL, _("Traversal of '%s' found no ambient depth"), svn_dirent_local_style(local_abspath, scratch_pool)); } else { ambient_depth = svn_depth_from_word(ambient_depth_w); } } SVN_ERR(handle_externals_change(ctx, repos_root_url, timestamp_sleep, local_abspath, desc_text, old_external_defs, ambient_depth, requested_depth, iterpool)); } /* Remove the remaining externals */ for (hi = apr_hash_first(scratch_pool, old_external_defs); hi; hi = apr_hash_next(hi)) { const char *item_abspath = svn__apr_hash_index_key(hi); const char *defining_abspath = svn__apr_hash_index_val(hi); const char *parent_abspath; svn_pool_clear(iterpool); SVN_ERR(wrap_external_error( ctx, item_abspath, handle_external_item_removal(ctx, defining_abspath, item_abspath, iterpool), iterpool)); /* Are there any unversioned directories between the removed * external and the DEFINING_ABSPATH which we can remove? */ parent_abspath = item_abspath; do { svn_node_kind_t kind; parent_abspath = svn_dirent_dirname(parent_abspath, iterpool); SVN_ERR(svn_wc_read_kind2(&kind, ctx->wc_ctx, parent_abspath, FALSE /* show_deleted*/, FALSE /* show_hidden */, iterpool)); if (kind == svn_node_none) { svn_error_t *err; err = svn_io_dir_remove_nonrecursive(parent_abspath, iterpool); if (err) { if (APR_STATUS_IS_ENOTEMPTY(err->apr_err)) { svn_error_clear(err); break; /* No parents to delete */ } else if (APR_STATUS_IS_ENOENT(err->apr_err) || APR_STATUS_IS_ENOTDIR(err->apr_err)) { svn_error_clear(err); /* Fall through; parent dir might be unversioned */ } else return svn_error_trace(err); } } } while (strcmp(parent_abspath, defining_abspath) != 0); } svn_pool_destroy(iterpool); return SVN_NO_ERROR;}
开发者ID:ngkaho1234,项目名称:freebsd,代码行数:101,
示例21: copy_versioned_files//.........这里部分代码省略......... if (is_deleted) return SVN_NO_ERROR; } SVN_ERR(svn_wc_read_kind(&from_kind, ctx->wc_ctx, from_abspath, FALSE, pool)); if (from_kind == svn_node_dir) { apr_fileperms_t perm = APR_OS_DEFAULT; int j; /* Try to make the new directory. If this fails because the directory already exists, check our FORCE flag to see if we care. */ /* Keep the source directory's permissions if applicable. Skip retrieving the umask on windows. Apr does not implement setting filesystem privileges on Windows. Retrieving the file permissions with APR_FINFO_PROT | APR_FINFO_OWNER is documented to be 'incredibly expensive' */#ifndef WIN32 if (revision->kind == svn_opt_revision_working) { apr_finfo_t finfo; SVN_ERR(svn_io_stat(&finfo, from_abspath, APR_FINFO_PROT, pool)); perm = finfo.protection; }#endif err = svn_io_dir_make(to_abspath, perm, pool); if (err) { if (! APR_STATUS_IS_EEXIST(err->apr_err)) return svn_error_trace(err); if (! force) SVN_ERR_W(err, _("Destination directory exists, and will not be " "overwritten unless forced")); else svn_error_clear(err); } SVN_ERR(svn_wc__node_get_children(&children, ctx->wc_ctx, from_abspath, FALSE, pool, pool)); iterpool = svn_pool_create(pool); for (j = 0; j < children->nelts; j++) { const char *child_abspath = APR_ARRAY_IDX(children, j, const char *); const char *child_name = svn_dirent_basename(child_abspath, NULL); const char *target_abspath; svn_node_kind_t child_kind; svn_pool_clear(iterpool); if (ctx->cancel_func) SVN_ERR(ctx->cancel_func(ctx->cancel_baton)); target_abspath = svn_dirent_join(to_abspath, child_name, iterpool); SVN_ERR(svn_wc_read_kind(&child_kind, ctx->wc_ctx, child_abspath, FALSE, iterpool)); if (child_kind == svn_node_dir) { if (depth == svn_depth_infinity || depth == svn_depth_immediates)
开发者ID:DJEX93,项目名称:dsploit,代码行数:67,
示例22: write_change_entry/* Write a single change entry, path PATH, change CHANGE, to STREAM. Only include the node kind field if INCLUDE_NODE_KIND is true. Only include the mergeinfo-mod field if INCLUDE_MERGEINFO_MODS is true. All temporary allocations are in SCRATCH_POOL. */static svn_error_t *write_change_entry(svn_stream_t *stream, const char *path, svn_fs_path_change2_t *change, svn_boolean_t include_node_kind, svn_boolean_t include_mergeinfo_mods, apr_pool_t *scratch_pool){ const char *idstr; const char *change_string = NULL; const char *kind_string = ""; const char *mergeinfo_string = ""; svn_stringbuf_t *buf; apr_size_t len; switch (change->change_kind) { case svn_fs_path_change_modify: change_string = ACTION_MODIFY; break; case svn_fs_path_change_add: change_string = ACTION_ADD; break; case svn_fs_path_change_delete: change_string = ACTION_DELETE; break; case svn_fs_path_change_replace: change_string = ACTION_REPLACE; break; case svn_fs_path_change_reset: change_string = ACTION_RESET; break; default: return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL, _("Invalid change type %d"), change->change_kind); } if (change->node_rev_id) idstr = svn_fs_fs__id_unparse(change->node_rev_id, scratch_pool)->data; else idstr = ACTION_RESET; if (include_node_kind) { SVN_ERR_ASSERT(change->node_kind == svn_node_dir || change->node_kind == svn_node_file); kind_string = apr_psprintf(scratch_pool, "-%s", change->node_kind == svn_node_dir ? SVN_FS_FS__KIND_DIR : SVN_FS_FS__KIND_FILE); } if (include_mergeinfo_mods && change->mergeinfo_mod != svn_tristate_unknown) mergeinfo_string = apr_psprintf(scratch_pool, " %s", change->mergeinfo_mod == svn_tristate_true ? FLAG_TRUE : FLAG_FALSE); buf = svn_stringbuf_createf(scratch_pool, "%s %s%s %s %s%s %s/n", idstr, change_string, kind_string, change->text_mod ? FLAG_TRUE : FLAG_FALSE, change->prop_mod ? FLAG_TRUE : FLAG_FALSE, mergeinfo_string, path); if (SVN_IS_VALID_REVNUM(change->copyfrom_rev)) { svn_stringbuf_appendcstr(buf, apr_psprintf(scratch_pool, "%ld %s", change->copyfrom_rev, change->copyfrom_path)); } svn_stringbuf_appendbyte(buf, '/n'); /* Write all change info in one write call. */ len = buf->len; return svn_error_trace(svn_stream_write(stream, buf->data, &len));}
开发者ID:2asoft,项目名称:freebsd,代码行数:84,
示例23: switch_internal//.........这里部分代码省略......... SVN_RA_CAPABILITY_DEPTH, pool)); dfb.ra_session = ra_session; SVN_ERR(svn_ra_get_session_url(ra_session, &dfb.anchor_url, pool)); dfb.target_revision = revnum; SVN_ERR(svn_wc_get_switch_editor4(&switch_editor, &switch_edit_baton, &revnum, ctx->wc_ctx, anchor_abspath, target, switch_rev_url, use_commit_times, depth, depth_is_sticky, allow_unver_obstructions, server_supports_depth, diff3_cmd, preserved_exts, svn_client__dirent_fetcher, &dfb, ctx->conflict_func2, ctx->conflict_baton2, NULL, NULL, ctx->cancel_func, ctx->cancel_baton, ctx->notify_func2, ctx->notify_baton2, pool, pool)); /* Tell RA to do an update of URL+TARGET to REVISION; if we pass an invalid revnum, that means RA will use the latest revision. */ SVN_ERR(svn_ra_do_switch2(ra_session, &reporter, &report_baton, revnum, target, depth_is_sticky ? depth : svn_depth_unknown, switch_rev_url, switch_editor, switch_edit_baton, pool)); /* Drive the reporter structure, describing the revisions within PATH. When we call reporter->finish_report, the update_editor will be driven by svn_repos_dir_delta2. We pass in an external_func for recording all externals. It shouldn't be needed for a switch if it wasn't for the relative externals of type '../path'. All of those must be resolved to the new location. */ err = svn_wc_crawl_revisions5(ctx->wc_ctx, local_abspath, reporter, report_baton, TRUE, depth, (! depth_is_sticky), (! server_supports_depth), use_commit_times, ctx->cancel_func, ctx->cancel_baton, ctx->notify_func2, ctx->notify_baton2, pool); if (err) { /* Don't rely on the error handling to handle the sleep later, do it now */ svn_io_sleep_for_timestamps(local_abspath, pool); return svn_error_trace(err); } *use_sleep = TRUE; /* We handle externals after the switch is complete, so that handling external items (and any errors therefrom) doesn't delay the primary operation. */ if (SVN_DEPTH_IS_RECURSIVE(depth) && (! ignore_externals)) { apr_hash_t *new_externals; apr_hash_t *new_depths; SVN_ERR(svn_wc__externals_gather_definitions(&new_externals, &new_depths, ctx->wc_ctx, local_abspath, depth, pool, pool)); SVN_ERR(svn_client__handle_externals(new_externals, new_depths, source_root, local_abspath, depth, use_sleep, ctx, pool)); } /* Sleep to ensure timestamp integrity (we do this regardless of errors in the actual switch operation(s)). */ if (sleep_here) svn_io_sleep_for_timestamps(local_abspath, pool); /* Return errors we might have sustained. */ if (err) return svn_error_trace(err); /* Let everyone know we're finished here. */ if (ctx->notify_func2) { svn_wc_notify_t *notify = svn_wc_create_notify(anchor_abspath, svn_wc_notify_update_completed, pool); notify->kind = svn_node_none; notify->content_state = notify->prop_state = svn_wc_notify_state_inapplicable; notify->lock_state = svn_wc_notify_lock_state_inapplicable; notify->revision = revnum; (*ctx->notify_func2)(ctx->notify_baton2, notify, pool); } /* If the caller wants the result revision, give it to them. */ if (result_rev) *result_rev = revnum; return SVN_NO_ERROR;}
开发者ID:AsherBond,项目名称:MondocosmOS-Dependencies,代码行数:101,
示例24: open_pack_or_rev_file/* Core implementation of svn_fs_fs__open_pack_or_rev_file working on an * existing, initialized FILE structure. If WRITABLE is TRUE, give write * access to the file - temporarily resetting the r/o state if necessary. */static svn_error_t *open_pack_or_rev_file(svn_fs_x__revision_file_t *file, svn_fs_t *fs, svn_revnum_t rev, svn_boolean_t writable, apr_pool_t *result_pool, apr_pool_t *scratch_pool){ svn_error_t *err; svn_boolean_t retry = FALSE; do { const char *path = svn_fs_x__path_rev_absolute(fs, rev, scratch_pool); apr_file_t *apr_file; apr_int32_t flags = writable ? APR_READ | APR_WRITE | APR_BUFFERED : APR_READ | APR_BUFFERED; /* We may have to *temporarily* enable write access. */ err = writable ? auto_make_writable(path, result_pool, scratch_pool) : SVN_NO_ERROR; /* open the revision file in buffered r/o or r/w mode */ if (!err) err = svn_io_file_open(&apr_file, path, flags, APR_OS_DEFAULT, result_pool); if (!err) { file->file = apr_file; file->stream = svn_stream_from_aprfile2(apr_file, TRUE, result_pool); return SVN_NO_ERROR; } if (err && APR_STATUS_IS_ENOENT(err->apr_err)) { /* Could not open the file. This may happen if the * file once existed but got packed later. */ svn_error_clear(err); /* if that was our 2nd attempt, leave it at that. */ if (retry) return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL, _("No such revision %ld"), rev); /* We failed for the first time. Refresh cache & retry. */ SVN_ERR(svn_fs_x__update_min_unpacked_rev(fs, scratch_pool)); file->start_revision = svn_fs_x__packed_base_rev(fs, rev); retry = TRUE; } else { retry = FALSE; } } while (retry); return svn_error_trace(err);}
开发者ID:2asoft,项目名称:freebsd,代码行数:67,
注:本文中的svn_error_trace函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ svn_hash_sets函数代码示例 C++ svn_error_createf函数代码示例 |