Author: julianfoad
Date: Mon Apr 20 08:10:40 2015
New Revision: 1674754

URL: http://svn.apache.org/r1674754
Log:
On the 'move-tracking-2' branch: catch up to trunk@1674752.

Added:
    subversion/branches/move-tracking-2/subversion/svnbench/null-blame-cmd.c
      - copied unchanged from r1674752, 
subversion/trunk/subversion/svnbench/null-blame-cmd.c
Modified:
    subversion/branches/move-tracking-2/   (props changed)
    subversion/branches/move-tracking-2/build/   (props changed)
    subversion/branches/move-tracking-2/build/ac-macros/swig.m4
    subversion/branches/move-tracking-2/build/generator/gen_base.py
    subversion/branches/move-tracking-2/build/generator/gen_win_dependencies.py
    
subversion/branches/move-tracking-2/build/generator/templates/build-outputs.mk.ezt
    
subversion/branches/move-tracking-2/build/generator/templates/vcnet_vcxproj.ezt
    subversion/branches/move-tracking-2/gen-make.py   (contents, props changed)
    subversion/branches/move-tracking-2/subversion/   (props changed)
    
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/EditorProxy.h
    
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/RemoteSession.cpp
    
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/StateReporter.cpp
    
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/StateReporter.h
    
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp
    
subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
    
subversion/branches/move-tracking-2/subversion/include/private/svn_client_private.h
    
subversion/branches/move-tracking-2/subversion/include/private/svn_cmdline_private.h
    subversion/branches/move-tracking-2/subversion/include/svn_dirent_uri.h
    subversion/branches/move-tracking-2/subversion/include/svn_fs.h
    subversion/branches/move-tracking-2/subversion/include/svn_ra.h
    subversion/branches/move-tracking-2/subversion/libsvn_client/client.h
    subversion/branches/move-tracking-2/subversion/libsvn_client/copy.c
    subversion/branches/move-tracking-2/subversion/libsvn_client/export.c
    subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c
    subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.c
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.h
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/dag.c
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/dag.h
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.h
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/pack.c
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/recovery.c
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/rep-cache.c
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/stats.c
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/structure
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/transaction.c
    subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/tree.c
    subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/stat.c
    subversion/branches/move-tracking-2/subversion/libsvn_repos/repos.c
    subversion/branches/move-tracking-2/subversion/libsvn_subr/   (props 
changed)
    subversion/branches/move-tracking-2/subversion/libsvn_subr/cmdline.c
    subversion/branches/move-tracking-2/subversion/libsvn_subr/dirent_uri.c
    subversion/branches/move-tracking-2/subversion/libsvn_subr/io.c
    subversion/branches/move-tracking-2/subversion/libsvn_wc/diff_editor.c
    subversion/branches/move-tracking-2/subversion/libsvn_wc/diff_local.c
    subversion/branches/move-tracking-2/subversion/libsvn_wc/wc-metadata.sql
    subversion/branches/move-tracking-2/subversion/libsvn_wc/wc_db.c
    subversion/branches/move-tracking-2/subversion/libsvn_wc/wc_db_update_move.c
    subversion/branches/move-tracking-2/subversion/mod_dav_svn/liveprops.c
    subversion/branches/move-tracking-2/subversion/mod_dav_svn/repos.c
    subversion/branches/move-tracking-2/subversion/svn/conflict-callbacks.c
    subversion/branches/move-tracking-2/subversion/svn/similarity.c
    subversion/branches/move-tracking-2/subversion/svn/svn.c
    subversion/branches/move-tracking-2/subversion/svnbench/cl.h
    subversion/branches/move-tracking-2/subversion/svnbench/svnbench.c
    subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
    subversion/branches/move-tracking-2/subversion/svnmucc/svnmucc.c
    subversion/branches/move-tracking-2/subversion/svnrdump/svnrdump.c
    subversion/branches/move-tracking-2/subversion/svnsync/svnsync.c
    
subversion/branches/move-tracking-2/subversion/tests/cmdline/checkout_tests.py
    subversion/branches/move-tracking-2/subversion/tests/cmdline/copy_tests.py
    subversion/branches/move-tracking-2/subversion/tests/cmdline/diff_tests.py
    subversion/branches/move-tracking-2/subversion/tests/cmdline/getopt_tests.py
    
subversion/branches/move-tracking-2/subversion/tests/cmdline/svnadmin_tests.py
    
subversion/branches/move-tracking-2/subversion/tests/cmdline/svnsync_authz_tests.py
    subversion/branches/move-tracking-2/subversion/tests/cmdline/svntest/wc.py
    subversion/branches/move-tracking-2/subversion/tests/cmdline/switch_tests.py
    subversion/branches/move-tracking-2/subversion/tests/cmdline/update_tests.py
    
subversion/branches/move-tracking-2/subversion/tests/cmdline/upgrade_tests.py
    
subversion/branches/move-tracking-2/subversion/tests/libsvn_client/client-test.c
    
subversion/branches/move-tracking-2/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/branches/move-tracking-2/tools/   (props changed)
    subversion/branches/move-tracking-2/tools/client-side/bash_completion
    subversion/branches/move-tracking-2/tools/dist/backport.pl
    subversion/branches/move-tracking-2/tools/dist/release.py
    subversion/branches/move-tracking-2/win-tests.py   (contents, props changed)

Propchange: subversion/branches/move-tracking-2/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 20 08:10:40 2015
@@ -88,4 +88,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1606692-1673179
+/subversion/trunk:1606692-1674752

Propchange: subversion/branches/move-tracking-2/build/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 20 08:10:40 2015
@@ -82,4 +82,4 @@
 /subversion/branches/verify-at-commit/build:1462039-1462408
 /subversion/branches/verify-keep-going/build:1439280-1546110
 /subversion/branches/wc-collate-path/build:1402685-1480384
-/subversion/trunk/build:1606692-1663280
+/subversion/trunk/build:1606692-1674752

Modified: subversion/branches/move-tracking-2/build/ac-macros/swig.m4
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/build/ac-macros/swig.m4?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/build/ac-macros/swig.m4 (original)
+++ subversion/branches/move-tracking-2/build/ac-macros/swig.m4 Mon Apr 20 
08:10:40 2015
@@ -92,12 +92,13 @@ AC_DEFUN(SVN_FIND_SWIG,
     #   packages/rpm/redhat-7.x/subversion.spec
     #   packages/rpm/rhel-3/subversion.spec
     #   packages/rpm/rhel-4/subversion.spec
-    if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then
+    if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \
+       test "$SWIG_VERSION" -lt "300000"; then
       SWIG_SUITABLE=yes
     else
       SWIG_SUITABLE=no
       AC_MSG_WARN([Detected SWIG version $SWIG_VERSION_RAW])
-      AC_MSG_WARN([Subversion requires SWIG 1.3.24 or later])
+      AC_MSG_WARN([Subversion requires SWIG >= 1.3.24 and < 3.0.0 ])
     fi
   fi
  

Modified: subversion/branches/move-tracking-2/build/generator/gen_base.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/build/generator/gen_base.py?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/build/generator/gen_base.py (original)
+++ subversion/branches/move-tracking-2/build/generator/gen_base.py Mon Apr 20 
08:10:40 2015
@@ -22,6 +22,7 @@
 # gen_base.py -- infrastructure for generating makefiles, dependencies, etc.
 #
 
+import collections
 import os
 import sys
 import glob
@@ -319,6 +320,93 @@ class GeneratorBase:
   def errno_filter(self, codes):
     return codes
 
+  class FileSectionOptionEnum(object):
+    # These are accessed via getattr() later on
+    file = object()
+    section = object()
+    option = object()
+
+  def _client_configuration_defines(self):
+    """Return an iterator over SVN_CONFIG_* #define's in the "Client
+    configuration files strings" section of svn_config.h."""
+
+    pattern = re.compile(
+      r'^\s*#\s*define\s+'
+      r'(?P<macro>SVN_CONFIG_(?P<kind>CATEGORY|SECTION|OPTION)_[A-Z0-9a-z_]+)'
+    )
+    kind = {
+      'CATEGORY': self.FileSectionOptionEnum.file,
+      'SECTION': self.FileSectionOptionEnum.section,
+      'OPTION': self.FileSectionOptionEnum.option,
+    }
+
+    fname = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),
+                         'subversion', 'include', 'svn_config.h')
+    lines = iter(open(fname))
+    for line in lines:
+      if "@name Client configuration files strings" in line:
+        break
+    else:
+      raise Exception("Unable to parse svn_config.h")
+
+    for line in lines:
+      if "@{" in line:
+        break
+    else:
+      raise Exception("Unable to parse svn_config.h")
+
+    for line in lines:
+      if "@}" in line:
+        break
+      match = pattern.match(line)
+      if match:
+        yield (
+          match.group('macro'),
+          kind[match.group('kind')],
+        )
+    else:
+      raise Exception("Unable to parse svn_config.h")
+
+  def write_config_keys(self):
+    groupby = collections.defaultdict(list)
+    empty_sections = []
+    previous = (None, None)
+    for macro, kind in self._client_configuration_defines():
+      if kind is previous[1] is self.FileSectionOptionEnum.section:
+        empty_sections.append(previous[0])
+      groupby[kind].append(macro)
+      previous = (macro, kind)
+    else:
+      # If the last (macro, kind) is a section, then it's an empty section.
+      if kind is self.FileSectionOptionEnum.section:
+        empty_sections.append(macro)
+
+    lines = []
+    lines.append('/* Automatically generated by %s:write_config_keys() */'
+                 % (__file__,))
+    lines.append('')
+
+    for kind in ('file', 'section', 'option'):
+      macros = groupby[getattr(self.FileSectionOptionEnum, kind)]
+      lines.append('static const char *svn__valid_config_%ss[] = {' % (kind,))
+      for macro in macros:
+        lines.append('  %s,' % (macro,))
+      # Remove ',' for c89 compatibility
+      lines[-1] = lines[-1][0:-1]
+      lines.append('};')
+      lines.append('')
+
+    lines.append('static const char *svn__empty_config_sections[] = {');
+    for section in empty_sections:
+      lines.append('  %s,' % (section,))
+    # Remove ',' for c89 compatibility
+    lines[-1] = lines[-1][0:-1]
+    lines.append('};')
+    lines.append('')
+
+    self.write_file_if_changed('subversion/libsvn_subr/config_keys.inc',
+                               '\n'.join(lines))
+
 class DependencyGraph:
   """Record dependencies between build items.
 
@@ -1212,6 +1300,9 @@ class IncludeDependencyInfo:
       if os.sep.join(['libsvn_subr', 'error.c']) in fname \
            and 'errorcode.inc' == include_param:
         continue # generated by GeneratorBase.write_errno_table
+      if os.sep.join(['libsvn_subr', 'cmdline.c']) in fname \
+           and 'config_keys.inc' == include_param:
+        continue # generated by GeneratorBase.write_config_keys
       elif direct_possibility_fname in domain_fnames:
         self._upd_dep_hash(hdrs, direct_possibility_fname, type_code)
       elif (len(domain_fnames) == 1

Modified: 
subversion/branches/move-tracking-2/build/generator/gen_win_dependencies.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/build/generator/gen_win_dependencies.py?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/build/generator/gen_win_dependencies.py 
(original)
+++ subversion/branches/move-tracking-2/build/generator/gen_win_dependencies.py 
Mon Apr 20 08:10:40 2015
@@ -296,7 +296,7 @@ class GenDependenciesBase(gen_base.Gener
 
     # Required dependencies
     self._find_apr()
-    self._find_apr_util_and_expat()
+    self._find_apr_util_etc()
     self._find_zlib()
     self._find_sqlite(show_warnings)
 
@@ -424,7 +424,7 @@ class GenDependenciesBase(gen_base.Gener
                                               defines=defines,
                                               extra_bin=extra_bin)
 
-  def _find_apr_util_and_expat(self):
+  def _find_apr_util_etc(self):
     "Find the APR-util library and version"
 
     minimal_aprutil_version = (1, 3, 0)
@@ -526,6 +526,13 @@ class GenDependenciesBase(gen_base.Gener
                                                    defines=defines,
                                                    extra_bin=extra_bin)
 
+    # Perhaps apr-util can also provide memcached support
+    if version >= (1, 3, 0) :
+      self._libraries['apr_memcache'] = SVNCommonLibrary(
+                                          'apr_memcache', inc_path, lib_dir,
+                                          lib_name, aprutil_version,
+                                          defines=['SVN_HAVE_MEMCACHE'])
+
     # And now find expat
     # If we have apr-util as a source location, it is in a subdir.
     # If we have an install package it is in the lib subdir

Modified: 
subversion/branches/move-tracking-2/build/generator/templates/build-outputs.mk.ezt
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/build/generator/templates/build-outputs.mk.ezt?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/build/generator/templates/build-outputs.mk.ezt
 (original)
+++ 
subversion/branches/move-tracking-2/build/generator/templates/build-outputs.mk.ezt
 Mon Apr 20 08:10:40 2015
@@ -46,6 +46,7 @@ MANPAGES =[for manpages] [manpages][end]
 CLEAN_FILES =[for cfiles] [cfiles][end]
 EXTRACLEAN_FILES =[for sql] [sql.header][end] \
   $(abs_builddir)/subversion/libsvn_subr/errorcode.inc \
+  $(abs_builddir)/subversion/libsvn_subr/config_keys.inc \
   $(abs_srcdir)/compile_commands.json
 
 SWIG_INCLUDES = -I$(abs_builddir)/subversion \

Modified: 
subversion/branches/move-tracking-2/build/generator/templates/vcnet_vcxproj.ezt
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/build/generator/templates/vcnet_vcxproj.ezt?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/build/generator/templates/vcnet_vcxproj.ezt 
(original)
+++ 
subversion/branches/move-tracking-2/build/generator/templates/vcnet_vcxproj.ezt 
Mon Apr 20 08:10:40 2015
@@ -62,7 +62,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
       
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
       
<DisableSpecificWarnings>4100;4127;4206;4512;4701;4706;4800;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      
<TreatSpecificWarningsAsErrors>4002;4003;4013;4020;4022;4024;4028;4029;4030;4031;4033;4047;4089;4113;4115;4204;4715;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
+      
<TreatSpecificWarningsAsErrors>4002;4003;4013;4020;4022;4024;4028;4029;4030;4031;4033;4047;4089;4113;4115;4133;4204;4715;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
 [if-any configs.forced_include_files]      <ForcedIncludeFiles>[for 
configs.forced_include_files][configs.forced_include_files];[end]%(ForcedIncludeFiles)</ForcedIncludeFiles>
 [end]    </ClCompile>
 [is config_type "Application"]    <Link>

Modified: subversion/branches/move-tracking-2/gen-make.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/gen-make.py?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/gen-make.py (original)
+++ subversion/branches/move-tracking-2/gen-make.py Mon Apr 20 08:10:40 2015
@@ -67,6 +67,7 @@ def main(fname, gentype, verfname=None,
   generator.write()
   generator.write_sqlite_headers()
   generator.write_errno_table()
+  generator.write_config_keys()
 
   if ('--debug', '') in other_options:
     for dep_type, target_dict in generator.graph.deps.items():

Propchange: subversion/branches/move-tracking-2/gen-make.py
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 20 08:10:40 2015
@@ -87,4 +87,4 @@
 /subversion/branches/verify-at-commit/gen-make.py:1462039-1462408
 /subversion/branches/verify-keep-going/gen-make.py:1439280-1546110
 /subversion/branches/wc-collate-path/gen-make.py:1402685-1480384
-/subversion/trunk/gen-make.py:1606692-1663280
+/subversion/trunk/gen-make.py:1606692-1674752

Propchange: subversion/branches/move-tracking-2/subversion/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 20 08:10:40 2015
@@ -82,4 +82,4 @@
 /subversion/branches/verify-at-commit/subversion:1462039-1462408
 /subversion/branches/verify-keep-going/subversion:1439280-1546110
 /subversion/branches/wc-collate-path/subversion:1402685-1480384
-/subversion/trunk/subversion:1606692-1673179
+/subversion/trunk/subversion:1606692-1674752

Modified: 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/EditorProxy.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/EditorProxy.h?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/EditorProxy.h
 (original)
+++ 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/EditorProxy.h
 Mon Apr 20 08:10:40 2015
@@ -27,6 +27,8 @@
 #ifndef JAVAHL_EDITOR_PROXY_H
 #define JAVAHL_EDITOR_PROXY_H
 
+#include <memory>
+
 #include "svn_delta.h"
 #include "private/svn_editor.h"
 #include "private/svn_delta_private.h"
@@ -51,6 +53,8 @@ struct EditorProxyCallbacks
 class EditorProxy
 {
 public:
+  typedef std::auto_ptr<EditorProxy> UniquePtr;
+
   EditorProxy(jobject jeditor, apr_pool_t* edit_pool,
               const char* repos_root_url, const char* base_relpath,
               svn_cancel_func_t cancel_func, void* cancel_baton,

Modified: 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/RemoteSession.cpp
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/RemoteSession.cpp
 (original)
+++ 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/RemoteSession.cpp
 Mon Apr 20 08:10:40 2015
@@ -835,7 +835,7 @@ RemoteSession::status(jobject jthis, jst
   proxy_callbacks.m_extra_baton.baton = &rp->m_target_revision;
 
   apr_pool_t* report_pool = rp->get_report_pool();
-  std::auto_ptr<EditorProxy> editor(
+  EditorProxy::UniquePtr editor(
       new EditorProxy(jstatus_editor, report_pool,
                       repos_root_url, base_relpath,
                       m_context->checkCancel, m_context,
@@ -853,7 +853,7 @@ RemoteSession::status(jobject jthis, jst
                                 editor->delta_editor(),
                                 editor->delta_baton(),
                                 report_pool),);
-  rp->set_reporter_data(raw_reporter, report_baton, editor.release());
+  rp->set_reporter_data(raw_reporter, report_baton, editor);
 }
 
 // TODO: diff

Modified: 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/StateReporter.cpp
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/StateReporter.cpp?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/StateReporter.cpp
 (original)
+++ 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/StateReporter.cpp
 Mon Apr 20 08:10:40 2015
@@ -43,9 +43,7 @@ StateReporter::StateReporter()
 {}
 
 StateReporter::~StateReporter()
-{
-  delete m_editor;
-}
+{}
 
 StateReporter*
 StateReporter::getCppObject(jobject jthis)
@@ -179,8 +177,8 @@ StateReporter::abortReport()
 
 void
 StateReporter::set_reporter_data(const svn_ra_reporter3_t* raw_reporter,
-                                   void* report_baton,
-                                   EditorProxy* editor)
+                                 void* report_baton,
+                                 EditorProxy::UniquePtr editor)
 {
   //DEBUG:fprintf(stderr, "  (n) StateReporter::set_reporter_data()\n");
 

Modified: 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/StateReporter.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/StateReporter.h?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/StateReporter.h
 (original)
+++ 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/StateReporter.h
 Mon Apr 20 08:10:40 2015
@@ -61,13 +61,13 @@ private:
   bool m_valid;
   const svn_ra_reporter3_t* m_raw_reporter;
   void* m_report_baton;
-  EditorProxy* m_editor;
+  EditorProxy::UniquePtr m_editor;
 
   friend class RemoteSession;
   apr_pool_t* get_report_pool() const { return pool.getPool(); }
   void set_reporter_data(const svn_ra_reporter3_t* raw_reporter,
                          void* report_baton,
-                         EditorProxy* editor);
+                         EditorProxy::UniquePtr editor);
   svn_revnum_t m_target_revision;
 };
 

Modified: 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp
 (original)
+++ 
subversion/branches/move-tracking-2/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp
 Mon Apr 20 08:10:40 2015
@@ -270,7 +270,7 @@ Java_org_apache_subversion_javahl_util_C
       {
         enumerator_t* enmr = static_cast<enumerator_t*>(baton);
         JNIEnv* const e = enmr->m_env;
-        const jobject jh = enmr->m_jhandler;;
+        const jobject jh = enmr->m_jhandler;
 
         static jmethodID mid = 0;
         if (0 == mid)

Modified: 
subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
 (original)
+++ 
subversion/branches/move-tracking-2/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
 Mon Apr 20 08:10:40 2015
@@ -1091,6 +1091,7 @@ public class BasicTests extends SVNTests
     private void setupPinExternalsTest(OneTest thisTest) throws Throwable
     {
         byte[] extref = ("^/A/D/H ADHext\n" +
+                         "^/A/D/H ADHext2\n" +
                          "^/A/D/H@1 peggedADHext\n" +
                          "-r1 ^/A/D/H revvedADHext\n").getBytes();
         Set<String> paths = new HashSet<String>();
@@ -1130,6 +1131,7 @@ public class BasicTests extends SVNTests
 
         // Verification
         String expected = ("^/A/D/H@2 ADHext\n" +
+                           "^/A/D/H@2 ADHext2\n" +
                            "^/A/D/H@1 peggedADHext\n" +
                            "-r1 ^/A/D/H@2 revvedADHext\n");
         String actual =
@@ -1158,6 +1160,7 @@ public class BasicTests extends SVNTests
 
         // Verification
         String expected = ("^/A/D/H@2 ADHext\n" +
+                           "^/A/D/H@2 ADHext2\n" +
                            "^/A/D/H@1 peggedADHext\n" +
                            "-r1 ^/A/D/H@2 revvedADHext\n");
         String actual =
@@ -1186,6 +1189,7 @@ public class BasicTests extends SVNTests
 
         // Verification
         String expected = ("^/A/D/H@2 ADHext\n" +
+                           "^/A/D/H@2 ADHext2\n" +
                            "^/A/D/H@1 peggedADHext\n" +
                            "-r1 ^/A/D/H@2 revvedADHext\n");
         String actual =
@@ -1214,6 +1218,7 @@ public class BasicTests extends SVNTests
 
         // Verification
         String expected = ("^/A/D/H@2 ADHext\n" +
+                           "^/A/D/H@2 ADHext2\n" +
                            "^/A/D/H@1 peggedADHext\n" +
                            "-r1 ^/A/D/H@2 revvedADHext\n");
         String actual =
@@ -1249,6 +1254,44 @@ public class BasicTests extends SVNTests
 
         // Verification
         String expected = ("^/A/D/H@2 ADHext\n" +
+                           "^/A/D/H ADHext2\n" +
+                           "^/A/D/H@1 peggedADHext\n" +
+                           "-r1 ^/A/D/H revvedADHext\n");
+        String actual =
+            new String(client.propertyGet(target, "svn:externals", null, 
null));
+
+        assertEquals(expected, actual);
+    }
+
+    /**
+     * Test REPO-to-REPO copy with explicit pinned externals that
+     * don't correspond to actual externals
+     * @throws Throwable
+     */
+    public void testCopyPinExternals_repo2repo_corkscrew() throws Throwable
+    {
+        // build the test setup
+        OneTest thisTest = new OneTest();
+        setupPinExternalsTest(thisTest);
+
+        String sourceUrl = thisTest.getUrl() + "/A/B";
+        Map<String, List<ExternalItem>> externalsToPin =
+            new HashMap<String, List<ExternalItem>>();
+        List<ExternalItem> items = new ArrayList<ExternalItem>(1);
+        items.add(new ExternalItem("ADHext", "^/A/D/H", null, null));
+        externalsToPin.put(sourceUrl + "/A", items);
+
+        List<CopySource> sources = new ArrayList<CopySource>(1);
+        sources.add(new CopySource(sourceUrl, null, null));
+        String target = thisTest.getUrl() + "/A/Bcopy";
+        client.copy(sources, target, true, false, false, false,
+                    true,       // pinExternals
+                    externalsToPin,
+                    null, new ConstMsg("Copy WC to REPO"), null);
+
+        // Verification
+        String expected = ("^/A/D/H ADHext\n" +
+                           "^/A/D/H ADHext2\n" +
                            "^/A/D/H@1 peggedADHext\n" +
                            "-r1 ^/A/D/H revvedADHext\n");
         String actual =

Modified: 
subversion/branches/move-tracking-2/subversion/include/private/svn_client_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_client_private.h?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/include/private/svn_client_private.h
 (original)
+++ 
subversion/branches/move-tracking-2/subversion/include/private/svn_client_private.h
 Mon Apr 20 08:10:40 2015
@@ -40,6 +40,51 @@ extern "C" {
 #endif /* __cplusplus */
 
 
+/* Set *REVNUM to the revision number identified by REVISION.
+
+   If REVISION->kind is svn_opt_revision_number, just use
+   REVISION->value.number, ignoring LOCAL_ABSPATH and RA_SESSION.
+
+   Else if REVISION->kind is svn_opt_revision_committed,
+   svn_opt_revision_previous, or svn_opt_revision_base, or
+   svn_opt_revision_working, then the revision can be identified
+   purely based on the working copy's administrative information for
+   LOCAL_ABSPATH, so RA_SESSION is ignored.  If LOCAL_ABSPATH is not
+   under revision control, return SVN_ERR_UNVERSIONED_RESOURCE, or if
+   LOCAL_ABSPATH is null, return SVN_ERR_CLIENT_VERSIONED_PATH_REQUIRED.
+
+   Else if REVISION->kind is svn_opt_revision_date or
+   svn_opt_revision_head, then RA_SESSION is used to retrieve the
+   revision from the repository (using REVISION->value.date in the
+   former case), and LOCAL_ABSPATH is ignored.  If RA_SESSION is null,
+   return SVN_ERR_CLIENT_RA_ACCESS_REQUIRED.
+
+   Else if REVISION->kind is svn_opt_revision_unspecified, set
+   *REVNUM to SVN_INVALID_REVNUM.
+
+   If YOUNGEST_REV is non-NULL, it is an in/out parameter.  If
+   *YOUNGEST_REV is valid, use it as the youngest revision in the
+   repository (regardless of reality) -- don't bother to lookup the
+   true value for HEAD, and don't return any value in *REVNUM greater
+   than *YOUNGEST_REV.  If *YOUNGEST_REV is not valid, and a HEAD
+   lookup is required to populate *REVNUM, then also populate
+   *YOUNGEST_REV with the result.  This is useful for making multiple
+   serialized calls to this function with a basically static view of
+   the repository, avoiding race conditions which could occur between
+   multiple invocations with HEAD lookup requests.
+
+   Else return SVN_ERR_CLIENT_BAD_REVISION.
+
+   Use SCRATCH_POOL for any temporary allocation.  */
+svn_error_t *
+svn_client__get_revision_number(svn_revnum_t *revnum,
+                                svn_revnum_t *youngest_rev,
+                                svn_wc_context_t *wc_ctx,
+                                const char *local_abspath,
+                                svn_ra_session_t *ra_session,
+                                const svn_opt_revision_t *revision,
+                                apr_pool_t *scratch_pool);
+
 /* Return true if KIND is a revision kind that is dependent on the working
  * copy. Otherwise, return false. */
 #define SVN_CLIENT__REVKIND_NEEDS_WC(kind)                                 \

Modified: 
subversion/branches/move-tracking-2/subversion/include/private/svn_cmdline_private.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_cmdline_private.h?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- 
subversion/branches/move-tracking-2/subversion/include/private/svn_cmdline_private.h
 (original)
+++ 
subversion/branches/move-tracking-2/subversion/include/private/svn_cmdline_private.h
 Mon Apr 20 08:10:40 2015
@@ -88,11 +88,15 @@ typedef struct svn_cmdline__config_argum
  * containing svn_cmdline__config_argument_t* elements, allocating the option
  * data in @a pool
  *
+ * [Since 1.9/1.10:] If the file, section, or option value is not recognized,
+ * warn to @c stderr, using @a prefix as in svn_handle_warning2().
+ *
  * @since New in 1.7.
  */
 svn_error_t *
 svn_cmdline__parse_config_option(apr_array_header_t *config_options,
                                  const char *opt_arg,
+                                 const char *prefix,
                                  apr_pool_t *pool);
 
 /** Sets the config options in @a config_options, an apr array containing

Modified: 
subversion/branches/move-tracking-2/subversion/include/svn_dirent_uri.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/svn_dirent_uri.h?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/svn_dirent_uri.h 
(original)
+++ subversion/branches/move-tracking-2/subversion/include/svn_dirent_uri.h Mon 
Apr 20 08:10:40 2015
@@ -363,9 +363,9 @@ svn_relpath_dirname(const char *relpath,
  * @since New in 1.9.
  */
 const char *
-svn_relpath_limit(const char *relpath,
-                  int max_components,
-                  apr_pool_t *result_pool);
+svn_relpath_prefix(const char *relpath,
+                   int max_components,
+                   apr_pool_t *result_pool);
 
 
 /** Divide the canonicalized @a uri into a uri @a *dirpath and a

Modified: subversion/branches/move-tracking-2/subversion/include/svn_fs.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/svn_fs.h?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/svn_fs.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/svn_fs.h Mon Apr 20 
08:10:40 2015
@@ -113,7 +113,7 @@ typedef struct svn_fs_t svn_fs_t;
  *
  * "2" is allowed, too and means "enable if efficient",
  * i.e. this will not create warning at runtime if there
- * if no efficient support for revprop caching.
+ * is no efficient support for revprop caching.
  *
  * @since New in 1.8.
  */

Modified: subversion/branches/move-tracking-2/subversion/include/svn_ra.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/svn_ra.h?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/svn_ra.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/svn_ra.h Mon Apr 20 
08:10:40 2015
@@ -1094,11 +1094,10 @@ svn_ra_get_file(svn_ra_session_t *sessio
  * callers want to know, and some don't.)
  *
  * If @a props is non @c NULL, set @a *props to contain the properties of
- * the directory.  This means @em all properties: not just ones controlled by
- * the user and stored in the repository fs, but non-tweakable ones
- * generated by the SCM system itself (e.g. 'wcprops', 'entryprops',
- * etc.)  The keys are <tt>const char *</tt>, values are
- * <tt>@c svn_string_t *</tt>.
+ * the directory, including properties that are non-tweakable and
+ * generated by the SCM system itself (such as #svn_prop_wc_kind and
+ * #svn_prop_entry_kind properties).  The keys are <tt>const char *</tt>,
+ * values are <tt>@c svn_string_t *</tt>.
  *
  * @since New in 1.4.
  */

Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/client.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/client.h?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/client.h 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/client.h Mon 
Apr 20 08:10:40 2015
@@ -73,52 +73,6 @@ typedef struct svn_client__private_ctx_t
 svn_client__private_ctx_t *
 svn_client__get_private_ctx(svn_client_ctx_t *ctx);
 
-
-/* Set *REVNUM to the revision number identified by REVISION.
-
-   If REVISION->kind is svn_opt_revision_number, just use
-   REVISION->value.number, ignoring LOCAL_ABSPATH and RA_SESSION.
-
-   Else if REVISION->kind is svn_opt_revision_committed,
-   svn_opt_revision_previous, or svn_opt_revision_base, or
-   svn_opt_revision_working, then the revision can be identified
-   purely based on the working copy's administrative information for
-   LOCAL_ABSPATH, so RA_SESSION is ignored.  If LOCAL_ABSPATH is not
-   under revision control, return SVN_ERR_UNVERSIONED_RESOURCE, or if
-   LOCAL_ABSPATH is null, return SVN_ERR_CLIENT_VERSIONED_PATH_REQUIRED.
-
-   Else if REVISION->kind is svn_opt_revision_date or
-   svn_opt_revision_head, then RA_SESSION is used to retrieve the
-   revision from the repository (using REVISION->value.date in the
-   former case), and LOCAL_ABSPATH is ignored.  If RA_SESSION is null,
-   return SVN_ERR_CLIENT_RA_ACCESS_REQUIRED.
-
-   Else if REVISION->kind is svn_opt_revision_unspecified, set
-   *REVNUM to SVN_INVALID_REVNUM.
-
-   If YOUNGEST_REV is non-NULL, it is an in/out parameter.  If
-   *YOUNGEST_REV is valid, use it as the youngest revision in the
-   repository (regardless of reality) -- don't bother to lookup the
-   true value for HEAD, and don't return any value in *REVNUM greater
-   than *YOUNGEST_REV.  If *YOUNGEST_REV is not valid, and a HEAD
-   lookup is required to populate *REVNUM, then also populate
-   *YOUNGEST_REV with the result.  This is useful for making multiple
-   serialized calls to this function with a basically static view of
-   the repository, avoiding race conditions which could occur between
-   multiple invocations with HEAD lookup requests.
-
-   Else return SVN_ERR_CLIENT_BAD_REVISION.
-
-   Use SCRATCH_POOL for any temporary allocation.  */
-svn_error_t *
-svn_client__get_revision_number(svn_revnum_t *revnum,
-                                svn_revnum_t *youngest_rev,
-                                svn_wc_context_t *wc_ctx,
-                                const char *local_abspath,
-                                svn_ra_session_t *ra_session,
-                                const svn_opt_revision_t *revision,
-                                apr_pool_t *scratch_pool);
-
 /* Set *ORIGINAL_REPOS_RELPATH and *ORIGINAL_REVISION to the original location
    that served as the source of the copy from which PATH_OR_URL at REVISION was
    created, or NULL and SVN_INVALID_REVNUM (respectively) if PATH_OR_URL at

Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/copy.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/copy.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/copy.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/copy.c Mon Apr 
20 08:10:40 2015
@@ -330,8 +330,16 @@ pin_externals_prop(svn_string_t **pinned
                                               scratch_pool));
 
   if (externals_to_pin)
-    items_to_pin = svn_hash_gets((apr_hash_t *)externals_to_pin,
-                                 local_abspath_or_url);
+    {
+      items_to_pin = svn_hash_gets((apr_hash_t *)externals_to_pin,
+                                   local_abspath_or_url);
+      if (!items_to_pin)
+        {
+          /* No pinning at all for this path. */
+          *pinned_externals = svn_string_dup(externals_prop_val, result_pool);
+          return SVN_NO_ERROR;
+        }
+    }
   else
     items_to_pin = NULL;
 
@@ -1616,7 +1624,10 @@ repos_to_repos_copy(const apr_array_head
           && (relpath != NULL && *relpath != '\0'))
         {
           info->resurrection = TRUE;
-          top_url = svn_uri_dirname(top_url, pool);
+          top_url = svn_uri_get_longest_ancestor(
+                            top_url,
+                            svn_uri_dirname(pair->dst_abspath_or_url, pool),
+                            pool);
           SVN_ERR(svn_ra_reparent(ra_session, top_url, pool));
         }
     }

Modified: subversion/branches/move-tracking-2/subversion/libsvn_client/export.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_client/export.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_client/export.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_client/export.c Mon 
Apr 20 08:10:40 2015
@@ -1508,7 +1508,7 @@ svn_client_export5(svn_revnum_t *result_
       eib.ignore_keywords = ignore_keywords;
       eib.wc_ctx = ctx->wc_ctx;
       eib.native_eol = native_eol;
-      eib.notify_func = ctx->notify_func2;;
+      eib.notify_func = ctx->notify_func2;
       eib.notify_baton = ctx->notify_baton2;
       eib.origin_abspath = from_path_or_url;
       eib.exported = FALSE;

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3p.c Mon 
Apr 20 08:10:40 2015
@@ -705,7 +705,7 @@ find_txn_path(apr_hash_t *changes,
      if it was existing, add it to the 'existing path', else stop there. */
   for (i = 1; *remainder_path; i++)
     {
-      const char *new_prefix_path = svn_relpath_limit(relpath, i, result_pool);
+      const char *new_prefix_path = svn_relpath_prefix(relpath, i, 
result_pool);
       change_node_t *change = svn_hash_gets(changes, new_prefix_path);
 
       if (change && change->action == RESTRUCTURE_ADD)

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_base/fs.c Mon Apr 
20 08:10:40 2015
@@ -780,7 +780,7 @@ base_create(svn_fs_t *fs,
   ((base_fs_data_t *) fs->fsap_data)->format = format;
 
   SVN_ERR(populate_opened_fs(fs, pool));
-  return SVN_NO_ERROR;;
+  return SVN_NO_ERROR;
 
 error:
   return svn_error_compose_create(svn_err,

Modified: 
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.c 
Mon Apr 20 08:10:40 2015
@@ -286,6 +286,114 @@ use_block_read(svn_fs_t *fs)
   return svn_fs_fs__use_log_addressing(fs) && ffd->use_block_read;
 }
 
+svn_error_t *
+svn_fs_fs__fixup_expanded_size(svn_fs_t *fs,
+                               representation_t *rep,
+                               apr_pool_t *scratch_pool)
+{
+  svn_checksum_t checksum;
+  svn_checksum_t *empty_md5;
+  svn_fs_fs__revision_file_t *revision_file;
+  svn_fs_fs__rep_header_t *rep_header;
+
+  /* Anything to do at all?
+   *
+   * Note that a 0 SIZE is only possible for PLAIN reps due to the SVN\1
+   * magic prefix in any DELTA rep. */
+  if (!rep || rep->expanded_size != 0 || rep->size == 0)
+    return SVN_NO_ERROR;
+
+  /* This function may only be called for committed data. */
+  assert(!svn_fs_fs__id_txn_used(&rep->txn_id));
+
+  /* EXPANDED_SIZE is 0. If the MD5 does not match the one for empty
+   * contents, we know that EXPANDED_SIZE == 0 is wrong and needs to
+   * be set to the actual value given by SIZE.
+   *
+   * Using svn_checksum_match() will also accept all-zero values for
+   * the MD5 digest and only report a mismatch if the MD5 has actually
+   * been given. */
+  empty_md5 = svn_checksum_empty_checksum(svn_checksum_md5, scratch_pool);
+
+  checksum.digest = rep->md5_digest;
+  checksum.kind = svn_checksum_md5;
+  if (!svn_checksum_match(empty_md5, &checksum))
+    {
+      rep->expanded_size = rep->size;
+      return SVN_NO_ERROR;
+    }
+
+  /* Data in the rep-cache.db does not have MD5 checksums (all zero) on it.
+   * Compare SHA1 instead. */
+  if (rep->has_sha1)
+    {
+      svn_checksum_t *empty_sha1
+        = svn_checksum_empty_checksum(svn_checksum_sha1, scratch_pool);
+
+      checksum.digest = rep->sha1_digest;
+      checksum.kind = svn_checksum_sha1;
+      if (!svn_checksum_match(empty_sha1, &checksum))
+        {
+          rep->expanded_size = rep->size;
+          return SVN_NO_ERROR;
+        }
+    }
+
+  /* Only two cases are left here.
+   * (1) A non-empty PLAIN rep with a MD5 collision on EMPTY_MD5.
+   * (2) A DELTA rep with zero-length output. */
+
+  /* SVN always stores a DELTA rep with zero-length output as an empty
+   * sequence of txdelta windows, i.e. as "SVN\1".  In that case, SIZE is
+   * 4 bytes.  There is no other possible DELTA rep of that size and any
+   * PLAIN rep of 4 bytes would produce a different MD5.  Hence, if SIZE is
+   * actually 4 here, we know that this is an empty DELTA rep.
+   *
+   * Note that it is technically legal to have DELTA reps with a 0 length
+   * output window.  Their on-disk size would be longer.  We handle that
+   * case later together with the equally unlikely MD5 collision. */
+  if (rep->size == 4)
+    {
+      /* EXPANDED_SIZE is already 0. */
+      return SVN_NO_ERROR;
+    }
+
+  /* We still have the two options, PLAIN or DELTA rep.  At this point, we
+   * are in an extremely unlikely case and can spend some time to figure it
+   * out.  So, let's just look at the representation header. */
+  SVN_ERR(open_and_seek_revision(&revision_file, fs, rep->revision,
+                                 rep->item_index, scratch_pool));
+  SVN_ERR(svn_fs_fs__read_rep_header(&rep_header, revision_file->stream,
+                                     scratch_pool, scratch_pool));
+  SVN_ERR(svn_fs_fs__close_revision_file(revision_file));
+
+  /* Only for PLAIN reps do we have to correct EXPANDED_SIZE. */
+  if (rep_header->type == svn_fs_fs__rep_plain)
+    rep->expanded_size = rep->size;
+
+  return SVN_NO_ERROR;
+}
+
+/* Correct known issues with committed NODEREV in FS.
+ * Uses SCRATCH_POOL for temporaries.
+ */
+static svn_error_t *
+fixup_node_revision(svn_fs_t *fs,
+                    node_revision_t *noderev,
+                    apr_pool_t *scratch_pool)
+{
+  /* Workaround issue #4031: is-fresh-txn-root in revision files. */
+  noderev->is_fresh_txn_root = FALSE;
+
+  /* Make sure EXPANDED_SIZE has the correct value for every rep. */
+  SVN_ERR(svn_fs_fs__fixup_expanded_size(fs, noderev->data_rep,
+                                         scratch_pool));
+  SVN_ERR(svn_fs_fs__fixup_expanded_size(fs, noderev->prop_rep,
+                                         scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
 /* Get the node-revision for the node ID in FS.
    Set *NODEREV_P to the new node-revision structure, allocated in POOL.
    See svn_fs_fs__get_node_revision, which wraps this and adds another
@@ -376,9 +484,7 @@ get_node_revision_body(node_revision_t *
                                           revision_file->stream,
                                           result_pool,
                                           scratch_pool));
-
-          /* Workaround issue #4031: is-fresh-txn-root in revision files. */
-          (*noderev_p)->is_fresh_txn_root = FALSE;
+          SVN_ERR(fixup_node_revision(fs, *noderev_p, scratch_pool));
 
           /* The noderev is not in cache, yet. Add it, if caching has been 
enabled. */
           if (ffd->node_revision_cache)
@@ -765,9 +871,7 @@ create_rep_state_body(rep_state_t **rep_
      Since we don't know the depth of the delta chain, let's assume, the
      whole contents get rewritten 3 times.
    */
-  estimated_window_storage
-    = 4 * (  (rep->expanded_size ? rep->expanded_size : rep->size)
-           + SVN_DELTA_WINDOW_SIZE);
+  estimated_window_storage = 4 * (rep->expanded_size + SVN_DELTA_WINDOW_SIZE);
   estimated_window_storage = MIN(estimated_window_storage, APR_SIZE_MAX);
 
   rs->window_cache =    ffd->txdelta_window_cache
@@ -1322,15 +1426,11 @@ set_cached_combined_window(svn_stringbuf
    ID, and representation REP.
    Also, set *WINDOW_P to the base window content for *LIST, if it
    could be found in cache. Otherwise, *LIST will contain the base
-   representation for the whole delta chain.
-   Finally, return the expanded size of the representation in
-   *EXPANDED_SIZE. It will take care of cases where only the on-disk
-   size is known.  */
+   representation for the whole delta chain. */
 static svn_error_t *
 build_rep_list(apr_array_header_t **list,
                svn_stringbuf_t **window_p,
                rep_state_t **src_state,
-               svn_filesize_t *expanded_size,
                svn_fs_t *fs,
                representation_t *first_rep,
                apr_pool_t *pool)
@@ -1345,24 +1445,9 @@ build_rep_list(apr_array_header_t **list
   *list = apr_array_make(pool, 1, sizeof(rep_state_t *));
   rep = *first_rep;
 
-  /* The value as stored in the data struct.
-     0 is either for unknown length or actually zero length. */
-  *expanded_size = first_rep->expanded_size;
-
   /* for the top-level rep, we need the rep_args */
   SVN_ERR(create_rep_state(&rs, &rep_header, &shared_file, &rep, fs, pool,
                            iterpool));
-
-  /* Unknown size or empty representation?
-     That implies the this being the first iteration.
-     Usually size equals on-disk size, except for empty,
-     compressed representations (delta, size = 4).
-     Please note that for all non-empty deltas have
-     a 4-byte header _plus_ some data. */
-  if (*expanded_size == 0)
-    if (rep_header->type == svn_fs_fs__rep_plain || first_rep->size != 4)
-      *expanded_size = first_rep->size;
-
   while (1)
     {
       svn_pool_clear(iterpool);
@@ -1664,7 +1749,7 @@ get_combined_window(svn_stringbuf_t **re
 }
 
 /* Returns whether or not the expanded fulltext of the file is cachable
- * based on its size SIZE.  The decision depends on the cache used by RB.
+ * based on its size SIZE.  The decision depends on the cache used by FFD.
  */
 static svn_boolean_t
 fulltext_size_is_cachable(fs_fs_data_t *ffd, svn_filesize_t size)
@@ -1997,8 +2082,9 @@ rep_read_contents(void *baton,
   if (!rb->rs_list)
     {
       /* Window stream not initialized, yet.  Do it now. */
+      rb->len = rb->rep.expanded_size;
       SVN_ERR(build_rep_list(&rb->rs_list, &rb->base_window,
-                             &rb->src_state, &rb->len, rb->fs, &rb->rep,
+                             &rb->src_state, rb->fs, &rb->rep,
                              rb->filehandle_pool));
 
       /* In case we did read from the fulltext cache before, make the
@@ -2065,7 +2151,6 @@ svn_fs_fs__get_contents(svn_stream_t **c
   else
     {
       fs_fs_data_t *ffd = fs->fsap_data;
-      svn_filesize_t len = rep->expanded_size ? rep->expanded_size : rep->size;
       struct rep_read_baton *rb;
 
       pair_cache_key_t fulltext_cache_key = { 0 };
@@ -2081,7 +2166,7 @@ svn_fs_fs__get_contents(svn_stream_t **c
        * cache it. */
       if (ffd->fulltext_cache && cache_fulltext
           && SVN_IS_VALID_REVNUM(rep->revision)
-          && fulltext_size_is_cachable(ffd, len))
+          && fulltext_size_is_cachable(ffd, rep->expanded_size))
         {
           rb->fulltext_cache = ffd->fulltext_cache;
         }
@@ -2469,9 +2554,7 @@ get_dir_contents(apr_array_header_t **en
       /* Undeltify content before parsing it. Otherwise, we could only
        * parse it byte-by-byte.
        */
-      apr_size_t len = noderev->data_rep->expanded_size
-                     ? (apr_size_t)noderev->data_rep->expanded_size
-                     : (apr_size_t)noderev->data_rep->size;
+      apr_size_t len = noderev->data_rep->expanded_size;
       svn_stringbuf_t *text;
 
       /* The representation is immutable.  Read it normally. */
@@ -3200,9 +3283,7 @@ block_read_noderev(node_revision_t **nod
   /* read node rev from revision file */
   SVN_ERR(svn_fs_fs__read_noderev(noderev_p, stream,
                                   result_pool, scratch_pool));
-
-  /* Workaround issue #4031: is-fresh-txn-root in revision files. */
-  (*noderev_p)->is_fresh_txn_root = FALSE;
+  SVN_ERR(fixup_node_revision(fs, *noderev_p, scratch_pool));
 
   if (ffd->node_revision_cache)
     SVN_ERR(svn_cache__set(ffd->node_revision_cache, &key, *noderev_p,

Modified: 
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.h?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.h 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/cached_data.h 
Mon Apr 20 08:10:40 2015
@@ -30,6 +30,18 @@
 
 
 
+/* Resolve a FSFS quirk: if REP in FS is a "PLAIN" representation, its
+ * EXPANDED_SIZE element may be 0, in which case its value has to be taken
+ * from SIZE.
+ *
+ * This function ensures that EXPANDED_SIZE in REP always contains the
+ * actual value. No-op if REP is NULL.  Uses SCRATCH_POOL for temporaries.
+ */
+svn_error_t *
+svn_fs_fs__fixup_expanded_size(svn_fs_t *fs,
+                               representation_t *rep,
+                               apr_pool_t *scratch_pool);
+
 /* Set *NODEREV_P to the node-revision for the node ID in FS.  Do any
    allocations in POOL. */
 svn_error_t *

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/dag.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/dag.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/dag.c Mon Apr 
20 08:10:40 2015
@@ -498,6 +498,40 @@ svn_fs_fs__dag_get_proplist(apr_hash_t *
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_fs_fs__dag_has_props(svn_boolean_t *has_props,
+                         dag_node_t *node,
+                         apr_pool_t *scratch_pool)
+{
+  node_revision_t *noderev;
+
+  SVN_ERR(get_node_revision(&noderev, node));
+
+  if (! noderev->prop_rep)
+    {
+      *has_props = FALSE; /* Easy out */
+      return SVN_NO_ERROR;
+    }
+
+  if (svn_fs_fs__id_txn_used(&noderev->prop_rep->txn_id))
+    {
+      /* We are in a commit or something. Check actual properties */
+      apr_hash_t *proplist;
+
+      SVN_ERR(svn_fs_fs__get_proplist(&proplist, node->fs,
+                                      noderev, scratch_pool));
+
+      *has_props = proplist ? (0 < apr_hash_count(proplist)) : FALSE;
+    }
+  else
+    {
+      /* Properties are stored as a standard hash stream,
+         always ending with "END\n" (4 bytes) */
+      *has_props = noderev->prop_rep->expanded_size > 4;
+    }
+
+  return SVN_NO_ERROR;
+}
 
 svn_error_t *
 svn_fs_fs__dag_set_proplist(dag_node_t *node,

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/dag.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/dag.h?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/dag.h Mon Apr 
20 08:10:40 2015
@@ -177,6 +177,12 @@ svn_error_t *svn_fs_fs__dag_get_proplist
                                          dag_node_t *node,
                                          apr_pool_t *pool);
 
+/* Set *HAS_PROPS to TRUE if NODE has properties. Use SCRATCH_POOL
+   for temporary allocations */
+svn_error_t *svn_fs_fs__dag_has_props(svn_boolean_t *has_props,
+                                      dag_node_t *node,
+                                      apr_pool_t *scratch_pool);
+
 /* Set the property list of NODE to PROPLIST, allocating from POOL.
    The node being changed must be mutable.
 

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.h?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs.h Mon Apr 20 
08:10:40 2015
@@ -527,7 +527,14 @@ typedef struct representation_t
   svn_filesize_t size;
 
   /* The size of the fulltext of the representation. If this is 0,
-   * the fulltext size is equal to representation size in the rev file, */
+   * for a plain rep, the real fulltext size is equal to the SIZE field.
+   * For a delta rep, this field is always the real fulltext size.
+   *
+   * Note that svn_fs_fs__fixup_expanded_size() checks for these special
+   * cases and ensures that this field contains the actual value.  We call
+   * it early after reading a representation struct, so most code does not
+   * have to worry about it.
+   */
   svn_filesize_t expanded_size;
 
   /* Is this a representation (still) within a transaction? */

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/fs_fs.c Mon Apr 
20 08:10:40 2015
@@ -1377,38 +1377,9 @@ svn_fs_fs__file_length(svn_filesize_t *l
       /* Treat "no representation" as "empty file". */
       *length = 0;
     }
-  else if (data_rep->expanded_size)
-    {
-      /* Standard case: a non-empty file. */
-      *length = data_rep->expanded_size;
-    }
   else
     {
-      /* Work around a FSFS format quirk (see issue #4554).
-
-         A plain representation may specify its EXPANDED LENGTH as "0"
-         in which case, the SIZE value is what we want.
-
-         Because EXPANDED_LENGTH will also be 0 for empty files, while
-         SIZE is non-null, we need to check wether the content is
-         actually empty.  We simply compare with the MD5 checksum of
-         empty content (sha-1 is not always available).
-       */
-      svn_checksum_t *empty_md5
-        = svn_checksum_empty_checksum(svn_checksum_md5, pool);
-
-      if (memcmp(empty_md5->digest, data_rep->md5_digest,
-                 sizeof(data_rep->md5_digest)))
-        {
-          /* Contents is not empty, i.e. EXPANDED_LENGTH cannot be the
-             actual file length. */
-          *length = data_rep->size;
-        }
-      else
-        {
-          /* Contents is empty. */
-          *length = 0;
-        }
+      *length = data_rep->expanded_size;
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/pack.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/pack.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/pack.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/pack.c Mon Apr 
20 08:10:40 2015
@@ -737,9 +737,7 @@ copy_node_to_temp(pack_context_t *contex
     {
       path_order->rep_id.revision = noderev->data_rep->revision;
       path_order->rep_id.number = noderev->data_rep->item_index;
-      path_order->expanded_size = noderev->data_rep->expanded_size
-                                ? noderev->data_rep->expanded_size
-                                : noderev->data_rep->size;
+      path_order->expanded_size = noderev->data_rep->expanded_size;
     }
 
   /* Sort path is the key used for ordering noderevs and associated reps.

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/recovery.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/recovery.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/recovery.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/recovery.c Mon 
Apr 20 08:10:40 2015
@@ -196,9 +196,7 @@ recover_find_max_ids(svn_fs_t *fs,
      stored in the representation.  Note that this is a directory, i.e.
      represented using the hash format on disk and can never have 0 length. */
   baton.pool = pool;
-  baton.remaining = noderev->data_rep->expanded_size
-                  ? noderev->data_rep->expanded_size
-                  : noderev->data_rep->size;
+  baton.remaining = noderev->data_rep->expanded_size;
   stream = svn_stream_create(&baton, pool);
   svn_stream_set_read2(stream, NULL /* only full read support */,
                        read_handler_recover);

Modified: 
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/rep-cache.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/rep-cache.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/rep-cache.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/rep-cache.c Mon 
Apr 20 08:10:40 2015
@@ -24,6 +24,7 @@
 
 #include "svn_private_config.h"
 
+#include "cached_data.h"
 #include "fs_fs.h"
 #include "fs.h"
 #include "rep-cache.h"
@@ -273,6 +274,8 @@ svn_fs_fs__get_rep_reference(representat
       (*rep)->item_index = svn_sqlite__column_int64(stmt, 1);
       (*rep)->size = svn_sqlite__column_int64(stmt, 2);
       (*rep)->expanded_size = svn_sqlite__column_int64(stmt, 3);
+
+      SVN_ERR(svn_fs_fs__fixup_expanded_size(fs, *rep, pool));
     }
   else
     *rep = NULL;

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/stats.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/stats.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/stats.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/stats.c Mon Apr 
20 08:10:40 2015
@@ -436,8 +436,7 @@ parse_representation(rep_stats_t **repre
        */
       result = apr_pcalloc(result_pool, sizeof(*result));
       result->revision = rep->revision;
-      result->expanded_size = (rep->expanded_size ? rep->expanded_size
-                                                  : rep->size);
+      result->expanded_size = rep->expanded_size;
       result->offset = (apr_off_t)rep->item_index;
       result->size = rep->size;
 

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/structure
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/structure?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/structure 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/structure Mon 
Apr 20 08:10:40 2015
@@ -198,9 +198,9 @@ Shard packing:
     (i.e. same min packed revision)
 
 Addressing:
-  Format 1-6: Physical addressing; uses fixed positions within a rev file
+  Format 1+: Physical addressing; uses fixed positions within a rev file
   Format 7+:  Logical addressing; uses item index that will be translated
-    on-the-fly to the actual rev / pack file location
+    on-the-fly to the actual rev / pack file location (default for 7+ created)
 
 Repository IDs:
   Format 1+:  The first line of db/uuid contains the repository UUID
@@ -578,8 +578,9 @@ defined:
     representations may not be handled correctly by SVN before 1.7.20,
     1.8.12 and 1.9.0, if they have 0 <size> fields for non-empty contents.
     Releases 1.8.0 through 1.8.11 may have falsely created instances of
-    that (see issue #4554).  Finally, 0 <size> fields are NEVER legal for
-    DELTA representations.
+    that (see issue #4554).  Finally, 0 <size> fields are only ever legal
+    for DELTA representations if the reconstructed full-text is actually
+    empty.
 
 The predecessor of a node-rev crosses both soft and true copies;
 together with the count field, it allows efficient determination of

Modified: 
subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/transaction.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/transaction.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/transaction.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/transaction.c 
Mon Apr 20 08:10:40 2015
@@ -25,6 +25,7 @@
 #include <assert.h>
 #include <apr_sha1.h>
 
+#include "svn_error_codes.h"
 #include "svn_hash.h"
 #include "svn_props.h"
 #include "svn_sorts.h"
@@ -1963,9 +1964,7 @@ choose_delta_base(representation_t **rep
 
       /* Very short rep bases are simply not worth it as we are unlikely
        * to re-coup the deltification space overhead of 20+ bytes. */
-      svn_filesize_t rep_size = (*rep)->expanded_size
-                              ? (*rep)->expanded_size
-                              : (*rep)->size;
+      svn_filesize_t rep_size = (*rep)->expanded_size;
       if (rep_size < 64)
         {
           *rep = NULL;
@@ -2118,7 +2117,7 @@ rep_write_get_baton(struct rep_write_bat
 }
 
 /* For REP->SHA1_CHECKSUM, try to find an already existing representation
-   in FS and return it in *OUT_REP.  If no such representation exists or
+   in FS and return it in *OLD_REP.  If no such representation exists or
    if rep sharing has been disabled for FS, NULL will be returned.  Since
    there may be new duplicate representations within the same uncommitted
    revision, those can be passed in REPS_HASH (maps a sha1 digest onto
@@ -2144,7 +2143,7 @@ get_shared_rep(representation_t **old_re
 
   /* Check and see if we already have a representation somewhere that's
      identical to the one we just wrote out.  Start with the hash lookup
-     because it is cheepest. */
+     because it is cheapest. */
   if (reps_hash)
     *old_rep = apr_hash_get(reps_hash,
                             rep->sha1_digest,
@@ -2213,13 +2212,36 @@ get_shared_rep(representation_t **old_re
   if (!*old_rep)
     return SVN_NO_ERROR;
 
-  /* We don't want 0-length PLAIN representations to replace non-0-length
-     ones (see issue #4554).  Take into account that EXPANDED_SIZE may be
-     0 in which case we have to check the on-disk SIZE.  Also, this doubles
-     as a simple guard against general rep-cache induced corruption. */
-  if (   ((*old_rep)->expanded_size != rep->expanded_size)
-      || ((rep->expanded_size == 0) && ((*old_rep)->size != rep->size)))
+  /* A simple guard against general rep-cache induced corruption. */
+  if ((*old_rep)->expanded_size != rep->expanded_size)
     {
+      /* Make the problem show up in the server log.
+
+         Because not sharing reps is always a save option,
+         completely terminating the server process would
+         be inappropriate.
+       */
+      svn_checksum_t checksum;
+      checksum.digest = rep->sha1_digest;
+      checksum.kind = svn_checksum_sha1;
+
+      err = svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
+                              "Rep size %s mismatches rep-cache.db value %s "
+                              "for SHA1 %s.\n"
+                              "You should delete the rep-cache.db and "
+                              "verify the repository. The cached rep will "
+                              "not be shared.",
+                              apr_psprintf(scratch_pool, "%" APR_OFF_T_FMT,
+                                           rep->expanded_size),
+                              apr_psprintf(scratch_pool, "%" APR_OFF_T_FMT,
+                                           (*old_rep)->expanded_size),
+                              svn_checksum_to_cstring_display(&checksum,
+                                                              scratch_pool));
+
+      (fs->warning)(fs->warning_baton, err);
+      svn_error_clear(err);
+
+      /* Ignore the shared rep. */
       *old_rep = NULL;
     }
   else
@@ -2554,6 +2576,7 @@ write_container_rep(representation_t *re
 
   /* Check and see if we already have a representation somewhere that's
      identical to the one we just wrote out. */
+  rep->expanded_size = whb->size;
   SVN_ERR(get_shared_rep(&old_rep, fs, rep, reps_hash, scratch_pool,
                          scratch_pool));
 
@@ -2589,7 +2612,6 @@ write_container_rep(representation_t *re
 
       /* update the representation */
       rep->size = whb->size;
-      rep->expanded_size = whb->size;
     }
 
   return SVN_NO_ERROR;
@@ -2693,6 +2715,7 @@ write_container_delta_rep(representation
 
   /* Check and see if we already have a representation somewhere that's
      identical to the one we just wrote out. */
+  rep->expanded_size = whb->size;
   SVN_ERR(get_shared_rep(&old_rep, fs, rep, reps_hash, scratch_pool,
                          scratch_pool));
 
@@ -2728,7 +2751,6 @@ write_container_delta_rep(representation
       SVN_ERR(store_p2l_index_entry(fs, &rep->txn_id, &entry, scratch_pool));
 
       /* update the representation */
-      rep->expanded_size = whb->size;
       rep->size = rep_end - delta_start;
     }
 

Modified: subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/tree.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/tree.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/tree.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_fs_fs/tree.c Mon Apr 
20 08:10:40 2015
@@ -1521,13 +1521,12 @@ fs_node_has_props(svn_boolean_t *has_pro
                   const char *path,
                   apr_pool_t *scratch_pool)
 {
-  apr_hash_t *props;
+  dag_node_t *node;
 
-  SVN_ERR(fs_node_proplist(&props, root, path, scratch_pool));
+  SVN_ERR(get_dag(&node, root, path, scratch_pool));
 
-  *has_props = (0 < apr_hash_count(props));
-
-  return SVN_NO_ERROR;
+  return svn_error_trace(svn_fs_fs__dag_has_props(has_props, node,
+                                                  scratch_pool));
 }
 
 static svn_error_t *

Modified: subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/stat.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/stat.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/stat.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_ra_serf/stat.c Mon 
Apr 20 08:10:40 2015
@@ -193,6 +193,9 @@ fill_dirent_propfunc(void *baton,
         {
           if (*val->data)
             {
+              /* Note: 1.8.x and earlier servers send the count proper; 1.9.0
+               * and newer send "1" if there are properties and "0" otherwise.
+               */
               apr_int64_t deadprop_count;
               SVN_ERR(svn_cstring_atoi64(&deadprop_count, val->data));
               fdb->entry->has_props = deadprop_count > 0;

Modified: subversion/branches/move-tracking-2/subversion/libsvn_repos/repos.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_repos/repos.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_repos/repos.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_repos/repos.c Mon Apr 
20 08:10:40 2015
@@ -2067,7 +2067,6 @@ svn_repos_stat(svn_dirent_t **dirent,
   svn_node_kind_t kind;
   svn_dirent_t *ent;
   const char *datestring;
-  apr_hash_t *prophash;
 
   SVN_ERR(svn_fs_check_path(&kind, root, path, pool));
 

Propchange: subversion/branches/move-tracking-2/subversion/libsvn_subr/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Apr 20 08:10:40 2015
@@ -12,3 +12,4 @@ internal_statements.h
 errorcode.inc
 libsvn_subr.pc.in
 libsvn_subr.pc
+config_keys.inc

Modified: subversion/branches/move-tracking-2/subversion/libsvn_subr/cmdline.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_subr/cmdline.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_subr/cmdline.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_subr/cmdline.c Mon 
Apr 20 08:10:40 2015
@@ -810,9 +810,124 @@ svn_cmdline__print_xml_prop(svn_stringbu
   return;
 }
 
+/* Return the most similar string to NEEDLE in HAYSTACK, which contains
+ * HAYSTACK_LEN elements.  Return NULL if no string is sufficiently similar.
+ */
+/* See svn_cl__similarity_check() for a more general solution. */
+static const char *
+most_similar(const char *needle_cstr,
+             const char **haystack,
+             apr_size_t haystack_len,
+             apr_pool_t *scratch_pool)
+{
+  const char *max_similar;
+  apr_size_t max_score = 0;
+  apr_size_t i;
+  svn_membuf_t membuf;
+  svn_string_t *needle_str = svn_string_create(needle_cstr, scratch_pool);
+
+  svn_membuf__create(&membuf, 64, scratch_pool);
+
+  for (i = 0; i < haystack_len; i++)
+    {
+      apr_size_t score;
+      svn_string_t *hay = svn_string_create(haystack[i], scratch_pool);
+
+      score = svn_string__similarity(needle_str, hay, &membuf, NULL);
+
+      /* If you update this factor, consider updating
+       * svn_cl__similarity_check(). */
+      if (score >= (2 * SVN_STRING__SIM_RANGE_MAX + 1) / 3
+          && score > max_score)
+        {
+          max_score = score;
+          max_similar = haystack[i];
+        }
+    }
+
+  if (max_score)
+    return max_similar;
+  else
+    return NULL;
+}
+
+/* Verify that NEEDLE is in HAYSTACK, which contains HAYSTACK_LEN elements. */
+static svn_error_t *
+string_in_array(const char *needle,
+                const char **haystack,
+                apr_size_t haystack_len,
+                apr_pool_t *scratch_pool)
+{
+  const char *next_of_kin;
+  apr_size_t i;
+  for (i = 0; i < haystack_len; i++)
+    {
+      if (!strcmp(needle, haystack[i]))
+        return SVN_NO_ERROR;
+    }
+
+  /* Error. */
+  next_of_kin = most_similar(needle, haystack, haystack_len, scratch_pool);
+  if (next_of_kin)
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("Ignoring unknown value '%s'; "
+                               "did you mean '%s'?"),
+                             needle, next_of_kin);
+  else
+    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                             _("Ignoring unknown value '%s'"),
+                             needle);
+}
+
+#include "config_keys.inc"
+
+/* Validate the FILE, SECTION, and OPTION components of CONFIG_OPTION are
+ * known.  Warn to stderr if not.  (An unknown value may be either a typo
+ * or added in a newer minor version of Subversion.) */
+static svn_error_t *
+validate_config_option(svn_cmdline__config_argument_t *config_option,
+                       apr_pool_t *scratch_pool)
+{
+  svn_boolean_t arbitrary_keys = FALSE;
+
+  /* TODO: some day, we could also verify that OPTION is valid for SECTION;
+     i.e., forbid invalid combinations such as config:auth:diff-extensions. */
+
+#define ARRAYLEN(x) ( sizeof((x)) / sizeof((x)[0]) )
+
+  SVN_ERR(string_in_array(config_option->file, svn__valid_config_files,
+                          ARRAYLEN(svn__valid_config_files),
+                          scratch_pool));
+  SVN_ERR(string_in_array(config_option->section, svn__valid_config_sections,
+                          ARRAYLEN(svn__valid_config_sections),
+                          scratch_pool));
+
+  /* Don't validate option names for sections such as servers[group],
+   * config[tunnels], and config[auto-props] that permit arbitrary options. */
+    {
+      int i;
+
+      for (i = 0; i < ARRAYLEN(svn__empty_config_sections); i++)
+        {
+        if (!strcmp(config_option->section, svn__empty_config_sections[i]))
+          arbitrary_keys = TRUE;
+        }
+    }
+
+  if (! arbitrary_keys)
+    SVN_ERR(string_in_array(config_option->option, svn__valid_config_options,
+                            ARRAYLEN(svn__valid_config_options),
+                            scratch_pool));
+
+#undef ARRAYLEN
+
+  return SVN_NO_ERROR;
+}
+
 svn_error_t *
 svn_cmdline__parse_config_option(apr_array_header_t *config_options,
                                  const char *opt_arg,
+                                 const char *prefix,
                                  apr_pool_t *pool)
 {
   svn_cmdline__config_argument_t *config_option;
@@ -826,6 +941,8 @@ svn_cmdline__parse_config_option(apr_arr
           if ((equals_sign = strchr(second_colon + 1, '=')) &&
               (equals_sign != second_colon + 1))
             {
+              svn_error_t *warning;
+
               config_option = apr_pcalloc(pool, sizeof(*config_option));
               config_option->file = apr_pstrndup(pool, opt_arg,
                                                  first_colon - opt_arg);
@@ -834,6 +951,13 @@ svn_cmdline__parse_config_option(apr_arr
               config_option->option = apr_pstrndup(pool, second_colon + 1,
                                                    equals_sign - second_colon 
- 1);
 
+              warning = validate_config_option(config_option, pool);
+              if (warning)
+                {
+                  svn_handle_warning2(stderr, warning, prefix);
+                  svn_error_clear(warning);
+                }
+
               if (! (strchr(config_option->option, ':')))
                 {
                   config_option->value = apr_pstrndup(pool, equals_sign + 1,

Modified: 
subversion/branches/move-tracking-2/subversion/libsvn_subr/dirent_uri.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_subr/dirent_uri.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_subr/dirent_uri.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_subr/dirent_uri.c Mon 
Apr 20 08:10:40 2015
@@ -1295,9 +1295,9 @@ svn_relpath_split(const char **dirpath,
 }
 
 const char *
-svn_relpath_limit(const char *relpath,
-                  int max_components,
-                  apr_pool_t *result_pool)
+svn_relpath_prefix(const char *relpath,
+                   int max_components,
+                   apr_pool_t *result_pool)
 {
   const char *end;
   assert(relpath_is_canonical(relpath));

Modified: subversion/branches/move-tracking-2/subversion/libsvn_subr/io.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_subr/io.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_subr/io.c Mon Apr 20 
08:10:40 2015
@@ -1856,7 +1856,7 @@ io_win_file_attrs_set(const char *fname,
                                   _("Can't set attributes of file '%s'"),
                                   svn_dirent_local_style(fname, pool));
 
-    return SVN_NO_ERROR;;
+    return SVN_NO_ERROR;
 }
 
 static svn_error_t *win_init_dynamic_imports(void *baton, apr_pool_t *pool)

Modified: subversion/branches/move-tracking-2/subversion/libsvn_wc/diff_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_wc/diff_editor.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_wc/diff_editor.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_wc/diff_editor.c Mon 
Apr 20 08:10:40 2015
@@ -145,6 +145,9 @@ struct dir_baton_t
   /* TRUE if the node is to be compared with an unrelated node*/
   svn_boolean_t ignoring_ancestry;
 
+  /* TRUE if the directory was reported incomplete to the repository */
+  svn_boolean_t is_incomplete;
+
   /* Processor state */
   void *pdb;
   svn_boolean_t skip;
@@ -1220,10 +1223,8 @@ handle_local_only(struct dir_baton_t *pb
 
   switch (info->status)
     {
-      case svn_wc__db_status_incomplete:
-        return SVN_NO_ERROR; /* Not local only */
-
       case svn_wc__db_status_normal:
+      case svn_wc__db_status_incomplete:
         if (!repos_delete)
           return SVN_NO_ERROR; /* Local and remote */
         svn_hash_sets(pb->deletes, name, NULL);
@@ -1608,25 +1609,47 @@ open_directory(const char *path,
         db->repos_only = TRUE;
 
       if (!db->repos_only)
-        switch (info->status)
-          {
-            case svn_wc__db_status_normal:
-              break;
-            case svn_wc__db_status_deleted:
-              db->repos_only = TRUE;
-
-              if (!info->have_more_work)
-                svn_hash_sets(pb->compared,
-                              apr_pstrdup(pb->pool, db->name), "");
-              break;
-            case svn_wc__db_status_added:
-              if (eb->ignore_ancestry)
-                db->ignoring_ancestry = TRUE;
-              else
+        {
+          switch (info->status)
+            {
+              case svn_wc__db_status_normal:
+              case svn_wc__db_status_incomplete:
+                db->is_incomplete = (info->status ==
+                                     svn_wc__db_status_incomplete);
+                break;
+              case svn_wc__db_status_deleted:
                 db->repos_only = TRUE;
-              break;
-            default:
-              SVN_ERR_MALFUNCTION();
+
+                if (!info->have_more_work)
+                  svn_hash_sets(pb->compared,
+                                apr_pstrdup(pb->pool, db->name), "");
+                break;
+              case svn_wc__db_status_added:
+                if (eb->ignore_ancestry)
+                  db->ignoring_ancestry = TRUE;
+                else
+                  db->repos_only = TRUE;
+                break;
+              default:
+                SVN_ERR_MALFUNCTION();
+          }
+
+          if (info->status == svn_wc__db_status_added
+              || info->status == svn_wc__db_status_deleted)
+            {
+              svn_wc__db_status_t base_status;
+
+              /* Node is shadowed; check BASE */
+              SVN_ERR(svn_wc__db_base_get_info(&base_status, NULL, NULL,
+                                               NULL, NULL, NULL, NULL, NULL,
+                                               NULL, NULL, NULL, NULL, NULL,
+                                               NULL, NULL, NULL,
+                                               eb->db, db->local_abspath,
+                                               dir_pool, dir_pool));
+
+              if (base_status == svn_wc__db_status_incomplete)
+                db->is_incomplete = TRUE;
+            }
         }
 
       if (!db->repos_only)
@@ -1714,7 +1737,7 @@ close_directory(void *dir_baton,
     {
       apr_hash_t *repos_props;
 
-      if (db->added)
+      if (db->added || db->is_incomplete)
         {
           repos_props = apr_hash_make(scratch_pool);
         }
@@ -1891,6 +1914,7 @@ open_file(const char *path,
         switch (info->status)
           {
             case svn_wc__db_status_normal:
+            case svn_wc__db_status_incomplete:
               break;
             case svn_wc__db_status_deleted:
               fb->repos_only = TRUE;

Modified: subversion/branches/move-tracking-2/subversion/libsvn_wc/diff_local.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_wc/diff_local.c?rev=1674754&r1=1674753&r2=1674754&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_wc/diff_local.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_wc/diff_local.c Mon 
Apr 20 08:10:40 2015
@@ -281,7 +281,8 @@ diff_status_callback(void *baton,
       {
         local_only = TRUE; /* Only report additions */
       }
-    else if (db_status == svn_wc__db_status_normal)
+    else if (db_status == svn_wc__db_status_normal
+             || db_status == svn_wc__db_status_incomplete)
       {
         /* Simple diff */
         base_kind = db_kind;
@@ -297,7 +298,8 @@ diff_status_callback(void *baton,
                                          eb->db, local_abspath,
                                          scratch_pool, scratch_pool));
 
-        if (base_status != svn_wc__db_status_normal)
+        if (base_status != svn_wc__db_status_normal
+            && base_status != svn_wc__db_status_incomplete)
           return SVN_NO_ERROR;
       }
     else
@@ -312,7 +314,8 @@ diff_status_callback(void *baton,
                                          eb->db, local_abspath,
                                          scratch_pool, scratch_pool));
 
-        if (base_status != svn_wc__db_status_normal)
+        if (base_status != svn_wc__db_status_normal
+            && base_status != svn_wc__db_status_incomplete)
           local_only = TRUE;
         else if (base_kind != db_kind || !eb->ignore_ancestry)
           {


Reply via email to