RE: Why do commands fail when a file is unknown to svn?
From: <terry_at_eatoni.com>
Date: 2004-03-05 00:49:51 CET
>>>>> "James" == James Goodall <jgoodall@dmetrix.com> writes:
James> You could do this:
James> svn ci $( find . -name Makefile -exec isversioncontrolled {} \; -print )
I'm not sure how/why this works, because, unfortunately, svn info
Meanwhile, you can get around it with grep -q as below.
$ find . -name Makefile | xargs check-in-if-under-svn
With a check-in-if-under-svn script looking like this
--- Begin file check-in-if-under-svn ---
I still wouldn't recommend this (it's slow because it fires up
So better (but more involved):
$ find . -name Makefile | xargs check-in-if-under-svn.pl
Where check-in-if-under-svn.pl looks like this:
----------------------------------------------
use strict;
my $svn = '/usr/local/bin/svn';
if ($ARGV[0] eq '-n'){
exit(0) unless @ARGV;
open(INFO, sprintf("$svn info %s |", join(' ', map { "'$_'" } @ARGV))) or die;
map { $invalid{$1} = undef if /^([^:]+):\s*\(Not a versioned resource\)$/ } <INFO>;
my @ci = grep { ! exists $invalid{$_} } @ARGV;
exit(0) unless @ci;
system("$echo$svn ci " . join(' ', map { "'$_'" } @ci));
exit $? >> 8;
BTW, you can give this script an initial -n argument if you just want
Note also that the above assumes you don't have files with a single
Finally, make sure you prune your find command if it encounters any
Terry
---------------------------------------------------------------------
|
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.