Author: julianfoad
Date: Tue Aug 22 13:44:35 2017
New Revision: 1805761
URL: http://svn.apache.org/viewvc?rev=1805761&view=rev
Log:
On the 'shelve' branch: let the '--list' option be accepted by 'unshelve' as
well as 'shelve', since that's when listing shelves is perhaps more useful.
* subversion/svn/shelve-cmd.c
(svn_cl__unshelve): When the '--list' option is given, list shelves.
* subversion/svn/svn.c
(svn_cl__cmd_table): Add the '--list' option to 'unshelve'.
Modified:
subversion/branches/shelve/subversion/svn/shelve-cmd.c
subversion/branches/shelve/subversion/svn/svn.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=1805761&r1=1805760&r2=1805761&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svn/shelve-cmd.c (original)
+++ subversion/branches/shelve/subversion/svn/shelve-cmd.c Tue Aug 22 13:44:35
2017
@@ -169,13 +169,25 @@ svn_cl__unshelve(apr_getopt_t *os,
{
svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
+ const char *local_abspath;
const char *shelf_name;
apr_array_header_t *targets;
- const char *local_abspath;
- SVN_ERR(get_shelf_name(&shelf_name, os, pool, pool));
SVN_ERR(svn_dirent_get_absolute(&local_abspath, "", pool));
+ if (opt_state->list)
+ {
+ if (os->ind < os->argc)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, 0, NULL);
+
+ SVN_ERR(shelves_list(local_abspath,
+ ! opt_state->quiet /*diffstat*/,
+ ctx, pool));
+ return SVN_NO_ERROR;
+ }
+
+ SVN_ERR(get_shelf_name(&shelf_name, os, pool, pool));
+
/* There should be no remaining arguments. */
SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
opt_state->targets,
Modified: subversion/branches/shelve/subversion/svn/svn.c
URL:
http://svn.apache.org/viewvc/subversion/branches/shelve/subversion/svn/svn.c?rev=1805761&r1=1805760&r2=1805761&view=diff
==============================================================================
--- subversion/branches/shelve/subversion/svn/svn.c (original)
+++ subversion/branches/shelve/subversion/svn/svn.c Tue Aug 22 13:44:35 2017
@@ -1652,11 +1652,13 @@ const svn_opt_subcommand_desc2_t svn_cl_
{ "unshelve", svn_cl__unshelve, {0}, N_
("Unshelve changes.\n"
- "usage: unshelve [--keep-shelved] NAME\n"
+ "usage: 1. unshelve [--keep-shelved] NAME\n"
+ " 2. unshelve --list\n"
"\n"
- " Apply the shelved patch NAME to the working copy.\n"
- " Delete the patch unless the '--keep-shelved' option is given.\n"),
- {opt_keep_shelved, 'q', opt_dry_run} },
+ " 1. Apply the shelved patch NAME to the working copy.\n"
+ " Delete the patch unless the '--keep-shelved' option is given.\n"
+ " 2. List shelved patches.\n"),
+ {opt_keep_shelved, opt_list, 'q', opt_dry_run} },
{ "shelves", svn_cl__shelves, {0}, N_
("List shelved patches.\n"