You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by jc...@apache.org on 2011/01/02 09:06:06 UTC

svn commit: r1054362 - in /subversion/branches/diff-optimizations-bytes: ./ build/ac-macros/ build/generator/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_delta/ subversion/libsvn_diff/ subversion/libsvn_r...

Author: jcorvel
Date: Sun Jan  2 08:06:05 2011
New Revision: 1054362

URL: http://svn.apache.org/viewvc?rev=1054362&view=rev
Log:
On the diff-optimizations-bytes branch:

Bring up to date with trunk.

Added:
    subversion/branches/diff-optimizations-bytes/subversion/include/private/svn_adler32.h
      - copied unchanged from r1054360, subversion/trunk/subversion/include/private/svn_adler32.h
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/adler32.c
      - copied unchanged from r1054360, subversion/trunk/subversion/libsvn_subr/adler32.c
    subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/upgrade_tests_data/upgrade_with_scheduled_change.tar.bz2
      - copied unchanged from r1054360, subversion/trunk/subversion/tests/cmdline/upgrade_tests_data/upgrade_with_scheduled_change.tar.bz2
Modified:
    subversion/branches/diff-optimizations-bytes/   (props changed)
    subversion/branches/diff-optimizations-bytes/Makefile.in
    subversion/branches/diff-optimizations-bytes/build/ac-macros/swig.m4
    subversion/branches/diff-optimizations-bytes/build/generator/gen_make.py
    subversion/branches/diff-optimizations-bytes/subversion/include/svn_error.h
    subversion/branches/diff-optimizations-bytes/subversion/include/svn_error_codes.h
    subversion/branches/diff-optimizations-bytes/subversion/include/svn_types.h
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/delete.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/repos_diff.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/text_delta.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/xdelta.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff.h
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_file.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_memory.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/util.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/util.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/auth.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/auth_digest.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/commit.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/util.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/win32_auth_sspi.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/auth.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/eol.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/error.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/opt.c
    subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/entries.c
    subversion/branches/diff-optimizations-bytes/subversion/svn/lock-cmd.c
    subversion/branches/diff-optimizations-bytes/subversion/svn/propget-cmd.c
    subversion/branches/diff-optimizations-bytes/subversion/svn/util.c
    subversion/branches/diff-optimizations-bytes/subversion/svnlook/main.c
    subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py
    subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/upgrade_tests.py
    subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/error-test.c

Propchange: subversion/branches/diff-optimizations-bytes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jan  2 08:06:05 2011
@@ -40,4 +40,4 @@
 /subversion/branches/tc_url_rev:874351-874483
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
-/subversion/trunk:1031270-1054007
+/subversion/trunk:1031270-1054360

Modified: subversion/branches/diff-optimizations-bytes/Makefile.in
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/Makefile.in?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/Makefile.in (original)
+++ subversion/branches/diff-optimizations-bytes/Makefile.in Sun Jan  2 08:06:05 2011
@@ -391,6 +391,8 @@ local-extraclean: local-distclean extrac
 	rm -f $(top_srcdir)/build-outputs.mk \
               $(top_srcdir)/subversion/svn_private_config.h.in \
               $(top_srcdir)/configure \
+              $(top_srcdir)/gen-make.opts \
+              $(top_srcdir)/build/transform_libtool_scripts.sh \
               $(top_srcdir)/build/libtool.m4 \
               $(top_srcdir)/build/ltoptions.m4 \
               $(top_srcdir)/build/ltsugar.m4 \
@@ -702,6 +704,12 @@ install-man:
 install-swig-py: install-swig-py-lib
 install-swig-rb: install-swig-rb-lib
 
+check-SWIG:
+	if [ "$(SWIG)" = "none" ]; then \
+	  echo "SWIG disabled at configure time" >&2; \
+	  exit 1; \
+	fi
+
 clean-swig: clean-swig-headers clean-swig-py clean-swig-rb clean-swig-pl
 extraclean-swig: extraclean-swig-headers extraclean-swig-py \
                  extraclean-swig-rb extraclean-swig-pl
@@ -730,7 +738,7 @@ READLINK_PL=$(PERL) -e 'use Cwd; print C
 
 swig-pl_DEPS = autogen-swig-pl libsvn_swig_perl \
   $(SWIG_PL_DIR)/native/Makefile
-swig-pl: $(swig-pl_DEPS)
+swig-pl: check-SWIG $(swig-pl_DEPS)
 	if test "`$(READLINK_PL) $(SWIG_PL_DIR)`" != "`$(READLINK_PL) $(SWIG_PL_SRC_DIR)`"; then \
 	  ln -sf $(SWIG_PL_SRC_DIR)/native/*.c $(SWIG_PL_DIR)/native; \
 	fi
@@ -773,7 +781,7 @@ copy-swig-py: autogen-swig-py $(SWIG_PY_
 	done
 	@touch $(SWIG_PY_DIR)/libsvn/__init__.py
 
-swig-py: autogen-swig-py copy-swig-py
+swig-py: check-SWIG autogen-swig-py copy-swig-py
 
 check-swig-py: swig-py
 	cd $(SWIG_PY_DIR); \
@@ -795,7 +803,7 @@ clean-swig-py:
 extraclean-swig-py: clean-swig-py
 	$(EXTRACLEAN_SWIG_PY)
 
-swig-rb: autogen-swig-rb
+swig-rb: check-SWIG autogen-swig-rb
 
 check-swig-rb: swig-rb svnserve
 	cd $(SWIG_RB_DIR); \

Modified: subversion/branches/diff-optimizations-bytes/build/ac-macros/swig.m4
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/build/ac-macros/swig.m4?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/build/ac-macros/swig.m4 (original)
+++ subversion/branches/diff-optimizations-bytes/build/ac-macros/swig.m4 Sun Jan  2 08:06:05 2011
@@ -55,7 +55,7 @@ AC_DEFUN(SVN_FIND_SWIG,
   where=$1
 
   if test $where = no; then
-    AC_PATH_PROG(SWIG, none, none)
+    SWIG=none
   elif test $where = check; then
     AC_PATH_PROG(SWIG, swig, none)
   else

Modified: subversion/branches/diff-optimizations-bytes/build/generator/gen_make.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/build/generator/gen_make.py?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/build/generator/gen_make.py (original)
+++ subversion/branches/diff-optimizations-bytes/build/generator/gen_make.py Sun Jan  2 08:06:05 2011
@@ -349,9 +349,16 @@ class Generator(gen_base.GeneratorBase):
         continue
 
       outputs = [ ]
+
+      # Fake CHECK-SWIG dependency, because these targets are in
+      # both Makefile.in AND build-outputs.mk
+      if itype == "swig-rb" or itype == "swig-py" or itype == "swig-pl":
+      	outputs.append('check-SWIG')
+
       for t in i_targets:
         if hasattr(t, 'filename'):
           outputs.append(t.filename)
+
       data.itargets.append(_eztdata(type=itype, outputs=outputs))
 
     ########################################

Modified: subversion/branches/diff-optimizations-bytes/subversion/include/svn_error.h
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/include/svn_error.h?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/include/svn_error.h (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/include/svn_error.h Sun Jan  2 08:06:05 2011
@@ -361,6 +361,13 @@ svn_error_t *svn_error_purge_tracing(svn
 
 /** @} */
 
+
+/** Error groups
+ *
+ * @defgroup svn_error_error_groups Error groups
+ * @{
+ */
+
 /**
  * Return TRUE if @a err is an error specifically related to locking a
  * path in the repository, FALSE otherwise.
@@ -388,6 +395,25 @@ svn_error_t *svn_error_purge_tracing(svn
    err->apr_err == SVN_ERR_RA_NOT_LOCKED ||                 \
    err->apr_err == SVN_ERR_FS_LOCK_EXPIRED)
 
+/** Evaluates to @c TRUE iff @a apr_err (of type #apr_status_t) is in the given
+ * @a category, which should be one of the @c SVN_ERR_*_CATEGORY_START
+ * constants.
+ * 
+ * @since New in 1.7.
+ */
+#define SVN_ERROR_IN_CATEGORY(apr_err, category)            \
+    ((category) == ((apr_err) / SVN_ERR_CATEGORY_SIZE) * SVN_ERR_CATEGORY_SIZE)
+
+
+/** @} */
+
+
+/** Internal malfunctions and assertions
+ *
+ * @defgroup svn_error_malfunction_assertion Malfunctions and assertions
+ * @{
+ */
+
 /** Report that an internal malfunction has occurred, and possibly terminate
  * the program.
  *
@@ -503,6 +529,8 @@ svn_error__malfunction(svn_boolean_t can
  * The function may alter its behaviour according to compile-time
  * and run-time and even interactive conditions.
  *
+ * @see SVN_ERROR_IN_CATEGORY()
+ *
  * @since New in 1.6.
  */
 typedef svn_error_t *(*svn_error_malfunction_handler_t)
@@ -548,6 +576,8 @@ svn_error_abort_on_malfunction(svn_boole
                                int line,
                                const char *expr);
 
+/** @} */
+
 
 #ifdef __cplusplus
 }

Modified: subversion/branches/diff-optimizations-bytes/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/include/svn_error_codes.h?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/include/svn_error_codes.h Sun Jan  2 08:06:05 2011
@@ -1406,6 +1406,10 @@ SVN_ERROR_START
              SVN_ERR_MALFUNC_CATEGORY_START + 0,
              "Assertion failure")
 
+  SVN_ERRDEF(SVN_ERR_ASSERTION_ONLY_TRACING_LINKS,
+             SVN_ERR_MALFUNC_CATEGORY_START + 1,
+             "No non-tracing links found in the error chain")
+
 SVN_ERROR_END
 
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/include/svn_types.h
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/include/svn_types.h?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/include/svn_types.h (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/include/svn_types.h Sun Jan  2 08:06:05 2011
@@ -62,6 +62,24 @@ extern "C" {
 # endif
 #endif
 
+
+/** Indicate whether the current platform supports unaligned data access.
+ *
+ * On the majority of machines running SVN (x86 / x64), unaligned access
+ * is much cheaper than repeated aligned access. Define this macro to 1
+ * on those machines.
+ * Unaligned access on other machines (e.g. IA64) will trigger memory
+ * acccess faults or simply misbehave.
+ *
+ * @since New in 1.7.
+ */
+#ifndef SVN_UNALIGNED_ACCESS_IS_OK
+# if defined(_M_IX86) || defined(_M_X64) || defined(i386) || defined(__x86_64)
+#  define SVN_UNALIGNED_ACCESS_IS_OK 1
+# else
+#  define SVN_UNALIGNED_ACCESS_IS_OK 0
+# endif
+#endif
 
 
 /** Subversion error object.

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/delete.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/delete.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/delete.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/delete.c Sun Jan  2 08:06:05 2011
@@ -230,7 +230,7 @@ delete_urls(const apr_array_header_t *pa
                                 &kind, subpool));
       if (kind == svn_node_none)
         return svn_error_createf(SVN_ERR_FS_NOT_FOUND, NULL,
-                                 "URL '%s' does not exist", item_url);
+                                 _("URL '%s' does not exist"), item_url);
     }
   svn_pool_destroy(subpool);
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/repos_diff.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_client/repos_diff.c Sun Jan  2 08:06:05 2011
@@ -39,6 +39,7 @@
 #include "svn_path.h"
 #include "svn_io.h"
 #include "svn_props.h"
+#include "svn_private_config.h"
 
 #include "client.h"
 
@@ -375,7 +376,7 @@ get_dir_abspath(const char **local_dir_a
         *local_dir_abspath = local_abspath;
       else if (!lenient)
         return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL,
-                                 "'%s' is not a versioned directory",
+                                 _("'%s' is not a versioned directory"),
                                  svn_dirent_local_style(local_abspath, pool));
     }
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/text_delta.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/text_delta.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/text_delta.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/text_delta.c Sun Jan  2 08:06:05 2011
@@ -606,11 +606,9 @@ patterning_copy(char *target, const char
 {
   const char *end = source + len;
 
-  /* On the majority of machines (x86 / x64), unaligned access is much
-   * cheaper than repeated aligned access.  Therefore, use chunky copies on
-   * these machines when feasible.
-   * For those machines, GCC, ICC and MSC will define one of the following: */
-#if defined(_M_IX86) || defined(_M_X64) || defined(i386) || defined(__x86_64)
+  /* On many machines, we can do "chunky" copies. */
+
+#if SVN_UNALIGNED_ACCESS_IS_OK
 
   if (end + sizeof(apr_uint32_t) <= target)
     {

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/xdelta.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/xdelta.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/xdelta.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_delta/xdelta.c Sun Jan  2 08:06:05 2011
@@ -29,6 +29,8 @@
 
 #include "svn_delta.h"
 #include "delta.h"
+
+#include "private/svn_adler32.h"
 
 /* This is pseudo-adler32. It is adler32 without the prime modulus.
    The idea is borrowed from monotone, and is a translation of the C++
@@ -39,6 +41,10 @@
 #define ADLER32_MASK      0x0000ffff
 #define ADLER32_CHAR_MASK 0x000000ff
 
+/* Size of the blocks we compute checksums for. This was chosen out of
+   thin air.  Monotone used 64, xdelta1 used 64, rsync uses 128.  */
+#define MATCH_BLOCKSIZE 64
+
 /* Structure to store the state of our adler32 checksum.  */
 struct adler32
 {
@@ -66,11 +72,32 @@ adler32_out(struct adler32 *ad, const ch
 {
   ad->s1 -= ((apr_uint32_t) (c)) & ADLER32_CHAR_MASK;
   ad->s1 &= ADLER32_MASK;
-  ad->s2 -= (ad->len * (((apr_uint32_t) c) & ADLER32_CHAR_MASK)) + 1;
+  ad->s2 -= (ad->len * (((apr_uint32_t) c) & ADLER32_CHAR_MASK));
   ad->s2 &= ADLER32_MASK;
   --ad->len;
 }
 
+/* Feed C_IN into the adler32 checksum and remove C_OUT at the same time.
+ * This function may (and will) only be called for
+ * ad->len == MATCH_BLOCKSIZE.
+ */
+static APR_INLINE void
+adler32_replace(struct adler32 *ad, const char c_out, const char c_in)
+{
+  apr_uint32_t s1 = ad->s1;
+  apr_uint32_t s2 = ad->s2;
+
+  s2 -= (MATCH_BLOCKSIZE * (((apr_uint32_t) c_out) & ADLER32_CHAR_MASK));
+
+  s1 -= ((apr_uint32_t) (c_out)) & ADLER32_CHAR_MASK;
+  s1 += ((apr_uint32_t) (c_in)) & ADLER32_CHAR_MASK;
+
+  s2 += s1;
+
+  ad->s1 = s1 & ADLER32_MASK;
+  ad->s2 = s2 & ADLER32_MASK;
+}
+
 /* Return the current adler32 checksum in the adler32 structure.  */
 
 static APR_INLINE apr_uint32_t
@@ -85,18 +112,15 @@ adler32_sum(const struct adler32 *ad)
 static APR_INLINE struct adler32 *
 init_adler32(struct adler32 *ad, const char *data, apr_uint32_t datalen)
 {
-  ad->s1 = 1;
-  ad->s2 = 0;
-  ad->len = 0;
-  while (datalen--)
-    adler32_in(ad, *(data++));
+  apr_uint32_t adler32 = svn__adler32(0, data, datalen);
+
+  ad->s1 = adler32 & ADLER32_MASK;
+  ad->s2 = (adler32 >> 16) & ADLER32_MASK;
+  ad->len = datalen;
+
   return ad;
 }
 
-/* Size of the blocks we compute checksums for. This was chosen out of
-   thin air.  Monotone used 64, xdelta1 used 64, rsync uses 128.  */
-#define MATCH_BLOCKSIZE 64
-
 /* Information for a block of the delta source.  The length of the
    block is the smaller of MATCH_BLOCKSIZE and the difference between
    the size of the source data and the position of this block. */
@@ -201,6 +225,35 @@ init_blocks_table(const char *data,
     }
 }
 
+/* Return the lowest position at which A and B differ. If no difference
+ * can be found in the first MAX_LEN characters, MAX_LEN will be returned.
+ */
+static apr_size_t
+match_length(const char *a, const char *b, apr_size_t max_len)
+{
+  apr_size_t pos = 0;
+
+#if SVN_UNALIGNED_ACCESS_IS_OK
+
+  /* Chunky operation is so much faster ...
+   *
+   * We can't make this work on architectures that require aligned access
+   * because A and B will probably have different alignment. So, skipping
+   * the first few chars until alignment is reached is not an option.
+   */
+  for (; pos + sizeof(apr_size_t) <= max_len; pos += sizeof(apr_size_t))
+    if (*(const apr_size_t*)(a + pos) != *(const apr_size_t*)(b + pos))
+      break;
+
+#endif
+
+  for (; pos < max_len; ++pos)
+    if (a[pos] != b[pos])
+      break;
+
+  return pos;
+}
+
 /* Try to find a match for the target data B in BLOCKS, and then
    extend the match as long as data in A and B at the match position
    continues to match.  We set the position in a we ended up in (in
@@ -229,6 +282,8 @@ find_match(const struct blocks *blocks,
   apr_uint32_t sum = adler32_sum(rolling);
   apr_size_t alen, badvance, apos;
   apr_size_t tpos, tlen;
+  apr_size_t delta, max_delta;
+  const char *aptr, *bptr;
 
   tpos = find_block(blocks, sum);
 
@@ -246,14 +301,15 @@ find_match(const struct blocks *blocks,
   apos = tpos;
   alen = tlen;
   badvance = tlen;
+
   /* Extend the match forward as far as possible */
-  while ((apos + alen < asize)
-         && (bpos + badvance < bsize)
-         && (a[apos + alen] == b[bpos + badvance]))
-    {
-      ++alen;
-      ++badvance;
-    }
+  max_delta = asize - apos - alen < bsize - bpos - badvance
+            ? asize - apos - alen
+            : bsize - bpos - badvance;
+  delta = match_length(a + apos + alen, b + bpos + badvance, max_delta);
+
+  alen += delta;
+  badvance += delta;
 
   /* See if we can extend backwards into a previous insert hunk.  */
   while (apos > 0
@@ -329,7 +385,6 @@ compute_delta(svn_txdelta__ops_baton_t *
       apr_size_t apos = 0;
       apr_size_t alen = 1;
       apr_size_t badvance = 1;
-      apr_size_t next;
       svn_boolean_t match;
 
       match = find_match(&blocks, &rolling, a, asize, b, bsize, lo, &apos,
@@ -354,14 +409,49 @@ compute_delta(svn_txdelta__ops_baton_t *
           svn_txdelta__insert_op(build_baton, svn_txdelta_source,
                                  apos, alen, NULL, pool);
         }
-      next = lo;
-      for (; next < lo + badvance; ++next)
+
+      if (badvance == 1)
+        {
+          /* This seems to be the _vast_ majority case -- even if
+           * you sum BADVANCE up, this case still accounts for 2/3
+           * of all bytes being processed.
+           */
+          if (lo + MATCH_BLOCKSIZE < bsize)
+            adler32_replace(&rolling, b[lo], b[lo + MATCH_BLOCKSIZE]);
+          else
+            adler32_out(&rolling, b[lo]);
+
+          lo++;
+        }
+      else if (badvance >= MATCH_BLOCKSIZE)
         {
-          adler32_out(&rolling, b[next]);
-          if (next + MATCH_BLOCKSIZE < bsize)
-            adler32_in(&rolling, b[next + MATCH_BLOCKSIZE]);
+          /* BADVANCE is often large enough that we can calculate the
+           * Adler32 sum directly instead of expensively updating the
+           * existing values.
+           */
+          apr_size_t remaining_block = lo + MATCH_BLOCKSIZE < bsize
+                                     ? MATCH_BLOCKSIZE
+                                     : bsize - (lo + MATCH_BLOCKSIZE);
+          init_adler32(&rolling,
+                       b + lo + badvance - remaining_block,
+                       remaining_block);
+          lo += badvance;
+        }
+      else
+        {
+          /* The very rare 3rd case
+           * (can only possibly happen close to end of the file).
+           */
+          apr_size_t next = lo;
+
+          for (; next < lo + badvance; ++next)
+            if (next + MATCH_BLOCKSIZE < bsize)
+              adler32_replace(&rolling, b[next], b[next + MATCH_BLOCKSIZE]);
+            else
+              adler32_out(&rolling, b[next]);
+
+          lo = next;
         }
-      lo = next;
     }
 
   /* If we still have an insert pending at the end, throw it in.  */

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff.h?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff.h (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff.h Sun Jan  2 08:06:05 2011
@@ -131,14 +131,6 @@ svn_diff__resolve_conflict(svn_diff_t *h
                            apr_pool_t *pool);
 
 
-/*
- * Return an adler32 checksum based on CHECKSUM, updated with
- * DATA of size LEN.
- */
-apr_uint32_t
-svn_diff__adler32(apr_uint32_t checksum, const char *data, apr_off_t len);
-
-
 /* Normalize the characters pointed to by the buffer BUF (of length *LENGTHP)
  * according to the options *OPTS, starting in the state *STATEP.
  *

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_file.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_file.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_file.c Sun Jan  2 08:06:05 2011
@@ -46,6 +46,7 @@
 
 #include "private/svn_utf_private.h"
 #include "private/svn_eol_private.h"
+#include "private/svn_adler32.h"
 
 /* A token, i.e. a line read from a file. */
 typedef struct svn_diff__file_token_t
@@ -747,7 +748,7 @@ datasource_get_next_token(apr_uint32_t *
                                  &file->normalize_state,
                                  curp, file_baton->options);
       file_token->length += length;
-      h = svn_diff__adler32(h, curp, length);
+      h = svn__adler32(h, curp, length);
 
       curp = endp = file->buffer;
       file->chunk++;
@@ -794,7 +795,7 @@ datasource_get_next_token(apr_uint32_t *
 
       file_token->length += length;
 
-      *hash = svn_diff__adler32(h, c, length);
+      *hash = svn__adler32(h, c, length);
       *token = file_token;
     }
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_memory.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_memory.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_memory.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/diff_memory.c Sun Jan  2 08:06:05 2011
@@ -34,6 +34,7 @@
 #include "svn_utf.h"
 #include "diff.h"
 #include "svn_private_config.h"
+#include "private/svn_adler32.h"
 
 typedef struct source_tokens_t
 {
@@ -140,7 +141,7 @@ datasource_get_next_token(apr_uint32_t *
 
       svn_diff__normalize_buffer(&buf, &len, &state, tok->data,
                                  mem_baton->normalization_options);
-      *hash = svn_diff__adler32(0, buf, len);
+      *hash = svn__adler32(0, buf, len);
       src->next_token++;
     }
   else

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/util.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/util.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_diff/util.c Sun Jan  2 08:06:05 2011
@@ -32,67 +32,6 @@
 
 #include "diff.h"
 
-/**
- * An Adler-32 implementation per RFC1950.
- *
- * "The Adler-32 algorithm is much faster than the CRC32 algorithm yet
- * still provides an extremely low probability of undetected errors"
- */
-
-/*
- * 65521 is the largest prime less than 65536.
- * "That 65521 is prime is important to avoid a possible large class of
- *  two-byte errors that leave the check unchanged."
- */
-#define ADLER_MOD_BASE 65521
-
-/*
- * "The modulo on unsigned long accumulators can be delayed for 5552 bytes,
- *  so the modulo operation time is negligible."
- */
-#define ADLER_MOD_BLOCK_SIZE 5552
-
-
-/*
- * Start with CHECKSUM and update the checksum by processing a chunk
- * of DATA sized LEN.
- */
-apr_uint32_t
-svn_diff__adler32(apr_uint32_t checksum, const char *data, apr_off_t len)
-{
-  const unsigned char *input = (const unsigned char *)data;
-  apr_uint32_t s1 = checksum & 0xFFFF;
-  apr_uint32_t s2 = checksum >> 16;
-  apr_uint32_t b;
-  apr_size_t blocks = len / ADLER_MOD_BLOCK_SIZE;
-
-  len %= ADLER_MOD_BLOCK_SIZE;
-
-  while (blocks--)
-    {
-      int count = ADLER_MOD_BLOCK_SIZE;
-      while (count--)
-        {
-          b = *input++;
-          s1 += b;
-          s2 += s1;
-        }
-
-      s1 %= ADLER_MOD_BASE;
-      s2 %= ADLER_MOD_BASE;
-    }
-
-  while (len--)
-    {
-      b = *input++;
-      s1 += b;
-      s2 += s1;
-    }
-
-  return ((s2 % ADLER_MOD_BASE) << 16) | (s1 % ADLER_MOD_BASE);
-}
-
-
 svn_boolean_t
 svn_diff_contains_conflicts(svn_diff_t *diff)
 {

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/util.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/util.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_neon/util.c Sun Jan  2 08:06:05 2011
@@ -651,7 +651,7 @@ generate_error(svn_ra_neon__request_t *r
 
   /*### This is a translation nightmare. Make sure to compose full strings
     and mark those for translation. */
-  return svn_error_createf(errcode, NULL, "%s: %s (%s://%s)",
+  return svn_error_createf(errcode, NULL, _("%s: %s (%s://%s)"),
                            context, msg, ne_get_scheme(req->ne_sess),
                            hostport);
 }
@@ -771,7 +771,7 @@ start_err_element(void *baton, int paren
            overwritten by the <human-readable> tag, or even someday by
            a <D:failed-precondition/> tag. */
         *err = svn_error_create(APR_EGENERAL, NULL,
-                                "General svn error from server");
+                                _("General svn error from server"));
         break;
       }
     case ELEM_human_readable:

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/auth.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/auth.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/auth.c Sun Jan  2 08:06:05 2011
@@ -335,7 +335,7 @@ svn_ra_serf__handle_auth(int code,
     {
       if (session->auth_protocol)
         return svn_error_createf(SVN_ERR_AUTHN_FAILED, NULL,
-                                 "%s Authentication failed",
+                                 _("%s Authentication failed"),
                                  session->auth_protocol->auth_name);
       else
         return svn_error_create(SVN_ERR_AUTHN_FAILED, NULL, NULL);
@@ -359,8 +359,8 @@ svn_ra_serf__handle_auth(int code,
     {
       /* Support more authentication mechanisms. */
       return svn_error_createf(SVN_ERR_AUTHN_FAILED, NULL,
-                               "%s authentication not supported.\n"
-                               "Authentication failed",
+                               _("%s authentication not supported.\n"
+                               "Authentication failed"),
                                ab.last_prot_name
                                  ? ab.last_prot_name
                                  : "Unknown");
@@ -461,8 +461,8 @@ handle_basic_auth(svn_ra_serf__handler_t
     {
       /* No more credentials. */
       return svn_error_create(SVN_ERR_AUTHN_FAILED, NULL,
-                "No more credentials or we tried too many times.\n"
-                "Authentication failed");
+                _("No more credentials or we tried too many times.\n"
+                "Authentication failed"));
     }
 
   simple_creds = creds;
@@ -537,7 +537,7 @@ handle_proxy_basic_auth(svn_ra_serf__han
     {
       /* No more credentials. */
       return svn_error_create(SVN_ERR_AUTHN_FAILED, NULL,
-                "Proxy authentication failed");
+                _("Proxy authentication failed"));
     }
 
   svn_ra_serf__encode_auth_header(session->proxy_auth_protocol->auth_name,

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/auth_digest.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/auth_digest.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/auth_digest.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/auth_digest.c Sun Jan  2 08:06:05 2011
@@ -311,8 +311,8 @@ svn_ra_serf__handle_digest_auth(svn_ra_s
     {
       /* No more credentials. */
       return svn_error_create(SVN_ERR_AUTHN_FAILED, NULL,
-                "No more credentials or we tried too many times.\n"
-                "Authentication failed");
+                _("No more credentials or we tried too many times.\n"
+                "Authentication failed"));
     }
 
   simple_creds = creds;

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/commit.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/commit.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/commit.c Sun Jan  2 08:06:05 2011
@@ -230,7 +230,7 @@ return_response_err(svn_ra_serf__handler
   err = svn_error_compose_create(
             ctx->server_error.error,
             svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
-                              "%s of '%s': %d %s",
+                              _("%s of '%s': %d %s"),
                               handler->method, handler->path,
                               ctx->status, ctx->reason));
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/util.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/util.c Sun Jan  2 08:06:05 2011
@@ -963,12 +963,12 @@ parse_dav_status(int *status_code_out, s
     token = apr_strtok(NULL, " \t\r\n", &tok_status);
   if (!token)
     return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
-                             "Malformed DAV:status CDATA '%s'",
+                             _("Malformed DAV:status CDATA '%s'"),
                              buf->data);
   err = svn_cstring_atoi(status_code_out, token);
   if (err)
     return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, err,
-                             "Malformed DAV:status CDATA '%s'",
+                             _("Malformed DAV:status CDATA '%s'"),
                              buf->data);
 
   return SVN_NO_ERROR;
@@ -1294,8 +1294,8 @@ svn_ra_serf__handle_xml_parser(serf_requ
                 }
             }
           SVN_ERR(svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
-                                         "XML parsing failed: (%d %s)",
-                                         sl.code, sl.reason));
+                                    _("XML parsing failed: (%d %s)"),
+                                    sl.code, sl.reason));
         }
 
       if (ctx->error && ctx->ignore_errors == FALSE)

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/win32_auth_sspi.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/win32_auth_sspi.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/win32_auth_sspi.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_ra_serf/win32_auth_sspi.c Sun Jan  2 08:06:05 2011
@@ -68,6 +68,7 @@
 #include "ra_serf.h"
 #include "win32_auth_sspi.h"
 
+#include "svn_private_config.h"
 #include "private/svn_atomic.h"
 
 #ifdef SVN_RA_SERF_SSPI_ENABLED
@@ -98,7 +99,7 @@ initialize_sspi(void *baton, apr_pool_t*
 
   return svn_error_createf
           (SVN_ERR_RA_SERF_SSPI_INITIALISATION_FAILED, NULL,
-           "SSPI Initialization failed.");
+           _("SSPI Initialization failed."));
 }
 
 /* Calculates the maximum token size based on the authentication protocol. */
@@ -121,7 +122,7 @@ sspi_maxtokensize(const char *auth_pkg,
   else
     return svn_error_createf
       (SVN_ERR_RA_SERF_SSPI_INITIALISATION_FAILED, NULL,
-       "SSPI Initialization failed.");
+       _("SSPI Initialization failed."));
 
   return SVN_NO_ERROR;
 }
@@ -291,7 +292,7 @@ sspi_get_credentials(char *token, apr_si
   if (status != SEC_E_OK)
     return svn_error_createf
             (SVN_ERR_RA_SERF_SSPI_INITIALISATION_FAILED, NULL,
-             "SSPI Initialization failed.");
+             _("SSPI Initialization failed."));
 
   status = sspi->InitializeSecurityContext(&creds,
                                            ctx != NULL && ctx->dwLower != 0
@@ -336,7 +337,7 @@ sspi_get_credentials(char *token, apr_si
 
       default:
           return svn_error_createf(SVN_ERR_AUTHN_FAILED, NULL,
-                "Authentication failed with error 0x%x.", status);
+                _("Authentication failed with error 0x%x."), status);
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/auth.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/auth.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/auth.c Sun Jan  2 08:06:05 2011
@@ -183,7 +183,7 @@ svn_auth_first_credentials(void **creden
   table = apr_hash_get(auth_baton->tables, cred_kind, APR_HASH_KEY_STRING);
   if (! table)
     return svn_error_createf(SVN_ERR_AUTHN_NO_PROVIDER, NULL,
-                             "No provider registered for '%s' credentials",
+                             _("No provider registered for '%s' credentials"),
                              cred_kind);
 
   /* First, see if we have cached creds in the auth_baton. */

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/eol.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/eol.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/eol.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/eol.c Sun Jan  2 08:06:05 2011
@@ -29,14 +29,68 @@
 #include "svn_io.h"
 #include "private/svn_eol_private.h"
 
+/* Machine-word-sized masks used in svn_eol__find_eol_start.
+ */
+#if APR_SIZEOF_VOIDP == 8
+#  define LOWER_7BITS_SET 0x7f7f7f7f7f7f7f7f
+#  define BIT_7_SET       0x8080808080808080
+#  define R_MASK          0x0a0a0a0a0a0a0a0a
+#  define N_MASK          0x0d0d0d0d0d0d0d0d
+#else
+#  define LOWER_7BITS_SET 0x7f7f7f7f
+#  define BIT_7_SET       0x80808080
+#  define R_MASK          0x0a0a0a0a
+#  define N_MASK          0x0d0d0d0d
+#endif
+
 char *
 svn_eol__find_eol_start(char *buf, apr_size_t len)
 {
+#if !SVN_UNALIGNED_ACCESS_IS_OK
+
+  /* On some systems, we need to make sure that buf is properly aligned
+   * for chunky data access. This overhead is still justified because
+   * only lines tend to be tens of chars long.
+   */
+  for (; (len > 0) && ((apr_size_t)buf) & (sizeof(apr_size_t)-1)
+       ; ++buf, --len)
+  {
+    if (*buf == '\n' || *buf == '\r')
+      return buf;
+  }
+
+#endif
+
+  /* Scan the input one machine word at a time. */
+  for (; len > sizeof(apr_size_t)
+       ; buf += sizeof(apr_size_t), len -= sizeof(apr_size_t))
+  {
+    /* This is a variant of the well-known strlen test: */
+    apr_size_t chunk = *(const apr_size_t *)buf;
+
+    /* A byte in R_TEST is \0, iff it was \r in *BUF.
+     * Similarly, N_TEST is an indicator for \n. */
+    apr_size_t r_test = chunk ^ R_MASK;
+    apr_size_t n_test = chunk ^ N_MASK;
+
+    /* A byte in R_TEST can by < 0x80, iff it has been \0 before 
+     * (i.e. \r in *BUF). Dito for N_TEST. */
+    r_test |= (r_test & LOWER_7BITS_SET) + LOWER_7BITS_SET;
+    n_test |= (n_test & LOWER_7BITS_SET) + LOWER_7BITS_SET;
+
+    /* Check whether at least one of the words contains a byte <0x80
+     * (if one is detected, there was a \r or \n in CHUNK). */
+    if ((r_test & n_test & BIT_7_SET) != BIT_7_SET)
+      break;
+  }
+
+  /* The remaining odd bytes will be examined the naive way: */
   for (; len > 0; ++buf, --len)
     {
       if (*buf == '\n' || *buf == '\r')
         return buf;
     }
+
   return NULL;
 }
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/error.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/error.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/error.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/error.c Sun Jan  2 08:06:05 2011
@@ -376,7 +376,14 @@ svn_error_purge_tracing(svn_error_t *err
 
       /* The link must be a real link in the error chain, otherwise an
          error chain with trace only links would map into SVN_NO_ERROR. */
-      SVN_ERR_ASSERT(err);
+      if (! err)
+        return svn_error_create(
+                 SVN_ERR_ASSERTION_ONLY_TRACING_LINKS, 
+                 svn_error_compose_create(
+                   svn_error__malfunction(TRUE, __FILE__, __LINE__,
+                                          NULL /* ### say something? */),
+                   err),
+                 NULL);
 
       /* Copy the current error except for its child error pointer
          into the new error.  Share any message and source filename

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/opt.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/opt.c Sun Jan  2 08:06:05 2011
@@ -1048,7 +1048,7 @@ svn_opt__print_version_info(const char *
   SVN_ERR(svn_cmdline_printf(pool, _("%s, version %s\n"
                                      "   compiled %s, %s\n\n"), pgm_name,
                              SVN_VERSION, __DATE__, __TIME__));
-  SVN_ERR(svn_cmdline_fputs(_("Copyright (C) 2010 The Apache Software Foundation.\n"
+  SVN_ERR(svn_cmdline_fputs(_("Copyright (C) 2011 The Apache Software Foundation.\n"
                               "This software consists of"
                               " contributions made by many people;\n"
                               "see the NOTICE file for more information.\n"

Modified: subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/entries.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/libsvn_wc/entries.c Sun Jan  2 08:06:05 2011
@@ -1992,7 +1992,14 @@ write_entry(struct write_baton **entry_n
 
       /* The revert_base checksum isn't available in the entry structure,
          so the caller provides it. */
-      below_working_node->checksum = text_base_info->revert_base.sha1_checksum;
+
+      /* text_base_info is NULL for files scheduled to be added. */
+      below_working_node->checksum = NULL;
+      if (text_base_info)
+        {
+          below_working_node->checksum =
+             text_base_info->revert_base.sha1_checksum;
+        }
       below_working_node->translated_size = 0;
       below_working_node->changed_rev = SVN_INVALID_REVNUM;
       below_working_node->changed_date = 0;
@@ -2025,12 +2032,16 @@ write_entry(struct write_baton **entry_n
         working_node->checksum = NULL;
       else
         {
-          working_node->checksum = text_base_info->normal_base.sha1_checksum;
+          working_node->checksum = NULL;
+          /* text_base_info is NULL for files scheduled to be added. */
+          if (text_base_info)
+            working_node->checksum = text_base_info->normal_base.sha1_checksum;
+         
 
           /* If an MD5 checksum is present in the entry, we can verify that
            * it matches the MD5 of the base file we found earlier. */
 #ifdef SVN_DEBUG
-          if (entry->checksum)
+          if (entry->checksum && text_base_info)
           {
             svn_checksum_t *md5_checksum;
             SVN_ERR(svn_checksum_parse_hex(&md5_checksum, svn_checksum_md5,

Modified: subversion/branches/diff-optimizations-bytes/subversion/svn/lock-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svn/lock-cmd.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svn/lock-cmd.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svn/lock-cmd.c Sun Jan  2 08:06:05 2011
@@ -72,8 +72,9 @@ get_comment(const char **comment, svn_cl
     }
 
   /* Translate to UTF8/LF. */
-  SVN_ERR(svn_subst_translate_string(&comment_string, comment_string,
-                                     opt_state->encoding, pool));
+  SVN_ERR(svn_subst_translate_string2(&comment_string, NULL, NULL,
+                                      comment_string, opt_state->encoding,
+                                      pool, pool));
   *comment = comment_string->data;
 
   return SVN_NO_ERROR;

Modified: subversion/branches/diff-optimizations-bytes/subversion/svn/propget-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svn/propget-cmd.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svn/propget-cmd.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svn/propget-cmd.c Sun Jan  2 08:06:05 2011
@@ -61,7 +61,7 @@ stream_write(svn_stream_t *out,
   SVN_ERR(svn_stream_write(out, data, &write_len));
   if (write_len != len)
     return svn_error_create(SVN_ERR_STREAM_UNEXPECTED_EOF, NULL,
-                            "Error writing to stream");
+                            _("Error writing to stream"));
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svn/util.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svn/util.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svn/util.c Sun Jan  2 08:06:05 2011
@@ -623,7 +623,7 @@ svn_cl__cleanup_log_msg(void *log_msg_ba
      commit error chain, too. */
 
   err = svn_error_createf(commit_err->apr_err, NULL,
-                          "   '%s'",
+                          _("   '%s'"),
                           svn_dirent_local_style(lmb->tmpfile_left, pool));
   svn_error_compose(commit_err,
                     svn_error_create(commit_err->apr_err, err,

Modified: subversion/branches/diff-optimizations-bytes/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/svnlook/main.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/svnlook/main.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/svnlook/main.c Sun Jan  2 08:06:05 2011
@@ -1571,7 +1571,7 @@ print_history(void *baton,
       if (phb->count >= phb->limit)
         /* Not L10N'd, since this error is supressed by the caller. */
         return svn_error_create(SVN_ERR_CEASE_INVOCATION, NULL,
-                                "History item limit reached");
+                                _("History item limit reached"));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/svnsync_tests.py Sun Jan  2 08:06:05 2011
@@ -780,7 +780,7 @@ def info_not_synchronized(sbox):
 #----------------------------------------------------------------------
 
 def copy_bad_line_endings(sbox):
-  "copy with inconsistent lineendings in svn:props"
+  "copy with inconsistent line endings in svn:* props"
   run_test(sbox, "copy-bad-line-endings.dump",
            exp_dump_file_name="copy-bad-line-endings.expected.dump",
            bypass_prop_validation=True)

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/upgrade_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/upgrade_tests.py?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/upgrade_tests.py (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/cmdline/upgrade_tests.py Sun Jan  2 08:06:05 2011
@@ -831,6 +831,16 @@ def replaced_files(sbox):
       [sbox.ospath('B/f'), '958eb2d755df2d9e0de6f7b835aec16b64d83f6f'],
       [sbox.ospath('B/g'), '395dfb603d8a4e0348d0b082803f2b7426c76eb9']])
 
+def upgrade_with_scheduled_change(sbox):
+  "upgrade 1.6.x wc with a scheduled change"
+  
+  sbox.build(create_wc = False)
+  replace_sbox_with_tarfile(sbox, 'upgrade_with_scheduled_change.tar.bz2')
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'upgrade', sbox.wc_dir)
+  
+   
 ########################################################################
 # Run the tests
 
@@ -855,6 +865,7 @@ test_list = [ None,
               upgrade_tree_conflict_data,
               delete_in_copy_upgrade,
               replaced_files,
+              upgrade_with_scheduled_change,
              ]
 
 

Modified: subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/error-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/error-test.c?rev=1054362&r1=1054361&r2=1054362&view=diff
==============================================================================
--- subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/error-test.c (original)
+++ subversion/branches/diff-optimizations-bytes/subversion/tests/libsvn_subr/error-test.c Sun Jan  2 08:06:05 2011
@@ -129,7 +129,7 @@ test_error_purge_tracing(apr_pool_t *poo
     err = svn_error_return(err);
 
     /* Register a malfunction handler that doesn't call abort() to
-       check that a new error chain with a SVN_ERR_ASSERTION_FAIL is
+       check that a new error chain with an assertion error is
        returned. */
     orig_handler =
       svn_error_set_malfunction_handler(svn_error_raise_on_malfunction);
@@ -150,6 +150,8 @@ test_error_purge_tracing(apr_pool_t *poo
           err3 = err3->child;
         if (err3)
           err3_copy = *err3;
+        else
+          err3_copy.apr_err = APR_SUCCESS;
 
         svn_error_clear(err);
 
@@ -161,15 +163,12 @@ test_error_purge_tracing(apr_pool_t *poo
         svn_error_clear(err2);
 
         SVN_TEST_ASSERT(err3);
-        SVN_TEST_ASSERT(SVN_ERR_ASSERTION_FAIL == err2_copy.apr_err);
-        SVN_TEST_ASSERT(SVN_ERR_ASSERTION_FAIL == err3_copy.apr_err);
 
-        /* This is the line number in error.c where
-           SVN_ERR_ASSERT(err) is called.  This check is done to
-           assert that the error is being thrown from the expected
-           line and not from another assertion that could be
-           introduced in the future. */
-        SVN_TEST_ASSERT(379 == err3_copy.line);
+        SVN_TEST_ASSERT(SVN_ERROR_IN_CATEGORY(err2_copy.apr_err,
+                                              SVN_ERR_MALFUNC_CATEGORY_START));
+        SVN_TEST_ASSERT(err3_copy.apr_err == err2_copy.apr_err);
+        SVN_TEST_ASSERT(
+          SVN_ERR_ASSERTION_ONLY_TRACING_LINKS == err3_copy.apr_err);
       }
     else
       {