diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
commit | cf46733632c7279a9fd0fe6ce26f9185a4ae82a9 (patch) | |
tree | da27775a2161723ef342e91af41a8b51fedef405 /subversion/svn/list-cmd.c | |
parent | bb0ef45f7c46b0ae221b26265ef98a768c33f820 (diff) | |
download | subversion-tarball-master.tar.gz |
subversion-1.9.7HEADsubversion-1.9.7master
Diffstat (limited to 'subversion/svn/list-cmd.c')
-rw-r--r-- | subversion/svn/list-cmd.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/subversion/svn/list-cmd.c b/subversion/svn/list-cmd.c index efe4279..5ea140f 100644 --- a/subversion/svn/list-cmd.c +++ b/subversion/svn/list-cmd.c @@ -49,6 +49,12 @@ struct print_baton { svn_boolean_t in_external; }; +/* Field flags required for this function */ +static const apr_uint32_t print_dirent_fields = SVN_DIRENT_KIND; +static const apr_uint32_t print_dirent_fields_verbose = ( + SVN_DIRENT_KIND | SVN_DIRENT_SIZE | SVN_DIRENT_TIME | + SVN_DIRENT_CREATED_REV | SVN_DIRENT_LAST_AUTHOR); + /* This implements the svn_client_list_func2_t API, printing a single directory entry in text format. */ static svn_error_t * @@ -161,7 +167,10 @@ print_dirent(void *baton, } } - +/* Field flags required for this function */ +static const apr_uint32_t print_dirent_xml_fields = ( + SVN_DIRENT_KIND | SVN_DIRENT_SIZE | SVN_DIRENT_TIME | + SVN_DIRENT_CREATED_REV | SVN_DIRENT_LAST_AUTHOR); /* This implements the svn_client_list_func2_t API, printing a single dirent in XML format. */ static svn_error_t * @@ -213,7 +222,7 @@ print_dirent_xml(void *baton, svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal, "external", "parent_url", external_parent_url, "target", external_target, - NULL); + SVN_VA_NULL); pb->last_external_parent_url = external_parent_url; pb->last_external_target = external_target; @@ -223,7 +232,7 @@ print_dirent_xml(void *baton, svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal, "entry", "kind", svn_cl__node_kind_str_xml(dirent->kind), - NULL); + SVN_VA_NULL); svn_cl__xml_tagged_cdata(&sb, scratch_pool, "name", entryname); @@ -237,7 +246,7 @@ print_dirent_xml(void *baton, svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal, "commit", "revision", apr_psprintf(scratch_pool, "%ld", dirent->created_rev), - NULL); + SVN_VA_NULL); svn_cl__xml_tagged_cdata(&sb, scratch_pool, "author", dirent->last_author); if (dirent->time) svn_cl__xml_tagged_cdata(&sb, scratch_pool, "date", @@ -246,7 +255,8 @@ print_dirent_xml(void *baton, if (lock) { - svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal, "lock", NULL); + svn_xml_make_open_tag(&sb, scratch_pool, svn_xml_normal, "lock", + SVN_VA_NULL); svn_cl__xml_tagged_cdata(&sb, scratch_pool, "token", lock->token); svn_cl__xml_tagged_cdata(&sb, scratch_pool, "owner", lock->owner); svn_cl__xml_tagged_cdata(&sb, scratch_pool, "comment", lock->comment); @@ -313,10 +323,12 @@ svn_cl__list(apr_getopt_t *os, "mode")); } - if (opt_state->verbose || opt_state->xml) - dirent_fields = SVN_DIRENT_ALL; + if (opt_state->xml) + dirent_fields = print_dirent_xml_fields; + else if (opt_state->verbose) + dirent_fields = print_dirent_fields_verbose; else - dirent_fields = SVN_DIRENT_KIND; /* the only thing we actually need... */ + dirent_fields = print_dirent_fields; pb.ctx = ctx; pb.verbose = opt_state->verbose; @@ -359,7 +371,7 @@ svn_cl__list(apr_getopt_t *os, svn_stringbuf_t *sb = svn_stringbuf_create_empty(pool); svn_xml_make_open_tag(&sb, pool, svn_xml_normal, "list", "path", truepath[0] == '\0' ? "." : truepath, - NULL); + SVN_VA_NULL); SVN_ERR(svn_cl__error_checked_fputs(sb->data, stdout)); } @@ -419,6 +431,8 @@ svn_cl__list(apr_getopt_t *os, if (seen_nonexistent_target) err = svn_error_create(SVN_ERR_ILLEGAL_TARGET, NULL, _("Could not list all targets because some targets don't exist")); + else + err = NULL; return svn_error_compose_create(externals_err, err); } |