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

Re: overwrite/convert a working directory

From: Avram Dorfman <dorfman_at_est.org>
Date: 2006-03-02 22:28:39 CET

Actually, I see that I left something important out of my
explanation. Since the directory in question is deeply nested, a
"simple copy" is not enough, b/c that won't copy directories. In
Unix, "cp -R" will do it recursively, so that "should" be fine.

The problem is that cp -R chokes on symbolic links, and there are
some in the dir structure in question. cp -R has a few options for
handling symbolic links, but they involve whether to follow them or
not. None of them enable it to simply overwrite a symbolic link with
another symbolic link. Here is the error I get:

corp-shell1% cp -R bar/* foo
cp: symlink: far: File exists
cp: cannot overwrite directory foo/far with non-directory bar/far
corp-shell1%

the troulbe is, foo/far is not a directory, it is a symbolic link,
as is bar/far. In fact, foo/far got there by a previous run of the
exact same cp -R invocation - it hasn't even changed since then.

The other factor that caused me to raise this question is a byproduct
of the fact that I'm using Mac OS X; When you copy a folder in the
Finder, it deletes destination folders of the same name, so then you
lose your .svn's again.

In thinking this through further, I acknowledge that this isn't an
SVN issue, it is two different issues with two different copy
utilities, and the simple answer is "get the files in there somehow
without disrupting the .svn directories, and then svn doesn't have
anything to do with it."

So, sorry for airing my dirty laundry publicly, and failing to think
this all the way through before posting. I think maybe I needed to
hear somebody else say "this is a copy issue not an svn issue".

Thanks ;-)

On Mar 2, 2006, at 3:40 PM, Phillip Susi wrote:

> Avram Dorfman wrote:
>> Hello,
>> I have this situation I keep running into that SVN doesn't seem to
>> be able to handle. I'd like to know what other people do when this
>> comes up.
>> Simply put, I need to be able to replace a working sub-directory
>> with another version of itself. The other version comes from a
>> build process elsewhere. If it were just a file, I would simply
>> overwrite the old file with the new one. But I can't do that with
>> a directory b/c the directory loses it's .svn structures, and svn
>> will no longer operate on it - it's not a working directory any more.
>> The directory itself is deeply nested; I can't simply overwrite
>> each individual file. The "hack" solution I'm currently using is
>> to tar up the new source, and expand the tar on top of the new one.
>
> You should have no trouble using a simple copy command to copy the
> files from the non wc directory tree to the wc directory tree. It
> needn't involve subversion at all.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Mar 2 22:30:51 2006

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.