You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2018/11/13 07:49:08 UTC

svn commit: r1846488 [14/23] - in /subversion/branches/mod-dav-svn-expressions: ./ build/ build/ac-macros/ build/generator/ build/generator/swig/ build/generator/templates/ build/generator/util/ build/win32/ contrib/client-side/ contrib/client-side/svn...

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/auth-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/auth-cmd.c?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/auth-cmd.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/auth-cmd.c Tue Nov 13 07:49:04 2018
@@ -455,12 +455,15 @@ svn_cl__auth(apr_getopt_t *os, void *bat
         {
           if (b.patterns->nelts == 0)
             SVN_ERR(svn_cmdline_printf(pool,
-                      _("Credentials cache in '%s' contains %d credentials\n"),
+                      Q_("Credentials cache in '%s' contains %d credential\n",
+                         "Credentials cache in '%s' contains %d credentials\n",
+                         b.matches),
                       svn_dirent_local_style(config_path, pool), b.matches));
           else
             SVN_ERR(svn_cmdline_printf(pool,
-                      _("Credentials cache in '%s' contains %d matching "
-                        "credentials\n"),
+                      Q_("Credentials cache in '%s' contains %d matching credential\n",
+                         "Credentials cache in '%s' contains %d matching credentials\n",
+                         b.matches),
                       svn_dirent_local_style(config_path, pool), b.matches));
         }
 
@@ -474,9 +477,11 @@ svn_cl__auth(apr_getopt_t *os, void *bat
                                    "no matching credentials"),
                                  svn_dirent_local_style(config_path, pool));
       else
-        SVN_ERR(svn_cmdline_printf(pool, _("Deleted %d matching credentials "
-                                   "from '%s'\n"), b.matches,
-                                   svn_dirent_local_style(config_path, pool)));
+        SVN_ERR(svn_cmdline_printf(pool,
+                  Q_("Deleted %d matching credential from '%s'\n",
+                     "Deleted %d matching credentials from '%s'\n",
+                     b.matches),
+                  b.matches, svn_dirent_local_style(config_path, pool)));
     }
 
   return SVN_NO_ERROR;

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/cl.h?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/cl.h (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/cl.h Tue Nov 13 07:49:04 2018
@@ -178,6 +178,7 @@ typedef struct svn_cl__opt_state_t
   svn_boolean_t help;            /* print usage message */
   const char *auth_username;     /* auth username */
   const char *auth_password;     /* auth password */
+  svn_boolean_t auth_password_from_stdin; /* read password from stdin */
   const char *extensions;        /* subprocess extension args */
   apr_array_header_t *targets;   /* target list from file */
   svn_boolean_t xml;             /* output in xml, e.g., "svn log --xml" */
@@ -255,6 +256,12 @@ typedef struct svn_cl__opt_state_t
   const char *show_item;           /* print only the given item */
   svn_boolean_t adds_as_modification; /* update 'add vs add' no tree conflict */
   svn_boolean_t vacuum_pristines; /* remove unreferenced pristines */
+  svn_boolean_t drop;             /* drop shelf after successful unshelve */
+  enum svn_cl__viewspec_t {
+      svn_cl__viewspec_unspecified = 0 /* default */,
+      svn_cl__viewspec_classic,
+      svn_cl__viewspec_svn11
+  } viewspec;                     /* value of --x-viewspec */
 } svn_cl__opt_state_t;
 
 /* Conflict stats for operations such as update and merge. */
@@ -302,6 +309,14 @@ svn_opt_subcommand_t
   svn_cl__revert,
   svn_cl__resolve,
   svn_cl__resolved,
+  svn_cl__shelf_diff,
+  svn_cl__shelf_drop,
+  svn_cl__shelf_list,
+  svn_cl__shelf_list_by_paths,
+  svn_cl__shelf_log,
+  svn_cl__shelf_save,
+  svn_cl__shelf_shelve,
+  svn_cl__shelf_unshelve,
   svn_cl__status,
   svn_cl__switch,
   svn_cl__unlock,
@@ -310,7 +325,7 @@ svn_opt_subcommand_t
 
 
 /* See definition in svn.c for documentation. */
-extern const svn_opt_subcommand_desc2_t svn_cl__cmd_table[];
+extern const svn_opt_subcommand_desc3_t svn_cl__cmd_table[];
 
 /* See definition in svn.c for documentation. */
 extern const int svn_cl__global_options[];
@@ -910,6 +925,20 @@ svn_cl__similarity_check(const char *key
                          apr_size_t token_count,
                          apr_pool_t *scratch_pool);
 
+/* Return in FUNC_P and BATON_P a callback that prints a summary diff,
+ * according to the options XML and IGNORE_PROPERTIES.
+ *
+ * ANCHOR is a URL or local path to be prefixed to the printed paths.
+ */
+svn_error_t *
+svn_cl__get_diff_summary_writer(svn_client_diff_summarize_func_t *func_p,
+                                void **baton_p,
+                                svn_boolean_t xml,
+                                svn_boolean_t ignore_properties,
+                                const char *anchor,
+                                apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/conflict-callbacks.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/conflict-callbacks.c?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/conflict-callbacks.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/conflict-callbacks.c Tue Nov 13 07:49:04 2018
@@ -115,7 +115,7 @@ show_diff(svn_client_conflict_t *conflic
        * as it appears after the merge operation).
        *
        * For conflicts recorded by the 'update' and 'switch' operations,
-       * show a diff beween 'theirs' (the new pristine version of the
+       * show a diff between 'theirs' (the new pristine version of the
        * file) and 'merged' (the version of the file as it appears with
        * local changes merged with the new pristine version).
        *
@@ -440,6 +440,11 @@ static const resolver_option_t builtin_r
 
   /* Options for local move vs incoming edit. */
   { "m", svn_client_conflict_option_local_move_file_text_merge },
+  { "m", svn_client_conflict_option_local_move_dir_merge },
+
+  /* Options for local missing vs incoming edit. */
+  { "m", svn_client_conflict_option_sibling_move_file_text_merge },
+  { "m", svn_client_conflict_option_sibling_move_dir_merge },
 
   { NULL }
 };
@@ -1529,17 +1534,16 @@ build_tree_conflict_options(
           id != svn_client_conflict_option_accept_current_wc_state)
         *all_options_are_dumb = FALSE;
 
-      if (id == svn_client_conflict_option_incoming_move_file_text_merge ||
-          id == svn_client_conflict_option_incoming_move_dir_merge)
-        {
-          SVN_ERR(
-            svn_client_conflict_option_get_moved_to_repos_relpath_candidates(
-              possible_moved_to_repos_relpaths, builtin_option,
-              result_pool, iterpool));
-          SVN_ERR(svn_client_conflict_option_get_moved_to_abspath_candidates(
-                    possible_moved_to_abspaths, builtin_option,
-                    result_pool, iterpool));
-        }
+      if (*possible_moved_to_repos_relpaths == NULL)
+        SVN_ERR(
+          svn_client_conflict_option_get_moved_to_repos_relpath_candidates2(
+            possible_moved_to_repos_relpaths, builtin_option,
+            result_pool, iterpool));
+
+      if (*possible_moved_to_abspaths == NULL)
+        SVN_ERR(svn_client_conflict_option_get_moved_to_abspath_candidates2(
+                  possible_moved_to_abspaths, builtin_option,
+                  result_pool, iterpool));
     }
 
   svn_pool_destroy(iterpool);
@@ -1654,8 +1658,8 @@ prompt_move_target_path(int *preferred_m
         {
           char buf[1024];
 
-          svn_cmdline_fprintf(stderr, iterpool, "%s\n",
-                              svn_err_best_message(err, buf, sizeof(buf)));
+          SVN_ERR(svn_cmdline_fprintf(stderr, iterpool, "%s\n",
+                                      svn_err_best_message(err, buf, sizeof(buf))));
           svn_error_clear(err);
           continue;
         }
@@ -1670,6 +1674,69 @@ prompt_move_target_path(int *preferred_m
   return SVN_NO_ERROR;
 }
 
+static svn_error_t *
+find_conflict_option_with_repos_move_targets(
+  svn_client_conflict_option_t **option_with_move_targets,
+  apr_array_header_t *options,
+  apr_pool_t *scratch_pool)
+{
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  int i;
+  apr_array_header_t *possible_moved_to_repos_relpaths = NULL;
+  
+  *option_with_move_targets = NULL;
+
+  for (i = 0; i < options->nelts; i++)
+    {
+      svn_client_conflict_option_t *option;
+
+      svn_pool_clear(iterpool);
+      option = APR_ARRAY_IDX(options, i, svn_client_conflict_option_t *);
+      SVN_ERR(svn_client_conflict_option_get_moved_to_repos_relpath_candidates2(
+        &possible_moved_to_repos_relpaths, option, iterpool, iterpool));
+      if (possible_moved_to_repos_relpaths)
+        {
+          *option_with_move_targets = option;
+          break;
+        }
+    }
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
+
+static svn_error_t *
+find_conflict_option_with_working_copy_move_targets(
+  svn_client_conflict_option_t **option_with_move_targets,
+  apr_array_header_t *options,
+  apr_pool_t *scratch_pool)
+{
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
+  int i;
+  apr_array_header_t *possible_moved_to_abspaths = NULL;
+  
+  *option_with_move_targets = NULL;
+
+  for (i = 0; i < options->nelts; i++)
+    {
+      svn_client_conflict_option_t *option;
+
+      svn_pool_clear(iterpool);
+      option = APR_ARRAY_IDX(options, i, svn_client_conflict_option_t *);
+      SVN_ERR(svn_client_conflict_option_get_moved_to_abspath_candidates2(
+              &possible_moved_to_abspaths, option, scratch_pool,
+              iterpool));
+      if (possible_moved_to_abspaths)
+        {
+          *option_with_move_targets = option;
+          break;
+        }
+    }
+  svn_pool_destroy(iterpool);
+
+  return SVN_NO_ERROR;
+}
+
 /* Ask the user what to do about the tree conflict described by CONFLICT
  * and either resolve the conflict accordingly or postpone resolution.
  * SCRATCH_POOL is used for temporary allocations. */
@@ -1797,7 +1864,7 @@ handle_tree_conflict(svn_boolean_t *reso
         {
           int preferred_move_target_idx;
           apr_array_header_t *options;
-          svn_client_conflict_option_t *conflict_option;
+          svn_client_conflict_option_t *option;
 
           SVN_ERR(prompt_move_target_path(&preferred_move_target_idx,
                                           possible_moved_to_repos_relpaths,
@@ -1810,22 +1877,12 @@ handle_tree_conflict(svn_boolean_t *reso
                                                                   ctx,
                                                                   iterpool,
                                                                   iterpool));
-          conflict_option =
-            svn_client_conflict_option_find_by_id( 
-              options,
-              svn_client_conflict_option_incoming_move_file_text_merge);
-          if (conflict_option == NULL)
+          SVN_ERR(find_conflict_option_with_repos_move_targets(
+            &option, options, iterpool));
+          if (option)
             {
-              conflict_option =
-                svn_client_conflict_option_find_by_id( 
-                  options, svn_client_conflict_option_incoming_move_dir_merge);
-            }
-
-          if (conflict_option)
-            {
-              SVN_ERR(svn_client_conflict_option_set_moved_to_repos_relpath(
-                        conflict_option, preferred_move_target_idx,
-                        ctx, iterpool));
+              SVN_ERR(svn_client_conflict_option_set_moved_to_repos_relpath2(
+                        option, preferred_move_target_idx, ctx, iterpool));
               repos_move_target_chosen = TRUE;
               wc_move_target_chosen = FALSE;
 
@@ -1851,7 +1908,7 @@ handle_tree_conflict(svn_boolean_t *reso
         {
           int preferred_move_target_idx;
           apr_array_header_t *options;
-          svn_client_conflict_option_t *conflict_option;
+          svn_client_conflict_option_t *option;
 
           SVN_ERR(prompt_move_target_path(&preferred_move_target_idx,
                                            possible_moved_to_abspaths, TRUE,
@@ -1863,22 +1920,12 @@ handle_tree_conflict(svn_boolean_t *reso
                                                                   ctx,
                                                                   iterpool,
                                                                   iterpool));
-          conflict_option =
-            svn_client_conflict_option_find_by_id( 
-              options,
-              svn_client_conflict_option_incoming_move_file_text_merge);
-          if (conflict_option == NULL)
-            {
-              conflict_option =
-                svn_client_conflict_option_find_by_id( 
-                  options, svn_client_conflict_option_incoming_move_dir_merge);
-            }
-
-          if (conflict_option)
+          SVN_ERR(find_conflict_option_with_working_copy_move_targets(
+            &option, options, iterpool));
+          if (option)
             {
-              SVN_ERR(svn_client_conflict_option_set_moved_to_abspath(
-                        conflict_option, preferred_move_target_idx, ctx,
-                        iterpool));
+              SVN_ERR(svn_client_conflict_option_set_moved_to_abspath2(
+                        option, preferred_move_target_idx, ctx, iterpool));
               wc_move_target_chosen = TRUE;
 
               /* Update option description. */
@@ -1930,7 +1977,6 @@ resolve_conflict_interactively(svn_boole
                                svn_cmdline_prompt_baton_t *pb,
                                svn_cl__conflict_stats_t *conflict_stats,
                                svn_client_ctx_t *ctx,
-                               apr_pool_t *result_pool,
                                apr_pool_t *scratch_pool)
 {
   svn_boolean_t text_conflicted;
@@ -1964,7 +2010,7 @@ resolve_conflict_interactively(svn_boole
   if (props_conflicted->nelts > 0)
     SVN_ERR(handle_prop_conflicts(resolved, postponed, quit, &merged_propval,
                                   path_prefix, pb, editor_cmd, config, conflict,
-                                  conflict_stats, ctx, result_pool, scratch_pool));
+                                  conflict_stats, ctx, scratch_pool, scratch_pool));
   if (tree_conflicted)
     SVN_ERR(handle_tree_conflict(resolved, postponed, quit, printed_description,
                                  conflict, path_prefix, pb, conflict_stats, ctx,
@@ -2201,11 +2247,14 @@ svn_cl__resolve_conflict(svn_boolean_t *
       svn_boolean_t postponed = FALSE;
       svn_boolean_t printed_description = FALSE;
       svn_error_t *err;
+      apr_pool_t *iterpool;
 
       *quit = FALSE;
 
+      iterpool = svn_pool_create(scratch_pool);
       while (!resolved && !postponed && !*quit)
         {
+          svn_pool_clear(iterpool);
           err = resolve_conflict_interactively(&resolved, &postponed, quit,
                                                external_failed,
                                                printed_summary,
@@ -2214,7 +2263,7 @@ svn_cl__resolve_conflict(svn_boolean_t *
                                                editor_cmd, ctx->config,
                                                path_prefix, pb,
                                                conflict_stats, ctx,
-                                               scratch_pool, scratch_pool);
+                                               iterpool);
           if (err && err->apr_err == SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE)
             {
               /* Conflict resolution has failed. Let the user try again.
@@ -2226,6 +2275,7 @@ svn_cl__resolve_conflict(svn_boolean_t *
             }
           SVN_ERR(err);
         }
+      svn_pool_destroy(iterpool);
     }
   else if (option_id != svn_client_conflict_option_postpone)
     SVN_ERR(mark_conflict_resolved(conflict, option_id,

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/diff-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/diff-cmd.c?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/diff-cmd.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/diff-cmd.c Tue Nov 13 07:49:04 2018
@@ -181,6 +181,24 @@ summarize_regular(const svn_client_diff_
   return svn_cmdline_fflush(stdout);
 }
 
+svn_error_t *
+svn_cl__get_diff_summary_writer(svn_client_diff_summarize_func_t *func_p,
+                                void **baton_p,
+                                svn_boolean_t xml,
+                                svn_boolean_t ignore_properties,
+                                const char *anchor,
+                                apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool)
+{
+  struct summarize_baton_t *b = apr_pcalloc(result_pool, sizeof(*b));
+
+  b->anchor = anchor;
+  b->ignore_properties = ignore_properties;
+  *func_p = xml ? summarize_xml : summarize_regular;
+  *baton_p = b;
+  return SVN_NO_ERROR;
+}
+
 /* An svn_opt_subcommand_t to handle the 'diff' command.
    This implements the `svn_opt_subcommand_t' interface. */
 svn_error_t *
@@ -203,9 +221,6 @@ svn_cl__diff(apr_getopt_t *os,
   svn_boolean_t ignore_properties =
     opt_state->diff.patch_compatible || opt_state->diff.ignore_properties;
   int i;
-  struct summarize_baton_t summarize_baton;
-  const svn_client_diff_summarize_func_t summarize_func =
-    (opt_state->xml ? summarize_xml : summarize_regular);
 
   if (opt_state->extensions)
     options = svn_cstring_split(opt_state->extensions, " \t\n\r", TRUE, pool);
@@ -448,9 +463,13 @@ svn_cl__diff(apr_getopt_t *os,
 
           if (opt_state->diff.summarize)
             {
-              summarize_baton.anchor = target1;
-              summarize_baton.ignore_properties = ignore_properties;
+              svn_client_diff_summarize_func_t summarize_func;
+              void *summarize_baton;
 
+              SVN_ERR(svn_cl__get_diff_summary_writer(
+                                &summarize_func, &summarize_baton,
+                                opt_state->xml, ignore_properties, target1,
+                                iterpool, iterpool));
               SVN_ERR(svn_client_diff_summarize2(
                                 target1,
                                 &opt_state->start_revision,
@@ -459,11 +478,11 @@ svn_cl__diff(apr_getopt_t *os,
                                 opt_state->depth,
                                 ! opt_state->diff.notice_ancestry,
                                 opt_state->changelists,
-                                summarize_func, &summarize_baton,
+                                summarize_func, summarize_baton,
                                 ctx, iterpool));
             }
           else
-            SVN_ERR(svn_client_diff6(
+            SVN_ERR(svn_client_diff7(
                      options,
                      target1,
                      &(opt_state->start_revision),
@@ -479,6 +498,7 @@ svn_cl__diff(apr_getopt_t *os,
                      ignore_properties,
                      opt_state->diff.properties_only,
                      opt_state->diff.use_git_diff_format,
+                     TRUE /*pretty_print_mergeinfo*/,
                      svn_cmdline_output_encoding(pool),
                      outstream,
                      errstream,
@@ -501,8 +521,13 @@ svn_cl__diff(apr_getopt_t *os,
 
           if (opt_state->diff.summarize)
             {
-              summarize_baton.anchor = truepath;
-              summarize_baton.ignore_properties = ignore_properties;
+              svn_client_diff_summarize_func_t summarize_func;
+              void *summarize_baton;
+
+              SVN_ERR(svn_cl__get_diff_summary_writer(
+                                &summarize_func, &summarize_baton,
+                                opt_state->xml, ignore_properties, truepath,
+                                iterpool, iterpool));
               SVN_ERR(svn_client_diff_summarize_peg2(
                                 truepath,
                                 &peg_revision,
@@ -511,11 +536,11 @@ svn_cl__diff(apr_getopt_t *os,
                                 opt_state->depth,
                                 ! opt_state->diff.notice_ancestry,
                                 opt_state->changelists,
-                                summarize_func, &summarize_baton,
+                                summarize_func, summarize_baton,
                                 ctx, iterpool));
             }
           else
-            SVN_ERR(svn_client_diff_peg6(
+            SVN_ERR(svn_client_diff_peg7(
                      options,
                      truepath,
                      &peg_revision,
@@ -531,6 +556,7 @@ svn_cl__diff(apr_getopt_t *os,
                      ignore_properties,
                      opt_state->diff.properties_only,
                      opt_state->diff.use_git_diff_format,
+                     TRUE /*pretty_print_mergeinfo*/,
                      svn_cmdline_output_encoding(pool),
                      outstream,
                      errstream,

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/help-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/help-cmd.c?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/help-cmd.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/help-cmd.c Tue Nov 13 07:49:04 2018
@@ -148,22 +148,25 @@ svn_cl__help(apr_getopt_t *os,
                            _("\nThe following authentication credential caches are available:\n\n"));
 
   /*### There is no API to query available providers at run time. */
+  if (config_path)
+    {
 #if (defined(WIN32) && !defined(__MINGW32__))
-  version_footer =
-    svn_stringbuf_create(apr_psprintf(pool, _("%s* Wincrypt cache in %s\n"),
-                                      version_footer->data,
-                                      svn_dirent_local_style(config_path,
-                                                             pool)),
-                         pool);
+      version_footer =
+        svn_stringbuf_create(apr_psprintf(pool, _("%s* Wincrypt cache in %s\n"),
+                                          version_footer->data,
+                                          svn_dirent_local_style(config_path,
+                                                                 pool)),
+                             pool);
 #elif !defined(SVN_DISABLE_PLAINTEXT_PASSWORD_STORAGE)
-  version_footer =
-    svn_stringbuf_create(apr_psprintf(pool, _("%s* Plaintext cache in %s\n"),
-                                      version_footer->data,
-                                      svn_dirent_local_style(config_path,
-                                                             pool)),
-                         pool);
+      version_footer =
+        svn_stringbuf_create(apr_psprintf(pool, _("%s* Plaintext cache in %s\n"),
+                                          version_footer->data,
+                                          svn_dirent_local_style(config_path,
+                                                                 pool)),
+                             pool);
 #endif
-#ifdef SVN_HAVE_GNOME_KEYRING
+    }
+#if (defined(SVN_HAVE_GNOME_KEYRING) || defined(SVN_HAVE_LIBSECRET))
   svn_stringbuf_appendcstr(version_footer, "* Gnome Keyring\n");
 #endif
 #ifdef SVN_HAVE_GPG_AGENT
@@ -176,7 +179,7 @@ svn_cl__help(apr_getopt_t *os,
   svn_stringbuf_appendcstr(version_footer, "* KWallet (KDE)\n");
 #endif
 
-  return svn_opt_print_help4(os,
+  return svn_opt_print_help5(os,
                              "svn",   /* ### erm, derive somehow? */
                              opt_state ? opt_state->version : FALSE,
                              opt_state ? opt_state->quiet : FALSE,

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/info-cmd.c?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/info-cmd.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/info-cmd.c Tue Nov 13 07:49:04 2018
@@ -21,6 +21,10 @@
  * ====================================================================
  */
 
+/* We define this here to remove any further warnings about the usage of
+   experimental functions in this file. */
+#define SVN_EXPERIMENTAL
+
 /* ==================================================================== */
 
 
@@ -45,6 +49,254 @@
 
 /*** Code. ***/
 
+struct layout_list_baton_t
+{
+  svn_boolean_t checkout;
+  const char *target;
+  const char *target_abspath;
+  svn_boolean_t with_revs;
+  int vs_py_format;
+};
+
+/* Output as 'svn' command-line commands.
+ *
+ * Implements svn_client__layout_func_t
+ */
+static svn_error_t *
+output_svn_command_line(void *layout_baton,
+                        const char *local_abspath,
+                        const char *repos_root_url,
+                        svn_boolean_t not_present,
+                        svn_boolean_t url_changed,
+                        const char *url,
+                        svn_boolean_t revision_changed,
+                        svn_revnum_t revision,
+                        svn_boolean_t depth_changed,
+                        svn_depth_t depth,
+                        apr_pool_t *scratch_pool)
+{
+  struct layout_list_baton_t *llb = layout_baton;
+  const char *relpath = svn_dirent_skip_ancestor(llb->target_abspath,
+                                                 local_abspath);
+  const char *cmd;
+  const char *depth_str;
+  const char *url_rev_str;
+
+  depth_str = (depth_changed
+               ? apr_psprintf(scratch_pool, " --set-depth=%s",
+                              svn_depth_to_word(depth))
+               : "");
+
+  if (llb->checkout)
+    {
+      cmd = "svn checkout";
+      if (depth != svn_depth_infinity)
+        depth_str = apr_psprintf(scratch_pool,
+                                 " --depth=%s", svn_depth_to_word(depth));
+      url_rev_str = apr_psprintf(scratch_pool, " %s", url);
+      if (llb->with_revs)
+        url_rev_str = apr_psprintf(scratch_pool, "%s@%ld",
+                                   url_rev_str, revision);
+      llb->checkout = FALSE;
+    }
+  else if (not_present)
+    {
+      /* Easiest way to create a not present node: update to r0 */
+      cmd = "svn update";
+      url_rev_str = " -r0";
+    }
+  else if (url_changed)
+    {
+      cmd = "svn switch";
+      url_rev_str = apr_psprintf(scratch_pool, " ^/%s",
+                                 svn_uri_skip_ancestor(repos_root_url,
+                                                       url, scratch_pool));
+      if (llb->with_revs)
+        url_rev_str = apr_psprintf(scratch_pool, "%s@%ld",
+                                   url_rev_str, revision);
+    }
+  else if (llb->with_revs && revision_changed)
+    {
+      cmd = "svn update";
+      url_rev_str = apr_psprintf(scratch_pool, " -r%ld", revision);
+    }
+  else if (depth_changed)
+    {
+      cmd = "svn update";
+      url_rev_str = "";
+    }
+  else
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_cmdline_printf(scratch_pool,
+                             "%s%-23s%-10s %s\n",
+                             cmd, depth_str, url_rev_str,
+                             svn_dirent_local_style(
+                               svn_dirent_join(llb->target, relpath,
+                                               scratch_pool), scratch_pool)));
+
+  return SVN_NO_ERROR;
+}
+
+/*  */
+static const char *
+depth_to_viewspec_py(svn_depth_t depth,
+                     apr_pool_t *result_pool)
+{
+  switch (depth)
+    {
+    case svn_depth_infinity:
+      return "/**";
+    case svn_depth_immediates:
+      return "/*";
+    case svn_depth_files:
+      return "/~";
+    case svn_depth_empty:
+      return "";
+    case svn_depth_exclude:
+      return "!";
+    default:
+      break;
+    }
+  return NULL;
+}
+
+/* Output in the format used by 'tools/client-side/viewspec.py'
+ *
+ * Implements svn_client__layout_func_t
+ */
+static svn_error_t *
+output_svn_viewspec_py(void *layout_baton,
+                       const char *local_abspath,
+                       const char *repos_root_url,
+                       svn_boolean_t not_present,
+                       svn_boolean_t url_changed,
+                       const char *url,
+                       svn_boolean_t revision_changed,
+                       svn_revnum_t revision,
+                       svn_boolean_t depth_changed,
+                       svn_depth_t depth,
+                       apr_pool_t *scratch_pool)
+{
+  struct layout_list_baton_t *llb = layout_baton;
+  const char *relpath = svn_dirent_skip_ancestor(llb->target_abspath,
+                                                 local_abspath);
+  const char *depth_str;
+  const char *rev_str = "";
+  const char *repos_rel_url = "";
+
+  depth_str = ((depth_changed || llb->checkout)
+               ? depth_to_viewspec_py(depth, scratch_pool)
+               : "");
+  if (! llb->with_revs)
+    revision_changed = FALSE;
+  if (revision_changed)
+    rev_str = apr_psprintf(scratch_pool, "@%ld", revision);
+
+  if (llb->checkout)
+    {
+      SVN_ERR(svn_cmdline_printf(scratch_pool,
+                                 "Format: %d\n"
+                                 "Url: %s\n",
+                                 llb->vs_py_format, url));
+      if (llb->with_revs)
+        SVN_ERR(svn_cmdline_printf(scratch_pool,
+                                   "Revision: %ld\n",
+                                   revision));
+      SVN_ERR(svn_cmdline_printf(scratch_pool, "\n"));
+      llb->checkout = FALSE;
+
+      if (depth == svn_depth_empty)
+        return SVN_NO_ERROR;
+      if (depth_str[0] == '/')
+        depth_str++;
+    }
+  else if (not_present)
+    {
+      /* Easiest way to create a not present node: update to r0 */
+      if (llb->vs_py_format < 2)
+        return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                                 _("svn-viewspec.py format 1 does not support "
+                                   "the 'not-present' state found at '%s'"),
+                                 relpath);
+      rev_str = "@0";
+    }
+  else if (url_changed)
+    {
+      if (llb->vs_py_format < 2)
+        return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                                 _("svn-viewspec.py format 1 does not support "
+                                   "the 'switched' state found at '%s'"),
+                                 relpath);
+      repos_rel_url = svn_uri_skip_ancestor(repos_root_url, url,
+                                            scratch_pool);
+      repos_rel_url = apr_psprintf(scratch_pool, "^/%s", repos_rel_url);
+    }
+  else if (!(revision_changed || depth_changed))
+    return SVN_NO_ERROR;
+
+  SVN_ERR(svn_cmdline_printf(scratch_pool,
+                             "%s%s %s%s\n",
+                             relpath, depth_str, repos_rel_url, rev_str));
+
+  return SVN_NO_ERROR;
+}
+
+/*
+ * Call svn_client__layout_list(), using a receiver function decided
+ * by VIEWSPEC.
+ */
+static svn_error_t *
+cl_layout_list(apr_array_header_t *targets,
+               enum svn_cl__viewspec_t viewspec,
+               void *baton,
+               svn_client_ctx_t *ctx,
+               apr_pool_t *scratch_pool)
+{
+  const char *list_path, *list_abspath;
+  struct layout_list_baton_t llb;
+
+  /* Add "." if user passed 0 arguments */
+  svn_opt_push_implicit_dot_target(targets, scratch_pool);
+
+  if (targets->nelts > 1)
+    return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, 0, NULL);
+
+  list_path = APR_ARRAY_IDX(targets, 0, const char *);
+
+  SVN_ERR(svn_cl__check_target_is_local_path(list_path));
+
+  SVN_ERR(svn_dirent_get_absolute(&list_abspath, list_path,
+                                  scratch_pool));
+
+  llb.checkout = TRUE;
+  llb.target = list_path;
+  llb.target_abspath = list_abspath;
+  llb.with_revs = TRUE;
+
+  switch (viewspec)
+    {
+    case svn_cl__viewspec_classic:
+      /* svn-viewspec.py format */
+      llb.vs_py_format = 2;
+
+      SVN_ERR(svn_client__layout_list(list_abspath,
+                                      output_svn_viewspec_py, &llb,
+                                      ctx, scratch_pool));
+      break;
+    case svn_cl__viewspec_svn11:
+      /* svn command-line format */
+      SVN_ERR(svn_client__layout_list(list_abspath,
+                                      output_svn_command_line, &llb,
+                                      ctx, scratch_pool));
+      break;
+    default:
+      SVN_ERR_MALFUNCTION();
+    }
+
+  return SVN_NO_ERROR;
+}
+
 static svn_error_t *
 svn_cl__info_print_time(apr_time_t atime,
                         const char *desc,
@@ -110,7 +362,9 @@ typedef enum
   info_item_last_changed_author,
 
   /* Working copy information */
-  info_item_wc_root
+  info_item_wc_root,
+  info_item_schedule,
+  info_item_depth
 } info_item_t;
 
 /* Mapping between option keywords and info_item_t. */
@@ -133,7 +387,9 @@ static const info_item_map_t info_item_m
                                           info_item_last_changed_rev },
     { MAKE_STRING("last-changed-date"),   info_item_last_changed_date },
     { MAKE_STRING("last-changed-author"), info_item_last_changed_author },
-    { MAKE_STRING("wc-root"),             info_item_wc_root }
+    { MAKE_STRING("wc-root"),             info_item_wc_root },
+    { MAKE_STRING("schedule"),            info_item_schedule },
+    { MAKE_STRING("depth"),               info_item_depth },
   };
 #undef MAKE_STRING
 
@@ -888,6 +1144,20 @@ print_info_item(void *baton,
                   target_path, pool));
       break;
 
+    case info_item_schedule:
+      SVN_ERR(print_info_item_string(
+                  (info->wc_info
+                   ? schedule_str(info->wc_info->schedule) : NULL),
+                  target_path, pool));
+      break;
+
+    case info_item_depth:
+      SVN_ERR(print_info_item_string(
+                  ((info->wc_info && info->kind == svn_node_dir)
+                   ? svn_depth_to_word(info->wc_info->depth) : NULL),
+                  target_path, pool));
+      break;
+
     default:
       SVN_ERR_MALFUNCTION();
     }
@@ -918,6 +1188,12 @@ svn_cl__info(apr_getopt_t *os,
                                                       opt_state->targets,
                                                       ctx, FALSE, pool));
 
+  if (opt_state->viewspec)
+    {
+      SVN_ERR(cl_layout_list(targets, opt_state->viewspec, baton, ctx, pool));
+      return SVN_NO_ERROR;
+    }
+
   /* Add "." if user passed 0 arguments. */
   svn_opt_push_implicit_dot_target(targets, pool);
 

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/list-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/list-cmd.c?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/list-cmd.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/list-cmd.c Tue Nov 13 07:49:04 2018
@@ -385,14 +385,20 @@ svn_cl__list(apr_getopt_t *os,
               apr_array_header_t *pattern_group
                 = APR_ARRAY_IDX(opt_state->search_patterns, k,
                                 apr_array_header_t *);
+              const char *pattern;
 
               /* Should never fail but ... */
               if (pattern_group->nelts != 1)
                 return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                   _("'search-and' option is not supported"));
 
-              APR_ARRAY_PUSH(patterns, const char *)
-                = APR_ARRAY_IDX(pattern_group, 0, const char *);
+              pattern = APR_ARRAY_IDX(pattern_group, 0, const char *);
+#if defined(WIN32)
+              /* As we currently can't pass glob patterns via the Windows
+                 CLI, fall back to sub-string search. */
+              pattern = apr_psprintf(subpool, "*%s*", pattern);
+#endif
+              APR_ARRAY_PUSH(patterns, const char *) = pattern;
             }
         }
 

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/log-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/log-cmd.c?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/log-cmd.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/log-cmd.c Tue Nov 13 07:49:04 2018
@@ -88,7 +88,7 @@ display_diff(const svn_log_entry_t *log_
   end_revision.value.number = log_entry->revision;
 
   SVN_ERR(svn_stream_puts(outstream, "\n"));
-  SVN_ERR(svn_client_diff_peg6(diff_options,
+  SVN_ERR(svn_client_diff_peg7(diff_options,
                                target_path_or_url,
                                target_peg_revision,
                                &start_revision, &end_revision,
@@ -102,6 +102,7 @@ display_diff(const svn_log_entry_t *log_
                                FALSE /* ignore prop diff */,
                                FALSE /* properties only */,
                                FALSE /* use git diff format */,
+                               TRUE  /* pretty_print_mergeinfo */,
                                svn_cmdline_output_encoding(pool),
                                outstream,
                                errstream,
@@ -333,7 +334,7 @@ svn_cl__log_entry_receiver(void *baton,
       return SVN_NO_ERROR;
     }
 
-  /* ### See http://subversion.tigris.org/issues/show_bug.cgi?id=807
+  /* ### See https://issues.apache.org/jira/browse/SVN-807
      for more on the fallback fuzzy conversions below. */
 
   if (author == NULL)

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/merge-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/merge-cmd.c?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/merge-cmd.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/merge-cmd.c Tue Nov 13 07:49:04 2018
@@ -545,27 +545,31 @@ retry:
                  "fix invalid mergeinfo in target with 'svn propset'"));
     }
 
-  /* Run the interactive resolver if conflicts were raised. */
-  SVN_ERR(svn_cl__conflict_stats_get_paths(&conflicted_paths, conflict_stats,
-                                           pool, pool));
-  if (conflicted_paths)
+  if (! opt_state->dry_run)
     {
-      SVN_ERR(svn_cl__walk_conflicts(conflicted_paths, conflict_stats,
-                                     opt_state, ctx, pool));
-      if (merge_err &&
-          svn_error_root_cause(merge_err)->apr_err == SVN_ERR_WC_FOUND_CONFLICT)
+      /* Run the interactive resolver if conflicts were raised. */
+      SVN_ERR(svn_cl__conflict_stats_get_paths(&conflicted_paths,
+                                               conflict_stats, pool, pool));
+      if (conflicted_paths)
         {
-          svn_error_t *err;
-
-          /* Check if all conflicts were resolved just now. */
-          err = svn_cl__conflict_stats_get_paths(&conflicted_paths,
-                                                 conflict_stats, pool, pool);
-          if (err)
-            merge_err = svn_error_compose_create(merge_err, err);
-          else if (conflicted_paths == NULL)
+          SVN_ERR(svn_cl__walk_conflicts(conflicted_paths, conflict_stats,
+                                         opt_state, ctx, pool));
+          if (merge_err && svn_error_root_cause(merge_err)->apr_err ==
+              SVN_ERR_WC_FOUND_CONFLICT)
             {
-              svn_error_clear(merge_err);
-              goto retry; /* ### conflicts resolved; continue merging */
+              svn_error_t *err;
+
+              /* Check if all conflicts were resolved just now. */
+              err = svn_cl__conflict_stats_get_paths(&conflicted_paths,
+                                                     conflict_stats,
+                                                     pool, pool);
+              if (err)
+                merge_err = svn_error_compose_create(merge_err, err);
+              else if (conflicted_paths == NULL)
+                {
+                  svn_error_clear(merge_err);
+                  goto retry; /* ### conflicts resolved; continue merging */
+                }
             }
         }
     }

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/notify.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/notify.c?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/notify.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/notify.c Tue Nov 13 07:49:04 2018
@@ -210,7 +210,7 @@ svn_cl__conflict_stats_get_paths(apr_arr
         }
     }
 
-  svn_hash_keys(conflicted_paths, all_conflicts, result_pool);
+  SVN_ERR(svn_hash_keys(conflicted_paths, all_conflicts, result_pool));
   svn_sort__array(*conflicted_paths, svn_sort_compare_paths);
 
   return SVN_NO_ERROR;

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/propset-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/propset-cmd.c?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/propset-cmd.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/propset-cmd.c Tue Nov 13 07:49:04 2018
@@ -151,7 +151,7 @@ svn_cl__propset(apr_getopt_t *os,
        * must always be explicitly provided when setting a versioned
        * property.  See
        *
-       *    http://subversion.tigris.org/issues/show_bug.cgi?id=924
+       *    https://issues.apache.org/jira/browse/SVN-924
        *
        * for more details.
        */

Modified: subversion/branches/mod-dav-svn-expressions/subversion/svn/revert-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/mod-dav-svn-expressions/subversion/svn/revert-cmd.c?rev=1846488&r1=1846487&r2=1846488&view=diff
==============================================================================
--- subversion/branches/mod-dav-svn-expressions/subversion/svn/revert-cmd.c (original)
+++ subversion/branches/mod-dav-svn-expressions/subversion/svn/revert-cmd.c Tue Nov 13 07:49:04 2018
@@ -67,10 +67,11 @@ svn_cl__revert(apr_getopt_t *os,
 
   SVN_ERR(svn_cl__check_targets_are_local_paths(targets));
 
-  err = svn_client_revert3(targets, opt_state->depth,
+  err = svn_client_revert4(targets, opt_state->depth,
                            opt_state->changelists,
                            FALSE /* clear_changelists */,
                            FALSE /* metadata_only */,
+                           TRUE /*added_keep_local*/,
                            ctx, scratch_pool);
   if (err
       && (err->apr_err == SVN_ERR_WC_INVALID_OPERATION_DEPTH)