subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1821831 - in /subversion/branches/shelve-checkpoint/subversion: include/svn_client.h libsvn_client/shelve.c svn/cl.h svn/shelve-cmd.c svn/svn.c
Date Mon, 22 Jan 2018 09:52:25 GMT
Author: julianfoad
Date: Mon Jan 22 09:52:24 2018
New Revision: 1821831

URL: http://svn.apache.org/viewvc?rev=1821831&view=rev
Log:
On the 'shelve-checkpoint' branch: Rename some functions so as not to clash
with the shelving v1 functions on trunk.

Modified:
    subversion/branches/shelve-checkpoint/subversion/include/svn_client.h
    subversion/branches/shelve-checkpoint/subversion/libsvn_client/shelve.c
    subversion/branches/shelve-checkpoint/subversion/svn/cl.h
    subversion/branches/shelve-checkpoint/subversion/svn/shelve-cmd.c
    subversion/branches/shelve-checkpoint/subversion/svn/svn.c

Modified: subversion/branches/shelve-checkpoint/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/include/svn_client.h?rev=1821831&r1=1821830&r2=1821831&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/include/svn_client.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/include/svn_client.h Mon Jan 22 09:52:24
2018
@@ -6894,10 +6894,10 @@ svn_client_shelf_export_patch(svn_client
  */
 SVN_EXPERIMENTAL
 svn_error_t *
-svn_client_shelf_get_paths(apr_hash_t **affected_paths,
-                           svn_client_shelf_version_t *shelf_version,
-                           apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool);
+svn_client_shelf_paths_changed(apr_hash_t **affected_paths,
+                               svn_client_shelf_version_t *shelf_version,
+                               apr_pool_t *result_pool,
+                               apr_pool_t *scratch_pool);
 
 /** Set the log message in @a shelf, using the log message callbacks in
  * the client context.
@@ -6944,31 +6944,11 @@ typedef struct svn_client_shelf_info_t
  */
 SVN_EXPERIMENTAL
 svn_error_t *
-svn_client_shelves_list(apr_hash_t **shelved_patch_infos,
-                        const char *local_abspath,
-                        svn_client_ctx_t *ctx,
-                        apr_pool_t *result_pool,
-                        apr_pool_t *scratch_pool);
-
-/** Set @a *any_shelved to indicate if there are any shelved changes in this WC.
- *
- * This shall provide the answer fast, regardless of how many changes
- * are stored, unlike svn_client_shelves_list().
- *
- * ### Initial implementation isn't O(1) fast -- it just calls
- *     svn_client_shelves_list().
- *
- * @a local_abspath is any path in the WC and is used to find the WC root.
- *
- * @since New in 1.X.
- * @warning EXPERIMENTAL.
- */
-SVN_EXPERIMENTAL
-svn_error_t *
-svn_client_shelves_any(svn_boolean_t *any_shelved,
-                       const char *local_abspath,
-                       svn_client_ctx_t *ctx,
-                       apr_pool_t *scratch_pool);
+svn_client_shelf_list(apr_hash_t **shelf_infos,
+                      const char *local_abspath,
+                      svn_client_ctx_t *ctx,
+                      apr_pool_t *result_pool,
+                      apr_pool_t *scratch_pool);
 
 /** @} */
 

Modified: subversion/branches/shelve-checkpoint/subversion/libsvn_client/shelve.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/libsvn_client/shelve.c?rev=1821831&r1=1821830&r2=1821831&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/libsvn_client/shelve.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/libsvn_client/shelve.c Mon Jan 22 09:52:24
2018
@@ -456,10 +456,10 @@ svn_client_shelf_delete(const char *name
 }
 
 svn_error_t *
-svn_client_shelf_get_paths(apr_hash_t **affected_paths,
-                           svn_client_shelf_version_t *shelf_version,
-                           apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool)
+svn_client_shelf_paths_changed(apr_hash_t **affected_paths,
+                               svn_client_shelf_version_t *shelf_version,
+                               apr_pool_t *result_pool,
+                               apr_pool_t *scratch_pool)
 {
   svn_patch_file_t *patch_file;
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
@@ -637,11 +637,11 @@ svn_client_shelf_set_log_message(svn_cli
 }
 
 svn_error_t *
-svn_client_shelves_list(apr_hash_t **shelved_patch_infos,
-                        const char *local_abspath,
-                        svn_client_ctx_t *ctx,
-                        apr_pool_t *result_pool,
-                        apr_pool_t *scratch_pool)
+svn_client_shelf_list(apr_hash_t **shelf_infos,
+                      const char *local_abspath,
+                      svn_client_ctx_t *ctx,
+                      apr_pool_t *result_pool,
+                      apr_pool_t *scratch_pool)
 {
   const char *wc_root_abspath;
   char *shelves_dir;
@@ -655,7 +655,7 @@ svn_client_shelves_list(apr_hash_t **she
   SVN_ERR(svn_io_get_dirents3(&dirents, shelves_dir, FALSE /*only_check_type*/,
                               result_pool, scratch_pool));
 
-  *shelved_patch_infos = apr_hash_make(result_pool);
+  *shelf_infos = apr_hash_make(result_pool);
 
   /* Remove non-shelves */
   for (hi = apr_hash_first(scratch_pool, dirents); hi; hi = apr_hash_next(hi))
@@ -671,27 +671,13 @@ svn_client_shelves_list(apr_hash_t **she
             = apr_palloc(result_pool, sizeof(*info));
 
           info->mtime = dirent->mtime;
-          svn_hash_sets(*shelved_patch_infos, name, info);
+          svn_hash_sets(*shelf_infos, name, info);
         }
     }
 
   return SVN_NO_ERROR;
 }
 
-svn_error_t *
-svn_client_shelves_any(svn_boolean_t *any_shelved,
-                       const char *local_abspath,
-                       svn_client_ctx_t *ctx,
-                       apr_pool_t *scratch_pool)
-{
-  apr_hash_t *shelved_patch_infos;
-
-  SVN_ERR(svn_client_shelves_list(&shelved_patch_infos, local_abspath,
-                                  ctx, scratch_pool, scratch_pool));
-  *any_shelved = apr_hash_count(shelved_patch_infos) != 0;
-  return SVN_NO_ERROR;
-}
-
 svn_error_t *
 svn_client_shelf_version_open(svn_client_shelf_version_t **shelf_version_p,
                               svn_client_shelf_t *shelf,

Modified: subversion/branches/shelve-checkpoint/subversion/svn/cl.h
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/svn/cl.h?rev=1821831&r1=1821830&r2=1821831&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/svn/cl.h (original)
+++ subversion/branches/shelve-checkpoint/subversion/svn/cl.h Mon Jan 22 09:52:24 2018
@@ -310,8 +310,8 @@ svn_opt_subcommand_t
   svn_cl__shelf_list,
   svn_cl__shelf_log,
   svn_cl__shelf_save,
-  svn_cl__shelve,
-  svn_cl__unshelve,
+  svn_cl__shelf_shelve,
+  svn_cl__shelf_unshelve,
   svn_cl__status,
   svn_cl__switch,
   svn_cl__unlock,

Modified: subversion/branches/shelve-checkpoint/subversion/svn/shelve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/svn/shelve-cmd.c?rev=1821831&r1=1821830&r2=1821831&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/svn/shelve-cmd.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/svn/shelve-cmd.c Mon Jan 22 09:52:24
2018
@@ -93,10 +93,10 @@ show_diffstat(svn_client_shelf_version_t
 }
 
 /* A comparison function for svn_sort__hash(), comparing the mtime of two
-   svn_client_shelved_patch_info_t's. */
+   svn_client_shelf_info_t's. */
 static int
-compare_shelved_patch_infos_by_mtime(const svn_sort__item_t *a,
-                                     const svn_sort__item_t *b)
+compare_shelf_infos_by_mtime(const svn_sort__item_t *a,
+                             const svn_sort__item_t *b)
 {
   svn_client_shelf_info_t *a_val = a->value;
   svn_client_shelf_info_t *b_val = b->value;
@@ -113,12 +113,12 @@ list_sorted_by_date(apr_array_header_t *
                     svn_client_ctx_t *ctx,
                     apr_pool_t *scratch_pool)
 {
-  apr_hash_t *shelved_patch_infos;
+  apr_hash_t *shelf_infos;
 
-  SVN_ERR(svn_client_shelves_list(&shelved_patch_infos, local_abspath,
-                                  ctx, scratch_pool, scratch_pool));
-  *list = svn_sort__hash(shelved_patch_infos,
-                         compare_shelved_patch_infos_by_mtime,
+  SVN_ERR(svn_client_shelf_list(&shelf_infos, local_abspath,
+                                ctx, scratch_pool, scratch_pool));
+  *list = svn_sort__hash(shelf_infos,
+                         compare_shelf_infos_by_mtime,
                          scratch_pool);
   return SVN_NO_ERROR;
 }
@@ -155,8 +155,8 @@ stats(svn_client_shelf_t *shelf,
     version_str = apr_psprintf(scratch_pool,
                                _("version %d of %d"),
                                version, shelf->max_version);
-  SVN_ERR(svn_client_shelf_get_paths(&paths,
-                                     shelf_version, scratch_pool, scratch_pool));
+  SVN_ERR(svn_client_shelf_paths_changed(&paths, shelf_version,
+                                         scratch_pool, scratch_pool));
   if (paths)
     paths_str = apr_psprintf(scratch_pool,
                              _(", %d paths changed"), apr_hash_count(paths));
@@ -512,8 +512,8 @@ check_no_modified_paths(const char *path
   sb.modified = FALSE;
   sb.ctx = ctx;
 
-  SVN_ERR(svn_client_shelf_get_paths(&paths, shelf_version,
-                                     scratch_pool, scratch_pool));
+  SVN_ERR(svn_client_shelf_paths_changed(&paths, shelf_version,
+                                         scratch_pool, scratch_pool));
   for (hi = apr_hash_first(scratch_pool, paths); hi; hi = apr_hash_next(hi))
     {
       const char *path = apr_hash_this_key(hi);
@@ -734,9 +734,9 @@ svn_cl__shelf_save(apr_getopt_t *os,
 
 /* This implements the `svn_opt_subcommand_t' interface. */
 svn_error_t *
-svn_cl__shelve(apr_getopt_t *os,
-               void *baton,
-               apr_pool_t *pool)
+svn_cl__shelf_shelve(apr_getopt_t *os,
+                     void *baton,
+                     apr_pool_t *pool)
 {
   svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
   svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
@@ -788,9 +788,9 @@ svn_cl__shelve(apr_getopt_t *os,
 
 /* This implements the `svn_opt_subcommand_t' interface. */
 svn_error_t *
-svn_cl__unshelve(apr_getopt_t *os,
-                 void *baton,
-                 apr_pool_t *scratch_pool)
+svn_cl__shelf_unshelve(apr_getopt_t *os,
+                       void *baton,
+                       apr_pool_t *scratch_pool)
 {
   svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
   svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;

Modified: subversion/branches/shelve-checkpoint/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve-checkpoint/subversion/svn/svn.c?rev=1821831&r1=1821830&r2=1821831&view=diff
==============================================================================
--- subversion/branches/shelve-checkpoint/subversion/svn/svn.c (original)
+++ subversion/branches/shelve-checkpoint/subversion/svn/svn.c Mon Jan 22 09:52:24 2018
@@ -1750,7 +1750,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
     }
   },
 
-  { "shelve", svn_cl__shelve, {0}, N_
+  { "shelve", svn_cl__shelf_shelve, {0}, N_
     ("Move local changes onto a shelf.\n"
      "usage: shelve [--keep-local] NAME [PATH...]\n"
      "\n"
@@ -1779,7 +1779,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
      'm', 'F', opt_force_log, opt_editor_cmd, opt_encoding,
     } },
 
-  { "unshelve", svn_cl__unshelve, {0}, N_
+  { "unshelve", svn_cl__shelf_unshelve, {0}, N_
     ("Copy shelved changes back into the WC.\n"
      "usage: unshelve [NAME [VERSION]]\n"
      "\n"
@@ -3057,7 +3057,7 @@ sub_main(int *exit_code, int argc, const
           || subcommand->cmd_func == svn_cl__lock
           || subcommand->cmd_func == svn_cl__propedit
           || subcommand->cmd_func == svn_cl__shelf_save
-          || subcommand->cmd_func == svn_cl__shelve))
+          || subcommand->cmd_func == svn_cl__shelf_shelve))
     {
       /* If the -F argument is a file that's under revision control,
          that's probably not what the user intended. */



Mime
View raw message