You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Avram Dorfman <do...@est.org> on 2006/03/02 20:15:47 UTC

overwrite/convert a working directory

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.

However, it seems perfectly valid to me that I should be able to take  
a non-working subdirectory that is in a working directory, and tell  
SVN to just go ahead and work on it as if it were an up-to-date  
working directory. Either that or there should be an operation that  
says "take this and make it a working directory, but don't mess with  
any of the actual contents".

It also seems to me that I would be in the same situation if I wanted  
to restore to an older version of a subdirectory, and make it the  
latest version. I can't just update to the older version b/c I won't  
be able to commit that update, right? How do I get the older version  
of a directory to *replace* the newer version of the same directory?

Thanks,
Avram

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: overwrite/convert a working directory

Posted by Avram Dorfman <do...@est.org>.
it's the same issue if you copy the contents of the folder into the  
destination folder - any sub-folders will overwrite the corresponding  
destination folder.

On Mar 3, 2006, at 3:44 PM, Phillip Susi wrote:

> Well yes, if you tell it to replace the entire folder, then I  
> suppose you get what you ask for, though that's rather unexpected  
> and counter intuitive.  Does it offer another option?  On most  
> other guis if you do this you get a copy/merge, and are usually  
> prompted for each conflicting file to replace or keep.  What if  
> rather than move the folder you explicitly copy and paste?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: overwrite/convert a working directory

Posted by Phillip Susi <ps...@cfl.rr.com>.
Well yes, if you tell it to replace the entire folder, then I suppose 
you get what you ask for, though that's rather unexpected and counter 
intuitive.  Does it offer another option?  On most other guis if you do 
this you get a copy/merge, and are usually prompted for each conflicting 
file to replace or keep.  What if rather than move the folder you 
explicitly copy and paste?

Ryan Schmidt wrote:
> Well, if you have a folder foo, and you take a second folder foo and try 
> to put it into the same directory as the first folder foo, the Finder 
> will ask if you want to replace the first folder foo, and if you say 
> yes, then it will dutifully comply and replace the first foo with the 
> second foo. That is, it will delete the first foo and whatever was in 
> it, and then the second foo will be there. So if the first foo contained 
> .svn directories and the second foo doesn't, then you can expect that 
> there won't be any .svn directories there when you finish. Perfectly 
> normal, perfectly expected, perfectly non-broken.
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: overwrite/convert a working directory

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 3, 2006, at 19:39, Phillip Susi wrote:

>> 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.
>
> Sounds like the Finder is broken then.  Try reporting that bug to  
> Apple.  When you copy a folder to another existing one, it should  
> add/replace, not delete anything from the destination folder.

Well, if you have a folder foo, and you take a second folder foo and  
try to put it into the same directory as the first folder foo, the  
Finder will ask if you want to replace the first folder foo, and if  
you say yes, then it will dutifully comply and replace the first foo  
with the second foo. That is, it will delete the first foo and  
whatever was in it, and then the second foo will be there. So if the  
first foo contained .svn directories and the second foo doesn't, then  
you can expect that there won't be any .svn directories there when  
you finish. Perfectly normal, perfectly expected, perfectly non-broken.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: overwrite/convert a working directory

Posted by Phillip Susi <ps...@cfl.rr.com>.
Avram Dorfman wrote:
> 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.
> 

I think you want cp -a.

> 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.
> 

Sounds like the Finder is broken then.  Try reporting that bug to Apple. 
  When you copy a folder to another existing one, it should add/replace, 
not delete anything from the destination folder.

> 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".
> 

This is a copy issue not an svn issue ;)



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: overwrite/convert a working directory

Posted by Avram Dorfman <do...@est.org>.
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

Re: overwrite/convert a working directory

Posted by Phillip Susi <ps...@cfl.rr.com>.
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