Author: julianfoad
Date: Tue Jan 23 14:19:48 2018
New Revision: 1822008
URL: http://svn.apache.org/viewvc?rev=1822008&view=rev
Log:
Shelving: Make 'shelf-list' and 'shelf-log' quieter with '-q' and noisier
with '-v'.
Do not print version, age and paths changed with 'shelf-list --quiet'.
Print diffstat only when '--verbose' is given.
Now 'shelf-list -q' prints only the shelf names.
* subversion/svn/shelf-cmd.c
(shelves_list): In quiet mode, print only the shelf names.
(svn_cl__shelf_list,
svn_cl__shelf_log): Pass the appropriate parameters.
* subversion/svn/svn.c
(svn_cl__cmd_table): Let 'shelf-list' and 'shelf-log' accept '-v'.
Modified:
subversion/trunk/subversion/svn/shelf-cmd.c
subversion/trunk/subversion/svn/svn.c
Modified: subversion/trunk/subversion/svn/shelf-cmd.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/shelf-cmd.c?rev=1822008&r1=1822007&r2=1822008&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/shelf-cmd.c (original)
+++ subversion/trunk/subversion/svn/shelf-cmd.c Tue Jan 23 14:19:48 2018
@@ -187,7 +187,7 @@ stats(svn_client_shelf_t *shelf,
/* Display a list of shelves */
static svn_error_t *
shelves_list(const char *local_abspath,
- svn_boolean_t with_logmsg,
+ svn_boolean_t quiet,
svn_boolean_t with_diffstat,
svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool)
@@ -206,13 +206,16 @@ shelves_list(const char *local_abspath,
svn_client_shelf_t *shelf;
svn_client_shelf_version_t *shelf_version;
- SVN_ERR(svn_client_shelf_open_existing(&shelf, name, local_abspath,
- ctx, scratch_pool));
+ SVN_ERR(svn_client_shelf_open_existing(&shelf, name, local_abspath,
+ ctx, scratch_pool));
SVN_ERR(svn_client_shelf_version_open(&shelf_version,
shelf, shelf->max_version,
scratch_pool, scratch_pool));
- SVN_ERR(stats(shelf, shelf->max_version, time_now,
- with_logmsg, scratch_pool));
+ if (quiet)
+ SVN_ERR(svn_cmdline_printf(scratch_pool, "%s\n", shelf->name));
+ else
+ SVN_ERR(stats(shelf, shelf->max_version, time_now,
+ TRUE /*with_logmsg*/, scratch_pool));
if (with_diffstat)
{
SVN_ERR(show_diffstat(shelf_version, scratch_pool));
@@ -840,8 +843,8 @@ svn_cl__shelf_list(apr_getopt_t *os,
SVN_ERR(svn_dirent_get_absolute(&local_abspath, "", pool));
SVN_ERR(shelves_list(local_abspath,
- ! opt_state->quiet /*with_logmsg*/,
- ! opt_state->quiet /*with_diffstat*/,
+ opt_state->quiet,
+ opt_state->verbose /*with_diffstat*/,
ctx, pool));
return SVN_NO_ERROR;
@@ -920,7 +923,7 @@ svn_cl__shelf_log(apr_getopt_t *os,
SVN_ERR(svn_dirent_get_absolute(&local_abspath, "", pool));
SVN_ERR(shelf_log(name, local_abspath,
- !opt_state->quiet /*with_diffstat*/,
+ opt_state->verbose /*with_diffstat*/,
ctx, pool));
return SVN_NO_ERROR;
Modified: subversion/trunk/subversion/svn/svn.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/svn.c?rev=1822008&r1=1822007&r2=1822008&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/svn.c (original)
+++ subversion/trunk/subversion/svn/svn.c Tue Jan 23 14:19:48 2018
@@ -1730,7 +1730,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" The shelving feature is EXPERIMENTAL. This command is likely to
change\n"
" in the next release, and there is no promise of backward
compatibility.\n"
),
- {'q'}
+ {'q', 'v'}
},
{ "shelf-log", svn_cl__shelf_log, {0}, N_
@@ -1742,7 +1742,7 @@ const svn_opt_subcommand_desc2_t svn_cl_
" The shelving feature is EXPERIMENTAL. This command is likely to
change\n"
" in the next release, and there is no promise of backward
compatibility.\n"
),
- {'q'}
+ {'q', 'v'}
},
{ "shelf-save", svn_cl__shelf_save, {0}, N_