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

Re: "The system cannot find the file specified" during update

From: Ruslan Sivak <russ_at_vshift.com>
Date: Thu, 23 Oct 2008 00:01:31 -0400

Ryan Schmidt wrote:
> On Oct 22, 2008, at 03:19, Ruslan Sivak wrote:
>> Ryan Schmidt wrote:
>>>> Looks like after I installed UnixUtils and changed the code slightly
>>>> svn st --depth=infinity | sed -n "s/^\! //p" | xargs svn rm
>>>> it seems to work. What if the file name has a spaces in it? Does
>>>> anyone have a regex for that?
>>> The regular expression is accurate for any filename; the problem is
>>> the xargs command which splits input on whitespace, whether that be
>>> a newline or a space. Maybe there is an argument to xargs to tell it
>>> to split only on newlines. Or you could replace xargs with a short
>>> script written in perl or another language of your choice. For example:
>>> svn st --depth=infinity \
>>> | sed -n "s/^\! //p" \
>>> | perl -e 'while (<>) {chomp;unlink;}'
>> This doesn't seem to do what the other script does. Unless I'm
>> mistaken this will delete the file (which is already deleted to start
>> with).
> Sorry, of course, you're right. I wasn't paying attention. Change
> "unlink" to something that will cause perl to call "svn rm" with the
> argument $_ instead.
>> Either way, I don't currently have perl installed, and would rather
>> not install it unless I had to.
> I'm sure it can be written in most any scripting language, or even a
> compiled program. Whatever you have at your disposal.
>> There does seem to be a switch to xargs to tell it that you're
>> separating filenames using the null character -0. Is there a way to
>> do the regular expression to make it insert a null character there?
> I don't know a way to tell sed to use a null byte between output lines
> instead of a newline.
> However, the tr utility can translate newlines to null bytes.
> svn st --depth=infinity \
> | sed -n "s/^\! //p" \
> | tr "\n" "\0" \
> | xargs -0 -n 1 svn rm
Thank you, that got me closer, but i'm still having issues. Here is a
modified command line that has the nasty side effect of svn rming "." -
the current directory.

svn st --depth=infinity | sed -n "s/^\! //p" |tr "\n\r" "\0" |
xargs -0 -n 1 --verbose

>svn st --depth=infinity | sed -n "s/^\! //p" | tr "\n\r" "\0"
| xargs -0 -n 1 --verbose -ixxx --no-run-if-empty svn rm \"xxx\"
svn rm "New Text Document.txt"
D New Text Document.txt
svn rm ""
D .
svn: Unable to lock 'BE'
svn rm "New Text Document (2).txt"
D New Text Document (2).txt
svn rm ""
D .
svn: Unable to lock 'BE'

I'm not sure where the empty lines are coming from. Maybe some
non-printable character? And svn just reinterprets it to mean "."?

P.S. BE is a folder under the images folder, which is under the current

To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-10-23 06:02:02 CEST

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

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