Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SVN - how to add parent directory to repo?

Posted on 2008-09-29
18
1,529 Views
Last Modified: 2013-11-25
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
Comment
Question by:trickyidiot
  • 11
  • 7
18 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
ID: 22597747
Hello trickyidiot,

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

Regards,

sunnycoder
0
 
LVL 6

Author Comment

by:trickyidiot
ID: 22597791
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
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22597859
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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 6

Author Comment

by:trickyidiot
ID: 22597899
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
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22597938
okay ...
create and add
/webdata/parentdirectory
svn copy subdirs to this directory ... that should work
0
 
LVL 6

Author Comment

by:trickyidiot
ID: 22598352
.. 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
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22598368
can you tell me the exact svn commands you used to create (and checkin) your directory structure in SVN
0
 
LVL 6

Author Comment

by:trickyidiot
ID: 22598369
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
 
LVL 6

Author Comment

by:trickyidiot
ID: 22598446
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
 
LVL 6

Author Comment

by:trickyidiot
ID: 22598470
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
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22598493
So when you checked out webdata, there was a parentdirectory under it already and you just cd into that directory?
0
 
LVL 6

Author Comment

by:trickyidiot
ID: 22598516
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
 
LVL 6

Author Comment

by:trickyidiot
ID: 22598520
correct
0
 
LVL 6

Author Comment

by:trickyidiot
ID: 22598527
I know I screwed up - I want to fix this rather than remove all the work I've done and start over
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22598538
okay then parent directory is already a part of SVN repository else you would not have seen it on your first check out
0
 
LVL 6

Author Comment

by:trickyidiot
ID: 22598598
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
 
LVL 6

Author Comment

by:trickyidiot
ID: 22598706
forget it - I'm just going to remove all existence of .svn dirs in /webdata/, kill the repo and start over
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22598727
>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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

INTRODUCTION Subversion is a fantastic version management and software configuration management tool for teams and individuals to manage software applications. It offers many advantages over it's CVS ancestor such as it's built-in compatibility w…
Article by: gr8gonzo
Git can be a complicated version control system for beginners, but it definitely is one of the best ones out there. Since this article assumes that you're starting at square one, it will skip over things that Git -can- do and will focus on the typic…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question