You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/11/27 12:52:46 UTC
svn commit: r1546002 [20/39] - in /subversion/branches/verify-keep-going: ./
build/ build/ac-macros/ build/generator/ build/generator/swig/
build/generator/templates/ build/win32/ contrib/client-side/emacs/
contrib/server-side/ contrib/server-side/svnc...
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/time.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/time.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/time.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/time.c Wed Nov 27 11:52:35 2013
@@ -34,6 +34,8 @@
#include "svn_error.h"
#include "svn_private_config.h"
+#include "private/svn_string_private.h"
+
/*** Code. ***/
@@ -82,7 +84,7 @@
/* Machine parseable part, generated by apr_snprintf. */
#define HUMAN_TIMESTAMP_FORMAT "%.4d-%.2d-%.2d %.2d:%.2d:%.2d %+.2d%.2d"
/* Human explanatory part, generated by apr_strftime as "Sat, 01 Jan 2000" */
-#define human_timestamp_format_suffix _(" (%a, %d %b %Y)")
+#define HUMAN_TIMESTAMP_FORMAT_SUFFIX _(" (%a, %d %b %Y)")
const char *
svn_time_to_cstring(apr_time_t when, apr_pool_t *pool)
@@ -135,24 +137,24 @@ svn_time_from_cstring(apr_time_t *when,
apr_time_exp_t exploded_time;
apr_status_t apr_err;
char wday[4], month[4];
- char *c;
+ const char *c;
/* Open-code parsing of the new timestamp format, as this
is a hot path for reading the entries file. This format looks
like: "2001-08-31T04:24:14.966996Z" */
- exploded_time.tm_year = (apr_int32_t) strtol(data, &c, 10);
+ exploded_time.tm_year = (apr_int32_t) svn__strtoul(data, &c);
if (*c++ != '-') goto fail;
- exploded_time.tm_mon = (apr_int32_t) strtol(c, &c, 10);
+ exploded_time.tm_mon = (apr_int32_t) svn__strtoul(c, &c);
if (*c++ != '-') goto fail;
- exploded_time.tm_mday = (apr_int32_t) strtol(c, &c, 10);
+ exploded_time.tm_mday = (apr_int32_t) svn__strtoul(c, &c);
if (*c++ != 'T') goto fail;
- exploded_time.tm_hour = (apr_int32_t) strtol(c, &c, 10);
+ exploded_time.tm_hour = (apr_int32_t) svn__strtoul(c, &c);
if (*c++ != ':') goto fail;
- exploded_time.tm_min = (apr_int32_t) strtol(c, &c, 10);
+ exploded_time.tm_min = (apr_int32_t) svn__strtoul(c, &c);
if (*c++ != ':') goto fail;
- exploded_time.tm_sec = (apr_int32_t) strtol(c, &c, 10);
+ exploded_time.tm_sec = (apr_int32_t) svn__strtoul(c, &c);
if (*c++ != '.') goto fail;
- exploded_time.tm_usec = (apr_int32_t) strtol(c, &c, 10);
+ exploded_time.tm_usec = (apr_int32_t) svn__strtoul(c, &c);
if (*c++ != 'Z') goto fail;
exploded_time.tm_year -= 1900;
@@ -245,7 +247,7 @@ svn_time_to_human_cstring(apr_time_t whe
ret = apr_strftime(human_datestr,
&retlen,
SVN_TIME__MAX_LENGTH - len,
- human_timestamp_format_suffix,
+ HUMAN_TIMESTAMP_FORMAT_SUFFIX,
&exploded_time);
/* If there was an error, ensure that the string is zero-terminated. */
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/types.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/types.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/types.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/types.c Wed Nov 27 11:52:35 2013
@@ -24,12 +24,12 @@
#include <apr_pools.h>
#include <apr_uuid.h>
+#include "svn_private_config.h"
#include "svn_hash.h"
#include "svn_types.h"
#include "svn_error.h"
#include "svn_string.h"
#include "svn_props.h"
-#include "svn_private_config.h"
#include "private/svn_dep_compat.h"
#include "private/svn_string_private.h"
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/username_providers.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/username_providers.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/username_providers.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/username_providers.c Wed Nov 27 11:52:35 2013
@@ -28,6 +28,8 @@
/*** Includes. ***/
#include <apr_pools.h>
+
+#include "svn_private_config.h"
#include "svn_hash.h"
#include "svn_auth.h"
#include "svn_error.h"
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/utf.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/utf.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/utf.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/utf.c Wed Nov 27 11:52:35 2013
@@ -32,13 +32,13 @@
#include <apr_xlate.h>
#include <apr_atomic.h>
+#include "svn_private_config.h"
#include "svn_hash.h"
#include "svn_string.h"
#include "svn_error.h"
#include "svn_pools.h"
#include "svn_ctype.h"
#include "svn_utf.h"
-#include "svn_private_config.h"
#include "win32_xlate.h"
#include "private/svn_utf_private.h"
@@ -172,7 +172,7 @@ get_xlate_key(const char *topage,
topage = "APR_DEFAULT_CHARSET";
return apr_pstrcat(pool, "svn-utf-", frompage, "to", topage,
- "-xlate-handle", (char *)NULL);
+ "-xlate-handle", SVN_VA_NULL);
}
/* Atomically replace the content in *MEM with NEW_VALUE and return
@@ -212,6 +212,7 @@ xlate_alloc_handle(xlate_handle_node_t *
{
apr_status_t apr_err;
apr_xlate_t *handle;
+ const char *name;
/* The error handling doesn't support the following cases, since we don't
use them currently. Catch this here. */
@@ -224,8 +225,10 @@ xlate_alloc_handle(xlate_handle_node_t *
#if defined(WIN32)
apr_err = svn_subr__win32_xlate_open((win32_xlate_t **)&handle, topage,
frompage, pool);
+ name = "win32-xlate: ";
#else
apr_err = apr_xlate_open(&handle, topage, frompage, pool);
+ name = "APR: ";
#endif
if (APR_STATUS_IS_EINVAL(apr_err) || APR_STATUS_IS_ENOTIMPL(apr_err))
@@ -233,6 +236,8 @@ xlate_alloc_handle(xlate_handle_node_t *
else if (apr_err != APR_SUCCESS)
{
const char *errstr;
+ char apr_strerr[512];
+
/* Can't use svn_error_wrap_apr here because it calls functions in
this file, leading to infinite recursion. */
if (frompage == SVN_APR_LOCALE_CHARSET)
@@ -248,7 +253,13 @@ xlate_alloc_handle(xlate_handle_node_t *
_("Can't create a character converter from "
"'%s' to '%s'"), frompage, topage);
- return svn_error_create(apr_err, NULL, errstr);
+ /* Just put the error on the stack, since svn_error_create duplicates it
+ later. APR_STRERR will be in the local encoding, not in UTF-8, though.
+ */
+ svn_strerror(apr_err, apr_strerr, sizeof(apr_strerr));
+ return svn_error_createf(SVN_ERR_PLUGIN_LOAD_FAILURE,
+ svn_error_create(apr_err, NULL, apr_strerr),
+ "%s%s", name, errstr);
}
/* Allocate and initialize the node. */
@@ -469,58 +480,6 @@ get_uton_xlate_handle_node(xlate_handle_
}
-/* Copy LEN bytes of SRC, converting non-ASCII and zero bytes to ?\nnn
- sequences, allocating the result in POOL. */
-static const char *
-fuzzy_escape(const char *src, apr_size_t len, apr_pool_t *pool)
-{
- const char *src_orig = src, *src_end = src + len;
- apr_size_t new_len = 0;
- char *new;
- const char *new_orig;
-
- /* First count how big a dest string we'll need. */
- while (src < src_end)
- {
- if (! svn_ctype_isascii(*src) || *src == '\0')
- new_len += 5; /* 5 slots, for "?\XXX" */
- else
- new_len += 1; /* one slot for the 7-bit char */
-
- src++;
- }
-
- /* Allocate that amount, plus one slot for '\0' character. */
- new = apr_palloc(pool, new_len + 1);
-
- new_orig = new;
-
- /* And fill it up. */
- while (src_orig < src_end)
- {
- if (! svn_ctype_isascii(*src_orig) || src_orig == '\0')
- {
- /* This is the same format as svn_xml_fuzzy_escape uses, but that
- function escapes different characters. Please keep in sync!
- ### If we add another fuzzy escape somewhere, we should abstract
- ### this out to a common function. */
- apr_snprintf(new, 6, "?\\%03u", (unsigned char) *src_orig);
- new += 5;
- }
- else
- {
- *new = *src_orig;
- new += 1;
- }
-
- src_orig++;
- }
-
- *new = '\0';
-
- return new_orig;
-}
-
/* Convert SRC_LENGTH bytes of SRC_DATA in NODE->handle, store the result
in *DEST, which is allocated in POOL. */
static svn_error_t *
@@ -598,8 +557,8 @@ convert_to_stringbuf(xlate_handle_node_t
(pool, _("Can't convert string from '%s' to '%s':"),
node->frompage, node->topage);
- err = svn_error_create(apr_err, NULL, fuzzy_escape(src_data,
- src_length, pool));
+ err = svn_error_create(
+ apr_err, NULL, svn_utf__fuzzy_escape(src_data, src_length, pool));
return svn_error_create(apr_err, err, errstr);
}
/* Else, exited due to success. Trim the result buffer down to the
@@ -680,7 +639,7 @@ invalid_utf8(const char *data, apr_size_
valid_txt = apr_pstrcat(pool, valid_txt,
apr_psprintf(pool, " %02x",
(unsigned char)last[i-valid]),
- (char *)NULL);
+ SVN_VA_NULL);
/* 4 invalid octets will guarantee that the faulty octet is displayed */
invalid = data + len - last;
@@ -690,7 +649,7 @@ invalid_utf8(const char *data, apr_size_
invalid_txt = apr_pstrcat(pool, invalid_txt,
apr_psprintf(pool, " %02x",
(unsigned char)last[i]),
- (char *)NULL);
+ SVN_VA_NULL);
return svn_error_createf(APR_EINVAL, NULL,
_("Valid UTF-8 data\n(hex:%s)\n"
@@ -975,18 +934,6 @@ svn_utf_cstring_from_utf8_ex2(const char
return err;
}
-
-svn_error_t *
-svn_utf_cstring_from_utf8_ex(const char **dest,
- const char *src,
- const char *topage,
- const char *convset_key,
- apr_pool_t *pool)
-{
- return svn_utf_cstring_from_utf8_ex2(dest, src, topage, pool);
-}
-
-
const char *
svn_utf__cstring_from_utf8_fuzzy(const char *src,
apr_pool_t *pool,
@@ -996,7 +943,7 @@ svn_utf__cstring_from_utf8_fuzzy(const c
const char *escaped, *converted;
svn_error_t *err;
- escaped = fuzzy_escape(src, strlen(src), pool);
+ escaped = svn_utf__fuzzy_escape(src, strlen(src), pool);
/* Okay, now we have a *new* UTF-8 string, one that's guaranteed to
contain only 7-bit bytes :-). Recode to native... */
@@ -1073,3 +1020,85 @@ svn_utf_cstring_from_utf8_string(const c
return err;
}
+
+
+#ifdef WIN32
+
+
+svn_error_t *
+svn_utf__win32_utf8_to_utf16(const WCHAR **result,
+ const char *src,
+ const WCHAR *prefix,
+ apr_pool_t *result_pool)
+{
+ const int utf8_count = strlen(src);
+ const int prefix_len = (prefix ? lstrlenW(prefix) : 0);
+ WCHAR *wide_str;
+ int wide_count;
+
+ if (0 == prefix_len + utf8_count)
+ {
+ *result = L"";
+ return SVN_NO_ERROR;
+ }
+
+ wide_count = MultiByteToWideChar(CP_UTF8, 0, src, utf8_count, NULL, 0);
+ if (wide_count == 0)
+ return svn_error_wrap_apr(apr_get_os_error(),
+ _("Conversion to UTF-16 failed"));
+
+ wide_str = apr_palloc(result_pool,
+ (prefix_len + wide_count + 1) * sizeof(*wide_str));
+ if (prefix_len)
+ memcpy(wide_str, prefix, prefix_len * sizeof(*wide_str));
+ if (0 == MultiByteToWideChar(CP_UTF8, 0, src, utf8_count,
+ wide_str + prefix_len, wide_count))
+ return svn_error_wrap_apr(apr_get_os_error(),
+ _("Conversion to UTF-16 failed"));
+
+ wide_str[prefix_len + wide_count] = 0;
+ *result = wide_str;
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_utf__win32_utf16_to_utf8(const char **result,
+ const WCHAR *src,
+ const char *prefix,
+ apr_pool_t *result_pool)
+{
+ const int wide_count = lstrlenW(src);
+ const int prefix_len = (prefix ? strlen(prefix) : 0);
+ char *utf8_str;
+ int utf8_count;
+
+ if (0 == prefix_len + wide_count)
+ {
+ *result = "";
+ return SVN_NO_ERROR;
+ }
+
+ utf8_count = WideCharToMultiByte(CP_UTF8, 0, src, wide_count,
+ NULL, 0, NULL, FALSE);
+ if (utf8_count == 0)
+ return svn_error_wrap_apr(apr_get_os_error(),
+ _("Conversion from UTF-16 failed"));
+
+ utf8_str = apr_palloc(result_pool,
+ (prefix_len + utf8_count + 1) * sizeof(*utf8_str));
+ if (prefix_len)
+ memcpy(utf8_str, prefix, prefix_len * sizeof(*utf8_str));
+ if (0 == WideCharToMultiByte(CP_UTF8, 0, src, wide_count,
+ utf8_str + prefix_len, utf8_count,
+ NULL, FALSE))
+ return svn_error_wrap_apr(apr_get_os_error(),
+ _("Conversion from UTF-16 failed"));
+
+ utf8_str[prefix_len + utf8_count] = 0;
+ *result = utf8_str;
+
+ return SVN_NO_ERROR;
+}
+
+#endif /* WIN32 */
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc.c Wed Nov 27 11:52:35 2013
@@ -37,7 +37,6 @@
const char *svn_utf__utf8proc_version(void)
{
/* Unused static function warning removal hack. */
- UNUSED(utf8proc_codepoint_valid);
UNUSED(utf8proc_NFD);
UNUSED(utf8proc_NFC);
UNUSED(utf8proc_NFKD);
@@ -48,19 +47,21 @@ const char *svn_utf__utf8proc_version(vo
-/* Fill the given BUFFER with an NFD UCS-4 representation of the UTF-8
- * STRING. If LENGTH is SVN_UTF__UNKNOWN_LENGTH, assume STRING is
- * NUL-terminated; otherwise look only at the first LENGTH bytes in
+/* Fill the given BUFFER with decomposed UCS-4 representation of the
+ * UTF-8 STRING. If LENGTH is SVN_UTF__UNKNOWN_LENGTH, assume STRING
+ * is NUL-terminated; otherwise look only at the first LENGTH bytes in
* STRING. Upon return, BUFFER->data points at an array of UCS-4
- * characters and *RESULT_LENGTH contains the length of the array.
+ * characters, and return the length of the array. TRANSFORM_FLAGS
+ * define exactly how the decomposition is performed.
*
- * A returned error may indicate that STRING contains invalid UTF-8 or
- * invalid Unicode codepoints. Any error message comes from utf8proc.
+ * A negative return value is an utf8proc error code and may indicate
+ * that STRING contains invalid UTF-8 or was so long that an overflow
+ * occurred.
*/
-static svn_error_t *
-decompose_normalized(apr_size_t *result_length,
- const char *string, apr_size_t length,
- svn_membuf_t *buffer)
+static ssize_t
+unicode_decomposition(int transform_flags,
+ const char *string, apr_size_t length,
+ svn_membuf_t *buffer)
{
const int nullterm = (length == SVN_UTF__UNKNOWN_LENGTH
? UTF8PROC_NULLTERM : 0);
@@ -71,23 +72,66 @@ decompose_normalized(apr_size_t *result_
const ssize_t ucs4len = buffer->size / sizeof(*ucs4buf);
const ssize_t result =
utf8proc_decompose((const void*) string, length, ucs4buf, ucs4len,
- UTF8PROC_DECOMPOSE | UTF8PROC_STABLE | nullterm);
-
- if (result < 0)
- return svn_error_create(SVN_ERR_UTF8PROC_ERROR, NULL,
- gettext(utf8proc_errmsg(result)));
+ UTF8PROC_DECOMPOSE | UTF8PROC_STABLE
+ | transform_flags | nullterm);
- if (result <= ucs4len)
- {
- *result_length = result;
- return SVN_NO_ERROR;
- }
+ if (result < 0 || result <= ucs4len)
+ return result;
/* Increase the decomposition buffer size and retry */
svn_membuf__ensure(buffer, result * sizeof(*ucs4buf));
}
}
+/* Fill the given BUFFER with an NFD UCS-4 representation of the UTF-8
+ * STRING. If LENGTH is SVN_UTF__UNKNOWN_LENGTH, assume STRING is
+ * NUL-terminated; otherwise look only at the first LENGTH bytes in
+ * STRING. Upon return, BUFFER->data points at an array of UCS-4
+ * characters and *RESULT_LENGTH contains the length of the array.
+ *
+ * A returned error may indicate that STRING contains invalid UTF-8 or
+ * invalid Unicode codepoints. Any error message comes from utf8proc.
+ */
+static svn_error_t *
+decompose_normalized(apr_size_t *result_length,
+ const char *string, apr_size_t length,
+ svn_membuf_t *buffer)
+{
+ ssize_t result = unicode_decomposition(0, string, length, buffer);
+ if (result < 0)
+ return svn_error_create(SVN_ERR_UTF8PROC_ERROR, NULL,
+ gettext(utf8proc_errmsg(result)));
+ *result_length = result;
+ return SVN_NO_ERROR;
+}
+
+/* Fill the given BUFFER with an NFC UTF-8 representation of the UTF-8
+ * STRING. If LENGTH is SVN_UTF__UNKNOWN_LENGTH, assume STRING is
+ * NUL-terminated; otherwise look only at the first LENGTH bytes in
+ * STRING. Upon return, BUFFER->data points at a NUL-terminated string
+ * of UTF-8 characters.
+ *
+ * A returned error may indicate that STRING contains invalid UTF-8 or
+ * invalid Unicode codepoints. Any error message comes from utf8proc.
+ */
+static svn_error_t *
+normalize_cstring(apr_size_t *result_length,
+ const char *string, apr_size_t length,
+ svn_membuf_t *buffer)
+{
+ ssize_t result = unicode_decomposition(0, string, length, buffer);
+ if (result >= 0)
+ {
+ svn_membuf__resize(buffer, result * sizeof(apr_int32_t) + 1);
+ result = utf8proc_reencode(buffer->data, result,
+ UTF8PROC_COMPOSE | UTF8PROC_STABLE);
+ }
+ if (result < 0)
+ return svn_error_create(SVN_ERR_UTF8PROC_ERROR, NULL,
+ gettext(utf8proc_errmsg(result)));
+ *result_length = result;
+ return SVN_NO_ERROR;
+}
/* Compare two arrays of UCS-4 codes, BUFA of length LENA and BUFB of
* length LENB. Return 0 if they're equal, a negative value if BUFA is
@@ -111,7 +155,6 @@ ucs4cmp(const apr_int32_t *bufa, apr_siz
return (lena == lenb ? 0 : (lena < lenb ? -1 : 1));
}
-
svn_error_t *
svn_utf__normcmp(int *result,
const char *str1, apr_size_t len1,
@@ -138,6 +181,16 @@ svn_utf__normcmp(int *result,
return SVN_NO_ERROR;
}
+svn_error_t*
+svn_utf__normalize(const char **result,
+ const char *str, apr_size_t len,
+ svn_membuf_t *buf)
+{
+ apr_size_t result_length;
+ SVN_ERR(normalize_cstring(&result_length, str, len, buf));
+ *result = (const char*)(buf->data);
+ return SVN_NO_ERROR;
+}
/* Decode a single UCS-4 code point to UTF-8, appending the result to BUFFER.
* Assume BUFFER is already filled to *LENGTH and return the new size there.
@@ -288,3 +341,181 @@ svn_utf__glob(svn_boolean_t *match,
*match = !apr_fnmatch(pattern_buf->data, string_buf->data, 0);
return SVN_NO_ERROR;
}
+
+svn_boolean_t
+svn_utf__is_normalized(const char *string, apr_pool_t *scratch_pool)
+{
+ svn_error_t *err;
+ svn_membuf_t buffer;
+ apr_size_t result_length;
+ const apr_size_t length = strlen(string);
+ svn_membuf__create(&buffer, length * sizeof(apr_int32_t), scratch_pool);
+ err = normalize_cstring(&result_length, string, length, &buffer);
+ if (err)
+ {
+ svn_error_clear(err);
+ return FALSE;
+ }
+ return (length == result_length && 0 == strcmp(string, buffer.data));
+}
+
+const char *
+svn_utf__fuzzy_escape(const char *src, apr_size_t length, apr_pool_t *pool)
+{
+ /* Hexadecimal digits for code conversion. */
+ static const char digits[] = "0123456789ABCDEF";
+
+ /* Flags used for Unicode decomposition. */
+ static const int decomp_flags = (
+ UTF8PROC_COMPAT | UTF8PROC_STABLE | UTF8PROC_LUMP
+ | UTF8PROC_NLF2LF | UTF8PROC_STRIPCC | UTF8PROC_STRIPMARK);
+
+ svn_stringbuf_t *result;
+ svn_membuf_t buffer;
+ ssize_t decomp_length;
+ ssize_t len;
+
+ /* Decompose to a non-reversible compatibility format. */
+ svn_membuf__create(&buffer, length * sizeof(apr_int32_t), pool);
+ decomp_length = unicode_decomposition(decomp_flags, src, length, &buffer);
+ if (decomp_length < 0)
+ {
+ svn_membuf_t part;
+ apr_size_t done, prev;
+
+ /* The only other error we can receive here indicates an integer
+ overflow due to the length of the input string. Not very
+ likely, but we certainly shouldn't continue in that case. */
+ SVN_ERR_ASSERT_NO_RETURN(decomp_length == UTF8PROC_ERROR_INVALIDUTF8);
+
+ /* Break the decomposition into parts that are valid UTF-8, and
+ bytes that are not. Represent the invalid bytes in the target
+ erray by their negative value. This works because utf8proc
+ will not generate Unicode code points with values larger than
+ U+10FFFF. */
+ svn_membuf__create(&part, sizeof(apr_int32_t), pool);
+ decomp_length = 0;
+ done = prev = 0;
+ while (done < length)
+ {
+ apr_int32_t uc;
+
+ while (done < length)
+ {
+ len = utf8proc_iterate((uint8_t*)src + done, length - done, &uc);
+ if (len < 0)
+ break;
+ done += len;
+ }
+
+ /* Decompose the valid part */
+ if (done > prev)
+ {
+ len = unicode_decomposition(
+ decomp_flags, src + prev, done - prev, &part);
+ SVN_ERR_ASSERT_NO_RETURN(len > 0);
+ svn_membuf__resize(
+ &buffer, (decomp_length + len) * sizeof(apr_int32_t));
+ memcpy((apr_int32_t*)buffer.data + decomp_length,
+ part.data, len * sizeof(apr_int32_t));
+ decomp_length += len;
+ prev = done;
+ }
+
+ /* What follows could be a valid UTF-8 sequence, but not
+ a valid Unicode character. */
+ if (done < length)
+ {
+ const char *last;
+
+ /* Determine the length of the UTF-8 sequence */
+ const char *const p = src + done;
+ len = utf8proc_utf8class[(uint8_t)*p];
+
+ /* Check if the multi-byte sequence is valid UTF-8. */
+ if (len > 1 && len <= (apr_ssize_t)(length - done))
+ last = svn_utf__last_valid(p, len);
+ else
+ last = NULL;
+
+ /* Might not be a valid UTF-8 sequence at all */
+ if (!last || (last && last - p < len))
+ {
+ uc = -((apr_int32_t)(*p & 0xff));
+ len = 1;
+ }
+ else
+ {
+ switch (len)
+ {
+ /* Decode the UTF-8 sequence without validation. */
+ case 2:
+ uc = ((p[0] & 0x1f) << 6) + (p[1] & 0x3f);
+ break;
+ case 3:
+ uc = (((p[0] & 0x0f) << 12) + ((p[1] & 0x3f) << 6)
+ + (p[2] & 0x3f));
+ break;
+ case 4:
+ uc = (((p[0] & 0x07) << 18) + ((p[1] & 0x3f) << 12)
+ + ((p[2] & 0x3f) << 6) + (p[3] & 0x3f));
+ break;
+ default:
+ SVN_ERR_ASSERT_NO_RETURN(
+ !"Unexpected invalid UTF-8 byte");
+ }
+
+ }
+
+ svn_membuf__resize(
+ &buffer, (decomp_length + 1) * sizeof(apr_int32_t));
+ ((apr_int32_t*)buffer.data)[decomp_length++] = uc;
+ done += len;
+ prev = done;
+ }
+ }
+ }
+
+ /* Scan the result and deleting any combining diacriticals and
+ inserting placeholders where any non-ascii characters remain. */
+ result = svn_stringbuf_create_ensure(decomp_length, pool);
+ for (len = 0; len < decomp_length; ++len)
+ {
+ const apr_int32_t cp = ((apr_int32_t*)buffer.data)[len];
+ if (cp > 0 && cp < 127)
+ svn_stringbuf_appendbyte(result, (char)cp);
+ else if (cp == 0)
+ svn_stringbuf_appendcstr(result, "\\0");
+ else if (cp < 0)
+ {
+ const apr_int32_t rcp = ((-cp) & 0xff);
+ svn_stringbuf_appendcstr(result, "?\\");
+ svn_stringbuf_appendbyte(result, digits[(rcp & 0x00f0) >> 4]);
+ svn_stringbuf_appendbyte(result, digits[(rcp & 0x000f)]);
+ }
+ else
+ {
+ if (utf8proc_codepoint_valid(cp))
+ {
+ const utf8proc_property_t *prop = utf8proc_get_property(cp);
+ if (prop->combining_class != 0)
+ continue; /* Combining mark; ignore */
+ svn_stringbuf_appendcstr(result, "{U+");
+ }
+ else
+ svn_stringbuf_appendcstr(result, "{U?");
+ if (cp > 0xffff)
+ {
+ svn_stringbuf_appendbyte(result, digits[(cp & 0xf00000) >> 20]);
+ svn_stringbuf_appendbyte(result, digits[(cp & 0x0f0000) >> 16]);
+ }
+ svn_stringbuf_appendbyte(result, digits[(cp & 0xf000) >> 12]);
+ svn_stringbuf_appendbyte(result, digits[(cp & 0x0f00) >> 8]);
+ svn_stringbuf_appendbyte(result, digits[(cp & 0x00f0) >> 4]);
+ svn_stringbuf_appendbyte(result, digits[(cp & 0x000f)]);
+ svn_stringbuf_appendbyte(result, '}');
+ }
+ }
+
+ return result->data;
+}
Propchange: subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc/utf8proc.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc/utf8proc.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc/utf8proc.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc/utf8proc.c Wed Nov 27 11:52:35 2013
@@ -182,10 +182,10 @@ ssize_t utf8proc_encode_char(int32_t uc,
if (uc < 0x00) {
return 0;
} else if (uc < 0x80) {
- dst[0] = uc;
+ dst[0] = (uint8_t)uc;
return 1;
} else if (uc < 0x800) {
- dst[0] = 0xC0 + (uc >> 6);
+ dst[0] = 0xC0 + (uint8_t)(uc >> 6);
dst[1] = 0x80 + (uc & 0x3F);
return 2;
} else if (uc == 0xFFFF) {
@@ -195,12 +195,12 @@ ssize_t utf8proc_encode_char(int32_t uc,
dst[0] = 0xFE;
return 1;
} else if (uc < 0x10000) {
- dst[0] = 0xE0 + (uc >> 12);
+ dst[0] = 0xE0 + (uint8_t)(uc >> 12);
dst[1] = 0x80 + ((uc >> 6) & 0x3F);
dst[2] = 0x80 + (uc & 0x3F);
return 3;
} else if (uc < 0x110000) {
- dst[0] = 0xF0 + (uc >> 18);
+ dst[0] = 0xF0 + (uint8_t)(uc >> 18);
dst[1] = 0x80 + ((uc >> 12) & 0x3F);
dst[2] = 0x80 + ((uc >> 6) & 0x3F);
dst[3] = 0x80 + (uc & 0x3F);
Propchange: subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc/utf8proc.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc/utf8proc.h
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: subversion/branches/verify-keep-going/subversion/libsvn_subr/utf8proc/utf8proc_data.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/version.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/version.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/version.c Wed Nov 27 11:52:35 2013
@@ -75,8 +75,10 @@ svn_boolean_t svn_ver_equal(const svn_ve
svn_error_t *
-svn_ver_check_list(const svn_version_t *my_version,
- const svn_version_checklist_t *checklist)
+svn_ver_check_list2(const svn_version_t *my_version,
+ const svn_version_checklist_t *checklist,
+ svn_boolean_t (*comparator)(const svn_version_t *,
+ const svn_version_t *))
{
svn_error_t *err = SVN_NO_ERROR;
int i;
@@ -84,12 +86,17 @@ svn_ver_check_list(const svn_version_t *
for (i = 0; checklist[i].label != NULL; ++i)
{
const svn_version_t *lib_version = checklist[i].version_query();
- if (!svn_ver_compatible(my_version, lib_version))
+ if (!comparator(my_version, lib_version))
err = svn_error_createf(SVN_ERR_VERSION_MISMATCH, err,
- _("Version mismatch in '%s':"
+ _("Version mismatch in '%s'%s:"
" found %d.%d.%d%s,"
" expected %d.%d.%d%s"),
checklist[i].label,
+ comparator == svn_ver_equal
+ ? _(" (expecting equality)")
+ : comparator == svn_ver_compatible
+ ? _(" (expecting compatibility)")
+ : "",
lib_version->major, lib_version->minor,
lib_version->patch, lib_version->tag,
my_version->major, my_version->minor,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_crashrpt.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_crashrpt.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_crashrpt.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_crashrpt.c Wed Nov 27 11:52:35 2013
@@ -244,7 +244,7 @@ write_process_info(EXCEPTION_RECORD *exc
"Rsp=%016I64x Rbp=%016I64x Rsi=%016I64x Rdi=%016I64x\n",
context->Rsp, context->Rbp, context->Rsi, context->Rdi);
fprintf(log_file,
- "R8= %016I64x R9= %016I64x R10= %016I64x R11=%016I64x\n",
+ "R8= %016I64x R9= %016I64x R10=%016I64x R11=%016I64x\n",
context->R8, context->R9, context->R10, context->R11);
fprintf(log_file,
"R12=%016I64x R13=%016I64x R14=%016I64x R15=%016I64x\n",
@@ -427,13 +427,15 @@ write_var_values(PSYMBOL_INFO sym_info,
format_value(value_str, sym_info->ModBase, sym_info->TypeIndex,
(void *)var_data);
- fprintf(log_file, "%s=%s", sym_info->Name, value_str);
+ fprintf(log_file, "%.*s=%s", (int)sym_info->NameLen, sym_info->Name,
+ value_str);
}
if (!log_params && sym_info->Flags & SYMFLAG_LOCAL)
{
format_value(value_str, sym_info->ModBase, sym_info->TypeIndex,
(void *)var_data);
- fprintf(log_file, " %s = %s\n", sym_info->Name, value_str);
+ fprintf(log_file, " %.*s = %s\n", (int)sym_info->NameLen,
+ sym_info->Name, value_str);
}
return TRUE;
@@ -466,8 +468,10 @@ write_function_detail(STACKFRAME64 stack
if (SymFromAddr_(proc, stack_frame.AddrPC.Offset, &func_disp, pIHS))
{
fprintf(log_file,
- "#%d 0x%08I64x in %.200s(",
- nr_of_frame, stack_frame.AddrPC.Offset, pIHS->Name);
+ "#%d 0x%08I64x in %.*s(",
+ nr_of_frame, stack_frame.AddrPC.Offset,
+ pIHS->NameLen > 200 ? 200 : (int)pIHS->NameLen,
+ pIHS->Name);
/* restrict symbol enumeration to this frame only */
ih_stack_frame.InstructionOffset = stack_frame.AddrPC.Offset;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_crypto.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_crypto.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_crypto.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_crypto.c Wed Nov 27 11:52:35 2013
@@ -32,6 +32,8 @@ typedef int win32_crypto__dummy;
#include <apr_pools.h>
#include <apr_base64.h>
+
+#include "svn_private_config.h"
#include "svn_auth.h"
#include "svn_error.h"
#include "svn_hash.h"
@@ -40,10 +42,9 @@ typedef int win32_crypto__dummy;
#include "svn_user.h"
#include "svn_base64.h"
+#include "auth.h"
#include "private/svn_auth_private.h"
-#include "svn_private_config.h"
-
#include <wincrypt.h>
@@ -213,7 +214,7 @@ static const svn_auth_provider_t windows
/* Public API */
void
-svn_auth_get_windows_simple_provider(svn_auth_provider_object_t **provider,
+svn_auth__get_windows_simple_provider(svn_auth_provider_object_t **provider,
apr_pool_t *pool)
{
svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));
@@ -331,7 +332,7 @@ static const svn_auth_provider_t windows
/* Public API */
void
-svn_auth_get_windows_ssl_client_cert_pw_provider
+svn_auth__get_windows_ssl_client_cert_pw_provider
(svn_auth_provider_object_t **provider,
apr_pool_t *pool)
{
@@ -436,8 +437,9 @@ windows_ssl_server_trust_first_credentia
const char *realmstring,
apr_pool_t *pool)
{
- apr_uint32_t *failures = svn_hash_gets(parameters,
- SVN_AUTH_PARAM_SSL_SERVER_FAILURES);
+ apr_uint32_t *failure_ptr = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_SSL_SERVER_FAILURES);
+ apr_uint32_t failures = *failure_ptr;
const svn_auth_ssl_server_cert_info_t *cert_info =
svn_hash_gets(parameters, SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO);
@@ -445,7 +447,7 @@ windows_ssl_server_trust_first_credentia
*iter_baton = NULL;
/* We can accept only unknown certificate authority. */
- if (*failures & SVN_AUTH_SSL_UNKNOWNCA)
+ if (failures & SVN_AUTH_SSL_UNKNOWNCA)
{
svn_boolean_t ok;
@@ -455,15 +457,16 @@ windows_ssl_server_trust_first_credentia
if (ok)
{
/* Clear failure flag. */
- *failures &= ~SVN_AUTH_SSL_UNKNOWNCA;
+ failures &= ~SVN_AUTH_SSL_UNKNOWNCA;
}
}
/* If all failures are cleared now, we return the creds */
- if (! *failures)
+ if (! failures)
{
svn_auth_cred_ssl_server_trust_t *creds =
apr_pcalloc(pool, sizeof(*creds));
+ creds->accepted_failures = *failure_ptr & ~failures;
creds->may_save = FALSE; /* No need to save it. */
*credentials = creds;
}
@@ -480,7 +483,7 @@ static const svn_auth_provider_t windows
/* Public API */
void
-svn_auth_get_windows_ssl_server_trust_provider
+svn_auth__get_windows_ssl_server_trust_provider
(svn_auth_provider_object_t **provider, apr_pool_t *pool)
{
svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));
@@ -489,4 +492,24 @@ svn_auth_get_windows_ssl_server_trust_pr
*provider = po;
}
+static const svn_auth_provider_t windows_server_authority_provider = {
+ SVN_AUTH_CRED_SSL_SERVER_AUTHORITY,
+ windows_ssl_server_trust_first_credentials,
+ NULL,
+ NULL,
+};
+
+/* Public API */
+void
+svn_auth__get_windows_ssl_server_authority_provider(
+ svn_auth_provider_object_t **provider,
+ apr_pool_t *pool)
+{
+ svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));
+
+ po->vtable = &windows_server_authority_provider;
+ *provider = po;
+}
+
+
#endif /* WIN32 */
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_xlate.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_xlate.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_xlate.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/win32_xlate.c Wed Nov 27 11:52:35 2013
@@ -47,9 +47,12 @@ typedef int win32_xlate__dummy;
#include "svn_string.h"
#include "svn_utf.h"
#include "private/svn_atomic.h"
+#include "private/svn_subr_private.h"
#include "win32_xlate.h"
+#include "svn_private_config.h"
+
static svn_atomic_t com_initialized = 0;
/* Initializes COM and keeps COM available until process exit.
@@ -118,11 +121,11 @@ get_page_id_from_name(UINT *page_id_p, c
}
err = svn_atomic__init_once(&com_initialized, initialize_com, NULL, pool);
-
if (err)
{
+ apr_status_t saved = err->apr_err;
svn_error_clear(err);
- return APR_EGENERAL;
+ return saved; /* probably SVN_ERR_ATOMIC_INIT_FAILURE */
}
hr = CoCreateInstance(&CLSID_CMultiLanguage, NULL, CLSCTX_INPROC_SERVER,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_crawler.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_crawler.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_crawler.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_crawler.c Wed Nov 27 11:52:35 2013
@@ -30,6 +30,7 @@
#include <apr_file_io.h>
#include <apr_hash.h>
+#include "svn_private_config.h"
#include "svn_hash.h"
#include "svn_types.h"
#include "svn_pools.h"
@@ -47,8 +48,6 @@
#include "workqueue.h"
#include "conflicts.h"
-#include "svn_private_config.h"
-
/* Helper for report_revisions_and_depths().
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_files.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_files.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_files.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_files.c Wed Nov 27 11:52:35 2013
@@ -32,6 +32,7 @@
#include <apr_file_io.h>
#include <apr_strings.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_error.h"
#include "svn_io.h"
@@ -44,7 +45,6 @@
#include "entries.h"
#include "lock.h"
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
@@ -117,7 +117,7 @@ svn_wc__adm_child(const char *path,
path,
adm_dir_name,
child,
- NULL);
+ SVN_VA_NULL);
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_ops.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/adm_ops.c Wed Nov 27 11:52:35 2013
@@ -36,6 +36,7 @@
#include <apr_time.h>
#include <apr_errno.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_pools.h"
#include "svn_string.h"
@@ -53,7 +54,6 @@
#include "conflicts.h"
#include "workqueue.h"
-#include "svn_private_config.h"
#include "private/svn_subr_private.h"
#include "private/svn_dep_compat.h"
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c Wed Nov 27 11:52:35 2013
@@ -32,6 +32,7 @@
#include <apr_hash.h>
#include <apr_errno.h>
+#include "svn_private_config.h"
#include "svn_hash.h"
#include "svn_types.h"
#include "svn_pools.h"
@@ -52,8 +53,6 @@
#include "private/svn_skel.h"
#include "private/svn_string_private.h"
-#include "svn_private_config.h"
-
/* --------------------------------------------------------------------
* Conflict skel management
*/
@@ -2710,12 +2709,17 @@ resolve_prop_conflict_on_node(svn_boolea
* existed and was resolved, set *DID_RESOLVE to TRUE, else set it to FALSE.
*
* It is not an error if there is no tree conflict.
+ *
+ * If the conflict can't be resolved yet because another tree conflict is
+ * blocking a storage location, store the tree conflict in the RESOLVE_LATER
+ * hash.
*/
static svn_error_t *
resolve_tree_conflict_on_node(svn_boolean_t *did_resolve,
svn_wc__db_t *db,
const char *local_abspath,
svn_wc_conflict_choice_t conflict_choice,
+ apr_hash_t *resolve_later,
svn_wc_notify_func2_t notify_func,
void *notify_baton,
svn_cancel_func_t cancel_func,
@@ -2749,6 +2753,7 @@ resolve_tree_conflict_on_node(svn_boolea
if (operation == svn_wc_operation_update
|| operation == svn_wc_operation_switch)
{
+ svn_error_t *err;
if (reason == svn_wc_conflict_reason_deleted ||
reason == svn_wc_conflict_reason_replaced)
{
@@ -2767,10 +2772,26 @@ resolve_tree_conflict_on_node(svn_boolea
* this directory, and leave this directory deleted.
* The newly conflicted moved-away children will be updated
* if they are resolved with 'mine_conflict' as well. */
- SVN_ERR(svn_wc__db_resolve_delete_raise_moved_away(
+ err = svn_wc__db_resolve_delete_raise_moved_away(
db, local_abspath, notify_func, notify_baton,
- scratch_pool));
- *did_resolve = TRUE;
+ scratch_pool);
+
+ if (err)
+ {
+ const char *dup_abspath;
+ if (err && err->apr_err != SVN_ERR_WC_OBSTRUCTED_UPDATE)
+ return svn_error_trace(err);
+
+ svn_error_clear(err);
+ dup_abspath = apr_pstrdup(apr_hash_pool_get(resolve_later),
+ local_abspath);
+
+ svn_hash_sets(resolve_later, dup_abspath, dup_abspath);
+
+ return SVN_NO_ERROR; /* Retry after other conflicts */
+ }
+ else
+ *did_resolve = TRUE;
}
else
return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
@@ -2790,12 +2811,28 @@ resolve_tree_conflict_on_node(svn_boolea
* move (theirs-conflict). */
if (conflict_choice == svn_wc_conflict_choose_mine_conflict)
{
- SVN_ERR(svn_wc__db_update_moved_away_conflict_victim(
+ err = svn_wc__db_update_moved_away_conflict_victim(
db, local_abspath,
notify_func, notify_baton,
cancel_func, cancel_baton,
- scratch_pool));
- *did_resolve = TRUE;
+ scratch_pool);
+
+ if (err)
+ {
+ const char *dup_abspath;
+ if (err && err->apr_err != SVN_ERR_WC_OBSTRUCTED_UPDATE)
+ return svn_error_trace(err);
+
+ svn_error_clear(err);
+ dup_abspath = apr_pstrdup(apr_hash_pool_get(resolve_later),
+ local_abspath);
+
+ svn_hash_sets(resolve_later, dup_abspath, dup_abspath);
+
+ return SVN_NO_ERROR; /* Retry after other conflicts */
+ }
+ else
+ *did_resolve = TRUE;
}
else if (conflict_choice == svn_wc_conflict_choose_merged)
{
@@ -2823,20 +2860,27 @@ resolve_tree_conflict_on_node(svn_boolea
}
}
- if (! *did_resolve && conflict_choice != svn_wc_conflict_choose_merged)
+ if (! *did_resolve)
{
- /* For other tree conflicts, there is no way to pick
- * theirs-full or mine-full, etc. Throw an error if the
- * user expects us to be smarter than we really are. */
- return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
- NULL,
- _("Tree conflict can only be "
- "resolved to 'working' state; "
- "'%s' not resolved"),
- svn_dirent_local_style(local_abspath,
- scratch_pool));
+ if (conflict_choice != svn_wc_conflict_choose_merged)
+ {
+ /* For other tree conflicts, there is no way to pick
+ * theirs-full or mine-full, etc. Throw an error if the
+ * user expects us to be smarter than we really are. */
+ return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
+ NULL,
+ _("Tree conflict can only be "
+ "resolved to 'working' state; "
+ "'%s' not resolved"),
+ svn_dirent_local_style(local_abspath,
+ scratch_pool));
+ }
+ else
+ *did_resolve = TRUE;
}
+ SVN_ERR_ASSERT(*did_resolve);
+
SVN_ERR(svn_wc__db_op_mark_resolved(db, local_abspath, FALSE, FALSE, TRUE,
NULL, scratch_pool));
SVN_ERR(svn_wc__wq_run(db, local_abspath, cancel_func, cancel_baton,
@@ -2889,6 +2933,7 @@ struct conflict_status_walker_baton
void *cancel_baton;
svn_wc_notify_func2_t notify_func;
void *notify_baton;
+ apr_hash_t *resolve_later;
};
/* Implements svn_wc_status4_t to walk all conflicts to resolve.
@@ -2958,13 +3003,15 @@ conflict_status_walker(void *baton,
db,
local_abspath,
my_choice,
+ cswb->resolve_later,
cswb->notify_func,
cswb->notify_baton,
cswb->cancel_func,
cswb->cancel_baton,
iterpool));
- resolved = TRUE;
+ if (did_resolve)
+ resolved = TRUE;
break;
case svn_wc_conflict_kind_text:
@@ -3046,6 +3093,8 @@ svn_wc__resolve_conflicts(svn_wc_context
svn_node_kind_t kind;
svn_boolean_t conflicted;
struct conflict_status_walker_baton cswb;
+ apr_pool_t *iterpool = NULL;
+ svn_error_t *err;
/* ### the underlying code does NOT support resolving individual
### properties. bail out if the caller tries it. */
@@ -3085,6 +3134,8 @@ svn_wc__resolve_conflicts(svn_wc_context
cswb.notify_func = notify_func;
cswb.notify_baton = notify_baton;
+ cswb.resolve_later = apr_hash_make(scratch_pool);
+
if (notify_func)
notify_func(notify_baton,
svn_wc_create_notify(local_abspath,
@@ -3092,16 +3143,66 @@ svn_wc__resolve_conflicts(svn_wc_context
scratch_pool),
scratch_pool);
- SVN_ERR(svn_wc_walk_status(wc_ctx,
- local_abspath,
- depth,
- FALSE /* get_all */,
- FALSE /* no_ignore */,
- TRUE /* ignore_text_mods */,
- NULL /* ignore_patterns */,
- conflict_status_walker, &cswb,
- cancel_func, cancel_baton,
- scratch_pool));
+ err = svn_wc_walk_status(wc_ctx,
+ local_abspath,
+ depth,
+ FALSE /* get_all */,
+ FALSE /* no_ignore */,
+ TRUE /* ignore_text_mods */,
+ NULL /* ignore_patterns */,
+ conflict_status_walker, &cswb,
+ cancel_func, cancel_baton,
+ scratch_pool);
+
+ while (!err && apr_hash_count(cswb.resolve_later))
+ {
+ apr_hash_index_t *hi;
+ svn_boolean_t cleared_one = FALSE;
+ const char *tc_abspath = NULL;
+
+ if (iterpool)
+ svn_pool_clear(iterpool);
+ else
+ iterpool = svn_pool_create(scratch_pool);
+
+ for (hi = apr_hash_first(scratch_pool, cswb.resolve_later);
+ hi && !err;
+ hi = apr_hash_next(hi))
+ {
+ tc_abspath = svn__apr_hash_index_key(hi);
+ svn_pool_clear(iterpool);
+
+ svn_hash_sets(cswb.resolve_later, tc_abspath, NULL);
+
+ err = svn_wc_walk_status(wc_ctx, tc_abspath, depth, FALSE, FALSE,
+ TRUE, NULL, conflict_status_walker, &cswb,
+ cancel_func, cancel_baton,
+ iterpool);
+
+ if (!err && !svn_hash_gets(cswb.resolve_later, tc_abspath))
+ cleared_one = TRUE;
+ }
+
+ if (!cleared_one && !err)
+ {
+ /* Return the error on one of the paths: The last one. */
+ err = svn_error_createf(
+ SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+ _("Unable to resolve pending conflict on '%s'"),
+ svn_dirent_local_style(tc_abspath, scratch_pool));
+ }
+ }
+
+ if (iterpool)
+ svn_pool_destroy(iterpool);
+
+ if (err && err->apr_err != SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE)
+ err = svn_error_createf(
+ SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, err,
+ _("Unable to resolve conflicts on '%s'"),
+ svn_dirent_local_style(local_abspath, scratch_pool));
+
+ SVN_ERR(err);
if (notify_func)
notify_func(notify_baton,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/copy.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/copy.c Wed Nov 27 11:52:35 2013
@@ -28,6 +28,8 @@
/*** Includes. ***/
#include <string.h>
+
+#include "svn_private_config.h"
#include "svn_pools.h"
#include "svn_error.h"
#include "svn_dirent_uri.h"
@@ -39,7 +41,6 @@
#include "props.h"
#include "conflicts.h"
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c Wed Nov 27 11:52:35 2013
@@ -28,6 +28,7 @@
#include <apr_md5.h>
+#include "svn_private_config.h"
#include "svn_wc.h"
#include "svn_subst.h"
#include "svn_pools.h"
@@ -47,8 +48,6 @@
#include "translate.h"
#include "workqueue.h"
-#include "svn_private_config.h"
-
/* baton for traversal_info_update */
struct traversal_info_update_baton
{
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/diff.h?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/diff.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/diff.h Wed Nov 27 11:52:35 2013
@@ -38,7 +38,9 @@
extern "C" {
#endif /* __cplusplus */
-/* Reports the file LOCAL_ABSPATH as ADDED file with relpath RELPATH to
+/* A function to diff locally added and locally copied files.
+
+ Reports the file LOCAL_ABSPATH as ADDED file with relpath RELPATH to
PROCESSOR with as parent baton PROCESSOR_PARENT_BATON.
The node is expected to have status svn_wc__db_status_normal, or
@@ -61,7 +63,9 @@ svn_wc__diff_local_only_file(svn_wc__db_
void *cancel_baton,
apr_pool_t *scratch_pool);
-/* Reports the directory LOCAL_ABSPATH and everything below it (limited by
+/* A function to diff locally added and locally copied directories.
+
+ Reports the directory LOCAL_ABSPATH and everything below it (limited by
DEPTH) as added with relpath RELPATH to PROCESSOR with as parent baton
PROCESSOR_PARENT_BATON.
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_editor.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_editor.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_editor.c Wed Nov 27 11:52:35 2013
@@ -57,6 +57,7 @@
#include <assert.h>
+#include "svn_private_config.h"
#include "svn_error.h"
#include "svn_pools.h"
#include "svn_dirent_uri.h"
@@ -75,8 +76,6 @@
#include "translate.h"
#include "diff.h"
-#include "svn_private_config.h"
-
/*-------------------------------------------------------------------------*/
@@ -474,14 +473,18 @@ svn_wc__diff_base_working_diff(svn_wc__d
{
const svn_io_dirent2_t *dirent;
+ /* Verify truename to mimic status for iota/IOTA difference on Windows */
SVN_ERR(svn_io_stat_dirent2(&dirent, local_abspath,
- FALSE /* verify truename */,
+ TRUE /* verify truename */,
TRUE /* ingore_enoent */,
scratch_pool, scratch_pool));
- if (dirent->kind == svn_node_file
- && dirent->filesize == recorded_size
- && dirent->mtime == recorded_time)
+ /* If a file does not exist on disk (missing/obstructed) then we
+ can't provide a text diff */
+ if (dirent->kind != svn_node_file
+ || (dirent->kind == svn_node_file
+ && dirent->filesize == recorded_size
+ && dirent->mtime == recorded_time))
{
files_same = TRUE;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/diff_local.c Wed Nov 27 11:52:35 2013
@@ -31,6 +31,7 @@
#include <apr_hash.h>
+#include "svn_private_config.h"
#include "svn_error.h"
#include "svn_pools.h"
#include "svn_dirent_uri.h"
@@ -45,8 +46,6 @@
#include "translate.h"
#include "diff.h"
-#include "svn_private_config.h"
-
/*-------------------------------------------------------------------------*/
/* Baton containing the state of a directory
@@ -116,16 +115,23 @@ ensure_state(struct diff_baton *eb,
apr_pool_t *ns_pool;
if (!eb->cur)
{
- if (!svn_dirent_is_ancestor(eb->anchor_abspath, local_abspath))
+ const char *relpath;
+
+ relpath = svn_dirent_skip_ancestor(eb->anchor_abspath, local_abspath);
+ if (! relpath)
return SVN_NO_ERROR;
- SVN_ERR(ensure_state(eb,
- svn_dirent_dirname(local_abspath,scratch_pool),
- FALSE,
- scratch_pool));
+ /* Don't recurse on the anchor, as that might loop infinately because
+ svn_dirent_dirname("/",...) -> "/"
+ svn_dirent_dirname("C:/",...) -> "C:/" (Windows) */
+ if (*relpath)
+ SVN_ERR(ensure_state(eb,
+ svn_dirent_dirname(local_abspath, scratch_pool),
+ FALSE,
+ scratch_pool));
}
else if (svn_dirent_is_child(eb->cur->local_abspath, local_abspath, NULL))
- SVN_ERR(ensure_state(eb, svn_dirent_dirname(local_abspath,scratch_pool),
+ SVN_ERR(ensure_state(eb, svn_dirent_dirname(local_abspath, scratch_pool),
FALSE,
scratch_pool));
else
@@ -195,23 +201,15 @@ diff_status_callback(void *baton,
struct diff_baton *eb = baton;
svn_wc__db_t *db = eb->db;
- switch (status->node_status)
- {
- case svn_wc_status_unversioned:
- 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;
+ if (! status->versioned)
+ return SVN_NO_ERROR; /* unversioned (includes dir externals) */
- default:
- break; /* Go check other conditions */
+ if (status->node_status == svn_wc_status_conflicted
+ && 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;
}
/* Not text/prop modified, not copied. Easy out */
@@ -399,7 +397,7 @@ diff_status_callback(void *baton,
}
}
- if (local_only)
+ if (local_only && (db_status != svn_wc__db_status_deleted))
{
if (db_kind == svn_node_file)
SVN_ERR(svn_wc__diff_local_only_file(db, child_abspath,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c Wed Nov 27 11:52:35 2013
@@ -26,6 +26,7 @@
#include <apr_strings.h>
+#include "svn_private_config.h"
#include "svn_error.h"
#include "svn_types.h"
#include "svn_time.h"
@@ -45,7 +46,6 @@
#include "wc_db.h"
#include "wc-queries.h" /* for STMT_* */
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
#include "private/svn_sqlite.h"
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/externals.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/externals.c Wed Nov 27 11:52:35 2013
@@ -32,6 +32,7 @@
#include <apr_general.h>
#include <apr_uri.h>
+#include "svn_private_config.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
#include "svn_error.h"
@@ -53,8 +54,6 @@
#include "translate.h"
#include "workqueue.h"
#include "conflicts.h"
-
-#include "svn_private_config.h"
/** Externals **/
@@ -1557,7 +1556,7 @@ svn_wc__resolve_relative_external_url(co
apr_pstrndup(scratch_pool, url, num_leading_slashes),
svn_relpath_canonicalize(url + num_leading_slashes,
scratch_pool),
- (char*)NULL);
+ SVN_VA_NULL);
}
else
{
@@ -1664,7 +1663,7 @@ svn_wc__resolve_relative_external_url(co
SVN_ERR(uri_scheme(&scheme, repos_root_url, scratch_pool));
*resolved_url = svn_uri_canonicalize(apr_pstrcat(scratch_pool, scheme,
- ":", url, (char *)NULL),
+ ":", url, SVN_VA_NULL),
result_pool);
return SVN_NO_ERROR;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c Wed Nov 27 11:52:35 2013
@@ -21,6 +21,7 @@
* @endcopyright
*/
+#include "svn_private_config.h"
#include "svn_dirent_uri.h"
#include "svn_hash.h"
#include "svn_path.h"
@@ -29,7 +30,6 @@
#include "wc.h"
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
@@ -555,7 +555,7 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
&repos_uuid,
wc_ctx->db,
svn_dirent_dirname(
- local_abspath,
+ this_abspath,
iterpool),
scratch_pool,
iterpool));
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/lock.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/lock.c Wed Nov 27 11:52:35 2013
@@ -26,6 +26,7 @@
#include <apr_pools.h>
#include <apr_time.h>
+#include "svn_private_config.h"
#include "svn_pools.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
@@ -39,7 +40,6 @@
#include "props.h"
#include "wc_db.h"
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/node.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/node.c Wed Nov 27 11:52:35 2013
@@ -38,6 +38,7 @@
#include <apr_pools.h>
#include <apr_time.h>
+#include "svn_private_config.h"
#include "svn_pools.h"
#include "svn_dirent_uri.h"
#include "svn_path.h"
@@ -49,7 +50,6 @@
#include "entries.h"
#include "wc_db.h"
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/old-and-busted.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/old-and-busted.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/old-and-busted.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/old-and-busted.c Wed Nov 27 11:52:35 2013
@@ -23,6 +23,7 @@
+#include "svn_private_config.h"
#include "svn_time.h"
#include "svn_xml.h"
#include "svn_dirent_uri.h"
@@ -37,7 +38,6 @@
#include "lock.h"
#include "private/svn_wc_private.h"
-#include "svn_private_config.h"
/* Within the (old) entries file, boolean values have a specific string
@@ -443,7 +443,7 @@ svn_wc__serialize_file_external(const ch
SVN_ERR(opt_revision_to_string(&s1, path, peg_rev, pool));
SVN_ERR(opt_revision_to_string(&s2, path, rev, pool));
- s = apr_pstrcat(pool, s1, ":", s2, ":", path, (char *)NULL);
+ s = apr_pstrcat(pool, s1, ":", s2, ":", path, SVN_VA_NULL);
}
else
s = NULL;
@@ -811,11 +811,15 @@ atts_to_entry(svn_wc_entry_t **new_entry
### not used by loggy; no need to set MODIFY_FLAGS */
entry->url = extract_string(atts, ENTRIES_ATTR_URL, pool);
+ if (entry->url)
+ entry->url = svn_uri_canonicalize(entry->url, pool);
/* Set up repository root. Make sure it is a prefix of url.
### not used by loggy; no need to set MODIFY_FLAGS */
entry->repos = extract_string(atts, ENTRIES_ATTR_REPOS, pool);
+ if (entry->repos)
+ entry->repos = svn_uri_canonicalize(entry->repos, pool);
if (entry->url && entry->repos
&& !svn_uri__is_ancestor(entry->repos, entry->url))
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/props.c Wed Nov 27 11:52:35 2013
@@ -33,6 +33,7 @@
#include <apr_strings.h>
#include <apr_general.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_string.h"
#include "svn_pools.h"
@@ -60,8 +61,6 @@
#include "workqueue.h"
#include "conflicts.h"
-#include "svn_private_config.h"
-
/* Forward declaration. */
static svn_error_t *
prop_conflict_from_skel(const svn_string_t **conflict_desc,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/relocate.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/relocate.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/relocate.c Wed Nov 27 11:52:35 2013
@@ -148,7 +148,7 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
if (old_url_len == from_len)
new_url = to;
else
- new_url = apr_pstrcat(scratch_pool, to, old_url + from_len, (char *)NULL);
+ new_url = apr_pstrcat(scratch_pool, to, old_url + from_len, SVN_VA_NULL);
if (! svn_path_is_url(new_url))
return svn_error_createf(SVN_ERR_WC_INVALID_RELOCATION, NULL,
_("Invalid relocation destination: '%s' "
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/revert.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/revert.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/revert.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/revert.c Wed Nov 27 11:52:35 2013
@@ -29,6 +29,7 @@
#include <apr_pools.h>
#include <apr_tables.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_pools.h"
#include "svn_string.h"
@@ -43,7 +44,6 @@
#include "adm_files.h"
#include "workqueue.h"
-#include "svn_private_config.h"
#include "private/svn_io_private.h"
#include "private/svn_wc_private.h"
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/status.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/status.c Wed Nov 27 11:52:35 2013
@@ -30,6 +30,7 @@
#include <apr_file_io.h>
#include <apr_hash.h>
+#include "svn_private_config.h"
#include "svn_pools.h"
#include "svn_types.h"
#include "svn_delta.h"
@@ -43,8 +44,6 @@
#include "svn_hash.h"
#include "svn_sorts.h"
-#include "svn_private_config.h"
-
#include "wc.h"
#include "props.h"
#include "entries.h"
@@ -242,144 +241,7 @@ struct file_baton
/** Code **/
-/* Fill in *INFO with the information it would contain if it were
- obtained from svn_wc__db_read_children_info. */
-static svn_error_t *
-read_info(const struct svn_wc__db_info_t **info,
- const char *local_abspath,
- svn_wc__db_t *db,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- struct svn_wc__db_info_t *mtb = apr_pcalloc(result_pool, sizeof(*mtb));
- const svn_checksum_t *checksum;
- const char *original_repos_relpath;
-
- SVN_ERR(svn_wc__db_read_info(&mtb->status, &mtb->kind,
- &mtb->revnum, &mtb->repos_relpath,
- &mtb->repos_root_url, &mtb->repos_uuid,
- &mtb->changed_rev, &mtb->changed_date,
- &mtb->changed_author, &mtb->depth,
- &checksum, NULL, &original_repos_relpath, NULL,
- NULL, NULL, &mtb->lock, &mtb->recorded_size,
- &mtb->recorded_time, &mtb->changelist,
- &mtb->conflicted, &mtb->op_root,
- &mtb->had_props, &mtb->props_mod,
- &mtb->have_base, &mtb->have_more_work, NULL,
- db, local_abspath,
- result_pool, scratch_pool));
-
- SVN_ERR(svn_wc__db_wclocked(&mtb->locked, db, local_abspath, scratch_pool));
-
- /* Maybe we have to get some shadowed lock from BASE to make our test suite
- happy... (It might be completely unrelated, but...) */
- if (mtb->have_base
- && (mtb->status == svn_wc__db_status_added
- || mtb->status == svn_wc__db_status_deleted
- || mtb->kind == svn_node_file))
- {
- svn_boolean_t update_root;
- svn_wc__db_lock_t **lock_arg = NULL;
-
- if (mtb->status == svn_wc__db_status_added
- || mtb->status == svn_wc__db_status_deleted)
- lock_arg = &mtb->lock;
-
- SVN_ERR(svn_wc__db_base_get_info(NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- lock_arg, NULL, NULL, &update_root,
- db, local_abspath,
- result_pool, scratch_pool));
-
- mtb->file_external = (update_root && mtb->kind == svn_node_file);
-
- if (mtb->status == svn_wc__db_status_deleted)
- {
- const char *moved_to_abspath;
- const char *moved_to_op_root_abspath;
-
- /* NOTE: we can't use op-root-ness as a condition here since a base
- * node can be the root of a move and still not be an explicit
- * op-root (having a working node with op_depth == pathelements).
- *
- * Both these (almost identical) situations showcase this:
- * svn mv a/b bb
- * svn del a
- * and
- * svn mv a aa
- * svn mv aa/b bb
- * In both, 'bb' is moved from 'a/b', but 'a/b' has no op_depth>0
- * node at all, as its parent 'a' is locally deleted. */
-
- SVN_ERR(svn_wc__db_scan_deletion(NULL,
- &moved_to_abspath,
- NULL,
- &moved_to_op_root_abspath,
- db, local_abspath,
- scratch_pool, scratch_pool));
- if (moved_to_abspath != NULL
- && moved_to_op_root_abspath != NULL
- && strcmp(moved_to_abspath, moved_to_op_root_abspath) == 0)
- {
- mtb->moved_to_abspath = apr_pstrdup(result_pool,
- moved_to_abspath);
- }
- /* ### ^^^ THIS SUCKS. For at least two reasons:
- * 1) We scan the node deletion and that's technically not necessary.
- * We'd be fine to know if this is an actual root of a move.
- * 2) From the elaborately calculated results, we backwards-guess
- * whether this is a root.
- * It works ok, and this code only gets called when a node is an
- * explicit target of a 'status'. But it would be better to do this
- * differently.
- * We could return moved-to via svn_wc__db_base_get_info() (called
- * just above), but as moved-to is only intended to be returned for
- * roots of a move, that doesn't fit too well. */
- }
- }
-
- /* ### svn_wc__db_read_info() could easily return the moved-here flag. But
- * for now... (The per-dir query for recursive status is far more optimal.)
- * Note that this actually scans around to get the full path, for a bool.
- * This bool then gets returned, later is evaluated, and if true leads to
- * the same paths being scanned again. We'd want to obtain this bool here as
- * cheaply as svn_wc__db_read_children_info() does. */
- if (mtb->status == svn_wc__db_status_added)
- {
- svn_wc__db_status_t status;
- SVN_ERR(svn_wc__db_scan_addition(&status, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- db, local_abspath,
- result_pool, scratch_pool));
-
- mtb->moved_here = (status == svn_wc__db_status_moved_here);
- mtb->incomplete = (status == svn_wc__db_status_incomplete);
- }
-
- mtb->has_checksum = (checksum != NULL);
- mtb->copied = (original_repos_relpath != NULL);
-
-#ifdef HAVE_SYMLINK
- if (mtb->kind == svn_node_file
- && (mtb->had_props || mtb->props_mod))
- {
- apr_hash_t *properties;
-
- if (mtb->props_mod)
- SVN_ERR(svn_wc__db_read_props(&properties, db, local_abspath,
- scratch_pool, scratch_pool));
- else
- SVN_ERR(svn_wc__db_read_pristine_props(&properties, db, local_abspath,
- scratch_pool, scratch_pool));
-
- mtb->special = (NULL != svn_hash_gets(properties, SVN_PROP_SPECIAL));
- }
-#endif
- *info = mtb;
-
- return SVN_NO_ERROR;
-}
/* Return *REPOS_RELPATH and *REPOS_ROOT_URL for LOCAL_ABSPATH using
information in INFO if available, falling back on
@@ -493,7 +355,8 @@ assemble_status(svn_wc_status3_t **statu
if (!info)
- SVN_ERR(read_info(&info, local_abspath, db, result_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_read_single_info(&info, db, local_abspath,
+ result_pool, scratch_pool));
if (!info->repos_relpath || !parent_repos_relpath)
switched_p = FALSE;
@@ -713,19 +576,21 @@ assemble_status(svn_wc_status3_t **statu
&& prop_status != svn_wc_status_none)
node_status = prop_status;
- /* 5. Easy out: unless we're fetching -every- entry, don't bother
- to allocate a struct for an uninteresting entry. */
+ /* 5. Easy out: unless we're fetching -every- node, don't bother
+ to allocate a struct for an uninteresting node.
+ This filter should match the filter in is_sendable_status() */
if (! get_all)
if (((node_status == svn_wc_status_none)
|| (node_status == svn_wc_status_normal))
&& (! switched_p)
- && (! info->locked )
+ && (! info->locked)
&& (! info->lock)
&& (! repos_lock)
&& (! info->changelist)
- && (! conflicted))
+ && (! conflicted)
+ && (! info->moved_to))
{
*status = NULL;
return SVN_NO_ERROR;
@@ -799,8 +664,11 @@ assemble_status(svn_wc_status3_t **statu
stat->changelist = apr_pstrdup(result_pool, info->changelist);
stat->moved_from_abspath = moved_from_abspath;
- if (info->moved_to_abspath)
- stat->moved_to_abspath = apr_pstrdup(result_pool, info->moved_to_abspath);
+
+ /* ### TODO: Handle multiple moved_to values properly */
+ if (info->moved_to)
+ stat->moved_to_abspath = apr_pstrdup(result_pool,
+ info->moved_to->moved_to_abspath);
stat->file_external = info->file_external;
@@ -1345,8 +1213,8 @@ get_dir_status(const struct walk_status_
SVN_ERR(err);
if (!dir_info)
- SVN_ERR(read_info(&dir_info, local_abspath, wb->db,
- scratch_pool, iterpool));
+ SVN_ERR(svn_wc__db_read_single_info(&dir_info, wb->db, local_abspath,
+ scratch_pool, iterpool));
SVN_ERR(get_repos_root_url_relpath(&dir_repos_relpath, &dir_repos_root_url,
&dir_repos_uuid, dir_info,
@@ -1506,8 +1374,9 @@ get_child_status(const struct walk_statu
if (dirent->kind == svn_node_none)
dirent = NULL;
- SVN_ERR(read_info(&dir_info, parent_abspath, wb->db,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_read_single_info(&dir_info,
+ wb->db, parent_abspath,
+ scratch_pool, scratch_pool));
SVN_ERR(get_repos_root_url_relpath(&dir_repos_relpath, &dir_repos_root_url,
&dir_repos_uuid, dir_info,
@@ -1902,6 +1771,8 @@ make_file_baton(struct dir_baton *parent
* Return a boolean answer to the question "Is @a status something that
* should be reported?". @a no_ignore and @a get_all are the same as
* svn_wc_get_status_editor4().
+ *
+ * This implementation should match the filter in assemble_status()
*/
static svn_boolean_t
is_sendable_status(const svn_wc_status3_t *status,
@@ -1949,6 +1820,9 @@ is_sendable_status(const svn_wc_status3_
if (status->changelist)
return TRUE;
+ if (status->moved_to_abspath)
+ return TRUE;
+
/* Otherwise, don't send it. */
return FALSE;
}
@@ -2710,7 +2584,8 @@ svn_wc__internal_walk_status(svn_wc__db_
ignore_patterns = ignores;
}
- err = read_info(&info, local_abspath, db, scratch_pool, scratch_pool);
+ err = svn_wc__db_read_single_info(&info, db, local_abspath,
+ scratch_pool, scratch_pool);
if (err)
{
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/translate.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/translate.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/translate.c Wed Nov 27 11:52:35 2013
@@ -30,6 +30,7 @@
#include <apr_file_io.h>
#include <apr_strings.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_string.h"
#include "svn_dirent_uri.h"
@@ -45,11 +46,9 @@
#include "translate.h"
#include "props.h"
-#include "svn_private_config.h"
#include "private/svn_wc_private.h"
-
/* */
static svn_error_t *
read_handler_unsupported(void *baton, char *buffer, apr_size_t *len)
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/update_editor.c?rev=1546002&r1=1546001&r2=1546002&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/update_editor.c Wed Nov 27 11:52:35 2013
@@ -32,6 +32,7 @@
#include <apr_tables.h>
#include <apr_strings.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_pools.h"
#include "svn_hash.h"
@@ -40,7 +41,6 @@
#include "svn_path.h"
#include "svn_error.h"
#include "svn_io.h"
-#include "svn_private_config.h"
#include "svn_time.h"
#include "wc.h"
@@ -1011,9 +1011,13 @@ window_handler(svn_txdelta_window_t *win
if (err)
{
- /* We failed to apply the delta; clean up the temporary file. */
- svn_error_clear(svn_io_remove_file2(hb->new_text_base_tmp_abspath, TRUE,
- hb->pool));
+ /* We failed to apply the delta; clean up the temporary file if it
+ already created by lazy_open_target(). */
+ if (hb->new_text_base_tmp_abspath)
+ {
+ svn_error_clear(svn_io_remove_file2(hb->new_text_base_tmp_abspath,
+ TRUE, hb->pool));
+ }
}
else
{
@@ -3006,18 +3010,55 @@ absent_node(const char *path,
kind = svn_node_unknown;
}
- if (status == svn_wc__db_status_normal
- && kind == svn_node_dir)
+ if (status == svn_wc__db_status_normal)
{
- /* We found an obstructing working copy!
+ svn_boolean_t wcroot;
+ /* We found an obstructing working copy or a file external! */
- We can do two things now:
- 1) notify the user, record a skip, etc.
- 2) Just record the absent node in BASE in the parent
- working copy.
+ SVN_ERR(svn_wc__db_is_wcroot(&wcroot, eb->db, local_abspath,
+ scratch_pool));
- As option 2 happens to be exactly what we do anyway, lets do that.
- */
+ if (wcroot)
+ {
+ /*
+ We have an obstructing working copy; possibly a directory external
+
+ We can do two things now:
+ 1) notify the user, record a skip, etc.
+ 2) Just record the absent node in BASE in the parent
+ working copy.
+
+ As option 2 happens to be exactly what we do anyway, fall through.
+ */
+ }
+ else
+ {
+ /* The server asks us to replace a file external
+ (Existing BASE node; not reported by the working copy crawler or
+ there would have been a delete_entry() call.
+
+ There is no way we can store this state in the working copy as
+ the BASE layer is already filled.
+
+ We could error out, but that is not helping anybody; the user is not
+ even seeing with what the file external would be replaced, so let's
+ report a skip and continue the update.
+ */
+
+ if (eb->notify_func)
+ {
+ svn_wc_notify_t *notify;
+ notify = svn_wc_create_notify(
+ local_abspath,
+ svn_wc_notify_update_skip_obstruction,
+ scratch_pool);
+
+ eb->notify_func(eb->notify_baton, notify, scratch_pool);
+ }
+
+ svn_pool_destroy(scratch_pool);
+ return SVN_NO_ERROR;
+ }
}
else if (status == svn_wc__db_status_not_present
|| status == svn_wc__db_status_server_excluded