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 2015/01/29 14:50:30 UTC

svn commit: r1655662 - in /subversion/branches/pin-externals: ./ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/tests/org/apache/subversion/javahl/ subversion/bindings/swig/ su...

Author: stsp
Date: Thu Jan 29 13:50:29 2015
New Revision: 1655662

URL: http://svn.apache.org/r1655662
Log:
On the pin-externals branch, merge outstanding changes from trunk.

Modified:
    subversion/branches/pin-externals/   (props changed)
    subversion/branches/pin-externals/subversion/bindings/javahl/native/DiffOptions.cpp
    subversion/branches/pin-externals/subversion/bindings/javahl/native/DiffOptions.h
    subversion/branches/pin-externals/subversion/bindings/javahl/native/SVNClient.cpp
    subversion/branches/pin-externals/subversion/bindings/javahl/native/SVNClient.h
    subversion/branches/pin-externals/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
    subversion/branches/pin-externals/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
    subversion/branches/pin-externals/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
    subversion/branches/pin-externals/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
    subversion/branches/pin-externals/subversion/bindings/swig/core.i
    subversion/branches/pin-externals/subversion/include/svn_client.h
    subversion/branches/pin-externals/subversion/include/svn_diff.h
    subversion/branches/pin-externals/subversion/libsvn_client/copy.c
    subversion/branches/pin-externals/subversion/libsvn_client/mtcc.c
    subversion/branches/pin-externals/subversion/libsvn_client/prop_commands.c
    subversion/branches/pin-externals/subversion/libsvn_fs_fs/dag.c
    subversion/branches/pin-externals/subversion/libsvn_fs_fs/dag.h
    subversion/branches/pin-externals/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/pin-externals/subversion/libsvn_fs_fs/tree.c
    subversion/branches/pin-externals/subversion/libsvn_ra/ra_loader.c
    subversion/branches/pin-externals/subversion/libsvn_ra_serf/options.c
    subversion/branches/pin-externals/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/pin-externals/subversion/libsvn_ra_serf/util.c
    subversion/branches/pin-externals/subversion/mod_dav_svn/repos.c
    subversion/branches/pin-externals/subversion/tests/cmdline/blame_tests.py
    subversion/branches/pin-externals/subversion/tests/cmdline/commit_tests.py
    subversion/branches/pin-externals/subversion/tests/cmdline/redirect_tests.py

Propchange: subversion/branches/pin-externals/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 29 13:50:29 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:1643755-1655241
+/subversion/trunk:1643755-1655651

Modified: subversion/branches/pin-externals/subversion/bindings/javahl/native/DiffOptions.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/bindings/javahl/native/DiffOptions.cpp?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/bindings/javahl/native/DiffOptions.cpp (original)
+++ subversion/branches/pin-externals/subversion/bindings/javahl/native/DiffOptions.cpp Thu Jan 29 13:50:29 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/pin-externals/subversion/bindings/javahl/native/DiffOptions.h
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/bindings/javahl/native/DiffOptions.h?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/bindings/javahl/native/DiffOptions.h (original)
+++ subversion/branches/pin-externals/subversion/bindings/javahl/native/DiffOptions.h Thu Jan 29 13:50:29 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/pin-externals/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/bindings/javahl/native/SVNClient.cpp?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/pin-externals/subversion/bindings/javahl/native/SVNClient.cpp Thu Jan 29 13:50:29 2015
@@ -1185,7 +1185,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", );
@@ -1199,7 +1199,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/pin-externals/subversion/bindings/javahl/native/SVNClient.h
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/bindings/javahl/native/SVNClient.h?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/bindings/javahl/native/SVNClient.h (original)
+++ subversion/branches/pin-externals/subversion/bindings/javahl/native/SVNClient.h Thu Jan 29 13:50:29 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/pin-externals/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp (original)
+++ subversion/branches/pin-externals/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp Thu Jan 29 13:50:29 2015
@@ -1648,7 +1648,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);
@@ -1673,10 +1674,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/pin-externals/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java (original)
+++ subversion/branches/pin-externals/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java Thu Jan 29 13:50:29 2015
@@ -1338,12 +1338,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/pin-externals/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java (original)
+++ subversion/branches/pin-externals/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java Thu Jan 29 13:50:29 2015
@@ -662,11 +662,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/pin-externals/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/pin-externals/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Thu Jan 29 13:50:29 2015
@@ -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/pin-externals/subversion/bindings/swig/core.i
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/bindings/swig/core.i?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/bindings/swig/core.i (original)
+++ subversion/branches/pin-externals/subversion/bindings/swig/core.i Thu Jan 29 13:50:29 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/pin-externals/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/include/svn_client.h?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/include/svn_client.h (original)
+++ subversion/branches/pin-externals/subversion/include/svn_client.h Thu Jan 29 13:50:29 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/pin-externals/subversion/include/svn_diff.h
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/include/svn_diff.h?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/include/svn_diff.h (original)
+++ subversion/branches/pin-externals/subversion/include/svn_diff.h Thu Jan 29 13:50:29 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/pin-externals/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_client/copy.c?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_client/copy.c Thu Jan 29 13:50:29 2015
@@ -1468,6 +1468,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;
             }
@@ -1481,6 +1482,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;
@@ -1492,6 +1494,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;
             }
@@ -1807,6 +1810,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;
               APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
             }
@@ -1819,6 +1823,7 @@ wc_to_repos_copy(const apr_array_header_
 
           item = svn_client_commit_item3_create(scratch_pool);
           item->url = pair->dst_abspath_or_url;
+          item->kind = pair->src_kind;
           item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;
           APR_ARRAY_PUSH(commit_items, svn_client_commit_item3_t *) = item;
         }
@@ -1865,6 +1870,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 *));

Modified: subversion/branches/pin-externals/subversion/libsvn_client/mtcc.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_client/mtcc.c?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_client/mtcc.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_client/mtcc.c Thu Jan 29 13:50:29 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/pin-externals/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_client/prop_commands.c?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_client/prop_commands.c Thu Jan 29 13:50:29 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,

Modified: subversion/branches/pin-externals/subversion/libsvn_fs_fs/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_fs/dag.c?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_fs/dag.c Thu Jan 29 13:50:29 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/pin-externals/subversion/libsvn_fs_fs/dag.h
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_fs/dag.h?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_fs/dag.h (original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_fs/dag.h Thu Jan 29 13:50:29 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/pin-externals/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_fs/fs_fs.c?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_fs/fs_fs.c Thu Jan 29 13:50:29 2015
@@ -1746,7 +1746,6 @@ svn_fs_fs__create_file_tree(svn_fs_t *fs
                                         pool));
 
   /* Create the 'current' file. */
-  SVN_ERR(svn_io_file_create_empty(svn_fs_fs__path_current(fs, pool), pool));
   SVN_ERR(svn_fs_fs__write_current(fs, 0, 1, 1, pool));
 
   /* Create the 'uuid' file. */

Modified: subversion/branches/pin-externals/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_fs_fs/tree.c?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_fs_fs/tree.c Thu Jan 29 13:50:29 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/pin-externals/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra/ra_loader.c?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra/ra_loader.c Thu Jan 29 13:50:29 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/pin-externals/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/options.c?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/options.c Thu Jan 29 13:50:29 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,43 @@ 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,
+                              _("The repository reports that it was moved "
+                                "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/pin-externals/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/ra_serf.h?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/ra_serf.h Thu Jan 29 13:50:29 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/pin-externals/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_ra_serf/util.c?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_ra_serf/util.c Thu Jan 29 13:50:29 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/pin-externals/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/mod_dav_svn/repos.c?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/pin-externals/subversion/mod_dav_svn/repos.c Thu Jan 29 13:50:29 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/pin-externals/subversion/tests/cmdline/blame_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/tests/cmdline/blame_tests.py?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/tests/cmdline/blame_tests.py (original)
+++ subversion/branches/pin-externals/subversion/tests/cmdline/blame_tests.py Thu Jan 29 13:50:29 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/pin-externals/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/tests/cmdline/commit_tests.py?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/pin-externals/subversion/tests/cmdline/commit_tests.py Thu Jan 29 13:50:29 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/pin-externals/subversion/tests/cmdline/redirect_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/tests/cmdline/redirect_tests.py?rev=1655662&r1=1655661&r2=1655662&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/tests/cmdline/redirect_tests.py (original)
+++ subversion/branches/pin-externals/subversion/tests/cmdline/redirect_tests.py Thu Jan 29 13:50:29 2015
@@ -205,6 +205,28 @@ 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: The repository.*moved"
+
+  # 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')
+
+#----------------------------------------------------------------------
 
 ########################################################################
 # Run the tests
@@ -216,6 +238,7 @@ test_list = [ None,
               redirected_update,
               redirected_nonroot_update,
               redirected_externals,
+              redirected_copy,
              ]
 
 if __name__ == '__main__':