subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1329209 [31/38] - in /subversion/branches/javahl-ra: ./ build/ build/ac-macros/ build/generator/ build/generator/templates/ build/win32/ contrib/client-side/emacs/ contrib/client-side/vim/ contrib/server-side/mod_dontdothat/ notes/ notes/a...
Date Mon, 23 Apr 2012 12:33:03 GMT
Modified: subversion/branches/javahl-ra/subversion/svnsync/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svnsync/main.c?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svnsync/main.c (original)
+++ subversion/branches/javahl-ra/subversion/svnsync/main.c Mon Apr 23 12:32:48 2012
@@ -959,16 +959,21 @@ open_target_session(svn_ra_session_t **t
 typedef struct replay_baton_t {
   svn_ra_session_t *from_session;
   svn_ra_session_t *to_session;
+  /* Extra 'backdoor' session for fetching data *from* the target repo. */
+  svn_ra_session_t *extra_to_session;
+  svn_revnum_t current_revision;
   subcommand_baton_t *sb;
   svn_boolean_t has_commit_revprops_capability;
   int normalized_rev_props_count;
   int normalized_node_props_count;
+  const char *to_root;
 } replay_baton_t;
 
 /* Return a replay baton allocated from POOL and populated with
    data from the provided parameters. */
-static replay_baton_t *
-make_replay_baton(svn_ra_session_t *from_session,
+static svn_error_t *
+make_replay_baton(replay_baton_t **baton_p,
+                  svn_ra_session_t *from_session,
                   svn_ra_session_t *to_session,
                   subcommand_baton_t *sb, apr_pool_t *pool)
 {
@@ -976,7 +981,16 @@ make_replay_baton(svn_ra_session_t *from
   rb->from_session = from_session;
   rb->to_session = to_session;
   rb->sb = sb;
-  return rb;
+
+  SVN_ERR(svn_ra_get_repos_root2(to_session, &rb->to_root, pool));
+
+#ifdef ENABLE_EV2_SHIMS
+  /* Open up the extra baton.  Only needed for Ev2 shims. */
+  SVN_ERR(open_target_session(&rb->extra_to_session, sb, pool));
+#endif
+
+  *baton_p = rb;
+  return SVN_NO_ERROR;
 }
 
 /* Return TRUE iff KEY is the name of an svn:date or svn:author or any svnsync
@@ -1030,6 +1044,137 @@ filter_include_log(const char *key)
 }
 
 
+static svn_error_t *
+fetch_base_func(const char **filename,
+                void *baton,
+                const char *path,
+                svn_revnum_t base_revision,
+                apr_pool_t *result_pool,
+                apr_pool_t *scratch_pool)
+{
+  struct replay_baton_t *rb = baton;
+  svn_stream_t *fstream;
+  svn_error_t *err;
+
+  if (svn_path_is_url(path))
+    path = svn_uri_skip_ancestor(rb->to_root, path, scratch_pool);
+  else if (path[0] == '/')
+    path += 1;
+
+  if (! SVN_IS_VALID_REVNUM(base_revision))
+    base_revision = rb->current_revision - 1;
+
+  SVN_ERR(svn_stream_open_unique(&fstream, filename, NULL,
+                                 svn_io_file_del_on_pool_cleanup,
+                                 result_pool, scratch_pool));
+
+  err = svn_ra_get_file(rb->extra_to_session, path, base_revision,
+                        fstream, NULL, NULL, scratch_pool);
+  if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
+    {
+      svn_error_clear(err);
+      SVN_ERR(svn_stream_close(fstream));
+
+      *filename = NULL;
+      return SVN_NO_ERROR;
+    }
+  else if (err)
+    return svn_error_trace(err);
+
+  SVN_ERR(svn_stream_close(fstream));
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+fetch_props_func(apr_hash_t **props,
+                 void *baton,
+                 const char *path,
+                 svn_revnum_t base_revision,
+                 apr_pool_t *result_pool,
+                 apr_pool_t *scratch_pool)
+{
+  struct replay_baton_t *rb = baton;
+  svn_node_kind_t node_kind;
+
+  if (svn_path_is_url(path))
+    path = svn_uri_skip_ancestor(rb->to_root, path, scratch_pool);
+  else if (path[0] == '/')
+    path += 1;
+
+  if (! SVN_IS_VALID_REVNUM(base_revision))
+    base_revision = rb->current_revision - 1;
+
+  SVN_ERR(svn_ra_check_path(rb->extra_to_session, path, base_revision,
+                            &node_kind, scratch_pool));
+
+  if (node_kind == svn_node_file)
+    {
+      SVN_ERR(svn_ra_get_file(rb->extra_to_session, path, base_revision,
+                              NULL, NULL, props, result_pool));
+    }
+  else if (node_kind == svn_node_dir)
+    {
+      apr_array_header_t *tmp_props;
+
+      SVN_ERR(svn_ra_get_dir2(rb->extra_to_session, NULL, NULL, props, path,
+                              base_revision, 0 /* Dirent fields */,
+                              result_pool));
+      tmp_props = svn_prop_hash_to_array(*props, result_pool);
+      SVN_ERR(svn_categorize_props(tmp_props, NULL, NULL, &tmp_props,
+                                   result_pool));
+      *props = svn_prop_array_to_hash(tmp_props, result_pool);
+    }
+  else
+    {
+      *props = apr_hash_make(result_pool);
+    }
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+fetch_kind_func(svn_kind_t *kind,
+                void *baton,
+                const char *path,
+                svn_revnum_t base_revision,
+                apr_pool_t *scratch_pool)
+{
+  struct replay_baton_t *rb = baton;
+  svn_node_kind_t node_kind;
+
+  if (svn_path_is_url(path))
+    path = svn_uri_skip_ancestor(rb->to_root, path, scratch_pool);
+  else if (path[0] == '/')
+    path += 1;
+
+  if (! SVN_IS_VALID_REVNUM(base_revision))
+    base_revision = rb->current_revision - 1;
+
+  SVN_ERR(svn_ra_check_path(rb->extra_to_session, path, base_revision,
+                            &node_kind, scratch_pool));
+
+  *kind = svn__kind_from_node_kind(node_kind, FALSE);
+  return SVN_NO_ERROR;
+}
+
+
+static svn_delta_shim_callbacks_t *
+get_shim_callbacks(replay_baton_t *rb,
+                   apr_pool_t *result_pool)
+{
+  svn_delta_shim_callbacks_t *callbacks =
+                            svn_delta_shim_callbacks_default(result_pool);
+
+  callbacks->fetch_props_func = fetch_props_func;
+  callbacks->fetch_kind_func = fetch_kind_func;
+  callbacks->fetch_base_func = fetch_base_func;
+  callbacks->fetch_baton = rb;
+
+  return callbacks;
+}
+
+
 /* Callback function for svn_ra_replay_range, invoked when starting to parse
  * a replay report.
  */
@@ -1051,8 +1196,6 @@ replay_rev_started(svn_revnum_t revision
   apr_hash_t *filtered;
   int filtered_count;
   int normalized_count;
-  svn_delta_shim_callbacks_t *shim_callbacks =
-                                    svn_delta_shim_callbacks_default(pool);
 
   /* We set this property so that if we error out for some reason
      we can later determine where we were in the process of
@@ -1098,6 +1241,8 @@ replay_rev_started(svn_revnum_t revision
                                      rb->sb->source_prop_encoding, pool));
   rb->normalized_rev_props_count += normalized_count;
 
+  SVN_ERR(svn_ra__register_editor_shim_callbacks(rb->to_session,
+                                get_shim_callbacks(rb, pool)));
   SVN_ERR(svn_ra_get_commit_editor3(rb->to_session, &commit_editor,
                                     &commit_baton,
                                     filtered,
@@ -1120,9 +1265,7 @@ replay_rev_started(svn_revnum_t revision
   *editor = cancel_editor;
   *edit_baton = cancel_baton;
 
-  SVN_ERR(svn_editor__insert_shims(editor, edit_baton, *editor, *edit_baton,
-                                   shim_callbacks, pool, pool));
-
+  rb->current_revision = revision;
   return SVN_NO_ERROR;
 }
 
@@ -1316,7 +1459,7 @@ do_synchronize(svn_ra_session_t *to_sess
 
   /* Ok, so there are new revisions, iterate over them copying them
      into the destination repository. */
-  rb = make_replay_baton(from_session, to_session, baton, pool);
+  SVN_ERR(make_replay_baton(&rb, from_session, to_session, baton, pool));
 
   /* For compatibility with older svnserve versions, check first if we
      support adding revprops to the commit. */
@@ -1745,7 +1888,6 @@ main(int argc, const char *argv[])
   const char *password = NULL, *source_password = NULL, *sync_password = NULL;
   apr_array_header_t *config_options = NULL;
   const char *source_prop_encoding = NULL;
-  apr_allocator_t *allocator;
 
   if (svn_cmdline_init("svnsync", stderr) != EXIT_SUCCESS)
     {
@@ -1759,13 +1901,7 @@ main(int argc, const char *argv[])
   /* Create our top-level pool.  Use a separate mutexless allocator,
    * given this application is single threaded.
    */
-  if (apr_allocator_create(&allocator))
-    return EXIT_FAILURE;
-
-  apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-
-  pool = svn_pool_create_ex(NULL, allocator);
-  apr_allocator_owner_set(allocator, pool);
+  pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
 
   err = svn_ra_initialize(pool);
   if (err)

Modified: subversion/branches/javahl-ra/subversion/svnsync/sync.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svnsync/sync.c?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svnsync/sync.c (original)
+++ subversion/branches/javahl-ra/subversion/svnsync/sync.c Mon Apr 23 12:32:48 2012
@@ -33,9 +33,6 @@
 #include "svn_subst.h"
 #include "svn_string.h"
 
-#include "private/svn_opt_private.h"
-#include "private/svn_cmdline_private.h"
-
 #include "sync.h"
 
 #include "svn_private_config.h"
@@ -389,7 +386,7 @@ change_file_prop(void *file_baton,
   edit_baton_t *eb = fb->edit_baton;
 
   /* only regular properties can pass over libsvn_ra */
-  if (svn_property_kind(NULL, name) != svn_prop_regular_kind)
+  if (svn_property_kind2(name) != svn_prop_regular_kind)
     return SVN_NO_ERROR;
 
   /* Maybe drop svn:mergeinfo.  */
@@ -437,7 +434,7 @@ change_dir_prop(void *dir_baton,
   edit_baton_t *eb = db->edit_baton;
 
   /* Only regular properties can pass over libsvn_ra */
-  if (svn_property_kind(NULL, name) != svn_prop_regular_kind)
+  if (svn_property_kind2(name) != svn_prop_regular_kind)
     return SVN_NO_ERROR;
 
   /* Maybe drop svn:mergeinfo.  */

Modified: subversion/branches/javahl-ra/subversion/svnversion/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/svnversion/main.c?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/svnversion/main.c (original)
+++ subversion/branches/javahl-ra/subversion/svnversion/main.c Mon Apr 23 12:32:48 2012
@@ -122,7 +122,6 @@ main(int argc, const char *argv[])
 {
   const char *wc_path, *trail_url;
   const char *local_abspath;
-  apr_allocator_t *allocator;
   apr_pool_t *pool;
   svn_wc_revision_status_t *res;
   svn_boolean_t no_newline = FALSE, committed = FALSE;
@@ -150,13 +149,7 @@ main(int argc, const char *argv[])
   /* Create our top-level pool.  Use a separate mutexless allocator,
    * given this application is single threaded.
    */
-  if (apr_allocator_create(&allocator))
-    return EXIT_FAILURE;
-
-  apr_allocator_max_free_set(allocator, SVN_ALLOCATOR_RECOMMENDED_MAX_FREE);
-
-  pool = svn_pool_create_ex(NULL, allocator);
-  apr_allocator_owner_set(allocator, pool);
+  pool = apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
 
   /* Check library versions */
   err = check_lib_versions();
@@ -225,7 +218,7 @@ main(int argc, const char *argv[])
     }
 
   SVN_INT_ERR(svn_utf_cstring_to_utf8(&wc_path,
-                                      (os->ind < argc) ? os->argv[os->ind] 
+                                      (os->ind < argc) ? os->argv[os->ind]
                                                        : ".",
                                       pool));
 

Modified: subversion/branches/javahl-ra/subversion/tests/README
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/README?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/README (original)
+++ subversion/branches/javahl-ra/subversion/tests/README Mon Apr 23 12:32:48 2012
@@ -130,6 +130,47 @@ This same rule applies to Subversion dev
 bug, write a test for it. **
 
 
+When to file a related issue
+----------------------------
+
+By definition, if you write a new test which is set to XFail, then it
+assumed that the test is for a known bug.  In these cases it is
+recommended that you associate an issue in the issue tracker with the
+XFailing test.  This ensures that the issue tracker is the authoritative
+list of known bugs -- see http://subversion.tigris.org/issue-tracker.html.
+You may need to create a new issue if one doesn't already exist.
+
+For C tests simply add a comment noting any associated issue:
+
+    /* This is for issue #3234. */
+    static svn_error_t *
+    test_copy_crash(const svn_test_opts_t *opts,
+                    apr_pool_t *pool)
+    {
+      apr_array_header_t *sources;
+      svn_opt_revision_t rev;
+      .
+      .
+
+For Python tests use the @Issue() decorator (a summary comment of the
+issue never hurts either):
+
+    #---------------------------------------------------------------------
+    # Test for issue #3657 'dav update report handler in skelta mode can
+    # cause spurious conflicts'.
+    @Issue(3657)
+    @XFail()
+    def dav_skelta_mode_causes_spurious_conflicts(sbox):
+      "dav skelta mode can cause spurious conflicts"
+      .
+      .
+
+Of course it isn't *always* necessary to create an associated issue.
+If a the fix for an new XFailing test is imminent, you are probably
+better off simply fixing the bug and moving on.  Use common sense, but
+when in doubt associate a new issue.
+
+
 What not to test
 ----------------
 

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/README
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/README?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/README (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/README Mon Apr 23 12:32:48 2012
@@ -12,7 +12,7 @@ command-line client.  It has no access t
 looks inside the .svn/ directory; it only performs actions that a
 human user would do.
 
-These tests require Python 2.4 or later.
+These tests require Python 2.5 or later.
 
   [ For more general information on Subversion's testing system,
     please read the README in subversion/tests/. ]
@@ -333,7 +333,8 @@ svntest/tree.py.  It will explain the ge
 
 Finally, try copying-and-pasting a simple test and then edit from
 there.  Don't forget to add your test to the 'test_list' variable at
-the bottom of the file.
+the bottom of the file. To avoid renumbering of existing tests, you
+should add new tests to the end of the list.
 
 
 Testing Compatability With Previous Release

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/authz_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/authz_tests.py?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/authz_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/authz_tests.py Mon Apr 23 12:32:48 2012
@@ -1290,7 +1290,8 @@ def wc_commit_error_handling(sbox):
   # Allow the informative error for dav and the ra_svn specific one that is
   # returned on editor->edit_close().
   expected_err = "(svn: E195023: Changing directory '.*Z' is forbidden)|" + \
-                 "(svn: E220004: Access denied)"
+                 "(svn: E220004: Access denied)|" + \
+                 "(svn: E175013: Access to '.*Z' forbidden)"
   svntest.actions.run_and_verify_svn(None, None, expected_err,
                                      'ci', wc_dir, '-m', '')
 
@@ -1302,7 +1303,8 @@ def wc_commit_error_handling(sbox):
   # Allow the informative error for dav and the ra_svn specific one that is
   # returned on editor->edit_close().
   expected_err = "(svn: E195023: Changing file '.*zeta' is forbidden)|" + \
-                 "(svn: E220004: Access denied)"
+                 "(svn: E220004: Access denied)|" + \
+                 "(svn: E175013: Access to '.*zeta' forbidden)"
   svntest.actions.run_and_verify_svn(None, None, expected_err,
                                      'ci', wc_dir, '-m', '')
   sbox.simple_revert('A/zeta')
@@ -1323,7 +1325,8 @@ def wc_commit_error_handling(sbox):
   # Allow the informative error for dav and the ra_svn specific one that is
   # returned on editor->edit_close().
   expected_err = "(svn: E195023: Changing file '.*lambda' is forbidden.*)|" + \
-                 "(svn: E220004: Access denied)"
+                 "(svn: E220004: Access denied)|" + \
+                 "(svn: E175013: Access to '.*lambda' forbidden)"
   svntest.actions.run_and_verify_svn(None, None, expected_err,
                                      'ci', wc_dir, '-m', '')
 
@@ -1333,7 +1336,8 @@ def wc_commit_error_handling(sbox):
   # Allow the informative error for dav and the ra_svn specific one that is
   # returned on editor->edit_close().
   expected_err = "(svn: E195023: Changing file '.*lambda' is forbidden.*)|" + \
-                 "(svn: E220004: Access denied)"
+                 "(svn: E220004: Access denied)|" + \
+                 "(svn: E175013: Access to '.*lambda' forbidden)"
   svntest.actions.run_and_verify_svn(None, None, expected_err,
                                      'ci', wc_dir, '-m', '')
 
@@ -1343,7 +1347,8 @@ def wc_commit_error_handling(sbox):
   # Allow the informative error for dav and the ra_svn specific one that is
   # returned on editor->edit_close().
   expected_err = "(svn: E195023: Changing directory '.*F' is forbidden.*)|" + \
-                 "(svn: E220004: Access denied)"
+                 "(svn: E220004: Access denied)|" + \
+                 "(svn: E175013: Access to '.*F' forbidden)"
   svntest.actions.run_and_verify_svn(None, None, expected_err,
                                      'ci', wc_dir, '-m', '')
   sbox.simple_revert('A/B/F')
@@ -1352,7 +1357,8 @@ def wc_commit_error_handling(sbox):
   # Allow the informative error for dav and the ra_svn specific one that is
   # returned on editor->edit_close().
   expected_err = "(svn: E195023: Changing file '.*mu' is forbidden.*)|" + \
-                 "(svn: E220004: Access denied)"
+                 "(svn: E220004: Access denied)|" + \
+                 "(svn: E175013: Access to '.*mu' forbidden)"
   svntest.actions.run_and_verify_svn(None, None, expected_err,
                                      'ci', wc_dir, '-m', '')
 
@@ -1383,7 +1389,7 @@ def upgrade_absent(sbox):
   # Relocate to allow finding the repository
   svntest.actions.run_and_verify_svn(None, None, [], 'relocate',
                                      'svn://127.0.0.1/authz_tests-2',
-                                     sbox.repo_url, sbox.wc_dir)  
+                                     sbox.repo_url, sbox.wc_dir)
 
   expected_output = svntest.wc.State(sbox.wc_dir, {
   })

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/basic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/basic_tests.py?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/basic_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/basic_tests.py Mon Apr 23 12:32:48 2012
@@ -25,7 +25,9 @@
 ######################################################################
 
 # General modules
-import shutil, stat, re, os
+import shutil, stat, re, os, logging
+
+logger = logging.getLogger()
 
 # Our testing module
 import svntest
@@ -659,8 +661,8 @@ def basic_conflict(sbox):
     # probably reveal the cause for the failure, if they were
     # uncommented:
     #
-    # print("Not all extra reject files have been accounted for:")
-    # print(extra_files)
+    # logger.warn("Not all extra reject files have been accounted for:")
+    # logger.warn(extra_files)
     ### we should raise a less generic error here. which?
     raise svntest.Failure
 
@@ -780,17 +782,17 @@ def basic_revert(sbox):
   fp = open(beta_path, 'r')
   lines = fp.readlines()
   if not ((len (lines) == 1) and (lines[0] == "This is the file 'beta'.\n")):
-    print("Revert failed to restore original text.")
+    logger.warn("Revert failed to restore original text.")
     raise svntest.Failure
   fp = open(iota_path, 'r')
   lines = fp.readlines()
   if not ((len (lines) == 1) and (lines[0] == "This is the file 'iota'.\n")):
-    print("Revert failed to restore original text.")
+    logger.warn("Revert failed to restore original text.")
     raise svntest.Failure
   fp = open(rho_path, 'r')
   lines = fp.readlines()
   if not ((len (lines) == 1) and (lines[0] == "This is the file 'rho'.\n")):
-    print("Revert failed to restore original text.")
+    logger.warn("Revert failed to restore original text.")
     raise svntest.Failure
   fp = open(zeta_path, 'r')
   lines = fp.readlines()
@@ -989,9 +991,9 @@ def verify_file_deleted(message, path):
   except IOError:
     return
   if message is not None:
-    print(message)
+    logger.warn(message)
   ###TODO We should raise a less generic error here. which?
-  raise Failure
+  raise svntest.Failure
 
 def verify_dir_deleted(path):
   if not os.path.isdir(path):
@@ -999,6 +1001,7 @@ def verify_dir_deleted(path):
 
   return 1
 
+@Issue(687,4074)
 def basic_delete(sbox):
   "basic delete command"
 
@@ -1167,11 +1170,11 @@ def basic_delete(sbox):
 
   # check unversioned and added dirs has been removed
   if verify_dir_deleted(Q_path):
-    print("Failed to remove unversioned dir")
+    logger.warn("Failed to remove unversioned dir")
     ### we should raise a less generic error here. which?
     raise svntest.Failure
   if verify_dir_deleted(X_path):
-    print("Failed to remove added dir")
+    logger.warn("Failed to remove added dir")
     ### we should raise a less generic error here. which?
     raise svntest.Failure
 
@@ -1190,6 +1193,12 @@ def basic_delete(sbox):
                                      'rm', '-m', 'delete iota URL',
                                      iota_URL)
 
+  # Issue 4074, deleting a root url SEGV.
+  expected_error = 'svn: E170000: .*not within a repository'
+  svntest.actions.run_and_verify_svn(None, [], expected_error,
+                                     'rm', sbox.repo_url,
+                                     '--message', 'delete root')
+
 #----------------------------------------------------------------------
 
 def basic_checkout_deleted(sbox):
@@ -1666,8 +1675,8 @@ def basic_info(sbox):
       if line.startswith('Path: '):
         paths.append(line[6:].rstrip())
     if paths != expected_paths:
-      print("Reported paths: %s" % paths)
-      print("Expected paths: %s" % expected_paths)
+      logger.warn("Reported paths: %s" % paths)
+      logger.warn("Expected paths: %s" % expected_paths)
       raise svntest.Failure
 
   sbox.build(read_only = True)
@@ -1690,7 +1699,7 @@ def repos_root(sbox):
       if line == "Repository Root: " + sbox.repo_url + "\n":
         break
     else:
-      print("Bad or missing repository root")
+      logger.warn("Bad or missing repository root")
       raise svntest.Failure
 
   sbox.build(read_only = True)
@@ -1913,7 +1922,7 @@ def delete_keep_local_twice(sbox):
   svntest.actions.run_and_verify_svn(None, None, [], 'rm', '--keep-local', dir)
 
   if not os.path.isdir(dir):
-    print('Directory was really deleted')
+    logger.warn('Directory was really deleted')
     raise svntest.Failure
 
 def windows_paths_in_repos(sbox):
@@ -2187,8 +2196,8 @@ def automatic_conflict_resolution(sbox):
     # probably reveal the cause for the failure, if they were
     # uncommented:
     #
-    # print("Not all extra reject files have been accounted for:")
-    # print(extra_files)
+    # logger.warn("Not all extra reject files have been accounted for:")
+    # logger.warn(extra_files)
     ### we should raise a less generic error here. which?
     raise svntest.Failure
 
@@ -2821,6 +2830,123 @@ def add_multiple_targets(sbox):
                                      'status', wc_dir)
 
 
+def quiet_commits(sbox):
+  "commits with --quiet"
+
+  sbox.build()
+
+  svntest.main.file_append(sbox.ospath('A/mu'), 'xxx')
+
+  svntest.actions.run_and_verify_svn(None, [], [],
+                                     'commit', sbox.wc_dir,
+                                     '--message', 'commit', '--quiet')
+
+  svntest.actions.run_and_verify_svn(None, [], [],
+                                     'mkdir', sbox.repo_url + '/X',
+                                     '--message', 'mkdir URL', '--quiet')
+
+  svntest.actions.run_and_verify_svn(None, [], [],
+                                     'import', sbox.ospath('A/mu'),
+                                     sbox.repo_url + '/f',
+                                     '--message', 'import', '--quiet')
+
+  svntest.actions.run_and_verify_svn(None, [], [],
+                                     'rm', sbox.repo_url + '/f',
+                                     '--message', 'rm URL', '--quiet')
+
+  svntest.actions.run_and_verify_svn(None, [], [],
+                                     'copy', sbox.repo_url + '/X',
+                                     sbox.repo_url + '/Y',
+                                     '--message', 'cp URL URL', '--quiet')
+
+  svntest.actions.run_and_verify_svn(None, [], [],
+                                     'move', sbox.repo_url + '/Y',
+                                     sbox.repo_url + '/Z',
+                                     '--message', 'mv URL URL', '--quiet')
+
+  # Not fully testing each command, just that they all commit and
+  # produce no output.
+  expected_output = wc.State(sbox.wc_dir, {
+    'X' : Item(status='A '),
+    'Z' : Item(status='A '),
+    })
+  expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 7)
+  expected_status.add({
+      'X'   : Item(status='  ', wc_rev=7),
+      'Z'   : Item(status='  ', wc_rev=7),
+      })
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.tweak('A/mu',
+                      contents=expected_disk.desc['A/mu'].contents
+                      + 'xxx')
+  expected_disk.add({
+    'X' : Item(),
+    'Z' : Item()
+    })
+  svntest.actions.run_and_verify_update(sbox.wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status)
+
+# Regression test for issue #4023: on Windows, 'svn rm' incorrectly deletes
+# on-disk file if it is case-clashing with intended (non-on-disk) target.
+@Issue(4023)
+@XFail(svntest.main.is_fs_case_insensitive)
+def rm_missing_with_case_clashing_ondisk_item(sbox):
+  """rm missing item with case-clashing ondisk item"""
+
+  sbox.build(read_only = True)
+  wc_dir = sbox.wc_dir
+
+  iota_path = os.path.join(wc_dir, 'iota')
+  IOTA_path = os.path.join(wc_dir, 'IOTA')
+
+  # Out-of-svn move, to make iota missing, while IOTA appears as unversioned.
+  os.rename(iota_path, IOTA_path)
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+    'iota'              : Item(status='! ', wc_rev='1'),
+    'IOTA'              : Item(status='? '),
+    })
+  svntest.actions.run_and_verify_unquiet_status(wc_dir, expected_status)
+
+  # 'svn rm' iota, should leave IOTA alone.
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'rm', iota_path)
+
+  # Test status: the unversioned IOTA should still be there.
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+    'iota'              : Item(status='D ', wc_rev='1'),
+    'IOTA'              : Item(status='? '),
+    })
+  svntest.actions.run_and_verify_unquiet_status(wc_dir, expected_status)
+
+
+def delete_conflicts_one_of_many(sbox):
+  """delete multiple targets one conflict"""
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  svntest.main.file_append(sbox.ospath('A/D/G/rho'), 'new rho')
+  sbox.simple_commit()
+  svntest.main.file_append(sbox.ospath('A/D/G/rho'), 'conflict rho')
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'update', '-r1', '--accept', 'postpone',
+                                     wc_dir)
+
+  if not os.path.exists(sbox.ospath('A/D/G/rho.mine')):
+    raise svntest.Failure("conflict file rho.mine missing")
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'rm', '--force',
+                                     sbox.ospath('A/D/G/rho'),
+                                     sbox.ospath('A/D/G/tau'))
+
+  verify_file_deleted("failed to remove conflict file",
+                      sbox.ospath('A/D/G/rho.mine'))
 
 ########################################################################
 # Run the tests
@@ -2885,6 +3011,9 @@ test_list = [ None,
               ls_url_special_characters,
               ls_multiple_and_non_existent_targets,
               add_multiple_targets,
+              quiet_commits,
+              rm_missing_with_case_clashing_ondisk_item,
+              delete_conflicts_one_of_many,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/checkout_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/checkout_tests.py?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/checkout_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/checkout_tests.py Mon Apr 23 12:32:48 2012
@@ -31,6 +31,7 @@ import sys, re, os, time, subprocess
 # Our testing module
 import svntest
 from svntest import wc, actions
+import logging
 
 # (abbreviation)
 Skip = svntest.testcase.Skip_deco
@@ -41,6 +42,8 @@ Issue = svntest.testcase.Issue_deco
 Wimp = svntest.testcase.Wimp_deco
 Item = wc.StateItem
 
+logger = logging.getLogger()
+
 #----------------------------------------------------------------------
 # Helper function for testing stderr from co.
 # If none of the strings in STDERR list matches the regular expression
@@ -50,10 +53,9 @@ def test_stderr(re_string, stderr):
   for line in stderr:
     if exp_err_re.search(line):
       return
-  if svntest.main.options.verbose:
-    for x in stderr:
-      sys.stdout.write(x)
-    print("Expected stderr reg-ex: '" + re_string + "'")
+  for x in stderr:
+    logger.debug(x[:-1])
+  logger.info("Expected stderr reg-ex: '" + re_string + "'")
   raise svntest.Failure("Checkout failed but not in the expected way")
 
 #----------------------------------------------------------------------

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/commit_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/commit_tests.py?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/commit_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/commit_tests.py Mon Apr 23 12:32:48 2012
@@ -1136,19 +1136,26 @@ def commit_in_dir_scheduled_for_addition
 
   A_path = os.path.join(wc_dir, 'A')
   Z_path = os.path.join(wc_dir, 'Z')
+  Z_abspath = os.path.abspath(Z_path)
   mu_path = os.path.join(wc_dir, 'Z', 'mu')
 
   svntest.main.run_svn(None, 'move', A_path, Z_path)
 
+  # Make sure mu is a committable
+  svntest.main.file_write(mu_path, "xxxx")
+
   # Commit a copied thing inside an added-with-history directory,
   # expecting a specific error to occur!
   svntest.actions.run_and_verify_commit(wc_dir,
                                         None,
                                         None,
-                                        "not under version control",
+                                        "svn: E200009: '" +
+                                        re.escape(Z_abspath) +
+                                        "' is not known to exist in the",
                                         mu_path)
 
   Q_path = os.path.join(wc_dir, 'Q')
+  Q_abspath = os.path.abspath(Q_path)
   bloo_path = os.path.join(Q_path, 'bloo')
 
   os.mkdir(Q_path)
@@ -1160,9 +1167,24 @@ def commit_in_dir_scheduled_for_addition
   svntest.actions.run_and_verify_commit(wc_dir,
                                         None,
                                         None,
-                                        "not under version control",
+                                        "svn: E200009: '" +
+                                        re.escape(Q_abspath) +
+                                        "' is not known to exist in the",
                                         bloo_path)
 
+  R_path = sbox.ospath('Z/B/R')
+  sbox.simple_mkdir('Z/B/R')
+
+  # Commit a d added thing inside an added directory,
+  # expecting a specific error to occur!
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        None,
+                                        None,
+                                        "svn: E200009: '" +
+                                        re.escape(Z_abspath) +
+                                        "' is not known to exist in the.*",
+                                        R_path)
+
 #----------------------------------------------------------------------
 
 # Does this make sense now that deleted files are always removed from the wc?
@@ -2824,7 +2846,37 @@ def commit_incomplete(sbox):
                                         expected_status,
                                         None,
                                         wc_dir)
-  
+
+#----------------------------------------------------------------------
+# Reported here:
+#   Message-ID: <4EBF0FC9.300@gmail.com>
+#   Date: Sun, 13 Nov 2011 13:31:05 +1300
+#   From: Fergus Slorach <sugref@gmail.com>
+#   Subject: svn commit --targets behaviour change in 1.7?
+@Issue(4059)
+def commit_add_subadd(sbox):
+  "committing add with explicit subadd targets"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  targets_file = sbox.ospath('targets') # ### better tempdir?
+  targets_file = os.path.abspath(targets_file)
+
+  # prepare targets file
+  targets = "A/D A/D/H A/D/H/chi A/D/H/omega A/D/H/psi".split()
+  open(targets_file, 'w').write("\n".join(targets))
+
+  # r2: rm A/D
+  sbox.simple_rm('A/D')
+  sbox.simple_commit(message='rm')
+
+  # r3: revert r2, with specific invocation
+  os.chdir(wc_dir)
+  svntest.main.run_svn(None, 'up')
+  svntest.main.run_svn(None, 'merge', '-c', '-2', './')
+  svntest.main.run_svn(None, 'commit', '--targets', targets_file, '-mm')
+
 
 ########################################################################
 # Run the tests
@@ -2894,6 +2946,7 @@ test_list = [ None,
               tree_conflicts_resolved,
               commit_multiple_nested_deletes,
               commit_incomplete,
+              commit_add_subadd,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/copy_tests.py?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/copy_tests.py Mon Apr 23 12:32:48 2012
@@ -25,7 +25,9 @@
 ######################################################################
 
 # General modules
-import stat, os, re, shutil
+import stat, os, re, shutil, logging
+
+logger = logging.getLogger()
 
 # Our testing module
 import svntest
@@ -812,7 +814,7 @@ def copy_preserve_executable_bit(sbox):
   mode2 = os.stat(newpath1)[stat.ST_MODE]
 
   if mode1 == mode2:
-    print("setting svn:executable did not change file's permissions")
+    logger.warn("setting svn:executable did not change file's permissions")
     raise svntest.Failure
 
   # Commit the file
@@ -827,7 +829,7 @@ def copy_preserve_executable_bit(sbox):
 
   # The mode on the original and copied file should be identical
   if mode2 != mode3:
-    print("permissions on the copied file are not identical to original file")
+    logger.warn("permissions on the copied file are not identical to original file")
     raise svntest.Failure
 
 #----------------------------------------------------------------------
@@ -942,13 +944,13 @@ def repos_to_wc(sbox):
   # Modification will only show up if timestamps differ
   exit_code, out, err = svntest.main.run_svn(None, 'diff', pi_path)
   if err or not out:
-    print("diff failed")
+    logger.warn("diff failed")
     raise svntest.Failure
   for line in out:
     if line == '+zig\n': # Crude check for diff-like output
       break
   else:
-    print("diff output incorrect %s" % out)
+    logger.warn("diff output incorrect %s" % out)
     raise svntest.Failure
 
   # Revert everything and verify.
@@ -1367,7 +1369,7 @@ def revision_kinds_local_source(sbox):
       if line.rstrip() == "Copied From Rev: " + str(from_rev):
         break
     else:
-      print("%s should have been copied from revision %s" % (dst, from_rev))
+      logger.warn("%s should have been copied from revision %s" % (dst, from_rev))
       raise svntest.Failure
 
   # Check that the new files have the right contents
@@ -1625,7 +1627,7 @@ def url_to_non_existent_url_path(sbox):
     if re.match (msg, err_line):
       break
   else:
-    print("message \"%s\" not found in error output: %s" % (msg, err))
+    logger.warn("message \"%s\" not found in error output: %s" % (msg, err))
     raise svntest.Failure
 
 
@@ -4654,9 +4656,15 @@ def changed_dir_data_should_match_checko
 
   os.chdir(was_cwd)
   os.chdir(wc_dir)
-  svntest.actions.run_and_verify_svn(None, verify_out, [], 'status', '-v')
+  rv, verify_out2, err = main.run_svn (None, 'status', '-v')
   os.chdir(was_cwd)
 
+  # The order of the status output is not absolutely defined, but
+  # otherwise should match
+  svntest.verify.verify_outputs(None,
+                                sorted(verify_out2), None,
+                                sorted(verify_out), None)
+
 def move_added_nodes(sbox):
   """move added nodes"""
 
@@ -5553,10 +5561,17 @@ def wc_wc_copy_incomplete(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
+  # We don't know what order the copy will do children of A/B so
+  # remove files so that only subdirs remain then all children can be
+  # marked incomplete.
+  sbox.simple_rm('A/B/lambda')
+  sbox.simple_commit()
+  sbox.simple_update()
+
   # We don't know whether copy will do E or F first, so make both
   # incomplete
-  svntest.actions.set_incomplete(sbox.ospath('A/B/E'), 1)
-  svntest.actions.set_incomplete(sbox.ospath('A/B/F'), 1)
+  svntest.actions.set_incomplete(sbox.ospath('A/B/E'), 2)
+  svntest.actions.set_incomplete(sbox.ospath('A/B/F'), 2)
 
   # Copy fails with no changes to wc
   svntest.actions.run_and_verify_svn(None, None,
@@ -5564,7 +5579,8 @@ def wc_wc_copy_incomplete(sbox):
                                      'copy',
                                      sbox.ospath('A/B/E'),
                                      sbox.ospath('A/B/E2'))
-  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 2)
+  expected_status.remove('A/B/lambda')
   expected_status.tweak('A/B/E', 'A/B/F', status='! ')
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
@@ -5579,7 +5595,6 @@ def wc_wc_copy_incomplete(sbox):
       'A/B2'        : Item(status='A ', copied='+', wc_rev='-'),
       'A/B2/E'      : Item(status='! ', wc_rev='-'),
       'A/B2/F'      : Item(status='! ', wc_rev='-'),
-      'A/B2/lambda' : Item(status='  ', copied='+', wc_rev='-'),
       })
   ### Can't get this to work as copied status of E and F in 1.6
   ### entries tree doesn't match 1.7 status tree
@@ -5589,10 +5604,10 @@ def wc_wc_copy_incomplete(sbox):
   expected_output = svntest.wc.State(wc_dir, {
       'A/B2': Item(verb='Adding'),
       })
-  expected_status.tweak('A/B2', 'A/B2/lambda',
-                        status='  ', copied=None, wc_rev=2)
+  expected_status.tweak('A/B2',
+                        status='  ', copied=None, wc_rev=3)
   expected_status.tweak('A/B2/E', 'A/B2/F',
-                        status='! ', copied=None, wc_rev=2)
+                        status='! ', copied=None, wc_rev=3)
   ### E and F are status '!' but the test code ignores them?
   expected_status.remove('A/B2/E', 'A/B2/F')
   svntest.actions.run_and_verify_commit(wc_dir,
@@ -5600,8 +5615,8 @@ def wc_wc_copy_incomplete(sbox):
                                         expected_status,
                                         None, wc_dir)
   expected_status.add({
-      'A/B2/E'       : Item(status='! ', wc_rev=2),
-      'A/B2/F'       : Item(status='! ', wc_rev=2),
+      'A/B2/E'       : Item(status='! ', wc_rev=3),
+      'A/B2/F'       : Item(status='! ', wc_rev=3),
       })
 
   # Update makes things complete
@@ -5611,16 +5626,74 @@ def wc_wc_copy_incomplete(sbox):
       'A/B2/E/beta'  : Item(status='A '),
       'A/B2/F'       : Item(status='A '),
       })
-  expected_status.tweak(wc_rev=2, status='  ')
+  expected_status.tweak(wc_rev=3, status='  ')
   expected_status.add({
-      'A/B2/E/alpha' : Item(status='  ', wc_rev=2),
-      'A/B2/E/beta'  : Item(status='  ', wc_rev=2),
+      'A/B2/E/alpha' : Item(status='  ', wc_rev=3),
+      'A/B2/E/beta'  : Item(status='  ', wc_rev=3),
       })
   svntest.actions.run_and_verify_update(wc_dir,
                                         expected_output,
                                         None,
                                         expected_status)
 
+def three_nested_moves(sbox):
+  "three nested moves"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('A/B'),
+                                     sbox.ospath('A/B2'))
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('A/B2/E'),
+                                     sbox.ospath('A/B2/E2'))
+  svntest.actions.run_and_verify_svn(None, None, [], 'mv',
+                                     sbox.ospath('A/B2/E2/alpha'),
+                                     sbox.ospath('A/B2/E2/alpha2'))
+
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.add({
+      'A/B2'           : Item(status='  ', wc_rev=2),
+      'A/B2/E2'        : Item(status='  ', wc_rev=2),
+      'A/B2/E2/alpha2' : Item(status='  ', wc_rev=2),
+      'A/B2/E2/beta'   : Item(status='  ', wc_rev=2),
+      'A/B2/F'         : Item(status='  ', wc_rev=2),
+      'A/B2/lambda'    : Item(status='  ', wc_rev=2),
+      })
+  expected_status.remove('A/B', 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta',
+                         'A/B/F', 'A/B/lambda')
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B'            : Item(verb='Deleting'),
+    'A/B2'           : Item(verb='Adding'),
+    'A/B2/E'         : Item(verb='Deleting'),
+    'A/B2/E2'        : Item(verb='Adding'),
+    'A/B2/E2/alpha'  : Item(verb='Deleting'),
+    'A/B2/E2/alpha2' : Item(verb='Adding'),
+    })
+
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output,
+                                        expected_status,
+                                        None, wc_dir)
+
+def copy_to_unversioned_parent(sbox):
+  "copy to unversioned parent"
+
+  sbox.build()
+
+  # This succeeds
+  #svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
+  #                                   sbox.ospath('A/B'),
+  #                                   sbox.ospath('New/B2'))
+
+  # And this currently fails with The node '.*Unversioned' was not found,
+  # while it should succeed or returns some error that a GUI client can use.
+  os.mkdir(sbox.ospath('Unversioned'))
+  svntest.actions.run_and_verify_svn(None, None, [], 'cp', '--parents',
+                                     sbox.ospath('A/B'),
+                                     sbox.ospath('Unversioned/B2'))
+
 ########################################################################
 # Run the tests
 
@@ -5734,6 +5807,8 @@ test_list = [ None,
               commit_copied_half_of_move,
               commit_deleted_half_of_move,
               wc_wc_copy_incomplete,
+              three_nested_moves,
+              copy_to_unversioned_parent,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/davautocheck.sh?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/davautocheck.sh Mon Apr 23 12:32:48 2012
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 #
 # Licensed to the Apache Software Foundation (ASF) under one
@@ -71,40 +71,56 @@
 # To use value for "SVNPathAuthz" directive set SVN_PATH_AUTHZ with
 # appropriate value in the environment.
 #
+# To load an MPM module for Apache 2.4 use APACHE_MPM=event in the
+# environment.
+#
 # Passing --no-tests as argv[1] will have the script start a server
 # but not run any tests.
 
+PYTHON=${PYTHON:-python}
+
 SCRIPTDIR=$(dirname $0)
 SCRIPT=$(basename $0)
 
-trap stop_httpd_and_die SIGHUP SIGTERM SIGINT
+trap stop_httpd_and_die HUP TERM INT
 
 # Ensure the server uses a known locale.
 LC_ALL=C
 export LC_ALL
 
-function stop_httpd_and_die() {
+stop_httpd_and_die() {
   [ -e "$HTTPD_PID" ] && kill $(cat "$HTTPD_PID")
   exit 1
 }
 
-function say() {
+say() {
   echo "$SCRIPT: $*"
 }
 
-function fail() {
+fail() {
   say $*
   stop_httpd_and_die
 }
 
-function query() {
-  echo -n "$SCRIPT: $1 (y/n)? [$2] "
-  read -n 1 -t 32
+query() {
+  printf "%s" "$SCRIPT: $1 (y/n)? [$2] "
+  if [ -n "$BASH_VERSION" ]; then
+    read -n 1 -t 32
+  else
+    # 
+    prog=$(cat) <<'EOF'
+import select as s
+import sys
+if s.select([sys.stdin.fileno()], [], [], 32)[0]:
+  sys.stdout.write(sys.stdin.read(1))
+EOF
+    REPLY=`stty cbreak; $PYTHON -c "$prog" "$@"; stty -cbreak`
+  fi
   echo
   [ "${REPLY:-$2}" = 'y' ]
 }
 
-function get_loadmodule_config() {
+get_loadmodule_config() {
   local SO="$($APXS -q LIBEXECDIR)/$1.so"
 
   # shared object module?
@@ -121,7 +137,7 @@ function get_loadmodule_config() {
 }
 
 # Check apxs's SBINDIR and BINDIR for given program names
-function get_prog_name() {
+get_prog_name() {
   for prog in $*
   do
     for dir in $($APXS -q SBINDIR) $($APXS -q BINDIR)
@@ -171,9 +187,7 @@ fi
 
 # Find the source and build directories. The build dir can be found if it is
 # the current working dir or the source dir.
-pushd ${SCRIPTDIR}/../../../ > /dev/null
-ABS_SRCDIR=$(pwd)
-popd > /dev/null
+ABS_SRCDIR=$(cd ${SCRIPTDIR}/../../../; pwd)
 if [ -x subversion/svn/svn ]; then
   ABS_BUILDDIR=$(pwd)
 elif [ -x $ABS_SRCDIR/subversion/svn/svn ]; then
@@ -195,7 +209,8 @@ fi
 [ -r "$MOD_AUTHZ_SVN" ] \
   || fail "authz_svn_module not found, please use '--enable-shared --enable-dso --with-apxs' with your 'configure' script"
 
-export LD_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs:$LD_LIBRARY_PATH"
+LD_LIBRARY_PATH="$ABS_BUILDDIR/subversion/libsvn_ra_neon/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_local/.libs:$ABS_BUILDDIR/subversion/libsvn_ra_svn/.libs:$LD_LIBRARY_PATH"
+export LD_LIBRARY_PATH
 
 case "`uname`" in
   Darwin*) LDD='otool -L'
@@ -255,8 +270,23 @@ LOAD_MOD_AUTHN_FILE="$(get_loadmodule_co
 LOAD_MOD_AUTHZ_USER="$(get_loadmodule_config mod_authz_user)" \
     || fail "Authz_User module not found."
 }
+if [ ${APACHE_MPM:+set} ]; then
+    LOAD_MOD_MPM=$(get_loadmodule_config mod_mpm_$APACHE_MPM) \
+      || fail "MPM module not found"
+fi
+
+random_port() {
+  if [ -n "$BASH_VERSION" ]; then
+    echo $(($RANDOM+1024))
+  else
+    $PYTHON -c 'import random; print random.randint(1024, 2**16-1)'
+  fi
+}
 
-HTTPD_PORT=$(($RANDOM+1024))
+HTTPD_PORT=$(random_port)
+while netstat -an | grep $HTTPD_PORT | grep 'LISTEN'; do
+  HTTPD_PORT=$(random_port)
+done
 HTTPD_ROOT="$ABS_BUILDDIR/subversion/tests/cmdline/httpd-$(date '+%Y%m%d-%H%M%S')"
 HTTPD_CFG="$HTTPD_ROOT/cfg"
 HTTPD_PID="$HTTPD_ROOT/pid"
@@ -278,6 +308,7 @@ $HTPASSWD -b  $HTTPD_USERS jconstant ray
 touch $HTTPD_MIME_TYPES
 
 cat > "$HTTPD_CFG" <<__EOF__
+$LOAD_MOD_MPM
 $LOAD_MOD_LOG_CONFIG
 $LOAD_MOD_MIME
 $LOAD_MOD_ALIAS
@@ -292,9 +323,22 @@ $LOAD_MOD_AUTHZ_USER
 $LOAD_MOD_AUTHZ_HOST
 LoadModule          authz_svn_module "$MOD_AUTHZ_SVN"
 
+__EOF__
+
+if "$HTTPD" -v | grep '/2\.[012]' >/dev/null; then
+  cat >> "$HTTPD_CFG" <<__EOF__
 LockFile            lock
 User                $(id -un)
 Group               $(id -gn)
+__EOF__
+else
+  cat >> "$HTTPD_CFG" <<__EOF__
+# TODO: maybe uncomment this for prefork,worker MPMs only?
+# Mutex file:lock mpm-accept
+__EOF__
+fi
+
+cat >> "$HTTPD_CFG" <<__EOF__
 Listen              $HTTPD_PORT
 ServerName          localhost
 PidFile             "$HTTPD_PID"
@@ -362,6 +406,7 @@ $START &
 sleep 2
 
 say "HTTPD started and listening on '$BASE_URL'..."
+#query "Ready" "y"
 
 # Perform a trivial validation of our httpd configuration by
 # downloading a file and comparing it to the original copy.
@@ -411,12 +456,11 @@ if [ $# = 0 ]; then
   time make check "BASE_URL=$BASE_URL"
   r=$?
 else
-  pushd "$ABS_BUILDDIR/subversion/tests/cmdline/" >/dev/null
+  (cd "$ABS_BUILDDIR/subversion/tests/cmdline/"
   TEST="$1"
   shift
-  time "$ABS_SRCDIR/subversion/tests/cmdline/${TEST}_tests.py" "--url=$BASE_URL" "$@"
+  time "$ABS_SRCDIR/subversion/tests/cmdline/${TEST}_tests.py" "--url=$BASE_URL" "$@")
   r=$?
-  popd >/dev/null
 fi
 
 say "Finished testing..."

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py Mon Apr 23 12:32:48 2012
@@ -1076,7 +1076,8 @@ def diff_in_depthy_wc(sbox):
     "___________________________________________________________________\n",
     "Deleted: foo\n",
     "## -1 +0,0 ##\n",
-    "-foo-val\n"]
+    "-foo-val\n",
+    "\\ No newline at end of property\n"]
 
   os.chdir(wc_empty)
 
@@ -2841,6 +2842,48 @@ def update_below_depth_empty(sbox):
   svntest.actions.run_and_verify_update(sbox.wc_dir, expected_output, None,
                                         None, None)
 
+# Test for issue #4136.
+@Issue(4136)
+def commit_then_immediates_update(sbox):
+  "deep commit followed by update --depth immediates"
+  sbox.build()
+
+  repo_url = sbox.repo_url
+  wc_dir = sbox.wc_dir
+  mu_path = sbox.ospath('A/mu')
+
+  # Modify A/mu and commit the changes.
+  svntest.main.file_write(mu_path, "modified mu\n")
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/mu'        : Item(verb='Sending'),
+    })
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/mu', wc_rev=2, status='  ')
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output,
+                                        expected_status,
+                                        None,
+                                        wc_dir)
+
+  # Now, update --depth immediates in the root of the working copy.
+  expected_output = svntest.wc.State(wc_dir, { })
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.tweak('A/mu', contents="modified mu\n")
+  expected_status = svntest.wc.State(wc_dir, { '' : svntest.wc.StateItem() })
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('',     wc_rev=2, status='  ')
+  expected_status.tweak('A',    wc_rev=2, status='  ')
+  expected_status.tweak('A/mu', wc_rev=2, status='  ')
+  expected_status.tweak('iota', wc_rev=2, status='  ')
+  svntest.actions.run_and_verify_update(wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        None, None, None, None, None, False,
+                                        "--depth=immediates", wc_dir)
+  
+
+
 #----------------------------------------------------------------------
 # list all tests here, starting with None:
 test_list = [ None,
@@ -2888,6 +2931,7 @@ test_list = [ None,
               update_depth_empty_root_of_infinite_children,
               sparse_update_with_dash_dash_parents,
               update_below_depth_empty,
+              commit_then_immediates_update,
               ]
 
 if __name__ == "__main__":

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/diff_tests.py?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/diff_tests.py Mon Apr 23 12:32:48 2012
@@ -26,7 +26,9 @@
 ######################################################################
 
 # General modules
-import sys, re, os, time, shutil
+import sys, re, os, time, shutil, logging
+
+logger = logging.getLogger()
 
 # Our testing module
 import svntest
@@ -45,16 +47,38 @@ Item = svntest.wc.StateItem
 ######################################################################
 # Generate expected output
 
-def make_diff_header(path, old_tag, new_tag):
+def make_diff_header(path, old_tag, new_tag, src_label=None, dst_label=None):
   """Generate the expected diff header for file PATH, with its old and new
-  versions described in parentheses by OLD_TAG and NEW_TAG. Return the header
-  as an array of newline-terminated strings."""
+  versions described in parentheses by OLD_TAG and NEW_TAG. SRC_LABEL and
+  DST_LABEL are paths or urls that are added to the diff labels if we're
+  diffing against the repository or diffing two arbitrary paths.
+  Return the header as an array of newline-terminated strings."""
+  if src_label:
+    src_label = src_label.replace('\\', '/')
+    src_label = '\t(.../' + src_label + ')'
+  else:
+    src_label = ''
+  if dst_label:
+    dst_label = dst_label.replace('\\', '/')
+    dst_label = '\t(.../' + dst_label + ')'
+  else:
+    dst_label = ''
   path_as_shown = path.replace('\\', '/')
   return [
     "Index: " + path_as_shown + "\n",
     "===================================================================\n",
-    "--- " + path_as_shown + "\t(" + old_tag + ")\n",
-    "+++ " + path_as_shown + "\t(" + new_tag + ")\n",
+    "--- " + path_as_shown + src_label + "\t(" + old_tag + ")\n",
+    "+++ " + path_as_shown + dst_label + "\t(" + new_tag + ")\n",
+    ]
+
+def make_no_diff_deleted_header(path, old_tag, new_tag):
+  """Generate the expected diff header for a deleted file PATH when in
+  'no-diff-deleted' mode. (In that mode, no further details appear after the
+  header.) Return the header as an array of newline-terminated strings."""
+  path_as_shown = path.replace('\\', '/')
+  return [
+    "Index: " + path_as_shown + " (deleted)\n",
+    "===================================================================\n",
     ]
 
 def make_git_diff_header(target_path, repos_relpath,
@@ -146,15 +170,20 @@ def make_diff_prop_header(path):
     "___________________________________________________________________\n"
   ]
 
+def make_diff_prop_val(plus_minus, pval):
+  "Return diff for prop value PVAL, with leading PLUS_MINUS (+ or -)."
+  if len(pval) > 0 and pval[-1] != '\n':
+    return [plus_minus + pval + "\n","\\ No newline at end of property\n"]
+  return [plus_minus + pval]
+
 def make_diff_prop_deleted(pname, pval):
   """Return a property diff for deletion of property PNAME, old value PVAL.
      PVAL is a single string with no embedded newlines.  Return the result
      as a list of newline-terminated strings."""
   return [
     "Deleted: " + pname + "\n",
-    "## -1 +0,0 ##\n",
-    "-" + pval + "\n"
-  ]
+    "## -1 +0,0 ##\n"
+  ] + make_diff_prop_val("-", pval)
 
 def make_diff_prop_added(pname, pval):
   """Return a property diff for addition of property PNAME, new value PVAL.
@@ -163,8 +192,7 @@ def make_diff_prop_added(pname, pval):
   return [
     "Added: " + pname + "\n",
     "## -0,0 +1 ##\n",
-    "+" + pval + "\n"
-  ]
+  ] + make_diff_prop_val("+", pval)
 
 def make_diff_prop_modified(pname, pval1, pval2):
   """Return a property diff for modification of property PNAME, old value
@@ -173,9 +201,7 @@ def make_diff_prop_modified(pname, pval1
   return [
     "Modified: " + pname + "\n",
     "## -1 +1 ##\n",
-    "-" + pval1 + "\n",
-    "+" + pval2 + "\n"
-  ]
+  ] + make_diff_prop_val("-", pval1) + make_diff_prop_val("+", pval2)
 
 ######################################################################
 # Diff output checker
@@ -256,8 +282,8 @@ def verify_excluded_output(diff_output, 
   "verify given line does not exist in diff output as diff line"
   for line in diff_output:
     if re.match("^(\\+|-)%s" % re.escape(excluded), line):
-      print('Sought: %s' % excluded)
-      print('Found:  %s' % line)
+      logger.warn('Sought: %s' % excluded)
+      logger.warn('Found:  %s' % line)
       raise svntest.Failure
 
 def extract_diff_path(line):
@@ -1157,8 +1183,10 @@ def diff_base_to_repos(sbox):
     if not re_infoline.match(line):
       list2.append(line)
 
-  if list1 != list2:
-    raise svntest.Failure
+  # Two files in diff may be in any order.
+  list1 = svntest.verify.UnorderedOutput(list1)
+
+  svntest.verify.compare_and_display_lines('', '', list1, list2)
 
 
 #----------------------------------------------------------------------
@@ -1218,6 +1246,7 @@ def diff_deleted_in_head(sbox):
 
 
 #----------------------------------------------------------------------
+@Issue(2873)
 def diff_targets(sbox):
   "select diff targets"
 
@@ -1263,30 +1292,20 @@ def diff_targets(sbox):
                                                             update_path,
                                                             add_path)
 
-  regex = 'svn: E195012: Unable to find repository location for \'.*\''
-  for line in err_output:
-    if re.match(regex, line):
-      break
-  else:
+  if check_update_a_file(diff_output) or check_add_a_file(diff_output):
     raise svntest.Failure
 
   exit_code, diff_output, err_output = svntest.main.run_svn(1,
                                                             'diff', '-r1:2',
                                                             add_path)
-  for line in err_output:
-    if re.match(regex, line):
-      break
-  else:
+
+  if not check_update_a_file(diff_output) or check_add_a_file(diff_output):
     raise svntest.Failure
 
   exit_code, diff_output, err_output = svntest.main.run_svn(
     1, 'diff', '-r1:2', '--old', parent_path, 'alpha', 'theta')
 
-  regex = 'svn: E160013: \'.*\' was not found in the repository'
-  for line in err_output:
-    if re.match(regex, line):
-      break
-  else:
+  if check_update_a_file(diff_output) or check_add_a_file(diff_output):
     raise svntest.Failure
 
   exit_code, diff_output, err_output = svntest.main.run_svn(
@@ -1565,7 +1584,7 @@ def check_for_omitted_prefix_in_path_com
   good_dest = ".../prefix_other/mytag"
 
   if ((src != good_src) or (dest != good_dest)):
-    print("src is '%s' instead of '%s' and dest is '%s' instead of '%s'" %
+    logger.warn("src is '%s' instead of '%s' and dest is '%s' instead of '%s'" %
           (src, good_src, dest, good_dest))
     raise svntest.Failure
 
@@ -1763,6 +1782,7 @@ def diff_prop_on_named_dir(sbox):
 
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'propdel', 'p', 'A')
+
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'ci', '-m', '')
 
@@ -2863,18 +2883,18 @@ def diff_with_depth(sbox):
   A_header = make_diff_header('A', "revision 1", "working copy")
   B_header = make_diff_header(B_path, "revision 1", "working copy")
 
-  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
-  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
-                                                  + iota_header + diff[7:12])
-  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:7])
+  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:7]
+                                                  + iota_header + diff[8:14])
+  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:7]
                                                        + iota_header
-                                                       + diff[7:12]
-                                                       +  A_header + diff[8:18])
-  expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+                                                       + diff[8:14]
+                                                       + A_header + diff[15:21])
+  expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:7]
                                                        + iota_header
-                                                       + diff[7:12]
-                                                       +  A_header + diff[8:18]
-                                                       + B_header + diff[12:])
+                                                       + diff[8:14]
+                                                       + A_header + diff[15:21]
+                                                       + B_header + diff[22:])
 
   os.chdir(sbox.wc_dir)
 
@@ -2910,18 +2930,18 @@ def diff_with_depth(sbox):
   A_header = make_diff_header('A', "revision 1", "revision 2")
   B_header = make_diff_header(B_path, "revision 1", "revision 2")
 
-  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:6])
-  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:6]
-                                                  + iota_header + diff[7:12])
-  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:6]
+  expected_empty = svntest.verify.UnorderedOutput(dot_header + diff[:7])
+  expected_files = svntest.verify.UnorderedOutput(dot_header + diff[:7]
+                                                  + iota_header + diff[8:14])
+  expected_immediates = svntest.verify.UnorderedOutput(dot_header + diff[:7]
                                                        + iota_header
-                                                       + diff[7:12]
-                                                       +  A_header + diff[8:18])
+                                                       + diff[8:14]
+                                                       + A_header + diff[15:21])
   expected_infinity = svntest.verify.UnorderedOutput(dot_header + diff[:6]
                                                        + iota_header
-                                                       + diff[7:12]
-                                                       +  A_header + diff[8:18]
-                                                       + B_header + diff[12:])
+                                                       + diff[8:14]
+                                                       + A_header + diff[15:21]
+                                                       + B_header + diff[22:])
 
   # Test repos-repos diff.
   svntest.actions.run_and_verify_svn(None, expected_empty, [],
@@ -2954,10 +2974,10 @@ def diff_with_depth(sbox):
     make_diff_prop_header(".") + \
     make_diff_prop_modified("foo1", "bar1", "baz1")
 
-  expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[43:])
-  expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[29:])
-  expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[11:22]
-                                                       +diff_wc_repos[29:])
+  expected_empty = svntest.verify.UnorderedOutput(diff_wc_repos[49:])
+  expected_files = svntest.verify.UnorderedOutput(diff_wc_repos[33:])
+  expected_immediates = svntest.verify.UnorderedOutput(diff_wc_repos[13:26]
+                                                       +diff_wc_repos[33:])
   expected_infinity = svntest.verify.UnorderedOutput(diff_wc_repos[:])
 
   svntest.actions.run_and_verify_svn(None, None, [],
@@ -3585,6 +3605,9 @@ def diff_git_empty_files(sbox):
   ] + make_git_diff_header(iota_path, "iota", "revision 2", "working copy",
                            delete=True, text_changes=False)
 
+  # Two files in diff may be in any order.
+  expected_output = svntest.verify.UnorderedOutput(expected_output)
+
   svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
                                      '--git', wc_dir)
 
@@ -3625,6 +3648,9 @@ def diff_git_with_props(sbox):
                     make_diff_prop_header("iota") + \
                     make_diff_prop_added("svn:keywords", "Id")
 
+  # Files in diff may be in any order.
+  expected_output = svntest.verify.UnorderedOutput(expected_output)
+
   svntest.actions.run_and_verify_svn(None, expected_output, [], 'diff',
                                      '--git', wc_dir)
 
@@ -3749,6 +3775,108 @@ def no_spurious_conflict(sbox):
   expected_status.tweak('3449_spurious', status='  ')
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
+def diff_two_working_copies(sbox):
+  "diff between two working copies"
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Create a pristine working copy that will remain mostly unchanged
+  wc_dir_old = sbox.add_wc_path('old')
+  svntest.main.run_svn(None, 'co', sbox.repo_url, wc_dir_old)
+  # Add a property to A/B/F in the pristine working copy
+  svntest.main.run_svn(None, 'propset', 'newprop', 'propval-old\n',
+                       os.path.join(wc_dir_old, 'A', 'B', 'F'))
+
+  # Make changes to the first working copy:
+
+  # removed nodes
+  sbox.simple_rm('A/mu')
+  sbox.simple_rm('A/D/H')
+
+  # new nodes
+  sbox.simple_mkdir('newdir')
+  svntest.main.file_append(sbox.ospath('newdir/newfile'), 'new text\n')
+  sbox.simple_add('newdir/newfile')
+  sbox.simple_mkdir('newdir/newdir2') # should not show up in the diff
+
+  # modified nodes
+  sbox.simple_propset('newprop', 'propval', 'A/D')
+  sbox.simple_propset('newprop', 'propval', 'A/D/gamma')
+  svntest.main.file_append(sbox.ospath('A/B/lambda'), 'new text\n')
+
+  # replaced nodes (files vs. directories) with property mods
+  sbox.simple_rm('A/B/F')
+  svntest.main.file_append(sbox.ospath('A/B/F'), 'new text\n')
+  sbox.simple_add('A/B/F')
+  sbox.simple_propset('newprop', 'propval-new\n', 'A/B/F')
+  sbox.simple_rm('A/D/G/pi')
+  sbox.simple_mkdir('A/D/G/pi')
+  sbox.simple_propset('newprop', 'propval', 'A/D/G/pi')
+
+  src_label = os.path.basename(wc_dir_old)
+  dst_label = os.path.basename(wc_dir)
+  expected_output = make_diff_header('newdir/newfile', 'working copy',
+                                     'working copy',
+                                     src_label, dst_label) + [
+                      "@@ -0,0 +1 @@\n",
+                      "+new text\n",
+                    ] + make_diff_header('A/mu', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +0,0 @@\n",
+                      "-This is the file 'mu'.\n",
+                    ] + make_diff_header('A/B/F', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -0,0 +1 @@\n",
+                      "+new text\n",
+                    ] + make_diff_prop_header('A/B/F') + \
+                        make_diff_prop_modified("newprop", "propval-old\n",
+                                                "propval-new\n") + \
+                    make_diff_header('A/B/lambda', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +1,2 @@\n",
+                      " This is the file 'lambda'.\n",
+                      "+new text\n",
+                    ] + make_diff_header('A/D', 'working copy', 'working copy',
+                                         src_label, dst_label) + \
+                        make_diff_prop_header('A/D') + \
+                        make_diff_prop_added("newprop", "propval") + \
+                    make_diff_header('A/D/gamma', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + \
+                        make_diff_prop_header('A/D/gamma') + \
+                        make_diff_prop_added("newprop", "propval") + \
+                    make_diff_header('A/D/G/pi', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +0,0 @@\n",
+                      "-This is the file 'pi'.\n",
+                    ] + make_diff_prop_header('A/D/G/pi') + \
+                        make_diff_prop_added("newprop", "propval") + \
+                    make_diff_header('A/D/H/chi', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +0,0 @@\n",
+                      "-This is the file 'chi'.\n",
+                    ] + make_diff_header('A/D/H/omega', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +0,0 @@\n",
+                      "-This is the file 'omega'.\n",
+                    ] + make_diff_header('A/D/H/psi', 'working copy',
+                                         'working copy',
+                                         src_label, dst_label) + [
+                      "@@ -1 +0,0 @@\n",
+                      "-This is the file 'psi'.\n",
+                    ]
+                    
+  # Files in diff may be in any order.
+  expected_output = svntest.verify.UnorderedOutput(expected_output)
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'diff', '--old', wc_dir_old,
+                                     '--new', wc_dir)
 
 ########################################################################
 #Run the tests
@@ -3817,6 +3945,7 @@ test_list = [ None,
               diff_abs_localpath_from_wc_folder,
               no_spurious_conflict,
               diff_correct_wc_base_revnum,
+              diff_two_working_copies,
               ]
 
 if __name__ == '__main__':

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/externals_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/externals_tests.py?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/externals_tests.py (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/externals_tests.py Mon Apr 23 12:32:48 2012
@@ -225,7 +225,7 @@ def change_external_expect_error(path, n
   but expect to get an error message that matches EXPECTED_ERR."""
 
   svntest.actions.set_prop('svn:externals', new_val, path,
-                           expected_err=expected_err)
+                           expected_re_string=expected_err)
 
 
 def probe_paths_exist(paths):
@@ -706,6 +706,13 @@ def disallow_dot_or_dotdot_directory_ref
   if not external_urls: external_urls = list(external_url_for.values())
   externals_value_8 = external_urls.pop() + " /foo \n"
   if not external_urls: external_urls = list(external_url_for.values())
+  if svntest.main.is_os_windows():
+    externals_value_9 = external_urls.pop() + " D:/foo\n"
+    if not external_urls: external_urls = list(external_url_for.values())
+    externals_value_10 = external_urls.pop() + " D:\\foo\n"
+    if not external_urls: external_urls = list(external_url_for.values())
+    externals_value_11 = external_urls.pop() + " D:foo\n"
+    if not external_urls: external_urls = list(external_url_for.values())
 
   set_externals_for_path_expect_error(B_path, externals_value_1)
   set_externals_for_path_expect_error(G_path, externals_value_2)
@@ -715,6 +722,10 @@ def disallow_dot_or_dotdot_directory_ref
   set_externals_for_path_expect_error(B_path, externals_value_6)
   set_externals_for_path_expect_error(G_path, externals_value_7)
   set_externals_for_path_expect_error(H_path, externals_value_8)
+  if svntest.main.is_os_windows():
+    set_externals_for_path_expect_error(B_path, externals_value_9)
+    set_externals_for_path_expect_error(B_path, externals_value_10)
+    set_externals_for_path_expect_error(B_path, externals_value_11)
 
 
 #----------------------------------------------------------------------
@@ -1877,7 +1888,7 @@ def exclude_externals(sbox):
                                         None, None, None, None, False,
                                         '--set-depth', 'infinity', wc_dir)
 
-def file_externals_different_repos(sbox):
+def file_externals_different_url(sbox):
   "update file externals via different url"
 
   sbox.build()
@@ -1896,30 +1907,52 @@ def file_externals_different_repos(sbox)
                       r2_url + '/iota  r2-e-2\n' +
                       '^/iota  rr-e-1\n', '')
 
+  # All file externals appear in the working copy, with normalised URLs.
   expected_output = svntest.wc.State(wc_dir, {
     'r1-e-1'            : Item(status='A '),
     'r1-e-2'            : Item(status='A '),
+    'r2-e-1'            : Item(status='A '),
+    'r2-e-2'            : Item(status='A '),
     'rr-e-1'            : Item(status='A '),
   })
 
-  # The externals from r2 should fail, but currently pass.
-  # This creates a wc.db inconsistency
+  expected_status = actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('', status=' M')
+  expected_status.add({
+    'r2-e-1'            : Item(status='  ', wc_rev='1', switched='X'),
+    'r1-e-1'            : Item(status='  ', wc_rev='1', switched='X'),
+    'r1-e-2'            : Item(status='  ', wc_rev='1', switched='X'),
+    'rr-e-1'            : Item(status='  ', wc_rev='1', switched='X'),
+    'r2-e-2'            : Item(status='  ', wc_rev='1', switched='X'),
+  })
+
   svntest.actions.run_and_verify_update(wc_dir,
-                                        expected_output, None, None,
-                                        'svn: warning: W200007: Unsupported.*')
+                                        expected_output, None,
+                                        expected_status, None)
+
+  # Verify that all file external URLs are descendants of r1_url
+  for e in ['r1-e-1', 'r1-e-2', 'r2-e-1', 'r2-e-2', 'rr-e-1']:
+    actions.run_and_verify_info([{'Repository Root' : r1_url}],
+                                os.path.join(sbox.wc_dir, e))
+
 
   svntest.actions.run_and_verify_svn(None, None, [],
                                      'relocate', r1_url, r2_url, wc_dir)
 
 
+  # URLs of existing file externals are silently rewritten
   expected_output = svntest.wc.State(wc_dir, {
-    'r2-e-1'            : Item(status='A '),
-    'r2-e-2'            : Item(status='A '),
   })
 
   svntest.actions.run_and_verify_update(wc_dir,
-                                        expected_output, None, None,
-                                        'svn: warning: W200007: Unsupported.*')
+                                        expected_output, None,
+                                        expected_status, None)
+
+  # Verify that all file external URLs are descendants of r2_url
+  for e in ['r1-e-1', 'r1-e-2', 'r2-e-1', 'r2-e-2', 'rr-e-1']:
+    actions.run_and_verify_info([{'Repository Root' : r2_url}],
+                                os.path.join(sbox.wc_dir, e))
+
 
 def file_external_in_unversioned(sbox):
   "file external in unversioned dir"
@@ -2533,10 +2566,10 @@ def include_immediate_dir_externals(sbox
   #     svn ps svn:externals "^/A/B/E X/XE" wc_dir
   #     svn ci
   #     svn up
-  # 
+  #
   #     svn ps some change X/XE
   #     echo mod >> X/XE/alpha
-  # 
+  #
   #     svn st X/XE
   #     # Expect only the propset on X/XE to be committed.
   #     # Should be like 'svn commit --include-externals --depth=empty X/XE'.
@@ -2640,6 +2673,197 @@ def include_immediate_dir_externals(sbox
     None, '--include-externals', '--depth=immediates', X)
 
 
+@Issue(4085)
+@XFail()
+def shadowing(sbox):
+  "external shadows an existing dir"
+
+  sbox.build(read_only=True)
+  wc_dir = sbox.wc_dir
+
+  # Setup external: /A/B/F as 'C' child of /A
+  externals_prop = "^/A/B/F C\n"
+
+  raised = False
+  try:
+    change_external(sbox.ospath('A'), externals_prop, commit=False)
+  except:
+    raised = True
+  if not raised:
+    raise svntest.Failure("Creating conflicting child 'C' of 'A' didn't error")
+
+# Test for issue #4093 'remapping a file external can segfault due to
+# "deleted" props'.
+@Issue(4093)
+def remap_file_external_with_prop_del(sbox):
+  "file external remap segfaults due to deleted props"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  A_path  = os.path.join(wc_dir, "A")
+  mu_path = os.path.join(wc_dir, "A", "mu")
+
+  # Add a property to A/mu
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'ps', 'propname', 'propval', mu_path)
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'commit', '-m', 'New property on a file',
+                                     wc_dir)
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+  # Add a new file external A/external pointing to ^/A/mu
+  externals_prop = "^/A/mu external\n"
+  change_external(A_path, externals_prop)
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+  # Change A/external to point to ^/iota
+  externals_prop = "^/iota external\n"
+  change_external(A_path, externals_prop)
+
+  # Now update to bring the new external down.
+  # This previously segfaulted as described in
+  # http://subversion.tigris.org/issues/show_bug.cgi?id=4093#desc1
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+
+# Test for issue #4053 'svn:externals with explicit rev checks out HEAD'
+@Issue(4053)
+def dir_external_with_dash_r_only(sbox):
+  "whether '-r1 ^/A B' updates properly"
+  # svntest.factory.make(sbox,"""
+  #   echo 'newer alpha' > A/B/E/alpha
+  #   svn ci
+  #   svn ps svn:externals ' -r1 ^/A/B/E E_ext' .
+  #   svn up
+  #   # ^ move the 'status.tweak(wc_rev=2)' above the 'add()' call
+  #   svn info E_ext
+  #   # ^ change the 'svn info' call to
+  #   #  expected_info = { 'Revision': '1' }
+  #   #  actions.run_and_verify_info([expected_info], E_ext)
+  #   """)
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+  url = sbox.repo_url
+
+  A_B_E_alpha = os.path.join(wc_dir, 'A', 'B', 'E', 'alpha')
+  E_ext = os.path.join(wc_dir, 'E_ext')
+
+  # echo 'newer alpha' > A/B/E/alpha
+  main.file_write(A_B_E_alpha, 'newer alpha\n')
+
+  # svn ci
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B/E/alpha'       : Item(verb='Sending'),
+  })
+
+  expected_status = actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/B/E/alpha', wc_rev='2')
+
+  actions.run_and_verify_commit(wc_dir, expected_output, expected_status,
+    None, wc_dir)
+
+  # svn ps svn:externals ' -r1 ^/A/B/E E_ext' .
+  expected_stdout = ["property 'svn:externals' set on '" + wc_dir + "'\n"]
+
+  actions.run_and_verify_svn2('OUTPUT', expected_stdout, [], 0, 'ps',
+    'svn:externals', ' -r1 ^/A/B/E E_ext', wc_dir)
+
+  # svn up
+  expected_output = svntest.wc.State(wc_dir, {
+    'E_ext/beta'        : Item(status='A '),
+    'E_ext/alpha'       : Item(status='A '),
+  })
+
+  expected_disk = svntest.main.greek_state.copy()
+  expected_disk.add({
+    'E_ext'             : Item(),
+    'E_ext/alpha'       : Item(contents="This is the file 'alpha'.\n"),
+    'E_ext/beta'        : Item(contents="This is the file 'beta'.\n"),
+  })
+  expected_disk.tweak('A/B/E/alpha', contents='newer alpha\n')
+
+  expected_status.tweak(wc_rev='2')
+  expected_status.tweak('', status=' M')
+  expected_status.add({
+    'E_ext'             : Item(status='X '),
+  })
+
+  actions.run_and_verify_update(wc_dir, expected_output, expected_disk,
+    expected_status, None, None, None, None, None, False, wc_dir)
+
+  # svn info E_ext/alpha
+  expected_info = { 'Revision': '1' }
+  actions.run_and_verify_info([expected_info], E_ext)
+
+# Test for issue #4123 'URL-to-WC copy of externals fails on Windows'
+@Issue(4123)
+def url_to_wc_copy_of_externals(sbox):
+  "url-to-wc copy of externals"
+
+  sbox.build()
+
+  wc_dir = sbox.wc_dir
+  repo_url = sbox.repo_url
+
+  # Create an external A/C/external pointing to ^/A/D/G.
+  svntest.actions.run_and_verify_svn(None, None, [], 'ps',
+                                     'svn:externals', '^/A/D/G external',
+                                     os.path.join(wc_dir, 'A', 'C'))
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
+                                     'create an external', wc_dir)
+  svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+  # Copy ^/A/C to External-WC-to-URL-Copy.
+  #
+  # Previously this failed with:
+  #   >svn copy ^^/A/C External-WC-to-URL-Copy
+  #    U   External-WC-to-URL-Copy
+  #
+  #   Fetching external item into 'External-WC-to-URL-Copy\external':
+  #   A    External-WC-to-URL-Copy\external\pi
+  #   A    External-WC-to-URL-Copy\external\rho
+  #   A    External-WC-to-URL-Copy\external\tau
+  #   Checked out external at revision 2.
+  #
+  #   Checked out revision 2.
+  #   ..\..\..\subversion\libsvn_client\copy.c:2249: (apr_err=720005)
+  #   ..\..\..\subversion\libsvn_client\copy.c:1857: (apr_err=720005)
+  #   ..\..\..\subversion\libsvn_client\copy.c:1857: (apr_err=720005)
+  #   ..\..\..\subversion\libsvn_client\copy.c:1737: (apr_err=720005)
+  #   ..\..\..\subversion\libsvn_client\copy.c:1737: (apr_err=720005)
+  #   ..\..\..\subversion\libsvn_client\copy.c:1537: (apr_err=720005)
+  #   ..\..\..\subversion\libsvn_subr\io.c:3416: (apr_err=720005)
+  #   svn: E720005: Can't move 'C:\SVN\src-trunk-3\Debug\subversion\tests\
+  #   cmdline\svn-test-work\working_copies\externals_tests-41\.svn\tmp\
+  #   svn-F9E2C0EC' to 'C:\SVN\src-trunk-3\Debug\subversion\tests\cmdline\
+  #   svn-test-work\working_copies\externals_tests-41\External-WC-to-URL-Copy':
+  #   Access is denied.
+  external_root_path = os.path.join(wc_dir, "External-WC-to-URL-Copy")
+  external_ex_path = os.path.join(wc_dir, "External-WC-to-URL-Copy",
+                                  "external")
+  external_pi_path = os.path.join(wc_dir, "External-WC-to-URL-Copy",
+                                  "external", "pi")
+  external_rho_path = os.path.join(wc_dir, "External-WC-to-URL-Copy",
+                                   "external", "rho")
+  external_tau_path = os.path.join(wc_dir, "External-WC-to-URL-Copy",
+                                   "external", "tau")
+  expected_stdout = verify.UnorderedOutput([
+    "\n",
+    " U   " + external_root_path + "\n",
+    "Fetching external item into '" + external_ex_path + "':\n",
+    "A    " + external_pi_path + "\n",
+    "A    " + external_rho_path + "\n",
+    "A    " + external_tau_path + "\n",
+    "Checked out external at revision 2.\n",
+    "Checked out revision 2.\n",
+    "A         " + external_root_path + "\n"
+  ])
+  exit_code, stdout, stderr = svntest.actions.run_and_verify_svn2(
+    "OUTPUT", expected_stdout, [], 0, 'copy', repo_url + '/A/C',
+    os.path.join(wc_dir, 'External-WC-to-URL-Copy'))
+
 ########################################################################
 # Run the tests
 
@@ -2678,11 +2902,15 @@ test_list = [ None,
               incoming_file_on_file_external,
               incoming_file_external_on_file,
               exclude_externals,
-              file_externals_different_repos,
+              file_externals_different_url,
               file_external_in_unversioned,
               copy_file_externals,
               include_externals,
               include_immediate_dir_externals,
+              shadowing,
+              remap_file_external_with_prop_del,
+              dir_external_with_dash_r_only,
+              url_to_wc_copy_of_externals,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout?rev=1329209&r1=1329208&r2=1329209&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout (original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/getopt_tests_data/svn_help_log_switch_stdout Mon Apr 23 12:32:48 2012
@@ -38,6 +38,10 @@ usage: 1. log [PATH][@REV]
     svn log http://www.example.com/repo/project foo.c bar.c
     svn log http://www.example.com/repo/project@50 foo.c bar.c
 
+    This command shows the log entry for the revision the branch
+    ^/branches/foo was created in:
+      svn log --stop-on-copy --limit 1 -r0:HEAD ^/branches/foo
+
 Valid options:
   -r [--revision] ARG      : ARG (some commands also take ARG1:ARG2 range)
                              A revision argument can be one of:
@@ -157,9 +161,10 @@ Valid options:
   --ignore-ancestry        : ignore ancestry when calculating merges
   --force                  : force operation to run
   --accept ARG             : specify automatic conflict resolution action
-                             ('postpone', 'base', 'mine-conflict',
+                             ('postpone', 'working', 'base', 'mine-conflict',
                              'theirs-conflict', 'mine-full', 'theirs-full',
                              'edit', 'launch')
+                             (shorthand: 'p', 'mc', 'tc', 'mf', 'tf', 'e', 'l')
 
 Global options:
   --username ARG           : specify a username ARG



Mime
View raw message