[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn propset from stdin

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2002-10-21 22:47:00 CEST

Brandon Ehle <azverkan@yahoo.com> writes:
> Any idea how difficult it would be for me to modify "svn propset" to
> take properties from stdin? The reason I want to do this is to allow
> a script to append "svn:ignore"s via something like
> > svn pg svn:ignore | someapp | svn ps svn:ignore

I think a `--stdin' flag would make sense. It would apply to every
command that -F also applies to, and it shouldn't be too hard to code
(i.e., look at the code for -F, do something similar).

It should just be a matter of writing

   svn_error_t *svn_string_from_stream (svn_stringbuf_t **result,
                                        svn_stream_t *stream,
                                        apr_pool_t *pool);

and then adding a clause in the option parsing to handle it. The code
for -F looks like this, to give you an idea of how simple it is:

      case 'F':
        err = svn_utf_cstring_to_utf8 (&utf8_opt_arg, opt_arg, NULL, pool);
        if (!err)
          err = svn_string_from_file (&(opt_state.filedata),
                                      utf8_opt_arg, pool);
        if (err)
          {
            svn_handle_error (err, stderr, FALSE);
            svn_pool_destroy (pool);
            return EXIT_FAILURE;
          }

Thoughts? (Not saying this should be a high priority, or even 1.0,
just that we should file an issue and/or accept patches for it.)

> Or it there a better way to do this?

You could use -F (--file) right now:

   svn pg svn:ignore | someapp > foo; svn ps -F foo svn:ignore

or something like that.

> Is this something that could be done with the python swig bindings as well?

I would think so.

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Oct 21 23:16:43 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.