You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2017/10/27 13:10:01 UTC
svn commit: r1813532 -
/subversion/branches/shelve/subversion/svn/shelve-cmd.c
Author: julianfoad
Date: Fri Oct 27 13:10:01 2017
New Revision: 1813532
URL: http://svn.apache.org/viewvc?rev=1813532&view=rev
Log:
On the 'shelve' branch: Simplify code.
* subversion/libssvn_client/shelve.c
(name_of_youngest): Use an existing helper. Remove an obsolete
deletion of '.patch' suffix which is no longer present.
Modified:
subversion/branches/shelve/subversion/svn/shelve-cmd.c
Modified: subversion/branches/shelve/subversion/svn/shelve-cmd.c
URL: http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/svn/shelve-cmd.c?rev=1813532&r1=1813531&r2=1813532&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svn/shelve-cmd.c (original)
+++ subversion/branches/shelve/subversion/svn/shelve-cmd.c Fri Oct 27 13:10:01 2017
@@ -123,20 +123,17 @@ name_of_youngest(const char **name_p,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- apr_hash_t *dirents;
apr_array_header_t *list;
const svn_sort__item_t *youngest_item;
- SVN_ERR(svn_client_shelves_list(&dirents, local_abspath,
- ctx, scratch_pool, scratch_pool));
- if (apr_hash_count(dirents) == 0)
+ SVN_ERR(list_sorted_by_date(&list,
+ local_abspath, ctx, scratch_pool));
+ if (list->nelts == 0)
return svn_error_create(SVN_ERR_CL_INSUFFICIENT_ARGS, NULL,
_("No shelved changes found"));
- list = svn_sort__hash(dirents, compare_dirents_by_mtime, scratch_pool);
youngest_item = &APR_ARRAY_IDX(list, list->nelts - 1, svn_sort__item_t);
- *name_p = apr_pstrndup(result_pool, youngest_item->key,
- strlen(youngest_item->key) - 6 /* remove '.patch' */);
+ *name_p = youngest_item->key;
return SVN_NO_ERROR;
}