• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1912
  • Last Modified:

SVN - how to add parent directory to repo?

I have a directory with a LOT of files in it (literally millions), so rather than doing an svn add to the parent directory, I went into that directory and added smaller chunks. to keep from killing the server (some of the 'chunks' took 40 hours to complete)

Now I want the parent directory itself in the repo, but I am getting erros when trying to do so:
svn: '.' is not a working copy
svn: Can't open file '.svn/entries': No such file or directory

the dir structure is set up like this:
/webdata/parentdirectory/subdirs

All the 'subdirs' are added to, and committed into the repo - how do I get 'parentdirectory' added and committed as well?

Have I screwed the pooch here?

I *really* do not have time to remove all of the subdirs and re-add/commit them with the parent directory.

Thank you in advance for any insight.

0
trickyidiot
Asked:
trickyidiot
  • 11
  • 7
1 Solution
 
sunnycoderCommented:
Hello trickyidiot,

Add the parent directory in a different path and svn copy all the files to that directory.

Regards,

sunnycoder
0
 
trickyidiotAuthor Commented:
I'm confused. (sorry)

Here's a touch more detail.

I have a live website that I am trying to add to a repo.
All site data is in /webdata/ but the webroot is /webdata/parentdirectory (renamed for ambiguity here)

if I move the dta to a different directory, it will jack everything up, won't it?
0
 
sunnycoderCommented:
Tell me if this is possible.

In SVN create a directory /webdata/parentdirectory1
Next svn copy all subdirs to /webdata/parentdirectory1
Change webroot to /webdata/parentdirectory1

Would that work for you or are there some hardcoded references to parentdirectory?

If that does not work, then use a post commit hook to update your site automatically after every checkin ... btw this is also the recommended setup
http://subversion.tigris.org/faq.html#website-auto-update
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
trickyidiotAuthor Commented:
I am not willing to change the webroot simply beacvuse there is too much tied to it.

As for setting the live site to update after every commit - absolutely not.

I dev in the dev environment. When it's ready to test, I commit.

I update to the test environment and our test team tests.
Once everything has passed testing, then the live site is sent an update

As for right now, I'm just trying to get the live site in the repo.

There has to be a way to add the parent dir...
0
 
sunnycoderCommented:
okay ...
create and add
/webdata/parentdirectory
svn copy subdirs to this directory ... that should work
0
 
trickyidiotAuthor Commented:
.. create and add where? it already exists on the web server just not in the repo.

The files within parentdirectory were added to the repo, just not the parent directory itself
0
 
sunnycoderCommented:
can you tell me the exact svn commands you used to create (and checkin) your directory structure in SVN
0
 
trickyidiotAuthor Commented:
I was hoping this would work (I should have done this first)
[root@removed /]# svn add --non-recursive parentdirectory
svn: '.' is not a working copy
svn: Can't open file '.svn/entries': No such file or directory
0
 
trickyidiotAuthor Commented:
svn checkout http://svn.servernameremoved.com/nameremoved_repository/trunk/
cd webdata
cd parentdirectory
svn add subdir
svn commit -m "Adding subdir dir... whole lotta files here..."
0
 
trickyidiotAuthor Commented:
thats wrong - this is right:

svn checkout http://svn.servernameremoved.com/nameremoved_repository/trunk/webdata
cd webdata
cd parentdirectory
svn add subdir
svn commit -m "Adding subdir dir... whole lotta files here..."
0
 
sunnycoderCommented:
So when you checked out webdata, there was a parentdirectory under it already and you just cd into that directory?
0
 
trickyidiotAuthor Commented:
svnadmin create /var/svn/nameremoved
svn mkdir /var/svn/nameremoved/trunk
svn mkdir file:///var/svn/nameremoved/trunk -m "Creating trunk directory"
svn mkdir file:///var/svn/nameremoved/tags -m "Creating tags directory"
svn mkdir file:///var/svn/nameremoved/branches -m "Creating branches directory"
svn mkdir file:///var/svn/nameremoved/trunk/tmp_svn_tst -m "Creating temp test directory directory"
svn mkdir file:///var/svn/nameremoved/trunk/webdata -m "Creating webdata dir"
svn commit -m "creating webdata folder for nameremoved live"
0
 
trickyidiotAuthor Commented:
correct
0
 
trickyidiotAuthor Commented:
I know I screwed up - I want to fix this rather than remove all the work I've done and start over
0
 
sunnycoderCommented:
okay then parent directory is already a part of SVN repository else you would not have seen it on your first check out
0
 
trickyidiotAuthor Commented:
no it's not
here is a ls -lah of the contents of /webdata

drwxr-xr-x 10 root    root    4.0K Sep 26 15:37 .
drwxr-xr-x 27 root    root    4.0K Sep 26 14:56 ..
drwxrwxr-x  3 root    priceqa 4.0K Sep 23 10:27 classes
drwxrwxr-x  3 root    priceqa 4.0K Sep 23 10:27 CustomTags_movedToCFDir
drwxrwxr-x  3 root    priceqa  16K Sep 23 10:29 lost+found
drwxrwxr-x 31 bcopher priceqa 4.0K Sep 23 10:29 nameremoved
-rw-r--r--  1 root    root    9.0K Feb 14  2007 price.conf
drwxrwxr-x 31 nobody  priceqa 4.0K Sep 25 16:40 nameremovedlive
drwxr-xr-x  6 root    root    4.0K Sep 26 14:35 nameremovedlive_includes
drwxrwxr-x 13 root    priceqa 4.0K Jun 15 15:37 nameremovedmedia
-rw-rw-r--  1 root    priceqa  224 Apr 26  2007 sendmail.cfm
drwxr-xr-x  2 root    root    4.0K Dec  6  2007 test

there is NO .svn dir there

This is on the webderver - not the svn server

when you add dirs to svn, .svn dirs are generated.

0
 
trickyidiotAuthor Commented:
forget it - I'm just going to remove all existence of .svn dirs in /webdata/, kill the repo and start over
0
 
sunnycoderCommented:
>here is a ls -lah of the contents of /webdata
>This is on the webderver
How can you have your subdirs without the parentdirectory on the webserver? I am sorry but I am lost. You said you want to check in the directory structure of your website which has a parentdirectory and now you are giving a listing of that directory minus the parentdirectory. In addition to that you are reporting that a svn checkout gives you parentdirectory!!! How would svn know of the parent directory had it not been checked in?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 11
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now