View previous topic :: View next topic |
Author |
Message |
deffe n00b
Joined: 20 Jan 2004 Posts: 51
|
Posted: Sat Oct 30, 2004 5:07 pm Post subject: HOWTO: Subversion Server and Client (almost) |
|
|
For information on subversion and what it's all about check this out:
http://subversion.tigris.org/
I have never used any type of versioning software before and I do have a question on the best way to use it. Please see the client section...
Server
Install subversion
Code: | # emerge subversion |
NOTE: I had a problem installing subversion. Improper USE flags and swigs were the culprits. Below is the fix:
https://bugs.gentoo.org/show_bug.cgi?id=65425
Since I am going to use the svnserve daemon method (you can also use the apache mod_svn method) lets install xinetd if you don't already have it.
Create your repository
Code: |
# mkdir -p /var/svn
# svnadmin create /var/svn/repos
|
Configure the svnserve daemon
Code: |
# nano /var/svn/repos/conf/svnserve.conf
[general]
# no access for anonymous users
anon-access = none
# authenticated users have full access
auth-access = write
# use file relative to svnserve.conf path
password-db = passwd
realm = My First Repository
|
The passwd file above can be used to store users who can gain access to your subversion boxen. Here is the format (one user per line):
Code: |
[users]
USERNAME = PASSWORD
|
If you have a fresh install of xinetd you will not be able to connect to the server unles you comment or remove the only_from line in your xinetd.conf
Code: |
defaults
{
instances = 60
log_type = SYSLOG authpriv info
log_on_success = HOST PID
log_on_failure = HOST
cps = 25 30
}
includedir /etc/xinetd.d
|
Create the svnserve xinetd conf file
Code: |
# nano /etc/xinetd.d/svnserve
service svnserve
{
disable = no
socket_type = stream
wait = no
user = root
group = root
log_type = FILE /var/log/svnserve
protocol = tcp
log_on_failure += USERID
port = 3690
server = /usr/bin/svnserve
server_args = -i -r /var/svn/repos
}
|
Start the svnserve daemon and set init
Code: |
# /etc/init.d/xinetd start
# rc-update add xinetd default
|
Client
Install subversion (and rapidsvn if you want a GUI)
Code: |
# emerge subversion
Optional:
# emerge rapidsvn
|
Navigate to your development directory and import your project
Code: |
$ cd project1
$ svn import project1 svn://server/repos/project1
|
Now my question is with where do I checkout the project? For instance, if I do the following:
Code: |
$ svn checkout svn://server/repos/project1
|
within the directory I am working in it will not make changes to a web application since the working directory is the path of the web application. If I try to move down a directory and import I get:
Code: |
svn: Failed to add directory 'project1/images': object of the same name already exists
|
Am I using the software in the wrong manner or do I need to do something else? _________________ Everytime you start your SUV god clubs a seal. |
|
Back to top |
|
|
Maedhros Bodhisattva
Joined: 14 Apr 2004 Posts: 5511 Location: Durham, UK
|
Posted: Sat Oct 30, 2004 5:11 pm Post subject: |
|
|
Have you seen the subversion book? I found it very helpful. Basically, once you've imported your project, you can delete your current working copy, as it's stored on the server. Then just checkout a new copy, which will have lots of subversion specific (hidden) directories in it. _________________ No-one's more important than the earthworm. |
|
Back to top |
|
|
deffe n00b
Joined: 20 Jan 2004 Posts: 51
|
Posted: Sun Oct 31, 2004 12:28 am Post subject: |
|
|
I looked through the book and didn't see anything that fits the scenario I described above.
Has anyone used subversion in a development environment with a web server, mount the web application share on client, and have a seperate subversion server and still make immediate changes to the web server and subversion?
Confuse you yet? _________________ Everytime you start your SUV god clubs a seal. |
|
Back to top |
|
|
Petyr Guru
Joined: 08 Jan 2003 Posts: 471 Location: San Diego, CA, USA
|
Posted: Mon Nov 01, 2004 5:03 pm Post subject: Re: HOWTO: Subversion Server and Client (almost) |
|
|
deffe wrote: |
Navigate to your development directory and import your project
Code: |
$ cd project1
$ svn import project1 svn://server/repos/project1
|
|
Okay so now you've imported code for a project into subversion
Quote: | Now my question is with where do I checkout the project? For instance, if I do the following:
Code: |
$ svn checkout svn://server/repos/project1
|
within the directory I am working in it will not make changes to a web application since the working directory is the path of the web application. If I try to move down a directory and import I get:
Code: |
svn: Failed to add directory 'project1/images': object of the same name already exists
|
|
I'm not sure I completely understand this, so I'll take a stab in the dark ^_~
Basically you've imported the project, but you don't have a valid working copy. Import doesn't make the pwd a working copy, you have to do a checkout (co) for that. Simple solution is import the directory, rename it, then do a checkout to that original directory. i.e. Code: | svn import blah http://server/repos/blah
mv blah blah.bak
svn co http://server/repos/blah ./blah | If everything looks good, then you can remove the "original" since the original is now in subversion. Once you have a valid working copy (wc), then import is not longer needed. You instead would use svn add [Directory / File] to add new things in there.
Does that kinda answer your question?
As for the second part, it sounds like you want to do dev work on a seperate compueter. Then when your happy with it, you commit those changes to subversion, and the web server magically picks up those changes automatically.
Is this possible? Yes, but you need to fiddle around a bit with some of the post-commit scripts for the repository and you'll need to do a little script writing. Basically what you can do is have a script that fires off an ssh command to the web server telling it to go and pick up the changes. Take a look at the subversion book for info on that kind of stuff.
hth!
Petyr Rahl |
|
Back to top |
|
|
fourhead l33t
Joined: 03 Sep 2003 Posts: 875 Location: Cologne, Germany
|
Posted: Sat Dec 04, 2004 6:59 pm Post subject: |
|
|
I followed your steps of installing a Subversion server, except I'm not using xinetd. On the client machine, I created a directory test with one file test.txt in it. When I cd into this directory and do
svn import test svn://myserver.de/test
I suddenly see nano showing my a file saying "This and the following lines are being ignored". In the next line, I see
"A test"
When I exit nano, sn asks me to Continue, Cancel or Edit. Whatever I choose there, I get back to my bash prompt. I created the repository on the server with "svnadmin create /var/svn". What am I doing wrong here???
Tom |
|
Back to top |
|
|
Petyr Guru
Joined: 08 Jan 2003 Posts: 471 Location: San Diego, CA, USA
|
Posted: Sun Dec 05, 2004 6:40 pm Post subject: |
|
|
Normally when nano pops up you want to enter a log message for the file that you're adding to the repository. You can leave it blank but you need to tell subversion to continue anyways after that.
Go read through the SVN book that's linked off of subversion.tigris.org
It's the exact book that you can buy (if your really want to) from a bookstore, and it's EXTREMELY helpful for all the questions posed here.
hth,
Petyr |
|
Back to top |
|
|
golgo13 Apprentice
Joined: 24 Nov 2004 Posts: 158
|
Posted: Tue Oct 11, 2005 5:57 am Post subject: |
|
|
You can add a log message directly from the command line with the -m switch followed by your log comment:
Code: |
svn import /home/user/project svn://serverAddress/project -m 'Initial Import'
|
_________________ www.latestintech.com |
|
Back to top |
|
|
jago25_98 Apprentice
Joined: 23 Aug 2002 Posts: 180
|
Posted: Mon Oct 27, 2008 12:37 am Post subject: |
|
|
Quote: | With the code that is currently in trunk, in this scenario, the svn checkout command will still need to pull down the same number of bytes from the server as a "normal" checkout. It is possible that it could be enhanced in the future to more selectively pull down just the differences, something like an rsync. A change of that nature has been deferred for some future release or whenever someone comes along with enough motivation to tackle it. |
from http://markphip.blogspot.com/2007/01/subversion-15-tolerate-obstructions.html
?
Code: | j@IDPP-0644:~/compile$ mv trunk/ trunk2
j@IDPP-0644:~/compile$ svn checkout --force svn://svn.icculus.org/alienarena/trunk ./trunk2
Subcommand 'checkout' doesn't accept option '--force'
Type 'svn help checkout' for usage.
j@IDPP-0644:~/compile$ svn checkout svn://svn.icculus.org/alienarena/trunk ./trunk2
svn: Failed to add file 'trunk2/data1/maps/ctf-europa.bsp': object of the same name already exists
j@IDPP-0644:~/compile$ | [/code] |
|
Back to top |
|
|
torontolimo n00b
Joined: 28 Oct 2008 Posts: 3
|
Posted: Tue Oct 28, 2008 5:32 pm Post subject: |
|
|
Mon 26 Dec 2005
Setting up and connecting to subversion server using svn+ssh://
Posted by Chandra under General
For anyone who has not heard of Subversion , it is an open-source version control system (very much like CVS but much better) to manage your source code. I had started to play with Ruby on Rails using the RailsIDE and I would hate for my source code to be without version control and much worse just kept in my hard drive. So I wanted to have a version control for my personal projects just like I do at work. And I didn’t want to host this subversion repository in my windows box at home, I would rather keep it at the ISP machine where I host my domain. Sounds simple enough, right?. Wrong!!. I found so little on the net about it that I was compelled to write this down for others who might want to do this . Here is a step-by-step guide on running and connecting to a subversion repository in an ISP account.
Before we get started, there are a few assumptions:
# Your ISP provides you with shell access using ssh. You can’t do what I am describing below using Control Panel. Not all of ISPs allow Shell access and some will do it if you ask them. This is an absolute requirement.
# You have permission to install anything under your user directory. This I know almost all of them allow you to do.
Step 1: Installing subversion server
The following instructions are for a linux machine. Surf to subversion site and look for the latest stable source code package. When I did the install , this is what I ended up using: http://subversion.tigris.org/tarballs/subversion-1.1.4.tar.gz. Now ssh into your account and do the following:
$ cd $HOME;
$ curl -o subversion-1.1.4.tar.gz http://subversion.tigris.org/tarballs/subversion-1.1.4.tar.gz
$ gunzip subversion-1.1.4.tar.gz; tar xvf subversion-1.1.4.tar
$ mv subversion-1.1.4 subversion-1.1.4-dist
$ cd subversion-1.1.4-dist
$ ./configure --prefix=$HOME/subversion-1.1.4
$ make
$ make install
$ cd $HOME; ln -sf subversion-1.1.4 subversion _________________ http://www.torontolimousineservices.com/
http://www.p59.info
http://www.p63.info |
|
Back to top |
|
|
|