88
89
const char *name_local;
89
90
svn_prop_inherited_item_t *iprop =
90
91
APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
91
svn_string_t *propval = svn__apr_hash_index_val(
92
svn_string_t *propval = apr_hash_this_val(
92
93
apr_hash_first(pool, iprop->prop_hash));
100
101
name_local = svn_dirent_local_style(iprop->path_or_url, iterpool);
102
103
svn_xml_make_open_tag(&sb, iterpool, svn_xml_normal, "target",
103
"path", name_local, NULL);
104
"path", name_local, SVN_VA_NULL);
105
106
svn_cmdline__print_xml_prop(&sb, pname, propval, TRUE, iterpool);
106
107
svn_xml_make_close_tag(&sb, iterpool, "target");
123
124
svn_pool_clear(iterpool);
125
126
svn_xml_make_open_tag(&sb, iterpool, svn_xml_normal, "target",
126
"path", filename, NULL);
127
"path", filename, SVN_VA_NULL);
127
128
svn_cmdline__print_xml_prop(&sb, pname, propval, FALSE, iterpool);
128
129
svn_xml_make_close_tag(&sb, iterpool, "target");
278
279
svn_prop_inherited_item_t *iprop =
279
280
APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
280
svn_string_t *propval = svn__apr_hash_index_val(apr_hash_first(pool,
281
svn_string_t *propval = apr_hash_this_val(apr_hash_first(pool,
281
282
iprop->prop_hash));
282
283
SVN_ERR(print_single_prop(propval, target_abspath_or_url,
283
284
iprop->path_or_url,
319
320
const char *pname, *pname_utf8;
320
321
apr_array_header_t *args, *targets;
321
322
svn_stream_t *out;
323
svn_boolean_t warned = FALSE;
323
if (opt_state->verbose && (opt_state->revprop || opt_state->strict
325
if (opt_state->verbose && (opt_state->revprop || opt_state->no_newline
324
326
|| opt_state->xml))
325
327
return svn_error_create(SVN_ERR_CL_MUTUALLY_EXCLUSIVE_ARGS, NULL,
326
328
_("--verbose cannot be used with --revprop or "
327
"--strict or --xml"));
329
"--no-newline or --xml"));
329
331
/* PNAME is first argument (and PNAME_UTF8 will be a UTF-8 version
365
367
URL, &(opt_state->start_revision),
366
368
&rev, ctx, pool));
372
return svn_error_createf(SVN_ERR_PROPERTY_NOT_FOUND, NULL,
373
_("Property '%s' not found on "
376
svn_opt__revision_to_string(
377
&opt_state->start_revision,
370
382
if (opt_state->xml)
377
389
svn_xml_make_open_tag(&sb, pool, svn_xml_normal,
379
"rev", revstr, NULL);
391
"rev", revstr, SVN_VA_NULL);
381
393
svn_cmdline__print_xml_prop(&sb, pname_utf8, propval, FALSE,
400
412
SVN_ERR(stream_write(out, printable_val->data,
401
413
printable_val->len));
402
if (! opt_state->strict)
414
if (! opt_state->no_newline)
403
415
SVN_ERR(stream_write(out, APR_EOL_STR, strlen(APR_EOL_STR)));
415
427
if (opt_state->depth == svn_depth_unknown)
416
428
opt_state->depth = svn_depth_empty;
418
/* Strict mode only makes sense for a single target. So make
430
/* No-newline mode only makes sense for a single target. So make
419
431
sure we have only a single target, and that we're not being
420
432
asked to recurse on that target. */
421
if (opt_state->strict
422
&& ((targets->nelts > 1) || (opt_state->depth != svn_depth_empty)))
433
if (opt_state->no_newline
434
&& ((targets->nelts > 1) || (opt_state->depth != svn_depth_empty)
435
|| (opt_state->show_inherited_props)))
423
436
return svn_error_create
424
437
(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
425
_("Strict output of property values only available for single-"
426
"target, non-recursive propget operations"));
438
_("--no-newline is only available for single-target,"
439
" non-recursive propget operations"));
428
441
for (i = 0; i < targets->nelts; i++)
459
472
/* Any time there is more than one thing to print, or where
460
473
the path associated with a printed thing is not obvious,
461
474
we'll print filenames. That is, unless we've been told
462
not to do so with the --strict option. */
475
not to do so with the --no-newline option. */
463
476
print_filenames = ((opt_state->depth > svn_depth_empty
464
477
|| targets->nelts > 1
465
478
|| apr_hash_count(props) > 1
466
479
|| opt_state->verbose
467
480
|| opt_state->show_inherited_props)
468
&& (! opt_state->strict));
469
omit_newline = opt_state->strict;
470
like_proplist = opt_state->verbose && !opt_state->strict;
481
&& (! opt_state->no_newline));
482
omit_newline = opt_state->no_newline;
483
like_proplist = opt_state->verbose && !opt_state->no_newline;
485
/* If there are no properties, and exactly one node was queried,
487
if (opt_state->depth == svn_depth_empty
488
&& !opt_state->show_inherited_props
489
&& apr_hash_count(props) == 0)
492
err = svn_error_createf(SVN_ERR_PROPERTY_NOT_FOUND, NULL,
493
_("Property '%s' not found on '%s'"),
495
svn_handle_warning2(stderr, err, "svn: ");
496
svn_error_clear(err);
472
500
if (opt_state->xml)
473
501
SVN_ERR(print_properties_xml(