You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/12/05 04:56:54 UTC
svn commit: r1417276 - in /subversion/branches/ev2-export: ./
subversion/include/ subversion/include/private/ subversion/libsvn_client/
subversion/libsvn_subr/ subversion/libsvn_wc/ subversion/svn/
subversion/tests/libsvn_wc/
Author: hwright
Date: Wed Dec 5 03:56:51 2012
New Revision: 1417276
URL: http://svn.apache.org/viewvc?rev=1417276&view=rev
Log:
On the ev2-export branch:
Bring up-to-date with trunk, accepting the full incoming version of
libsvn_client/export.c, as changes have been manually migrated to trunk.
Added:
subversion/branches/ev2-export/subversion/libsvn_subr/sqlite3wrapper.c
- copied unchanged from r1417271, subversion/trunk/subversion/libsvn_subr/sqlite3wrapper.c
Modified:
subversion/branches/ev2-export/ (props changed)
subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h
subversion/branches/ev2-export/subversion/include/svn_editor.h
subversion/branches/ev2-export/subversion/include/svn_wc.h
subversion/branches/ev2-export/subversion/libsvn_client/add.c
subversion/branches/ev2-export/subversion/libsvn_client/export.c
subversion/branches/ev2-export/subversion/libsvn_client/patch.c
subversion/branches/ev2-export/subversion/libsvn_client/revert.c
subversion/branches/ev2-export/subversion/libsvn_client/switch.c
subversion/branches/ev2-export/subversion/libsvn_subr/sqlite.c
subversion/branches/ev2-export/subversion/libsvn_wc/crop.c
subversion/branches/ev2-export/subversion/libsvn_wc/deprecated.c
subversion/branches/ev2-export/subversion/libsvn_wc/relocate.c
subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c
subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql
subversion/branches/ev2-export/subversion/libsvn_wc/wc.h
subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c
subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h
subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h
subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_update_move.c
subversion/branches/ev2-export/subversion/svn/merge-cmd.c
subversion/branches/ev2-export/subversion/svn/svn.c
subversion/branches/ev2-export/subversion/tests/libsvn_wc/entries-compat.c
Propchange: subversion/branches/ev2-export/
------------------------------------------------------------------------------
Merged /subversion/branches/wc-collate-path:r1407642
Merged /subversion/trunk:r1416745-1417271
Modified: subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/ev2-export/subversion/include/private/svn_wc_private.h Wed Dec 5 03:56:51 2012
@@ -317,14 +317,18 @@ svn_wc__del_tree_conflict(svn_wc_context
const char *victim_abspath,
apr_pool_t *scratch_pool);
-/** Like svn_wc_is_wc_root(), but it doesn't consider switched subdirs or
+/** Check whether LOCAL_ABSPATH has a parent directory that knows about its
+ * existence. Set *IS_WCROOT to FALSE if a parent is found, and to TRUE
+ * if there is no such parent.
+ *
+ * Like svn_wc_is_wc_root2(), but doesn't consider switched subdirs or
* deleted entries as working copy roots.
*/
svn_error_t *
-svn_wc__strictly_is_wc_root(svn_boolean_t *wc_root,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *scratch_pool);
+svn_wc__is_wcroot(svn_boolean_t *is_wcroot,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool);
/** Set @a *wcroot_abspath to the local abspath of the root of the
Modified: subversion/branches/ev2-export/subversion/include/svn_editor.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/include/svn_editor.h?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/include/svn_editor.h (original)
+++ subversion/branches/ev2-export/subversion/include/svn_editor.h Wed Dec 5 03:56:51 2012
@@ -884,8 +884,11 @@ svn_editor_add_absent(svn_editor_t *edit
*
* Alter the properties of the directory at @a relpath.
*
- * @a revision specifies the expected revision of the directory and is
- * used to catch attempts at altering out-of-date directories. If the
+ * @a revision specifies the revision at which the receiver should
+ * expect to find this node. That is, @a relpath at the start of the
+ * whole edit and @a relpath at @a revision must lie within the same
+ * node-rev (aka location history segment). This information may be used
+ * to catch an attempt to alter and out-of-date directory. If the
* directory does not have a corresponding revision in the repository
* (e.g. it has not yet been committed), then @a revision should be
* #SVN_INVALID_REVNUM.
@@ -1004,8 +1007,14 @@ svn_editor_copy(svn_editor_t *editor,
svn_revnum_t replaces_rev);
/** Drive @a editor's #svn_editor_cb_move_t callback.
- * Move the node at @a src_relpath, expected to be identical to revision @a
- * src_revision of that path, to @a dst_relpath.
+ *
+ * Move the node at @a src_relpath to @a dst_relpath.
+ *
+ * @a src_revision specifies the revision at which the receiver should
+ * expect to find this node. That is, @a src_relpath at the start of
+ * the whole edit and @a src_relpath at @a src_revision must lie within
+ * the same node-rev (aka history-segment). This is just like the
+ * revisions specified to svn_editor_delete() and svn_editor_rotate().
*
* For a description of @a replaces_rev, see svn_editor_add_file().
*
Modified: subversion/branches/ev2-export/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/include/svn_wc.h?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/include/svn_wc.h (original)
+++ subversion/branches/ev2-export/subversion/include/svn_wc.h Wed Dec 5 03:56:51 2012
@@ -5404,10 +5404,10 @@ svn_wc_crawl_revisions(const char *path,
*/
/** If @a is_wcroot is not @c NULL, set @a *is_wcroot to @c TRUE if @a
- * local_abspath is the root of the working, otherwise to @c FALSE.
+ * local_abspath is the root of the working copy, otherwise to @c FALSE.
*
* If @a is_switched is not @c NULL, set @a *is_switched to @c TRUE if @a
- * local_abspath is not the root of the working, and switched against its
+ * local_abspath is not the root of the working copy, and switched against its
* parent.
*
* If @a kind is not @c NULL, set @a *kind to the node kind of @a
Modified: subversion/branches/ev2-export/subversion/libsvn_client/add.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/add.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/add.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/add.c Wed Dec 5 03:56:51 2012
@@ -1119,11 +1119,11 @@ svn_client_add5(const char *path,
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
/* See if we're being asked to add a wc-root. That's typically not
- okay, unless we're in "force" mode. svn_wc__strictly_is_wc_root()
+ okay, unless we're in "force" mode. svn_wc__is_wcroot()
will return TRUE even if LOCAL_ABSPATH is a *symlink* to a working
copy root, which is a scenario we want to treat differently. */
- err = svn_wc__strictly_is_wc_root(&is_wc_root, ctx->wc_ctx,
- local_abspath, scratch_pool);
+ err = svn_wc__is_wcroot(&is_wc_root, ctx->wc_ctx, local_abspath,
+ scratch_pool);
if (err)
{
if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND
Modified: subversion/branches/ev2-export/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/export.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/export.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/export.c Wed Dec 5 03:56:51 2012
@@ -43,8 +43,12 @@
#include "svn_private_config.h"
#include "private/svn_subr_private.h"
-#include "private/svn_wc_private.h"
#include "private/svn_delta_private.h"
+#include "private/svn_wc_private.h"
+
+#ifndef ENABLE_EV2_IMPL
+#define ENABLE_EV2_IMPL 0
+#endif
/*** Code. ***/
@@ -509,6 +513,356 @@ struct edit_baton
};
+struct dir_baton
+{
+ struct edit_baton *edit_baton;
+ const char *path;
+};
+
+
+struct file_baton
+{
+ struct edit_baton *edit_baton;
+
+ const char *path;
+ const char *tmppath;
+
+ /* We need to keep this around so we can explicitly close it in close_file,
+ thus flushing its output to disk so we can copy and translate it. */
+ svn_stream_t *tmp_stream;
+
+ /* The MD5 digest of the file's fulltext. This is all zeros until
+ the last textdelta window handler call returns. */
+ unsigned char text_digest[APR_MD5_DIGESTSIZE];
+
+ /* The three svn: properties we might actually care about. */
+ const svn_string_t *eol_style_val;
+ const svn_string_t *keywords_val;
+ const svn_string_t *executable_val;
+ svn_boolean_t special;
+
+ /* Any keyword vals to be substituted */
+ const char *revision;
+ const char *url;
+ const char *author;
+ apr_time_t date;
+
+ /* Pool associated with this baton. */
+ apr_pool_t *pool;
+};
+
+
+struct handler_baton
+{
+ svn_txdelta_window_handler_t apply_handler;
+ void *apply_baton;
+ apr_pool_t *pool;
+ const char *tmppath;
+};
+
+
+static svn_error_t *
+set_target_revision(void *edit_baton,
+ svn_revnum_t target_revision,
+ apr_pool_t *pool)
+{
+ struct edit_baton *eb = edit_baton;
+
+ /* Stashing a target_revision in the baton */
+ *(eb->target_revision) = target_revision;
+ return SVN_NO_ERROR;
+}
+
+
+
+/* Just ensure that the main export directory exists. */
+static svn_error_t *
+open_root(void *edit_baton,
+ svn_revnum_t base_revision,
+ apr_pool_t *pool,
+ void **root_baton)
+{
+ struct edit_baton *eb = edit_baton;
+ struct dir_baton *db = apr_pcalloc(pool, sizeof(*db));
+
+ SVN_ERR(open_root_internal(eb->root_path, eb->force,
+ eb->notify_func, eb->notify_baton, pool));
+
+ /* Build our dir baton. */
+ db->path = eb->root_path;
+ db->edit_baton = eb;
+ *root_baton = db;
+
+ return SVN_NO_ERROR;
+}
+
+
+/* Ensure the directory exists, and send feedback. */
+static svn_error_t *
+add_directory(const char *path,
+ void *parent_baton,
+ const char *copyfrom_path,
+ svn_revnum_t copyfrom_revision,
+ apr_pool_t *pool,
+ void **baton)
+{
+ struct dir_baton *pb = parent_baton;
+ struct dir_baton *db = apr_pcalloc(pool, sizeof(*db));
+ struct edit_baton *eb = pb->edit_baton;
+ const char *full_path = svn_dirent_join(eb->root_path, path, pool);
+ svn_node_kind_t kind;
+
+ SVN_ERR(svn_io_check_path(full_path, &kind, pool));
+ if (kind == svn_node_none)
+ SVN_ERR(svn_io_dir_make(full_path, APR_OS_DEFAULT, pool));
+ else if (kind == svn_node_file)
+ return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
+ _("'%s' exists and is not a directory"),
+ svn_dirent_local_style(full_path, pool));
+ else if (! (kind == svn_node_dir && eb->force))
+ return svn_error_createf(SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
+ _("'%s' already exists"),
+ svn_dirent_local_style(full_path, pool));
+
+ if (eb->notify_func)
+ {
+ svn_wc_notify_t *notify = svn_wc_create_notify(full_path,
+ svn_wc_notify_update_add,
+ pool);
+ notify->kind = svn_node_dir;
+ (*eb->notify_func)(eb->notify_baton, notify, pool);
+ }
+
+ /* Build our dir baton. */
+ db->path = full_path;
+ db->edit_baton = eb;
+ *baton = db;
+
+ return SVN_NO_ERROR;
+}
+
+
+/* Build a file baton. */
+static svn_error_t *
+add_file(const char *path,
+ void *parent_baton,
+ const char *copyfrom_path,
+ svn_revnum_t copyfrom_revision,
+ apr_pool_t *pool,
+ void **baton)
+{
+ struct dir_baton *pb = parent_baton;
+ struct edit_baton *eb = pb->edit_baton;
+ struct file_baton *fb = apr_pcalloc(pool, sizeof(*fb));
+ const char *full_path = svn_dirent_join(eb->root_path, path, pool);
+
+ /* PATH is not canonicalized, i.e. it may still contain spaces etc.
+ * but EB->root_url is. */
+ const char *full_url = svn_path_url_add_component2(eb->root_url,
+ path,
+ pool);
+
+ fb->edit_baton = eb;
+ fb->path = full_path;
+ fb->url = full_url;
+ fb->pool = pool;
+
+ *baton = fb;
+ return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+window_handler(svn_txdelta_window_t *window, void *baton)
+{
+ struct handler_baton *hb = baton;
+ svn_error_t *err;
+
+ err = hb->apply_handler(window, hb->apply_baton);
+ if (err)
+ {
+ /* We failed to apply the patch; clean up the temporary file. */
+ err = svn_error_compose_create(
+ err,
+ svn_io_remove_file2(hb->tmppath, TRUE, hb->pool));
+ }
+
+ return svn_error_trace(err);
+}
+
+
+
+/* Write incoming data into the tmpfile stream */
+static svn_error_t *
+apply_textdelta(void *file_baton,
+ const char *base_checksum,
+ apr_pool_t *pool,
+ svn_txdelta_window_handler_t *handler,
+ void **handler_baton)
+{
+ struct file_baton *fb = file_baton;
+ struct handler_baton *hb = apr_palloc(pool, sizeof(*hb));
+
+ /* Create a temporary file in the same directory as the file. We're going
+ to rename the thing into place when we're done. */
+ SVN_ERR(svn_stream_open_unique(&fb->tmp_stream, &fb->tmppath,
+ svn_dirent_dirname(fb->path, pool),
+ svn_io_file_del_none, fb->pool, fb->pool));
+
+ hb->pool = pool;
+ hb->tmppath = fb->tmppath;
+
+ /* svn_txdelta_apply() closes the stream, but we want to close it in the
+ close_file() function, so disown it here. */
+ /* ### contrast to when we call svn_ra_get_file() which does NOT close the
+ ### tmp_stream. we *should* be much more consistent! */
+ svn_txdelta_apply(svn_stream_empty(pool),
+ svn_stream_disown(fb->tmp_stream, pool),
+ fb->text_digest, NULL, pool,
+ &hb->apply_handler, &hb->apply_baton);
+
+ *handler_baton = hb;
+ *handler = window_handler;
+ return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+change_file_prop(void *file_baton,
+ const char *name,
+ const svn_string_t *value,
+ apr_pool_t *pool)
+{
+ struct file_baton *fb = file_baton;
+
+ if (! value)
+ return SVN_NO_ERROR;
+
+ /* Store only the magic three properties. */
+ if (strcmp(name, SVN_PROP_EOL_STYLE) == 0)
+ fb->eol_style_val = svn_string_dup(value, fb->pool);
+
+ else if (! fb->edit_baton->ignore_keywords &&
+ strcmp(name, SVN_PROP_KEYWORDS) == 0)
+ fb->keywords_val = svn_string_dup(value, fb->pool);
+
+ else if (strcmp(name, SVN_PROP_EXECUTABLE) == 0)
+ fb->executable_val = svn_string_dup(value, fb->pool);
+
+ /* Try to fill out the baton's keywords-structure too. */
+ else if (strcmp(name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
+ fb->revision = apr_pstrdup(fb->pool, value->data);
+
+ else if (strcmp(name, SVN_PROP_ENTRY_COMMITTED_DATE) == 0)
+ SVN_ERR(svn_time_from_cstring(&fb->date, value->data, fb->pool));
+
+ else if (strcmp(name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
+ fb->author = apr_pstrdup(fb->pool, value->data);
+
+ else if (strcmp(name, SVN_PROP_SPECIAL) == 0)
+ fb->special = TRUE;
+
+ return SVN_NO_ERROR;
+}
+
+
+static svn_error_t *
+change_dir_prop(void *dir_baton,
+ const char *name,
+ const svn_string_t *value,
+ apr_pool_t *pool)
+{
+ struct dir_baton *db = dir_baton;
+ struct edit_baton *eb = db->edit_baton;
+
+ if (value && (strcmp(name, SVN_PROP_EXTERNALS) == 0))
+ SVN_ERR(add_externals(eb->externals, db->path, value));
+
+ return SVN_NO_ERROR;
+}
+
+
+/* Move the tmpfile to file, and send feedback. */
+static svn_error_t *
+close_file(void *file_baton,
+ const char *text_digest,
+ apr_pool_t *pool)
+{
+ struct file_baton *fb = file_baton;
+ struct edit_baton *eb = fb->edit_baton;
+ svn_checksum_t *text_checksum;
+ svn_checksum_t *actual_checksum;
+
+ /* Was a txdelta even sent? */
+ if (! fb->tmppath)
+ return SVN_NO_ERROR;
+
+ SVN_ERR(svn_stream_close(fb->tmp_stream));
+
+ SVN_ERR(svn_checksum_parse_hex(&text_checksum, svn_checksum_md5, text_digest,
+ pool));
+ actual_checksum = svn_checksum__from_digest_md5(fb->text_digest, pool);
+
+ /* Note that text_digest can be NULL when talking to certain repositories.
+ In that case text_checksum will be NULL and the following match code
+ will note that the checksums match */
+ if (!svn_checksum_match(text_checksum, actual_checksum))
+ return svn_checksum_mismatch_err(text_checksum, actual_checksum, pool,
+ _("Checksum mismatch for '%s'"),
+ svn_dirent_local_style(fb->path, pool));
+
+ if ((! fb->eol_style_val) && (! fb->keywords_val) && (! fb->special))
+ {
+ SVN_ERR(svn_io_file_rename(fb->tmppath, fb->path, pool));
+ }
+ else
+ {
+ svn_subst_eol_style_t style;
+ const char *eol = NULL;
+ svn_boolean_t repair = FALSE;
+ apr_hash_t *final_kw = NULL;
+
+ if (fb->eol_style_val)
+ {
+ SVN_ERR(get_eol_style(&style, &eol, fb->eol_style_val->data,
+ eb->native_eol));
+ repair = TRUE;
+ }
+
+ if (fb->keywords_val)
+ SVN_ERR(svn_subst_build_keywords2(&final_kw, fb->keywords_val->data,
+ fb->revision, fb->url, fb->date,
+ fb->author, pool));
+
+ SVN_ERR(svn_subst_copy_and_translate4(fb->tmppath, fb->path,
+ eol, repair, final_kw,
+ TRUE, /* expand */
+ fb->special,
+ eb->cancel_func, eb->cancel_baton,
+ pool));
+
+ SVN_ERR(svn_io_remove_file2(fb->tmppath, FALSE, pool));
+ }
+
+ if (fb->executable_val)
+ SVN_ERR(svn_io_set_file_executable(fb->path, TRUE, FALSE, pool));
+
+ if (fb->date && (! fb->special))
+ SVN_ERR(svn_io_set_file_affected_time(fb->date, fb->path, pool));
+
+ if (fb->edit_baton->notify_func)
+ {
+ svn_wc_notify_t *notify = svn_wc_create_notify(fb->path,
+ svn_wc_notify_update_add,
+ pool);
+ notify->kind = svn_node_file;
+ (*fb->edit_baton->notify_func)(fb->edit_baton->notify_baton, notify,
+ pool);
+ }
+
+ return SVN_NO_ERROR;
+}
+
static svn_error_t *
fetch_props_func(apr_hash_t **props,
void *baton,
@@ -539,13 +893,46 @@ fetch_base_func(const char **filename,
}
static svn_error_t *
-add_file(void *baton,
- const char *relpath,
- const svn_checksum_t *checksum,
- svn_stream_t *contents,
- apr_hash_t *props,
- svn_revnum_t replaces_rev,
- apr_pool_t *scratch_pool)
+get_editor_ev1(const svn_delta_editor_t **export_editor,
+ void **edit_baton,
+ struct edit_baton *eb,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_delta_editor_t *editor = svn_delta_default_editor(result_pool);
+
+ editor->set_target_revision = set_target_revision;
+ editor->open_root = open_root;
+ editor->add_directory = add_directory;
+ editor->add_file = add_file;
+ editor->apply_textdelta = apply_textdelta;
+ editor->close_file = close_file;
+ editor->change_file_prop = change_file_prop;
+ editor->change_dir_prop = change_dir_prop;
+
+ SVN_ERR(svn_delta_get_cancellation_editor(ctx->cancel_func,
+ ctx->cancel_baton,
+ editor,
+ eb,
+ export_editor,
+ edit_baton,
+ result_pool));
+
+ return SVN_NO_ERROR;
+}
+
+
+/*** The Ev2 Implementation ***/
+
+static svn_error_t *
+add_file_ev2(void *baton,
+ const char *relpath,
+ const svn_checksum_t *checksum,
+ svn_stream_t *contents,
+ apr_hash_t *props,
+ svn_revnum_t replaces_rev,
+ apr_pool_t *scratch_pool)
{
struct edit_baton *eb = baton;
const char *full_path = svn_dirent_join(eb->root_path, relpath,
@@ -669,12 +1056,12 @@ add_file(void *baton,
}
static svn_error_t *
-add_directory(void *baton,
- const char *relpath,
- const apr_array_header_t *children,
- apr_hash_t *props,
- svn_revnum_t replaces_rev,
- apr_pool_t *scratch_pool)
+add_directory_ev2(void *baton,
+ const char *relpath,
+ const apr_array_header_t *children,
+ apr_hash_t *props,
+ svn_revnum_t replaces_rev,
+ apr_pool_t *scratch_pool)
{
struct edit_baton *eb = baton;
svn_node_kind_t kind;
@@ -722,12 +1109,12 @@ target_revision_func(void *baton,
}
static svn_error_t *
-get_editor(const svn_delta_editor_t **export_editor,
- void **edit_baton,
- struct edit_baton *eb,
- svn_client_ctx_t *ctx,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+get_editor_ev2(const svn_delta_editor_t **export_editor,
+ void **edit_baton,
+ struct edit_baton *eb,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_editor_t *editor;
struct svn_delta__extra_baton *exb = apr_pcalloc(result_pool, sizeof(*exb));
@@ -739,9 +1126,9 @@ get_editor(const svn_delta_editor_t **ex
SVN_ERR(svn_editor_create(&editor, eb, ctx->cancel_func, ctx->cancel_baton,
result_pool, scratch_pool));
- SVN_ERR(svn_editor_setcb_add_directory(editor, add_directory,
+ SVN_ERR(svn_editor_setcb_add_directory(editor, add_directory_ev2,
scratch_pool));
- SVN_ERR(svn_editor_setcb_add_file(editor, add_file, scratch_pool));
+ SVN_ERR(svn_editor_setcb_add_file(editor, add_file_ev2, scratch_pool));
*found_abs_paths = TRUE;
@@ -759,6 +1146,226 @@ get_editor(const svn_delta_editor_t **ex
return SVN_NO_ERROR;
}
+static svn_error_t *
+export_file_ev2(const char *from_path_or_url,
+ const char *to_path,
+ struct edit_baton *eb,
+ svn_client__pathrev_t *loc,
+ svn_ra_session_t *ra_session,
+ svn_boolean_t overwrite,
+ apr_pool_t *scratch_pool)
+{
+ svn_boolean_t from_is_url = svn_path_is_url(from_path_or_url);
+ apr_hash_t *props;
+ svn_stream_t *tmp_stream;
+ svn_node_kind_t to_kind;
+
+ if (svn_path_is_empty(to_path))
+ {
+ if (from_is_url)
+ to_path = svn_uri_basename(from_path_or_url, scratch_pool);
+ else
+ to_path = svn_dirent_basename(from_path_or_url, NULL);
+ eb->root_path = to_path;
+ }
+ else
+ {
+ SVN_ERR(append_basename_if_dir(&to_path, from_path_or_url,
+ from_is_url, scratch_pool));
+ eb->root_path = to_path;
+ }
+
+ SVN_ERR(svn_io_check_path(to_path, &to_kind, scratch_pool));
+
+ if ((to_kind == svn_node_file || to_kind == svn_node_unknown) &&
+ ! overwrite)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("Destination file '%s' exists, and "
+ "will not be overwritten unless forced"),
+ svn_dirent_local_style(to_path, scratch_pool));
+ else if (to_kind == svn_node_dir)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("Destination '%s' exists. Cannot "
+ "overwrite directory with non-directory"),
+ svn_dirent_local_style(to_path, scratch_pool));
+
+ tmp_stream = svn_stream_buffered(scratch_pool);
+
+ SVN_ERR(svn_ra_get_file(ra_session, "", loc->rev,
+ tmp_stream, NULL, &props, scratch_pool));
+
+ /* Since you cannot actually root an editor at a file, we manually drive
+ * a function of our editor. */
+ SVN_ERR(add_file_ev2(eb, "", NULL, tmp_stream, props, SVN_INVALID_REVNUM,
+ scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+export_file(const char *from_path_or_url,
+ const char *to_path,
+ struct edit_baton *eb,
+ svn_client__pathrev_t *loc,
+ svn_ra_session_t *ra_session,
+ svn_boolean_t overwrite,
+ apr_pool_t *scratch_pool)
+{
+ apr_hash_t *props;
+ apr_hash_index_t *hi;
+ struct file_baton *fb = apr_pcalloc(scratch_pool, sizeof(*fb));
+ svn_node_kind_t to_kind;
+ svn_boolean_t from_is_url = svn_path_is_url(from_path_or_url);
+
+ if (svn_path_is_empty(to_path))
+ {
+ if (from_is_url)
+ to_path = svn_uri_basename(from_path_or_url, scratch_pool);
+ else
+ to_path = svn_dirent_basename(from_path_or_url, NULL);
+ eb->root_path = to_path;
+ }
+ else
+ {
+ SVN_ERR(append_basename_if_dir(&to_path, from_path_or_url,
+ from_is_url, scratch_pool));
+ eb->root_path = to_path;
+ }
+
+ SVN_ERR(svn_io_check_path(to_path, &to_kind, scratch_pool));
+
+ if ((to_kind == svn_node_file || to_kind == svn_node_unknown) &&
+ ! overwrite)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("Destination file '%s' exists, and "
+ "will not be overwritten unless forced"),
+ svn_dirent_local_style(to_path, scratch_pool));
+ else if (to_kind == svn_node_dir)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("Destination '%s' exists. Cannot "
+ "overwrite directory with non-directory"),
+ svn_dirent_local_style(to_path, scratch_pool));
+
+ /* Since you cannot actually root an editor at a file, we
+ * manually drive a few functions of our editor. */
+
+ /* This is the equivalent of a parentless add_file(). */
+ fb->edit_baton = eb;
+ fb->path = eb->root_path;
+ fb->url = eb->root_url;
+ fb->pool = scratch_pool;
+
+ /* Copied from apply_textdelta(). */
+ SVN_ERR(svn_stream_open_unique(&fb->tmp_stream, &fb->tmppath,
+ svn_dirent_dirname(fb->path, scratch_pool),
+ svn_io_file_del_none,
+ fb->pool, fb->pool));
+
+ /* Step outside the editor-likeness for a moment, to actually talk
+ * to the repository. */
+ /* ### note: the stream will not be closed */
+ SVN_ERR(svn_ra_get_file(ra_session, "", loc->rev,
+ fb->tmp_stream,
+ NULL, &props, scratch_pool));
+
+ /* Push the props into change_file_prop(), to update the file_baton
+ * with information. */
+ for (hi = apr_hash_first(scratch_pool, props); hi; hi = apr_hash_next(hi))
+ {
+ const char *propname = svn__apr_hash_index_key(hi);
+ const svn_string_t *propval = svn__apr_hash_index_val(hi);
+
+ SVN_ERR(change_file_prop(fb, propname, propval, scratch_pool));
+ }
+
+ /* And now just use close_file() to do all the keyword and EOL
+ * work, and put the file into place. */
+ SVN_ERR(close_file(fb, NULL, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+export_directory(const char *from_path_or_url,
+ const char *to_path,
+ struct edit_baton *eb,
+ svn_client__pathrev_t *loc,
+ svn_ra_session_t *ra_session,
+ svn_boolean_t overwrite,
+ svn_boolean_t ignore_externals,
+ svn_boolean_t ignore_keywords,
+ svn_depth_t depth,
+ const char *native_eol,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
+{
+ void *edit_baton;
+ const svn_delta_editor_t *export_editor;
+ const svn_ra_reporter3_t *reporter;
+ void *report_baton;
+ svn_boolean_t use_sleep = FALSE;
+ svn_node_kind_t kind;
+
+ if (!ENABLE_EV2_IMPL)
+ SVN_ERR(get_editor_ev1(&export_editor, &edit_baton, eb, ctx,
+ scratch_pool, scratch_pool));
+ else
+ SVN_ERR(get_editor_ev2(&export_editor, &edit_baton, eb, ctx,
+ scratch_pool, scratch_pool));
+
+ /* Manufacture a basic 'report' to the update reporter. */
+ SVN_ERR(svn_ra_do_update2(ra_session,
+ &reporter, &report_baton,
+ loc->rev,
+ "", /* no sub-target */
+ depth,
+ FALSE, /* don't want copyfrom-args */
+ export_editor, edit_baton, scratch_pool));
+
+ SVN_ERR(reporter->set_path(report_baton, "", loc->rev,
+ /* Depth is irrelevant, as we're
+ passing start_empty=TRUE anyway. */
+ svn_depth_infinity,
+ TRUE, /* "help, my dir is empty!" */
+ NULL, scratch_pool));
+
+ SVN_ERR(reporter->finish_report(report_baton, scratch_pool));
+
+ /* Special case: Due to our sly export/checkout method of updating an
+ * empty directory, no target will have been created if the exported
+ * item is itself an empty directory (export_editor->open_root never
+ * gets called, because there are no "changes" to make to the empty
+ * dir we reported to the repository).
+ *
+ * So we just create the empty dir manually; but we do it via
+ * open_root_internal(), in order to get proper notification.
+ */
+ SVN_ERR(svn_io_check_path(to_path, &kind, scratch_pool));
+ if (kind == svn_node_none)
+ SVN_ERR(open_root_internal
+ (to_path, overwrite, ctx->notify_func2,
+ ctx->notify_baton2, scratch_pool));
+
+ if (! ignore_externals && depth == svn_depth_infinity)
+ {
+ const char *repos_root_url;
+ const char *to_abspath;
+
+ SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root_url,
+ scratch_pool));
+ SVN_ERR(svn_dirent_get_absolute(&to_abspath, to_path, scratch_pool));
+ SVN_ERR(svn_client__export_externals(eb->externals,
+ from_path_or_url,
+ to_abspath, repos_root_url,
+ depth, native_eol,
+ ignore_keywords, &use_sleep,
+ ctx, scratch_pool));
+ }
+
+ return SVN_NO_ERROR;
+}
+
+
/*** Public Interfaces ***/
@@ -819,108 +1426,19 @@ svn_client_export5(svn_revnum_t *result_
if (kind == svn_node_file)
{
- apr_hash_t *props;
- svn_stream_t *tmp_stream;
- svn_node_kind_t to_kind;
-
- if (svn_path_is_empty(to_path))
- {
- if (from_is_url)
- to_path = svn_uri_basename(from_path_or_url, pool);
- else
- to_path = svn_dirent_basename(from_path_or_url, NULL);
- eb->root_path = to_path;
- }
+ if (!ENABLE_EV2_IMPL)
+ SVN_ERR(export_file(from_path_or_url, to_path, eb, loc, ra_session,
+ overwrite, pool));
else
- {
- SVN_ERR(append_basename_if_dir(&to_path, from_path_or_url,
- from_is_url, pool));
- eb->root_path = to_path;
- }
-
- SVN_ERR(svn_io_check_path(to_path, &to_kind, pool));
-
- if ((to_kind == svn_node_file || to_kind == svn_node_unknown) &&
- ! overwrite)
- return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
- _("Destination file '%s' exists, and "
- "will not be overwritten unless forced"),
- svn_dirent_local_style(to_path, pool));
- else if (to_kind == svn_node_dir)
- return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
- _("Destination '%s' exists. Cannot "
- "overwrite directory with non-directory"),
- svn_dirent_local_style(to_path, pool));
-
- tmp_stream = svn_stream_buffered(pool);
-
- SVN_ERR(svn_ra_get_file(ra_session, "", loc->rev,
- tmp_stream, NULL, &props, pool));
-
- /* Since you cannot actually root an editor at a file, we
- * manually drive a function of our editor. */
- SVN_ERR(add_file(eb, "", NULL, tmp_stream, props,
- SVN_INVALID_REVNUM, pool));
+ SVN_ERR(export_file_ev2(from_path_or_url, to_path, eb, loc,
+ ra_session, overwrite, pool));
}
else if (kind == svn_node_dir)
{
- void *edit_baton;
- const svn_delta_editor_t *export_editor;
- const svn_ra_reporter3_t *reporter;
- void *report_baton;
- svn_boolean_t use_sleep = FALSE;
-
- SVN_ERR(get_editor(&export_editor, &edit_baton, eb, ctx,
- pool, pool));
-
- /* Manufacture a basic 'report' to the update reporter. */
- SVN_ERR(svn_ra_do_update2(ra_session,
- &reporter, &report_baton,
- loc->rev,
- "", /* no sub-target */
- depth,
- FALSE, /* don't want copyfrom-args */
- export_editor, edit_baton, pool));
-
- SVN_ERR(reporter->set_path(report_baton, "", loc->rev,
- /* Depth is irrelevant, as we're
- passing start_empty=TRUE anyway. */
- svn_depth_infinity,
- TRUE, /* "help, my dir is empty!" */
- NULL, pool));
-
- SVN_ERR(reporter->finish_report(report_baton, pool));
-
- /* Special case: Due to our sly export/checkout method of
- * updating an empty directory, no target will have been created
- * if the exported item is itself an empty directory
- * (export_editor->open_root never gets called, because there
- * are no "changes" to make to the empty dir we reported to the
- * repository).
- *
- * So we just create the empty dir manually; but we do it via
- * open_root_internal(), in order to get proper notification.
- */
- SVN_ERR(svn_io_check_path(to_path, &kind, pool));
- if (kind == svn_node_none)
- SVN_ERR(open_root_internal
- (to_path, overwrite, ctx->notify_func2,
- ctx->notify_baton2, pool));
-
- if (! ignore_externals && depth == svn_depth_infinity)
- {
- const char *repos_root_url;
- const char *to_abspath;
-
- SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_root_url, pool));
- SVN_ERR(svn_dirent_get_absolute(&to_abspath, to_path, pool));
- SVN_ERR(svn_client__export_externals(eb->externals,
- from_path_or_url,
- to_abspath, repos_root_url,
- depth, native_eol,
- ignore_keywords, &use_sleep,
- ctx, pool));
- }
+ SVN_ERR(export_directory(from_path_or_url, to_path,
+ eb, loc, ra_session, overwrite,
+ ignore_externals, ignore_keywords, depth,
+ native_eol, ctx, pool));
}
else if (kind == svn_node_none)
{
Modified: subversion/branches/ev2-export/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/patch.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/patch.c Wed Dec 5 03:56:51 2012
@@ -2617,8 +2617,8 @@ check_dir_empty(svn_boolean_t *empty, co
int i;
/* Working copy root cannot be deleted, so never consider it empty. */
- SVN_ERR(svn_wc__strictly_is_wc_root(&is_wc_root, wc_ctx, local_abspath,
- scratch_pool));
+ SVN_ERR(svn_wc__is_wcroot(&is_wc_root, wc_ctx, local_abspath,
+ scratch_pool));
if (is_wc_root)
{
*empty = FALSE;
Modified: subversion/branches/ev2-export/subversion/libsvn_client/revert.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/revert.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/revert.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/revert.c Wed Dec 5 03:56:51 2012
@@ -166,8 +166,8 @@ svn_client_revert2(const apr_array_heade
baton.changelists = changelists;
baton.ctx = ctx;
- SVN_ERR(svn_wc__strictly_is_wc_root(&wc_root, ctx->wc_ctx,
- local_abspath, pool));
+ SVN_ERR(svn_wc__is_wcroot(&wc_root, ctx->wc_ctx, local_abspath,
+ pool));
lock_target = wc_root ? local_abspath
: svn_dirent_dirname(local_abspath, pool);
err = svn_wc__call_with_write_lock(revert, &baton, ctx->wc_ctx,
Modified: subversion/branches/ev2-export/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_client/switch.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_client/switch.c Wed Dec 5 03:56:51 2012
@@ -231,10 +231,8 @@ switch_internal(svn_revnum_t *result_rev
svn_boolean_t wc_root;
svn_boolean_t needs_iprop_cache = TRUE;
- SVN_ERR(svn_wc__strictly_is_wc_root(&wc_root,
- ctx->wc_ctx,
- local_abspath,
- pool));
+ SVN_ERR(svn_wc__is_wcroot(&wc_root, ctx->wc_ctx, local_abspath,
+ pool));
/* Switching the WC root to anything but the repos root means
we need an iprop cache. */
Modified: subversion/branches/ev2-export/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_subr/sqlite.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_subr/sqlite.c Wed Dec 5 03:56:51 2012
@@ -43,14 +43,17 @@
#endif
#ifdef SVN_SQLITE_INLINE
-/* Include sqlite3 inline, making all symbols private. */
- #define SQLITE_API static
- #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
- #pragma GCC diagnostic ignored "-Wunused-function"
- #endif
- #include <sqlite3.c>
+/* Import the sqlite3 API vtable from sqlite3wrapper.c */
+# define SQLITE_OMIT_DEPRECATED
+# include <sqlite3ext.h>
+extern const sqlite3_api_routines *const svn_sqlite3__api_funcs;
+extern int (*const svn_sqlite3__api_initialize)(void);
+extern int (*const svn_sqlite3__api_config)(int, ...);
+# define sqlite3_api svn_sqlite3__api_funcs
+# define sqlite3_initialize svn_sqlite3__api_initialize
+# define sqlite3_config svn_sqlite3__api_config
#else
- #include <sqlite3.h>
+# include <sqlite3.h>
#endif
#if !SQLITE_VERSION_AT_LEAST(3,7,12)
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/crop.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/crop.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/crop.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/crop.c Wed Dec 5 03:56:51 2012
@@ -196,8 +196,8 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
svn_revnum_t revision;
const char *repos_relpath, *repos_root, *repos_uuid;
- SVN_ERR(svn_wc__check_wc_root(&is_root, NULL, &is_switched,
- wc_ctx->db, local_abspath, scratch_pool));
+ SVN_ERR(svn_wc__db_is_switched(&is_root, &is_switched, NULL,
+ wc_ctx->db, local_abspath, scratch_pool));
if (is_root)
{
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/deprecated.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/deprecated.c Wed Dec 5 03:56:51 2012
@@ -3211,8 +3211,8 @@ svn_wc_is_wc_root2(svn_boolean_t *wc_roo
svn_error_t *err;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
- err = svn_wc__check_wc_root(&is_root, &kind, &is_switched,
- wc_ctx->db, local_abspath, scratch_pool);
+ err = svn_wc__db_is_switched(&is_root, &is_switched, &kind,
+ wc_ctx->db, local_abspath, scratch_pool);
if (err)
{
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/relocate.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/relocate.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/relocate.c Wed Dec 5 03:56:51 2012
@@ -94,8 +94,8 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
const char *uuid;
svn_boolean_t is_wc_root;
- SVN_ERR(svn_wc__strictly_is_wc_root(&is_wc_root, wc_ctx, local_abspath,
- scratch_pool));
+ SVN_ERR(svn_wc__is_wcroot(&is_wc_root, wc_ctx, local_abspath,
+ scratch_pool));
if (! is_wc_root)
{
const char *wcroot_abspath;
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/update_editor.c Wed Dec 5 03:56:51 2012
@@ -5009,20 +5009,6 @@ svn_wc__get_switch_editor(const svn_delt
svn_error_t *
-svn_wc__check_wc_root(svn_boolean_t *wc_root,
- svn_kind_t *kind,
- svn_boolean_t *switched,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *scratch_pool)
-{
- return svn_error_trace(
- svn_wc__db_is_switched(wc_root, switched, kind,
- db, local_abspath,
- scratch_pool));
-}
-
-svn_error_t *
svn_wc_check_root(svn_boolean_t *is_wcroot,
svn_boolean_t *is_switched,
svn_kind_t *kind,
@@ -5037,13 +5023,13 @@ svn_wc_check_root(svn_boolean_t *is_wcro
scratch_pool));
}
-svn_error_t*
-svn_wc__strictly_is_wc_root(svn_boolean_t *wc_root,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *scratch_pool)
+svn_error_t *
+svn_wc__is_wcroot(svn_boolean_t *is_wcroot,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool)
{
- return svn_error_trace(svn_wc__db_is_wcroot(wc_root,
+ return svn_error_trace(svn_wc__db_is_wcroot(is_wcroot,
wc_ctx->db,
local_abspath,
scratch_pool));
@@ -5077,9 +5063,9 @@ svn_wc_get_actual_target2(const char **a
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
- err = svn_wc__check_wc_root(&is_wc_root, &kind, &is_switched,
- wc_ctx->db, local_abspath,
- scratch_pool);
+ err = svn_wc__db_is_switched(&is_wc_root, &is_switched, &kind,
+ wc_ctx->db, local_abspath,
+ scratch_pool);
if (err)
{
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc-queries.sql Wed Dec 5 03:56:51 2012
@@ -220,34 +220,6 @@ DELETE FROM nodes
WHERE wc_id = ?1 AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
AND op_depth = 0
--- STMT_DELETE_WORKING_OP_DEPTH
-DELETE FROM nodes
-WHERE wc_id = ?1
- AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
- AND op_depth = ?3
-
--- STMT_SELECT_LOCAL_RELPATH_OP_DEPTH
-SELECT local_relpath
-FROM nodes
-WHERE wc_id = ?1
- AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
- AND op_depth = ?3
-
--- STMT_COPY_NODE_MOVE
-INSERT INTO nodes (
- wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
- revision, presence, depth, kind, changed_revision, changed_date,
- changed_author, checksum, properties, translated_size, last_mod_time,
- symlink_target, moved_here )
-SELECT
- wc_id, ?4 /*local_relpath */, ?5 /*op_depth*/, ?6 /* parent_relpath */,
- repos_id,
- repos_path, revision, presence, depth, kind, changed_revision,
- changed_date, changed_author, checksum, properties, translated_size,
- last_mod_time, symlink_target, 1
-FROM nodes
-WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3
-
-- STMT_SELECT_OP_DEPTH_CHILDREN
SELECT local_relpath FROM nodes
WHERE wc_id = ?1 AND parent_relpath = ?2 AND op_depth = ?3
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc.h?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc.h Wed Dec 5 03:56:51 2012
@@ -641,27 +641,6 @@ svn_wc__wipe_postupgrade(const char *dir
void *cancel_baton,
apr_pool_t *scratch_pool);
-/* Check whether a node is a working copy root or switched.
- *
- * If LOCAL_ABSPATH is the root of a working copy, set *WC_ROOT to TRUE,
- * otherwise to FALSE.
- *
- * If KIND is not null, set *KIND to the node type of LOCAL_ABSPATH.
- *
- * If LOCAL_ABSPATH is switched against its parent in the same working copy
- * set *SWITCHED to TRUE, otherwise to FALSE. SWITCHED can be NULL
- * if the result is not important.
- *
- * Use SCRATCH_POOL for temporary allocations.
- */
-svn_error_t *
-svn_wc__check_wc_root(svn_boolean_t *wc_root,
- svn_kind_t *kind,
- svn_boolean_t *switched,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *scratch_pool);
-
/* Ensure LOCAL_ABSPATH is still locked in DB. Returns the error
* SVN_ERR_WC_NOT_LOCKED if this is not the case.
*/
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c Wed Dec 5 03:56:51 2012
@@ -12718,7 +12718,7 @@ svn_wc__db_node_hidden(svn_boolean_t *hi
svn_error_t *
-svn_wc__db_is_wcroot(svn_boolean_t *is_root,
+svn_wc__db_is_wcroot(svn_boolean_t *is_wcroot,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *scratch_pool)
@@ -12734,12 +12734,12 @@ svn_wc__db_is_wcroot(svn_boolean_t *is_r
if (*local_relpath != '\0')
{
- *is_root = FALSE; /* Node is a file, or has a parent directory within
+ *is_wcroot = FALSE; /* Node is a file, or has a parent directory within
the same wcroot */
return SVN_NO_ERROR;
}
- *is_root = TRUE;
+ *is_wcroot = TRUE;
return SVN_NO_ERROR;
}
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h Wed Dec 5 03:56:51 2012
@@ -1807,7 +1807,7 @@ svn_wc__db_revert_list_done(svn_wc__db_t
If HAD_PROPS is requested and the node has pristine props, the value will
be set to TRUE.
- If PROP_MODS is requested and the node has property modification the value
+ If PROPS_MOD is requested and the node has property modification the value
will be set to TRUE.
### add information about the need to scan upwards to get a complete
@@ -2302,23 +2302,28 @@ svn_wc__db_node_check_replace(svn_boolea
### changelist usage -- we may already assume the list fits in memory.
*/
-/* Checks if LOCAL_ABSPATH has a parent directory that knows about its
- * existance. Set *IS_ROOT to FALSE if a parent is found, and to TRUE
- * if there is no such parent.
+/* The DB-private version of svn_wc__is_wcroot(), which see.
*/
svn_error_t *
-svn_wc__db_is_wcroot(svn_boolean_t *is_root,
+svn_wc__db_is_wcroot(svn_boolean_t *is_wcroot,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *scratch_pool);
-/* Checks if LOCAL_ABSPATH is a working copy root, switched and a directory.
- With these answers we can answer all 'is anchor' questions that we need for
- the different ra operations with just a single sqlite transaction and
- filestat.
+/* Check whether a node is a working copy root and/or switched.
- All output arguments can be null to specify that the result is not
- interesting to the caller
+ If LOCAL_ABSPATH is the root of a working copy, set *IS_WC_ROOT to TRUE,
+ otherwise to FALSE.
+
+ If LOCAL_ABSPATH is switched against its parent in the same working copy
+ set *IS_SWITCHED to TRUE, otherwise to FALSE.
+
+ If KIND is not null, set *KIND to the node type of LOCAL_ABSPATH.
+
+ Any of the output arguments can be null to specify that the result is not
+ interesting to the caller.
+
+ Use SCRATCH_POOL for temporary allocations.
*/
svn_error_t *
svn_wc__db_is_switched(svn_boolean_t *is_wcroot,
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h Wed Dec 5 03:56:51 2012
@@ -262,7 +262,18 @@ svn_wc__db_base_get_info_internal(svn_wc
/* Similar to svn_wc__db_base_get_info(), but taking WCROOT+LOCAL_RELPATH
* instead of DB+LOCAL_ABSPATH, an explicit op-depth of the node to get
- * information about, and outputting REPOS_ID instead of URL+UUID. */
+ * information about, and outputting REPOS_ID instead of URL+UUID, and
+ * without the LOCK or UPDATE_ROOT outputs.
+ *
+ * OR
+ *
+ * Similar to svn_wc__db_base_get_info_internal(), but taking an explicit
+ * op-depth OP_DEPTH of the node to get information about, and without the
+ * LOCK or UPDATE_ROOT outputs.
+ *
+ * ### [JAF] TODO: Harmonize svn_wc__db_base_get_info[_internal] with
+ * svn_wc__db_depth_get_info -- common API, common implementation.
+ */
svn_error_t *
svn_wc__db_depth_get_info(svn_wc__db_status_t *status,
svn_kind_t *kind,
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_update_move.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_update_move.c Wed Dec 5 03:56:51 2012
@@ -672,83 +672,6 @@ update_moved_away_subtree(svn_editor_t *
return SVN_NO_ERROR;
}
-/* Update the single op-depth layer in the move destination subtree
- rooted at DST_RELPATH to make it match the move source subtree
- rooted at SRC_RELPATH. */
-static svn_error_t *
-replace_moved_layer(const char *src_relpath,
- const char *dst_relpath,
- svn_wc__db_t *db,
- svn_wc__db_wcroot_t *wcroot,
- apr_pool_t *scratch_pool)
-{
- svn_sqlite__stmt_t *stmt;
- svn_boolean_t have_row;
- int src_op_depth;
- int dst_op_depth = relpath_depth(dst_relpath);
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_SELECT_NODE_INFO));
- SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, src_relpath));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- if (have_row)
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- if (have_row)
- src_op_depth = svn_sqlite__column_int(stmt, 0);
- SVN_ERR(svn_sqlite__reset(stmt));
- if (!have_row)
- return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
- _("'%s' is not deleted"),
- svn_dirent_local_style(src_relpath,
- scratch_pool));
-
- /* Delete entire subtree at one op-depth. */
- SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_DELETE_WORKING_OP_DEPTH));
- SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id,
- dst_relpath, dst_op_depth));
- SVN_ERR(svn_sqlite__step_done(stmt));
-
- /* Copy entire subtree at one op-depth. */
- SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_SELECT_LOCAL_RELPATH_OP_DEPTH));
- SVN_ERR(svn_sqlite__bindf(stmt, "isd", wcroot->wc_id,
- src_relpath, src_op_depth));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- while (have_row)
- {
- svn_error_t *err;
- svn_sqlite__stmt_t *stmt2;
- const char *src_cp_relpath = svn_sqlite__column_text(stmt, 0, NULL);
- const char *dst_cp_relpath
- = svn_relpath_join(dst_relpath,
- svn_relpath_skip_ancestor(src_relpath,
- src_cp_relpath),
- scratch_pool);
-
- err = svn_sqlite__get_statement(&stmt2, wcroot->sdb,
- STMT_COPY_NODE_MOVE);
- if (!err)
- err = svn_sqlite__bindf(stmt2, "isdsds", wcroot->wc_id,
- src_cp_relpath, src_op_depth,
- dst_cp_relpath, dst_op_depth,
- svn_relpath_dirname(dst_cp_relpath,
- scratch_pool));
- if (!err)
- err = svn_sqlite__step_done(stmt2);
- if (err)
- return svn_error_compose_create(err, svn_sqlite__reset(stmt));
-
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- }
- SVN_ERR(svn_sqlite__reset(stmt));
-
- /* TODO: extend/retract any base-deleted layers to account for
- added/removed nodes in the replaced layer. */
-
- return SVN_NO_ERROR;
-}
-
/* Transfer changes from the move source to the move destination.
*
* Drive the editor TC_EDITOR with the difference between DST_RELPATH
@@ -802,9 +725,6 @@ drive_tree_conflict_editor(svn_editor_t
SVN_ERR(svn_editor_complete(tc_editor));
- SVN_ERR(replace_moved_layer(src_relpath, dst_relpath, db, wcroot,
- scratch_pool));
-
return SVN_NO_ERROR;
}
Modified: subversion/branches/ev2-export/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/merge-cmd.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/ev2-export/subversion/svn/merge-cmd.c Wed Dec 5 03:56:51 2012
@@ -37,6 +37,10 @@
#include "svn_private_config.h"
+/* A handy constant */
+static const svn_opt_revision_t unspecified_revision
+ = { svn_opt_revision_unspecified, { 0 } };
+
/*** Code. ***/
@@ -47,6 +51,7 @@ merge_reintegrate(const char *source_pat
const svn_opt_revision_t *source_peg_revision,
const char *target_wcpath,
svn_boolean_t dry_run,
+ svn_boolean_t verbose,
const apr_array_header_t *merge_options,
svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool)
@@ -54,6 +59,15 @@ merge_reintegrate(const char *source_pat
const char *url1, *url2;
svn_revnum_t rev1, rev2;
+ if (verbose)
+ SVN_ERR(svn_cmdline_printf(scratch_pool, _("checking branch relationship...\n")));
+ SVN_ERR_W(svn_cl__check_related_source_and_target(
+ source_path_or_url, source_peg_revision,
+ target_wcpath, &unspecified_revision, ctx, scratch_pool),
+ _("Source and target must be different but related branches"));
+
+ if (verbose)
+ SVN_ERR(svn_cmdline_printf(scratch_pool, _("calculating reintegrate merge...\n")));
SVN_ERR(svn_client_find_reintegrate_merge(
&url1, &rev1, &url2, &rev2,
source_path_or_url, source_peg_revision, target_wcpath,
@@ -70,6 +84,9 @@ merge_reintegrate(const char *source_pat
revision2.kind = svn_opt_revision_number;
revision2.value.number = rev2;
+ if (verbose)
+ SVN_ERR(svn_cmdline_printf(scratch_pool, _("merging...\n")));
+
/* Do the merge. Set 'allow_mixed_rev' to true, not because we want
* to allow a mixed-rev WC but simply to bypass the check, as it was
* already checked in svn_client_find_reintegrate_merge(). */
@@ -116,12 +133,23 @@ automatic_merge(const char *source_path_
svn_boolean_t allow_mixed_rev,
svn_boolean_t allow_local_mods,
svn_boolean_t allow_switched_subtrees,
+ svn_boolean_t verbose,
const apr_array_header_t *merge_options,
svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool)
{
svn_client_automatic_merge_t *merge;
+ if (verbose)
+ SVN_ERR(svn_cmdline_printf(scratch_pool, _("checking branch relationship...\n")));
+ SVN_ERR_W(svn_cl__check_related_source_and_target(
+ source_path_or_url, source_revision,
+ target_wcpath, &unspecified_revision, ctx, scratch_pool),
+ _("Source and target must be different but related branches"));
+
+ if (verbose)
+ SVN_ERR(svn_cmdline_printf(scratch_pool, _("calculating automatic merge...\n")));
+
/* Find the 3-way merges needed (and check suitability of the WC). */
SVN_ERR(svn_client_find_automatic_merge(&merge,
source_path_or_url, source_revision,
@@ -156,6 +184,9 @@ automatic_merge(const char *source_path_
"cannot be used with this kind of merge"));
}
+ if (verbose)
+ SVN_ERR(svn_cmdline_printf(scratch_pool, _("merging...\n")));
+
/* Perform the 3-way merges */
SVN_ERR(svn_client_do_automatic_merge(merge, target_wcpath, depth,
force, record_only,
@@ -181,7 +212,6 @@ svn_cl__merge(apr_getopt_t *os,
svn_opt_revision_t first_range_start, first_range_end, peg_revision1,
peg_revision2;
apr_array_header_t *options, *ranges_to_merge = opt_state->revision_ranges;
- svn_opt_revision_t unspecified = { svn_opt_revision_unspecified, { 0 } };
/* Merge doesn't support specifying a revision or revision range
when using --reintegrate. */
@@ -435,11 +465,6 @@ svn_cl__merge(apr_getopt_t *os,
&& first_range_start.kind == svn_opt_revision_unspecified
&& first_range_end.kind == svn_opt_revision_unspecified)
{
- SVN_ERR_W(svn_cl__check_related_source_and_target(
- sourcepath1, &peg_revision1, targetpath, &unspecified,
- ctx, pool),
- _("Source and target must be different but related branches"));
-
merge_err = automatic_merge(sourcepath1, &peg_revision1, targetpath,
opt_state->depth,
opt_state->force,
@@ -448,17 +473,14 @@ svn_cl__merge(apr_getopt_t *os,
opt_state->allow_mixed_rev,
TRUE /*allow_local_mods*/,
TRUE /*allow_switched_subtrees*/,
+ opt_state->verbose,
options, ctx, pool);
}
else if (opt_state->reintegrate)
{
- SVN_ERR_W(svn_cl__check_related_source_and_target(
- sourcepath1, &peg_revision1, targetpath, &unspecified,
- ctx, pool),
- _("Source and target must be different but related branches"));
-
merge_err = merge_reintegrate(sourcepath1, &peg_revision1, targetpath,
- opt_state->dry_run, options, ctx, pool);
+ opt_state->dry_run, opt_state->verbose,
+ options, ctx, pool);
}
else if (! two_sources_specified)
{
@@ -476,12 +498,16 @@ svn_cl__merge(apr_getopt_t *os,
APR_ARRAY_PUSH(ranges_to_merge, svn_opt_revision_range_t *) = range;
/* This must be a 'sync' merge so check branch relationship. */
+ if (opt_state->verbose)
+ SVN_ERR(svn_cmdline_printf(pool, _("checking branch relationship...\n")));
SVN_ERR_W(svn_cl__check_related_source_and_target(
- sourcepath1, &peg_revision1, targetpath, &unspecified,
- ctx, pool),
+ sourcepath1, &peg_revision1,
+ targetpath, &unspecified_revision, ctx, pool),
_("Source and target must be different but related branches"));
}
+ if (opt_state->verbose)
+ SVN_ERR(svn_cmdline_printf(pool, _("merging...\n")));
merge_err = svn_client_merge_peg4(sourcepath1,
ranges_to_merge,
&peg_revision1,
@@ -502,6 +528,9 @@ svn_cl__merge(apr_getopt_t *os,
return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
_("Merge sources must both be "
"either paths or URLs"));
+
+ if (opt_state->verbose)
+ SVN_ERR(svn_cmdline_printf(pool, _("merging...\n")));
merge_err = svn_client_merge4(sourcepath1,
&first_range_start,
sourcepath2,
Modified: subversion/branches/ev2-export/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/svn/svn.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/svn/svn.c (original)
+++ subversion/branches/ev2-export/subversion/svn/svn.c Wed Dec 5 03:56:51 2012
@@ -1036,7 +1036,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" repositories.\n"),
{'r', 'c', 'N', opt_depth, 'q', opt_force, opt_dry_run, opt_merge_cmd,
opt_record_only, 'x', opt_ignore_ancestry, opt_accept, opt_reintegrate,
- opt_allow_mixed_revisions} },
+ opt_allow_mixed_revisions, 'v'} },
{ "mergeinfo", svn_cl__mergeinfo, {0}, N_
("Display merge-related information.\n"
Modified: subversion/branches/ev2-export/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/libsvn_wc/entries-compat.c?rev=1417276&r1=1417275&r2=1417276&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/branches/ev2-export/subversion/tests/libsvn_wc/entries-compat.c Wed Dec 5 03:56:51 2012
@@ -614,13 +614,13 @@ test_access_baton_like_locking(apr_pool_
repos_root_url, 0, svn_depth_infinity,
pool));
- SVN_ERR(svn_wc__check_wc_root(&is_root, NULL, NULL, wc_ctx->db, subdir,
- pool));
+ SVN_ERR(svn_wc__db_is_switched(&is_root, NULL, NULL, wc_ctx->db, subdir,
+ pool));
SVN_TEST_ASSERT(is_root);
- SVN_ERR(svn_wc__check_wc_root(&is_root, NULL, NULL, wc_ctx2->db, subdir,
- pool));
+ SVN_ERR(svn_wc__db_is_switched(&is_root, NULL, NULL, wc_ctx2->db, subdir,
+ pool));
/* This test was added to show a regression where the next check failed,
but the check above this succeeded */