Colin D Bennett <cbennett@radsoft.com> writes:
> On Tuesday 05 November 2002 06:29, Ben Collins-Sussman wrote:
> > ...
> > Run 'svn status' in a working copy. Any unversioned items show up
> > with a '?'. You can write a little shell script to grep those
> > filenames out of the list and pipe them into 'xargs svn add'.
> >
> > People have posted such examples around here somewhere...
>
> Here's a very simple script I hacked together one day so I could unpack a
> source tarball into a working copy, run the script, and then svn commit, and
> the repo should then be synced with my tarball.
>
>
> #!/usr/bin/perl -w
> # Syncronize an svn workspace by scheduling any files added or removed
> # from the working copy to be added/removed from svn.
> #
> use strict;
>
> my @added = ();
> my @removed = ();
>
> while (<>) {
> /^(.)(.) {5}(.*)$/ or do { print "line didn't match: $_"; next; };
> my $status = $1;
> my $propstatus = $2;
> my $file = $3;
> $status eq "!" && push(@removed, $file);
> $status eq "?" && push(@added, $file);
> }
>
> @removed > 0 and print "svn rm " . join(' ', @removed) . "\n\n";
> @added > 0 and print "svn add " . join(' ', @added) . "\n\n";
Might be nice to include something like this in the tools section of
the repo as a starting place for people needing this sort of
functionality. Of course, then the documentaiton would need to
mention it so seekers would know that it even existed. Of course,
then users would have to actually read the documentation..
--
Daniel Rall <dlr@finemaltcoding.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 5 22:11:16 2002