Computing Project RepositoryMain Page | About | Help | FAQ | Special pages | Log in
The Free Encyclopedia
Printable version | Disclaimers

Using subversion to manage projects

From Computing Project Repository

Viewing and editing the repository

Subversion is a newer and better version of CVS.

You can browse the subversion repositories on the web without having subversion installed on your machine, but to edit the files you will need to install the subversion commands for Unix or Windows. <p> Using the subversion commands to work, there are several steps.

You will use URLs to access the files on the project host. The convention for subversion repositories is to create a "trunk" directory that includes all of the files and subdirectories of your project.

https://svn.iu.hio.no/projects/project_name/trunk

Let's suppose you want to set up the project "cfengine-2". The files are contained in:

enterprise$ cd /myfiles/cfengine-2

The administrator must first set up the repository:


mkdir trunk
mv * trunk   
svn import trunk file:///path/cfengine-2/trunk

Or, if he/she has set it up already, you can import the files yourself. Go first to where the root directory of your project is, then do this (Unix):

mkdir trunk
mv * trunk
svn import `pwd` https://project.iu.hio.no/projects/MyProject -m "Initial import"

You will be asked for a user name and password.

As a user, you no long "own" the files. To edit the repository you now have to check out a "working version". Whe you do this, subversion fills the working copy with hidden data that allow it to intelligently manage the files and remember the location of the repository that they come from:

enterprise$ cd /workdir
enterprise$ svn checkout https://svn.iu.hio.no/projects/cfengine-2/trunk

Error validating server certificate for 'https://svn.iu.hio.no:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
 - The certificate hostname does not match.
Certificate information:
 - Hostname: eternity.iu.hio.no
 - Valid: from Feb  7 21:15:02 2005 GMT until Feb  7 21:15:02 2006 GMT
 - Issuer: Computing, Oslo University College, Oslo, Oslo, no
 - Fingerprint: 69:95:c5:21:62:89:20:3e:c0:c7:a9:1e:cf:6e:08:5e:79:4d:6a:cf

(R)eject, accept (t)emporarily or accept (p)ermanently? p

A  trunk/mkinstalldirs
A  trunk/configure.in
A  trunk/ChangeLog
A  trunk/src
A  trunk/src/Makefile.in
A  trunk/src/cfagent.c
A  trunk/src/tidy.c
A  trunk/src/cflex.l
A  trunk/src/cfrun.c
A  trunk/src/client.c
A  trunk/src/item-ext.c
A  trunk/src/parse.c
A  trunk/src/cflex.l.in
A  trunk/src/crypto.c
A  trunk/src/classes.c
A  trunk/src/link.c
A  trunk/src/prototypes.h
A  trunk/config.guess
A  trunk/ltmain.sh
A  trunk/README
A  trunk/config.sub
A  trunk/SURVEY
A  trunk/acconfig.h
A  trunk/contrib
A  trunk/contrib/Makefile.in
A  trunk/contrib/README.vicf
A  trunk/contrib/Makefile.am
A  trunk/contrib/vicf.in
A  trunk/contrib/README
A  trunk/contrib/cfengine.el
A  trunk/contrib/cfdoc
A  trunk/mdate-sh
A  trunk/configure.ac
A  trunk/TODO
A  trunk/doc
A  trunk/doc/texinfo.tex
A  trunk/doc/cfengine-Reference.html
A  trunk/doc/version3.texi
A  trunk/doc/cfengine-Tutorial.html
A  trunk/doc/stamp-vti
A  trunk/doc/cfengine-Reference.texinfo
A  trunk/doc/cfengine-Anomalies.texinfo
A  trunk/doc/Makefile.am
A  trunk/INSTALL

Checked out revision 19.

You now have a working copy in a directory called "workdir/trunk". You can edit the files here, or add files:

enterprise$ svn add getloadavg.c
A         getloadavg.c

Delete files...

enterprise$ svn del getloadavg.c
D         getloadavg.c
enterprise$ cd pub/
enterprise$ svn add getloadavg.c
A         getloadavg.c

Then when you have completed a change, you commit the changes. Ether name a single file explicitly or go back to workdir and type:

enterprise$ svn commit trunk

A    pub/getloadavg.c
D    configure.in
M    ChangeLog
M    src/cf.extern.h
M    src/cfservd.c
M    src/locks.c
M    src/item.c
M    src/cfexecd.c
M    src/cfenvd.c
M    src/cfagent.c
M    src/item-ext.c
M    src/do.c
M    src/crypto.c
M    src/globals.c
M    src/cfenvgraph.c
A    acinclude.m4

Password for 'mark': XXXXXXXXXX 

Sending        trunk/ChangeLog
Adding         trunk/acinclude.m4
Deleting       trunk/configure.in
Adding         trunk/pub/getloadavg.c
Sending        trunk/src/cf.extern.h
Sending        trunk/src/cfagent.c
Sending        trunk/src/cfenvd.c
Sending        trunk/src/cfenvgraph.c
Sending        trunk/src/cfexecd.c
Sending        trunk/src/cfservd.c
Sending        trunk/src/crypto.c
Sending        trunk/src/do.c
Sending        trunk/src/globals.c
Sending        trunk/src/item-ext.c
Sending        trunk/src/item.c
Sending        trunk/src/locks.c
Transmitting file data ...............
Committed revision 20.
enterprise$ <b>svn commit *.texinfo -m "Short comment to avoid starting editor..."</b>
Sending        cfengine-Reference.texinfo
Sending        cfengine-Tutorial.texinfo
Transmitting file data ..
Committed revision 21.

Retrieved from "https://project.iu.hio.no:443/wiki/index.php/Using_subversion_to_manage_projects"

This page has been accessed 1003 times. This page was last modified 09:49, 10 Feb 2005.


Find
Browse
Main Page
Community portal
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Create an account or log in
Special pages
New pages
Image list
Statistics
Bug reports
More...