You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by James <ex...@gmail.com> on 2008/01/03 18:36:45 UTC

Obtaining new .svn directories

I thought this might have been an obvious necessity (yet google has gotten
me no where) but is there any way to get a .svn directory if its accidently
been modified or removed? For example say I had a large project with upwards
of 1000 files and I accidently deleted the root .svn directory. Do I really
need to re-checkout the entire project (with all its files) just to fix the
missing .svn directory?

I've tried doing a svn checkout in the non-versioned directory hoping svn
would be able to re-create the missing .svn directories but instead it just
gives me an error stating "svn: Failed to add directory 'XXX': object of the
same name already exists". If only I could tell it to ignore those
directories/files... am I doing something wrong here?

Re: Obtaining new .svn directories

Posted by Donald H Locker <do...@ptmelec.com>.
James wrote:
 >  Andrew Reedick wrote, without attribution:
>  > In theory, not that I've tried it recently, and with no guarantee of
>  > success, reliability, or data integrity, you could:
>  >        rename the dir to dir.oops
>  >        svn co -N svn://server/repos/blah/blah/dir
>  >        move dir.oops/* dir/.
>  >        run 'svn status' to see if it really worked.  Maybe followed by
>  > an 'svn update'
> 
> I tried this and it didn't seem to work (the .svn directory was missing 
> entries for my files so it still complained about obstructing paths).

This statement confuses me.  Checkout to a new working copy; there will be 
no existing files to obstruct the checkout.  Now copy the files and 
directories (but NOT the oops .svn directories) from dir.oops and you should 
have everything good to go.

This is essentially what I've done in the past and never had any trouble. 
The way I avoid the .svn directories is
$ cp -r dir.oops dir.oops.safe; find dir.oops -type d -name .svn -print | 
xargs rm -rf; cp -r dir.oops dir

In Windows, copy and paste dir.oops to a safe place of your choice.  Run the 
search on dir.oops, looking for .svn of type Folder  When the search is 
complete, select all the found .svn and delete them.  Now enter dir.oops, 
Ctl-A to select all, Ctl-C to copy, navigate to dir and Ctl-V to paste 
everything in again.  (Yes to all will come in handy at this time.)

HTH,
Donald.

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

RE: Re: Obtaining new .svn directories

Posted by "Reedick, Andrew" <jr...@ATT.COM>.
Bleh, you need to run another round of 'svn update -N' on the dir\*.

 

rename the dir to dir.oops

svn co -N svn://server/repos/blah/blah/dir

 

## Run update -N for each file/dir in the broken dir

cd dir

svn ls

... listing of files and dirs...

svn update -N dir1 dir2 dir3 file1 file2 ...dirN fileN

 

## Now move the old workspace into the fixed directory

cd ..

move (or copy) dir.oops/* dir

 

Note:  move dir.oops/* will not pick up the .svn file on most systems.
So make sure your equivalent move/copy command doesn't pick up the
defective/missing .svn dir.

 

 

 

 

From: James [mailto:excess@gmail.com] 
Sent: Sunday, January 06, 2008 1:29 PM
To: Reedick, Andrew
Cc: users@subversion.tigris.org
Subject: Re: Re: Obtaining new .svn directories

 

> In theory, not that I've tried it recently, and with no guarantee of
> success, reliability, or data integrity, you could:
>        rename the dir to dir.oops
>        svn co -N svn://server/repos/blah/blah/dir 
>        move dir.oops/* dir/.
>        run 'svn status' to see if it really worked.  Maybe followed by
> an 'svn update'

I tried this and it didn't seem to work (the .svn directory was missing
entries for my files so it still complained about obstructing paths). 

> Just curious - in this situation if I were to try 1.5, what would be
> the command
> that would restore the .svn dir.  Is it 'svn co' or 'svn update'?

I've looked at the revision log for checkout-cmd.c and I found this:
---
Support --force option with svn checkout, update, and switch.

With the force option, co, sw, and up now tolerate unversioned
obstructing paths when adding new paths of the same type, rather than 
generating a SVN_ERR_WC_OBSTRUCTED_UPDATE error.

If the obstructing path is the same type (file or directory) as the
corresponding path in the repository it will be left 'as-is' in the
working copy.  For directories this simply means the obstruction is 
tolerated.  For files, any content differences between the obstruction
and the repository are treated like a local modification to the
working copy.

This patch is an expansion of one originally posted by Jonathan Gilbert 
<o2...@sneakemail.com> against the 1.2.0 tag.  See the various
"Takeover" threads on the dev mailing list.
---

This sounds like exactly what I needed but I'm not sure when 1.5 will be
available. Is there a patch available by chance? 


*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA622



Re: Re: Obtaining new .svn directories

Posted by James <ex...@gmail.com>.
> In theory, not that I've tried it recently, and with no guarantee of
> success, reliability, or data integrity, you could:
>        rename the dir to dir.oops
>        svn co -N svn://server/repos/blah/blah/dir
>        move dir.oops/* dir/.
>        run 'svn status' to see if it really worked.  Maybe followed by
> an 'svn update'

I tried this and it didn't seem to work (the .svn directory was missing
entries for my files so it still complained about obstructing paths).

> Just curious - in this situation if I were to try 1.5, what would be
> the command
> that would restore the .svn dir.  Is it 'svn co' or 'svn update'?

I've looked at the revision log for checkout-cmd.c and I found this:
---
Support --force option with svn checkout, update, and switch.

With the force option, co, sw, and up now tolerate unversioned
obstructing paths when adding new paths of the same type, rather than
generating a SVN_ERR_WC_OBSTRUCTED_UPDATE error.

If the obstructing path is the same type (file or directory) as the
corresponding path in the repository it will be left 'as-is' in the
working copy.  For directories this simply means the obstruction is
tolerated.  For files, any content differences between the obstruction
and the repository are treated like a local modification to the
working copy.

This patch is an expansion of one originally posted by Jonathan Gilbert
<o2...@sneakemail.com> against the 1.2.0 tag.  See the various
"Takeover" threads on the dev mailing list.
---

This sounds like exactly what I needed but I'm not sure when 1.5 will be
available. Is there a patch available by chance?

RE: Re: Obtaining new .svn directories

Posted by "Reedick, Andrew" <jr...@ATT.COM>.
> >> I've tried doing a svn checkout in the non-versioned directory
> >> hoping svn
> >> would be able to re-create the missing .svn directories but instead
> >> it just
> >> gives me an error stating "svn: Failed to add directory 'XXX':
> >> object of the
> >> same name already exists". If only I could tell it to ignore those
> >> directories/files... am I doing something wrong here?
> >
> >


In theory, not that I've tried it recently, and with no guarantee of
success, reliability, or data integrity, you could:
	rename the dir to dir.oops
	svn co -N svn://server/repos/blah/blah/dir
	move dir.oops/* dir/.
	run 'svn status' to see if it really worked.  Maybe followed by
an 'svn update'

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


Re: Obtaining new .svn directories

Posted by Steven Bakke <st...@amd.com>.
On Jan 3, 2008, at 2:11 PM, Erik Huelsmann wrote:

> On Jan 3, 2008 7:36 PM, James <ex...@gmail.com> wrote:
>> I thought this might have been an obvious necessity (yet google has  
>> gotten
>> me no where) but is there any way to get a .svn directory if its  
>> accidently
>> been modified or removed? For example say I had a large project  
>> with upwards
>> of 1000 files and I accidently deleted the root .svn directory. Do  
>> I really
>> need to re-checkout the entire project (with all its files) just to  
>> fix the
>> missing .svn directory?
>>
>> I've tried doing a svn checkout in the non-versioned directory  
>> hoping svn
>> would be able to re-create the missing .svn directories but instead  
>> it just
>> gives me an error stating "svn: Failed to add directory 'XXX':  
>> object of the
>> same name already exists". If only I could tell it to ignore those
>> directories/files... am I doing something wrong here?
>
>
> This is a feature provided by Subversion 1.5 (which is yet to be  
> released).

Just curious - in this situation if I were to try 1.5, what would be  
the command
that would restore the .svn dir.  Is it 'svn co' or 'svn update'?

-Steve

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



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

Re: Obtaining new .svn directories

Posted by Erik Huelsmann <eh...@gmail.com>.
On Jan 3, 2008 7:36 PM, James <ex...@gmail.com> wrote:
> I thought this might have been an obvious necessity (yet google has gotten
> me no where) but is there any way to get a .svn directory if its accidently
> been modified or removed? For example say I had a large project with upwards
> of 1000 files and I accidently deleted the root .svn directory. Do I really
> need to re-checkout the entire project (with all its files) just to fix the
> missing .svn directory?
>
> I've tried doing a svn checkout in the non-versioned directory hoping svn
> would be able to re-create the missing .svn directories but instead it just
> gives me an error stating "svn: Failed to add directory 'XXX': object of the
> same name already exists". If only I could tell it to ignore those
> directories/files... am I doing something wrong here?


This is a feature provided by Subversion 1.5 (which is yet to be released).

bye,

Erik.

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