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

svn commit: r1498045 [7/8] - in /subversion/branches/fsfs-format7: ./ build/ build/generator/ build/generator/templates/ notes/tree-conflicts/ subversion/bindings/cxxhl/include/ subversion/bindings/cxxhl/include/svncxxhl/ subversion/bindings/cxxhl/src/...

Modified: subversion/branches/fsfs-format7/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/cl.h?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/cl.h (original)
+++ subversion/branches/fsfs-format7/subversion/svn/cl.h Sun Jun 30 01:03:10 2013
@@ -239,6 +239,9 @@ typedef struct svn_cl__opt_state_t
   svn_boolean_t include_externals; /* Recurses (in)to file & dir externals */
   svn_boolean_t show_inherited_props;  /* get inherited properties */
   apr_array_header_t* search_patterns; /* pattern arguments for --search */
+  svn_boolean_t mergeinfo_log;     /* show log message in mergeinfo command */
+  svn_boolean_t remove_unversioned;/* remove unversioned items */
+  svn_boolean_t remove_ignored;    /* remove ignored items */
 } svn_cl__opt_state_t;
 
 
@@ -820,23 +823,6 @@ svn_cl__local_style_skip_ancestor(const 
                                   const char *path,
                                   apr_pool_t *pool);
 
-/* Check that PATH_OR_URL1@REVISION1 is related to PATH_OR_URL2@REVISION2.
- * Raise an error if not.
- *
- * ### Ideally we would also check that they are on different lines of
- * history.  That is easy in common cases, but to give a correct answer in
- * general we need to know the operative revision(s) as well.  For example,
- * when one location is the branch point from which the other branch was
- * copied.
- */
-svn_error_t *
-svn_cl__check_related_source_and_target(const char *path_or_url1,
-                                        const svn_opt_revision_t *revision1,
-                                        const char *path_or_url2,
-                                        const svn_opt_revision_t *revision2,
-                                        svn_client_ctx_t *ctx,
-                                        apr_pool_t *pool);
-
 /* If the user is setting a mime-type to mark one of the TARGETS as binary,
  * as determined by property name PROPNAME and value PROPVAL, then check
  * whether Subversion's own binary-file detection recognizes the target as

Modified: subversion/branches/fsfs-format7/subversion/svn/cleanup-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/cleanup-cmd.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/cleanup-cmd.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/cleanup-cmd.c Sun Jun 30 01:03:10 2013
@@ -69,7 +69,10 @@ svn_cl__cleanup(apr_getopt_t *os,
 
       svn_pool_clear(subpool);
       SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
-      err = svn_client_cleanup(target, ctx, subpool);
+      err = svn_client_cleanup2(target, opt_state->include_externals,
+                                opt_state->remove_unversioned,
+                                opt_state->remove_ignored,
+                                ctx, subpool);
       if (err && err->apr_err == SVN_ERR_WC_LOCKED)
         {
           const char *target_abspath;
@@ -79,6 +82,16 @@ svn_cl__cleanup(apr_getopt_t *os,
             {
               err =  svn_error_compose_create(err, err2);
             }
+          else if (opt_state->remove_unversioned || opt_state->remove_ignored)
+            {
+              err = svn_error_create(SVN_ERR_WC_LOCKED, err,
+                                     _("Working copy locked; if no other "
+                                       "Subversion client is currently "
+                                       "using the working copy, try running "
+                                       "'svn cleanup' without the "
+                                       "--remove-unversioned and "
+                                       "--remove-ignored options first."));
+            }
           else
             {
               const char *wcroot_abspath;

Modified: subversion/branches/fsfs-format7/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/conflict-callbacks.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/conflict-callbacks.c Sun Jun 30 01:03:10 2013
@@ -455,7 +455,7 @@ static const resolver_option_t text_conf
                                   -1 },
   { "df", N_("show diff"),        N_("show all changes made to merged file"),
                                   -1 },
-  { "r",  N_("resolved"),         N_("accept merged version of file"),
+  { "r",  N_("mark resolved"),   N_("accept merged version of file"),
                                   svn_wc_conflict_choose_merged },
   { "",   "",                     "", svn_wc_conflict_choose_unspecified },
   { "dc", N_("display conflict"), N_("show all conflicts "
@@ -475,13 +475,13 @@ static const resolver_option_t text_conf
                                      "(same)  [theirs-full]"),
                                   svn_wc_conflict_choose_theirs_full },
   { "",   "",                     "", svn_wc_conflict_choose_unspecified },
-  { "p",  N_("postpone"),         N_("mark the conflict to be resolved later"
-                                     "  [postpone]"),
-                                  svn_wc_conflict_choose_postpone },
   { "m",  N_("merge"),            N_("use internal merge tool to resolve "
                                      "conflict"), -1 },
   { "l",  N_("launch tool"),      N_("launch external tool to resolve "
                                      "conflict  [launch]"), -1 },
+  { "p",  N_("postpone"),         N_("mark the conflict to be resolved later"
+                                     "  [postpone]"),
+                                  svn_wc_conflict_choose_postpone },
   { "q",  N_("quit resolution"),  N_("postpone all remaining conflicts"),
                                   svn_wc_conflict_choose_postpone },
   { "s",  N_("show all options"), N_("show this list (also 'h', '?')"), -1 },
@@ -491,9 +491,6 @@ static const resolver_option_t text_conf
 /* Resolver options for a property conflict */
 static const resolver_option_t prop_conflict_options[] =
 {
-  { "p",  N_("postpone"),         N_("mark the conflict to be resolved later"
-                                     "  [postpone]"),
-                                  svn_wc_conflict_choose_postpone },
   { "mf", N_("my version"),       N_("accept my version of entire property (even "
                                      "non-conflicts)  [mine-full]"),
                                   svn_wc_conflict_choose_mine_full },
@@ -503,8 +500,11 @@ static const resolver_option_t prop_conf
   { "dc", N_("display conflict"), N_("show conflicts in this property"), -1 },
   { "e",  N_("edit property"),    N_("change merged property value in an editor"
                                      "  [edit]"), -1 },
-  { "r",  N_("resolved"),         N_("accept edited version of property"),
+  { "r",  N_("mark resolved"),    N_("accept edited version of property"),
                                   svn_wc_conflict_choose_merged },
+  { "p",  N_("postpone"),         N_("mark the conflict to be resolved later"
+                                     "  [postpone]"),
+                                  svn_wc_conflict_choose_postpone },
   { "q",  N_("quit resolution"),  N_("postpone all remaining conflicts"),
                                   svn_wc_conflict_choose_postpone },
   { "h",  N_("help"),             N_("show this help (also '?')"), -1 },
@@ -514,15 +514,15 @@ static const resolver_option_t prop_conf
 /* Resolver options for an obstructued addition */
 static const resolver_option_t obstructed_add_options[] =
 {
-  { "p",  N_("postpone"),         N_("mark the conflict to be resolved later"
-                                     "  [postpone]"),
-                                  svn_wc_conflict_choose_postpone },
   { "mf", N_("my version"),       N_("accept pre-existing item (ignore "
                                      "upstream addition)  [mine-full]"),
                                   svn_wc_conflict_choose_mine_full },
   { "tf", N_("their version"),    N_("accept incoming item (overwrite "
                                      "pre-existing item)  [theirs-full]"),
                                   svn_wc_conflict_choose_theirs_full },
+  { "p",  N_("postpone"),         N_("mark the conflict to be resolved later"
+                                     "  [postpone]"),
+                                  svn_wc_conflict_choose_postpone },
   { "q",  N_("quit resolution"),  N_("postpone all remaining conflicts"),
                                   svn_wc_conflict_choose_postpone },
   { "h",  N_("help"),             N_("show this help (also '?')"), -1 },
@@ -532,10 +532,10 @@ static const resolver_option_t obstructe
 /* Resolver options for a tree conflict */
 static const resolver_option_t tree_conflict_options[] =
 {
+  { "r",  N_("mark resolved"),    N_("accept current working copy state"),
+                                  svn_wc_conflict_choose_merged },
   { "p",  N_("postpone"),         N_("resolve the conflict later  [postpone]"),
                                   svn_wc_conflict_choose_postpone },
-  { "r",  N_("resolved"),         N_("accept current working copy state"),
-                                  svn_wc_conflict_choose_merged },
   { "q",  N_("quit resolution"),  N_("postpone all remaining conflicts"),
                                   svn_wc_conflict_choose_postpone },
   { "h",  N_("help"),             N_("show this help (also '?')"), -1 },
@@ -544,53 +544,32 @@ static const resolver_option_t tree_conf
 
 static const resolver_option_t tree_conflict_options_update_moved_away[] =
 {
-  { "p",  N_("postpone"),         N_("resolve the conflict later  [postpone]"),
-                                  svn_wc_conflict_choose_postpone },
-  { "mc", N_("my side of conflict"), N_("apply update to the move destination"
-                                        "  [mine-conflict]"),
+  { "mc", N_("apply update to move destination (recommended)"),
+                                  N_("apply incoming update to move destination"
+                                     "  [mine-conflict]"),
                                   svn_wc_conflict_choose_mine_conflict },
-  { "r",  N_("resolved"),         N_("mark resolved "
-                                     "(the move will become a copy)"),
-                                  svn_wc_conflict_choose_merged },
-  { "q",  N_("quit resolution"),  N_("postpone all remaining conflicts"),
-                                  svn_wc_conflict_choose_postpone },
-  { "h",  N_("help"),             N_("show this help (also '?')"), -1 },
-  { NULL }
-};
-
-static const resolver_option_t tree_conflict_options_update_deleted[] =
-{
   { "p",  N_("postpone"),         N_("resolve the conflict later  [postpone]"),
                                   svn_wc_conflict_choose_postpone },
-  { "mc", N_("my side of conflict"), N_("keep any moves affected "
-                                        "by this deletion  [mine-conflict]"),
-                                  svn_wc_conflict_choose_mine_conflict },
-  { "r",  N_("resolved"),         N_("mark resolved (any affected moves will "
-                                     "become copies)"),
-                                  svn_wc_conflict_choose_merged },
   { "q",  N_("quit resolution"),  N_("postpone all remaining conflicts"),
                                   svn_wc_conflict_choose_postpone },
   { "h",  N_("help"),             N_("show this help (also '?')"), -1 },
   { NULL }
 };
 
-static const resolver_option_t tree_conflict_options_update_replaced[] =
+static const resolver_option_t tree_conflict_options_update_edit_deleted_dir[] =
 {
+  { "mc", N_("prepare for updating moved-away children, if any (recommended)"),
+                                  N_("allow updating moved-away children "
+                                     "with 'svn resolve' [mine-conflict]"),
+                                  svn_wc_conflict_choose_mine_conflict },
   { "p",  N_("postpone"),         N_("resolve the conflict later  [postpone]"),
                                   svn_wc_conflict_choose_postpone },
-  { "mc", N_("my side of conflict"), N_("keep any moves affected by this "
-                                        "replacement  [mine-conflict]"),
-                                  svn_wc_conflict_choose_mine_conflict },
-  { "r",  N_("resolved"),         N_("mark resolved (any affected moves will "
-                                     "become copies)"),
-                                  svn_wc_conflict_choose_merged },
   { "q",  N_("quit resolution"),  N_("postpone all remaining conflicts"),
                                   svn_wc_conflict_choose_postpone },
   { "h",  N_("help"),             N_("show this help (also '?')"), -1 },
   { NULL }
 };
 
-
 /* Return a pointer to the option description in OPTIONS matching the
  * one- or two-character OPTION_CODE.  Return NULL if not found. */
 static const resolver_option_t *
@@ -927,7 +906,7 @@ handle_text_conflict(svn_wc_conflict_res
               SVN_ERR(svn_cmdline_fprintf(
                         stderr, iterpool,
                         _("Invalid option; use diff/edit/merge/launch "
-                          "before choosing 'resolved'.\n\n")));
+                          "before choosing 'mark resolved'.\n\n")));
               continue;
             }
 
@@ -1076,20 +1055,23 @@ handle_tree_conflict(svn_wc_conflict_res
 
       svn_pool_clear(iterpool);
 
+      tc_opts = tree_conflict_options;
+
       if (desc->operation == svn_wc_operation_update ||
           desc->operation == svn_wc_operation_switch)
         {
           if (desc->reason == svn_wc_conflict_reason_moved_away)
-            tc_opts = tree_conflict_options_update_moved_away;
-          else if (desc->reason == svn_wc_conflict_reason_deleted)
-            tc_opts = tree_conflict_options_update_deleted;
-          else if (desc->reason == svn_wc_conflict_reason_replaced)
-            tc_opts = tree_conflict_options_update_replaced;
-          else
-            tc_opts = tree_conflict_options;
+            {
+              tc_opts = tree_conflict_options_update_moved_away;
+            }
+          else if (desc->reason == svn_wc_conflict_reason_deleted ||
+                   desc->reason == svn_wc_conflict_reason_replaced)
+            {
+              if (desc->action == svn_wc_conflict_action_edit &&
+                  desc->node_kind == svn_node_dir)
+                tc_opts = tree_conflict_options_update_edit_deleted_dir;
+            }
         }
-      else
-        tc_opts = tree_conflict_options;
 
       SVN_ERR(prompt_user(&opt, tc_opts, NULL, b->pb, iterpool));
       if (! opt)

Modified: subversion/branches/fsfs-format7/subversion/svn/file-merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/file-merge.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/file-merge.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/file-merge.c Sun Jun 30 01:03:10 2013
@@ -655,6 +655,8 @@ merge_chunks(apr_array_header_t **merged
   svn_stringbuf_appendcstr(
     prompt,
     _("Select: (1) use their version, (2) use your version,\n"
+      "        (12) their version first, then yours,\n"
+      "        (21) your version first, then theirs,\n"
       "        (e1) edit their version and use the result,\n"
       "        (e2) edit your version and use the result,\n"
       "        (eb) edit both versions and use the result,\n"
@@ -679,6 +681,24 @@ merge_chunks(apr_array_header_t **merged
           *merged_chunk = chunk2;
           break;
         }
+      if (strcmp(answer, "12") == 0)
+        {
+          *merged_chunk = apr_array_make(result_pool,
+                                         chunk1->nelts + chunk2->nelts,
+                                         sizeof(svn_stringbuf_t *));
+          apr_array_cat(*merged_chunk, chunk1);
+          apr_array_cat(*merged_chunk, chunk2);
+          break;
+        }
+      if (strcmp(answer, "21") == 0)
+        {
+          *merged_chunk = apr_array_make(result_pool,
+                                         chunk1->nelts + chunk2->nelts,
+                                         sizeof(svn_stringbuf_t *));
+          apr_array_cat(*merged_chunk, chunk2);
+          apr_array_cat(*merged_chunk, chunk1);
+          break;
+        }
       else if (strcmp(answer, "p") == 0)
         {
           *merged_chunk = NULL;

Modified: subversion/branches/fsfs-format7/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/merge-cmd.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/merge-cmd.c Sun Jun 30 01:03:10 2013
@@ -101,15 +101,6 @@ run_merge(svn_boolean_t two_sources_spec
           && (first_range_end.kind == svn_opt_revision_unspecified))
         {
           ranges_to_merge = NULL;
-
-          /* This must be a 'sync' merge so check branch relationship. */
-          if (opt_state->verbose)
-            SVN_ERR(svn_cmdline_printf(
-                      scratch_pool, _("--- Checking branch relationship\n")));
-          SVN_ERR_W(svn_cl__check_related_source_and_target(
-                      sourcepath1, &peg_revision1,
-                      targetpath, &unspecified_revision, ctx, scratch_pool),
-                _("Source and target must be different but related branches"));
         }
 
       if (opt_state->verbose)

Modified: subversion/branches/fsfs-format7/subversion/svn/mergeinfo-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/mergeinfo-cmd.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/mergeinfo-cmd.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/mergeinfo-cmd.c Sun Jun 30 01:03:10 2013
@@ -27,7 +27,9 @@
 
 /*** Includes. ***/
 
+#include "svn_compat.h"
 #include "svn_pools.h"
+#include "svn_props.h"
 #include "svn_client.h"
 #include "svn_cmdline.h"
 #include "svn_path.h"
@@ -55,6 +57,61 @@ print_log_rev(void *baton,
   return SVN_NO_ERROR;
 }
 
+/* The separator between log messages. */
+#define SEP_STRING \
+  "------------------------------------------------------------------------\n"
+
+/* Implements the svn_log_entry_receiver_t interface. */
+static svn_error_t *
+print_log_details(void *baton,
+                  svn_log_entry_t *log_entry,
+                  apr_pool_t *pool)
+{
+  const char *author;
+  const char *date;
+  const char *message;
+
+  svn_compat_log_revprops_out(&author, &date, &message, log_entry->revprops);
+
+  if (author == NULL)
+    author = _("(no author)");
+
+  if (date && date[0])
+    /* Convert date to a format for humans. */
+    SVN_ERR(svn_cl__time_cstring_to_human_cstring(&date, date, pool));
+  else
+    date = _("(no date)");
+
+  if (log_entry->non_inheritable)
+    SVN_ERR(svn_cmdline_printf(pool,
+                               SEP_STRING "r%ld* | %s | %s",
+                               log_entry->revision, author, date));
+  else
+    SVN_ERR(svn_cmdline_printf(pool,
+                               SEP_STRING "r%ld | %s | %s",
+                               log_entry->revision, author, date));
+
+  if (message != NULL)
+    {
+      /* 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));
+    }
+
+  SVN_ERR(svn_cmdline_printf(pool, "\n"));
+
+  if (message != NULL)
+    {
+      /* A blank line always precedes the log message. */
+      SVN_ERR(svn_cmdline_printf(pool, "\n%s\n", message));
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /* Draw a diagram (by printing text to the console) summarizing the state
  * of merging between two branches, given the merge description
  * indicated by YCA, BASE, RIGHT, TARGET, REINTEGRATE_LIKE. */
@@ -238,6 +295,50 @@ mergeinfo_summary(
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+mergeinfo_log(svn_boolean_t finding_merged,
+              const char *target,
+              const svn_opt_revision_t *tgt_peg_revision,
+              const char *source,
+              const svn_opt_revision_t *src_peg_revision,
+              const svn_opt_revision_t *src_start_revision,
+              const svn_opt_revision_t *src_end_revision,
+              svn_depth_t depth,
+              svn_boolean_t include_log_details,
+              svn_client_ctx_t *ctx,
+              apr_pool_t *pool)
+{
+  apr_array_header_t *revprops;
+  svn_log_entry_receiver_t log_reciever;
+
+  if (include_log_details)
+    {
+      revprops = apr_array_make(pool, 3, sizeof(const char *));
+      APR_ARRAY_PUSH(revprops, const char *) = SVN_PROP_REVISION_AUTHOR;
+      APR_ARRAY_PUSH(revprops, const char *) = SVN_PROP_REVISION_DATE;
+      APR_ARRAY_PUSH(revprops, const char *) = SVN_PROP_REVISION_LOG;
+
+      log_reciever = print_log_details;
+    }
+  else
+    {
+      /* We need only revisions number, not revision properties. */
+      revprops = apr_array_make(pool, 0, sizeof(const char *));
+      log_reciever = print_log_rev;
+    }
+
+  SVN_ERR(svn_client_mergeinfo_log2(finding_merged, target,
+                                    tgt_peg_revision,
+                                    source, src_peg_revision,
+                                    src_start_revision,
+                                    src_end_revision,
+                                    log_reciever, NULL,
+                                    TRUE, depth, revprops, ctx,
+                                    pool));
+
+  return SVN_NO_ERROR;
+}
+
 /* This implements the `svn_opt_subcommand_t' interface. */
 svn_error_t *
 svn_cl__mergeinfo(apr_getopt_t *os,
@@ -297,11 +398,6 @@ svn_cl__mergeinfo(apr_getopt_t *os,
         tgt_peg_revision.kind = svn_opt_revision_base;
     }
 
-  SVN_ERR_W(svn_cl__check_related_source_and_target(source, &src_peg_revision,
-                                                    target, &tgt_peg_revision,
-                                                    ctx, pool),
-            _("Source and target must be different but related branches"));
-
   src_start_revision = &(opt_state->start_revision);
   if (opt_state->end_revision.kind == svn_opt_revision_unspecified)
     src_end_revision = src_start_revision;
@@ -311,23 +407,21 @@ svn_cl__mergeinfo(apr_getopt_t *os,
   /* Do the real work, depending on the requested data flavor. */
   if (opt_state->show_revs == svn_cl__show_revs_merged)
     {
-      SVN_ERR(svn_client_mergeinfo_log2(TRUE, target, &tgt_peg_revision,
-                                        source, &src_peg_revision,
-                                        src_start_revision,
-                                        src_end_revision,
-                                        print_log_rev, NULL,
-                                        TRUE, depth, NULL, ctx,
-                                        pool));
+      SVN_ERR(mergeinfo_log(TRUE, target, &tgt_peg_revision,
+                            source, &src_peg_revision,
+                            src_start_revision,
+                            src_end_revision,
+                            depth, opt_state->mergeinfo_log,
+                            ctx, pool));
     }
   else if (opt_state->show_revs == svn_cl__show_revs_eligible)
     {
-      SVN_ERR(svn_client_mergeinfo_log2(FALSE, target, &tgt_peg_revision,
-                                        source, &src_peg_revision,
-                                        src_start_revision,
-                                        src_end_revision,
-                                        print_log_rev, NULL,
-                                        TRUE, depth, NULL, ctx,
-                                        pool));
+      SVN_ERR(mergeinfo_log(FALSE, target, &tgt_peg_revision,
+                            source, &src_peg_revision,
+                            src_start_revision,
+                            src_end_revision,
+                            depth, opt_state->mergeinfo_log,
+                            ctx, pool));
     }
   else
     {
@@ -340,6 +434,11 @@ svn_cl__mergeinfo(apr_getopt_t *os,
         return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                 _("Depth specification options valid only "
                                   "with --show-revs option"));
+      if (opt_state->mergeinfo_log)
+        return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                                _("--log option valid only with "
+                                  "--show-revs option"));
+
 
       SVN_ERR(mergeinfo_summary(source, &src_peg_revision,
                                 target, &tgt_peg_revision,

Modified: subversion/branches/fsfs-format7/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/notify.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/notify.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/notify.c Sun Jun 30 01:03:10 2013
@@ -1136,6 +1136,13 @@ notify(void *baton, const svn_wc_notify_
         goto print_error;
       break;
 
+    case svn_wc_notify_cleanup_external:
+      if ((err = svn_cmdline_printf
+           (pool, _("Performing cleanup on external item at '%s'.\n"),
+            path_local)))
+        goto print_error;
+      break;
+
     default:
       break;
     }

Modified: subversion/branches/fsfs-format7/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/svn.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/svn.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/svn.c Sun Jun 30 01:03:10 2013
@@ -133,7 +133,10 @@ typedef enum svn_cl__longopt_t {
   opt_include_externals,
   opt_show_inherited_props,
   opt_search,
-  opt_search_and
+  opt_search_and,
+  opt_mergeinfo_log,
+  opt_remove_unversioned,
+  opt_remove_ignored
 } svn_cl__longopt_t;
 
 
@@ -368,17 +371,20 @@ const apr_getopt_option_t svn_cl__option
                        "                             "
                        "Please run 'svn update' instead.")},
   {"include-externals", opt_include_externals, 0,
-                       N_("Also commit file and dir externals reached by\n"
+                       N_("also operate on externals defined by\n"
                        "                             "
-                       "recursion. This does not include externals with a\n"
-                       "                             "
-                       "fixed revision. (See the svn:externals property)")},
+                       "svn:externals properties")},
   {"show-inherited-props", opt_show_inherited_props, 0,
                        N_("retrieve target's inherited properties")},
   {"search", opt_search, 1,
                        N_("use ARG as search pattern (glob syntax)")},
   {"search-and", opt_search_and, 1,
                        N_("combine ARG with the previous search pattern")},
+  {"log", opt_mergeinfo_log, 0,
+                       N_("show revision log message, author and date")},
+  {"remove-unversioned", opt_remove_unversioned, 0,
+                       N_("remove unversioned items")},
+  {"remove-ignored", opt_remove_ignored, 0, N_("remove ignored items")},
 
   /* Long-opt Aliases
    *
@@ -484,10 +490,29 @@ const svn_opt_subcommand_desc2_t svn_cl_
     {'r', 'q', 'N', opt_depth, opt_force, opt_ignore_externals} },
 
   { "cleanup", svn_cl__cleanup, {0}, N_
-    ("Recursively clean up the working copy, removing locks, resuming\n"
+    ("Recursively clean up the working copy, removing write locks, resuming\n"
      "unfinished operations, etc.\n"
-     "usage: cleanup [WCPATH...]\n"),
-    {opt_merge_cmd} },
+     "usage: cleanup [WCPATH...]\n"
+     "\n"
+     "  By default, finish any unfinished business in the working copy at WCPATH,\n"
+     "  and remove write locks (shown as 'L' by the 'svn status' command) from\n"
+     "  the working copy. Usually, this is only necessary if a Subversion client\n"
+     "  has crashed while using the working copy, leaving it in an unusable state.\n"
+     "\n"
+     "  WARNING: There is no mechanism that will protect write locks still\n"
+     "           being used by other Subversion clients. Running this command\n"
+     "           while another client is using the working copy can corrupt\n"
+     "           the working copy beyond repair!\n"
+     "\n"
+     "  If the --remove-unversioned option or the --remove-ignored option\n"
+     "  is given, remove any unversioned or ignored items within WCPATH.\n"
+     "  To prevent accidental working copy corruption, unversioned or ignored\n"
+     "  items can only be removed if the working copy is not already locked\n"
+     "  for writing by another Subversion client.\n"
+     "  Note that the 'svn status' command shows unversioned items as '?',\n"
+     "  and ignored items as 'I' if the --no-ignore option is given to it.\n"),
+    {opt_merge_cmd, opt_remove_unversioned, opt_remove_ignored,
+     opt_include_externals} },
 
   { "commit", svn_cl__commit, {"ci"},
     N_("Send changes from your working copy to the repository.\n"
@@ -496,7 +521,11 @@ const svn_opt_subcommand_desc2_t svn_cl_
        "  A log message must be provided, but it can be empty.  If it is not\n"
        "  given by a --message or --file option, an editor will be started.\n"
        "  If any targets are (or contain) locked items, those will be\n"
-       "  unlocked after a successful commit.\n"),
+       "  unlocked after a successful commit.\n"
+       "\n"
+       "  If --include-externals is given, also commit file and directory\n"
+       "  externals reached by recursion. Do not commit externals with a\n"
+       "  fixed revision.\n"),
     {'q', 'N', opt_depth, opt_targets, opt_no_unlock, SVN_CL__LOG_MSG_OPTIONS,
      opt_changelist, opt_keep_changelists, opt_include_externals} },
 
@@ -648,8 +677,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "    Size (in bytes)\n"
      "    Date and time of the last commit\n"),
     {'r', 'v', 'R', opt_depth, opt_incremental, opt_xml,
-     opt_include_externals },
-    {{opt_include_externals, N_("include externals definitions")}} },
+     opt_include_externals}, },
 
   { "lock", svn_cl__lock, {0}, N_
     ("Lock working copy paths or URLs in the repository, so that\n"
@@ -750,18 +778,18 @@ const svn_opt_subcommand_desc2_t svn_cl_
        * (with quotes and newlines removed). */
 "Merge changes into a working copy.\n"
 "usage: 1. merge SOURCE[@REV] [TARGET_WCPATH]\n"
-"          (the 'automatic' merge)\n"
+"          (the 'complete' merge)\n"
 "       2. merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH]\n"
 "          (the 'cherry-pick' merge)\n"
 "       3. merge SOURCE1[@REV1] SOURCE2[@REV2] [TARGET_WCPATH]\n"
 "          (the '2-URL' merge)\n"
 "\n"
 "  1. This form, with one source path and no revision range, is called\n"
-"     an 'automatic' merge:\n"
+"     a 'complete' merge:\n"
 "\n"
 "       svn merge SOURCE[@REV] [TARGET_WCPATH]\n"
 "\n"
-"     The automatic merge is used for the 'sync' and 'reintegrate' merges\n"
+"     The complete merge is used for the 'sync' and 'reintegrate' merges\n"
 "     in the 'feature branch' pattern described below. It finds all the\n"
 "     changes on the source branch that have not already been merged to the\n"
 "     target branch, and merges them into the working copy. Merge tracking\n"
@@ -900,7 +928,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "     of 'REV' is the base revision (usually the revision last updated to).\n"
 "\n"
 "     TARGET_WCPATH is a working copy path; if omitted, '.' is generally\n"
-"     assumed. The special cases noted above in the 'automatic' merge form\n"
+"     assumed. The special cases noted above in the 'complete' merge form\n"
 "     also apply here.\n"
 "\n"
 "     The revision ranges to be merged are specified by the '-r' and/or '-c'\n"
@@ -971,7 +999,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
 "     The three branches involved can be completely unrelated.\n"
 "\n"
 "     TARGET_WCPATH is a working copy path; if omitted, '.' is generally\n"
-"     assumed. The special cases noted above in the 'automatic' merge form\n"
+"     assumed. The special cases noted above in the 'complete' merge form\n"
 "     also apply here.\n"
 "\n"
 "     SOURCE1 and/or SOURCE2 can also be specified as a working copy path,\n"
@@ -1088,7 +1116,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "     shows, from left to right:\n"
      "       the youngest common ancestor of the branches;\n"
      "       the latest full merge in either direction, and thus the common base\n"
-     "         that will be used for the next automatic merge;\n"
+     "         that will be used for the next complete merge;\n"
      "       the repository path and revision number of the tip of each branch.\n"
      "\n"
      "  2. Print the revision numbers on SOURCE that have been merged to TARGET\n"
@@ -1108,7 +1136,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "  and the default for TARGET is HEAD for a URL or BASE for a WC path.\n"
      "\n"
      "  The depth can be 'empty' or 'infinity'; the default is 'empty'.\n"),
-    {'r', 'R', opt_depth, opt_show_revs} },
+    {'r', 'R', opt_depth, opt_show_revs, opt_mergeinfo_log} },
 
   { "mkdir", svn_cl__mkdir, {0}, N_
     ("Create a new directory under version control.\n"
@@ -1430,9 +1458,10 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "      ' ' no modifications\n"
      "      'C' Conflicted\n"
      "      'M' Modified\n"
-     "    Third column: Whether the working copy directory is locked\n"
-     "      ' ' not locked\n"
-     "      'L' locked\n"
+     "    Third column: Whether the working copy is locked for writing by\n"
+     "                  another Subversion client modifying the working copy\n"
+     "      ' ' not locked for writing\n"
+     "      'L' locked for writing\n"
      "    Fourth column: Scheduled commit will contain addition-with-history\n"
      "      ' ' no history scheduled with commit\n"
      "      '+' history scheduled with commit\n"
@@ -1440,16 +1469,16 @@ const svn_opt_subcommand_desc2_t svn_cl_
      "      ' ' normal\n"
      "      'S' the item has a Switched URL relative to the parent\n"
      "      'X' a versioned file created by an eXternals definition\n"
-     "    Sixth column: Repository lock token\n"
+     "    Sixth column: Whether the item is locked in repository for exclusive commit\n"
      "      (without -u)\n"
-     "      ' ' no lock token\n"
-     "      'K' lock token present\n"
+     "      ' ' not locked by this working copy\n"
+     "      'K' locked by this working copy, but lock might be stolen or broken\n"
      "      (with -u)\n"
-     "      ' ' not locked in repository, no lock token\n"
-     "      'K' locked in repository, lock toKen present\n"
-     "      'O' locked in repository, lock token in some Other working copy\n"
-     "      'T' locked in repository, lock token present but sTolen\n"
-     "      'B' not locked in repository, lock token present but Broken\n"
+     "      ' ' not locked in repository, not locked by this working copy\n"
+     "      'K' locked in repository, lock owned by this working copy\n"
+     "      'O' locked in repository, lock owned by another working copy\n"
+     "      'T' locked in repository, lock owned by this working copy was stolen\n"
+     "      'B' not locked in repository, lock owned by this working copy is broken\n"
      "    Seventh column: Whether the item is the victim of a tree conflict\n"
      "      ' ' normal\n"
      "      'C' tree-Conflicted\n"
@@ -1648,6 +1677,8 @@ signal_handler(int signum)
 svn_error_t *
 svn_cl__check_cancel(void *baton)
 {
+  /* Cancel baton should be always NULL in command line client. */
+  SVN_ERR_ASSERT(baton == NULL);
   if (cancelled)
     return svn_error_create(SVN_ERR_CANCELLED, NULL, _("Caught signal"));
   else
@@ -2212,6 +2243,9 @@ sub_main(int argc, const char *argv[], a
                                _("'%s' is not a valid --show-revs value"),
                                utf8_opt_arg));
         break;
+      case opt_mergeinfo_log:
+        opt_state.mergeinfo_log = TRUE;
+        break;
       case opt_reintegrate:
         opt_state.reintegrate = TRUE;
         break;
@@ -2274,6 +2308,12 @@ sub_main(int argc, const char *argv[], a
       case opt_search_and:
         SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
         add_search_pattern_to_latest_group(&opt_state, utf8_opt_arg, pool);
+      case opt_remove_unversioned:
+        opt_state.remove_unversioned = TRUE;
+        break;
+      case opt_remove_ignored:
+        opt_state.remove_ignored = TRUE;
+        break;
       default:
         /* Hmmm. Perhaps this would be a good place to squirrel away
            opts that commands like svn diff might need. Hmmm indeed. */

Modified: subversion/branches/fsfs-format7/subversion/svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svn/util.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svn/util.c (original)
+++ subversion/branches/fsfs-format7/subversion/svn/util.c Sun Jun 30 01:03:10 2013
@@ -1007,46 +1007,6 @@ svn_cl__local_style_skip_ancestor(const 
   return svn_dirent_local_style(relpath ? relpath : path, pool);
 }
 
-/* Return a string of the form "PATH_OR_URL@REVISION". */
-static const char *
-path_for_display(const char *path_or_url,
-                 const svn_opt_revision_t *revision,
-                 apr_pool_t *pool)
-{
-  const char *rev_str = svn_opt__revision_to_string(revision, pool);
-
-  if (! svn_path_is_url(path_or_url))
-    path_or_url = svn_dirent_local_style(path_or_url, pool);
-  return apr_psprintf(pool, "%s@%s", path_or_url, rev_str);
-}
-
-svn_error_t *
-svn_cl__check_related_source_and_target(const char *path_or_url1,
-                                        const svn_opt_revision_t *revision1,
-                                        const char *path_or_url2,
-                                        const svn_opt_revision_t *revision2,
-                                        svn_client_ctx_t *ctx,
-                                        apr_pool_t *pool)
-{
-  const char *ancestor_url;
-  svn_revnum_t ancestor_rev;
-
-  SVN_ERR(svn_client__youngest_common_ancestor(
-            &ancestor_url, &ancestor_rev,
-            path_or_url1, revision1, path_or_url2, revision2,
-            ctx, pool, pool));
-
-  if (ancestor_url == NULL)
-    {
-      return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
-                               _("Source and target have no common ancestor: "
-                                 "'%s' and '%s'"),
-                               path_for_display(path_or_url1, revision1, pool),
-                               path_for_display(path_or_url2, revision2, pool));
-    }
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_cl__propset_print_binary_mime_type_warning(apr_array_header_t *targets,
                                                const char *propname,

Modified: subversion/branches/fsfs-format7/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svnadmin/svnadmin.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svnadmin/svnadmin.c (original)
+++ subversion/branches/fsfs-format7/subversion/svnadmin/svnadmin.c Sun Jun 30 01:03:10 2013
@@ -48,8 +48,6 @@
 #include "private/svn_subr_private.h"
 #include "private/svn_cmdline_private.h"
 
-#include "../libsvn_fs_fs/fs.h" /* for SVN_FS_FS__MIN_PACKED_FORMAT */
-
 #include "svn_private_config.h"
 
 
@@ -180,6 +178,7 @@ enum svnadmin__cmdline_options_t
   {
     svnadmin__version = SVN_OPT_FIRST_LONGOPT_ID,
     svnadmin__incremental,
+    svnadmin__keep_going,
     svnadmin__deltas,
     svnadmin__ignore_uuid,
     svnadmin__force_uuid,
@@ -288,6 +287,9 @@ static const apr_getopt_option_t options
     {"pre-1.6-compatible",     svnadmin__pre_1_6_compatible, 0,
      N_("deprecated; see --compatible-version")},
 
+    {"keep-going",    svnadmin__keep_going, 0,
+     N_("continue verification after detecting a corruption")},
+
     {"memory-cache-size",     'M', 1,
      N_("size of the extra in-memory cache in MB used to\n"
         "                             minimize redundant operations. Default: 16.\n"
@@ -491,7 +493,7 @@ static const svn_opt_subcommand_desc2_t 
   {"verify", subcommand_verify, {0}, N_
    ("usage: svnadmin verify REPOS_PATH\n\n"
     "Verify the data stored in the repository.\n"),
-  {'t', 'r', 'q', 'M'} },
+  {'t', 'r', 'q', svnadmin__keep_going, 'M'} },
 
   { NULL, NULL, {0}, NULL, {0} }
 };
@@ -522,6 +524,7 @@ struct svnadmin_opt_state
   svn_boolean_t clean_logs;                         /* --clean-logs */
   svn_boolean_t bypass_hooks;                       /* --bypass-hooks */
   svn_boolean_t wait;                               /* --wait */
+  svn_boolean_t keep_going;                         /* --keep-going */
   svn_boolean_t bypass_prop_validation;             /* --bypass-prop-validation */
   enum svn_repos_load_uuid uuid_action;             /* --ignore-uuid,
                                                        --force-uuid */
@@ -715,6 +718,18 @@ subcommand_create(apr_getopt_t *os, void
                      APR_HASH_KEY_STRING, "1");
     }
 
+  if (opt_state->compatible_version
+      && ! svn_version__at_least(opt_state->compatible_version, 1, 1, 0)
+      /* ### TODO: this NULL check hard-codes knowledge of the library's
+                   default fs-type value */
+      && (opt_state->fs_type == NULL
+          || !strcmp(opt_state->fs_type, SVN_FS_TYPE_FSFS)))
+    {
+      return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+                              _("Repositories compatible with 1.0.x must use "
+                                "--fs-type=bdb"));
+    }
+
   SVN_ERR(svn_repos_create(&repos, opt_state->repository_path,
                            NULL, NULL, NULL, fs_config, pool));
   svn_fs_set_warning_func(svn_repos_fs(repos), warning_func, NULL);
@@ -825,6 +840,16 @@ repos_notify_handler(void *baton,
                             notify->warning_str);
       return;
 
+    case svn_repos_notify_failure:
+      if (notify->revision != SVN_INVALID_REVNUM)
+        cmdline_stream_printf(feedback_stream, scratch_pool,
+                              _("* Error verifying revision %ld.\n"),
+                              notify->revision);
+      if (notify->err)
+        svn_handle_error2(notify->err, stderr, FALSE /* non-fatal */,
+                          "svnadmin: ");
+      return;
+
     case svn_repos_notify_dump_rev_end:
       cmdline_stream_printf(feedback_stream, scratch_pool,
                             _("* Dumped revision %ld.\n"),
@@ -972,6 +997,35 @@ repos_notify_handler(void *baton,
                               " repository may take some time...\n"));
       return;
 
+    case svn_repos_notify_pack_revprops:
+      {
+        const char *shardstr = apr_psprintf(scratch_pool,
+                                            "%" APR_INT64_T_FMT,
+                                            notify->shard);
+        cmdline_stream_printf(feedback_stream, scratch_pool,
+                              _("Packing revision properties"
+                                " in shard %s..."),
+                              shardstr);
+        return;
+      }
+
+    case svn_repos_notify_cleanup_revprops:
+      {
+        const char *shardstr = apr_psprintf(scratch_pool,
+                                            "%" APR_INT64_T_FMT,
+                                            notify->shard);
+        cmdline_stream_printf(feedback_stream, scratch_pool,
+                              _("Removing non-packed revision properties"
+                                " in shard %s..."),
+                              shardstr);
+        return;
+      }
+
+    case svn_repos_notify_format_bumped:
+      cmdline_stream_printf(feedback_stream, scratch_pool,
+                            _("Bumped repository format to %ld\n"),
+                            notify->revision);
+
     default:
       return;
   }
@@ -1660,10 +1714,12 @@ subcommand_verify(apr_getopt_t *os, void
   if (! opt_state->quiet)
     progress_stream = recode_stream_create(stdout, pool);
 
-  return svn_repos_verify_fs2(repos, lower, upper,
-                              !opt_state->quiet
-                                ? repos_notify_handler : NULL,
-                              progress_stream, check_cancel, NULL, pool);
+  return svn_error_trace(svn_repos_verify_fs3(repos, lower, upper,
+                                              opt_state->keep_going,
+                                              !opt_state->quiet
+                                              ? repos_notify_handler : NULL,
+                                              progress_stream, check_cancel,
+                                              NULL, pool));
 }
 
 /* This implements `svn_opt_subcommand_t'. */
@@ -1767,8 +1823,8 @@ subcommand_info(apr_getopt_t *os, void *
           SVN_ERR(svn_cmdline_printf(pool, _("FSFS Shard Size: %d\n"),
                                      fsfs_info->shard_size));
 
-        /* Print packing statistics, if supported by the FS format. */
-        if (fs_format >= SVN_FS_FS__MIN_PACKED_FORMAT && fsfs_info->shard_size)
+        /* Print packing statistics, if enabled on the FS. */
+        if (fsfs_info->shard_size)
           {
             const int shard_size = fsfs_info->shard_size;
             const int shards_packed = fsfs_info->min_unpacked_rev / shard_size;
@@ -2284,6 +2340,9 @@ sub_main(int argc, const char *argv[], a
           opt_state.compatible_version = compatible_version;
         }
         break;
+      case svnadmin__keep_going:
+        opt_state.keep_going = TRUE;
+        break;
       case svnadmin__fs_type:
         SVN_INT_ERR(svn_utf_cstring_to_utf8(&opt_state.fs_type, opt_arg, pool));
         break;

Modified: subversion/branches/fsfs-format7/subversion/svnlook/svnlook.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/svnlook/svnlook.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/svnlook/svnlook.c (original)
+++ subversion/branches/fsfs-format7/subversion/svnlook/svnlook.c Sun Jun 30 01:03:10 2013
@@ -57,6 +57,7 @@
 #include "private/svn_diff_private.h"
 #include "private/svn_cmdline_private.h"
 #include "private/svn_fspath.h"
+#include "private/svn_io_private.h"
 
 #include "svn_private_config.h"
 
@@ -983,12 +984,21 @@ print_diff_tree(svn_stream_t *out_stream
               SVN_ERR(generate_label(&new_label, root, path, pool));
 
               /* We deal in streams, but svn_io_run_diff2() deals in file
-                 handles, unfortunately, so we need to make these temporary
-                 files, and then copy the contents to our stream. */
-              SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL,
-                        svn_io_file_del_on_pool_cleanup, pool, pool));
-              SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL,
-                        svn_io_file_del_on_pool_cleanup, pool, pool));
+                 handles, so we may need to make temporary files and then
+                 copy the contents to our stream. */
+              outfile = svn_stream__aprfile(out_stream);
+              if (outfile)
+                outfilename = NULL;
+              else
+                SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL,
+                          svn_io_file_del_on_pool_cleanup, pool, pool));
+              SVN_ERR(svn_stream_for_stderr(&err_stream, pool));
+              errfile = svn_stream__aprfile(err_stream);
+              if (errfile)
+                errfilename = NULL;
+              else
+                SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL,
+                          svn_io_file_del_on_pool_cleanup, pool, pool));
 
               SVN_ERR(svn_io_run_diff2(".",
                                        diff_cmd_argv,
@@ -998,21 +1008,25 @@ print_diff_tree(svn_stream_t *out_stream
                                        &exitcode, outfile, errfile,
                                        c->diff_cmd, pool));
 
-              SVN_ERR(svn_io_file_close(outfile, pool));
-              SVN_ERR(svn_io_file_close(errfile, pool));
-
               /* Now, open and copy our files to our output streams. */
-              SVN_ERR(svn_stream_for_stderr(&err_stream, pool));
-              SVN_ERR(svn_stream_open_readonly(&stream, outfilename,
-                                               pool, pool));
-              SVN_ERR(svn_stream_copy3(stream,
-                                       svn_stream_disown(out_stream, pool),
-                                       NULL, NULL, pool));
-              SVN_ERR(svn_stream_open_readonly(&stream, errfilename,
-                                               pool, pool));
-              SVN_ERR(svn_stream_copy3(stream,
-                                       svn_stream_disown(err_stream, pool),
-                                       NULL, NULL, pool));
+              if (outfilename)
+                {
+                  SVN_ERR(svn_io_file_close(outfile, pool));
+                  SVN_ERR(svn_stream_open_readonly(&stream, outfilename,
+                                                   pool, pool));
+                  SVN_ERR(svn_stream_copy3(stream,
+                                           svn_stream_disown(out_stream, pool),
+                                           NULL, NULL, pool));
+                }
+              if (errfilename)
+                {
+                  SVN_ERR(svn_io_file_close(errfile, pool));
+                  SVN_ERR(svn_stream_open_readonly(&stream, errfilename,
+                                                   pool, pool));
+                  SVN_ERR(svn_stream_copy3(stream,
+                                           svn_stream_disown(err_stream, pool),
+                                           NULL, NULL, pool));
+                }
 
               SVN_ERR(svn_stream_printf_from_utf8(out_stream, encoding, pool,
                                                   "\n"));

Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/README
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/README?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/README (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/README Sun Jun 30 01:03:10 2013
@@ -245,9 +245,25 @@ Directory Contents
 
           /verify.py:       Verifies output from Subversion.
 
-          /entry.py:        Parse an `entries' file (### not used yet)
-
-
+          /testcase.py:     Control of test case execution - contains
+                            decorators for expected failures and conditionally
+                            executed tests.
+
+          /sandbox.py:      Tools for manipulating a test's working area 
+                            ("a sandbox"), those are handy for most simple
+                            actions a test might want to perform on a wc.
+
+          /objects.py:      Objects that keep track of state during a test.
+                            (not directly used by the test scripts.)
+
+          /mergetrees.py:   Routines that create merge scenarios.
+          
+          /factory.py:      Automatically generate a (near-)complete new 
+                            cmdline test from a series of shell commands.
+          
+          /error.py:        Error codes as constants, for convenience.
+                            (auto-generated by tools/dev/gen-py-error.py)
+                            
 
 What the Python Tests are Doing
 ===============================

Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/blame_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/blame_tests.py?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/blame_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/blame_tests.py Sun Jun 30 01:03:10 2013
@@ -956,6 +956,34 @@ def blame_eol_handling(sbox):
                                        'blame', f2)
 
 
+@SkipUnless(svntest.main.server_has_reverse_get_file_revs)
+def blame_youngest_to_oldest(sbox):
+  "blame_youngest_to_oldest"
+
+  sbox.build()
+
+  # First, make a new revision of iota.
+  iota = sbox.ospath('iota')
+  orig_line = open(iota).read()
+  line = "New contents for iota\n"
+  svntest.main.file_append(iota, line)
+  sbox.simple_commit()
+  
+  # Move the file, to check that the operation will peg correctly.
+  iota_moved = sbox.ospath('iota_moved')
+  sbox.simple_move('iota', 'iota_moved')
+  sbox.simple_commit()
+  
+  # Delete a line.
+  open(iota_moved, 'w').write(line)
+  sbox.simple_commit()
+
+  expected_output = [
+        '     %d    jrandom %s\n' % (3, orig_line[:-1]),
+  ]
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'blame', '-r4:1', iota_moved)
+
 ########################################################################
 # Run the tests
 
@@ -979,6 +1007,7 @@ test_list = [ None,
               merge_sensitive_blame_and_empty_mergeinfo,
               blame_multiple_targets,
               blame_eol_handling,
+              blame_youngest_to_oldest,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/checkout_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/checkout_tests.py?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/checkout_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/checkout_tests.py Sun Jun 30 01:03:10 2013
@@ -660,8 +660,13 @@ def checkout_peg_rev_date(sbox):
   sbox.build()
   wc_dir = sbox.wc_dir
 
-  # note the current time to use it as peg revision date.
-  current_time = time.strftime("%Y-%m-%dT%H:%M:%S")
+  exit_code, output, errput = svntest.main.run_svn(None, 'propget', 'svn:date',
+                                                   '--revprop', '-r1',
+                                                   '--strict',
+                                                   sbox.repo_url)
+  if exit_code or errput != [] or len(output) != 1:
+    raise svntest.Failure("svn:date propget failed")
+  r1_time = output[0]
 
   # sleep till the next second.
   time.sleep(1.1)
@@ -686,7 +691,7 @@ def checkout_peg_rev_date(sbox):
 
   # use an old date to checkout, that way we're sure we get the first revision
   svntest.actions.run_and_verify_checkout(sbox.repo_url +
-                                          '@{' + current_time + '}',
+                                          '@{' + r1_time + '}',
                                           checkout_target,
                                           expected_output,
                                           expected_wc)

Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/lock_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/lock_tests.py?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/lock_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/lock_tests.py Sun Jun 30 01:03:10 2013
@@ -1840,6 +1840,56 @@ def commit_stolen_lock(sbox):
                                         err_re,
                                         wc_dir)
 
+# When removing directories, the locks of contained files were not 
+# correctly removed from the working copy database, thus they later 
+# magically reappeared when new files or directories with the same
+# pathes were added.
+@Issue(4364)
+def drop_locks_on_parent_deletion(sbox):
+  "drop locks when the parent is deleted"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # lock some files, and remove them.
+  sbox.simple_lock('A/B/lambda')
+  sbox.simple_lock('A/B/E/alpha')
+  sbox.simple_lock('A/B/E/beta')
+  sbox.simple_rm('A/B')
+  
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.remove_subtree('A/B')
+  
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        [],
+                                        expected_status,
+                                        None,
+                                        wc_dir)
+
+  # now re-add entities to the deleted pathes.
+  sbox.simple_mkdir('A/B')
+  sbox.simple_add_text('new file replacing old file', 'A/B/lambda')
+  sbox.simple_add_text('file replacing former dir', 'A/B/F')
+  # The bug also resurrected locks on directories when their path
+  # matched a former file.
+  sbox.simple_mkdir('A/B/E', 'A/B/E/alpha')
+    
+  expected_status = svntest.actions.get_virginal_state(wc_dir, 1)
+  expected_status.tweak('A/B',
+						'A/B/E',
+						'A/B/E/alpha',
+						'A/B/F',
+						'A/B/lambda',
+						wc_rev='3')
+  expected_status.remove('A/B/E/beta')
+   
+  svntest.actions.run_and_verify_commit(wc_dir,
+                                        [],
+                                        expected_status,
+                                        None,
+                                        wc_dir)
+	
+										
 ########################################################################
 # Run the tests
 
@@ -1892,6 +1942,7 @@ test_list = [ None,
               locks_stick_over_switch,
               lock_unlock_deleted,
               commit_stolen_lock,
+              drop_locks_on_parent_deletion,
             ]
 
 if __name__ == '__main__':

Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/mergeinfo_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/mergeinfo_tests.py?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/mergeinfo_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/mergeinfo_tests.py Sun Jun 30 01:03:10 2013
@@ -779,6 +779,31 @@ def noninheritable_mergeinfo_not_always_
     [], sbox.repo_url + '/A', sbox.repo_url + '/branch',
     '--show-revs', 'eligible', '-R')
 
+@SkipUnless(server_has_mergeinfo)
+def mergeinfo_log(sbox):
+  "'mergeinfo --log' on a path with mergeinfo"
+
+  sbox.build()
+  wc_dir = sbox.wc_dir
+
+  # make a branch 'A2'
+  sbox.simple_repo_copy('A', 'A2')  # r2
+  # make a change in branch 'A'
+  sbox.simple_mkdir('A/newdir')
+  sbox.simple_commit()  # r3
+  sbox.simple_update()
+
+  # Dummy up some mergeinfo.
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'ps', SVN_PROP_MERGEINFO, '/A:3',
+                                     sbox.ospath('A2'))
+  svntest.actions.run_and_verify_svn(None,
+                                     None, [],
+                                     'mergeinfo', '--show-revs=merged',
+                                     '--log', sbox.repo_url + '/A',
+                                     sbox.ospath('A2'))
+
+
 ########################################################################
 # Run the tests
 
@@ -796,6 +821,7 @@ test_list = [ None,
               wc_target_inherits_mergeinfo_from_repos,
               natural_history_is_not_eligible_nor_merged,
               noninheritable_mergeinfo_not_always_eligible,
+              mergeinfo_log,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/move_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/move_tests.py?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/move_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/move_tests.py Sun Jun 30 01:03:10 2013
@@ -1234,6 +1234,110 @@ def move_missing(sbox):
   svntest.actions.run_and_verify_status(wc_dir, expected_status)
 
 
+def nested_replaces(sbox):
+  "nested replaces"
+
+  repo_dir, repo_url = sbox.add_repo_path('blank')
+  wc_dir = sbox.add_wc_path('blank')
+  svntest.main.create_repos(repo_dir)
+  ospath = lambda dirent: sbox.ospath(dirent, wc_dir)
+
+  ## r1: setup
+  svntest.actions.run_and_verify_svnmucc(None, None, [],
+                           '-U', repo_url,
+                           '-m', 'r1: create tree',
+                           'mkdir', 'A', 'mkdir', 'A/B', 'mkdir', 'A/B/C',
+                           'mkdir', 'X', 'mkdir', 'X/Y', 'mkdir', 'X/Y/Z',
+                           # sentinel files
+                           'put', os.devnull, 'A/a',
+                           'put', os.devnull, 'A/B/b',
+                           'put', os.devnull, 'A/B/C/c',
+                           'put', os.devnull, 'X/x',
+                           'put', os.devnull, 'X/Y/y',
+                           'put', os.devnull, 'X/Y/Z/z')
+
+  svntest.main.run_svn(None, 'checkout', '-q', repo_url, wc_dir)
+  r1_status = svntest.wc.State(wc_dir, {
+    ''            : Item(status='  ', wc_rev='1'),
+    'A'           : Item(status='  ', wc_rev='1'),
+    'A/B'         : Item(status='  ', wc_rev='1'),
+    'A/B/C'       : Item(status='  ', wc_rev='1'),
+    'X'           : Item(status='  ', wc_rev='1'),
+    'X/Y'         : Item(status='  ', wc_rev='1'),
+    'X/Y/Z'       : Item(status='  ', wc_rev='1'),
+    'A/a'         : Item(status='  ', wc_rev='1'),
+    'A/B/b'       : Item(status='  ', wc_rev='1'),
+    'A/B/C/c'     : Item(status='  ', wc_rev='1'),
+    'X/x'         : Item(status='  ', wc_rev='1'),
+    'X/Y/y'       : Item(status='  ', wc_rev='1'),
+    'X/Y/Z/z'     : Item(status='  ', wc_rev='1'),
+    })
+  svntest.actions.run_and_verify_status(wc_dir, r1_status)
+
+  ## r2: juggling
+  moves = [
+    ('A', 'A2'),
+    ('X', 'X2'),
+    ('A2/B/C', 'X'),
+    ('X2/Y/Z', 'A'),
+    ('A2/B', 'A/B'),
+    ('X2/Y', 'X/Y'),
+    ('A2', 'X/Y/Z'),
+    ('X2', 'A/B/C'),
+  ]
+  for src, dst in moves:
+    svntest.main.run_svn(None, 'mv', ospath(src), ospath(dst))
+  r2_status = svntest.wc.State(wc_dir, {
+    ''          : Item(status='  ', wc_rev='1'),
+    'A'         : Item(status='R ', copied='+', moved_from='X/Y/Z', moved_to='X/Y/Z', wc_rev='-'),
+    'A/B'       : Item(status='A ', copied='+', moved_from='X/Y/Z/B', wc_rev='-', entry_status='R '),
+    'A/B/C'     : Item(status='R ', copied='+', moved_from='X', moved_to='X', wc_rev='-'),
+    'A/B/C/Y'   : Item(status='D ', copied='+', wc_rev='-', moved_to='X/Y'),
+    'A/B/C/Y/y' : Item(status='D ', copied='+', wc_rev='-'),
+    'A/B/C/Y/Z' : Item(status='D ', copied='+', wc_rev='-'),
+    'A/B/C/Y/Z/z':Item(status='D ', copied='+', wc_rev='-'),
+    'X'         : Item(status='R ', copied='+', moved_from='A/B/C', moved_to='A/B/C', wc_rev='-'),
+    'X/Y'       : Item(status='A ', copied='+', moved_from='A/B/C/Y', wc_rev='-', entry_status='R '),
+    'X/Y/Z'     : Item(status='R ', copied='+', moved_from='A', moved_to='A', wc_rev='-'),
+    'X/Y/Z/B'   : Item(status='D ', copied='+', wc_rev='-', moved_to='A/B'),
+    'X/Y/Z/B/b' : Item(status='D ', copied='+', wc_rev='-'),
+    'X/Y/Z/B/C' : Item(status='D ', copied='+', wc_rev='-'),
+    'X/Y/Z/B/C/c':Item(status='D ', copied='+', wc_rev='-'),
+    'A/a'       : Item(status='D ', wc_rev='1'),
+    'A/B/b'     : Item(status='D ', wc_rev='1'),
+    'A/B/C/c'   : Item(status='D ', copied='+', wc_rev='-'),
+    'X/x'       : Item(status='D ', wc_rev='1'),
+    'X/Y/y'     : Item(status='D ', wc_rev='1'),
+    'X/Y/Z/z'   : Item(status='D ', copied='+', wc_rev='-'),
+    'X/c'       : Item(status='  ', copied='+', wc_rev='-'),
+    'A/z'       : Item(status='  ', copied='+', wc_rev='-'),
+    'A/B/b'     : Item(status='  ', copied='+', wc_rev='-'),
+    'X/Y/y'     : Item(status='  ', copied='+', wc_rev='-'),
+    'X/Y/Z/a'   : Item(status='  ', copied='+', wc_rev='-'),
+    'A/B/C/x'   : Item(status='  ', copied='+', wc_rev='-'),
+  })
+  svntest.actions.run_and_verify_status(wc_dir, r2_status)
+
+  svntest.main.run_svn(None, 'commit', '-m', 'r2: juggle the tree', wc_dir)
+  expected_output = svntest.verify.UnorderedRegexListOutput(map(re.escape, [
+    '   R /A (from /X/Y/Z:1)',
+    '   A /A/B (from /A/B:1)',
+    '   R /A/B/C (from /X:1)',
+    '   R /X (from /A/B/C:1)',
+    '   A /X/Y (from /X/Y:1)',
+    '   R /X/Y/Z (from /A:1)',
+    '   D /X/Y/Z/B',
+    '   D /A/B/C/Y',
+  ]) + [
+    '^-', '^r2', '^-', '^Changed paths:',
+  ])
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'log', '-qvr2', repo_url)
+
+  ## Test updating to r1.
+  svntest.main.run_svn(None, 'update', '-r1', wc_dir)
+  svntest.actions.run_and_verify_status(wc_dir, r1_status)
+
 #######################################################################
 # Run the tests
 
@@ -1245,6 +1349,7 @@ test_list = [ None,
               deeper_move_file_test,
               property_merge,
               move_missing,
+              nested_replaces,
             ]
 
 if __name__ == '__main__':

Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/svnadmin_tests.py?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/svnadmin_tests.py Sun Jun 30 01:03:10 2013
@@ -1826,6 +1826,67 @@ def recover_old(sbox):
   svntest.main.run_svnadmin("recover", sbox.repo_dir)
 
 
+@SkipUnless(svntest.main.is_fs_type_fsfs)
+def verify_keep_going(sbox):
+  "svnadmin verify --keep-going test"
+
+  sbox.build(create_wc = False)
+  repo_url = sbox.repo_url
+  B_url = sbox.repo_url + '/B'
+  C_url = sbox.repo_url + '/C'
+
+  # Create A/B/E/bravo in r2.
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'mkdir', '-m', 'log_msg',
+                                     B_url)
+
+  svntest.actions.run_and_verify_svn(None, None, [],
+                                     'mkdir', '-m', 'log_msg',
+                                     C_url)
+  
+  r2 = fsfs_file(sbox.repo_dir, 'revs', '2')
+  fp = open(r2, 'a')
+  fp.write("""inserting junk to corrupt the rev""")
+  fp.close()
+  exit_code, output, errput = svntest.main.run_svnadmin("verify",
+                                                        "--keep-going",
+                                                        sbox.repo_dir)
+
+  exp_out = svntest.verify.RegexListOutput([".*Verifying repository metadata",
+                                           ".*Verified revision 0.",
+                                           ".*Verified revision 1.",
+                                           ".*Error verifying revision 2.",
+                                           ".*Verified revision 3."])
+
+  exp_err = svntest.verify.RegexListOutput(["svnadmin: E160004:.*",
+                                           "svnadmin: E165011:.*"], False)
+
+
+  if svntest.verify.verify_outputs("Unexpected error while running 'svnadmin verify'.",
+                                   output, errput, exp_out, exp_err):
+    raise svntest.Failure
+
+  exit_code, output, errput = svntest.main.run_svnadmin("verify",
+                                                        sbox.repo_dir)
+
+  exp_out = svntest.verify.RegexListOutput([".*Verifying repository metadata",
+                                           ".*Verified revision 0.",
+                                           ".*Verified revision 1.",
+                                           ".*Error verifying revision 2."])
+
+  if svntest.verify.verify_outputs("Unexpected error while running 'svnadmin verify'.",
+                                   output, errput, exp_out, exp_err):
+    raise svntest.Failure
+
+
+  exit_code, output, errput = svntest.main.run_svnadmin("verify",
+                                                        "--quiet",
+                                                        sbox.repo_dir)
+
+  if svntest.verify.verify_outputs("Output of 'svnadmin verify' is unexpected.",
+                                   None, errput, None, "svnadmin: E165011:.*"):
+    raise svntest.Failure
+
 ########################################################################
 # Run the tests
 
@@ -1862,6 +1923,7 @@ test_list = [ None,
               locking,
               mergeinfo_race,
               recover_old,
+              verify_keep_going,
              ]
 
 if __name__ == '__main__':

Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/svnmucc_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/svnmucc_tests.py?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/svnmucc_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/svnmucc_tests.py Sun Jun 30 01:03:10 2013
@@ -411,6 +411,48 @@ def no_log_msg_non_interactive(sbox):
                 'mkdir', 'A/subdir')
 
 
+def nested_replaces(sbox):
+  "nested replaces"
+
+  sbox.build(create_wc=False)
+  repo_url = sbox.repo_url
+  svntest.actions.run_and_verify_svnmucc(None, None, [],
+                           '-U', repo_url, '-m', 'r2: create tree',
+                           'rm', 'A',
+                           'rm', 'iota',
+                           'mkdir', 'A', 'mkdir', 'A/B', 'mkdir', 'A/B/C',
+                           'mkdir', 'M', 'mkdir', 'M/N', 'mkdir', 'M/N/O',
+                           'mkdir', 'X', 'mkdir', 'X/Y', 'mkdir', 'X/Y/Z')
+  svntest.actions.run_and_verify_svnmucc(None, None, [],
+                           '-U', repo_url, '-m', 'r3: nested replaces',
+                           *("""
+rm A rm M rm X
+cp HEAD X/Y/Z A cp HEAD A/B/C M cp HEAD M/N/O X
+cp HEAD A/B A/B cp HEAD M/N M/N cp HEAD X/Y X/Y
+rm A/B/C rm M/N/O rm X/Y/Z
+cp HEAD X A/B/C cp HEAD A M/N/O cp HEAD M X/Y/Z
+rm A/B/C/Y
+                           """.split()))
+
+  # ### TODO: need a smarter run_and_verify_log() that verifies copyfrom
+  expected_output = svntest.verify.UnorderedRegexListOutput(map(re.escape, [
+    '   R /A (from /X/Y/Z:2)',
+    '   A /A/B (from /A/B:2)',
+    '   R /A/B/C (from /X:2)',
+    '   R /M (from /A/B/C:2)',
+    '   A /M/N (from /M/N:2)',
+    '   R /M/N/O (from /A:2)',
+    '   R /X (from /M/N/O:2)',
+    '   A /X/Y (from /X/Y:2)',
+    '   R /X/Y/Z (from /M:2)',
+    '   D /A/B/C/Y',
+  ]) + [
+    '^-', '^r3', '^-', '^Changed paths:',
+  ])
+  svntest.actions.run_and_verify_svn(None, expected_output, [],
+                                     'log', '-qvr3', repo_url)
+
+
 ######################################################################
 
 test_list = [ None,
@@ -419,6 +461,7 @@ test_list = [ None,
               propset_root,
               too_many_log_messages,
               no_log_msg_non_interactive,
+              nested_replaces,
             ]
 
 if __name__ == '__main__':

Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/svntest/main.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/svntest/main.py?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/svntest/main.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/svntest/main.py Sun Jun 30 01:03:10 2013
@@ -561,7 +561,8 @@ def run_command_stdin(command, error_exp
          stderr_lines
 
 def create_config_dir(cfgdir, config_contents=None, server_contents=None,
-                      ssl_cert=None, ssl_url=None, http_proxy=None):
+                      ssl_cert=None, ssl_url=None, http_proxy=None,
+                      exclusive_wc_locks=None):
   "Create config directories and files"
 
   # config file names
@@ -582,7 +583,11 @@ password-stores =
 [miscellany]
 interactive-conflicts = false
 """
-
+    if exclusive_wc_locks:
+      config_contents += """
+[working-copy]
+exclusive-locking = true
+"""
   # define default server file contents if none provided
   if server_contents is None:
     http_library_str = ""
@@ -1356,6 +1361,9 @@ def server_enforces_date_syntax():
 def server_has_atomic_revprop():
   return options.server_minor_version >= 7
 
+def server_has_reverse_get_file_revs():
+  return options.server_minor_version >= 8
+
 def is_plaintext_password_storage_disabled():
   try:
     predicate = re.compile("^WARNING: Plaintext password storage is enabled!")
@@ -1424,6 +1432,8 @@ class TestSpawningThread(threading.Threa
       args.append('--ssl-cert=' + options.ssl_cert)
     if options.http_proxy:
       args.append('--http-proxy=' + options.http_proxy)
+    if options.exclusive_wc_locks:
+      args.append('--exclusive-wc-locks')
 
     result, stdout_lines, stderr_lines = spawn_process(command, 0, False, None,
                                                        *args)
@@ -1771,6 +1781,8 @@ def _create_parser():
                     help='Use the HTTP Proxy at hostname:port.')
   parser.add_option('--tools-bin', action='store', dest='tools_bin',
                     help='Use the svn tools installed in this path')
+  parser.add_option('--exclusive-wc-locks', action='store_true',
+                    help='Use sqlite exclusive locking for working copies')
 
   # most of the defaults are None, but some are other values, set them here
   parser.set_defaults(
@@ -2092,7 +2104,8 @@ def execute_tests(test_list, serial_only
     create_config_dir(default_config_dir,
                       ssl_cert=options.ssl_cert,
                       ssl_url=options.test_area_url,
-                      http_proxy=options.http_proxy)
+                      http_proxy=options.http_proxy,
+                      exclusive_wc_locks=options.exclusive_wc_locks)
 
     # Setup the pristine repository
     svntest.actions.setup_pristine_greek_repository()

Modified: subversion/branches/fsfs-format7/subversion/tests/cmdline/wc_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/cmdline/wc_tests.py?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/cmdline/wc_tests.py (original)
+++ subversion/branches/fsfs-format7/subversion/tests/cmdline/wc_tests.py Sun Jun 30 01:03:10 2013
@@ -42,6 +42,7 @@ Issues = svntest.testcase.Issues_deco
 Issue = svntest.testcase.Issue_deco
 Wimp = svntest.testcase.Wimp_deco
 Item = wc.StateItem
+UnorderedOutput = svntest.verify.UnorderedOutput
 
 ######################################################################
 # Tests
@@ -200,6 +201,144 @@ def cleanup_below_wc_root(sbox):
   svntest.actions.run_and_verify_svn("Cleanup below wc root", None, [],
                                      "cleanup", sbox.ospath("A"))
 
+@SkipUnless(svntest.main.is_posix_os)
+@Issue(4383)
+def update_through_unversioned_symlink(sbox):
+  """update through unversioned symlink"""
+
+  sbox.build(read_only = True)
+  wc_dir = sbox.wc_dir
+  state = svntest.actions.get_virginal_state(wc_dir, 1)
+  symlink = sbox.get_tempname()
+  os.symlink(os.path.abspath(sbox.wc_dir), symlink)
+  expected_output = []
+  expected_disk = []
+  expected_status = []
+  # Subversion 1.8.0 crashes when updating a working copy through a symlink
+  svntest.actions.run_and_verify_update(wc_dir, expected_output,
+                                        expected_disk, expected_status,
+                                        None, None, None, None, None, 1,
+                                        symlink)
+
+@Issue(3549)
+def cleanup_unversioned_items(sbox):
+  """cleanup --remove-unversioned / --remove-ignored"""
+
+  sbox.build(read_only = True)
+  wc_dir = sbox.wc_dir
+
+  # create some unversioned items
+  os.mkdir(sbox.ospath('dir1'))
+  os.mkdir(sbox.ospath('dir2'))
+  contents = "This is an unversioned file\n."
+  svntest.main.file_write(sbox.ospath('dir1/dir1_child1'), contents)
+  svntest.main.file_write(sbox.ospath('dir2/dir2_child1'), contents)
+  os.mkdir(sbox.ospath('dir2/foo_child2'))
+  svntest.main.file_write(sbox.ospath('file_foo'), contents),
+  os.mkdir(sbox.ospath('dir_foo'))
+  svntest.main.file_write(sbox.ospath('dir_foo/foo_child1'), contents)
+  os.mkdir(sbox.ospath('dir_foo/foo_child2'))
+  # a file that matches a default ignore pattern
+  svntest.main.file_write(sbox.ospath('foo.o'), contents)
+
+  # ignore some of the unversioned items
+  sbox.simple_propset('svn:ignore', '*_foo', '.')
+
+  os.chdir(wc_dir)
+
+  expected_output = [
+        ' M      .\n',
+        '?       dir1\n',
+        '?       dir2\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'status')
+  expected_output += [
+        'I       dir_foo\n',
+        'I       file_foo\n',
+        'I       foo.o\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'status', '--no-ignore')
+
+  expected_output = [
+        'D         dir1\n',
+        'D         dir2\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'cleanup', '--remove-unversioned')
+  expected_output = [
+        ' M      .\n',
+        'I       dir_foo\n',
+        'I       file_foo\n',
+        'I       foo.o\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'status', '--no-ignore')
+
+  # remove ignored items, with an empty global-ignores list
+  expected_output = [
+        'D         dir_foo\n',
+        'D         file_foo\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'cleanup', '--remove-ignored',
+                                     '--config-option',
+                                     'config:miscellany:global-ignores=')
+
+  # the file matching global-ignores should still be present
+  expected_output = [
+        ' M      .\n',
+        'I       foo.o\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'status', '--no-ignore')
+
+  # un-ignore the file matching global ignores, making it unversioned,
+  # and remove it with --remove-unversioned
+  expected_output = [
+        'D         foo.o\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, UnorderedOutput(expected_output),
+                                     [], 'cleanup', '--remove-unversioned',
+                                     '--config-option',
+                                     'config:miscellany:global-ignores=')
+  expected_output = [
+        ' M      .\n',
+  ]
+  svntest.actions.run_and_verify_svn(None, expected_output,
+                                     [], 'status', '--no-ignore')
+
+def cleanup_unversioned_items_in_locked_wc(sbox):
+  """cleanup unversioned items in locked WC should fail"""
+
+  sbox.build(read_only = True)
+
+  contents = "This is an unversioned file\n."
+  svntest.main.file_write(sbox.ospath('unversioned_file'), contents)
+
+  svntest.actions.lock_admin_dir(sbox.ospath(""), True)
+  for option in ['--remove-unversioned', '--remove-ignored']:
+    svntest.actions.run_and_verify_svn(None, None,
+                                       "svn: E155004: Working copy locked;.*",
+                                       "cleanup", option,
+                                       sbox.ospath(""))
+
+def cleanup_dir_external(sbox):
+  """cleanup --include-externals"""
+
+  sbox.build(read_only = True)
+
+  # configure a directory external
+  sbox.simple_propset("svn:externals", "^/A A_ext", ".")
+  sbox.simple_update()
+
+  svntest.actions.lock_admin_dir(sbox.ospath("A_ext"), True)
+  svntest.actions.run_and_verify_svn(None, ["Performing cleanup on external " +
+                                     "item at '%s'.\n" % sbox.ospath("A_ext")],
+                                     [], "cleanup", '--include-externals',
+                                     sbox.ospath(""))
+
 ########################################################################
 # Run the tests
 
@@ -218,6 +357,10 @@ test_list = [ None,
               status_without_wc_db_and_entries,
               status_with_missing_wc_db_and_maybe_valid_entries,
               cleanup_below_wc_root,
+              update_through_unversioned_symlink,
+              cleanup_unversioned_items,
+              cleanup_unversioned_items_in_locked_wc,
+              cleanup_dir_external,
              ]
 
 if __name__ == '__main__':

Propchange: subversion/branches/fsfs-format7/subversion/tests/libsvn_fs/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sun Jun 30 01:03:10 2013
@@ -1,4 +1,5 @@
 .libs
+test-fs-*
 test-repo-*
 locks-test
 fs-test

Modified: subversion/branches/fsfs-format7/subversion/tests/libsvn_fs_fs/fs-pack-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/libsvn_fs_fs/fs-pack-test.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/libsvn_fs_fs/fs-pack-test.c (original)
+++ subversion/branches/fsfs-format7/subversion/tests/libsvn_fs_fs/fs-pack-test.c Sun Jun 30 01:03:10 2013
@@ -125,6 +125,8 @@ pack_notify(void *baton,
   return SVN_NO_ERROR;
 }
 
+#define R1_LOG_MSG "Let's serf"
+
 /* Create a packed filesystem in DIR.  Set the shard size to
    SHARD_SIZE and create NUM_REVS number of revisions (in addition to
    r0).  Use POOL for allocations.  After this function successfully
@@ -166,6 +168,9 @@ create_packed_filesystem(const char *dir
   SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, subpool));
   SVN_ERR(svn_fs_txn_root(&txn_root, txn, subpool));
   SVN_ERR(svn_test__create_greek_tree(txn_root, subpool));
+  SVN_ERR(svn_fs_change_txn_prop(txn, SVN_PROP_REVISION_LOG,
+                                 svn_string_create(R1_LOG_MSG, pool), 
+                                 pool));
   SVN_ERR(svn_fs_commit_txn(&conflict, &after_rev, txn, subpool));
   SVN_TEST_ASSERT(SVN_IS_VALID_REVNUM(after_rev));
 
@@ -902,6 +907,35 @@ test_reps(const svn_test_opts_t *opts,
 #undef MAX_REV
 
 /* ------------------------------------------------------------------------ */
+#define REPO_NAME "test-repo-fsfs-pack-shard-size-one"
+#define SHARD_SIZE 1
+#define MAX_REV 4
+static svn_error_t *
+pack_shard_size_one(const svn_test_opts_t *opts,
+                     apr_pool_t *pool)
+{
+  svn_string_t *propval;
+  svn_fs_t *fs;
+
+  /* Bail (with success) on known-untestable scenarios */
+  if ((strcmp(opts->fs_type, "fsfs") != 0)
+      || (opts->server_minor_version && (opts->server_minor_version < 6)))
+    return SVN_NO_ERROR;
+
+  SVN_ERR(create_packed_filesystem(REPO_NAME, opts, MAX_REV, SHARD_SIZE,
+                                   pool));
+  SVN_ERR(svn_fs_open(&fs, REPO_NAME, NULL, pool));
+  /* whitebox: revprop packing special-cases r0, which causes
+     (start_rev==1, end_rev==0) in pack_revprops_shard().  So test that. */
+  SVN_ERR(svn_fs_revision_prop(&propval, fs, 1, SVN_PROP_REVISION_LOG, pool));
+  SVN_TEST_STRING_ASSERT(propval->data, R1_LOG_MSG);
+
+  return SVN_NO_ERROR;
+}
+#undef REPO_NAME
+#undef SHARD_SIZE
+#undef MAX_REV
+/* ------------------------------------------------------------------------ */
 
 /* The test table.  */
 
@@ -930,5 +964,7 @@ struct svn_test_descriptor_t test_funcs[
                        "test svn_fs_info"),
     SVN_TEST_OPTS_PASS(test_reps,
                        "test representations container"),
+    SVN_TEST_OPTS_PASS(pack_shard_size_one,
+                       "test packing with shard size = 1"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/fsfs-format7/subversion/tests/libsvn_subr/io-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/libsvn_subr/io-test.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/libsvn_subr/io-test.c (original)
+++ subversion/branches/fsfs-format7/subversion/tests/libsvn_subr/io-test.c Sun Jun 30 01:03:10 2013
@@ -481,6 +481,31 @@ test_three_file_content_comparison(apr_p
   return err;
 }
 
+static svn_error_t *
+read_length_line_shouldnt_loop(apr_pool_t *pool)
+{
+  const char *tmp_dir;
+  const char *tmp_file;
+  char buffer[4];
+  apr_size_t buffer_limit = sizeof(buffer);
+  apr_file_t *f;
+
+  SVN_ERR(svn_dirent_get_absolute(&tmp_dir, "read_length_tmp", pool));
+  SVN_ERR(svn_io_remove_dir2(tmp_dir, TRUE, NULL, NULL, pool));
+  SVN_ERR(svn_io_make_dir_recursively(tmp_dir, pool));
+  svn_test_add_dir_cleanup(tmp_dir);
+
+  SVN_ERR(svn_io_write_unique(&tmp_file, tmp_dir, "1234\r\n", 6,
+                              svn_io_file_del_on_pool_cleanup, pool));
+
+  SVN_ERR(svn_io_file_open(&f, tmp_file, APR_READ, APR_OS_DEFAULT, pool));
+
+  SVN_TEST_ASSERT_ERROR(svn_io_read_length_line(f, buffer, &buffer_limit,
+                                                pool), SVN_ERR_MALFORMED_FILE);
+  SVN_TEST_ASSERT(buffer_limit == 4);
+
+  return SVN_NO_ERROR;
+}
 
 
 /* The test table.  */
@@ -496,5 +521,7 @@ struct svn_test_descriptor_t test_funcs[
                    "three file size comparison"),
     SVN_TEST_PASS2(test_three_file_content_comparison,
                    "three file content comparison"),
+    SVN_TEST_PASS2(read_length_line_shouldnt_loop,
+                   "svn_io_read_length_line() shouldn't loop"),
     SVN_TEST_NULL
   };

Modified: subversion/branches/fsfs-format7/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/tests/libsvn_wc/op-depth-test.c?rev=1498045&r1=1498044&r2=1498045&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/branches/fsfs-format7/subversion/tests/libsvn_wc/op-depth-test.c Sun Jun 30 01:03:10 2013
@@ -1109,6 +1109,7 @@ base_dir_insert_remove(svn_test__sandbox
   SVN_ERR(svn_wc__db_base_remove(b->wc_ctx->db, dir_abspath,
                                  FALSE /* keep_as_Working */,
                                  FALSE /* queue_deletes */,
+                                 FALSE /* remove_locks */,
                                  SVN_INVALID_REVNUM,
                                  NULL, NULL, b->pool));
   SVN_ERR(svn_wc__wq_run(b->wc_ctx->db, dir_abspath,