You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2015/01/30 02:16:24 UTC

svn commit: r1655900 - in /subversion/branches/svn-auth-x509: ./ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subversion/bindings/javahl/t...

Author: breser
Date: Fri Jan 30 01:16:23 2015
New Revision: 1655900

URL: http://svn.apache.org/r1655900
Log:
On the svn-auth-x509 branch: Sync with trunk up to r1655899.

Modified:
    subversion/branches/svn-auth-x509/   (props changed)
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CommitMessage.cpp
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CreateJ.cpp
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/DiffOptions.cpp
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/DiffOptions.h
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/EnumMapper.cpp
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/EnumMapper.h
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/SVNClient.cpp
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/SVNClient.h
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java
    subversion/branches/svn-auth-x509/subversion/bindings/swig/core.i
    subversion/branches/svn-auth-x509/subversion/bindings/swig/ruby/test/test_client.rb
    subversion/branches/svn-auth-x509/subversion/include/svn_client.h
    subversion/branches/svn-auth-x509/subversion/include/svn_diff.h
    subversion/branches/svn-auth-x509/subversion/include/svn_version.h
    subversion/branches/svn-auth-x509/subversion/libsvn_client/copy.c
    subversion/branches/svn-auth-x509/subversion/libsvn_client/externals.c
    subversion/branches/svn-auth-x509/subversion/libsvn_client/import.c
    subversion/branches/svn-auth-x509/subversion/libsvn_client/mtcc.c
    subversion/branches/svn-auth-x509/subversion/libsvn_client/prop_commands.c
    subversion/branches/svn-auth-x509/subversion/libsvn_client/util.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/dag.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/dag.h
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra/ra_loader.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/util.c
    subversion/branches/svn-auth-x509/subversion/libsvn_subr/sysinfo.c
    subversion/branches/svn-auth-x509/subversion/mod_dav_svn/repos.c
    subversion/branches/svn-auth-x509/subversion/tests/cmdline/blame_tests.py
    subversion/branches/svn-auth-x509/subversion/tests/cmdline/commit_tests.py
    subversion/branches/svn-auth-x509/subversion/tests/cmdline/redirect_tests.py
    subversion/branches/svn-auth-x509/subversion/tests/libsvn_fs/fs-test.c

Propchange: subversion/branches/svn-auth-x509/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 30 01:16:23 2015
@@ -85,4 +85,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1603509-1655188
+/subversion/trunk:1603509-1655899

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CommitMessage.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CommitMessage.cpp?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CommitMessage.cpp (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CommitMessage.cpp Fri Jan 30 01:16:23 2015
@@ -65,6 +65,7 @@ CommitMessage::getCommitMessage(const ch
                                 const apr_array_header_t *commit_items,
                                 apr_pool_t *pool)
 {
+  *log_msg = NULL;
   *tmp_file = NULL;
   JNIEnv *env = JNIUtil::getEnv();
 
@@ -93,6 +94,9 @@ CommitMessage::getCommitMessage(const ch
 
       jobject jitem = CreateJ::CommitItem(item);
 
+      if (!jitem)
+        return SVN_NO_ERROR; /* Exception thrown */
+
       // store the Java object into the array
       jitems.push_back(jitem);
     }
@@ -102,7 +106,7 @@ CommitMessage::getCommitMessage(const ch
                                                     midCallback,
                                                     CreateJ::Set(jitems));
   if (JNIUtil::isJavaExceptionThrown())
-    return SVN_NO_ERROR;
+    POP_AND_RETURN(SVN_NO_ERROR);
 
   if (jmessage != NULL)
     {

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CreateJ.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CreateJ.cpp?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CreateJ.cpp (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CreateJ.cpp Fri Jan 30 01:16:23 2015
@@ -71,7 +71,8 @@ CreateJ::ConflictDescriptor(const svn_wc
                               "Ljava/lang/String;Ljava/lang/String;"
                               "Ljava/lang/String;Ljava/lang/String;"
                               "L"JAVA_PACKAGE"/types/ConflictVersion;"
-                              "L"JAVA_PACKAGE"/types/ConflictVersion;)V");
+                              "L"JAVA_PACKAGE"/types/ConflictVersion;"
+                              "Ljava/lang/String;[B[B[B[B)V");
       if (JNIUtil::isJavaExceptionThrown() || ctor == 0)
         POP_AND_RETURN_NULL;
     }
@@ -118,6 +119,33 @@ CreateJ::ConflictDescriptor(const svn_wc
   jobject joperation = EnumMapper::mapOperation(desc->operation);
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
+  jstring jpropRejectAbspath = JNIUtil::makeJString(desc->prop_reject_abspath);
+  if (JNIUtil::isJavaExceptionThrown())
+    POP_AND_RETURN_NULL;
+  jbyteArray jpropValueBase = (
+      !desc->prop_value_base ? NULL
+      :JNIUtil::makeJByteArray(desc->prop_value_base->data,
+                               int(desc->prop_value_base->len)));
+  if (JNIUtil::isExceptionThrown())
+    POP_AND_RETURN_NULL;
+  jbyteArray jpropValueWorking = (
+      !desc->prop_value_working ? NULL
+      :JNIUtil::makeJByteArray(desc->prop_value_working->data,
+                               int(desc->prop_value_working->len)));
+  if (JNIUtil::isExceptionThrown())
+    POP_AND_RETURN_NULL;
+  jbyteArray jpropValueIncomingOld = (
+      !desc->prop_value_incoming_old ? NULL
+      :JNIUtil::makeJByteArray(desc->prop_value_incoming_old->data,
+                               int(desc->prop_value_incoming_old->len)));
+  if (JNIUtil::isExceptionThrown())
+    POP_AND_RETURN_NULL;
+  jbyteArray jpropValueIncomingNew = (
+      !desc->prop_value_incoming_new ? NULL
+      :JNIUtil::makeJByteArray(desc->prop_value_incoming_new->data,
+                               int(desc->prop_value_incoming_new->len)));
+  if (JNIUtil::isExceptionThrown())
+    POP_AND_RETURN_NULL;
 
   // Instantiate the conflict descriptor.
   jobject jdesc = env->NewObject(clazz, ctor, jpath, jconflictKind,
@@ -125,7 +153,10 @@ CreateJ::ConflictDescriptor(const svn_wc
                                  (jboolean) desc->is_binary, jmimeType,
                                  jconflictAction, jconflictReason, joperation,
                                  jbasePath, jreposPath, juserPath,
-                                 jmergedPath, jsrcLeft, jsrcRight);
+                                 jmergedPath, jsrcLeft, jsrcRight,
+                                 jpropRejectAbspath, jpropValueBase,
+                                 jpropValueWorking, jpropValueIncomingOld,
+                                 jpropValueIncomingNew);
   if (JNIUtil::isJavaExceptionThrown())
     POP_AND_RETURN_NULL;
 

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/DiffOptions.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/DiffOptions.cpp?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/DiffOptions.cpp (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/DiffOptions.cpp Fri Jan 30 01:16:23 2015
@@ -71,5 +71,29 @@ apr_array_header_t *DiffOptions::options
   if (flags & SHOW_C_FUNCTION)
     APR_ARRAY_PUSH(opt, const char*) = "--show-c-function";
 
+  /* TODO: Support -U (context size) */
+
+  return opt;
+}
+
+svn_diff_file_options_t *DiffOptions::fileOptions(SVN::Pool &resultPool) const
+{
+  svn_diff_file_options_t *opt;
+
+  opt = svn_diff_file_options_create(resultPool.getPool());
+
+  if (flags & IGNORE_ALL_SPACE)
+    opt->ignore_space = svn_diff_file_ignore_space_all;
+  else if (flags & IGNORE_SPACE_CHANGE)
+    opt->ignore_eol_style = svn_diff_file_ignore_space_change;
+
+  if (flags & IGNORE_EOL_STYLE)
+    opt->ignore_eol_style = TRUE;
+
+  if (flags & SHOW_C_FUNCTION)
+    opt->show_c_function = TRUE;
+
+  /* TODO: Support context size */
+
   return opt;
 }

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/DiffOptions.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/DiffOptions.h?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/DiffOptions.h (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/DiffOptions.h Fri Jan 30 01:16:23 2015
@@ -29,6 +29,7 @@
 
 #include <apr_tables.h>
 #include "svn_types.h"
+#include "svn_diff.h"
 #include "Pool.h"
 #include "JNIUtil.h"
 
@@ -38,6 +39,7 @@ class DiffOptions
   DiffOptions(jobject joptions);
 
   apr_array_header_t *optionsArray(SVN::Pool &resultPool) const;
+  svn_diff_file_options_t *fileOptions(SVN::Pool &resultPool) const;
 
   svn_boolean_t useGitDiffFormat() const
   {

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/EnumMapper.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/EnumMapper.cpp?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/EnumMapper.cpp (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/EnumMapper.cpp Fri Jan 30 01:16:23 2015
@@ -32,32 +32,6 @@
 #include "JNIStringHolder.h"
 #include "../include/org_apache_subversion_javahl_CommitItemStateFlags.h"
 
-/**
- * Map a C commit state flag constant to the Java constant.
- * @param state     the C commit state flage constant
- * @returns the Java constant
- */
-jint EnumMapper::mapCommitMessageStateFlags(apr_byte_t flags)
-{
-  jint jstateFlags = 0;
-  if (flags & SVN_CLIENT_COMMIT_ITEM_ADD)
-    jstateFlags |=
-      org_apache_subversion_javahl_CommitItemStateFlags_Add;
-  if (flags & SVN_CLIENT_COMMIT_ITEM_DELETE)
-    jstateFlags |=
-      org_apache_subversion_javahl_CommitItemStateFlags_Delete;
-  if (flags & SVN_CLIENT_COMMIT_ITEM_TEXT_MODS)
-    jstateFlags |=
-      org_apache_subversion_javahl_CommitItemStateFlags_TextMods;
-  if (flags & SVN_CLIENT_COMMIT_ITEM_PROP_MODS)
-    jstateFlags |=
-      org_apache_subversion_javahl_CommitItemStateFlags_PropMods;
-  if (flags & SVN_CLIENT_COMMIT_ITEM_IS_COPY)
-    jstateFlags |=
-      org_apache_subversion_javahl_CommitItemStateFlags_IsCopy;
-  return jstateFlags;
-}
-
 jobject EnumMapper::mapChangePathAction(const char action)
 {
   switch (action)

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/EnumMapper.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/EnumMapper.h?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/EnumMapper.h (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/EnumMapper.h Fri Jan 30 01:16:23 2015
@@ -55,7 +55,6 @@ class EnumMapper
     toMergeinfoInheritance(jobject jInheritance);
 
   /* Converting from C enum's */
-  static jint mapCommitMessageStateFlags(apr_byte_t flags);
   static jobject mapChangePathAction(const char action);
   static jobject mapNotifyState(svn_wc_notify_state_t state);
   static jobject mapNotifyAction(svn_wc_notify_action_t action);

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/SVNClient.cpp?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/SVNClient.cpp Fri Jan 30 01:16:23 2015
@@ -1184,7 +1184,7 @@ void SVNClient::relocate(const char *fro
 void SVNClient::blame(const char *path, Revision &pegRevision,
                       Revision &revisionStart, Revision &revisionEnd,
                       bool ignoreMimeType, bool includeMergedRevisions,
-                      BlameCallback *callback)
+                      BlameCallback *callback, DiffOptions const& options)
 {
     SVN::Pool subPool(pool);
     SVN_JNI_NULL_PTR_EX(path, "path", );
@@ -1198,7 +1198,7 @@ void SVNClient::blame(const char *path,
     SVN_JNI_ERR(svn_client_blame5(
           intPath.c_str(), pegRevision.revision(), revisionStart.revision(),
           revisionEnd.revision(),
-          svn_diff_file_options_create(subPool.getPool()), ignoreMimeType,
+          options.fileOptions(subPool), ignoreMimeType,
           includeMergedRevisions, BlameCallback::callback, callback, ctx,
           subPool.getPool()),
         );

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/SVNClient.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/SVNClient.h?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/SVNClient.h Fri Jan 30 01:16:23 2015
@@ -82,7 +82,7 @@ class SVNClient :public SVNBase
   void blame(const char *path, Revision &pegRevision,
              Revision &revisionStart, Revision &revisionEnd,
              bool ignoreMimeType, bool includeMergedRevisions,
-             BlameCallback *callback);
+             BlameCallback *callback, DiffOptions const& options);
   void relocate(const char *from, const char *to, const char *path,
                 bool ignoreExternals);
   apr_hash_t *streamFileContent(const char *path,

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp Fri Jan 30 01:16:23 2015
@@ -1646,7 +1646,8 @@ JNIEXPORT void JNICALL
 Java_org_apache_subversion_javahl_SVNClient_blame
 (JNIEnv *env, jobject jthis, jstring jpath, jobject jpegRevision,
  jobject jrevisionStart, jobject jrevisionEnd, jboolean jignoreMimeType,
- jboolean jincludeMergedRevisions, jobject jblameCallback)
+ jboolean jincludeMergedRevisions, jobject jblameCallback,
+ jobject jdiffOptions)
 {
   JNIEntry(SVNClient, blame);
   SVNClient *cl = SVNClient::getCppObject(jthis);
@@ -1671,10 +1672,15 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
+  DiffOptions options(jdiffOptions);
+  if (JNIUtil::isExceptionThrown())
+    return;
+
   BlameCallback callback(jblameCallback);
   cl->blame(path, pegRevision, revisionStart, revisionEnd,
             jignoreMimeType ? true : false,
-            jincludeMergedRevisions ? true : false, &callback);
+            jincludeMergedRevisions ? true : false, &callback,
+            options);
 }
 
 JNIEXPORT void JNICALL

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/ConflictDescriptor.java Fri Jan 30 01:16:23 2015
@@ -71,13 +71,26 @@ public class ConflictDescriptor
      */
     private ConflictVersion srcRightVersion;
 
-    /** This constructor should only be called from JNI code. */
-    public ConflictDescriptor(String path, Kind conflictKind, NodeKind nodeKind,
+    // Information about property conflicts. New in 1.9
+    private String propRejectAbspath;
+    private byte[] propValueBase;
+    private byte[] propValueWorking;
+    private byte[] propValueIncomingOld;
+    private byte[] propValueIncomingNew;
+
+
+    // Private constructor, only called from the JNI code.
+    private ConflictDescriptor(String path, Kind conflictKind, NodeKind nodeKind,
                        String propertyName, boolean isBinary, String mimeType,
                        Action action, Reason reason, Operation operation,
                        String basePath, String theirPath,
                        String myPath, String mergedPath,
-                       ConflictVersion srcLeft, ConflictVersion srcRight)
+                       ConflictVersion srcLeft, ConflictVersion srcRight,
+                       String propRejectAbspath, byte[] propValueBase,
+                       byte[] propValueWorking,
+                       byte[] propValueIncomingOld,
+                       byte[] propValueIncomingNew)
+
     {
         this.path = path;
         this.conflictKind = conflictKind;
@@ -94,6 +107,28 @@ public class ConflictDescriptor
         this.operation = operation;
         this.srcLeftVersion = srcLeft;
         this.srcRightVersion = srcRight;
+        this.propRejectAbspath = propRejectAbspath;
+        this.propValueBase = propValueBase;
+        this.propValueWorking = propValueWorking;
+        this.propValueIncomingOld = propValueIncomingOld;
+        this.propValueIncomingNew = propValueIncomingNew;
+    }
+
+    /**
+     * This constructor should only be called from JNI code.
+     * @deprecated
+     */
+    @Deprecated
+    public ConflictDescriptor(String path, Kind conflictKind, NodeKind nodeKind,
+                       String propertyName, boolean isBinary, String mimeType,
+                       Action action, Reason reason, Operation operation,
+                       String basePath, String theirPath,
+                       String myPath, String mergedPath,
+                       ConflictVersion srcLeft, ConflictVersion srcRight)
+    {
+        this(path, conflictKind, nodeKind, propertyName, isBinary, mimeType,
+             action, reason, operation, basePath, theirPath, myPath, mergedPath,
+             srcLeft, srcRight, null, null, null, null, null);
     }
 
     public String getPath()
@@ -171,6 +206,32 @@ public class ConflictDescriptor
         return srcRightVersion;
     }
 
+    public String getPropRejectAbspath()
+    {
+        return propRejectAbspath;
+    }
+
+    public byte[] getPropValueBase()
+    {
+        return propValueBase;
+    }
+
+    public byte[] getPropValueWorking()
+    {
+        return propValueWorking;
+    }
+
+    public byte[] getPropValueIncomingOld()
+    {
+        return propValueIncomingOld;
+    }
+
+    public byte[] getPropValueIncomingNew()
+    {
+        return propValueIncomingNew;
+    }
+
+
     /**
      * Rich man's enum for <code>svn_wc_conflict_kind_t</code>.
      */

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java Fri Jan 30 01:16:23 2015
@@ -1323,12 +1323,28 @@ public interface ISVNClient
      *                      information
      * @param callback      callback to receive the file content and the other
      *                      information
+     * @param options       additional options for controlling the output
      * @throws ClientException
+     * @since 1.9
      */
     void blame(String path, Revision pegRevision, Revision revisionStart,
                Revision revisionEnd, boolean ignoreMimeType,
                boolean includeMergedRevisions,
-               BlameCallback callback) throws ClientException;
+               BlameCallback callback, DiffOptions options)
+            throws ClientException;
+
+    /**
+     * Retrieve the content together with the author, the revision and the date
+     * of the last change of each line
+     * <p>
+     * Behaves like the 1.9 version with <code>options</code> set to
+     * their default values.
+     */
+    void blame(String path, Revision pegRevision, Revision revisionStart,
+               Revision revisionEnd, boolean ignoreMimeType,
+               boolean includeMergedRevisions,
+               BlameCallback callback)
+            throws ClientException;
 
     /**
      * Set directory for the configuration information, taking the

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java Fri Jan 30 01:16:23 2015
@@ -651,11 +651,23 @@ public class SVNClient implements ISVNCl
                                 boolean ignoreExternals)
             throws ClientException;
 
+    public void blame(String path, Revision pegRevision,
+                      Revision revisionStart,
+                      Revision revisionEnd, boolean ignoreMimeType,
+                      boolean includeMergedRevisions,
+                      BlameCallback callback)
+            throws ClientException
+    {
+        blame(path, pegRevision, revisionStart, revisionEnd, ignoreMimeType,
+              includeMergedRevisions, callback, null);
+    }
+
     public native void blame(String path, Revision pegRevision,
                              Revision revisionStart,
                              Revision revisionEnd, boolean ignoreMimeType,
                              boolean includeMergedRevisions,
-                             BlameCallback callback)
+                             BlameCallback callback,
+                             DiffOptions options)
             throws ClientException;
 
     public native void setConfigDirectory(String configDir)

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Fri Jan 30 01:16:23 2015
@@ -259,7 +259,7 @@ public class BasicTests extends SVNTests
         tempclient.dispose();
 
         // create Y and Y/Z directories in the repository
-        addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y", NodeKind.none,
+        addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y", NodeKind.dir,
                               CommitItemStateFlags.Add);
         Set<String> urls = new HashSet<String>(1);
         urls.add(thisTest.getUrl() + "/Y");
@@ -1004,9 +1004,9 @@ public class BasicTests extends SVNTests
         OneTest thisTest = new OneTest();
 
         // create Y and Y/Z directories in the repository
-        addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y", NodeKind.none,
+        addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y", NodeKind.dir,
                               CommitItemStateFlags.Add);
-        addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y/Z", NodeKind.none,
+        addExpectedCommitItem(null, thisTest.getUrl().toString(), "Y/Z", NodeKind.dir,
                               CommitItemStateFlags.Add);
         Set<String> urls = new HashSet<String>(2);
         urls.add(thisTest.getUrl() + "/Y");
@@ -3885,11 +3885,46 @@ public class BasicTests extends SVNTests
                      false, false, callback);
         assertEquals(1, callback.numberOfLines());
         BlameCallbackImpl.BlameLine line = callback.getBlameLine(0);
-        if (line != null)
-        {
-            assertEquals(1, line.getRevision());
-            assertEquals("jrandom", line.getAuthor());
+        assertNotNull(line);
+        assertEquals(1, line.getRevision());
+        assertEquals("jrandom", line.getAuthor());
+        assertEquals("This is the file 'iota'.", line.getLine());
+    }
+
+    /**
+     * Test blame with diff options.
+     * @since 1.9
+     */
+    public void testBlameWithDiffOptions() throws Throwable
+    {
+        OneTest thisTest = new OneTest();
+        // Modify the file iota, making only whitespace changes.
+        File iota = new File(thisTest.getWorkingCopy(), "iota");
+        FileOutputStream stream = new FileOutputStream(iota, false);
+        stream.write("This   is   the   file   'iota'.\t".getBytes());
+        stream.close();
+        Set<String> srcPaths = new HashSet<String>(1);
+        srcPaths.add(thisTest.getWCPath());
+        try {
+            client.username("rayjandom");
+            client.commit(srcPaths, Depth.infinity, false, false, null, null,
+                          new ConstMsg("Whitespace-only change in /iota"), null);
+        } finally {
+            client.username("jrandom");
         }
+
+        // Run blame on the result
+        BlameCallbackImpl callback = new BlameCallbackImpl();
+        client.blame(thisTest.getWCPath() + "/iota", Revision.HEAD,
+                     Revision.getInstance(1), Revision.HEAD,
+                     false, false, callback,
+                     new DiffOptions(DiffOptions.Flag.IgnoreWhitespace));
+        assertEquals(1, callback.numberOfLines());
+        BlameCallbackImpl.BlameLine line = callback.getBlameLine(0);
+        assertNotNull(line);
+        assertEquals(1, line.getRevision());
+        assertEquals("jrandom", line.getAuthor());
+        assertEquals("This   is   the   file   'iota'.\t", line.getLine());
     }
 
     /**

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Fri Jan 30 01:16:23 2015
@@ -257,10 +257,11 @@ class SVNTests extends TestCase
         greekRepos = new File(localTmp, "repos");
         greekDump = new File(localTmp, "greek_dump");
         admin.create(greekRepos, true,false, null, this.fsType);
-        addExpectedCommitItem(greekFiles.getAbsolutePath(), null, null,
-                              NodeKind.none, CommitItemStateFlags.Add);
+        addExpectedCommitItem(greekFiles.getAbsolutePath(),
+                              makeReposUrl(greekRepos).toString(), null,
+                              NodeKind.dir, CommitItemStateFlags.Add);
         client.doImport(greekFiles.getAbsolutePath(),
-                       makeReposUrl(greekRepos).toString(),
+                        makeReposUrl(greekRepos).toString(),
                         Depth.infinity, false, false, null,
                         new MyCommitMessage(), null);
         admin.dump(greekRepos, new FileOutputStream(greekDump),

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/tests/org/tigris/subversion/javahl/SVNTests.java Fri Jan 30 01:16:23 2015
@@ -232,8 +232,9 @@ class SVNTests extends TestCase
         greekDump = new File(localTmp, "greek_dump");
         admin.create(greekRepos.getAbsolutePath(), true,false, null,
                      this.fsType);
-        addExpectedCommitItem(greekFiles.getAbsolutePath(), null, null,
-                              NodeKind.none, CommitItemStateFlags.Add);
+        addExpectedCommitItem(greekFiles.getAbsolutePath(),
+                              makeReposUrl(greekRepos).toString(), null,
+                              NodeKind.dir, CommitItemStateFlags.Add);
         client.doImport(greekFiles.getAbsolutePath(), makeReposUrl(greekRepos),
                         null, true );
         admin.dump(greekRepos.getAbsolutePath(), new FileOutputer(greekDump),

Modified: subversion/branches/svn-auth-x509/subversion/bindings/swig/core.i
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/swig/core.i?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/swig/core.i (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/swig/core.i Fri Jan 30 01:16:23 2015
@@ -800,10 +800,11 @@ core_set_current_pool (apr_pool_t *pool)
 #endif
 
 #ifdef SWIGPYTHON
-# The auth baton depends on the providers, so we preserve a
-# reference to them inside the wrapper. This way, if all external
-# references to the providers are gone, they will still be alive,
-# keeping the baton valid.
+/* The auth baton depends on the providers, so we preserve a
+   reference to them inside the wrapper. This way, if all external
+   references to the providers are gone, they will still be alive,
+   keeping the baton valid.
+ */
 %feature("pythonappend") svn_auth_open %{
   val.__dict__["_deps"] = list(args[0])
 %}

Modified: subversion/branches/svn-auth-x509/subversion/bindings/swig/ruby/test/test_client.rb
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/swig/ruby/test/test_client.rb?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/swig/ruby/test/test_client.rb (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/swig/ruby/test/test_client.rb Fri Jan 30 01:16:23 2015
@@ -2243,8 +2243,8 @@ class SvnClientTest < Test::Unit::TestCa
 
       items = nil
       ctx.cp(path, repos_uri2)
-      assert_equal([nil], items.collect {|item| item.wcprop_changes})
-      assert_equal([nil], items.collect {|item| item.incoming_prop_changes})
+      assert_equal([[]], items.collect {|item| item.wcprop_changes})
+      assert_equal([[]], items.collect {|item| item.incoming_prop_changes})
       assert_equal([nil], items.collect {|item| item.outgoing_prop_changes})
     end
   end

Modified: subversion/branches/svn-auth-x509/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/include/svn_client.h?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/include/svn_client.h (original)
+++ subversion/branches/svn-auth-x509/subversion/include/svn_client.h Fri Jan 30 01:16:23 2015
@@ -465,13 +465,19 @@ typedef struct svn_client_commit_item3_t
 {
   /* IMPORTANT: If you extend this structure, add new fields to the end. */
 
-  /** absolute working-copy path of item */
+  /** absolute working-copy path of item. Always set during normal commits
+   * (and copies from a working copy) to the repository. Can only be NULL
+   * when stub commit items are created for operations that only involve
+   * direct repository operations. During WC->REPOS copy operations, this
+   * path is the WC source path of the operation. */
   const char *path;
 
   /** node kind (dir, file) */
   svn_node_kind_t kind;
 
-  /** commit URL for this item */
+  /** commit URL for this item. Points to the repository location of PATH
+   * during commits, or to the final URL of the item when copying from the
+   * working copy to the repository. */
   const char *url;
 
   /** revision of textbase */

Modified: subversion/branches/svn-auth-x509/subversion/include/svn_diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/include/svn_diff.h?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/include/svn_diff.h (original)
+++ subversion/branches/svn-auth-x509/subversion/include/svn_diff.h Fri Jan 30 01:16:23 2015
@@ -475,6 +475,7 @@ typedef struct svn_diff_file_options_t
     * of the nearest preceding line that starts with a character that might be
     * the initial character of a C language identifier.  The default is
     * @c FALSE.
+    * @since New in 1.5.
     */
   svn_boolean_t show_c_function;
 

Modified: subversion/branches/svn-auth-x509/subversion/include/svn_version.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/include/svn_version.h?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/include/svn_version.h (original)
+++ subversion/branches/svn-auth-x509/subversion/include/svn_version.h Fri Jan 30 01:16:23 2015
@@ -306,6 +306,11 @@ typedef struct svn_version_extended_t sv
  * retrieve (for example, the OS release name, list of shared
  * libraries, etc.).  Use @a pool for all allocations.
  *
+ * @note This function may allocate significant auxiliary resources
+ * (memory and file descriptors) in @a pool.  It is recommended to
+ * copy the returned data to suitable longer-lived memory and clear
+ * @a pool after calling this function.
+ *
  * @since New in 1.8.
  */
 const svn_version_extended_t *

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_client/copy.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_client/copy.c Fri Jan 30 01:16:23 2015
@@ -1093,6 +1093,7 @@ repos_to_repos_copy(const apr_array_head
 
               item = svn_client_commit_item3_create(pool);
               item->url = svn_path_url_add_component2(top_url, relpath, pool);
+              item->kind = svn_node_dir;
               item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;
               APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
             }
@@ -1106,6 +1107,7 @@ repos_to_repos_copy(const apr_array_head
           item = svn_client_commit_item3_create(pool);
           item->url = svn_path_url_add_component2(top_url, info->dst_path,
                                                   pool);
+          item->kind = info->src_kind;
           item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD
                               | SVN_CLIENT_COMMIT_ITEM_IS_COPY;
           item->copyfrom_url = info->src_url;
@@ -1117,6 +1119,7 @@ repos_to_repos_copy(const apr_array_head
               item = svn_client_commit_item3_create(pool);
               item->url = svn_path_url_add_component2(top_url, info->src_path,
                                                       pool);
+              item->kind = info->src_kind;
               item->state_flags = SVN_CLIENT_COMMIT_ITEM_DELETE;
               APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
             }
@@ -1347,52 +1350,6 @@ wc_to_repos_copy(const apr_array_header_
         }
     }
 
-  if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))
-    {
-      /* Produce a list of new paths to add, and provide it to the
-         mechanism used to acquire a log message. */
-      svn_client_commit_item3_t *item;
-      const char *tmp_file;
-      commit_items = apr_array_make(scratch_pool, copy_pairs->nelts,
-                                    sizeof(item));
-
-      /* Add any intermediate directories to the message */
-      if (make_parents)
-        {
-          for (i = 0; i < new_dirs->nelts; i++)
-            {
-              const char *url = APR_ARRAY_IDX(new_dirs, i, const char *);
-
-              item = svn_client_commit_item3_create(scratch_pool);
-              item->url = url;
-              item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;
-              APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
-            }
-        }
-
-      for (i = 0; i < copy_pairs->nelts; i++)
-        {
-          svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i,
-                                            svn_client__copy_pair_t *);
-
-          item = svn_client_commit_item3_create(scratch_pool);
-          item->url = pair->dst_abspath_or_url;
-          item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;
-          APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
-        }
-
-      SVN_ERR(svn_client__get_log_msg(&message, &tmp_file, commit_items,
-                                      ctx, scratch_pool));
-      if (! message)
-        {
-          svn_pool_destroy(iterpool);
-          svn_pool_destroy(session_pool);
-          return SVN_NO_ERROR;
-        }
-    }
-  else
-    message = "";
-
   cukb.session = ra_session;
   SVN_ERR(svn_ra_get_repos_root2(ra_session, &cukb.repos_root_url, session_pool));
   cukb.should_reparent = FALSE;
@@ -1423,6 +1380,7 @@ wc_to_repos_copy(const apr_array_header_
 
           item = svn_client_commit_item3_create(scratch_pool);
           item->url = url;
+          item->kind = svn_node_dir;
           item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;
           item->incoming_prop_changes = apr_array_make(scratch_pool, 1,
                                                        sizeof(svn_prop_t *));
@@ -1450,8 +1408,6 @@ wc_to_repos_copy(const apr_array_header_
 
       /* Set the mergeinfo for the destination to the combined merge
          info known to the WC and the repository. */
-      item->outgoing_prop_changes = apr_array_make(scratch_pool, 1,
-                                                   sizeof(svn_prop_t *));
       /* Repository mergeinfo (or NULL if it's locally added)... */
       if (src_origin)
         SVN_ERR(svn_client__get_repos_mergeinfo(
@@ -1468,18 +1424,24 @@ wc_to_repos_copy(const apr_array_header_
                                      iterpool));
       else if (! mergeinfo)
         mergeinfo = wc_mergeinfo;
+
       if (mergeinfo)
         {
           /* Push a mergeinfo prop representing MERGEINFO onto the
            * OUTGOING_PROP_CHANGES array. */
 
           svn_prop_t *mergeinfo_prop
-            = apr_palloc(item->outgoing_prop_changes->pool,
-                         sizeof(svn_prop_t));
+                            = apr_palloc(scratch_pool, sizeof(*mergeinfo_prop));
           svn_string_t *prop_value;
 
           SVN_ERR(svn_mergeinfo_to_string(&prop_value, mergeinfo,
-                                          item->outgoing_prop_changes->pool));
+                                          scratch_pool));
+
+          if (!item->outgoing_prop_changes)
+            {
+              item->outgoing_prop_changes = apr_array_make(scratch_pool, 1,
+                                                           sizeof(svn_prop_t *));
+            }
 
           mergeinfo_prop->name = SVN_PROP_MERGEINFO;
           mergeinfo_prop->value = prop_value;
@@ -1488,6 +1450,22 @@ wc_to_repos_copy(const apr_array_header_
         }
     }
 
+  if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))
+    {
+      const char *tmp_file;
+
+      SVN_ERR(svn_client__get_log_msg(&message, &tmp_file, commit_items,
+                                      ctx, scratch_pool));
+      if (! message)
+        {
+          svn_pool_destroy(iterpool);
+          svn_pool_destroy(session_pool);
+          return SVN_NO_ERROR;
+        }
+    }
+  else
+    message = "";
+
   /* Sort and condense our COMMIT_ITEMS. */
   SVN_ERR(svn_client__condense_commit_items(&top_dst_url,
                                             commit_items, scratch_pool));
@@ -2002,7 +1980,7 @@ try_copy(svn_boolean_t *timestamp_sleep,
         {
           svn_client_copy_source_t *source = APR_ARRAY_IDX(sources, i,
                                                svn_client_copy_source_t *);
-          svn_client__copy_pair_t *pair = apr_palloc(pool, sizeof(*pair));
+          svn_client__copy_pair_t *pair = apr_pcalloc(pool, sizeof(*pair));
           const char *src_basename;
           svn_boolean_t src_is_url = svn_path_is_url(source->path);
 
@@ -2024,6 +2002,7 @@ try_copy(svn_boolean_t *timestamp_sleep,
 
           pair->src_op_revision = *source->revision;
           pair->src_peg_revision = *source->peg_revision;
+          pair->src_kind = svn_node_unknown;
 
           SVN_ERR(svn_opt_resolve_revisions(&pair->src_peg_revision,
                                             &pair->src_op_revision,
@@ -2052,7 +2031,7 @@ try_copy(svn_boolean_t *timestamp_sleep,
   else
     {
       /* Only one source path. */
-      svn_client__copy_pair_t *pair = apr_palloc(pool, sizeof(*pair));
+      svn_client__copy_pair_t *pair = apr_pcalloc(pool, sizeof(*pair));
       svn_client_copy_source_t *source =
         APR_ARRAY_IDX(sources, 0, svn_client_copy_source_t *);
       svn_boolean_t src_is_url = svn_path_is_url(source->path);
@@ -2064,6 +2043,7 @@ try_copy(svn_boolean_t *timestamp_sleep,
                                         source->path, pool));
       pair->src_op_revision = *source->revision;
       pair->src_peg_revision = *source->peg_revision;
+      pair->src_kind = svn_node_unknown;
 
       SVN_ERR(svn_opt_resolve_revisions(&pair->src_peg_revision,
                                         &pair->src_op_revision,

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_client/externals.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_client/externals.c Fri Jan 30 01:16:23 2015
@@ -146,6 +146,7 @@ relegate_dir_external(svn_wc_context_t *
 static svn_error_t *
 switch_dir_external(const char *local_abspath,
                     const char *url,
+                    const char *url_from_externals_definition,
                     const svn_opt_revision_t *peg_revision,
                     const svn_opt_revision_t *revision,
                     const char *defining_abspath,
@@ -197,7 +198,16 @@ switch_dir_external(const char *local_ab
       SVN_ERR(svn_wc__get_wcroot(&defining_wcroot_abspath, ctx->wc_ctx,
                                  defining_abspath, pool, pool));
       if (strcmp(wcroot_abspath, defining_wcroot_abspath) == 0)
-        return svn_error_create(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL, NULL);
+        return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL,
+                                 _("The external '%s' defined in %s at '%s' "
+                                   "cannot be checked out because '%s' is "
+                                   "already a versioned path."),
+                                   url_from_externals_definition,
+                                   SVN_PROP_EXTERNALS,
+                                   svn_dirent_local_style(defining_abspath,
+                                                          pool),
+                                   svn_dirent_local_style(local_abspath,
+                                                          pool));
     }
 
   /* If path is a directory, try to update/switch to the correct URL
@@ -792,6 +802,7 @@ handle_external_item_change(svn_client_c
     {
       case svn_node_dir:
         SVN_ERR(switch_dir_external(local_abspath, new_loc->url,
+                                    new_item->url,
                                     &(new_item->peg_revision),
                                     &(new_item->revision),
                                     parent_dir_abspath,

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_client/import.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_client/import.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_client/import.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_client/import.c Fri Jan 30 01:16:23 2015
@@ -832,6 +832,8 @@ svn_client_import5(const char *path,
 
   SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
 
+  SVN_ERR(svn_io_check_path(local_abspath, &kind, scratch_pool));
+
   /* Create a new commit item and add it to the array. */
   if (SVN_CLIENT__HAS_LOG_MSG_FUNC(ctx))
     {
@@ -845,6 +847,8 @@ svn_client_import5(const char *path,
 
       item = svn_client_commit_item3_create(scratch_pool);
       item->path = local_abspath;
+      item->url = url;
+      item->kind = kind;
       item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;
       APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
 
@@ -860,8 +864,6 @@ svn_client_import5(const char *path,
         }
     }
 
-  SVN_ERR(svn_io_check_path(local_abspath, &kind, scratch_pool));
-
   SVN_ERR(svn_client_open_ra_session2(&ra_session, url, NULL,
                                       ctx, scratch_pool, iterpool));
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_client/mtcc.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_client/mtcc.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_client/mtcc.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_client/mtcc.c Fri Jan 30 01:16:23 2015
@@ -463,8 +463,8 @@ mtcc_verify_create(svn_client__mtcc_t *m
         return SVN_NO_ERROR; /* Node is explicitly deleted. We can replace */
     }
 
-  /* mod_dav_svn allows overwriting existing directories. Let's hide that
-     for users of this api */
+  /* mod_dav_svn used to allow overwriting existing directories. Let's hide
+     that for users of this api */
   SVN_ERR(svn_client__mtcc_check_path(&kind, new_relpath, FALSE,
                                       mtcc, scratch_pool));
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_client/prop_commands.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_client/prop_commands.c Fri Jan 30 01:16:23 2015
@@ -206,6 +206,7 @@ propset_on_url(const char *propname,
 
       item = svn_client_commit_item3_create(pool);
       item->url = target;
+      item->kind = node_kind;
       item->state_flags = SVN_CLIENT_COMMIT_ITEM_PROP_MODS;
       APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
       SVN_ERR(svn_client__get_log_msg(&message, &tmp_file, commit_items,
@@ -528,9 +529,10 @@ svn_client_revprop_set2(const char *prop
 
 /* Helper for the remote case of svn_client_propget.
  *
- * If PROPS is not null, then get the value of property PROPNAME in REVNUM,
-   using RA_LIB and SESSION.  Store the value ('svn_string_t *') in PROPS,
-   under the path key "TARGET_PREFIX/TARGET_RELATIVE" ('const char *').
+ * If PROPS is not null, then get the value of property PROPNAME in
+ * REVNUM, using RA_SESSION.  Store the value ('svn_string_t *') in
+ * PROPS, under the path key "TARGET_PREFIX/TARGET_RELATIVE"
+ * ('const char *').
  *
  * If INHERITED_PROPS is not null, then set *INHERITED_PROPS to a
  * depth-first ordered array of svn_prop_inherited_item_t * structures

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_client/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_client/util.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_client/util.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_client/util.c Fri Jan 30 01:16:23 2015
@@ -142,6 +142,7 @@ svn_client_commit_item3_create(apr_pool_
 
   item->revision = SVN_INVALID_REVNUM;
   item->copyfrom_rev = SVN_INVALID_REVNUM;
+  item->kind = svn_node_unknown;
 
   return item;
 }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/dag.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/dag.c Fri Jan 30 01:16:23 2015
@@ -1105,15 +1105,6 @@ svn_fs_fs__dag_dup(const dag_node_t *nod
   return new_node;
 }
 
-dag_node_t *
-svn_fs_fs__dag_copy_into_pool(dag_node_t *node,
-                              apr_pool_t *pool)
-{
-  return (node->node_pool == pool
-            ? node
-            : svn_fs_fs__dag_dup(node, pool));
-}
-
 svn_error_t *
 svn_fs_fs__dag_serialize(void **data,
                          apr_size_t *data_len,

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/dag.h?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/dag.h Fri Jan 30 01:16:23 2015
@@ -80,12 +80,6 @@ dag_node_t *
 svn_fs_fs__dag_dup(const dag_node_t *node,
                    apr_pool_t *pool);
 
-/* If NODE has been allocated in POOL, return NODE.  Otherwise, return
-   a copy created in POOL with svn_fs_fs__dag_dup. */
-dag_node_t *
-svn_fs_fs__dag_copy_into_pool(dag_node_t *node,
-                              apr_pool_t *pool);
-
 /* Serialize a DAG node, except don't try to preserve the 'fs' member.
    Implements svn_cache__serialize_func_t */
 svn_error_t *

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c Fri Jan 30 01:16:23 2015
@@ -373,10 +373,8 @@ locate_cache(svn_cache__t **cache,
     }
 }
 
-/* Return NODE for PATH from ROOT's node cache, or NULL if the node
-   isn't cached; read it from the FS. *NODE remains valid until either
-   POOL or the FS gets cleared or destroyed (whichever comes first).
- */
+/* Return NODE_P for PATH from ROOT's node cache, or NULL if the node
+   isn't cached; read it from the FS. *NODE_P is allocated in POOL. */
 static svn_error_t *
 dag_node_cache_get(dag_node_t **node_p,
                    svn_fs_root_t *root,
@@ -402,19 +400,22 @@ dag_node_cache_get(dag_node_t **node_p,
       if (bucket->node == NULL)
         {
           locate_cache(&cache, &key, root, path, pool);
-          SVN_ERR(svn_cache__get((void **)&node, &found, cache, key,
-                                 ffd->dag_node_cache->pool));
+          SVN_ERR(svn_cache__get((void **)&node, &found, cache, key, pool));
           if (found && node)
             {
               /* Patch up the FS, since this might have come from an old FS
               * object. */
               svn_fs_fs__dag_set_fs(node, root->fs);
-              bucket->node = node;
+
+              /* Retain the DAG node in L1 cache. */
+              bucket->node = svn_fs_fs__dag_dup(node,
+                                                ffd->dag_node_cache->pool);
             }
         }
       else
         {
-          node = bucket->node;
+          /* Copy the node from L1 cache into the passed-in POOL. */
+          node = svn_fs_fs__dag_dup(bucket->node, pool);
         }
     }
   else
@@ -798,8 +799,7 @@ make_parent_path(dag_node_t *node,
                  apr_pool_t *pool)
 {
   parent_path_t *parent_path = apr_pcalloc(pool, sizeof(*parent_path));
-  if (node)
-    parent_path->node = svn_fs_fs__dag_copy_into_pool(node, pool);
+  parent_path->node = node;
   parent_path->entry = entry;
   parent_path->parent = parent;
   parent_path->copy_inherit = copy_id_inherit_unknown;
@@ -1012,10 +1012,6 @@ open_path(parent_path_t **parent_path_p,
 
       svn_pool_clear(iterpool);
 
-      /* The NODE in PARENT_PATH always lives in POOL, i.e. it will
-       * survive the cleanup of ITERPOOL and the DAG cache.*/
-      here = parent_path->node;
-
       /* Parse out the next entry from the path.  */
       entry = svn_fs__next_entry_name(&next, rest, pool);
 
@@ -1024,12 +1020,15 @@ open_path(parent_path_t **parent_path_p,
       path_so_far->len += strlen(entry) + 1;
       path_so_far->data[path_so_far->len] = '\0';
 
-      /* Given the behavior of svn_fs__next_entry_name(), ENTRY may be an
-         empty string when the path either starts or ends with a slash.
-         In either case, we stay put: the current directory stays the
-         same, and we add nothing to the parent path.  We only need to
-         process non-empty path segments. */
-      if (*entry != '\0')
+      if (*entry == '\0')
+        {
+          /* Given the behavior of svn_fs__next_entry_name(), this
+             happens when the path either starts or ends with a slash.
+             In either case, we stay put: the current directory stays
+             the same, and we add nothing to the parent path. */
+          child = here;
+        }
+      else
         {
           copy_id_inherit_t inherit;
           const char *copy_path = NULL;
@@ -1078,7 +1077,7 @@ open_path(parent_path_t **parent_path_p,
           if (flags & open_path_node_only)
             {
               /* Shortcut: the caller only wants the final DAG node. */
-              parent_path->node = svn_fs_fs__dag_copy_into_pool(child, pool);
+              parent_path->node = child;
             }
           else
             {
@@ -1109,6 +1108,7 @@ open_path(parent_path_t **parent_path_p,
                   apr_psprintf(iterpool, _("Failure opening '%s'"), path));
 
       rest = next;
+      here = child;
     }
 
   svn_pool_destroy(iterpool);
@@ -1217,8 +1217,7 @@ make_path_mutable(svn_fs_root_t *root,
 
 /* Open the node identified by PATH in ROOT.  Set DAG_NODE_P to the
    node we find, allocated in POOL.  Return the error
-   SVN_ERR_FS_NOT_FOUND if this node doesn't exist.
- */
+   SVN_ERR_FS_NOT_FOUND if this node doesn't exist. */
 static svn_error_t *
 get_dag(dag_node_t **dag_node_p,
         svn_fs_root_t *root,
@@ -1256,7 +1255,7 @@ get_dag(dag_node_t **dag_node_p,
         }
     }
 
-  *dag_node_p = svn_fs_fs__dag_copy_into_pool(node, pool);
+  *dag_node_p = node;
   return SVN_NO_ERROR;
 }
 
@@ -1374,7 +1373,7 @@ fs_node_relation(svn_fs_node_relation_t
   rev_item_a = *svn_fs_fs__id_rev_item(id);
   node_id_a = *svn_fs_fs__id_node_id(id);
 
-  SVN_ERR(get_dag(&node, root_b, path_b,  pool));
+  SVN_ERR(get_dag(&node, root_b, path_b, pool));
   id = svn_fs_fs__dag_get_id(node);
   rev_item_b = *svn_fs_fs__id_rev_item(id);
   node_id_b = *svn_fs_fs__id_node_id(id);
@@ -1476,7 +1475,7 @@ fs_node_prop(svn_string_t **value_p,
   dag_node_t *node;
   apr_hash_t *proplist;
 
-  SVN_ERR(get_dag(&node, root, path,  pool));
+  SVN_ERR(get_dag(&node, root, path, pool));
   SVN_ERR(svn_fs_fs__dag_get_proplist(&proplist, node, pool));
   *value_p = NULL;
   if (proplist)

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra/ra_loader.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra/ra_loader.c Fri Jan 30 01:16:23 2015
@@ -279,7 +279,6 @@ svn_error_t *svn_ra_open4(svn_ra_session
   svn_boolean_t store_pp = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP;
   const char *store_pp_plaintext
     = SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT;
-  const char *corrected_url;
 
   /* Initialize the return variable. */
   *session_p = NULL;
@@ -482,34 +481,29 @@ svn_error_t *svn_ra_open4(svn_ra_session
   session->pool = sesspool;
 
   /* Ask the library to open the session. */
-  err = vtable->open_session(session, &corrected_url, repos_URL,
+  err = vtable->open_session(session, corrected_url_p,
+                             repos_URL,
                              callbacks, callback_baton, config, sesspool);
 
   if (err)
-    return svn_error_createf(
+    {
+      if (err->apr_err == SVN_ERR_RA_SESSION_URL_MISMATCH)
+        return svn_error_trace(err);
+
+      return svn_error_createf(
                 SVN_ERR_RA_CANNOT_CREATE_SESSION, err,
                 _("Unable to connect to a repository at URL '%s'"),
                 repos_URL);
+    }
 
   /* If the session open stuff detected a server-provided URL
      correction (a 301 or 302 redirect response during the initial
      OPTIONS request), then kill the session so the caller can decide
      what to do. */
-  if (corrected_url_p && corrected_url)
+  if (corrected_url_p && *corrected_url_p)
     {
-      if (! svn_path_is_url(corrected_url))
-        {
-          /* RFC1945 and RFC2616 state that the Location header's
-             value (from whence this CORRECTED_URL ultimately comes),
-             if present, must be an absolute URI.  But some Apache
-             versions (those older than 2.2.11, it seems) transmit
-             only the path portion of the URI.  See issue #3775 for
-             details. */
-          apr_uri_t corrected_URI = repos_URI;
-          corrected_URI.path = (char *)corrected_url;
-          corrected_url = apr_uri_unparse(pool, &corrected_URI, 0);
-        }
-      *corrected_url_p = svn_uri_canonicalize(corrected_url, pool);
+      /* *session_p = NULL; */
+      *corrected_url_p = apr_pstrdup(pool, *corrected_url_p);
       svn_pool_destroy(sesspool);
       return SVN_NO_ERROR;
     }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c Fri Jan 30 01:16:23 2015
@@ -30,6 +30,7 @@
 #include "svn_dirent_uri.h"
 #include "svn_hash.h"
 #include "svn_pools.h"
+#include "svn_path.h"
 #include "svn_ra.h"
 #include "svn_dav.h"
 #include "svn_xml.h"
@@ -511,6 +512,8 @@ svn_ra_serf__exchange_capabilities(svn_r
   /* This routine automatically fills in serf_sess->capabilities */
   SVN_ERR(create_options_req(&opt_ctx, serf_sess, scratch_pool));
 
+  opt_ctx->handler->no_fail_on_http_redirect_status = TRUE;
+
   SVN_ERR(svn_ra_serf__context_run_one(opt_ctx->handler, scratch_pool));
 
   /* If our caller cares about server redirections, and our response
@@ -519,9 +522,44 @@ svn_ra_serf__exchange_capabilities(svn_r
      successfully parsing as XML or somesuch. */
   if (corrected_url && (opt_ctx->handler->sline.code == 301))
     {
-      *corrected_url = apr_pstrdup(result_pool, opt_ctx->handler->location);
+      if (!opt_ctx->handler->location || !*opt_ctx->handler->location)
+        {
+          return svn_error_create(
+                    SVN_ERR_RA_DAV_RESPONSE_HEADER_BADNESS, NULL,
+                    _("Location header not set on redirect response"));
+        }
+      else if (svn_path_is_url(opt_ctx->handler->location))
+        {
+          *corrected_url = svn_uri_canonicalize(opt_ctx->handler->location,
+                                                result_pool);
+        }
+      else
+        {
+          /* RFC1945 and RFC2616 state that the Location header's value
+             (from whence this CORRECTED_URL comes), if present, must be an
+             absolute URI.  But some Apache versions (those older than 2.2.11,
+             it seems) transmit only the path portion of the URI.
+             See issue #3775 for details. */
+
+          apr_uri_t corrected_URI = serf_sess->session_url;
+
+          corrected_URI.path = (char *)corrected_url;
+          *corrected_url = svn_uri_canonicalize(
+                              apr_uri_unparse(scratch_pool, &corrected_URI, 0),
+                              result_pool);
+        }
+
       return SVN_NO_ERROR;
     }
+  else if (opt_ctx->handler->sline.code >= 300
+           && opt_ctx->handler->sline.code < 399)
+    {
+      return svn_error_createf(SVN_ERR_RA_SESSION_URL_MISMATCH, NULL,
+                               (opt_ctx->handler->sline.code == 301
+                                ? _("Repository moved permanently to '%s'")
+                                : _("Repository moved temporarily to '%s'")),
+                              opt_ctx->handler->location);
+    }
 
   if (opt_ctx->handler->sline.code != 200)
     return svn_error_trace(svn_ra_serf__unexpected_status(opt_ctx->handler));

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/ra_serf.h?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/ra_serf.h Fri Jan 30 01:16:23 2015
@@ -431,10 +431,13 @@ typedef struct svn_ra_serf__handler_t {
      for request. */
   svn_boolean_t no_dav_headers;
 
-  /* If TRUE doesn't end the context directly on certain HTTP errors like 405,
-     408, 500 (see util.c handle_response()) */
+  /* If TRUE doesn't fail requests on HTTP error statuses like 405, 408, 500
+     (see util.c response_done()) */
   svn_boolean_t no_fail_on_http_failure_status;
 
+  /* If TRUE doesn't fail requests on HTTP redirect statuses like 301, 307 */
+  svn_boolean_t no_fail_on_http_redirect_status;
+
   /* Has the request/response been completed?  */
   svn_boolean_t done;
   svn_boolean_t scheduled; /* Is the request scheduled in a context */

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/util.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/util.c Fri Jan 30 01:16:23 2015
@@ -1751,10 +1751,9 @@ svn_ra_serf__error_on_status(serf_status
       case 308:
         return svn_error_createf(SVN_ERR_RA_DAV_RELOCATED, NULL,
                                  (sline.code == 301)
-                                 ? _("Repository moved permanently to '%s';"
-                                     " please relocate")
-                                 : _("Repository moved temporarily to '%s';"
-                                     " please relocate"), location);
+                                  ? _("Repository moved permanently to '%s'")
+                                  : _("Repository moved temporarily to '%s'"),
+                                 location);
       case 403:
         return svn_error_createf(SVN_ERR_RA_DAV_FORBIDDEN, NULL,
                                  _("Access to '%s' forbidden"), path);
@@ -1853,9 +1852,13 @@ response_done(serf_request_t *request,
   if (handler->server_error)
     return svn_ra_serf__server_error_create(handler, scratch_pool);
 
-  if ((handler->sline.code >= 400 || handler->sline.code <= 199)
-      && !handler->session->pending_error
-      && !handler->no_fail_on_http_failure_status)
+  if (handler->sline.code >= 400 || handler->sline.code <= 199)
+    {
+      return svn_error_trace(svn_ra_serf__unexpected_status(handler));
+    }
+
+  if ((handler->sline.code >= 300 && handler->sline.code < 399)
+      && !handler->no_fail_on_http_redirect_status)
     {
       return svn_error_trace(svn_ra_serf__unexpected_status(handler));
     }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_subr/sysinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_subr/sysinfo.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_subr/sysinfo.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_subr/sysinfo.c Fri Jan 30 01:16:23 2015
@@ -410,6 +410,63 @@ lsb_release(apr_pool_t *pool)
   return NULL;
 }
 
+/* Read /etc/os-release, as documented here:
+ * http://www.freedesktop.org/software/systemd/man/os-release.html
+ */
+static const char *
+systemd_release(apr_pool_t *pool)
+{
+  svn_error_t *err;
+  svn_stream_t *stream;
+
+  /* Open the file. */
+  err = svn_stream_open_readonly(&stream, "/etc/os-release", pool, pool);
+  if (err && APR_STATUS_IS_ENOENT(err->apr_err))
+    {
+      svn_error_clear(err);
+      err = svn_stream_open_readonly(&stream, "/usr/lib/os-release", pool,
+                                     pool);
+    }
+  if (err)
+    {
+      svn_error_clear(err);
+      return NULL;
+    }
+
+  /* Look for the PRETTY_NAME line. */
+  while (TRUE)
+    {
+      svn_stringbuf_t *line;
+      svn_boolean_t eof;
+
+      err = svn_stream_readline(stream, &line, "\n", &eof, pool);
+      if (err)
+        {
+          svn_error_clear(err);
+          return NULL;
+        }
+
+      if (!strncmp(line->data, "PRETTY_NAME=", 12))
+        {
+          svn_stringbuf_t *release_name;
+          
+          /* The value may or may not be enclosed by double quotes.  We don't
+           * attempt to strip them. */
+          release_name = svn_stringbuf_create(line->data + 12, pool);
+          svn_error_clear(svn_stream_close(stream));
+          svn_stringbuf_strip_whitespace(release_name);
+          return release_name->data;
+        }
+
+      if (eof)
+        break;
+    }
+
+  /* The file did not contain a PRETTY_NAME line. */
+  svn_error_clear(svn_stream_close(stream));
+  return NULL;
+}
+
 /* Read the whole contents of a file. */
 static svn_stringbuf_t *
 read_file_contents(const char *filename, apr_pool_t *pool)
@@ -527,6 +584,10 @@ linux_release_name(apr_pool_t *pool)
      Covers, for example, Debian, Ubuntu and SuSE.  */
   const char *release_name = lsb_release(pool);
 
+  /* Try the systemd way (covers Arch). */
+  if (!release_name)
+    release_name = systemd_release(pool);
+
   /* Try RHEL/Fedora/CentOS */
   if (!release_name)
     release_name = redhat_release(pool);

Modified: subversion/branches/svn-auth-x509/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/mod_dav_svn/repos.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/svn-auth-x509/subversion/mod_dav_svn/repos.c Fri Jan 30 01:16:23 2015
@@ -1035,6 +1035,28 @@ prep_working(dav_resource_combined *comb
   comb->res.exists = (kind != svn_node_none);
   comb->res.collection = (kind == svn_node_dir);
 
+  if (comb->res.exists
+      && comb->priv.r->method_number == M_MKCOL
+      && comb->priv.repos->is_svn_client)
+    {
+      /* mod_dav will now continue returning a generic HTTP_METHOD_NOT_ALLOWED
+         error, which doesn't produce nice output on SVN, nor gives any details
+         on why the operation failed.
+
+         Let's error out a bit earlier and produce an error message that is
+         easier to understand for both clients and users. */
+
+      /* It would be nice if we could error out a bit later (see issue #2295),
+         like in create_collection(), but mod_dav outsmarts us by just
+         returning the error when the node exists. */
+
+      return dav_svn__convert_err(
+                  svn_error_createf(SVN_ERR_FS_ALREADY_EXISTS, NULL,
+                                    "Path already exists, path '%s'",
+                                    comb->priv.repos_path),
+                  HTTP_METHOD_NOT_ALLOWED, NULL, pool);
+    }
+
   return NULL;
 }
 

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/blame_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/blame_tests.py?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/blame_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/blame_tests.py Fri Jan 30 01:16:23 2015
@@ -819,53 +819,33 @@ def blame_multiple_targets(sbox):
   sbox.build()
 
   # First, make a new revision of iota.
-  iota = os.path.join(sbox.wc_dir, 'iota')
-  svntest.main.file_append(iota, "New contents for iota\n")
-  svntest.main.run_svn(None, 'ci', '-m', '', iota)
+  sbox.simple_append('iota', "New contents for iota\n")
+  sbox.simple_commit()
+  iota = sbox.ospath('iota')
 
   expected_output = [
     "     1    jrandom This is the file 'iota'.\n",
     "     2    jrandom New contents for iota\n",
     ]
 
-  def multiple_wc_targets():
-    "multiple wc targets"
+  # We use --force to avoid an early bail from the current blame code,
+  # that performs a property check before the actual blame.
 
-    non_existent = os.path.join(sbox.wc_dir, 'non-existent')
+  non_existent = os.path.join(sbox.wc_dir, 'non-existent')
+  svntest.actions.run_and_verify_svn(None, None,
+                                     ".*W155010: The node.*non-existent'.*",
+                                     'blame', non_existent, iota,
+                                     '--force')
+
+  iota_url = sbox.repo_url + '/iota'
+  non_existent_url = sbox.repo_url + '/non-existent'
+
+  # SVN_ERR_FS_NOT_FILE | SVN_ERR_FS_NOT_FOUND
+  svntest.actions.run_and_verify_svn(None, None,
+                                     ".*W1600(13|17): '.*non-existent' .*not",
+                                     'blame', non_existent_url, iota_url,
+                                     '--force')
 
-    expected_err = ".*W155010.*\n.*E200009.*"
-    expected_err_re = re.compile(expected_err, re.DOTALL)
-
-    exit_code, output, error = svntest.main.run_svn(1, 'blame',
-                                                    non_existent, iota)
-
-    # Verify error
-    if not expected_err_re.match("".join(error)):
-      raise svntest.Failure('blame failed: expected error "%s", but received '
-                            '"%s"' % (expected_err, "".join(error)))
-    svntest.verify.verify_outputs(None, output, None, expected_output, None)
-
-  def multiple_url_targets():
-    "multiple url targets"
-
-    iota_url = sbox.repo_url + '/iota'
-    non_existent = sbox.repo_url + '/non-existent'
-
-    expected_err = ".*(W160017|W160013|W150000).*\n.*E200009.*"
-    expected_err_re = re.compile(expected_err, re.DOTALL)
-
-    exit_code, output, error = svntest.main.run_svn(1, 'blame',
-                                                    non_existent, iota_url)
-
-    # Verify error
-    if not expected_err_re.match("".join(error)):
-      raise svntest.Failure('blame failed: expected error "%s", but received '
-                            '"%s"' % (expected_err, "".join(error)))
-    svntest.verify.verify_outputs(None, output, None, expected_output, None)
-
-  # Test one by one
-  multiple_wc_targets()
-  multiple_url_targets()
 
 @Issue(4034)
 def blame_eol_handling(sbox):

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/commit_tests.py?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/commit_tests.py Fri Jan 30 01:16:23 2015
@@ -3123,6 +3123,18 @@ def commit_mergeinfo_ood(sbox):
   svntest.actions.run_and_verify_svn(None, None, expected_err,
                                      'commit', sbox.ospath(''), '-m', 'M')
 
+@Issue(2295)
+def mkdir_conflict_proper_error(sbox):
+  "mkdir conflict should produce a proper error"
+
+  sbox.build(create_wc=False)
+  repo_url = sbox.repo_url
+
+  expected_error = "svn: E160020: .* already exists.*'/A'"
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
+                                     'mkdir', repo_url + '/A',
+                                     '-m', '')
+
 ########################################################################
 # Run the tests
 
@@ -3198,6 +3210,7 @@ test_list = [ None,
               commit_cp_with_deep_delete,
               commit_deep_deleted,
               commit_mergeinfo_ood,
+              mkdir_conflict_proper_error,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/svn-auth-x509/subversion/tests/cmdline/redirect_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/cmdline/redirect_tests.py?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/cmdline/redirect_tests.py (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/cmdline/redirect_tests.py Fri Jan 30 01:16:23 2015
@@ -205,6 +205,42 @@ def redirected_externals(sbox):
   verify_url(sbox.ospath('A/C/dirX'), sbox.repo_url + '/A/B/F')
 
 #----------------------------------------------------------------------
+@SkipUnless(svntest.main.is_ra_type_dav)
+def redirected_copy(sbox):
+  "redirected copy"
+
+  sbox.build(create_wc=False)
+
+  # E170011 = SVN_ERR_RA_SESSION_URL_MISMATCH
+  expected_error = "svn: E170011: Repository moved permanently"
+
+  # This tests the actual copy handling
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
+                                     'cp', '-m', 'failed copy',
+                                     sbox.redirected_root_url() + '/A',
+                                     sbox.redirected_root_url() + '/A_copied')
+
+  # This tests the cmdline handling of '^/copy-of-A'
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
+                                     'cp', '-m', 'failed copy',
+                                     sbox.redirected_root_url() + '/A',
+                                     '^/copy-of-A')
+
+  # E170011 = SVN_ERR_RA_SESSION_URL_MISMATCH
+  expected_error = "svn: E170011: Repository moved temporarily"
+
+  # This tests the actual copy handling
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
+                                     'cp', '-m', 'failed copy',
+                                     sbox.redirected_root_url(temporary=True) + '/A',
+                                     sbox.redirected_root_url(temporary=True) + '/A_copied')
+
+  # This tests the cmdline handling of '^/copy-of-A'
+  svntest.actions.run_and_verify_svn(None, None, expected_error,
+                                     'cp', '-m', 'failed copy',
+                                     sbox.redirected_root_url(temporary=True) + '/A',
+                                     '^/copy-of-A')
+#----------------------------------------------------------------------
 
 ########################################################################
 # Run the tests
@@ -216,6 +252,7 @@ test_list = [ None,
               redirected_update,
               redirected_nonroot_update,
               redirected_externals,
+              redirected_copy,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/svn-auth-x509/subversion/tests/libsvn_fs/fs-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/tests/libsvn_fs/fs-test.c?rev=1655900&r1=1655899&r2=1655900&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/tests/libsvn_fs/fs-test.c (original)
+++ subversion/branches/svn-auth-x509/subversion/tests/libsvn_fs/fs-test.c Fri Jan 30 01:16:23 2015
@@ -6696,6 +6696,56 @@ test_modify_txn_being_written(const svn_
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+test_prop_and_text_rep_sharing_collision(const svn_test_opts_t *opts,
+                                         apr_pool_t *pool)
+{
+  /* Regression test for issue 4554: Wrong file length with PLAIN
+   * representations in FSFS. */
+  svn_fs_t *fs;
+  svn_fs_txn_t *txn;
+  svn_fs_root_t *txn_root;
+  svn_fs_root_t *rev_root;
+  svn_revnum_t new_rev;
+  svn_filesize_t length;
+  const char *testdir = "test-prop-and-text-rep-sharing-collision";
+
+  /* Create a new repo. */
+  SVN_ERR(svn_test__create_fs(&fs, testdir, opts, pool));
+
+  SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, pool));
+  SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+  /* Set node property for the root. */
+  SVN_ERR(svn_fs_change_node_prop(txn_root, "/", "prop",
+                                  svn_string_create("value", pool),
+                                  pool));
+
+  /* Commit revision r1. */
+  SVN_ERR(test_commit_txn(&new_rev, txn, NULL, pool));
+
+  SVN_ERR(svn_fs_begin_txn(&txn, fs, 1, pool));
+  SVN_ERR(svn_fs_txn_root(&txn_root, txn, pool));
+
+  /* Create file with same contents as property representation. */
+  SVN_ERR(svn_fs_make_file(txn_root, "/foo", pool));
+  SVN_ERR(svn_test__set_file_contents(txn_root, "/foo",
+                                      "K 4\n"
+                                      "prop\n"
+                                      "V 5\n"
+                                      "value\n"
+                                      "END\n", pool));
+
+  /* Commit revision r2. */
+  SVN_ERR(test_commit_txn(&new_rev, txn, NULL, pool));
+
+  /* Check that FS reports correct length for the file (23). */
+  SVN_ERR(svn_fs_revision_root(&rev_root, fs, 2, pool));
+  SVN_ERR(svn_fs_file_length(&length, rev_root, "/foo", pool));
+
+  SVN_TEST_ASSERT(length == 23);
+  return SVN_NO_ERROR; 
+}
+
 /* ------------------------------------------------------------------------ */
 
 /* The test table.  */
@@ -6825,6 +6875,8 @@ static struct svn_test_descriptor_t test
                        "test pool lifetime dependencies with txn roots"),
     SVN_TEST_OPTS_PASS(test_modify_txn_being_written,
                        "test modify txn being written in FSFS"),
+    SVN_TEST_OPTS_PASS(test_prop_and_text_rep_sharing_collision,
+                       "test property and text rep-sharing collision"),
     SVN_TEST_NULL
   };