Solved

SVN - how to add parent directory to repo?

Posted on 2008-09-29
18
1,445 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 6

Author Comment

by:trickyidiot
Comment Utility
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
Comment Utility
okay ...
create and add
/webdata/parentdirectory
svn copy subdirs to this directory ... that should work
0
 
LVL 6

Author Comment

by:trickyidiot
Comment Utility
.. 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 6

Author Comment

by:trickyidiot
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
correct
0
 
LVL 6

Author Comment

by:trickyidiot
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Not getting TFS Task alerts 3 276
.htacces, redirect http to https 3 349
git, understanding 2 134
How best to setup github repositories 3 42
When working in a large software development team, whether you have many developers working on the same projects, or your project is linked to other projects; it is very important that developers regularly perform "get latest" to ensure that the cha…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now