You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/07/22 13:22:20 UTC

svn commit: r1505660 [2/5] - in /subversion/branches/fsfs-improvements: ./ build/generator/ build/generator/swig/ build/generator/templates/ notes/http-and-webdav/ subversion/ subversion/bindings/swig/ subversion/bindings/swig/ruby/libsvn_swig_ruby/ su...

Modified: subversion/branches/fsfs-improvements/build/generator/templates/vcnet_vcxproj.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/build/generator/templates/vcnet_vcxproj.ezt?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/build/generator/templates/vcnet_vcxproj.ezt (original)
+++ subversion/branches/fsfs-improvements/build/generator/templates/vcnet_vcxproj.ezt Mon Jul 22 11:22:18 2013
@@ -57,7 +57,7 @@
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <StringPooling>true</StringPooling>
-[end]      <AdditionalIncludeDirectories>$(SolutionDir)[configs.name];[for includes][includes];[end];%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+[end]      <AdditionalIncludeDirectories>$(SolutionDir)[configs.name];[for configs.includes][configs.includes];[end]%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>[if-any instrument_apr_pools]APR_POOL_DEBUG=[instrument_apr_pools];[end][is platforms "x64"]WIN64;[end][for configs.defines][configs.defines];[end]%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <WarningLevel>Level4</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@@ -65,7 +65,8 @@
       <ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
       <DisableSpecificWarnings>4100;4127;4206;4701;4706;%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <TreatSpecificWarningsAsErrors>4002;4003;4013;4020;4022;4024;4028;4029;4030;4031;4033;4047;4089;4113;4115;4204;4715;%(TreatSpecificWarningsAsErrors)</TreatSpecificWarningsAsErrors>
-    </ClCompile>
+[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>
       <AdditionalDependencies>[for configs.libs][configs.libs];[end]%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>[for configs.libdirs][configs.libdirs];[end]%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -79,8 +80,8 @@
       <AdditionalDependencies>[for configs.libs][configs.libs];[end]%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>[for configs.libdirs][configs.libdirs];[end]%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-[is configs.name "Debug"]      <IgnoreSpecificDefaultLibraries>msvcrt.lib</IgnoreSpecificDefaultLibraries>
-[end][if-any def_file]      <ModuleDefinitionFile>[def_file]</ModuleDefinitionFile>
+      <IgnoreSpecificDefaultLibraries>[is configs.name "Debug"]msvcrt.lib[end][is configs.name "Release"]msvcrtd.lib[end]</IgnoreSpecificDefaultLibraries>
+[if-any def_file]      <ModuleDefinitionFile>[def_file]</ModuleDefinitionFile>
 [end]    </Link>
 [else][is config_type "StaticLibrary"]    <Lib>
       <TargetMachine>[is platforms "X64"]MachineX64[else]MachineX86[end]</TargetMachine>
@@ -89,7 +90,7 @@
 [end][end][end]  </ItemDefinitionGroup>
 [end][end][if-any target.desc]  <ItemGroup>
     <ResourceCompile Include="..\svn.rc">
-[for configs][for platforms]      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='[configs.name]|[platforms]'">[for includes][includes];[end];%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+[for configs][for platforms]      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='[configs.name]|[platforms]'">[for configs.includes][configs.includes];[end]%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='[configs.name]|[platforms]'">SVN_FILE_NAME=[target.output_name];SVN_FILE_DESCRIPTION=[target.desc];[is configs.name "Debug"]_DEBUG[else]NDEBUG[end];%(PreprocessorDefinitions)</PreprocessorDefinitions>
 [end][end]    </ResourceCompile>
   </ItemGroup>

Modified: subversion/branches/fsfs-improvements/configure.ac
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/configure.ac?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/configure.ac (original)
+++ subversion/branches/fsfs-improvements/configure.ac Mon Jul 22 11:22:18 2013
@@ -739,8 +739,8 @@ AH_BOTTOM([
 # define SVN__PREDICT_FALSE(x) (__builtin_expect(x, 0))
 # define SVN__PREDICT_TRUE(x) (__builtin_expect(!!(x), 1))
 #else
-# define SVN__PREDICT_FALSE(x)
-# define SVN__PREDICT_TRUE(x)
+# define SVN__PREDICT_FALSE(x) (x)
+# define SVN__PREDICT_TRUE(x) (x)
 #endif
 
 #if defined(SVN_DEBUG)

Modified: subversion/branches/fsfs-improvements/gen-make.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/gen-make.py?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/gen-make.py (original)
+++ subversion/branches/fsfs-improvements/gen-make.py Mon Jul 22 11:22:18 2013
@@ -224,9 +224,10 @@ class Options:
     self.list = []
     self.dict = {}
 
-  def add(self, opt, val):
+  def add(self, opt, val, overwrite=True):
     if opt in self.dict:
-      self.list[self.dict[opt]] = (opt, val)
+      if overwrite:
+        self.list[self.dict[opt]] = (opt, val)
     else:
       self.dict[opt] = len(self.list)
       self.list.append((opt, val))
@@ -309,9 +310,12 @@ if __name__ == '__main__':
       gentype = val
     else:
       if opt == '--with-httpd':
-        rest.add('--with-apr', os.path.join(val, 'srclib', 'apr'))
-        rest.add('--with-apr-util', os.path.join(val, 'srclib', 'apr-util'))
-        rest.add('--with-apr-iconv', os.path.join(val, 'srclib', 'apr-iconv'))
+        rest.add('--with-apr', os.path.join(val, 'srclib', 'apr'),
+                 overwrite=False)
+        rest.add('--with-apr-util', os.path.join(val, 'srclib', 'apr-util'),
+                 overwrite=False)
+        rest.add('--with-apr-iconv', os.path.join(val, 'srclib', 'apr-iconv'),
+                 overwrite=False)
 
   # Remember all options so that --reload and other scripts can use them
   opt_conf = open('gen-make.opts', 'w')

Modified: subversion/branches/fsfs-improvements/get-deps.sh
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/get-deps.sh?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/get-deps.sh (original)
+++ subversion/branches/fsfs-improvements/get-deps.sh Mon Jul 22 11:22:18 2013
@@ -37,7 +37,7 @@ SERF_VERSION=${SERF_VERSION:-"1.2.1"}
 ZLIB_VERSION=${ZLIB_VERSION:-"1.2.8"}
 SQLITE_VERSION=${SQLITE_VERSION:-"3.7.15.1"}
 GMOCK_VERSION=${GMOCK_VERSION:-"1.6.0"}
-HTTPD_VERSION=${HTTPD_VERSION:-"2.4.3"}
+HTTPD_VERSION=${HTTPD_VERSION:-"2.4.6"}
 APR_ICONV_VERSION=${APR_ICONV_VERSION:-"1.2.1"}
 
 APR=apr-${APR_VERSION}

Modified: subversion/branches/fsfs-improvements/notes/http-and-webdav/webdav-protocol
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/notes/http-and-webdav/webdav-protocol?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/notes/http-and-webdav/webdav-protocol (original)
+++ subversion/branches/fsfs-improvements/notes/http-and-webdav/webdav-protocol Mon Jul 22 11:22:18 2013
@@ -228,7 +228,7 @@ Purpose: Present what we have in our WC 
 Target URL: Base VCC URL
             Example: REPORT /repos/test/!svn/vcc/default
 
-Note: ra_serf will not set the send-all attribute to the update-report.  It
+Note: ra_serf may not set the send-all attribute to the update-report.  It
       will instead take the returned D:checked-in href and do a pipelined
       PROPFIND / GET on that resource.
 

Modified: subversion/branches/fsfs-improvements/subversion/bindings/swig/INSTALL
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/swig/INSTALL?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/swig/INSTALL (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/swig/INSTALL Mon Jul 22 11:22:18 2013
@@ -232,35 +232,15 @@ BUILDING SWIG BINDINGS FOR SVN ON WINDOW
              compile in Release mode.  (This is due to pyconfig.h using the
             _DEBUG flag too and setting a #pragma comment(lib) value.)
 
-       For Perl support, you also need to add the paths into Visual Studio.
-
-       In Visual C++ 6, go to Tools -> Options -> Directories.
-
-       In Visual C++ .NET, go to Tools -> Options -> Projects
-       -> VC++ Directories.
-
-       Add the following paths:
-
-           Executable Directories:
-
-               For Perl, path to perl.exe
-               (for example, C:\Program Files\Perl\bin)
-
-           Library Directories:
-
-               For Perl, path to perl##.lib
-               (for example, C:\Program Files\Perl\lib\CORE)
-
-           Include Directories:
-
-               For Perl, path to perl.h
-               (for example, C:\Program Files\Perl\lib\CORE)
+       Our project generator detects Perl, Ruby and Python installs and will
+       generate the swig projects for these languages if both swig and the
+       language is found.
 
    3.  Create the Visual Studio project files via gen-make.py, adding in
        the --with-swig parameter to the installed location for SWIG.
        Example:
 
-        > gen-make.py -t vcproj --with-swig="C:\Program Files\SWIG-2.0.2"
+        > gen-make.py <other options> --with-swig="C:\Program Files\SWIG-2.0.2"
 
    4.  If you haven't already built Subversion, you should do so now.
        Instructions are in the main INSTALL file.
@@ -271,6 +251,7 @@ BUILDING SWIG BINDINGS FOR SVN ON WINDOW
 
            __SWIG_PYTHON__
            __SWIG_PERL__
+           __SWIG_RUBY__
 
    6. Install the bindings. The procedure varies depending on the language.
 

Modified: subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c Mon Jul 22 11:22:18 2013
@@ -23,9 +23,16 @@
 /* Tell swigutil_rb.h that we're inside the implementation */
 #define SVN_SWIG_SWIGUTIL_RB_C
 
+/* Windows hack: Allow overriding some <ruby.h> defaults */
+#include "swigutil_rb__pre_ruby.h"
 #include "swig_ruby_external_runtime.swg"
 #include "swigutil_rb.h"
+
+#ifdef HAVE_RUBY_ST_H
+#include <ruby/st.h>
+#else
 #include <st.h>
+#endif
 
 #undef PACKAGE_BUGREPORT
 #undef PACKAGE_NAME

Modified: subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h (original)
+++ subversion/branches/fsfs-improvements/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h Mon Jul 22 11:22:18 2013
@@ -22,8 +22,14 @@
 #ifndef SVN_SWIG_SWIGUTIL_RB_H
 #define SVN_SWIG_SWIGUTIL_RB_H
 
+/* Windows hack: Allow overriding some <ruby.h> defaults */
+#include "swigutil_rb__pre_ruby.h"
 #include <ruby.h>
+#ifdef HAVE_RUBY_REGEX_H
+#include <ruby/regex.h>
+#else
 #include <regex.h>
+#endif
 
 #if SIZEOF_VOIDP == SIZEOF_LONG
 #  define PTR2NUM(x) (ULONG2NUM((unsigned long)(x)))

Modified: subversion/branches/fsfs-improvements/subversion/include/private/svn_cache.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/private/svn_cache.h?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/private/svn_cache.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/private/svn_cache.h Mon Jul 22 11:22:18 2013
@@ -305,6 +305,33 @@ svn_cache__membuffer_cache_create(svn_me
                                   apr_pool_t *result_pool);
 
 /**
+ * @defgroup Standard priority classes for #svn_cache__create_membuffer_cache.
+ * @{
+ */
+
+/**
+ * Data in this priority class should not be removed from the cache unless
+ * absolutely necessary.  Use of this should be very restricted.
+ */
+#define SVN_CACHE__MEMBUFFER_HIGH_PRIORITY   10000
+
+/**
+ * Data in this priority class has a good chance to remain in cache unless
+ * there is more data in this class than the cache's capcity.  Use of this
+ * as the default for all information that is costly to fetch from disk.
+ */
+#define SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY 1000
+
+/**
+ * Data in this priority class will be removed as soon as the cache starts
+ * filling up.  Use of this for ephemeral data that can easisly be acquired
+ * again from other sources.
+ */
+#define SVN_CACHE__MEMBUFFER_LOW_PRIORITY      100
+
+/** @} */
+
+/**
  * Creates a new cache in @a *cache_p, storing the data in a potentially
  * shared @a membuffer object.  The elements in the cache will be indexed
  * by keys of length @a klen, which may be APR_HASH_KEY_STRING if they
@@ -312,7 +339,9 @@ svn_cache__membuffer_cache_create(svn_me
  * serialize_func and deserialized using @a deserialize_func.  Because
  * the same memcache object may cache many different kinds of values
  * form multiple caches, @a prefix should be specified to differentiate
- * this cache from other caches.  @a *cache_p will be allocated in @a result_pool.
+ * this cache from other caches.  All entries written through this cache
+ * interface will be assigned into the given @a priority class.  @a *cache_p
+ * will be allocated in @a result_pool.
  *
  * If @a deserialize_func is NULL, then the data is returned as an
  * svn_string_t; if @a serialize_func is NULL, then the data is
@@ -331,6 +360,7 @@ svn_cache__create_membuffer_cache(svn_ca
                                   svn_cache__deserialize_func_t deserialize,
                                   apr_ssize_t klen,
                                   const char *prefix,
+                                  apr_uint32_t priority,
                                   svn_boolean_t thread_safe,
                                   apr_pool_t *result_pool);
 
@@ -377,6 +407,18 @@ svn_cache__get(void **value,
                apr_pool_t *result_pool);
 
 /**
+ * Looks for an entry indexed by @a key in @a cache,  setting @a *found
+ * to TRUE if an entry has been found and FALSE otherwise.  @a key may be
+ * NULL in which case @a *found will be FALSE.  Temporary allocations will
+ * be made from @a scratch_pool.
+ */
+svn_error_t *
+svn_cache__has_key(svn_boolean_t *found,
+                   svn_cache__t *cache,
+                   const void *key,
+                   apr_pool_t *scratch_pool);
+
+/**
  * Stores the value @a value under the key @a key in @a cache.  Uses @a
  * scratch_pool for temporary allocations.  The cache makes copies of
  * @a key and @a value if necessary (that is, @a key and @a value may

Modified: subversion/branches/fsfs-improvements/subversion/include/private/svn_client_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/private/svn_client_private.h?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/private/svn_client_private.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/private/svn_client_private.h Mon Jul 22 11:22:18 2013
@@ -283,6 +283,11 @@ svn_client__copy_foreign(const char *url
  * The keys for the subtree mergeinfo are the repository root-relative
  * paths of TARGET_PATH_OR_URL and/or its subtrees, regardless of whether
  * TARGET_PATH_OR_URL is a URL or WC path.
+ *
+ * If RA_SESSION is not NULL, use it to obtain merge information instead of
+ * opening a new session. The session might be reparented after usage, so
+ * callers should reparent the session back to their original location if
+ * needed.
  */
 svn_error_t *
 svn_client__mergeinfo_log(svn_boolean_t finding_merged,
@@ -299,6 +304,7 @@ svn_client__mergeinfo_log(svn_boolean_t 
                           svn_depth_t depth,
                           const apr_array_header_t *revprops,
                           svn_client_ctx_t *ctx,
+                          svn_ra_session_t *ra_session,
                           apr_pool_t *result_pool,
                           apr_pool_t *scratch_pool);
 

Modified: subversion/branches/fsfs-improvements/subversion/include/private/svn_string_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/private/svn_string_private.h?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/private/svn_string_private.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/private/svn_string_private.h Mon Jul 22 11:22:18 2013
@@ -175,6 +175,32 @@ svn__ui64toa_sep(apr_uint64_t number, ch
 char *
 svn__i64toa_sep(apr_int64_t number, char seperator, apr_pool_t *pool);
 
+
+/** Writes the @a number as base36-encoded string into @a dest. The latter
+ * must provide space for at least #SVN_INT64_BUFFER_SIZE characters.
+ * Returns the number chars written excluding the terminating NUL.
+ *
+ * @note The actual maximum buffer requirement is much shorter than
+ * #SVN_INT64_BUFFER_SIZE but introducing yet another constant is only
+ * marginally useful and may open the door to security issues when e.g.
+ * switching between base10 and base36 encoding.
+ */
+apr_size_t
+svn__ui64tobase36(char *dest, apr_uint64_t number);
+
+/** Returns the value of the base36 encoded unsigned integer starting at
+ * @a source.  If @a next is not NULL, @a *next will be set to the first
+ * position after the integer.
+ *
+ * The data in @a source will be considered part of the number to parse
+ * as long as the characters are within the base36 range.  If there are
+ * no such characters to begin with, 0 is returned.  Inputs with more than
+ * #SVN_INT64_BUFFER_SIZE digits will not be fully parsed, i.e. the value
+ * of @a *next as well as the return value are undefined.
+ */
+apr_uint64_t
+svn__base36toui64(const char **next, const char *source);
+
 /**
  * Computes the similarity score of STRA and STRB. Returns the ratio
  * of the length of their longest common subsequence and the average
@@ -218,6 +244,24 @@ svn_string__similarity(const svn_string_
                        svn_membuf_t *buffer, apr_size_t *rlcs);
 
 
+/* 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.
+ */
+apr_size_t
+svn_cstring__match_length(const char *a,
+                          const char *b,
+                          apr_size_t max_len);
+
+/* Return the number of bytes before A and B that don't differ.  If no
+ * difference can be found in the first MAX_LEN characters,  MAX_LEN will
+ * be returned.  Please note that A-MAX_LEN and B-MAX_LEN must both be
+ * valid addresses.
+ */
+apr_size_t
+svn_cstring__reverse_match_length(const char *a,
+                                  const char *b,
+                                  apr_size_t max_len);
+
 /** @} */
 
 /** @} */

Modified: subversion/branches/fsfs-improvements/subversion/include/private/svn_temp_serializer.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/private/svn_temp_serializer.h?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/private/svn_temp_serializer.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/private/svn_temp_serializer.h Mon Jul 22 11:22:18 2013
@@ -143,6 +143,22 @@ void
 svn_temp_serializer__pop(svn_temp_serializer__context_t *context);
 
 /**
+ * Serialize a referenced sub-structure within the serialization
+ * @a context.  @a source_struct must be a reference to the
+ * pointer in the original parent structure so that the correspondence in
+ * the serialized structure can be established. @a struct_size must match
+ * the result of @c sizeof() of the actual structure.
+ *
+ * This function is equivalent but more efficient than calling
+ * #svn_temp_serializer__push() immediately followed by
+ * #svn_temp_serializer__pop().
+ */
+void
+svn_temp_serializer__add_leaf(svn_temp_serializer__context_t *context,
+                              const void * const * source_struct,
+                              apr_size_t struct_size);
+
+/**
  * Serialize a string referenced from the current structure within the
  * serialization @a context. @a s must be a reference to the @c char*
  * pointer in the original structure so that the correspondence in the

Modified: subversion/branches/fsfs-improvements/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_fs.h?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_fs.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_fs.h Mon Jul 22 11:22:18 2013
@@ -45,7 +45,8 @@
 extern "C" {
 #endif /* __cplusplus */
 
-
+
+
 /**
  * Get libsvn_fs version information.
  *
@@ -175,7 +176,8 @@ typedef struct svn_fs_t svn_fs_t;
  */
 svn_error_t *
 svn_fs_initialize(apr_pool_t *pool);
-
+
+
 
 /** The type of a warning callback function.  @a baton is the value specified
  * in the call to svn_fs_set_warning_func(); the filesystem passes it through
@@ -201,7 +203,8 @@ svn_fs_set_warning_func(svn_fs_t *fs,
                         svn_fs_warning_callback_t warning,
                         void *warning_baton);
 
-
+
+
 
 /**
  * Create a new, empty Subversion filesystem, stored in the directory
@@ -635,7 +638,8 @@ svn_fs_berkeley_recover(const char *path
 
 /** @} */
 
-
+
+
 /** Filesystem Access Contexts.
  *
  * @since New in 1.2.
@@ -722,7 +726,8 @@ svn_fs_access_add_lock_token(svn_fs_acce
 
 /** @} */
 
-
+
+
 /** Filesystem Nodes and Node-Revisions.
  *
  * In a Subversion filesystem, a `node' corresponds roughly to an
@@ -813,7 +818,8 @@ svn_fs_unparse_id(const svn_fs_id_t *id,
 
 /** @} */
 
-
+
+
 /** Filesystem Transactions.
  *
  * To make a change to a Subversion filesystem:
@@ -989,6 +995,9 @@ svn_fs_begin_txn(svn_fs_txn_t **txn_p,
  * the conflict in @a txn, allocated within @a pool;
  * otherwise, set @a *conflict_p to NULL.
  *
+ * If @ set_timestamp is non-zero 'svn:date' revision property will be updated
+ * to current time to ensure that svn:date revprops remain ordered.
+ *
  * If the commit succeeds, @a txn is invalid.
  *
  * If the commit fails for any reason, @a *new_rev is an invalid
@@ -1020,6 +1029,19 @@ svn_fs_begin_txn(svn_fs_txn_t **txn_p,
  * ###     conflict string
  * ###   *new_rev will always be initialized to SVN_INVALID_REVNUM, or
  * ###     to a valid, committed revision number
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_fs_commit_txn2(const char **conflict_p,
+                   svn_revnum_t *new_rev,
+                   svn_fs_txn_t *txn,
+                   svn_boolean_t set_timestamp,
+                   apr_pool_t *pool);
+
+/*
+ * Same as svn_fs_commit_txn2(), but with @a set_timestamp
+ * always set to @c TRUE.
  */
 svn_error_t *
 svn_fs_commit_txn(const char **conflict_p,
@@ -1146,7 +1168,8 @@ svn_fs_change_txn_props(svn_fs_txn_t *tx
 
 /** @} */
 
-
+
+
 /** Roots.
  *
  * An #svn_fs_root_t object represents the root directory of some
@@ -1230,7 +1253,8 @@ svn_fs_revision_root_revision(svn_fs_roo
 
 /** @} */
 
-
+
+
 /** Directory entry names and directory paths.
  *
  * Here are the rules for directory entry names, and directory paths:
@@ -1258,7 +1282,8 @@ svn_fs_revision_root_revision(svn_fs_roo
  */
 
 
-
+
+
 /** The kind of change that occurred on the path. */
 typedef enum svn_fs_path_change_kind_t
 {
@@ -1387,7 +1412,8 @@ svn_fs_paths_changed(apr_hash_t **change
 
 /** @} */
 
-
+
+
 /* Operations appropriate to all kinds of nodes.  */
 
 /** Set @a *kind_p to the type of node present at @a path under @a
@@ -1764,7 +1790,8 @@ svn_fs_merge(const char **conflict_p,
              apr_pool_t *pool);
 
 
-
+
+
 /* Directories.  */
 
 
@@ -1869,7 +1896,8 @@ svn_fs_revision_link(svn_fs_root_t *from
                      svn_fs_root_t *to_root,
                      const char *path,
                      apr_pool_t *pool);
-
+
+
 /* Files.  */
 
 /** Set @a *length_p to the length of the file @a path in @a root, in bytes.
@@ -2103,7 +2131,8 @@ svn_fs_contents_changed(svn_boolean_t *c
                         apr_pool_t *pool);
 
 
-
+
+
 /* Filesystem revisions.  */
 
 
@@ -2236,7 +2265,8 @@ svn_fs_change_rev_prop(svn_fs_t *fs,
                        apr_pool_t *pool);
 
 
-
+
+
 /* Computing deltas.  */
 
 
@@ -2258,7 +2288,8 @@ svn_fs_get_file_delta_stream(svn_txdelta
                              apr_pool_t *pool);
 
 
-
+
+
 /* UUID manipulation. */
 
 /** Populate @a *uuid with the UUID associated with @a fs.  Allocate
@@ -2278,13 +2309,15 @@ svn_fs_set_uuid(svn_fs_t *fs,
                 const char *uuid,
                 apr_pool_t *pool);
 
-
+
+
 /* Non-historical properties.  */
 
 /* [[Yes, do tell.]] */
 
 
-
+
+
 /** @defgroup svn_fs_locks Filesystem locks
  * @{
  * @since New in 1.2. */

Modified: subversion/branches/fsfs-improvements/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_io.h?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_io.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_io.h Mon Jul 22 11:22:18 2013
@@ -691,6 +691,27 @@ svn_io_file_create(const char *file,
                    const char *contents,
                    apr_pool_t *pool);
 
+/** Create file at utf8-encoded @a file with binary contents @a contents
+ * of @a length bytes.  @a file must not already exist.
+ * Use @a pool for memory allocations.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_io_file_create_binary(const char *file,
+                          const char *contents,
+                          apr_size_t length,
+                          apr_pool_t *pool);
+
+/** Create empty file at utf8-encoded @a file, which must not already exist.
+ * Use @a pool for memory allocations.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_io_file_create_empty(const char *file,
+                         apr_pool_t *pool);
+
 /**
  * Lock file at @a lock_file. If @a exclusive is TRUE,
  * obtain exclusive lock, otherwise obtain shared lock.

Modified: subversion/branches/fsfs-improvements/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/include/svn_wc.h?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/include/svn_wc.h (original)
+++ subversion/branches/fsfs-improvements/subversion/include/svn_wc.h Mon Jul 22 11:22:18 2013
@@ -1261,6 +1261,11 @@ typedef enum svn_wc_notify_action_t
    * @since New in 1.9. */
   svn_wc_notify_cleanup_external,
 
+  /** The operation failed because the operation (E.g. commit) is only valid
+   * if the operation includes this path.
+   * @since New in 1.9. */
+  svn_wc_notify_failed_requires_target
+
 } svn_wc_notify_action_t;
 
 

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_client/checkout.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_client/checkout.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_client/checkout.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_client/checkout.c Mon Jul 22 11:22:18 2013
@@ -79,8 +79,6 @@ svn_client__checkout_internal(svn_revnum
                               apr_pool_t *pool)
 {
   svn_node_kind_t kind;
-  apr_pool_t *session_pool = svn_pool_create(pool);
-  svn_ra_session_t *ra_session;
   svn_client__pathrev_t *pathrev;
 
   /* Sanity check.  Without these, the checkout is meaningless. */
@@ -94,15 +92,21 @@ svn_client__checkout_internal(svn_revnum
       && (revision->kind != svn_opt_revision_head))
     return svn_error_create(SVN_ERR_CLIENT_BAD_REVISION, NULL, NULL);
 
-  /* Get the RA connection. */
-  SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &pathrev,
-                                            url, NULL, peg_revision, revision,
-                                            ctx, session_pool));
+  {
+    apr_pool_t *session_pool = svn_pool_create(pool);
+    svn_ra_session_t *ra_session;
+
+    /* Get the RA connection. */
+    SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &pathrev,
+                                              url, NULL, peg_revision,
+                                              revision, ctx, session_pool));
+
+    pathrev = svn_client__pathrev_dup(pathrev, pool);
+    SVN_ERR(svn_ra_check_path(ra_session, "", pathrev->rev, &kind,
+                              session_pool));
 
-  pathrev = svn_client__pathrev_dup(pathrev, pool);
-  SVN_ERR(svn_ra_check_path(ra_session, "", pathrev->rev, &kind, pool));
-
-  svn_pool_destroy(session_pool);
+    svn_pool_destroy(session_pool);
+  }
 
   if (kind == svn_node_none)
     return svn_error_createf(SVN_ERR_RA_ILLEGAL_URL, NULL,

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_client/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_client/commit.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_client/commit.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_client/commit.c Mon Jul 22 11:22:18 2013
@@ -854,6 +854,19 @@ svn_client_commit6(const apr_array_heade
                               svn_dirent_local_style(item->path, iterpool),
                               svn_dirent_local_style(delete_op_root_abspath,
                                                      iterpool));
+
+                  if (ctx->notify_func2)
+                    {
+                      svn_wc_notify_t *notify;
+                      notify = svn_wc_create_notify(
+                                    delete_op_root_abspath,
+                                    svn_wc_notify_failed_requires_target,
+                                    iterpool);
+                      notify->err = cmt_err;
+
+                      ctx->notify_func2(ctx->notify_baton2, notify, iterpool);
+                    }
+
                   goto cleanup;
                 }
             }
@@ -885,6 +898,19 @@ svn_client_commit6(const apr_array_heade
                          svn_dirent_local_style(item->path, iterpool),
                          svn_dirent_local_style(copy_op_root_abspath,
                                                 iterpool));
+
+              if (ctx->notify_func2)
+                {
+                    svn_wc_notify_t *notify;
+                    notify = svn_wc_create_notify(
+                                copy_op_root_abspath,
+                                svn_wc_notify_failed_requires_target,
+                                iterpool);
+                    notify->err = cmt_err;
+
+                    ctx->notify_func2(ctx->notify_baton2, notify, iterpool);
+                }
+
               goto cleanup;
             }
         }

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_client/merge.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_client/merge.c Mon Jul 22 11:22:18 2013
@@ -12050,11 +12050,15 @@ short_circuit_mergeinfo_log(svn_mergeinf
                             svn_log_entry_receiver_t receiver,
                             svn_revnum_t *revision,
                             svn_client_ctx_t *ctx,
+                            svn_ra_session_t *ra_session,
                             apr_pool_t *result_pool,
                             apr_pool_t *scratch_pool)
 {
   apr_array_header_t *revprops;
   svn_error_t *err;
+  const char *session_url;
+
+  SVN_ERR(svn_ra_get_session_url(ra_session, &session_url, scratch_pool));
 
   revprops = apr_array_make(scratch_pool, 0, sizeof(const char *));
   err = svn_client__mergeinfo_log(finding_merged,
@@ -12067,8 +12071,12 @@ short_circuit_mergeinfo_log(svn_mergeinf
                                   source_end_revision,
                                   receiver, revision,
                                   TRUE, svn_depth_infinity,
-                                  revprops, ctx, result_pool,
-                                  scratch_pool);
+                                  revprops, ctx, ra_session,
+                                  result_pool, scratch_pool);
+
+  err = svn_error_compose_create(
+                  err,
+                  svn_ra_reparent(ra_session, session_url, scratch_pool));
 
   if (err)
     {
@@ -12132,6 +12140,7 @@ find_last_merged_location(svn_client__pa
                           const branch_history_t *source_branch,
                           svn_client__pathrev_t *target,
                           svn_client_ctx_t *ctx,
+                          svn_ra_session_t *ra_session,
                           apr_pool_t *result_pool,
                           apr_pool_t *scratch_pool)
 {
@@ -12159,7 +12168,8 @@ find_last_merged_location(svn_client__pa
                                       &source_end_rev, &source_start_rev,
                                       operative_rev_receiver,
                                       &youngest_merged_rev,
-                                      ctx, result_pool, scratch_pool));
+                                      ctx, ra_session,
+                                      result_pool, scratch_pool));
 
   if (!SVN_IS_VALID_REVNUM(youngest_merged_rev))
     {
@@ -12194,7 +12204,8 @@ find_last_merged_location(svn_client__pa
                                           &source_start_rev, &source_end_rev,
                                           operative_rev_receiver,
                                           &oldest_eligible_rev,
-                                          ctx, scratch_pool, scratch_pool));
+                                          ctx, ra_session,
+                                          scratch_pool, scratch_pool));
 
       /* If there are revisions eligible for merging, use the oldest one
          to calculate the base.  Otherwise there are no operative revisions
@@ -12248,7 +12259,9 @@ find_base_on_source(svn_client__pathrev_
                                     s_t->yca,
                                     &s_t->source_branch,
                                     s_t->target_branch.tip,
-                                    ctx, result_pool, scratch_pool));
+                                    ctx,
+                                    s_t->source_ra_session,
+                                    result_pool, scratch_pool));
   return SVN_NO_ERROR;
 }
 
@@ -12281,7 +12294,9 @@ find_base_on_target(svn_client__pathrev_
                                     s_t->yca,
                                     &s_t->target_branch,
                                     s_t->source,
-                                    ctx, result_pool, scratch_pool));
+                                    ctx,
+                                    s_t->target_ra_session,
+                                    result_pool, scratch_pool));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_client/mergeinfo.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_client/mergeinfo.c Mon Jul 22 11:22:18 2013
@@ -1021,6 +1021,11 @@ svn_client__elide_mergeinfo(const char *
    Set *REPOS_ROOT to the root URL of the repository associated with
    PATH_OR_URL.
 
+   If RA_SESSION is NOT NULL and PATH_OR_URL refers to a URL, RA_SESSION
+   (which must be of the repository containing PATH_OR_URL) will be used
+   instead of a temporary RA session. Caller is responsible for reparenting
+   the session if it wants to use it after the call.
+
    Allocate *MERGEINFO_CATALOG and all its contents in RESULT_POOL.  Use
    SCRATCH_POOL for all temporary allocations.
 
@@ -1034,17 +1039,30 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
               svn_boolean_t include_descendants,
               svn_boolean_t ignore_invalid_mergeinfo,
               svn_client_ctx_t *ctx,
+              svn_ra_session_t *ra_session,
               apr_pool_t *result_pool,
               apr_pool_t *scratch_pool)
 {
-  svn_ra_session_t *ra_session;
   const char *local_abspath;
   svn_boolean_t use_url = svn_path_is_url(path_or_url);
   svn_client__pathrev_t *peg_loc;
 
-  SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &peg_loc,
-                                            path_or_url, NULL, peg_revision,
-                                            peg_revision, ctx, scratch_pool));
+  if (ra_session && svn_path_is_url(path_or_url))
+    {
+      SVN_ERR(svn_ra_reparent(ra_session, path_or_url, scratch_pool));
+      SVN_ERR(svn_client__resolve_rev_and_url(&peg_loc, ra_session,
+                                              path_or_url,
+                                              peg_revision,
+                                              peg_revision,
+                                              ctx, scratch_pool));
+    }
+  else
+    {
+      SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &peg_loc,
+                                                path_or_url, NULL,
+                                                peg_revision,
+                                                peg_revision, ctx, scratch_pool));
+    }
 
   /* If PATH_OR_URL is as working copy path determine if we will need to
      contact the repository for the requested PEG_REVISION. */
@@ -1064,10 +1082,6 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
       }
     }
 
-  /* Check server Merge Tracking capability. */
-  SVN_ERR(svn_ra__assert_mergeinfo_capable_server(ra_session, path_or_url,
-                                                  scratch_pool));
-
   SVN_ERR(svn_ra_get_repos_root2(ra_session, repos_root, result_pool));
 
   if (use_url)
@@ -1496,29 +1510,22 @@ logs_for_mergeinfo_rangelist(const char 
                              svn_log_entry_receiver_t log_receiver,
                              void *log_receiver_baton,
                              svn_client_ctx_t *ctx,
+                             svn_ra_session_t *ra_session,
                              apr_pool_t *scratch_pool)
 {
-  apr_array_header_t *target;
   svn_merge_range_t *oldest_range, *youngest_range;
-  apr_array_header_t *revision_ranges;
-  svn_opt_revision_t oldest_rev, youngest_rev;
+  svn_revnum_t oldest_rev, youngest_rev;
   struct filter_log_entry_baton_t fleb;
 
   if (! rangelist->nelts)
     return SVN_NO_ERROR;
 
-  /* Build a single-member log target list using SOURCE_URL. */
-  target = apr_array_make(scratch_pool, 1, sizeof(const char *));
-  APR_ARRAY_PUSH(target, const char *) = source_url;
-
   /* Calculate and construct the bounds of our log request. */
   youngest_range = APR_ARRAY_IDX(rangelist, rangelist->nelts - 1,
                                  svn_merge_range_t *);
-  youngest_rev.kind = svn_opt_revision_number;
-  youngest_rev.value.number = youngest_range->end;
+  youngest_rev = youngest_range->end;
   oldest_range = APR_ARRAY_IDX(rangelist, 0, svn_merge_range_t *);
-  oldest_rev.kind = svn_opt_revision_number;
-  oldest_rev.value.number = oldest_range->start;
+  oldest_rev = oldest_range->start;
 
   if (! target_mergeinfo_catalog)
     target_mergeinfo_catalog = apr_hash_make(scratch_pool);
@@ -1543,19 +1550,29 @@ logs_for_mergeinfo_rangelist(const char 
   fleb.log_receiver_baton = log_receiver_baton;
   fleb.ctx = ctx;
 
-  /* Drive the log. */
-  revision_ranges = apr_array_make(scratch_pool, 1,
-                                   sizeof(svn_opt_revision_range_t *));
-  if (oldest_revs_first)
-    APR_ARRAY_PUSH(revision_ranges, svn_opt_revision_range_t *)
-      = svn_opt__revision_range_create(&oldest_rev, &youngest_rev, scratch_pool);
+  if (!ra_session)
+    SVN_ERR(svn_client__open_ra_session_internal(&ra_session, NULL, source_url,
+                                                 NULL, NULL, FALSE, FALSE, ctx,
+                                                 scratch_pool, scratch_pool));
   else
-    APR_ARRAY_PUSH(revision_ranges, svn_opt_revision_range_t *)
-      = svn_opt__revision_range_create(&youngest_rev, &oldest_rev, scratch_pool);
-  SVN_ERR(svn_client_log5(target, &youngest_rev, revision_ranges,
-                          0, discover_changed_paths, FALSE, FALSE, revprops,
-                          filter_log_entry_with_rangelist, &fleb, ctx,
-                          scratch_pool));
+    SVN_ERR(svn_ra_reparent(ra_session, source_url, scratch_pool));
+
+  {
+    apr_array_header_t *target;
+    target = apr_array_make(scratch_pool, 1, sizeof(const char *));
+    APR_ARRAY_PUSH(target, const char *) = "";
+
+    SVN_ERR(svn_ra_get_log2(ra_session, target,
+                            oldest_revs_first ? oldest_rev : youngest_rev,
+                            oldest_revs_first ? youngest_rev : oldest_rev,
+                            0 /* limit */,
+                            discover_changed_paths,
+                            FALSE /* strict_node_history */,
+                            FALSE /* include_merged_revisions */,
+                            revprops,
+                            filter_log_entry_with_rangelist, &fleb,
+                            scratch_pool));
+  }
 
   /* Check for cancellation. */
   if (ctx->cancel_func)
@@ -1616,7 +1633,7 @@ svn_client_mergeinfo_get_merged(apr_hash
   svn_mergeinfo_t mergeinfo;
 
   SVN_ERR(get_mergeinfo(&mergeinfo_cat, &repos_root, path_or_url,
-                        peg_revision, FALSE, FALSE, ctx, pool, pool));
+                        peg_revision, FALSE, FALSE, ctx, NULL, pool, pool));
   if (mergeinfo_cat)
     {
       const char *repos_relpath;
@@ -1662,6 +1679,7 @@ svn_client__mergeinfo_log(svn_boolean_t 
                           svn_depth_t depth,
                           const apr_array_header_t *revprops,
                           svn_client_ctx_t *ctx,
+                          svn_ra_session_t *ra_session,
                           apr_pool_t *result_pool,
                           apr_pool_t *scratch_pool)
 {
@@ -1715,6 +1733,9 @@ svn_client__mergeinfo_log(svn_boolean_t 
 
   subpool = svn_pool_create(scratch_pool);
 
+  if (ra_session)
+    target_session = ra_session;
+
   /* We need the union of TARGET_PATH_OR_URL@TARGET_PEG_REVISION's mergeinfo
      and MERGE_SOURCE_URL's history.  It's not enough to do path
      matching, because renames in the history of MERGE_SOURCE_URL
@@ -1731,11 +1752,27 @@ svn_client__mergeinfo_log(svn_boolean_t 
              it ourselves.  We do need to get the repos_root
              though, because get_mergeinfo() won't do it for us. */
           target_mergeinfo_cat = *target_mergeinfo_catalog;
-          SVN_ERR(svn_client__ra_session_from_path2(&target_session, &pathrev,
-                                                    target_path_or_url, NULL,
-                                                    target_peg_revision,
-                                                    target_peg_revision,
-                                                    ctx, subpool));
+
+          if (ra_session && svn_path_is_url(target_path_or_url))
+            {
+              SVN_ERR(svn_ra_reparent(ra_session, target_path_or_url, subpool));
+              SVN_ERR(svn_client__resolve_rev_and_url(&pathrev, ra_session,
+                                                      target_path_or_url,
+                                                      target_peg_revision,
+                                                      target_peg_revision,
+                                                      ctx, subpool));
+              target_session = ra_session;
+            }
+          else
+            {
+              SVN_ERR(svn_client__ra_session_from_path2(&target_session,
+                                                        &pathrev,
+                                                        target_path_or_url,
+                                                        NULL,
+                                                        target_peg_revision,
+                                                        target_peg_revision,
+                                                        ctx, subpool));
+            }
           SVN_ERR(svn_ra_get_repos_root2(target_session, &repos_root,
                                          scratch_pool));
         }
@@ -1747,7 +1784,7 @@ svn_client__mergeinfo_log(svn_boolean_t 
           SVN_ERR(get_mergeinfo(target_mergeinfo_catalog, &repos_root,
                                 target_path_or_url, target_peg_revision,
                                 depth == svn_depth_infinity, TRUE,
-                                ctx, result_pool, scratch_pool));
+                                ctx, ra_session, result_pool, scratch_pool));
           target_mergeinfo_cat = *target_mergeinfo_catalog;
         }
     }
@@ -1759,7 +1796,7 @@ svn_client__mergeinfo_log(svn_boolean_t 
       SVN_ERR(get_mergeinfo(&target_mergeinfo_cat, &repos_root,
                             target_path_or_url, target_peg_revision,
                             depth == svn_depth_infinity, TRUE,
-                            ctx, scratch_pool, scratch_pool));
+                            ctx, ra_session, scratch_pool, scratch_pool));
     }
 
   if (!svn_path_is_url(target_path_or_url))
@@ -1829,11 +1866,28 @@ svn_client__mergeinfo_log(svn_boolean_t 
                                                      scratch_pool));
       }
 
-    SVN_ERR(svn_client__ra_session_from_path2(&source_session, &pathrev,
-                                              source_path_or_url, NULL,
-                                              source_peg_revision,
-                                              source_peg_revision,
-                                              ctx, subpool));
+    if (target_session
+        && svn_path_is_url(source_path_or_url)
+        && repos_root
+        && svn_uri_skip_ancestor(repos_root, source_path_or_url, subpool))
+      {
+        /* We can re-use the existing session */
+        source_session = target_session;
+        SVN_ERR(svn_ra_reparent(source_session, source_path_or_url, subpool));
+        SVN_ERR(svn_client__resolve_rev_and_url(&pathrev, source_session,
+                                                source_path_or_url,
+                                                source_peg_revision,
+                                                source_peg_revision,
+                                                ctx, subpool));
+      }
+    else
+      {
+        SVN_ERR(svn_client__ra_session_from_path2(&source_session, &pathrev,
+                                                  source_path_or_url, NULL,
+                                                  source_peg_revision,
+                                                  source_peg_revision,
+                                                  ctx, subpool));
+      }
     SVN_ERR(svn_client__get_revision_number(&start_rev, &youngest_rev,
                                             ctx->wc_ctx, source_path_or_url,
                                             source_session,
@@ -1852,9 +1906,6 @@ svn_client__mergeinfo_log(svn_boolean_t 
                                                  scratch_pool));
     if (start_rev > end_rev)
       oldest_revs_first = FALSE;
-
-    /* Close the source and target sessions. */
-    svn_pool_destroy(subpool);
   }
 
   /* Separate the explicit or inherited mergeinfo on TARGET_PATH_OR_URL,
@@ -2111,7 +2162,10 @@ svn_client__mergeinfo_log(svn_boolean_t 
   log_target = svn_path_url_add_component2(repos_root, log_target + 1,
                                            scratch_pool);
 
-  SVN_ERR(logs_for_mergeinfo_rangelist(log_target, merge_source_fspaths,
+  {
+    svn_error_t *err;
+
+    err = logs_for_mergeinfo_rangelist(log_target, merge_source_fspaths,
                                        finding_merged,
                                        master_inheritable_rangelist,
                                        oldest_revs_first,
@@ -2122,8 +2176,13 @@ svn_client__mergeinfo_log(svn_boolean_t 
                                        discover_changed_paths,
                                        revprops,
                                        log_receiver, log_receiver_baton,
-                                       ctx, scratch_pool));
-  return SVN_NO_ERROR;
+                                       ctx, target_session, scratch_pool);
+
+    /* Close the source and target sessions. */
+    svn_pool_destroy(subpool); /* For SVN_ERR_CEASE_INVOCATION */
+
+    return svn_error_trace(err);
+  }
 }
 
 svn_error_t *
@@ -2142,13 +2201,15 @@ svn_client_mergeinfo_log2(svn_boolean_t 
                           svn_client_ctx_t *ctx,
                           apr_pool_t *scratch_pool)
 {
-  return svn_client__mergeinfo_log(finding_merged, target_path_or_url,
+  return svn_error_trace(
+         svn_client__mergeinfo_log(finding_merged, target_path_or_url,
                                    target_peg_revision, NULL,
                                    source_path_or_url, source_peg_revision,
                                    source_start_revision, source_end_revision,
                                    log_receiver, log_receiver_baton,
                                    discover_changed_paths, depth, revprops,
-                                   ctx, scratch_pool, scratch_pool);
+                                   ctx, NULL,
+                                   scratch_pool, scratch_pool));
 }
 
 svn_error_t *
@@ -2186,7 +2247,7 @@ svn_client_suggest_merge_sources(apr_arr
 
   /* ### TODO: Share ra_session batons to improve efficiency? */
   SVN_ERR(get_mergeinfo(&mergeinfo_cat, &repos_root, path_or_url,
-                        peg_revision, FALSE, FALSE, ctx, pool, pool));
+                        peg_revision, FALSE, FALSE, ctx, NULL, pool, pool));
 
   if (mergeinfo_cat && apr_hash_count(mergeinfo_cat))
     {

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_client/patch.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_client/patch.c Mon Jul 22 11:22:18 2013
@@ -2676,8 +2676,8 @@ install_patched_prop_targets(patch_targe
         {
           if (! dry_run)
             {
-              SVN_ERR(svn_io_file_create(target->local_abspath, "",
-                                         scratch_pool));
+              SVN_ERR(svn_io_file_create_empty(target->local_abspath,
+                                               scratch_pool));
               SVN_ERR(svn_wc_add_from_disk2(ctx->wc_ctx, target->local_abspath,
                                             NULL /*props*/,
                                             /* suppress notification */

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_delta/xdelta.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_delta/xdelta.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_delta/xdelta.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_delta/xdelta.c Mon Jul 22 11:22:18 2013
@@ -29,6 +29,7 @@
 
 #include "svn_hash.h"
 #include "svn_delta.h"
+#include "private/svn_string_private.h"
 #include "delta.h"
 
 /* This is pseudo-adler32. It is adler32 without the prime modulus.
@@ -223,73 +224,6 @@ init_blocks_table(const char *data,
     add_block(blocks, init_adler32(data + i), i);
 }
 
-/* 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 processing 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;
-}
-
-/* Return the number of bytes before A and B that don't differ.  If no
- * difference can be found in the first MAX_LEN characters,  MAX_LEN will
- * be returned.  Please note that A-MAX_LEN and B-MAX_LEN must both be
- * valid addresses.
- */
-static apr_size_t
-reverse_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 processing 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); pos <= max_len; pos += sizeof(apr_size_t))
-    if (*(const apr_size_t*)(a - pos) != *(const apr_size_t*)(b - pos))
-      break;
-
-  pos -= sizeof(apr_size_t);
-
-#endif
-
-  /* If we find a mismatch at -pos, pos-1 characters matched.
-   */
-  while (++pos <= max_len)
-    if (a[0-pos] != b[0-pos])
-      return pos - 1;
-
-  /* No mismatch found -> at least MAX_LEN matching chars.
-   */
-  return max_len;
-}
-
-
 /* 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
@@ -323,9 +257,9 @@ find_match(const struct blocks *blocks,
   max_delta = asize - apos - MATCH_BLOCKSIZE < bsize - bpos - MATCH_BLOCKSIZE
             ? asize - apos - MATCH_BLOCKSIZE
             : bsize - bpos - MATCH_BLOCKSIZE;
-  delta = match_length(a + apos + MATCH_BLOCKSIZE,
-                       b + bpos + MATCH_BLOCKSIZE,
-                       max_delta);
+  delta = svn_cstring__match_length(a + apos + MATCH_BLOCKSIZE,
+                                    b + bpos + MATCH_BLOCKSIZE,
+                                    max_delta);
 
   /* See if we can extend backwards (max MATCH_BLOCKSIZE-1 steps because A's
      content has been sampled only every MATCH_BLOCKSIZE positions).  */
@@ -362,7 +296,8 @@ store_delta_trailer(svn_txdelta__ops_bat
   if (max_len == 0)
     return;
 
-  end_match = reverse_match_length(a + asize, b + bsize, max_len);
+  end_match = svn_cstring__reverse_match_length(a + asize, b + bsize,
+                                                max_len);
   if (end_match <= 4)
     end_match = 0;
 
@@ -414,7 +349,7 @@ compute_delta(svn_txdelta__ops_baton_t *
   /* Optimization: directly compare window starts. If more than 4
    * bytes match, we can immediately create a matching windows.
    * Shorter sequences result in a net data increase. */
-  lo = match_length(a, b, asize > bsize ? bsize : asize);
+  lo = svn_cstring__match_length(a, b, asize > bsize ? bsize : asize);
   if ((lo > 4) || (lo == bsize))
     {
       svn_txdelta__insert_op(build_baton, svn_txdelta_source,
@@ -468,7 +403,8 @@ compute_delta(svn_txdelta__ops_baton_t *
             {
               /* the match borders on the previous op. Maybe, we found a
                * match that is better than / overlapping the previous one. */
-              apr_size_t len = reverse_match_length(a + apos, b + lo, apos < lo ? apos : lo);
+              apr_size_t len = svn_cstring__reverse_match_length
+                                 (a + apos, b + lo, apos < lo ? apos : lo);
               if (len > 0)
                 {
                   len = svn_txdelta__remove_copy(build_baton, len);

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs/fs-loader.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs/fs-loader.c Mon Jul 22 11:22:18 2013
@@ -221,21 +221,19 @@ static svn_error_t *
 get_library_vtable(fs_library_vtable_t **vtable, const char *fs_type,
                    apr_pool_t *pool)
 {
-  struct fs_type_defn **fst = &fs_modules;
+  struct fs_type_defn **fst;
   svn_boolean_t known = FALSE;
 
   /* There are two FS module definitions known at compile time.  We
      want to check these without any locking overhead even when
      dynamic third party modules are enabled.  The third party modules
      cannot be checked until the lock is held.  */
-  if (strcmp(fs_type, (*fst)->fs_type) == 0)
-    known = TRUE;
-  else
-    {
-      fst = &(*fst)->next;
-      if (strcmp(fs_type, (*fst)->fs_type) == 0)
+  for (fst = &fs_modules; *fst; fst = &(*fst)->next)
+    if (strcmp(fs_type, (*fst)->fs_type) == 0)
+      {
         known = TRUE;
-    }
+        break;
+      }
 
 #if defined(SVN_USE_DSO) && APR_HAS_DSO
   /* Third party FS modules that are unknown at compile time.
@@ -787,8 +785,9 @@ svn_fs_begin_txn(svn_fs_txn_t **txn_p, s
 
 
 svn_error_t *
-svn_fs_commit_txn(const char **conflict_p, svn_revnum_t *new_rev,
-                  svn_fs_txn_t *txn, apr_pool_t *pool)
+svn_fs_commit_txn2(const char **conflict_p, svn_revnum_t *new_rev,
+                   svn_fs_txn_t *txn, svn_boolean_t set_timestamp,
+                   apr_pool_t *pool)
 {
   svn_error_t *err;
 
@@ -796,7 +795,7 @@ svn_fs_commit_txn(const char **conflict_
   if (conflict_p)
     *conflict_p = NULL;
 
-  err = txn->vtable->commit(conflict_p, new_rev, txn, pool);
+  err = txn->vtable->commit(conflict_p, new_rev, txn, set_timestamp, pool);
 
 #ifdef SVN_DEBUG
   /* Check postconditions. */
@@ -829,6 +828,12 @@ svn_fs_commit_txn(const char **conflict_
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_fs_commit_txn(const char **conflict_p, svn_revnum_t *new_rev,
+                  svn_fs_txn_t *txn, apr_pool_t *pool)
+{
+  return svn_fs_commit_txn2(conflict_p, new_rev, txn, TRUE, pool);
+}
 
 svn_error_t *
 svn_fs_abort_txn(svn_fs_txn_t *txn, apr_pool_t *pool)

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs/fs-loader.h?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs/fs-loader.h Mon Jul 22 11:22:18 2013
@@ -248,7 +248,8 @@ typedef struct fs_vtable_t
 typedef struct txn_vtable_t
 {
   svn_error_t *(*commit)(const char **conflict_p, svn_revnum_t *new_rev,
-                         svn_fs_txn_t *txn, apr_pool_t *pool);
+                         svn_fs_txn_t *txn, svn_boolean_t set_timestamp,
+                         apr_pool_t *pool);
   svn_error_t *(*abort)(svn_fs_txn_t *txn, apr_pool_t *pool);
   svn_error_t *(*get_prop)(svn_string_t **value_p, svn_fs_txn_t *txn,
                            const char *propname, apr_pool_t *pool);

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/dag.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/dag.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/dag.c Mon Jul 22 11:22:18 2013
@@ -59,7 +59,8 @@
 
 #include "svn_private_config.h"
 
-
+
+
 /* Initializing a filesystem.  */
 
 struct dag_node_t
@@ -90,7 +91,8 @@ struct dag_node_t
 };
 
 
-
+
+
 /* Trivial helper/accessor functions. */
 svn_node_kind_t svn_fs_base__dag_node_kind(dag_node_t *node)
 {
@@ -265,7 +267,8 @@ svn_fs_base__dag_init_fs(svn_fs_t *fs)
 }
 
 
-
+
+
 /*** Directory node functions ***/
 
 /* Some of these are helpers for functions outside this section. */
@@ -538,7 +541,8 @@ svn_fs_base__dag_set_entry(dag_node_t *n
 }
 
 
-
+
+
 /*** Proplists. ***/
 
 svn_error_t *
@@ -669,7 +673,8 @@ svn_fs_base__dag_set_proplist(dag_node_t
 }
 
 
-
+
+
 /*** Roots. ***/
 
 svn_error_t *
@@ -1450,7 +1455,8 @@ svn_fs_base__dag_copy(dag_node_t *to_nod
 }
 
 
-
+
+
 /*** Deltification ***/
 
 /* Maybe change the representation identified by TARGET_REP_KEY to be
@@ -1569,17 +1575,18 @@ svn_fs_base__dag_index_checksums(dag_nod
 }
 
 
-
+
+
 /*** Committing ***/
 
 svn_error_t *
 svn_fs_base__dag_commit_txn(svn_revnum_t *new_rev,
                             svn_fs_txn_t *txn,
                             trail_t *trail,
+                            svn_boolean_t set_timestamp,
                             apr_pool_t *pool)
 {
   revision_t revision;
-  svn_string_t date;
   apr_hash_t *txnprops;
   svn_fs_t *fs = txn->fs;
   const char *txn_id = txn->id;
@@ -1605,15 +1612,22 @@ svn_fs_base__dag_commit_txn(svn_revnum_t
   SVN_ERR(svn_fs_base__txn_make_committed(fs, txn_id, *new_rev,
                                           trail, pool));
 
-  /* Set a date on the commit.  We wait until now to fetch the date,
-     so it's definitely newer than any previous revision's date. */
-  date.data = svn_time_to_cstring(apr_time_now(), pool);
-  date.len = strlen(date.data);
-  return svn_fs_base__set_rev_prop(fs, *new_rev, SVN_PROP_REVISION_DATE,
-                                   NULL, &date, trail, pool);
+  if (set_timestamp)
+    {
+      /* Set a date on the commit if requested.  We wait until now to fetch the
+         date, so it's definitely newer than any previous revision's date. */
+      svn_string_t date;
+      date.data = svn_time_to_cstring(apr_time_now(), pool);
+      date.len = strlen(date.data);
+      SVN_ERR(svn_fs_base__set_rev_prop(fs, *new_rev, SVN_PROP_REVISION_DATE,
+                                        NULL, &date, trail, pool));
+    }
+
+  return SVN_NO_ERROR;
 }
 
-
+
+
 /*** Comparison. ***/
 
 svn_error_t *
@@ -1657,7 +1671,8 @@ svn_fs_base__things_different(svn_boolea
 }
 
 
-
+
+
 /*** Mergeinfo tracking stuff ***/
 
 svn_error_t *

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/dag.h?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/dag.h (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/dag.h Mon Jul 22 11:22:18 2013
@@ -273,12 +273,16 @@ svn_error_t *svn_fs_base__dag_clone_root
    latest revision in TXN->FS.  If the caller doesn't take care of this,
    you may lose people's work!
 
+   Update commit time to ensure that svn:date revprops remain ordered if
+   SET_TIMESTAMP is non-zero.
+
    Do any necessary temporary allocation in a subpool of POOL.
    Consume temporary space at most proportional to the maximum depth
    of SVN_TXN's tree of mutable nodes.  */
 svn_error_t *svn_fs_base__dag_commit_txn(svn_revnum_t *new_rev,
                                          svn_fs_txn_t *txn,
                                          trail_t *trail,
+                                         svn_boolean_t set_timestamp,
                                          apr_pool_t *pool);
 
 

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/tree.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/tree.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/tree.c Mon Jul 22 11:22:18 2013
@@ -2560,6 +2560,7 @@ struct commit_args
 {
   svn_fs_txn_t *txn;
   svn_revnum_t new_rev;
+  svn_boolean_t set_timestamp;
 };
 
 
@@ -2619,7 +2620,7 @@ txn_body_commit(void *baton, trail_t *tr
 
   /* Else, commit the txn. */
   return svn_fs_base__dag_commit_txn(&(args->new_rev), txn, trail,
-                                     trail->pool);
+                                     args->set_timestamp, trail->pool);
 }
 
 
@@ -2629,6 +2630,7 @@ svn_error_t *
 svn_fs_base__commit_txn(const char **conflict_p,
                         svn_revnum_t *new_rev,
                         svn_fs_txn_t *txn,
+                        svn_boolean_t set_timestamp,
                         apr_pool_t *pool)
 {
   /* How do commits work in Subversion?
@@ -2732,6 +2734,7 @@ svn_fs_base__commit_txn(const char **con
 
       /* Try to commit. */
       commit_args.txn = txn;
+      commit_args.set_timestamp = set_timestamp;
       err = svn_fs_base__retry_txn(fs, txn_body_commit, &commit_args,
                                    FALSE, subpool);
       if (err && (err->apr_err == SVN_ERR_FS_TXN_OUT_OF_DATE))

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/tree.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/tree.h?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/tree.h (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_base/tree.h Mon Jul 22 11:22:18 2013
@@ -42,6 +42,7 @@ svn_error_t *svn_fs_base__deltify(svn_fs
 
 svn_error_t *svn_fs_base__commit_txn(const char **conflict_p,
                                      svn_revnum_t *new_rev, svn_fs_txn_t *txn,
+                                     svn_boolean_t set_timestamp,
                                      apr_pool_t *pool);
 
 svn_error_t *svn_fs_base__txn_root(svn_fs_root_t **root_p, svn_fs_txn_t *txn,

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/cached_data.c Mon Jul 22 11:22:18 2013
@@ -839,14 +839,19 @@ get_window_key(rep_state_t *rs, apr_off_
   const char *name;
   const char *last_part;
   const char *name_last;
+  svn_error_t *err;
 
   /* the rev file name containing the txdelta window.
    * If this fails we are in serious trouble anyways.
    * And if nobody else detects the problems, the file content checksum
    * comparison _will_ find them.
    */
-  if (apr_file_name_get(&name, rs->file->file))
-    return NULL;
+  err = svn_io_file_name_get(&name, rs->file, pool);
+  if (err)
+    {
+      svn_error_clear(err);
+      return NULL;
+    }
 
   /* Handle packed files as well by scanning backwards until we find the
    * revision or pack number. */

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/caching.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/caching.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/caching.c Mon Jul 22 11:22:18 2013
@@ -305,7 +305,8 @@ init_callbacks(svn_cache__t *cache,
  * Creates memcache if MEMCACHE is not NULL. Creates membuffer cache if
  * MEMBUFFER is not NULL. Fallbacks to inprocess cache if MEMCACHE and
  * MEMBUFFER are NULL and pages is non-zero.  Sets *CACHE_P to NULL
- * otherwise.
+ * otherwise.  Use the given PRIORITY class for the new cache.  If it
+ * is 0, then use the default priority class.
  *
  * Unless NO_HANDLER is true, register an error handler that reports errors
  * as warnings to the FS warning callback.
@@ -322,6 +323,7 @@ create_cache(svn_cache__t **cache_p,
              svn_cache__deserialize_func_t deserializer,
              apr_ssize_t klen,
              const char *prefix,
+             apr_uint32_t priority,
              svn_fs_t *fs,
              svn_boolean_t no_handler,
              apr_pool_t *pool)
@@ -329,6 +331,8 @@ create_cache(svn_cache__t **cache_p,
   svn_cache__error_handler_t error_handler = no_handler
                                            ? NULL
                                            : warn_and_fail_on_cache_errors;
+  if (priority == 0)
+    priority = SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY;
 
   if (memcache)
     {
@@ -343,7 +347,7 @@ create_cache(svn_cache__t **cache_p,
     {
       SVN_ERR(svn_cache__create_membuffer_cache(
                 cache_p, membuffer, serializer, deserializer,
-                klen, prefix, FALSE, pool));
+                klen, prefix, priority, FALSE, pool));
     }
   else if (pages)
     {
@@ -421,6 +425,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                        svn_fs_fs__deserialize_id,
                        sizeof(svn_revnum_t),
                        apr_pstrcat(pool, prefix, "RRI", (char *)NULL),
+                       0,
                        fs,
                        no_handler,
                        fs->pool));
@@ -435,6 +440,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                        svn_fs_fs__dag_deserialize,
                        APR_HASH_KEY_STRING,
                        apr_pstrcat(pool, prefix, "DAG", (char *)NULL),
+                       0,
                        fs,
                        no_handler,
                        fs->pool));
@@ -451,6 +457,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                        svn_fs_fs__deserialize_dir_entries,
                        APR_HASH_KEY_STRING,
                        apr_pstrcat(pool, prefix, "DIR", (char *)NULL),
+                       0,
                        fs,
                        no_handler,
                        fs->pool));
@@ -466,6 +473,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                        sizeof(svn_revnum_t),
                        apr_pstrcat(pool, prefix, "PACK-MANIFEST",
                                    (char *)NULL),
+                       0,
                        fs,
                        no_handler,
                        fs->pool));
@@ -479,6 +487,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                        svn_fs_fs__deserialize_node_revision,
                        sizeof(pair_cache_key_t),
                        apr_pstrcat(pool, prefix, "NODEREVS", (char *)NULL),
+                       0,
                        fs,
                        no_handler,
                        fs->pool));
@@ -492,6 +501,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                        svn_fs_fs__deserialize_changes,
                        sizeof(svn_revnum_t),
                        apr_pstrcat(pool, prefix, "CHANGES", (char *)NULL),
+                       0,
                        fs,
                        no_handler,
                        fs->pool));
@@ -507,6 +517,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                            NULL, NULL,
                            sizeof(pair_cache_key_t),
                            apr_pstrcat(pool, prefix, "TEXT", (char *)NULL),
+                           SVN_CACHE__MEMBUFFER_LOW_PRIORITY,
                            fs,
                            no_handler,
                            fs->pool));
@@ -520,6 +531,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                            sizeof(pair_cache_key_t),
                            apr_pstrcat(pool, prefix, "PROP",
                                        (char *)NULL),
+                           0,
                            fs,
                            no_handler,
                            fs->pool));
@@ -533,6 +545,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                            APR_HASH_KEY_STRING,
                            apr_pstrcat(pool, prefix, "MERGEINFO",
                                        (char *)NULL),
+                           0,
                            fs,
                            no_handler,
                            fs->pool));
@@ -546,6 +559,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                            APR_HASH_KEY_STRING,
                            apr_pstrcat(pool, prefix, "HAS_MERGEINFO",
                                        (char *)NULL),
+                           0,
                            fs,
                            no_handler,
                            fs->pool));
@@ -570,6 +584,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                            sizeof(pair_cache_key_t),
                            apr_pstrcat(pool, prefix, "REVPROP",
                                        (char *)NULL),
+                           0,
                            fs,
                            no_handler,
                            fs->pool));
@@ -591,6 +606,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                            APR_HASH_KEY_STRING,
                            apr_pstrcat(pool, prefix, "TXDELTA_WINDOW",
                                        (char *)NULL),
+                           0,
                            fs,
                            no_handler,
                            fs->pool));
@@ -604,6 +620,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f
                            APR_HASH_KEY_STRING,
                            apr_pstrcat(pool, prefix, "COMBINED_WINDOW",
                                        (char *)NULL),
+                           SVN_CACHE__MEMBUFFER_LOW_PRIORITY,
                            fs,
                            no_handler,
                            fs->pool));
@@ -707,6 +724,7 @@ svn_fs_fs__initialize_txn_caches(svn_fs_
                        APR_HASH_KEY_STRING,
                        apr_pstrcat(pool, prefix, "TXNDIR",
                                    (char *)NULL),
+                       0,
                        fs,
                        TRUE,
                        pool));

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/fs_fs.c Mon Jul 22 11:22:18 2013
@@ -168,7 +168,7 @@ get_lock_on_filesystem(const char *lock_
       svn_error_clear(err);
       err = NULL;
 
-      SVN_ERR(svn_io_file_create(lock_filename, "", pool));
+      SVN_ERR(svn_io_file_create_empty(lock_filename, pool));
       SVN_ERR(svn_io_file_lock2(lock_filename, TRUE, FALSE, pool));
     }
 
@@ -1099,7 +1099,7 @@ svn_fs_fs__create(svn_fs_t *fs,
                              (format >= SVN_FS_FS__MIN_NO_GLOBAL_IDS_FORMAT
                               ? "0\n" : "0 1 1\n"),
                              pool));
-  SVN_ERR(svn_io_file_create(path_lock(fs, pool), "", pool));
+  SVN_ERR(svn_io_file_create_empty(path_lock(fs, pool), pool));
   SVN_ERR(svn_fs_fs__set_uuid(fs, NULL, pool));
 
   SVN_ERR(write_revision_zero(fs));
@@ -1119,8 +1119,8 @@ svn_fs_fs__create(svn_fs_t *fs,
     {
       SVN_ERR(svn_io_file_create(svn_fs_fs__path_txn_current(fs, pool),
                                  "0\n", pool));
-      SVN_ERR(svn_io_file_create(svn_fs_fs__path_txn_current_lock(fs, pool),
-                                 "", pool));
+      SVN_ERR(svn_io_file_create_empty
+                  (svn_fs_fs__path_txn_current_lock(fs, pool), pool));
     }
 
   /* This filesystem is ready.  Stamp it with a format number. */

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/hotcopy.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/hotcopy.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/hotcopy.c Mon Jul 22 11:22:18 2013
@@ -912,7 +912,7 @@ hotcopy_create_empty_dest(svn_fs_t *src_
                              pool));
 
   /* Create lock file and UUID. */
-  SVN_ERR(svn_io_file_create(svn_fs_fs__path_lock(dst_fs, pool), "", pool));
+  SVN_ERR(svn_io_file_create_empty(svn_fs_fs__path_lock(dst_fs, pool), pool));
   SVN_ERR(svn_fs_fs__set_uuid(dst_fs, src_fs->uuid, pool));
 
   /* Create the min unpacked rev file. */
@@ -925,9 +925,9 @@ hotcopy_create_empty_dest(svn_fs_t *src_
     {
       SVN_ERR(svn_io_file_create(svn_fs_fs__path_txn_current(dst_fs, pool),
                                  "0\n", pool));
-      SVN_ERR(svn_io_file_create(svn_fs_fs__path_txn_current_lock(dst_fs,
-                                                                  pool),
-                                 "", pool));
+      SVN_ERR(svn_io_file_create_empty(
+                          svn_fs_fs__path_txn_current_lock(dst_fs, pool),
+                          pool));
     }
 
   dst_ffd->youngest_rev_cache = 0;

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/temp_serializer.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/temp_serializer.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/temp_serializer.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/temp_serializer.c Mon Jul 22 11:22:18 2013
@@ -106,13 +106,12 @@ serialize_svn_string(svn_temp_serializer
 
   /* the "string" content may actually be arbitrary binary data.
    * Thus, we cannot use svn_temp_serializer__add_string. */
-  svn_temp_serializer__push(context,
-                            (const void * const *)&string->data,
-                            string->len + 1);
+  svn_temp_serializer__add_leaf(context,
+                                (const void * const *)&string->data,
+                                string->len + 1);
 
   /* back to the caller's nesting level */
   svn_temp_serializer__pop(context);
-  svn_temp_serializer__pop(context);
 }
 
 /* Utility function to deserialize the STRING inside the BUFFER.
@@ -144,13 +143,12 @@ serialize_checksum(svn_temp_serializer__
 
   /* The digest is arbitrary binary data.
    * Thus, we cannot use svn_temp_serializer__add_string. */
-  svn_temp_serializer__push(context,
-                            (const void * const *)&checksum->digest,
-                            svn_checksum_size(checksum));
+  svn_temp_serializer__add_leaf(context,
+                                (const void * const *)&checksum->digest,
+                                svn_checksum_size(checksum));
 
   /* return to the caller's nesting level */
   svn_temp_serializer__pop(context);
-  svn_temp_serializer__pop(context);
 }
 
 /* Utility function to deserialize the checksum CS inside the BUFFER.
@@ -434,10 +432,9 @@ serialize_txdelta_ops(svn_temp_serialize
     return;
 
   /* the ops form a contiguous chunk of memory with no further references */
-  svn_temp_serializer__push(context,
-                            (const void * const *)ops,
-                            count * sizeof(svn_txdelta_op_t));
-  svn_temp_serializer__pop(context);
+  svn_temp_serializer__add_leaf(context,
+                                (const void * const *)ops,
+                                count * sizeof(svn_txdelta_op_t));
 }
 
 /* Utility function to serialize W in the given serialization CONTEXT.
@@ -1274,22 +1271,19 @@ svn_fs_fs__serialize_mergeinfo(void **da
   svn_temp_serializer__pop(context);
 
   /* key lengths array */
-  svn_temp_serializer__push(context,
-                            (const void * const *)&merges.key_lengths,
-                            merges.count * sizeof(*merges.key_lengths));
-  svn_temp_serializer__pop(context);
+  svn_temp_serializer__add_leaf(context,
+                                (const void * const *)&merges.key_lengths,
+                                merges.count * sizeof(*merges.key_lengths));
 
   /* range counts array */
-  svn_temp_serializer__push(context,
-                            (const void * const *)&merges.range_counts,
-                            merges.count * sizeof(*merges.range_counts));
-  svn_temp_serializer__pop(context);
+  svn_temp_serializer__add_leaf(context,
+                                (const void * const *)&merges.range_counts,
+                                merges.count * sizeof(*merges.range_counts));
 
   /* ranges */
-  svn_temp_serializer__push(context,
-                            (const void * const *)&merges.ranges,
-                            range_count * sizeof(*merges.ranges));
-  svn_temp_serializer__pop(context);
+  svn_temp_serializer__add_leaf(context,
+                                (const void * const *)&merges.ranges,
+                                range_count * sizeof(*merges.ranges));
 
   /* return the serialized result */
   serialized = svn_temp_serializer__get(context);

Modified: subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c?rev=1505660&r1=1505659&r2=1505660&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/transaction.c Mon Jul 22 11:22:18 2013
@@ -101,9 +101,14 @@ path_and_offset_of(apr_file_t *file, apr
 {
   const char *path;
   apr_off_t offset = 0;
+  svn_error_t *err;
 
-  if (apr_file_name_get(&path, file) != APR_SUCCESS)
-    path = "(unknown)";
+  err = svn_io_file_name_get(&path, file, pool);
+  if (err)
+    {
+      svn_error_clear(err);
+      path = "(unknown)";
+    }
 
   if (apr_file_seek(file, APR_CUR, &offset) != APR_SUCCESS)
     offset = -1;
@@ -1051,16 +1056,17 @@ svn_fs_fs__create_txn(svn_fs_txn_t **txn
   SVN_ERR(create_new_txn_noderev_from_rev(fs, txn->id, root_id, pool));
 
   /* Create an empty rev file. */
-  SVN_ERR(svn_io_file_create(svn_fs_fs__path_txn_proto_rev(fs, txn->id, pool),
-                             "", pool));
+  SVN_ERR(svn_io_file_create_empty(svn_fs_fs__path_txn_proto_rev(fs, txn->id,
+                                                                 pool),
+                                   pool));
 
   /* Create an empty rev-lock file. */
-  SVN_ERR(svn_io_file_create(path_txn_proto_rev_lock(fs, txn->id, pool), "",
-                             pool));
+  SVN_ERR(svn_io_file_create_empty(path_txn_proto_rev_lock(fs, txn->id, pool),
+                                   pool));
 
   /* Create an empty changes file. */
-  SVN_ERR(svn_io_file_create(path_txn_changes(fs, txn->id, pool), "",
-                             pool));
+  SVN_ERR(svn_io_file_create_empty(path_txn_changes(fs, txn->id, pool), 
+                                   pool));
 
   /* Create the next-ids file. */
   return svn_io_file_create(path_txn_next_ids(fs, txn->id, pool), "0 0\n",
@@ -2788,6 +2794,7 @@ struct commit_baton {
   svn_revnum_t *new_rev_p;
   svn_fs_t *fs;
   svn_fs_txn_t *txn;
+  svn_boolean_t set_timestamp;
   apr_array_header_t *reps_to_cache;
   apr_hash_t *reps_hash;
   apr_pool_t *reps_pool;
@@ -2814,6 +2821,7 @@ commit_body(void *baton, apr_pool_t *poo
   svn_prop_t prop;
   svn_string_t date;
   svn_stringbuf_t *trailer;
+  svn_string_t date;
 
   /* Get the current youngest revision. */
   SVN_ERR(svn_fs_fs__youngest_rev(&old_rev, cb->fs, pool));
@@ -2939,12 +2947,18 @@ commit_body(void *baton, apr_pool_t *poo
      remove the transaction directory later. */
   SVN_ERR(unlock_proto_rev(cb->fs, cb->txn->id, proto_file_lockcookie, pool));
 
-  /* Update commit time to ensure that svn:date revprops remain ordered. */
-  date.data = svn_time_to_cstring(apr_time_now(), pool);
-  date.len = strlen(date.data);
+  /* Update commit time to ensure that svn:date revprops remain ordered if
+     requested. */
+  if (cb->set_timestamp)
+    {
+      svn_string_t date;
+
+      date.data = svn_time_to_cstring(apr_time_now(), pool);
+      date.len = strlen(date.data);
 
-  SVN_ERR(svn_fs_fs__change_txn_prop(cb->txn, SVN_PROP_REVISION_DATE,
-                                     &date, pool));
+      SVN_ERR(svn_fs_fs__change_txn_prop(cb->txn, SVN_PROP_REVISION_DATE,
+                                         &date, pool));
+    }
 
   /* Move the revprops file into place. */
   SVN_ERR_ASSERT(! svn_fs_fs__is_packed_revprop(cb->fs, new_rev));
@@ -2998,6 +3012,7 @@ svn_error_t *
 svn_fs_fs__commit(svn_revnum_t *new_rev_p,
                   svn_fs_t *fs,
                   svn_fs_txn_t *txn,
+                  svn_boolean_t set_timestamp,
                   apr_pool_t *pool)
 {
   struct commit_baton cb;
@@ -3006,6 +3021,7 @@ svn_fs_fs__commit(svn_revnum_t *new_rev_
   cb.new_rev_p = new_rev_p;
   cb.fs = fs;
   cb.txn = txn;
+  cb.set_timestamp = set_timestamp;
 
   if (ffd->rep_sharing_allowed)
     {