You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/10/08 22:13:31 UTC

svn commit: r1006005 [8/10] - in /subversion/branches/object-model: ./ contrib/client-side/ notes/wc-ng/ subversion/bindings/javahl/native/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/src/org/tigris/subversio...

Modified: subversion/branches/object-model/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/cl.h?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/cl.h (original)
+++ subversion/branches/object-model/subversion/svn/cl.h Fri Oct  8 20:13:26 2010
@@ -417,15 +417,18 @@ svn_cl__print_status_xml(const char *pat
                          apr_pool_t *pool);
 
 
-/* Print a hash that maps property names (char *) to property values
-   (svn_string_t *).  The names are assumed to be in UTF-8 format;
+/* Print to stdout a hash that maps property names (char *) to property
+   values (svn_string_t *).  The names are assumed to be in UTF-8 format;
    the values are either in UTF-8 (the special Subversion props) or
    plain binary values.
 
+   If OUT is not NULL, then write to it rather than stdout.
+
    If NAMES_ONLY is true, print just names, else print names and
    values. */
 svn_error_t *
-svn_cl__print_prop_hash(apr_hash_t *prop_hash,
+svn_cl__print_prop_hash(svn_stream_t *out,
+                        apr_hash_t *prop_hash,
                         svn_boolean_t names_only,
                         apr_pool_t *pool);
 
@@ -626,7 +629,10 @@ svn_cl__cleanup_log_msg(void *log_msg_ba
 svn_error_t *
 svn_cl__may_need_force(svn_error_t *err);
 
-/* Write the STRING to the stdio STREAM, returning an error if it fails. */
+/* Write the STRING to the stdio STREAM, returning an error if it fails.
+
+   This function is equal to svn_cmdline_fputs() minus the utf8->local
+   encoding translation.  */
 svn_error_t *
 svn_cl__error_checked_fputs(const char *string, FILE* stream);
 

Modified: subversion/branches/object-model/subversion/svn/commit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/commit-cmd.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/commit-cmd.c (original)
+++ subversion/branches/object-model/subversion/svn/commit-cmd.c Fri Oct  8 20:13:26 2010
@@ -97,6 +97,21 @@ svn_cl__commit(apr_getopt_t *os,
   if (opt_state->depth == svn_depth_unknown)
     opt_state->depth = svn_depth_infinity;
 
+  /* Copies are done server-side, and cheaply, which means they're
+   * effectively always done with infinite depth.
+   * This is a potential cause of confusion for users trying to commit
+   * copied subtrees in part by restricting the commit's depth.
+   * See issue #3699. */
+  if (opt_state->depth < svn_depth_infinity)
+    SVN_ERR(svn_cmdline_printf(pool,
+                               _("svn: warning: The depth of this commit "
+                                 "is '%s', but copied directories will "
+                                 "regardless be committed with depth '%s'. "
+                                 "You must remove unwanted children of those "
+                                 "directories in a separate commit.\n"),
+                               svn_depth_to_word(opt_state->depth),
+                               svn_depth_to_word(svn_depth_infinity)));
+    
   cfg = apr_hash_get(ctx->config, SVN_CONFIG_CATEGORY_CONFIG,
                      APR_HASH_KEY_STRING);
   if (cfg)

Modified: subversion/branches/object-model/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/conflict-callbacks.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/object-model/subversion/svn/conflict-callbacks.c Fri Oct  8 20:13:26 2010
@@ -470,34 +470,34 @@ svn_cl__conflict_handler(svn_wc_conflict
             {
               prompt = apr_pstrcat(subpool, prompt,
                                    _(", (df) diff-full, (e) edit"),
-                                   NULL);
+                                   (char *)NULL);
 
               if (knows_something)
                 prompt = apr_pstrcat(subpool, prompt, _(", (r) resolved"),
-                                     NULL);
+                                     (char *)NULL);
 
               if (! desc->is_binary &&
                   desc->kind != svn_wc_conflict_kind_property)
                 prompt = apr_pstrcat(subpool, prompt,
                                      _(",\n        (mc) mine-conflict, "
                                        "(tc) theirs-conflict"),
-                                     NULL);
+                                     (char *)NULL);
             }
           else
             {
               if (knows_something)
                 prompt = apr_pstrcat(subpool, prompt, _(", (r) resolved"),
-                                     NULL);
+                                     (char *)NULL);
               prompt = apr_pstrcat(subpool, prompt,
                                    _(",\n        "
                                      "(mf) mine-full, (tf) theirs-full"),
-                                   NULL);
+                                   (char *)NULL);
             }
 
-          prompt = apr_pstrcat(subpool, prompt, ",\n        ", NULL);
+          prompt = apr_pstrcat(subpool, prompt, ",\n        ", (char *)NULL);
           prompt = apr_pstrcat(subpool, prompt,
                                _("(s) show all options: "),
-                               NULL);
+                               (char *)NULL);
 
           SVN_ERR(svn_cmdline_prompt_user2(&answer, prompt, b->pb, subpool));
 

Modified: subversion/branches/object-model/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/log-cmd.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/log-cmd.c (original)
+++ subversion/branches/object-model/subversion/svn/log-cmd.c Fri Oct  8 20:13:26 2010
@@ -163,9 +163,6 @@ log_entry_receiver(void *baton,
   const char *date;
   const char *message;
 
-  /* Number of lines in the msg. */
-  int lines;
-
   if (lb->ctx->cancel_func)
     SVN_ERR(lb->ctx->cancel_func(lb->ctx->cancel_baton));
 
@@ -201,7 +198,9 @@ log_entry_receiver(void *baton,
 
   if (message != NULL)
     {
-      lines = svn_cstring_count_newlines(message) + 1;
+      /* Number of lines in the msg. */
+      int lines = svn_cstring_count_newlines(message) + 1;
+
       SVN_ERR(svn_cmdline_printf(pool,
                                  Q_(" | %d line", " | %d lines", lines),
                                  lines));
@@ -631,9 +630,9 @@ svn_cl__log(apr_getopt_t *os,
           range = APR_ARRAY_IDX(opt_state->revision_ranges, i,
                                 svn_opt_revision_range_t *);
           if (range->start.value.number < range->end.value.number)
-            range->start = range->end;
+            range->start.value.number++;
           else
-            range->end = range->start;
+            range->end.value.number++;
         }
     }
 

Modified: subversion/branches/object-model/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/main.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/main.c (original)
+++ subversion/branches/object-model/subversion/svn/main.c Fri Oct  8 20:13:26 2010
@@ -1278,8 +1278,6 @@ main(int argc, const char *argv[])
   int i;
   const svn_opt_subcommand_desc2_t *subcommand = NULL;
   const char *dash_m_arg = NULL, *dash_F_arg = NULL;
-  const char *path_utf8;
-  apr_status_t apr_err;
   svn_cl__cmd_baton_t command_baton;
   svn_auth_baton_t *ab;
   svn_config_t *cfg_config;
@@ -1357,7 +1355,7 @@ main(int argc, const char *argv[])
       const char *utf8_opt_arg;
 
       /* Parse the next option. */
-      apr_err = apr_getopt_long(os, svn_cl__options, &opt_id, &opt_arg);
+      apr_status_t apr_err = apr_getopt_long(os, svn_cl__options, &opt_id, &opt_arg);
       if (APR_STATUS_IS_EOF(apr_err))
         break;
       else if (apr_err)
@@ -1398,9 +1396,6 @@ main(int argc, const char *argv[])
         break;
       case 'c':
         {
-          char *end;
-          svn_revnum_t changeno;
-          svn_opt_revision_range_t *range;
           apr_array_header_t *change_revs =
             svn_cstring_split(opt_arg, ", \n\r\t\v", TRUE, pool);
 
@@ -1414,6 +1409,9 @@ main(int argc, const char *argv[])
 
           for (i = 0; i < change_revs->nelts; i++)
             {
+              char *end;
+              svn_revnum_t changeno, changeno_end;
+              svn_opt_revision_range_t *range;
               const char *change_str =
                 APR_ARRAY_IDX(change_revs, i, const char *);
 
@@ -1423,7 +1421,22 @@ main(int argc, const char *argv[])
                  ### "{DATE}" and the special words. */
               while (*change_str == 'r')
                 change_str++;
-              changeno = strtol(change_str, &end, 10);
+              changeno = changeno_end = strtol(change_str, &end, 10);
+              if (end != change_str && *end == '-')
+                {
+                  if (changeno < 0)
+                    {
+                      err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                              _("Negative number in range (%s)"
+                                                " not supported with -c"),
+                                              change_str);
+                      return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+                    }
+                  change_str = end+1;
+                  while (*change_str == 'r')
+                    change_str++;
+                  changeno_end = strtol(change_str, &end, 10);
+                }
               if (end == change_str || *end != '\0')
                 {
                   err = svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
@@ -1441,19 +1454,28 @@ main(int argc, const char *argv[])
 
               /* Figure out the range:
                     -c N  -> -r N-1:N
-                    -c -N -> -r N:N-1 */
-              range = apr_palloc(pool, sizeof(*range));
+                    -c -N -> -r N:N-1
+                    -c M-N -> -r M-1:N for M < N
+                    -c M-N -> -r M:N-1 for M > N
+                    -c -M-N -> error (too confusing/no valid use case)
+              */
               if (changeno > 0)
                 {
-                  range->start.value.number = changeno - 1;
-                  range->end.value.number = changeno;
+                  if (changeno <= changeno_end)
+                    changeno--;
+                  else
+                    changeno_end--;
                 }
               else
                 {
                   changeno = -changeno;
-                  range->start.value.number = changeno;
-                  range->end.value.number = changeno - 1;
+                  changeno_end = changeno - 1;
                 }
+
+              range = apr_palloc(pool, sizeof(*range));
+              range->start.value.number = changeno;
+              range->end.value.number = changeno_end;
+
               opt_state.used_change_arg = TRUE;
               range->start.kind = svn_opt_revision_number;
               range->end.kind = svn_opt_revision_number;
@@ -1665,10 +1687,13 @@ main(int argc, const char *argv[])
         opt_state.new_target = apr_pstrdup(pool, opt_arg);
         break;
       case opt_config_dir:
-        err = svn_utf_cstring_to_utf8(&path_utf8, opt_arg, pool);
-        if (err)
-          return svn_cmdline_handle_exit_error(err, pool, "svn: ");
-        opt_state.config_dir = svn_dirent_internal_style(path_utf8, pool);
+        {
+          const char *path_utf8;
+          err = svn_utf_cstring_to_utf8(&path_utf8, opt_arg, pool);
+          if (err)
+            return svn_cmdline_handle_exit_error(err, pool, "svn: ");
+          opt_state.config_dir = svn_dirent_internal_style(path_utf8, pool);
+        }
         break;
       case opt_config_options:
         if (!opt_state.config_options)
@@ -2308,9 +2333,6 @@ main(int argc, const char *argv[])
                                            pool)))
     svn_handle_error2(err, stderr, TRUE, "svn: ");
 
-  /* svn can safely create instance of QApplication class. */
-  svn_auth_set_parameter(ab, "svn:auth:qapplication-safe", "1");
-
   ctx->auth_baton = ab;
 
   /* Set up conflict resolution callback. */

Modified: subversion/branches/object-model/subversion/svn/move-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/move-cmd.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/move-cmd.c (original)
+++ subversion/branches/object-model/subversion/svn/move-cmd.c Fri Oct  8 20:13:26 2010
@@ -84,7 +84,7 @@ svn_cl__move(apr_getopt_t *os,
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, pool));
 
-  err = svn_client_move6(targets, dst_path, opt_state->force,
+  err = svn_client_move6(targets, dst_path,
                          TRUE, opt_state->parents, opt_state->revprop_table,
                          svn_cl__print_commit_info, NULL, ctx, pool);
 

Modified: subversion/branches/object-model/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/notify.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/notify.c (original)
+++ subversion/branches/object-model/subversion/svn/notify.c Fri Oct  8 20:13:26 2010
@@ -324,7 +324,7 @@ notify(void *baton, const svn_wc_notify_
                                            apr_pstrcat(pool, s,
                                                        "%"APR_UINT64_T_FMT
                                                        " and fuzz %d (%s)\n",
-                                                       NULL),
+                                                       (char *)NULL),
                                            n->hunk_original_start,
                                            n->hunk_original_length,
                                            n->hunk_modified_start,
@@ -341,7 +341,7 @@ notify(void *baton, const svn_wc_notify_
                                            apr_pstrcat(pool, s,
                                                        "%"APR_UINT64_T_FMT
                                                        " and fuzz %d\n",
-                                                       NULL),
+                                                       (char *)NULL),
                                            n->hunk_original_start,
                                            n->hunk_original_length,
                                            n->hunk_modified_start,
@@ -362,7 +362,7 @@ notify(void *baton, const svn_wc_notify_
                   err = svn_cmdline_printf(pool,
                                             apr_pstrcat(pool, s,
                                                         "%"APR_UINT64_T_FMT" (%s)\n",
-                                                        NULL),
+                                                        (char *)NULL),
                                             n->hunk_original_start,
                                             n->hunk_original_length,
                                             n->hunk_modified_start,
@@ -376,7 +376,7 @@ notify(void *baton, const svn_wc_notify_
                   err = svn_cmdline_printf(pool,
                                            apr_pstrcat(pool, s,
                                                        "%"APR_UINT64_T_FMT"\n",
-                                                       NULL),
+                                                       (char *)NULL),
                                            n->hunk_original_start,
                                            n->hunk_original_length,
                                            n->hunk_modified_start,

Modified: subversion/branches/object-model/subversion/svn/propdel-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/propdel-cmd.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/propdel-cmd.c (original)
+++ subversion/branches/object-model/subversion/svn/propdel-cmd.c Fri Oct  8 20:13:26 2010
@@ -71,7 +71,6 @@ svn_cl__propdel(apr_getopt_t *os,
   const char *pname, *pname_utf8;
   apr_array_header_t *args, *targets;
   struct notify_wrapper_baton nwb = { 0 };
-  int i;
 
   /* Get the property's name (and a UTF-8 version of that name). */
   SVN_ERR(svn_opt_parse_num_args(&args, os, 1, pool));
@@ -121,6 +120,7 @@ svn_cl__propdel(apr_getopt_t *os,
   else  /* operate on a normal, versioned property (not a revprop) */
     {
       apr_pool_t *subpool = svn_pool_create(pool);
+      int i;
 
       if (opt_state->depth == svn_depth_unknown)
         opt_state->depth = svn_depth_empty;

Modified: subversion/branches/object-model/subversion/svn/propedit-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/propedit-cmd.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/propedit-cmd.c (original)
+++ subversion/branches/object-model/subversion/svn/propedit-cmd.c Fri Oct  8 20:13:26 2010
@@ -76,7 +76,6 @@ svn_cl__propedit(apr_getopt_t *os,
   svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
   const char *pname, *pname_utf8;
   apr_array_header_t *args, *targets;
-  int i;
 
   /* Validate the input and get the property's name (and a UTF-8
      version of that name). */
@@ -177,6 +176,7 @@ svn_cl__propedit(apr_getopt_t *os,
     {
       apr_pool_t *subpool = svn_pool_create(pool);
       struct commit_info_baton cib;
+      int i;
 
       /* The customary implicit dot rule has been prone to user error
        * here.  For example, Jon Trowbridge <tr...@gnu.og> did

Modified: subversion/branches/object-model/subversion/svn/propget-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/propget-cmd.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/propget-cmd.c (original)
+++ subversion/branches/object-model/subversion/svn/propget-cmd.c Fri Oct  8 20:13:26 2010
@@ -140,6 +140,12 @@ print_properties(svn_stream_t *out,
                                 ? _("Properties on '%s':\n")
                                 : "%s - ", filename);
           SVN_ERR(svn_cmdline_cstring_from_utf8(&header, header, iterpool));
+          SVN_ERR(svn_subst_translate_cstring2(header, &header,
+                                               APR_EOL_STR,  /* 'native' eol */
+                                               FALSE, /* no repair */
+                                               NULL,  /* no keywords */
+                                               FALSE, /* no expansion */
+                                               iterpool));
           SVN_ERR(stream_write(out, header, strlen(header)));
         }
 
@@ -149,7 +155,7 @@ print_properties(svn_stream_t *out,
           apr_hash_t *hash = apr_hash_make(iterpool);
 
           apr_hash_set(hash, pname_utf8, APR_HASH_KEY_STRING, propval);
-          svn_cl__print_prop_hash(hash, FALSE, iterpool);
+          svn_cl__print_prop_hash(out, hash, FALSE, iterpool);
         }
       else
         {
@@ -184,7 +190,6 @@ svn_cl__propget(apr_getopt_t *os,
   const char *pname, *pname_utf8;
   apr_array_header_t *args, *targets;
   svn_stream_t *out;
-  int i;
 
   if (opt_state->verbose && (opt_state->revprop || opt_state->strict
                              || opt_state->xml))
@@ -267,6 +272,7 @@ svn_cl__propget(apr_getopt_t *os,
   else  /* operate on a normal, versioned property (not a revprop) */
     {
       apr_pool_t *subpool = svn_pool_create(pool);
+      int i;
 
       if (opt_state->xml)
         SVN_ERR(svn_cl__xml_print_header("properties", subpool));

Modified: subversion/branches/object-model/subversion/svn/proplist-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/proplist-cmd.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/proplist-cmd.c (original)
+++ subversion/branches/object-model/subversion/svn/proplist-cmd.c Fri Oct  8 20:13:26 2010
@@ -98,7 +98,8 @@ proplist_receiver(void *baton,
 
   if (!opt_state->quiet)
     SVN_ERR(svn_cmdline_printf(pool, _("Properties on '%s':\n"), name_local));
-  return svn_cl__print_prop_hash(prop_hash, (! opt_state->verbose), pool);
+  return svn_cl__print_prop_hash(NULL, prop_hash, (! opt_state->verbose),
+                                 pool);
 }
 
 
@@ -111,7 +112,6 @@ svn_cl__proplist(apr_getopt_t *os,
   svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
   svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
   apr_array_header_t *targets;
-  int i;
 
   SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
                                                       opt_state->targets,
@@ -159,11 +159,12 @@ svn_cl__proplist(apr_getopt_t *os,
                                 rev));
 
           SVN_ERR(svn_cl__print_prop_hash
-                  (proplist, (! opt_state->verbose), scratch_pool));
+                  (NULL, proplist, (! opt_state->verbose), scratch_pool));
         }
     }
   else  /* operate on normal, versioned properties (not revprops) */
     {
+      int i;
       apr_pool_t *iterpool;
       svn_proplist_receiver_t pl_receiver;
 

Modified: subversion/branches/object-model/subversion/svn/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/props.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/props.c (original)
+++ subversion/branches/object-model/subversion/svn/props.c Fri Oct  8 20:13:26 2010
@@ -82,7 +82,8 @@ svn_cl__revprop_prepare(const svn_opt_re
 
 
 svn_error_t *
-svn_cl__print_prop_hash(apr_hash_t *prop_hash,
+svn_cl__print_prop_hash(svn_stream_t *out,
+                        apr_hash_t *prop_hash,
                         svn_boolean_t names_only,
                         apr_pool_t *pool)
 {
@@ -93,6 +94,7 @@ svn_cl__print_prop_hash(apr_hash_t *prop
       const char *pname = svn__apr_hash_index_key(hi);
       svn_string_t *propval = svn__apr_hash_index_val(hi);
       const char *pname_stdout;
+      apr_size_t len;
 
       if (svn_prop_needs_translation(pname))
         SVN_ERR(svn_subst_detranslate_string(&propval, propval,
@@ -100,18 +102,45 @@ svn_cl__print_prop_hash(apr_hash_t *prop
 
       SVN_ERR(svn_cmdline_cstring_from_utf8(&pname_stdout, pname, pool));
 
-      /* ### We leave these printfs for now, since if propval wasn't translated
-       * above, we don't know anything about its encoding.  In fact, it
-       * might be binary data... */
-      printf("  %s\n", pname_stdout);
+      if (out)
+        {
+          pname_stdout = apr_psprintf(pool, "  %s\n", pname_stdout); 
+          SVN_ERR(svn_subst_translate_cstring2(pname_stdout, &pname_stdout,
+                                              APR_EOL_STR,  /* 'native' eol */
+                                              FALSE, /* no repair */
+                                              NULL,  /* no keywords */
+                                              FALSE, /* no expansion */
+                                              pool));
+
+          len = strlen(pname_stdout);
+          SVN_ERR(svn_stream_write(out, pname_stdout, &len));
+        }
+      else
+        {
+          /* ### We leave these printfs for now, since if propval wasn't
+             translated above, we don't know anything about its encoding.
+             In fact, it might be binary data... */
+          printf("  %s\n", pname_stdout);
+        }
+
       if (!names_only)
         {
           /* Add an extra newline to the value before indenting, so that
            * every line of output has the indentation whether the value
            * already ended in a newline or not. */
           const char *newval = apr_psprintf(pool, "%s\n", propval->data);
-
-          printf("%s", svn_cl__indent_string(newval, "    ", pool));
+          const char *indented_newval = svn_cl__indent_string(newval,
+                                                              "    ",
+                                                              pool);
+          if (out)
+            {
+              len = strlen(indented_newval);
+              SVN_ERR(svn_stream_write(out, indented_newval, &len));
+            }
+          else
+            {
+              printf("%s", indented_newval);
+            }
         }
     }
 

Modified: subversion/branches/object-model/subversion/svn/propset-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/propset-cmd.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/propset-cmd.c (original)
+++ subversion/branches/object-model/subversion/svn/propset-cmd.c Fri Oct  8 20:13:26 2010
@@ -55,7 +55,6 @@ svn_cl__propset(apr_getopt_t *os,
   svn_string_t *propval = NULL;
   svn_boolean_t propval_came_from_cmdline;
   apr_array_header_t *args, *targets;
-  int i;
 
   /* PNAME and PROPVAL expected as first 2 arguments if filedata was
      NULL, else PNAME alone will precede the targets.  Get a UTF-8
@@ -131,6 +130,7 @@ svn_cl__propset(apr_getopt_t *os,
   else  /* operate on a normal, versioned property (not a revprop) */
     {
       apr_pool_t *iterpool;
+      int i;
 
       if (opt_state->depth == svn_depth_unknown)
         opt_state->depth = svn_depth_empty;

Modified: subversion/branches/object-model/subversion/svn/switch-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/switch-cmd.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/switch-cmd.c (original)
+++ subversion/branches/object-model/subversion/svn/switch-cmd.c Fri Oct  8 20:13:26 2010
@@ -47,7 +47,6 @@ rewrite_urls(const apr_array_header_t *t
   apr_pool_t *subpool;
   const char *from;
   const char *to;
-  int i;
 
   if (targets->nelts < 2)
     return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, 0, NULL);
@@ -70,6 +69,8 @@ rewrite_urls(const apr_array_header_t *t
     }
   else
     {
+      int i;
+
       for (i = 2; i < targets->nelts; i++)
         {
           const char *target = APR_ARRAY_IDX(targets, i, const char *);

Modified: subversion/branches/object-model/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svn/util.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svn/util.c (original)
+++ subversion/branches/object-model/subversion/svn/util.c Fri Oct  8 20:13:26 2010
@@ -906,9 +906,6 @@ svn_cl__may_need_force(svn_error_t *err)
 svn_error_t *
 svn_cl__error_checked_fputs(const char *string, FILE* stream)
 {
-  /* This function is equal to svn_cmdline_fputs() minus
-     the utf8->local encoding translation */
-
   /* On POSIX systems, errno will be set on an error in fputs, but this might
      not be the case on other platforms.  We reset errno and only
      use it if it was set by the below fputs call.  Else, we just return

Modified: subversion/branches/object-model/subversion/svndumpfilter/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svndumpfilter/main.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svndumpfilter/main.c (original)
+++ subversion/branches/object-model/subversion/svndumpfilter/main.c Fri Oct  8 20:13:26 2010
@@ -702,7 +702,6 @@ adjust_mergeinfo(svn_string_t **final_va
       const char *merge_source = svn__apr_hash_index_key(hi);
       apr_array_header_t *rangelist = svn__apr_hash_index_val(hi);
       struct parse_baton_t *pb = rb->pb;
-      int i;
 
       /* Determine whether the merge_source is a part of the prefix. */
       if (skip_path(merge_source, pb->prefixes, pb->do_exclude, pb->glob))
@@ -719,6 +718,8 @@ adjust_mergeinfo(svn_string_t **final_va
       /* Possibly renumber revisions in merge source's rangelist. */
       if (pb->do_renumber_revs)
         {
+          int i;
+
           for (i = 0; i < rangelist->nelts; i++)
             {
               struct revmap_t *revmap_start;

Modified: subversion/branches/object-model/subversion/svnlook/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svnlook/main.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svnlook/main.c (original)
+++ subversion/branches/object-model/subversion/svnlook/main.c Fri Oct  8 20:13:26 2010
@@ -1186,7 +1186,6 @@ print_tree(svn_fs_root_t *root,
            apr_pool_t *pool)
 {
   apr_pool_t *subpool;
-  int i;
   apr_hash_t *entries;
   apr_hash_index_t *hi;
   const char* name;
@@ -1195,8 +1194,11 @@ print_tree(svn_fs_root_t *root,
 
   /* Print the indentation. */
   if (!full_paths)
-    for (i = 0; i < indentation; i++)
-      SVN_ERR(svn_cmdline_fputs(" ", stdout, pool));
+    {
+      int i;
+      for (i = 0; i < indentation; i++)
+        SVN_ERR(svn_cmdline_fputs(" ", stdout, pool));
+    }
 
   /* ### The path format is inconsistent.. needs fix */
   if (full_paths)
@@ -1204,7 +1206,7 @@ print_tree(svn_fs_root_t *root,
   else if (*path == '/')
     name = svn_uri_basename(path, pool);
   else
-    name = svn_relpath_basename(path, pool);
+    name = svn_relpath_basename(path, NULL);
 
   if (svn_path_is_empty(name))
     name = "/"; /* basename of '/' is "" */

Modified: subversion/branches/object-model/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svnrdump/dump_editor.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svnrdump/dump_editor.c (original)
+++ subversion/branches/object-model/subversion/svnrdump/dump_editor.c Fri Oct  8 20:13:26 2010
@@ -34,7 +34,7 @@
 
 #define ARE_VALID_COPY_ARGS(p,r) ((p) && SVN_IS_VALID_REVNUM(r))
 
-#ifdef SVN_DEBUG
+#if 0
 #define LDR_DBG(x) SVN_DBG(x)
 #else
 #define LDR_DBG(x) while(0)
@@ -45,7 +45,7 @@ struct dump_edit_baton {
   /* The output stream we write the dumpfile to */
   svn_stream_t *stream;
 
-  /* Pool for per-edit-session allocations */
+  /* Pool for per-revision allocations */
   apr_pool_t *pool;
 
   /* Properties which were modified during change_file_prop
@@ -59,9 +59,12 @@ struct dump_edit_baton {
   /* Temporary buffer to write property hashes to in human-readable
    * form. ### Is this really needed? */
   svn_stringbuf_t *propstring;
-   
-  /* Temporary file to write delta to along with its checksum. */
-  char *delta_abspath;
+
+  /* Temporary file used for textdelta application along with its
+     absolute path; these two variables should be allocated in the
+     per-edit-session pool */
+  const char *delta_abspath;
+  apr_file_t *delta_file;
 
   /* The checksum of the file the delta is being applied to */
   const char *base_checksum;
@@ -132,7 +135,7 @@ make_dir_baton(const char *path,
   if (pb)
     abspath = svn_uri_join("/", path, pool);
   else
-    abspath = apr_pstrdup(pool, "/");
+    abspath = "/";
 
   /* Strip leading slash from copyfrom_path so that the path is
      canonical and svn_relpath_join can be used */
@@ -143,12 +146,11 @@ make_dir_baton(const char *path,
   new_db->eb = eb;
   new_db->parent_dir_baton = pb;
   new_db->abspath = abspath;
-  new_db->copyfrom_path = copyfrom_path ?
-    apr_pstrdup(pool, copyfrom_path) : NULL;
+  new_db->copyfrom_path = copyfrom_path;
   new_db->copyfrom_rev = copyfrom_rev;
   new_db->added = added;
   new_db->written_out = FALSE;
-  new_db->deleted_entries = apr_hash_make(eb->pool);
+  new_db->deleted_entries = apr_hash_make(pool);
 
   return new_db;
 }
@@ -367,16 +369,16 @@ open_root(void *edit_baton,
           void **root_baton)
 {
   struct dump_edit_baton *eb = edit_baton;
-  /* Allocate a special pool for the edit_baton to avoid pool
-     lifetime issues */
 
-  eb->pool = svn_pool_create(pool);
+  /* Clear the per-revision pool after each revision */
+  svn_pool_clear(eb->pool);
+
   eb->props = apr_hash_make(eb->pool);
   eb->deleted_props = apr_hash_make(eb->pool);
   eb->propstring = svn_stringbuf_create("", eb->pool);
 
   *root_baton = make_dir_baton(NULL, NULL, SVN_INVALID_REVNUM,
-                               edit_baton, NULL, FALSE, pool);
+                               edit_baton, NULL, FALSE, eb->pool);
   LDR_DBG(("open_root %p\n", *root_baton));
 
   return SVN_NO_ERROR;
@@ -416,12 +418,14 @@ add_directory(const char *path,
 {
   struct dir_baton *pb = parent_baton;
   void *val;
-  struct dir_baton *new_db
-    = make_dir_baton(path, copyfrom_path, copyfrom_rev, pb->eb, pb, TRUE, pool);
+  struct dir_baton *new_db;
   svn_boolean_t is_copy;
 
   LDR_DBG(("add_directory %s\n", path));
 
+  new_db = make_dir_baton(path, copyfrom_path, copyfrom_rev, pb->eb,
+                          pb, TRUE, pb->eb->pool);
+
   /* Some pending properties to dump? */
   SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props), TRUE, pool));
 
@@ -478,13 +482,13 @@ open_directory(const char *path,
   if (pb && ARE_VALID_COPY_ARGS(pb->copyfrom_path, pb->copyfrom_rev))
     {
       copyfrom_path = svn_uri_join(pb->copyfrom_path,
-                                   svn_relpath_basename(path, pool),
-                                   pool);
+                                   svn_relpath_basename(path, NULL),
+                                   pb->eb->pool);
       copyfrom_rev = pb->copyfrom_rev;
     }
 
   new_db = make_dir_baton(path, copyfrom_path, copyfrom_rev, pb->eb, pb,
-                          FALSE, pool);
+                          FALSE, pb->eb->pool);
   *child_baton = new_db;
   return SVN_NO_ERROR;
 }
@@ -495,7 +499,6 @@ close_directory(void *dir_baton,
 {
   struct dir_baton *db = dir_baton;
   struct dump_edit_baton *eb = db->eb;
-  apr_pool_t *iterpool;
   apr_hash_index_t *hi;
 
   LDR_DBG(("close_directory %p\n", dir_baton));
@@ -506,11 +509,8 @@ close_directory(void *dir_baton,
   /* Some pending newlines to dump? */
   SVN_ERR(dump_newlines(eb, &(eb->dump_newlines), pool));
 
-  /* Create a pool just for iterations to allocate a loop variable */
-  iterpool = svn_pool_create(pool);
-
   /* Dump the deleted directory entries */
-  for (hi = apr_hash_first(iterpool, db->deleted_entries); hi;
+  for (hi = apr_hash_first(pool, db->deleted_entries); hi;
        hi = apr_hash_next(hi))
     {
       const void *key;
@@ -523,7 +523,6 @@ close_directory(void *dir_baton,
     }
 
   svn_hash__clear(db->deleted_entries, pool);
-  svn_pool_destroy(iterpool);
   return SVN_NO_ERROR;
 }
 
@@ -597,7 +596,8 @@ open_file(const char *path,
   if (pb && ARE_VALID_COPY_ARGS(pb->copyfrom_path, pb->copyfrom_rev))
     {
       copyfrom_path = svn_relpath_join(pb->copyfrom_path,
-                                       svn_relpath_basename(path, pool), pool);
+                                       svn_relpath_basename(path, NULL),
+                                       pb->eb->pool);
       copyfrom_rev = pb->copyfrom_rev;
     }
 
@@ -628,7 +628,7 @@ change_dir_prop(void *parent_baton,
     apr_hash_set(db->eb->props, apr_pstrdup(db->eb->pool, name),
                  APR_HASH_KEY_STRING, svn_string_dup(value, db->eb->pool));
   else
-    apr_hash_set(db->eb->deleted_props, apr_pstrdup(pool, name),
+    apr_hash_set(db->eb->deleted_props, apr_pstrdup(db->eb->pool, name),
                  APR_HASH_KEY_STRING, "");
 
   if (! db->written_out)
@@ -685,7 +685,6 @@ static svn_error_t *
 window_handler(svn_txdelta_window_t *window, void *baton)
 {
   struct handler_baton *hb = baton;
-  struct dump_edit_baton *eb = hb->eb;
   static svn_error_t *err;
 
   err = hb->apply_handler(window, hb->apply_baton);
@@ -695,11 +694,6 @@ window_handler(svn_txdelta_window_t *win
   if (err)
     SVN_ERR(err);
 
-  /* Write information about the filepath to hb->eb */
-  eb->delta_abspath = apr_pstrdup(eb->pool, hb->delta_abspath);
-
-  /* Cleanup */
-  svn_pool_destroy(hb->pool);
   return SVN_NO_ERROR;
 }
 
@@ -712,23 +706,23 @@ apply_textdelta(void *file_baton, const 
   struct dump_edit_baton *eb = file_baton;
 
   /* Custom handler_baton allocated in a separate pool */
-  apr_pool_t *handler_pool = svn_pool_create(pool);
-  struct handler_baton *hb = apr_pcalloc(handler_pool, sizeof(*hb));
-  hb->pool = handler_pool;
-  hb->eb = eb;
+  struct handler_baton *hb;
+  svn_stream_t *delta_filestream;
+
+  hb = apr_pcalloc(eb->pool, sizeof(*hb));
 
   LDR_DBG(("apply_textdelta %p\n", file_baton));
 
   /* Use a temporary file to measure the text-content-length */
-  SVN_ERR(svn_stream_open_unique(&(hb->delta_filestream), &hb->delta_abspath,
-                                 NULL, svn_io_file_del_none, hb->pool,
-                                 hb->pool));
+  delta_filestream = svn_stream_from_aprfile2(eb->delta_file, TRUE, pool);
 
-  /* Prepare to write the delta to the temporary file. */
+  /* Prepare to write the delta to the delta_filestream */
   svn_txdelta_to_svndiff2(&(hb->apply_handler), &(hb->apply_baton),
-                          hb->delta_filestream, 0, hb->pool);
+                          delta_filestream, 0, pool);
+
   eb->dump_text = TRUE;
-  eb->base_checksum = apr_pstrdup(pool, base_checksum);
+  eb->base_checksum = apr_pstrdup(eb->pool, base_checksum);
+  svn_stream_close(delta_filestream);
 
   /* The actual writing takes place when this function has
      finished. Set handler and handler_baton now so for
@@ -745,9 +739,10 @@ close_file(void *file_baton,
            apr_pool_t *pool)
 {
   struct dump_edit_baton *eb = file_baton;
-  apr_file_t *delta_file;
   svn_stream_t *delta_filestream;
   apr_finfo_t *info = apr_pcalloc(pool, sizeof(apr_finfo_t));
+  apr_off_t offset;
+  apr_status_t err;
 
   LDR_DBG(("close_file %p\n", file_baton));
 
@@ -763,7 +758,9 @@ close_file(void *file_baton,
                                 SVN_REPOS_DUMPFILE_TEXT_DELTA
                                 ": true\n"));
 
-      SVN_ERR(svn_io_stat(info, eb->delta_abspath, APR_FINFO_SIZE, pool));
+      err = apr_file_info_get(info, APR_FINFO_SIZE, eb->delta_file);
+      if (err)
+        SVN_ERR(svn_error_wrap_apr(err, NULL));
 
       if (eb->base_checksum)
         /* Text-delta-base-md5: */
@@ -813,18 +810,19 @@ close_file(void *file_baton,
   /* Dump the text */
   if (eb->dump_text)
     {
-      /* Open the temporary file, map it to a stream, copy
-         the stream to eb->stream, close and delete the
-         file */
-      SVN_ERR(svn_io_file_open(&delta_file, eb->delta_abspath, APR_READ,
-                               APR_OS_DEFAULT, pool));
-      delta_filestream = svn_stream_from_aprfile2(delta_file, TRUE, pool);
+      /* Seek to the beginning of the delta file, map it to a stream,
+         and copy the stream to eb->stream. Then close the stream and
+         truncate the file so we can reuse it for the next textdelta
+         application. Note that the file isn't created, opened or
+         closed here */
+      offset = 0;
+      SVN_ERR(svn_io_file_seek(eb->delta_file, APR_SET, &offset, pool));
+      delta_filestream = svn_stream_from_aprfile2(eb->delta_file, TRUE, pool);
       SVN_ERR(svn_stream_copy3(delta_filestream, eb->stream, NULL, NULL, pool));
 
       /* Cleanup */
-      SVN_ERR(svn_io_file_close(delta_file, pool));
       SVN_ERR(svn_stream_close(delta_filestream));
-      SVN_ERR(svn_io_remove_file2(eb->delta_abspath, TRUE, pool));
+      SVN_ERR(svn_io_file_trunc(eb->delta_file, 0, pool));
       eb->dump_text = FALSE;
     }
 
@@ -838,10 +836,6 @@ close_file(void *file_baton,
 static svn_error_t *
 close_edit(void *edit_baton, apr_pool_t *pool)
 {
-  struct dump_edit_baton *eb = edit_baton;
-  LDR_DBG(("close_edit\n"));
-  svn_pool_destroy(eb->pool);
-
   return SVN_NO_ERROR;
 }
 
@@ -857,6 +851,15 @@ get_dump_editor(const svn_delta_editor_t
   eb = apr_pcalloc(pool, sizeof(struct dump_edit_baton));
   eb->stream = stream;
 
+  /* Create a special per-revision pool */
+  eb->pool = svn_pool_create(pool);
+
+  /* Open a unique temporary file for all textdelta applications in
+     this edit session. The file is automatically closed and cleaned
+     up when the edit session is done. */
+  SVN_ERR(svn_io_open_unique_file3(&(eb->delta_file), &(eb->delta_abspath),
+                                   NULL, svn_io_file_del_on_close, pool, pool));
+
   de = svn_delta_default_editor(pool);
   de->open_root = open_root;
   de->delete_entry = delete_entry;

Modified: subversion/branches/object-model/subversion/svnrdump/dump_editor.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svnrdump/dump_editor.h?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svnrdump/dump_editor.h (original)
+++ subversion/branches/object-model/subversion/svnrdump/dump_editor.h Fri Oct  8 20:13:26 2010
@@ -64,17 +64,6 @@ struct handler_baton
 {
   svn_txdelta_window_handler_t apply_handler;
   void *apply_baton;
-
-  /* Pool used for temporary allocations during delta application in
-     window_handler() */
-  apr_pool_t *pool;
-
-  /* Information about the path of the temporary file used */
-  const char *delta_abspath;
-  svn_stream_t *delta_filestream;
-
-  /* Global edit baton */
-  struct dump_edit_baton *eb;
 };
 
 /**

Modified: subversion/branches/object-model/subversion/svnrdump/load_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svnrdump/load_editor.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svnrdump/load_editor.c (original)
+++ subversion/branches/object-model/subversion/svnrdump/load_editor.c Fri Oct  8 20:13:26 2010
@@ -39,7 +39,7 @@
 #define SVNRDUMP_PROP_LOCK SVN_PROP_PREFIX "rdump-lock"
 #define LOCK_RETRIES 10
 
-#ifdef SVN_DEBUG
+#if 0
 #define LDR_DBG(x) SVN_DBG(x)
 #else
 #define LDR_DBG(x) while(0)

Modified: subversion/branches/object-model/subversion/svnrdump/load_editor.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svnrdump/load_editor.h?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svnrdump/load_editor.h (original)
+++ subversion/branches/object-model/subversion/svnrdump/load_editor.h Fri Oct  8 20:13:26 2010
@@ -89,11 +89,10 @@ struct revision_baton
 };
 
 /**
- * Build up a load editor @a parser for parsing a dumpfile stream from @a stream
- * set to fire the appropriate callbacks in load editor along with a
- * @a parser_baton, using @a pool for all memory allocations. The
- * @a editor/ @a edit_baton are central to the functionality of the
- *  parser.
+ * Build up a dumpstream parser @a parser (and corresponding baton @a
+ * parse_baton) to fire the appropriate callbacks in a commit editor
+ * set to commit to session @a session. Use @a pool for all memory
+ * allocations.
  */
 svn_error_t *
 get_dumpstream_loader(const svn_repos_parse_fns2_t **parser,
@@ -102,8 +101,10 @@ get_dumpstream_loader(const svn_repos_pa
                       apr_pool_t *pool);
 
 /**
- * Drive the load editor @a editor using the data in @a stream using
- * @a pool for all memory allocations.
+ * Drive the dumpstream loader described by @a parser and @a
+ * parse_baton to parse and commit the stream @a stream to the
+ * location described by @a session. Use @a pool for all memory
+ * allocations.
  */
 svn_error_t *
 drive_dumpstream_loader(svn_stream_t *stream,

Modified: subversion/branches/object-model/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svnrdump/svnrdump.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svnrdump/svnrdump.c (original)
+++ subversion/branches/object-model/subversion/svnrdump/svnrdump.c Fri Oct  8 20:13:26 2010
@@ -110,7 +110,7 @@ struct replay_baton {
   svn_boolean_t quiet;
 };
 
-typedef struct {
+typedef struct opt_baton_t {
   svn_ra_session_t *session;
   const char *url;
   svn_revnum_t start_revision;

Modified: subversion/branches/object-model/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svnserve/serve.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svnserve/serve.c (original)
+++ subversion/branches/object-model/subversion/svnserve/serve.c Fri Oct  8 20:13:26 2010
@@ -1429,7 +1429,6 @@ static svn_error_t *get_dir(svn_ra_svn_c
   apr_uint64_t dirent_fields;
   apr_array_header_t *dirent_fields_list = NULL;
   svn_ra_svn_item_t *elt;
-  int i;
 
   SVN_ERR(svn_ra_svn_parse_tuple(params, pool, "c(?r)bb?l", &path, &rev,
                                  &want_props, &want_contents,
@@ -1441,6 +1440,8 @@ static svn_error_t *get_dir(svn_ra_svn_c
     }
   else
     {
+      int i;
+
       dirent_fields = 0;
 
       for (i = 0; i < dirent_fields_list->nelts; ++i)

Modified: subversion/branches/object-model/subversion/svnsync/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/svnsync/main.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/svnsync/main.c (original)
+++ subversion/branches/object-model/subversion/svnsync/main.c Fri Oct  8 20:13:26 2010
@@ -2149,15 +2149,7 @@ main(int argc, const char *argv[])
                                         check_cancel, NULL,
                                         pool);
   if (! err)
-    {
-      /* svnsync can safely create instance of QApplication class. */
-      svn_auth_set_parameter(opt_baton.source_auth_baton,
-                             "svn:auth:qapplication-safe", "1");
-      svn_auth_set_parameter(opt_baton.sync_auth_baton,
-                             "svn:auth:qapplication-safe", "1");
-
-      err = (*subcommand->cmd_func)(os, &opt_baton, pool);
-    }
+    err = (*subcommand->cmd_func)(os, &opt_baton, pool);
   if (err)
     {
       /* For argument-related problems, suggest using the 'help'

Modified: subversion/branches/object-model/subversion/tests/cmdline/copy_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/tests/cmdline/copy_tests.py?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/tests/cmdline/copy_tests.py (original)
+++ subversion/branches/object-model/subversion/tests/cmdline/copy_tests.py Fri Oct  8 20:13:26 2010
@@ -4671,7 +4671,6 @@ def move_added_nodes(sbox):
   expected_status.add({'X/Z' : Item(status='A ', wc_rev='0')})
   svntest.actions.run_and_verify_status(sbox.wc_dir, expected_status)
 
-# This test currently fails, but should work ok once we move to single DB
 def copy_over_deleted_dir(sbox):
   "copy a directory over a deleted directory"
   sbox.build(read_only = True)
@@ -4680,6 +4679,217 @@ def copy_over_deleted_dir(sbox):
   main.run_svn(None, 'cp', os.path.join(sbox.wc_dir, 'A/D'),
                os.path.join(sbox.wc_dir, 'A/B'))
 
+#----------------------------------------------------------------------
+
+def check_op_depth(path, expected_result):
+  """Examine the WC DB for paths PATH and below, and check that their rows
+     in the 'NODES' table match EXPECTED_RESULT.  EXPECTED_RESULT is a
+     dictionary of {(op_depth, relpath) -> has_repo_noderev}, where 'relpath'
+     is relative to PATH, and 'has_repo_noderev' is true iff the repository
+     id, revision and relpath columns are expected to be non-null.
+
+     If the result does not match, raise a Failure.
+  """
+
+  errors = []
+
+  db, _, base_relpath = svntest.wc.open_wc_db(path)
+  c = db.cursor()
+
+  c.execute("""SELECT op_depth, presence, local_relpath, repos_id, revision,
+                 repos_path FROM nodes
+               WHERE local_relpath = '""" + base_relpath + """'
+                 OR  local_relpath LIKE '""" + base_relpath + """/%'""")
+  for row in c:
+    op_depth = row[0]
+    wc_relpath = row[2]
+    repo_id = row[3]
+    repo_rev = row[4]
+    repo_relpath = row[5]
+    relpath = wc_relpath[len(base_relpath):]
+
+    try:
+      has_repo = expected_result.pop((op_depth, relpath))
+    except KeyError:
+      errors.append("Row not expected: op_depth=%s, relpath=%s"
+                    % (op_depth, relpath))
+      continue
+
+    try:
+      if has_repo:
+        assert repo_id and repo_rev and repo_relpath
+      else:
+        assert not repo_id and not repo_rev and not repo_relpath
+    except AssertionError:
+      print "  EXPECTED:", op_depth, relpath, has_repo
+      print "  ACTUAL:  ", op_depth, relpath, repo_relpath
+      errors.append("Row op_depth=%s, relpath=%s has repo_relpath=%s"
+                    % (op_depth, relpath, repo_relpath))
+      continue
+
+  for (op_depth, relpath) in expected_result:
+    errors.append("Row not found: op_depth=%s, relpath=%s"
+                  % (op_depth, relpath))
+
+  db.close()
+
+  if errors:
+    raise svntest.Failure(errors)
+
+def nodes_table_wc_wc_copies(sbox):
+  """test wc-to-wc copies"""
+  sbox.build()
+
+  def wc_path(*components):
+    return os.path.join(sbox.wc_dir, *components)
+
+  # Prepare various things to copy
+
+  source_base_file = wc_path('A', 'B', 'lambda')
+  source_base_dir = wc_path('A', 'B', 'E')
+
+  source_added_file = wc_path('A', 'B', 'file-added')
+  source_added_dir = wc_path('A', 'B', 'D-added')
+  source_added_dir2 = wc_path('A', 'B', 'D-added', 'D2')
+
+  svntest.main.file_write(source_added_file, 'New file')
+  sbox.simple_add(source_added_file)
+  sbox.simple_mkdir(source_added_dir)
+  sbox.simple_mkdir(source_added_dir2)
+
+  source_copied_file = wc_path('A', 'B', 'lambda-copied')
+  source_copied_dir = wc_path('A', 'B', 'E-copied')
+
+  svntest.main.run_svn(None, 'copy', source_base_file, source_copied_file)
+  svntest.main.run_svn(None, 'copy', source_base_dir, source_copied_dir)
+
+  # Test copying various things
+
+  # base file
+  target = wc_path('A', 'C', 'copy1')
+  svntest.main.run_svn(None, 'copy', source_base_file, target)
+  check_op_depth(target, { (3, ''):       True })
+
+  # base dir
+  target = wc_path('A', 'C', 'copy2')
+  svntest.main.run_svn(None, 'copy', source_base_dir, target)
+  check_op_depth(target, { (3, ''):       True,
+                           (3, '/alpha'): False,
+                           (3, '/beta'):  False })
+
+  # added file
+  target = wc_path('A', 'C', 'copy3')
+  svntest.main.run_svn(None, 'copy', source_added_file, target)
+  check_op_depth(target, { (3, ''):       False })
+
+  # added dir
+  target = wc_path('A', 'C', 'copy4')
+  svntest.main.run_svn(None, 'copy', source_added_dir, target)
+  check_op_depth(target, { (3, ''):       False,
+                           (4, '/D2'):    False })
+
+  # copied file
+  target = wc_path('A', 'C', 'copy5')
+  svntest.main.run_svn(None, 'copy', source_copied_file, target)
+  check_op_depth(target, { (3, ''):       True })
+
+  # copied dir
+  target = wc_path('A', 'C', 'copy6')
+  svntest.main.run_svn(None, 'copy', source_copied_dir, target)
+  check_op_depth(target, { (3, ''):       True,
+                           (3, '/alpha'): False,
+                           (3, '/beta'):  False })
+
+  # copied tree with everything in it
+  target = wc_path('A', 'C', 'copy7')
+  svntest.main.run_svn(None, 'copy', wc_path('A', 'B'), target)
+  check_op_depth(target, { (3, ''):               True,
+                           (3, '/lambda'):        False,
+                           (3, '/E'):             False,
+                           (3, '/E/alpha'):       False,
+                           (3, '/E/beta'):        False,
+                           (3, '/F'):             False,
+                           # Each add is an op_root
+                           (4, '/file-added'):    False,
+                           (4, '/D-added'):       False,
+                           (5, '/D-added/D2'):    False,
+                           # Each copied-copy subtree is an op_root
+                           (4, '/lambda-copied'): True,
+                           (4, '/E-copied'):      True,
+                           (4, '/E-copied/alpha'):False,
+                           (4, '/E-copied/beta'): False, })
+
+def mixed_rev_copy_del(sbox):
+  """copy mixed-rev and delete children"""
+  
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # Delete and commit A/B/E/alpha
+  svntest.main.run_svn(None, 'rm', sbox.ospath('A/B/E/alpha'))
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/B/E/alpha', status='D ')
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B/E/alpha': Item(verb='Deleting'),
+    })
+  expected_status.remove('A/B/E/alpha')
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output,
+                                        expected_status,
+                                        None,
+                                        wc_dir)
+
+  # Update to r2, then update A/B/E/alpha and A/B/E/beta to r1
+  svntest.main.run_svn(None, 'up', wc_dir)
+  expected_status.tweak(wc_rev=2)
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+  svntest.main.run_svn(None, 'up', '-r1',
+                       sbox.ospath('A/B/E/alpha'),
+                       sbox.ospath('A/B/E/beta'))
+  expected_status.add({
+    'A/B/E/alpha' : Item(status='  ', wc_rev=1),
+    })
+  expected_status.tweak('A/B/E/beta', wc_rev=1)
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+  # Copy A/B/E to A/B/E_copy
+  svntest.actions.run_and_verify_svn(None, None, [], 'cp',
+                                     sbox.ospath('A/B/E'),
+                                     sbox.ospath('A/B/E_copy'))
+  expected_status.add({
+    'A/B/E_copy'       : Item(status='A ', copied='+', wc_rev='-'),
+    'A/B/E_copy/alpha' : Item(status='  ', copied='+', wc_rev='-'),
+    'A/B/E_copy/beta'  : Item(status='  ', copied='+', wc_rev='-'),
+    })
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+  # Delete A/B/E_copy/alpha and A/B/E_copy/beta
+  svntest.main.run_svn(None, 'rm',
+                       sbox.ospath('A/B/E_copy/alpha'),
+                       sbox.ospath('A/B/E_copy/beta'))
+  expected_status.tweak('A/B/E_copy/alpha', 'A/B/E_copy/beta', status='D ')
+  svntest.actions.run_and_verify_status(wc_dir, expected_status)
+
+  # This test currently fails above, as both alpha and beta disappear
+  # from status, what should happen is unclear.  In 1.6 both names
+  # remained in status 'D'.
+
+  # The commit doesn't work either, it should not delete alpha but
+  # must delete beta.  In 1.6 both alpha and beta were deleted and the
+  # commit failed.  It's not clear how the client can determine that
+  # alpha and beta should be treated differently.
+  expected_output = svntest.wc.State(wc_dir, {
+    'A/B/E_copy'      : Item(verb='Adding'),
+    'A/B/E_copy/beta' : Item(verb='Deleting'),
+    })
+  expected_status.tweak('A/B/E_copy', wc_rev=3, copied=None)
+  expected_status.remove('A/B/E_copy/alpha', 'A/B/E_copy/beta')
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        expected_output,
+                                        expected_status,
+                                        None,
+                                        wc_dir)
 
 ########################################################################
 # Run the tests
@@ -4775,6 +4985,8 @@ test_list = [ None,
               XFail(changed_dir_data_should_match_checkout),
               move_added_nodes,
               copy_over_deleted_dir,
+              Wimp("Needs NODES table & op-depth", nodes_table_wc_wc_copies),
+              XFail(mixed_rev_copy_del),
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/object-model/subversion/tests/cmdline/diff_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/tests/cmdline/diff_tests.py?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/tests/cmdline/diff_tests.py (original)
+++ subversion/branches/object-model/subversion/tests/cmdline/diff_tests.py Fri Oct  8 20:13:26 2010
@@ -2409,8 +2409,12 @@ def diff_repos_wc_add_with_props(sbox):
   diff_X_bar_base_r3 = make_diff_header("X/bar", "revision 0",
                                                  "revision 3") + diff_X_bar
 
-  expected_output_r1_base = diff_X_r1_base + diff_X_bar_r1_base + diff_foo_r1_base
-  expected_output_base_r3 = diff_foo_base_r3 + diff_X_bar_base_r3 + diff_X_base_r3
+  expected_output_r1_base = svntest.verify.UnorderedOutput(diff_X_r1_base +
+                                                           diff_X_bar_r1_base +
+                                                           diff_foo_r1_base)
+  expected_output_base_r3 = svntest.verify.UnorderedOutput(diff_foo_base_r3 +
+                                                           diff_X_bar_base_r3 +
+                                                           diff_X_base_r3)
 
   os.chdir(sbox.wc_dir)
 

Modified: subversion/branches/object-model/subversion/tests/cmdline/log_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/tests/cmdline/log_tests.py?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/tests/cmdline/log_tests.py (original)
+++ subversion/branches/object-model/subversion/tests/cmdline/log_tests.py Fri Oct  8 20:13:26 2010
@@ -1297,7 +1297,7 @@ def log_changes_range(sbox):
 
   exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
                                                               'log', '-c',
-                                                              '2:5', repo_url)
+                                                              '2-5', repo_url)
 
   log_chain = parse_log_output(output)
   check_log_chain(log_chain, [2, 3, 4, 5])
@@ -1316,6 +1316,19 @@ def log_changes_list(sbox):
   log_chain = parse_log_output(output)
   check_log_chain(log_chain, [2, 5, 7])
 
+def log_changes_complex(sbox):
+  "test log -c on complex set of ranges"
+
+  guarantee_repos_and_wc(sbox)
+  repo_url = sbox.repo_url
+
+  exit_code, output, err = svntest.actions.run_and_verify_svn(None, None, [],
+                                                              'log', '-c',
+                                                              '2,5-3,-8,6-7', repo_url)
+
+  log_chain = parse_log_output(output)
+  check_log_chain(log_chain, [2, 5, 4, 3, 8, 6, 7])
+
 #----------------------------------------------------------------------
 def only_one_wc_path(sbox):
   "svn log of two wc paths is disallowed"
@@ -1760,8 +1773,9 @@ test_list = [ None,
               SkipUnless(merge_sensitive_log_added_path,
                          server_has_mergeinfo),
               log_single_change,
-              XFail(log_changes_range),
+              log_changes_range,
               log_changes_list,
+              log_changes_complex,
               only_one_wc_path,
               retrieve_revprops,
               log_xml_with_bad_data,

Modified: subversion/branches/object-model/subversion/tests/cmdline/merge_reintegrate_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/tests/cmdline/merge_reintegrate_tests.py?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/tests/cmdline/merge_reintegrate_tests.py (original)
+++ subversion/branches/object-model/subversion/tests/cmdline/merge_reintegrate_tests.py Fri Oct  8 20:13:26 2010
@@ -2075,8 +2075,8 @@ def added_subtrees_with_mergeinfo_break_
 #----------------------------------------------------------------------
 # Test for issue #3648 '2-URL merges incorrectly reverse-merge mergeinfo
 # for merge target'.
-def two_URL_merge_removes_valid_mergefino_from_target(sbox):
-  "2-URL merge removes valid mergefino from target"
+def two_URL_merge_removes_valid_mergeinfo_from_target(sbox):
+  "2-URL merge removes valid mergeinfo from target"
 
   sbox.build()
   wc_dir = sbox.wc_dir
@@ -2254,7 +2254,7 @@ test_list = [ None,
                          server_has_mergeinfo),
               reintegrate_with_self_referential_mergeinfo,
               added_subtrees_with_mergeinfo_break_reintegrate,
-              two_URL_merge_removes_valid_mergefino_from_target,
+              two_URL_merge_removes_valid_mergeinfo_from_target,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/object-model/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/tests/cmdline/merge_tests.py?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/object-model/subversion/tests/cmdline/merge_tests.py Fri Oct  8 20:13:26 2010
@@ -13846,7 +13846,9 @@ def merge_range_prior_to_rename_source_e
   nu_moved_path   = os.path.join(wc_dir, "A", "D", "H", "nu_moved")
   A_path          = os.path.join(wc_dir, "A")
   A_COPY_path     = os.path.join(wc_dir, "A_COPY")
+  A_COPY_2_path   = os.path.join(wc_dir, "A_COPY_2")
   B_COPY_path     = os.path.join(wc_dir, "A_COPY", "B")
+  B_COPY_2_path   = os.path.join(wc_dir, "A_COPY_2", "B")
   beta_COPY_path  = os.path.join(wc_dir, "A_COPY", "B", "E", "beta")
   gamma_COPY_path = os.path.join(wc_dir, "A_COPY", "D", "gamma")
   rho_COPY_path   = os.path.join(wc_dir, "A_COPY", "D", "G", "rho")
@@ -13856,27 +13858,28 @@ def merge_range_prior_to_rename_source_e
 
   # Setup our basic 'trunk' and 'branch':
   # r2 - Copy A to A_COPY
-  # r3 - Text change to A/D/H/psi
-  # r4 - Text change to A/D/G/rho
-  # r5 - Text change to A/B/E/beta
-  # r6 - Text change to A/D/H/omega
-  wc_disk, wc_status = set_up_branch(sbox, False, 1)
+  # r3 - Copy A to A_COPY_2
+  # r4 - Text change to A/D/H/psi
+  # r5 - Text change to A/D/G/rho
+  # r6 - Text change to A/B/E/beta
+  # r7 - Text change to A/D/H/omega
+  wc_disk, wc_status = set_up_branch(sbox, False, 2)
 
-  # r7 - Add the file A/D/H/nu
+  # r8 - Add the file A/D/H/nu
   svntest.main.file_write(nu_path, "This is the file 'nu'.\n")
   svntest.actions.run_and_verify_svn(None, None, [], 'add', nu_path)
   expected_output = wc.State(wc_dir, {'A/D/H/nu' : Item(verb='Adding')})
-  wc_status.add({'A/D/H/nu' : Item(status='  ', wc_rev=7)})
+  wc_status.add({'A/D/H/nu' : Item(status='  ', wc_rev=8)})
   svntest.actions.run_and_verify_commit(wc_dir, expected_output,
                                         wc_status, None, wc_dir)
 
-  # r8 - Merge all available revisions (i.e. -r1:7) from A to A_COPY.
-  svntest.actions.run_and_verify_svn(None, ["At revision 7.\n"], [], 'up',
+  # r9 - Merge all available revisions (i.e. -r1:8) from A to A_COPY.
+  svntest.actions.run_and_verify_svn(None, ["At revision 8.\n"], [], 'up',
                                      wc_dir)
-  wc_status.tweak(wc_rev=7)
+  wc_status.tweak(wc_rev=8)
   svntest.actions.run_and_verify_svn(
     None,
-    expected_merge_output([[2,7]],
+    expected_merge_output([[2,8]],
                           ['A    ' + nu_COPY_path  + '\n',
                            'U    ' + beta_COPY_path  + '\n',
                            'U    ' + rho_COPY_path   + '\n',
@@ -13896,45 +13899,45 @@ def merge_range_prior_to_rename_source_e
                   'A_COPY/D/G/rho',
                   'A_COPY/D/H/omega',
                   'A_COPY/D/H/psi',
-                  wc_rev=8)
-  wc_status.add({'A_COPY/D/H/nu' : Item(status='  ', wc_rev=8)})
+                  wc_rev=9)
+  wc_status.add({'A_COPY/D/H/nu' : Item(status='  ', wc_rev=9)})
   svntest.actions.run_and_verify_commit(wc_dir, expected_output,
                                         wc_status, None, wc_dir)
 
-  # r9 - Reverse merge -r7:1 from A/B to A_COPY/B
-  svntest.actions.run_and_verify_svn(None, ["At revision 8.\n"], [], 'up',
+  # r10 - Reverse merge -r8:1 from A/B to A_COPY/B
+  svntest.actions.run_and_verify_svn(None, ["At revision 9.\n"], [], 'up',
                                      wc_dir)
-  wc_status.tweak(wc_rev=8)
+  wc_status.tweak(wc_rev=9)
   svntest.actions.run_and_verify_svn(
     None,
-    expected_merge_output([[7,2]], ['U    ' + beta_COPY_path  + '\n',
+    expected_merge_output([[8,2]], ['U    ' + beta_COPY_path  + '\n',
                                     ' G   ' + B_COPY_path     + '\n',]),
-    [], 'merge', sbox.repo_url + '/A/B', B_COPY_path, '-r7:1')
+    [], 'merge', sbox.repo_url + '/A/B', B_COPY_path, '-r8:1')
   expected_output = wc.State(wc_dir,
                              {'A_COPY/B'        : Item(verb='Sending'),
                               'A_COPY/B/E/beta' : Item(verb='Sending')})
   wc_status.tweak('A_COPY/B',
                   'A_COPY/B/E/beta',
-                  wc_rev=9)
+                  wc_rev=10)
   svntest.actions.run_and_verify_commit(wc_dir, expected_output,
                                         wc_status, None, wc_dir)
 
-  # r10 - Move A/D/H/nu to A/D/H/nu_moved
+  # r11 - Move A/D/H/nu to A/D/H/nu_moved
   svntest.actions.run_and_verify_svn(None, ["\n",
-                                            "Committed revision 10.\n"], [],
+                                            "Committed revision 11.\n"], [],
                                      'move', sbox.repo_url + '/A/D/H/nu',
                                      sbox.repo_url + '/A/D/H/nu_moved',
                                      '-m', 'Move nu to nu_moved')
   svntest.actions.run_and_verify_svn(None,
                                      ["D    " + nu_path + "\n",
                                       "A    " + nu_moved_path + "\n",
-                                      "Updated to revision 10.\n"],
+                                      "Updated to revision 11.\n"],
                                      [], 'up', wc_dir)
 
-  # Now merge -r5:10 from A to A_COPY.
-  # A_COPY needs only -r7:10, which amounts only to the rename of nu.
-  # The subtree A_COPY/B needs the entire range -r5:10 because of
-  # the reverse merge we performed in r9; but none of these revisions
+  # Now merge -r6:11 from A to A_COPY.
+  # A_COPY needs only -r8:11, which amounts only to the rename of nu.
+  # The subtree A_COPY/B needs the entire range -r6:11 because of
+  # the reverse merge we performed in r10; but none of these revisions
   # is operative in A/B so there are no changes to A_COPY/B.
   #
   # This merge currently fails because the delete half of the A_COPY/D/H/nu
@@ -13950,30 +13953,30 @@ def merge_range_prior_to_rename_source_e
   expected_elision_output = wc.State(A_COPY_path, {
     })
   expected_status = wc.State(A_COPY_path, {
-    ''             : Item(status=' M', wc_rev=10),
-    'B'            : Item(status=' M', wc_rev=10),
-    'mu'           : Item(status='  ', wc_rev=10),
-    'B/E'          : Item(status='  ', wc_rev=10),
-    'B/E/alpha'    : Item(status='  ', wc_rev=10),
-    'B/E/beta'     : Item(status='  ', wc_rev=10),
-    'B/lambda'     : Item(status='  ', wc_rev=10),
-    'B/F'          : Item(status='  ', wc_rev=10),
-    'C'            : Item(status='  ', wc_rev=10),
-    'D'            : Item(status='  ', wc_rev=10),
-    'D/G'          : Item(status='  ', wc_rev=10),
-    'D/G/pi'       : Item(status='  ', wc_rev=10),
-    'D/G/rho'      : Item(status='  ', wc_rev=10),
-    'D/G/tau'      : Item(status='  ', wc_rev=10),
-    'D/gamma'      : Item(status='  ', wc_rev=10),
-    'D/H'          : Item(status='  ', wc_rev=10),
-    'D/H/nu'       : Item(status='D ', wc_rev='10'),
+    ''             : Item(status=' M', wc_rev=11),
+    'B'            : Item(status='  ', wc_rev=11),
+    'mu'           : Item(status='  ', wc_rev=11),
+    'B/E'          : Item(status='  ', wc_rev=11),
+    'B/E/alpha'    : Item(status='  ', wc_rev=11),
+    'B/E/beta'     : Item(status='  ', wc_rev=11),
+    'B/lambda'     : Item(status='  ', wc_rev=11),
+    'B/F'          : Item(status='  ', wc_rev=11),
+    'C'            : Item(status='  ', wc_rev=11),
+    'D'            : Item(status='  ', wc_rev=11),
+    'D/G'          : Item(status='  ', wc_rev=11),
+    'D/G/pi'       : Item(status='  ', wc_rev=11),
+    'D/G/rho'      : Item(status='  ', wc_rev=11),
+    'D/G/tau'      : Item(status='  ', wc_rev=11),
+    'D/gamma'      : Item(status='  ', wc_rev=11),
+    'D/H'          : Item(status='  ', wc_rev=11),
+    'D/H/nu'       : Item(status='D ', wc_rev=11),
     'D/H/nu_moved' : Item(status='A ', wc_rev='-', copied='+'),
-    'D/H/chi'      : Item(status='  ', wc_rev=10),
-    'D/H/psi'      : Item(status='  ', wc_rev=10),
-    'D/H/omega'    : Item(status='  ', wc_rev=10),
+    'D/H/chi'      : Item(status='  ', wc_rev=11),
+    'D/H/psi'      : Item(status='  ', wc_rev=11),
+    'D/H/omega'    : Item(status='  ', wc_rev=11),
     })
   expected_disk = wc.State('', {
-    ''             : Item(props={SVN_PROP_MERGEINFO : '/A:2-10'}),
+    ''             : Item(props={SVN_PROP_MERGEINFO : '/A:2-11'}),
     'mu'           : Item("This is the file 'mu'.\n"),
     # A_COPY/B wasn't touched by the merge so keeps its existing mergeinfo.
     'B'            : Item(props={SVN_PROP_MERGEINFO : ''}),
@@ -13996,7 +13999,130 @@ def merge_range_prior_to_rename_source_e
     'D/H/omega'    : Item("New content"),
     })
   expected_skip = wc.State(A_COPY_path, {})
-  svntest.actions.run_and_verify_merge(A_COPY_path, 5, 10,
+  svntest.actions.run_and_verify_merge(A_COPY_path, 6, 11,
+                                       sbox.repo_url + '/A', None,
+                                       expected_output,
+                                       expected_mergeinfo_output,
+                                       expected_elision_output,
+                                       expected_disk,
+                                       expected_status,
+                                       expected_skip,
+                                       None, None, None, None,
+                                       None, 1, 1)
+  svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
+                                     'Merge -r6:11 from A to A_COPY', wc_dir)
+
+  # Now run a similar scenario as above on the second branch, but with
+  # a reverse merge this time.
+  #
+  # r13 - Merge all available revisions from A/B to A_COPY_B and then merge
+  # -r2:8 from A to A_COPY_2.  Among other things, this adds A_COPY_2/D/H/nu
+  # and leaves us with mergeinfo on the A_COPY_2 branch of:
+  #
+  #   Properties on 'A_COPY_2':
+  #     svn:mergeinfo
+  #       /A:3-8
+  #   Properties on 'A_COPY_2\B':
+  #     svn:mergeinfo
+  #       /A/B:3-12
+  svntest.actions.run_and_verify_svn(None, ["At revision 12.\n"], [], 'up',
+                                     wc_dir)
+  svntest.actions.run_and_verify_svn(None,
+                                     None, # Don't check stdout, we test this
+                                           # type of merge to death elsewhere.
+                                     [], 'merge', sbox.repo_url + '/A/B',
+                                     B_COPY_2_path)
+  svntest.actions.run_and_verify_svn(None, None,[], 'merge', '-r', '2:8',
+                                     sbox.repo_url + '/A', A_COPY_2_path)  
+  svntest.actions.run_and_verify_svn(
+    None, None, [], 'ci', '-m',
+    'Merge all from A/B to A_COPY_2/B\nMerge -r2:8 from A to A_COPY_2',
+    wc_dir)
+  svntest.actions.run_and_verify_svn(None, ["At revision 13.\n"], [], 'up',
+                                     wc_dir)
+
+  # Now reverse merge -r12:7 from A to A_COPY_2.
+  #
+  # Recall:
+  #
+  #   >svn log -r8:12 ^/A -v
+  #   ------------------------------------------------------------------------
+  #   r8 | jrandom | 2010-10-05 11:52:17 -0400 (Tue, 05 Oct 2010) | 1 line
+  #   Changed paths:
+  #      A /A/D/H/nu
+  #   
+  #   log msg
+  #   ------------------------------------------------------------------------
+  #   r11 | jrandom | 2010-10-05 11:52:19 -0400 (Tue, 05 Oct 2010) | 1 line
+  #   Changed paths:
+  #      D /A/D/H/nu
+  #      A /A/D/H/nu_moved (from /A/D/H/nu:10)
+  #
+  #   Move nu to nu_moved
+  #   ------------------------------------------------------------------------
+  #
+  # None of those revisions touch A/B, so A_COPY_2/B will remain unchanged by
+  # the merge.  Since we can only reverse merge changes from the explicit
+  # mergeinfo or natural history of a target, the only eligible revision to
+  # affect the remainder of the tree  rooted at A_COPY_2 is r8, the addition
+  # of A/D/H/nu.  So A_COPY/D/H/nu should deleted.  However, like the forward
+  # merge performed earlier, A_COPY/D/H/nu is reported as deleted, but still
+  # remains in the WC.
+  expected_output = wc.State(A_COPY_2_path, {
+    'D/H/nu'       : Item(status='D '),
+    })
+  expected_mergeinfo_output = wc.State(A_COPY_2_path, {
+    '' : Item(status=' U'),
+    })
+  expected_elision_output = wc.State(A_COPY_2_path, {
+    })
+  expected_status = wc.State(A_COPY_2_path, {
+    ''             : Item(status=' M'),
+    'B'            : Item(status='  '),
+    'mu'           : Item(status='  '),
+    'B/E'          : Item(status='  '),
+    'B/E/alpha'    : Item(status='  '),
+    'B/E/beta'     : Item(status='  '),
+    'B/lambda'     : Item(status='  '),
+    'B/F'          : Item(status='  '),
+    'C'            : Item(status='  '),
+    'D'            : Item(status='  '),
+    'D/G'          : Item(status='  '),
+    'D/G/pi'       : Item(status='  '),
+    'D/G/rho'      : Item(status='  '),
+    'D/G/tau'      : Item(status='  '),
+    'D/gamma'      : Item(status='  '),
+    'D/H'          : Item(status='  '),
+    'D/H/nu'       : Item(status='D '),
+    'D/H/chi'      : Item(status='  '),
+    'D/H/psi'      : Item(status='  '),
+    'D/H/omega'    : Item(status='  '),
+    })
+  expected_status.tweak(wc_rev=13)
+  expected_disk = wc.State('', {
+    ''             : Item(props={SVN_PROP_MERGEINFO : '/A:3-7'}),
+    'mu'           : Item("This is the file 'mu'.\n"),
+    # A_COPY_2/B wasn't touched by the merge so keeps its existing mergeinfo.
+    'B'            : Item(props={SVN_PROP_MERGEINFO : '/A/B:3-12'}),
+    'B/E'          : Item(),
+    'B/E/alpha'    : Item("This is the file 'alpha'.\n"),
+    'B/E/beta'     : Item("New content"),
+    'B/lambda'     : Item("This is the file 'lambda'.\n"),
+    'B/F'          : Item(),
+    'C'            : Item(),
+    'D'            : Item(),
+    'D/G'          : Item(),
+    'D/G/pi'       : Item("This is the file 'pi'.\n"),
+    'D/G/rho'      : Item("New content"),
+    'D/G/tau'      : Item("This is the file 'tau'.\n"),
+    'D/gamma'      : Item("This is the file 'gamma'.\n"),
+    'D/H'          : Item(),
+    'D/H/chi'      : Item("This is the file 'chi'.\n"),
+    'D/H/psi'      : Item("New content"),
+    'D/H/omega'    : Item("New content"),
+    })
+  expected_skip = wc.State(A_COPY_path, {})
+  svntest.actions.run_and_verify_merge(A_COPY_2_path, 12, 7,
                                        sbox.repo_url + '/A', None,
                                        expected_output,
                                        expected_mergeinfo_output,

Modified: subversion/branches/object-model/subversion/tests/cmdline/patch_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/tests/cmdline/patch_tests.py?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/tests/cmdline/patch_tests.py (original)
+++ subversion/branches/object-model/subversion/tests/cmdline/patch_tests.py Fri Oct  8 20:13:26 2010
@@ -2987,7 +2987,7 @@ def patch_prop_with_fuzz(sbox):
                                        1, # check-props
                                        1) # dry-run
 
-def patch_git_add_file(sbox):
+def patch_git_empty_files(sbox):
   "patch that contains empty files"
 
   sbox.build()
@@ -3001,18 +3001,25 @@ def patch_git_add_file(sbox):
     "===================================================================\n",
     "diff --git a/new b/new\n",
     "new file mode 10644\n",
+    "Index: iota\n",
+    "===================================================================\n",
+    "diff --git a/iota b/iota\n",
+    "deleted file mode 10644\n",
   ]
 
   svntest.main.file_write(patch_file_path, ''.join(unidiff_patch))
 
   expected_output = [
     'A         %s\n' % os.path.join(wc_dir, 'new'),
+    'D         %s\n' % os.path.join(wc_dir, 'iota'),
   ]
   expected_disk = svntest.main.greek_state.copy()
   expected_disk.add({'new' : Item(contents="")})
+  expected_disk.remove('iota')
 
   expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
   expected_status.add({'new' : Item(status='A ', wc_rev=0)})
+  expected_status.tweak('iota', status='D ')
 
   expected_skip = wc.State('', { })
 
@@ -3380,7 +3387,7 @@ test_list = [ None,
               patch_add_path_with_props,
               patch_prop_offset,
               patch_prop_with_fuzz,
-              patch_git_add_file,
+              patch_git_empty_files,
               patch_old_target_names,
               patch_reverse_revert,
             ]