You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/06/11 13:49:29 UTC
svn commit: r1491757 [2/2] - in /subversion/branches/javahl-1.8-extensions:
./ build/generator/ contrib/hook-scripts/
subversion/bindings/javahl/src/org/apache/subversion/javahl/
subversion/bindings/swig/ subversion/bindings/swig/include/ subversion/bi...
Modified: subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_local/split_url.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_local/split_url.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_local/split_url.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_local/split_url.c Tue Jun 11 11:49:27 2013
@@ -23,13 +23,14 @@
#include "ra_local.h"
#include <string.h>
+#include "svn_path.h"
#include "svn_dirent_uri.h"
#include "svn_private_config.h"
svn_error_t *
svn_ra_local__split_URL(svn_repos_t **repos,
- const char **repos_root_url,
+ const char **repos_url,
const char **fs_path,
const char *URL,
apr_pool_t *pool)
@@ -37,6 +38,7 @@ svn_ra_local__split_URL(svn_repos_t **re
svn_error_t *err = SVN_NO_ERROR;
const char *repos_dirent;
const char *repos_root_dirent;
+ svn_stringbuf_t *urlbuf;
SVN_ERR(svn_uri_get_dirent_from_file_url(&repos_dirent, URL, pool));
@@ -62,15 +64,31 @@ svn_ra_local__split_URL(svn_repos_t **re
/* = apr_pstrcat(pool,
"/",
svn_dirent_skip_ancestor(repos_root_dirent, repos_dirent),
- (const char *)NULL */
+ (const char *)NULL); */
*fs_path = &repos_dirent[strlen(repos_root_dirent)];
if (**fs_path == '\0')
*fs_path = "/";
- /* Create a url to the repository root. */
- SVN_ERR(svn_uri_get_file_url_from_dirent(repos_root_url, repos_root_dirent,
- pool));
+ /* Remove the path components after the root dirent from the original URL,
+ to get a URL to the repository root.
+
+ We don't use svn_uri_get_file_url_from_dirent() here as that would
+ transform several uris to form a differently formed url than
+ svn_uri_canonicalize would.
+
+ E.g. file://localhost/C:/dir -> file:///C:/dir
+ (a transform that was originally supported directly by this function,
+ before the implementation moved)
+
+ On on Windows:
+ file:///dir -> file:///E:/dir (When E: is the current disk)
+ */
+ urlbuf = svn_stringbuf_create(URL, pool);
+ svn_path_remove_components(urlbuf,
+ svn_path_component_count(repos_dirent)
+ - svn_path_component_count(repos_root_dirent));
+ *repos_url = urlbuf->data;
/* Configure hook script environment variables. */
SVN_ERR(svn_repos_hooks_setenv(*repos, NULL, pool));
Modified: subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_serf/commit.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_serf/commit.c Tue Jun 11 11:49:27 2013
@@ -804,8 +804,18 @@ maybe_set_lock_token_header(serf_bucket_
if (token)
{
const char *token_header;
+ const char *token_uri;
+ apr_uri_t uri = commit_ctx->session->session_url;
- token_header = apr_pstrcat(pool, "(<", token, ">)", (char *)NULL);
+ /* Supplying the optional URI affects apache response when
+ the lock is broken, see issue 4369. When present any URI
+ must be absolute (RFC 2518 9.4). */
+ uri.path = (char *)svn_path_url_add_component2(uri.path, relpath,
+ pool);
+ token_uri = apr_uri_unparse(pool, &uri, 0);
+
+ token_header = apr_pstrcat(pool, "<", token_uri, "> (<", token, ">)",
+ (char *)NULL);
serf_bucket_headers_set(headers, "If", token_header);
}
}
Modified: subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_serf/ra_serf.h?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/libsvn_ra_serf/ra_serf.h Tue Jun 11 11:49:27 2013
@@ -50,8 +50,8 @@ extern "C" {
/* Enforce the minimum version of serf. */
-#if !SERF_VERSION_AT_LEAST(0, 7, 1)
-#error Please update your version of serf to at least 0.7.1.
+#if !SERF_VERSION_AT_LEAST(1, 2, 1)
+#error Please update your version of serf to at least 1.2.1.
#endif
/** Use this to silence compiler warnings about unused parameters. */
Modified: subversion/branches/javahl-1.8-extensions/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/libsvn_repos/fs-wrap.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/libsvn_repos/fs-wrap.c Tue Jun 11 11:49:27 2013
@@ -409,10 +409,8 @@ svn_repos_fs_revision_prop(svn_string_t
else if (readability == svn_repos_revision_access_partial)
{
/* Only svn:author and svn:date are fetchable. */
- if ((strncmp(propname, SVN_PROP_REVISION_AUTHOR,
- sizeof(SVN_PROP_REVISION_AUTHOR)-1) != 0)
- && (strncmp(propname, SVN_PROP_REVISION_DATE,
- sizeof(SVN_PROP_REVISION_DATE)-1) != 0))
+ if ((strcmp(propname, SVN_PROP_REVISION_AUTHOR) != 0)
+ && (strcmp(propname, SVN_PROP_REVISION_DATE) != 0))
*value_p = NULL;
else
Modified: subversion/branches/javahl-1.8-extensions/subversion/libsvn_repos/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/libsvn_repos/replay.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/libsvn_repos/replay.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/libsvn_repos/replay.c Tue Jun 11 11:49:27 2013
@@ -704,31 +704,45 @@ path_driver_cb_func(void **dir_baton,
/* Handle property modifications. */
if (change->prop_mod || downgraded_copy)
{
- apr_array_header_t *prop_diffs;
- apr_hash_t *old_props;
- apr_hash_t *new_props;
- int i;
-
- if (source_root)
- SVN_ERR(svn_fs_node_proplist(&old_props, source_root,
- source_fspath, pool));
- else
- old_props = apr_hash_make(pool);
+ if (cb->compare_root)
+ {
+ apr_array_header_t *prop_diffs;
+ apr_hash_t *old_props;
+ apr_hash_t *new_props;
+ int i;
+
+ if (source_root)
+ SVN_ERR(svn_fs_node_proplist(&old_props, source_root,
+ source_fspath, pool));
+ else
+ old_props = apr_hash_make(pool);
- SVN_ERR(svn_fs_node_proplist(&new_props, root, edit_path, pool));
+ SVN_ERR(svn_fs_node_proplist(&new_props, root, edit_path, pool));
- SVN_ERR(svn_prop_diffs(&prop_diffs, new_props, old_props,
- pool));
+ SVN_ERR(svn_prop_diffs(&prop_diffs, new_props, old_props,
+ pool));
- for (i = 0; i < prop_diffs->nelts; ++i)
+ for (i = 0; i < prop_diffs->nelts; ++i)
+ {
+ svn_prop_t *pc = &APR_ARRAY_IDX(prop_diffs, i, svn_prop_t);
+ if (change->node_kind == svn_node_dir)
+ SVN_ERR(editor->change_dir_prop(*dir_baton, pc->name,
+ pc->value, pool));
+ else if (change->node_kind == svn_node_file)
+ SVN_ERR(editor->change_file_prop(file_baton, pc->name,
+ pc->value, pool));
+ }
+ }
+ else
{
- svn_prop_t *pc = &APR_ARRAY_IDX(prop_diffs, i, svn_prop_t);
- if (change->node_kind == svn_node_dir)
- SVN_ERR(editor->change_dir_prop(*dir_baton, pc->name,
- pc->value, pool));
- else if (change->node_kind == svn_node_file)
- SVN_ERR(editor->change_file_prop(file_baton, pc->name,
- pc->value, pool));
+ /* Just do a dummy prop change to signal that there are *any*
+ propmods. */
+ if (change->node_kind == svn_node_dir)
+ SVN_ERR(editor->change_dir_prop(*dir_baton, "", NULL,
+ pool));
+ else if (change->node_kind == svn_node_file)
+ SVN_ERR(editor->change_file_prop(file_baton, "", NULL,
+ pool));
}
}
Modified: subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/io.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/io.c Tue Jun 11 11:49:27 2013
@@ -2795,10 +2795,23 @@ svn_io_wait_for_cmd(apr_proc_t *cmd_proc
if (exitwhy)
*exitwhy = exitwhy_val;
+ else if (APR_PROC_CHECK_SIGNALED(exitwhy_val)
+ && APR_PROC_CHECK_CORE_DUMP(exitwhy_val))
+ return svn_error_createf
+ (SVN_ERR_EXTERNAL_PROGRAM, NULL,
+ _("Process '%s' failed (signal %d, core dumped)"),
+ cmd, exitcode_val);
+ else if (APR_PROC_CHECK_SIGNALED(exitwhy_val))
+ return svn_error_createf
+ (SVN_ERR_EXTERNAL_PROGRAM, NULL,
+ _("Process '%s' failed (signal %d)"),
+ cmd, exitcode_val);
else if (! APR_PROC_CHECK_EXIT(exitwhy_val))
+ /* Don't really know what happened here. */
return svn_error_createf
(SVN_ERR_EXTERNAL_PROGRAM, NULL,
- _("Process '%s' failed (exitwhy %d)"), cmd, exitwhy_val);
+ _("Process '%s' failed (exitwhy %d, exitcode %d)"),
+ cmd, exitwhy_val, exitcode_val);
if (exitcode)
*exitcode = exitcode_val;
@@ -3472,17 +3485,8 @@ svn_io_write_unique(const char **tmp_pat
err = svn_io_file_write_full(new_file, buf, nbytes, NULL, pool);
- /* ### BH: Windows doesn't have the race condition between the write and the
- ### rename that other operating systems might have. So allow windows
- ### to decide when it wants to perform the disk synchronization using
- ### the normal file locking and journaling filesystem rules.
-
- ### Note that this function doesn't handle the rename, so we aren't even
- ### sure that we really have to sync. */
-#ifndef WIN32
- if (!err && nbytes > 0)
+ if (!err)
err = svn_io_file_flush_to_disk(new_file, pool);
-#endif
return svn_error_trace(
svn_error_compose_create(err,
Modified: subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/sqlite3wrapper.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/sqlite3wrapper.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/sqlite3wrapper.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/sqlite3wrapper.c Tue Jun 11 11:49:27 2013
@@ -39,6 +39,17 @@
# pragma GCC diagnostic ignored "-Wshorten-64-to-32"
# endif
# endif
+# ifdef __APPLE__
+# include <Availability.h>
+# if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+ /* <libkern/OSAtomic.h> is included on OS X by sqlite3.c, and
+ on old systems (Leopard or older), it cannot be compiled
+ with -std=c89 because it uses inline. This is a work-around. */
+# define inline __inline__
+# include <libkern/OSAtomic.h>
+# undef inline
+# endif
+# endif
# include <sqlite3.c>
# if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6))
# pragma GCC diagnostic pop
Modified: subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/subst.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/subst.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/subst.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/libsvn_subr/subst.c Tue Jun 11 11:49:27 2013
@@ -297,14 +297,23 @@ build_keywords(apr_hash_t **kw,
for (i = 0; i < keyword_tokens->nelts; ++i)
{
const char *keyword = APR_ARRAY_IDX(keyword_tokens, i, const char *);
- apr_array_header_t *custom_keyword_tokens = NULL;
+ const char *custom_fmt = NULL;
if (expand_custom_keywords)
- custom_keyword_tokens = svn_cstring_split(keyword, "=",
- TRUE /* chop */, pool);
- if (expand_custom_keywords && custom_keyword_tokens->nelts == 2)
{
- const char *custom_fmt;
+ char *sep;
+
+ /* Check if there is a custom keyword definition, started by '='. */
+ sep = strchr(keyword, '=');
+ if (sep)
+ {
+ *sep = '\0'; /* Split keyword's name from custom format. */
+ custom_fmt = sep + 1;
+ }
+ }
+
+ if (custom_fmt)
+ {
svn_string_t *custom_val;
/* Custom keywords must be allowed to match the name of an
@@ -312,9 +321,6 @@ build_keywords(apr_hash_t **kw,
* in case new fixed keywords are added to Subversion which
* happen to match a custom keyword defined somewhere.
* There is only one global namespace for keyword names. */
-
- keyword = APR_ARRAY_IDX(custom_keyword_tokens, 0, const char*);
- custom_fmt = APR_ARRAY_IDX(custom_keyword_tokens, 1, const char*);
custom_val = keyword_printf(custom_fmt, rev, url, repos_root_url,
date, author, pool);
svn_hash_sets(*kw, keyword, custom_val);
Modified: subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/conflicts.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/conflicts.c Tue Jun 11 11:49:27 2013
@@ -2047,6 +2047,9 @@ svn_wc__conflict_invoke_resolver(svn_wc_
* If NOT create_tempfiles, always create a legacy property conflict
* descriptor.
*
+ * Use NODE_KIND, OPERATION and shallow copies of LEFT_VERSION and
+ * RIGHT_VERSION, rather than reading them from CONFLICT_SKEL.
+ *
* Allocate results in RESULT_POOL. SCRATCH_POOL is used for temporary
* allocations. */
static svn_error_t *
@@ -2055,6 +2058,7 @@ read_prop_conflicts(apr_array_header_t *
const char *local_abspath,
svn_skel_t *conflict_skel,
svn_boolean_t create_tempfiles,
+ svn_node_kind_t node_kind,
svn_wc_operation_t operation,
const svn_wc_conflict_version_t *left_version,
const svn_wc_conflict_version_t *right_version,
@@ -2084,7 +2088,7 @@ read_prop_conflicts(apr_array_header_t *
svn_wc_conflict_description2_t *desc;
desc = svn_wc_conflict_description_create_prop2(local_abspath,
- svn_node_unknown,
+ node_kind,
"", result_pool);
/* ### This should be changed. The prej file should be stored
@@ -2115,7 +2119,7 @@ read_prop_conflicts(apr_array_header_t *
svn_pool_clear(iterpool);
desc = svn_wc_conflict_description_create_prop2(local_abspath,
- svn_node_unknown,
+ node_kind,
propname,
result_pool);
@@ -2246,10 +2250,15 @@ svn_wc__read_conflicts(const apr_array_h
right_version = APR_ARRAY_IDX(locations, 1, const svn_wc_conflict_version_t *);
if (prop_conflicted)
- SVN_ERR(read_prop_conflicts(cflcts, db, local_abspath, conflict_skel,
- create_tempfiles,
- operation, left_version, right_version,
- result_pool, scratch_pool));
+ {
+ svn_node_kind_t node_kind
+ = left_version ? left_version->node_kind : svn_node_unknown;
+
+ SVN_ERR(read_prop_conflicts(cflcts, db, local_abspath, conflict_skel,
+ create_tempfiles, node_kind,
+ operation, left_version, right_version,
+ result_pool, scratch_pool));
+ }
if (text_conflicted)
{
Modified: subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/diff_local.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/diff_local.c Tue Jun 11 11:49:27 2013
@@ -201,6 +201,15 @@ diff_status_callback(void *baton,
case svn_wc_status_ignored:
return SVN_NO_ERROR; /* No diff */
+ case svn_wc_status_conflicted:
+ if (status->text_status == svn_wc_status_none
+ && status->prop_status == svn_wc_status_none)
+ {
+ /* Node is an actual only node describing a tree conflict */
+ return SVN_NO_ERROR;
+ }
+ break;
+
default:
break; /* Go check other conditions */
}
Modified: subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/tree_conflicts.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/libsvn_wc/tree_conflicts.c Tue Jun 11 11:49:27 2013
@@ -506,6 +506,8 @@ svn_wc__get_tree_conflict(const svn_wc_c
return SVN_NO_ERROR;
}
}
+
+ *tree_conflict = NULL;
return SVN_NO_ERROR;
}
Modified: subversion/branches/javahl-1.8-extensions/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/svn/conflict-callbacks.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/svn/conflict-callbacks.c Tue Jun 11 11:49:27 2013
@@ -1303,7 +1303,7 @@ conflict_func_interactive(svn_wc_conflic
Conflicting edits on a file's text, or
Conflicting edits on a property.
*/
- if (((desc->node_kind == svn_node_file)
+ if (((desc->kind == svn_wc_conflict_kind_text)
&& (desc->action == svn_wc_conflict_action_edit)
&& (desc->reason == svn_wc_conflict_reason_edited)))
SVN_ERR(handle_text_conflict(*result, desc, b, scratch_pool));
Modified: subversion/branches/javahl-1.8-extensions/subversion/svn/file-merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/svn/file-merge.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/svn/file-merge.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/svn/file-merge.c Tue Jun 11 11:49:27 2013
@@ -853,13 +853,20 @@ svn_cl__merge_file(const char *base_path
const char *merged_file_name;
struct file_merge_baton fmb;
svn_boolean_t executable;
+ const char *merged_path_local_style;
+ const char *merged_rel_path;
+ const char *wc_path_local_style;
+ const char *wc_rel_path = svn_dirent_skip_ancestor(path_prefix, wc_path);
+
+ /* PATH_PREFIX may not be an ancestor of WC_PATH, just use the
+ full WC_PATH in that case. */
+ if (wc_rel_path)
+ wc_path_local_style = svn_dirent_local_style(wc_rel_path, scratch_pool);
+ else
+ wc_path_local_style = svn_dirent_local_style(wc_path, scratch_pool);
-
- SVN_ERR(svn_cmdline_printf(
- scratch_pool, _("Merging '%s'.\n"),
- svn_dirent_local_style(svn_dirent_skip_ancestor(path_prefix,
- wc_path),
- scratch_pool)));
+ SVN_ERR(svn_cmdline_printf(scratch_pool, _("Merging '%s'.\n"),
+ wc_path_local_style));
SVN_ERR(svn_io_file_open(&original_file, base_path,
APR_READ | APR_BUFFERED,
@@ -905,29 +912,30 @@ svn_cl__merge_file(const char *base_path
if (fmb.abort_merge)
{
SVN_ERR(svn_io_remove_file2(merged_file_name, TRUE, scratch_pool));
- SVN_ERR(svn_cmdline_printf(
- scratch_pool, _("Merge of '%s' aborted.\n"),
- svn_dirent_local_style(svn_dirent_skip_ancestor(path_prefix,
- wc_path),
- scratch_pool)));
-
+ SVN_ERR(svn_cmdline_printf(scratch_pool, _("Merge of '%s' aborted.\n"),
+ wc_path_local_style));
return SVN_NO_ERROR;
}
SVN_ERR(svn_io_is_file_executable(&executable, merged_path, scratch_pool));
+
+ merged_rel_path = svn_dirent_skip_ancestor(path_prefix, merged_path);
+ if (merged_rel_path)
+ merged_path_local_style = svn_dirent_local_style(merged_rel_path,
+ scratch_pool);
+ else
+ merged_path_local_style = svn_dirent_local_style(merged_path,
+ scratch_pool);
+
SVN_ERR_W(svn_io_copy_file(merged_file_name, merged_path, FALSE,
scratch_pool),
apr_psprintf(scratch_pool,
_("Could not write merged result to '%s', saved "
"instead at '%s'.\n'%s' remains in conflict.\n"),
- svn_dirent_local_style(
- svn_dirent_skip_ancestor(path_prefix, merged_path),
- scratch_pool),
+ merged_path_local_style,
svn_dirent_local_style(merged_file_name,
scratch_pool),
- svn_dirent_local_style(
- svn_dirent_skip_ancestor(path_prefix, wc_path),
- scratch_pool)));
+ wc_path_local_style));
SVN_ERR(svn_io_set_file_executable(merged_path, executable, FALSE,
scratch_pool));
SVN_ERR(svn_io_remove_file2(merged_file_name, TRUE, scratch_pool));
@@ -941,15 +949,11 @@ svn_cl__merge_file(const char *base_path
SVN_ERR(svn_cmdline_printf(
scratch_pool,
_("Merge of '%s' completed (remains in conflict).\n"),
- svn_dirent_local_style(svn_dirent_skip_ancestor(path_prefix,
- wc_path),
- scratch_pool)));
+ wc_path_local_style));
else
SVN_ERR(svn_cmdline_printf(
scratch_pool, _("Merge of '%s' completed.\n"),
- svn_dirent_local_style(svn_dirent_skip_ancestor(path_prefix,
- wc_path),
- scratch_pool)));
+ wc_path_local_style));
return SVN_NO_ERROR;
}
Modified: subversion/branches/javahl-1.8-extensions/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/svnadmin/svnadmin.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/svnadmin/svnadmin.c Tue Jun 11 11:49:27 2013
@@ -744,6 +744,39 @@ subcommand_deltify(apr_getopt_t *os, voi
return SVN_NO_ERROR;
}
+static void
+cmdline_stream_printf(svn_stream_t *stream,
+ apr_pool_t *pool,
+ const char *fmt,
+ ...)
+ __attribute__((format(printf, 3, 4)));
+
+static void
+cmdline_stream_printf(svn_stream_t *stream,
+ apr_pool_t *pool,
+ const char *fmt,
+ ...)
+{
+ const char *message;
+ va_list ap;
+ svn_error_t *err;
+ const char *out;
+
+ va_start(ap, fmt);
+ message = apr_pvsprintf(pool, fmt, ap);
+ va_end(ap);
+
+ err = svn_cmdline_cstring_from_utf8(&out, message, pool);
+
+ if (err)
+ {
+ svn_error_clear(err);
+ out = svn_cmdline_cstring_from_utf8_fuzzy(message, pool);
+ }
+
+ svn_error_clear(svn_stream_puts(stream, out));
+}
+
/* Implementation of svn_repos_notify_func_t to wrap the output to a
response stream for svn_repos_dump_fs2() and svn_repos_verify_fs() */
@@ -753,36 +786,35 @@ repos_notify_handler(void *baton,
apr_pool_t *scratch_pool)
{
svn_stream_t *feedback_stream = baton;
- apr_size_t len;
switch (notify->action)
{
case svn_repos_notify_warning:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- "WARNING 0x%04x: %s\n", notify->warning,
- notify->warning_str));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ "WARNING 0x%04x: %s\n", notify->warning,
+ notify->warning_str);
return;
case svn_repos_notify_dump_rev_end:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("* Dumped revision %ld.\n"),
- notify->revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("* Dumped revision %ld.\n"),
+ notify->revision);
return;
case svn_repos_notify_verify_rev_end:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("* Verified revision %ld.\n"),
- notify->revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("* Verified revision %ld.\n"),
+ notify->revision);
return;
case svn_repos_notify_verify_rev_structure:
if (notify->revision == SVN_INVALID_REVNUM)
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("* Verifying repository metadata ...\n")));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("* Verifying repository metadata ...\n"));
else
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("* Verifying metadata at revision %ld ...\n"),
- notify->revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("* Verifying metadata at revision %ld ...\n"),
+ notify->revision);
return;
case svn_repos_notify_pack_shard_start:
@@ -790,14 +822,14 @@ repos_notify_handler(void *baton,
const char *shardstr = apr_psprintf(scratch_pool,
"%" APR_INT64_T_FMT,
notify->shard);
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("Packing revisions in shard %s..."),
- shardstr));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("Packing revisions in shard %s..."),
+ shardstr);
}
return;
case svn_repos_notify_pack_shard_end:
- svn_error_clear(svn_stream_puts(feedback_stream, _("done.\n")));
+ cmdline_stream_printf(feedback_stream, scratch_pool, _("done.\n"));
return;
case svn_repos_notify_pack_shard_start_revprop:
@@ -805,30 +837,30 @@ repos_notify_handler(void *baton,
const char *shardstr = apr_psprintf(scratch_pool,
"%" APR_INT64_T_FMT,
notify->shard);
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("Packing revprops in shard %s..."),
- shardstr));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("Packing revprops in shard %s..."),
+ shardstr);
}
return;
case svn_repos_notify_pack_shard_end_revprop:
- svn_error_clear(svn_stream_puts(feedback_stream, _("done.\n")));
+ cmdline_stream_printf(feedback_stream, scratch_pool, _("done.\n"));
return;
case svn_repos_notify_load_txn_committed:
if (notify->old_revision == SVN_INVALID_REVNUM)
{
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("\n------- Committed revision %ld >>>\n\n"),
- notify->new_revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("\n------- Committed revision %ld >>>\n\n"),
+ notify->new_revision);
}
else
{
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("\n------- Committed new rev %ld"
- " (loaded from original rev %ld"
- ") >>>\n\n"), notify->new_revision,
- notify->old_revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("\n------- Committed new rev %ld"
+ " (loaded from original rev %ld"
+ ") >>>\n\n"), notify->new_revision,
+ notify->old_revision);
}
return;
@@ -837,27 +869,27 @@ repos_notify_handler(void *baton,
switch (notify->node_action)
{
case svn_node_action_change:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+ cmdline_stream_printf(feedback_stream, scratch_pool,
_(" * editing path : %s ..."),
- notify->path));
+ notify->path);
break;
case svn_node_action_delete:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+ cmdline_stream_printf(feedback_stream, scratch_pool,
_(" * deleting path : %s ..."),
- notify->path));
+ notify->path);
break;
case svn_node_action_add:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+ cmdline_stream_printf(feedback_stream, scratch_pool,
_(" * adding path : %s ..."),
- notify->path));
+ notify->path);
break;
case svn_node_action_replace:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+ cmdline_stream_printf(feedback_stream, scratch_pool,
_(" * replacing path : %s ..."),
- notify->path));
+ notify->path);
break;
}
@@ -865,32 +897,30 @@ repos_notify_handler(void *baton,
return;
case svn_repos_notify_load_node_done:
- len = 7;
- svn_error_clear(svn_stream_write(feedback_stream, _(" done.\n"), &len));
+ cmdline_stream_printf(feedback_stream, scratch_pool, _(" done.\n"));
return;
case svn_repos_notify_load_copied_node:
- len = 9;
- svn_error_clear(svn_stream_write(feedback_stream, "COPIED...", &len));
+ cmdline_stream_printf(feedback_stream, scratch_pool, "COPIED...");
return;
case svn_repos_notify_load_txn_start:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("<<< Started new transaction, based on "
- "original revision %ld\n"),
- notify->old_revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("<<< Started new transaction, based on "
+ "original revision %ld\n"),
+ notify->old_revision);
return;
case svn_repos_notify_load_skipped_rev:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("<<< Skipped original revision %ld\n"),
- notify->old_revision));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("<<< Skipped original revision %ld\n"),
+ notify->old_revision);
return;
case svn_repos_notify_load_normalized_mergeinfo:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _(" removing '\\r' from %s ..."),
- SVN_PROP_MERGEINFO));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _(" removing '\\r' from %s ..."),
+ SVN_PROP_MERGEINFO);
return;
case svn_repos_notify_mutex_acquired:
@@ -899,17 +929,17 @@ repos_notify_handler(void *baton,
return;
case svn_repos_notify_recover_start:
- svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
- _("Repository lock acquired.\n"
- "Please wait; recovering the"
- " repository may take some time...\n")));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("Repository lock acquired.\n"
+ "Please wait; recovering the"
+ " repository may take some time...\n"));
return;
case svn_repos_notify_upgrade_start:
- svn_error_clear(svn_stream_puts(feedback_stream,
- _("Repository lock acquired.\n"
- "Please wait; upgrading the"
- " repository may take some time...\n")));
+ cmdline_stream_printf(feedback_stream, scratch_pool,
+ _("Repository lock acquired.\n"
+ "Please wait; upgrading the"
+ " repository may take some time...\n"));
return;
default:
Modified: subversion/branches/javahl-1.8-extensions/subversion/svnserve/svnserve.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/svnserve/svnserve.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/svnserve/svnserve.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/svnserve/svnserve.c Tue Jun 11 11:49:27 2013
@@ -1043,7 +1043,9 @@ int main(int argc, const char *argv[])
connection_pool) == APR_CHILD_DONE)
;
}
- if (APR_STATUS_IS_EINTR(status))
+ if (APR_STATUS_IS_EINTR(status)
+ || APR_STATUS_IS_ECONNABORTED(status)
+ || APR_STATUS_IS_ECONNRESET(status))
{
svn_pool_destroy(connection_pool);
continue;
Modified: subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/diff_tests.py?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/diff_tests.py Tue Jun 11 11:49:27 2013
@@ -32,7 +32,7 @@ logger = logging.getLogger()
# Our testing module
import svntest
-from svntest import err
+from svntest import err, wc
from prop_tests import binary_mime_type_on_text_file_warning
@@ -4549,6 +4549,50 @@ def diff_repos_empty_file_addition(sbox)
svntest.actions.run_and_verify_svn(None, expected_output, [],
'diff', '-c', '2', sbox.repo_url)
+def diff_missing_tree_conflict_victim(sbox):
+ "diff with missing tree-conflict victim in wc"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Produce an 'incoming edit vs. local missing' tree conflict:
+ # r2: edit iota and commit the change
+ svntest.main.file_append(sbox.ospath('iota'), "This is a change to iota.\n")
+ sbox.simple_propset('k', 'v', 'A/C')
+ sbox.simple_commit()
+ # now remove iota
+ sbox.simple_rm('iota', 'A/C')
+ sbox.simple_commit()
+ # update to avoid mixed-rev wc warning
+ sbox.simple_update()
+ # merge r2 into wc and verify that a tree conflict is flagged on iota
+ expected_output = wc.State(wc_dir, {
+ 'iota' : Item(status=' ', treeconflict='C'),
+ 'A/C' : Item(status=' ', treeconflict='C')
+ })
+ expected_mergeinfo_output = wc.State(wc_dir, {})
+ expected_elision_output = wc.State(wc_dir, {})
+ expected_disk = svntest.main.greek_state.copy()
+ expected_disk.remove('iota','A/C')
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 3)
+ expected_status.tweak('iota', 'A/C',
+ status='! ', treeconflict='C', wc_rev=None)
+ expected_skip = wc.State('', { })
+ svntest.actions.run_and_verify_merge(wc_dir, '1', '2',
+ sbox.repo_url, None,
+ expected_output,
+ expected_mergeinfo_output,
+ expected_elision_output,
+ expected_disk,
+ expected_status,
+ expected_skip,
+ None, None, None, None, None, None,
+ False, '--ignore-ancestry', wc_dir)
+
+ # 'svn diff' should show no change for the working copy
+ # This currently fails because svn errors out with a 'node not found' error
+ expected_output = [ ]
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff', wc_dir)
########################################################################
#Run the tests
@@ -4629,6 +4673,7 @@ test_list = [ None,
diff_dir_replaced_by_file,
diff_dir_replaced_by_dir,
diff_repos_empty_file_addition,
+ diff_missing_tree_conflict_victim,
]
if __name__ == '__main__':
Modified: subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/lock_tests.py?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/lock_tests.py Tue Jun 11 11:49:27 2013
@@ -1815,6 +1815,31 @@ def lock_unlock_deleted(sbox):
expected_status.tweak('A/mu', writelocked=None)
svntest.actions.run_and_verify_status(wc_dir, expected_status)
+@Issue(4369)
+def commit_stolen_lock(sbox):
+ "commit with a stolen lock"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ sbox.simple_append('A/mu', 'zig-zag')
+ sbox.simple_lock('A/mu')
+
+ expected_output = '\'mu\' locked by user \'jrandom\'.'
+ svntest.actions.run_and_verify_svn(None, expected_output, [],
+ 'lock', '--force',
+ sbox.repo_url + '/A/mu')
+
+ expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+ expected_status.tweak('A/mu', status='M ', writelocked='T')
+ err_re = "(.*E160037: Cannot verify lock on path '/A/mu')|" + \
+ "(.*E160038: '/.*/A/mu': no lock token available)"
+ svntest.actions.run_and_verify_commit(wc_dir,
+ [],
+ expected_status,
+ err_re,
+ wc_dir)
+
########################################################################
# Run the tests
@@ -1866,6 +1891,7 @@ test_list = [ None,
lock_multi_wc,
locks_stick_over_switch,
lock_unlock_deleted,
+ commit_stolen_lock,
]
if __name__ == '__main__':
Modified: subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/merge_tests.py?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/merge_tests.py Tue Jun 11 11:49:27 2013
@@ -18993,6 +18993,156 @@ def conflicted_split_merge_with_resolve(
prop_resolved=1, expect_error=False)
try_merge(target, 8, ['-r6:3', '-r10:7'], expect, '7')
+#----------------------------------------------------------------------
+# Test for issue 4367 'merge to shallow WC, repeat merge to infinite
+# depth WC is broken'.
+@SkipUnless(server_has_mergeinfo)
+@Issues(4367)
+def merge_to_empty_target_merge_to_infinite_target(sbox):
+ "repeat merge to infinite depth WC conflicts"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+ wc_disk, wc_status = set_up_branch(sbox, branch_only=True)
+ A_COPY_path = sbox.ospath('A_COPY')
+ C_COPY_path = sbox.ospath('A_COPY/C')
+ E_path = sbox.ospath('A/B/E')
+ J_path = sbox.ospath('A/C/J')
+ K_path = sbox.ospath('A/C/J/K')
+ nu1_path = sbox.ospath('A/C/J/nu1')
+ nu2_path = sbox.ospath('A/C/J/K/nu2')
+ L_path = sbox.ospath('A/B/L')
+ nu3_path = sbox.ospath('A/B/L/nu3')
+
+ B1_path = sbox.ospath('A/B/B1')
+ B1a_path = sbox.ospath('A/B/B1/B1a')
+ test1_path = sbox.ospath('A/B/B1/test.txt')
+ test2_path = sbox.ospath('A/B/B1/B1a/test.txt')
+
+ C1_path = sbox.ospath('A/C/C1')
+ test3_path = sbox.ospath('A/C/C1/test.txt')
+
+ # r3 - Add some subtrees:
+ # A /A/B/B1
+ # A /A/B/B1/B1a
+ # A /A/B/B1/B1a/test.txt
+ # A /A/B/B1/test.txt
+ svntest.main.run_svn(None, 'mkdir', B1_path)
+ svntest.main.run_svn(None, 'mkdir', B1a_path)
+ svntest.main.file_append(test1_path, "New file.\n")
+ svntest.main.file_append(test2_path, "New file.\n")
+ svntest.main.run_svn(None, 'add', test1_path, test2_path)
+ sbox.simple_commit()
+
+ # r4 - Add some another subtree.
+ # A /A/C/C1
+ # A /A/C/C1/test.txt
+ svntest.main.run_svn(None, 'mkdir', C1_path)
+ svntest.main.file_append(test3_path, "New file.\n")
+ svntest.main.run_svn(None, 'add', test3_path)
+ sbox.simple_commit()
+
+ # r5 - Delete part of the subtree added in r3.
+ # D /A/B/B1/B1a
+ svntest.main.run_svn(None, 'del', B1a_path)
+ sbox.simple_commit()
+
+ # r6 - Set depth of A_COPY to empty, merge all available revs from ^/A.
+ svntest.actions.run_and_verify_svn(None, None, [], 'up',
+ '--set-depth=empty', A_COPY_path)
+ svntest.actions.run_and_verify_svn(None, None, [], 'up',
+ '--set-depth=infinity', C_COPY_path)
+ svntest.actions.run_and_verify_svn(None, None, [], 'merge', '^/A',
+ A_COPY_path)
+ sbox.simple_commit()
+
+ # Update A_COPY back to depth infinity and retry the prior merge.
+ svntest.actions.run_and_verify_svn(None, None, [], 'up',
+ '--set-depth=infinity', A_COPY_path)
+
+ expected_output = wc.State(A_COPY_path, {
+ 'B/B1' : Item(status='A '),
+ 'B/B1/test.txt' : Item(status='A '),
+ 'B/B1/B1a' : Item(status='D ', prev_status='A '),
+ 'B/B1/B1a/test.txt' : Item(status='A '),
+ })
+ expected_mergeinfo_output = wc.State(A_COPY_path, {
+ '' : Item(status=' U'),
+ 'B' : Item(status=' G'),
+ })
+ expected_elision_output = wc.State(A_COPY_path, {
+ 'B' : Item(status=' U'),
+ })
+ expected_status = wc.State(A_COPY_path, {
+ '' : Item(status=' M'),
+ 'B' : Item(status=' '),
+ 'mu' : Item(status=' '),
+ 'B/B1' : Item(status='A ', copied='+'),
+ 'B/B1/test.txt' : Item(status=' ', copied='+'),
+ 'B/B1/B1a' : Item(status='D ', copied='+'),
+ 'B/B1/B1a/test.txt' : Item(status='D ', copied='+'),
+ 'B/E' : Item(status=' '),
+ 'B/E/alpha' : Item(status=' '),
+ 'B/E/beta' : Item(status=' '),
+ 'B/lambda' : Item(status=' '),
+ 'B/F' : Item(status=' '),
+ 'C' : Item(status=' '),
+ 'C/C1' : Item(status=' '),
+ 'C/C1/test.txt' : Item(status=' '),
+ 'D' : Item(status=' '),
+ 'D/G' : Item(status=' '),
+ 'D/G/pi' : Item(status=' '),
+ 'D/G/rho' : Item(status=' '),
+ 'D/G/tau' : Item(status=' '),
+ 'D/gamma' : Item(status=' '),
+ 'D/H' : Item(status=' '),
+ 'D/H/chi' : Item(status=' '),
+ 'D/H/psi' : Item(status=' '),
+ 'D/H/omega' : Item(status=' '),
+ })
+ expected_status.tweak(wc_rev=6)
+ expected_status.tweak('B/B1', 'B/B1/test.txt', 'B/B1/B1a',
+ 'B/B1/B1a/test.txt', wc_rev='-')
+ expected_disk = wc.State('', {
+ '' : Item(props={SVN_PROP_MERGEINFO : '/A:2-6'}),
+ 'B' : Item(),
+ 'mu' : Item("This is the file 'mu'.\n"),
+ 'B/B1' : Item(),
+ 'B/B1/test.txt' : Item("New file.\n"),
+ 'B/E' : Item(),
+ 'B/E/alpha' : Item("This is the file 'alpha'.\n"),
+ 'B/E/beta' : Item("This is the file 'beta'.\n"),
+ 'B/lambda' : Item("This is the file 'lambda'.\n"),
+ 'B/F' : Item(),
+ 'C' : Item(props={SVN_PROP_MERGEINFO : '/A/C:2-5'}),
+ 'C/C1' : Item(),
+ 'C/C1/test.txt' : Item("New file.\n"),
+ 'D' : Item(),
+ 'D/G' : Item(),
+ 'D/G/pi' : Item("This is the file 'pi'.\n"),
+ 'D/G/rho' : Item("This is the file 'rho'.\n"),
+ 'D/G/tau' : Item("This is the file 'tau'.\n"),
+ 'D/gamma' : Item("This is the file 'gamma'.\n"),
+ 'D/H' : Item(),
+ 'D/H/chi' : Item("This is the file 'chi'.\n"),
+ 'D/H/psi' : Item("This is the file 'psi'.\n"),
+ 'D/H/omega' : Item("This is the file 'omega'.\n"),
+ })
+ expected_skip = wc.State(A_COPY_path, { })
+ svntest.actions.run_and_verify_merge(A_COPY_path, None, None,
+ sbox.repo_url + '/A', None,
+ expected_output,
+ expected_mergeinfo_output,
+ expected_elision_output,
+ expected_disk,
+ expected_status,
+ expected_skip,
+ None, None, None, None,
+ None, 1, 0)
+
+ # Commit the merge.
+ #sbox.simple_commit()
+
########################################################################
# Run the tests
@@ -19137,6 +19287,7 @@ test_list = [ None,
multiple_editor_drive_merge_notifications,
single_editor_drive_merge_notifications,
conflicted_split_merge_with_resolve,
+ merge_to_empty_target_merge_to_infinite_target,
]
if __name__ == '__main__':
Modified: subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/svntest/sandbox.py?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/tests/cmdline/svntest/sandbox.py Tue Jun 11 11:49:27 2013
@@ -362,6 +362,13 @@ class Sandbox:
DEST is a relpath relative to the WC."""
open(self.ospath(dest), truncate and 'w' or 'a').write(contents)
+ def simple_lock(self, *targets):
+ """Lock TARGETS in the WC.
+ TARGETS are relpaths relative to the WC."""
+ assert len(targets) > 0
+ targets = self.ospaths(targets)
+ svntest.main.run_svn(False, 'lock', *targets)
+
def is_url(target):
return (target.startswith('^/')
@@ -389,7 +396,7 @@ def _cleanup_test_path(path, retrying=Fa
logger.info("CLEANUP: %s", path)
try:
- svntest.main.safe_rmtree(path)
+ svntest.main.safe_rmtree(path, retrying)
except:
logger.info("WARNING: cleanup failed, will try again later")
_deferred_test_paths.append(path)
Modified: subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_subr/subst_translate-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_subr/subst_translate-test.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_subr/subst_translate-test.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_subr/subst_translate-test.c Tue Jun 11 11:49:27 2013
@@ -269,6 +269,10 @@ test_svn_subst_build_keywords3(apr_pool_
"trunk/foo.txt stsp foo.txt %",
"1234", "http://svn.example.com/repos/trunk/foo.txt",
"http://svn.example.com/repos", "stsp"},
+ {"FOO", "FOO=author%_=%_%a",
+ "author = stsp",
+ "1234", "http://svn.example.com/repos/trunk/foo.txt",
+ "http://svn.example.com/repos", "stsp"},
{"MyKeyword", "MyKeyword=%r%_%u%_%_%a",
"4567 http://svn.example.com/svn/branches/myfile jrandom",
"4567", "http://svn.example.com/svn/branches/myfile",
@@ -295,6 +299,7 @@ test_svn_subst_build_keywords3(apr_pool_
t->rev, t->url, t->repos_root_url,
0 /* date */, t->author, pool));
expanded_keyword = svn_hash_gets(kw, t->keyword_name);
+ SVN_TEST_ASSERT(expanded_keyword != NULL);
SVN_TEST_STRING_ASSERT(expanded_keyword->data, t->expanded_keyword);
}
Modified: subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/conflict-data-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/conflict-data-test.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/conflict-data-test.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/conflict-data-test.c Tue Jun 11 11:49:27 2013
@@ -28,6 +28,7 @@
#include <apr_hash.h>
#include <apr_tables.h>
+#include "svn_props.h"
#include "svn_pools.h"
#include "svn_hash.h"
#include "svn_types.h"
@@ -54,42 +55,128 @@ fail(apr_pool_t *pool, const char *fmt,
return svn_error_create(SVN_ERR_TEST_FAILED, 0, msg);
}
-/* Raise a test error if EXPECTED and ACTUAL differ. */
+/* Assert that two integers are equal. Return an error if not. */
+#define ASSERT_INT_EQ(a, b) \
+ do { \
+ if ((a) != (b)) \
+ return svn_error_createf(SVN_ERR_TEST_FAILED, NULL, \
+ "failed: ASSERT_INT_EQ(" #a ", " #b ") " \
+ "-> (%d == %d)", a, b); \
+ } while (0)
+
+/* Assert that two strings are equal or both null. Return an error if not. */
+#define ASSERT_STR_EQ(a, b) \
+ SVN_TEST_STRING_ASSERT(a, b)
+
+/* Assert that two version_t's are equal or both null. Return an error if not. */
+static svn_error_t *
+compare_version(const svn_wc_conflict_version_t *actual,
+ const svn_wc_conflict_version_t *expected)
+{
+ if (actual == NULL && expected == NULL)
+ return SVN_NO_ERROR;
+
+ SVN_TEST_ASSERT(actual && expected);
+ ASSERT_STR_EQ(actual->repos_url, expected->repos_url);
+ ASSERT_INT_EQ((int)actual->peg_rev, (int)expected->peg_rev);
+ ASSERT_STR_EQ(actual->path_in_repos, expected->path_in_repos);
+ ASSERT_INT_EQ(actual->node_kind, expected->node_kind);
+ return SVN_NO_ERROR;
+}
+
+/* Assert that two conflict descriptions contain exactly the same data
+ * (including names of temporary files), or are both NULL. Return an
+ * error if not. */
+static svn_error_t *
+compare_conflict(const svn_wc_conflict_description2_t *actual,
+ const svn_wc_conflict_description2_t *expected)
+{
+ if (actual == NULL && expected == NULL)
+ return SVN_NO_ERROR;
+
+ SVN_TEST_ASSERT(actual && expected);
+
+ ASSERT_INT_EQ(actual->kind, expected->kind);
+ ASSERT_STR_EQ(actual->local_abspath, expected->local_abspath);
+ ASSERT_INT_EQ(actual->node_kind, expected->node_kind);
+ ASSERT_STR_EQ(actual->property_name, expected->property_name);
+ ASSERT_INT_EQ(actual->is_binary, expected->is_binary);
+ ASSERT_STR_EQ(actual->mime_type, expected->mime_type);
+ ASSERT_INT_EQ(actual->action, expected->action);
+ ASSERT_INT_EQ(actual->reason, expected->reason);
+ ASSERT_STR_EQ(actual->base_abspath, expected->base_abspath);
+ ASSERT_STR_EQ(actual->their_abspath, expected->their_abspath);
+ ASSERT_STR_EQ(actual->my_abspath, expected->my_abspath);
+ ASSERT_STR_EQ(actual->merged_file, expected->merged_file);
+ ASSERT_INT_EQ(actual->operation, expected->operation);
+ SVN_ERR(compare_version(actual->src_left_version,
+ expected->src_left_version));
+ SVN_ERR(compare_version(actual->src_right_version,
+ expected->src_right_version));
+ return SVN_NO_ERROR;
+}
+
+/* Assert that a file contains the expected data. Return an
+ * error if not. */
static svn_error_t *
-compare_version(const svn_wc_conflict_version_t *expected,
- const svn_wc_conflict_version_t *actual)
+compare_file_content(const char *file_abspath,
+ const char *expected_val,
+ apr_pool_t *scratch_pool)
{
- SVN_TEST_STRING_ASSERT(expected->repos_url, actual->repos_url);
- SVN_TEST_ASSERT(expected->peg_rev == actual->peg_rev);
- SVN_TEST_STRING_ASSERT(expected->path_in_repos, actual->path_in_repos);
- SVN_TEST_ASSERT(expected->node_kind == actual->node_kind);
+ svn_stringbuf_t *actual_val;
+
+ SVN_ERR(svn_stringbuf_from_file2(&actual_val, file_abspath, scratch_pool));
+ ASSERT_STR_EQ(actual_val->data, expected_val);
return SVN_NO_ERROR;
}
-/* Raise a test error if EXPECTED and ACTUAL differ or if ACTUAL is NULL. */
-static svn_error_t *
-compare_conflict(const svn_wc_conflict_description2_t *expected,
- const svn_wc_conflict_description2_t *actual)
-{
- SVN_TEST_ASSERT(actual != NULL);
-
- SVN_TEST_STRING_ASSERT(expected->local_abspath, actual->local_abspath);
- SVN_TEST_ASSERT(expected->node_kind == actual->node_kind);
- SVN_TEST_ASSERT(expected->kind == actual->kind);
- SVN_TEST_STRING_ASSERT(expected->property_name, actual->property_name);
- SVN_TEST_ASSERT(expected->is_binary == actual->is_binary);
- SVN_TEST_STRING_ASSERT(expected->mime_type, actual->mime_type);
- SVN_TEST_ASSERT(expected->action == actual->action);
- SVN_TEST_ASSERT(expected->reason == actual->reason);
- SVN_TEST_STRING_ASSERT(expected->base_abspath, actual->base_abspath);
- SVN_TEST_STRING_ASSERT(expected->their_abspath, actual->their_abspath);
- SVN_TEST_STRING_ASSERT(expected->my_abspath, actual->my_abspath);
- SVN_TEST_STRING_ASSERT(expected->merged_file, actual->merged_file);
- SVN_TEST_ASSERT(expected->operation == actual->operation);
- SVN_ERR(compare_version(expected->src_left_version,
- actual->src_left_version));
- SVN_ERR(compare_version(expected->src_right_version,
- actual->src_right_version));
+/* Assert that ACTUAL and EXPECTED both represent the same property
+ * conflict, or are both NULL. Return an error if not.
+ *
+ * Compare the property values found in files named by
+ * ACTUAL->base_abspath, ACTUAL->my_abspath, ACTUAL->merged_abspath
+ * with EXPECTED_BASE_VAL, EXPECTED_MY_VAL, EXPECTED_THEIR_VAL
+ * respectively, ignoring the corresponding fields in EXPECTED. */
+static svn_error_t *
+compare_prop_conflict(const svn_wc_conflict_description2_t *actual,
+ const svn_wc_conflict_description2_t *expected,
+ const char *expected_base_val,
+ const char *expected_my_val,
+ const char *expected_their_val,
+ apr_pool_t *scratch_pool)
+{
+ if (actual == NULL && expected == NULL)
+ return SVN_NO_ERROR;
+
+ SVN_TEST_ASSERT(actual && expected);
+ ASSERT_INT_EQ(actual->kind, svn_wc_conflict_kind_property);
+ ASSERT_INT_EQ(expected->kind, svn_wc_conflict_kind_property);
+
+ ASSERT_STR_EQ(actual->local_abspath, expected->local_abspath);
+ ASSERT_INT_EQ(actual->node_kind, expected->node_kind);
+ ASSERT_STR_EQ(actual->property_name, expected->property_name);
+ ASSERT_INT_EQ(actual->action, expected->action);
+ ASSERT_INT_EQ(actual->reason, expected->reason);
+ ASSERT_INT_EQ(actual->operation, expected->operation);
+ SVN_ERR(compare_version(actual->src_left_version,
+ expected->src_left_version));
+ SVN_ERR(compare_version(actual->src_right_version,
+ expected->src_right_version));
+
+ SVN_ERR(compare_file_content(actual->base_abspath, expected_base_val,
+ scratch_pool));
+ SVN_ERR(compare_file_content(actual->my_abspath, expected_my_val,
+ scratch_pool));
+ /* Historical wart: for a prop conflict, 'theirs' is in the 'merged_file'
+ * field, and the conflict artifact file is in the 'theirs_abspath' field. */
+ SVN_ERR(compare_file_content(actual->merged_file, expected_their_val,
+ scratch_pool));
+ /*ASSERT_STR_EQ(actual->theirs_abspath, conflict_artifact_file));*/
+
+ /* These are 'undefined' for a prop conflict */
+ /*ASSERT_INT_EQ(actual->is_binary, expected->is_binary);*/
+ /*ASSERT_STR_EQ(actual->mime_type, expected->mime_type);*/
+
return SVN_NO_ERROR;
}
@@ -254,11 +341,11 @@ test_read_write_tree_conflicts(const svn
SVN_ERR(svn_wc__get_tree_conflict(&read_conflict, sbox.wc_ctx,
child1_abspath, pool, pool));
- SVN_ERR(compare_conflict(conflict1, read_conflict));
+ SVN_ERR(compare_conflict(read_conflict, conflict1));
SVN_ERR(svn_wc__get_tree_conflict(&read_conflict, sbox.wc_ctx,
child2_abspath, pool, pool));
- SVN_ERR(compare_conflict(conflict2, read_conflict));
+ SVN_ERR(compare_conflict(read_conflict, conflict2));
}
/* Read many */
@@ -540,6 +627,186 @@ test_serialize_tree_conflict(const svn_t
return SVN_NO_ERROR;
}
+/* A conflict resolver callback baton for test_prop_conflicts(). */
+typedef struct test_prop_conflict_baton_t
+{
+ /* Sets of properties. */
+ apr_hash_t *mine;
+ apr_hash_t *their_old;
+ apr_hash_t *theirs;
+ /* The set of prop names in conflict. */
+ apr_hash_t *conflicts;
+
+ /* We use all the fields of DESC except the base/theirs/mine/merged paths. */
+ svn_wc_conflict_description2_t *desc;
+
+ int conflicts_seen;
+} test_prop_conflict_baton_t;
+
+/* Set *CONFLICT_SKEL_P to a new property conflict skel reflecting the
+ * conflict details given in B. */
+static svn_error_t *
+create_prop_conflict_skel(svn_skel_t **conflict_skel_p,
+ svn_wc_context_t *wc_ctx,
+ const test_prop_conflict_baton_t *b,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_skel_t *conflict_skel = svn_wc__conflict_skel_create(result_pool);
+ const char *marker_abspath;
+ svn_boolean_t complete;
+
+ SVN_ERR(svn_io_write_unique(&marker_abspath,
+ b->desc->local_abspath,
+ "conflict-artifact-file-content\n", 6,
+ svn_io_file_del_none, scratch_pool));
+
+ SVN_ERR(svn_wc__conflict_skel_add_prop_conflict(conflict_skel,
+ wc_ctx->db,
+ b->desc->local_abspath,
+ marker_abspath,
+ b->mine, b->their_old,
+ b->theirs, b->conflicts,
+ result_pool, scratch_pool));
+
+ switch (b->desc->operation)
+ {
+ case svn_wc_operation_update:
+ SVN_ERR(svn_wc__conflict_skel_set_op_update(
+ conflict_skel,
+ b->desc->src_left_version, b->desc->src_right_version,
+ result_pool, scratch_pool));
+ break;
+ case svn_wc_operation_switch:
+ SVN_ERR(svn_wc__conflict_skel_set_op_switch(
+ conflict_skel,
+ b->desc->src_left_version, b->desc->src_right_version,
+ result_pool, scratch_pool));
+ break;
+ case svn_wc_operation_merge:
+ SVN_ERR(svn_wc__conflict_skel_set_op_merge(
+ conflict_skel,
+ b->desc->src_left_version, b->desc->src_right_version,
+ result_pool, scratch_pool));
+ break;
+ default:
+ SVN_ERR_MALFUNCTION();
+ }
+
+ SVN_ERR(svn_wc__conflict_skel_is_complete(&complete, conflict_skel));
+ SVN_TEST_ASSERT(complete);
+ *conflict_skel_p = conflict_skel;
+ return SVN_NO_ERROR;
+}
+
+/* A conflict resolver callback for test_prop_conflicts(), that checks
+ * that the conflict described to it matches the one described in BATON,
+ * and also counts the number of times it is called. */
+static svn_error_t *
+prop_conflict_cb(svn_wc_conflict_result_t **result_p,
+ const svn_wc_conflict_description2_t *desc,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ test_prop_conflict_baton_t *b = baton;
+
+ SVN_ERR(compare_prop_conflict(
+ desc, b->desc,
+ svn_prop_get_value(b->their_old, desc->property_name),
+ svn_prop_get_value(b->mine, desc->property_name),
+ svn_prop_get_value(b->theirs, desc->property_name),
+ scratch_pool));
+ b->conflicts_seen++;
+
+ *result_p = svn_wc_create_conflict_result(svn_wc_conflict_choose_postpone,
+ NULL /*merged_file*/, result_pool);
+ return SVN_NO_ERROR;
+}
+
+/* Test for correct retrieval of property conflict descriptions from
+ * the WC DB.
+ *
+ * Presently it tests just one prop conflict, and only during the
+ * 'resolve' operation. We should also test during the 'update'/
+ * 'switch'/'merge' operations.
+ */
+static svn_error_t *
+test_prop_conflicts(const svn_test_opts_t *opts,
+ apr_pool_t *pool)
+{
+ svn_test__sandbox_t sbox;
+ svn_skel_t *conflict_skel;
+ svn_error_t *err;
+ const char *lock_abspath;
+ test_prop_conflict_baton_t *b = apr_pcalloc(pool, sizeof(*b));
+ svn_wc_conflict_description2_t *desc = apr_pcalloc(pool, sizeof(*b));
+
+ SVN_ERR(svn_test__sandbox_create(&sbox, "test_prop_conflicts", opts, pool));
+
+ /* Describe a property conflict */
+ b->mine = apr_hash_make(pool);
+ b->their_old = apr_hash_make(pool);
+ b->theirs = apr_hash_make(pool);
+ b->conflicts = apr_hash_make(pool);
+ svn_hash_sets(b->mine, "prop", svn_string_create("Mine", pool));
+ svn_hash_sets(b->their_old, "prop", svn_string_create("Their-Old", pool));
+ svn_hash_sets(b->theirs, "prop", svn_string_create("Theirs", pool));
+ svn_hash_sets(b->conflicts, "prop", "");
+
+ b->desc = desc;
+ desc->local_abspath = sbox.wc_abspath;
+ desc->kind = svn_wc_conflict_kind_property;
+ desc->node_kind = svn_node_dir;
+ desc->operation = svn_wc_operation_update;
+ desc->action = svn_wc_conflict_action_edit;
+ desc->reason = svn_wc_conflict_reason_edited;
+ desc->mime_type = NULL;
+ desc->is_binary = FALSE;
+ desc->property_name = "prop";
+ desc->src_left_version
+ = svn_wc_conflict_version_create2(sbox.repos_url, "uuid",
+ "trunk", 12, svn_node_dir, pool);
+ desc->src_right_version = NULL; /* WC only */
+
+ b->conflicts_seen = 0;
+
+ /* Record a conflict */
+ {
+ apr_pool_t *subpool = svn_pool_create(pool);
+ SVN_ERR(create_prop_conflict_skel(&conflict_skel, sbox.wc_ctx, b,
+ pool, subpool));
+ svn_pool_clear(subpool);
+ SVN_ERR(svn_wc__db_op_mark_conflict(sbox.wc_ctx->db,
+ sbox.wc_abspath,
+ conflict_skel, NULL, subpool));
+ svn_pool_destroy(subpool);
+ }
+
+ /* Test the API for resolving the conflict: check that correct details
+ * of the conflict are returned. */
+ SVN_ERR(svn_wc__acquire_write_lock_for_resolve(&lock_abspath, sbox.wc_ctx,
+ sbox.wc_abspath, pool, pool));
+ err = svn_wc__resolve_conflicts(sbox.wc_ctx, sbox.wc_abspath,
+ svn_depth_empty,
+ FALSE /* resolve_text */,
+ "" /* resolve_prop (ALL props) */,
+ FALSE /* resolve_tree */,
+ svn_wc_conflict_choose_unspecified,
+ prop_conflict_cb, b,
+ NULL, NULL, /* cancellation */
+ NULL, NULL, /* notification */
+ pool);
+
+ SVN_ERR(svn_error_compose_create(err,
+ svn_wc__release_write_lock(sbox.wc_ctx,
+ lock_abspath,
+ pool)));
+
+ ASSERT_INT_EQ(b->conflicts_seen, 1);
+ return SVN_NO_ERROR;
+}
+
/* The test table. */
struct svn_test_descriptor_t test_funcs[] =
@@ -557,6 +824,8 @@ struct svn_test_descriptor_t test_funcs[
"read and write a text conflict"),
SVN_TEST_OPTS_PASS(test_serialize_tree_conflict,
"read and write a tree conflict"),
+ SVN_TEST_OPTS_PASS(test_prop_conflicts,
+ "test prop conflicts"),
SVN_TEST_NULL
};
Modified: subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/db-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/db-test.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/db-test.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/db-test.c Tue Jun 11 11:49:27 2013
@@ -343,6 +343,8 @@ create_open(svn_wc__db_t **db,
SVN_ERR(svn_wc__db_open(db, NULL, FALSE, TRUE, pool, pool));
SVN_ERR(svn_test__create_fake_wc(*local_abspath, TESTING_DATA, pool, pool));
+ svn_test_add_dir_cleanup(*local_abspath);
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/entries-compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/entries-compat.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/entries-compat.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/entries-compat.c Tue Jun 11 11:49:27 2013
@@ -336,6 +336,8 @@ create_open(svn_wc__db_t **db,
TRUE /* enforce_empty_wq */,
pool, pool));
+ svn_test_add_dir_cleanup(*local_abspath);
+
return SVN_NO_ERROR;
}
Modified: subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/wc-queries-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/wc-queries-test.c?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/wc-queries-test.c (original)
+++ subversion/branches/javahl-1.8-extensions/subversion/tests/libsvn_wc/wc-queries-test.c Tue Jun 11 11:49:27 2013
@@ -32,6 +32,17 @@
#ifdef SVN_SQLITE_INLINE
/* Include sqlite3 inline, making all symbols private. */
#define SQLITE_API static
+ #ifdef __APPLE__
+ #include <Availability.h>
+ #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+ /* <libkern/OSAtomic.h> is included on OS X by sqlite3.c, and
+ on old systems (Leopard or older), it cannot be compiled
+ with -std=c89 because it uses inline. This is a work-around. */
+ #define inline __inline__
+ #include <libkern/OSAtomic.h>
+ #undef inline
+ #endif
+ #endif
#include <sqlite3.c>
#else
#include <sqlite3.h>
Modified: subversion/branches/javahl-1.8-extensions/tools/server-side/svnpubsub/commit-hook.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/tools/server-side/svnpubsub/commit-hook.py?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/tools/server-side/svnpubsub/commit-hook.py (original)
+++ subversion/branches/javahl-1.8-extensions/tools/server-side/svnpubsub/commit-hook.py Tue Jun 11 11:49:27 2013
@@ -19,6 +19,9 @@
SVNLOOK="/usr/local/svn-install/current/bin/svnlook"
#SVNLOOK="/usr/local/bin/svnlook"
+HOST="127.0.0.1"
+PORT=2069
+
import sys
import subprocess
try:
@@ -28,9 +31,6 @@ except ImportError:
import urllib2
-HOST="127.0.0.1"
-PORT=2069
-
def svncmd(cmd):
return subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
@@ -86,8 +86,8 @@ def main(repo, revision):
do_put(body)
if __name__ == "__main__":
- if len(sys.argv) != 3:
- print "invalid args"
+ if len(sys.argv) not in (3, 4):
+ sys.stderr.write("invalid args\n")
sys.exit(0)
- main(sys.argv[1], sys.argv[2])
+ main(*sys.argv[1:3])
Modified: subversion/branches/javahl-1.8-extensions/tools/server-side/svnpubsub/svnpubsub/server.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-1.8-extensions/tools/server-side/svnpubsub/svnpubsub/server.py?rev=1491757&r1=1491756&r2=1491757&view=diff
==============================================================================
--- subversion/branches/javahl-1.8-extensions/tools/server-side/svnpubsub/svnpubsub/server.py (original)
+++ subversion/branches/javahl-1.8-extensions/tools/server-side/svnpubsub/svnpubsub/server.py Tue Jun 11 11:49:27 2013
@@ -152,7 +152,7 @@ class Client(object):
self.r.write(str(input))
def write_start(self):
- self.r.setHeader('content-type', 'application/json')
+ self.r.setHeader('content-type', 'application/vnd.apache.vc-notify+json')
self.write('{"svnpubsub": {"version": 1}}\n\0')
def write_heartbeat(self):