Using subversion and viewcvs on Solaris 10

Source: Internet
Author: User
Document directory
  • Summary
  • 1. Subversion setup
  • 2. viewcvs setup
  • 3. viewcvs setup
Using subversion and viewcvs on Solaris 10

Author: badcoffee
Email: blog.oliver@gmail.com
Date: Jan 2005

Original Site: http://blog.csdn.net/yayong
Copyright: anyone refer to this article, must include author information and original site URL.

SUMMARYThis article is a introduction that show you how to install and setup subversion and viewcvs's on Solaris 10. it also give instructions about subversion usage for developer and keep keeper (administrator ). if you are a advanced
User, please refer to subversion book for more details.


1. Subversion setup 1.1 install subversion package
  • First, grab the PKG-Get package file, from URL below:

Http://www.blastwave.org/pkg_get.pkg

Install it
Pkgadd-D pkg_get.pkg

Then, make sure can find/usr/SFW/bin/wget command.
At last, maybe Modify/opt/csw/etc/pkg-get.conf file for proxy setting:
Ftp_proxy = http: // proxy_server: Port
Http_proxy = http: // proxy_server: Port
Export http_proxy ftp_proxy

Set envirment in/etc/profile:

Path =/opt/csw/bin: $ path;
Svn_editor =/usr/bin/VI
Export svn_editor
Export path

  • Install subversion package

PKG-get-I subversion

For Python and apache2 support:

PKG-get-I pysvn
PKG-get-I ap2_subversion

1.2 running a Subversion server
  • Create System Account:

Groupadd SVN
Useradd-c "SVN owner"-D/export/home/SVN-G SVN

Mkdir/export/home/SVN
Chown SVN: SVN/export/home/SVN
Chmod g + w/export/home/SVN

  • Creat repository for Project

Svnadmin create -- FS-type fsfs/export/home/SVN/[project name]

Import Source Code into repository:

CD [/path/to/source/tree]
SVN import file: // export/home/SVN/[project name]

  • Setting access policy of repository:

VI/export/home/SVN/[project name]/CONF/svnserve. conf
[General]
Anon-access = read
Auth-access = write
Password-DB = passwd. conf
Realm =/[project name]

Create passwd database:
/Export/home/SVN/[project name]/CONF/passwd. conf
[Users]
Username1 = passwd1
.......

Setting right access permission for Subversion server:
Chown-r SVN: SVN/Export/home/SVN/[project name]
Chmod-r g + w/export/home/SVN/[project name]
Chmod g + S/export/home/SVN/[project name]/DB

  • Configure the Subversion service:

Create the start script when system boot:
VI/etc/rc2.d/s98svnserve
Su-svn-c "/opt/csw/bin/svnserve-d-r/export/home/SVN &"

Chmod + x/etc/rc2.d/s98svnserve

Start subversion service:
/Etc/rc2.d/s98svnserve

  • Check out source code to verify subversion service works correctly

SVN checkout SVN: // [hostname]/[project name]

2. viewcvs setup 2.1 install viewcvs package
  • Install Python package

PKG-get-I Python

  • Install viewcvs package

./Viewcvs-install

Note: Before your installation, you can refer to install file in viewcvs package.
Currently, only viewcvs 1.0 can support subversion, but this version is under development.
You can get viewcvs 1.0 Dev version from viewcvs site.

  • Install enscript package

PKG-get-I enscript

  • Install gnudiff

PKG-get-I diffutils
CP/opt/csw/bin/gdiff */usr/bin/

2.2 runing viewcvs with Apache server
  • Configure viewcvs with subversion

VI/usr/local/viewcvs-1.0-dev/viewcvs. conf

# Cvs_roots = CVS:/home/cvsroot
Svn_roots = [project name]:/export/home/SVN/[project name]
Svn_parent_path =/export/home/SVN
Default_root = [project name]

Use_enscript = 1
Enscript_path =/opt/csw/bin/

  • Import subverion Python Moudle into Python

# Python
Python 2.3.4 (#3, Nov 10 2004, 12:43:17) [C] On sunos5
Type "help", "Copyright", "Credits" or "License" for more information.
>>> Import SVN. Repos

  • Start viewcvs Web Service

CP-F/usr/local/viewcvs-1.0-dev/www/cgi/*/var/apache2/cgi-bin/

VI/var/apache2/htdocs/index.html
<Script language = "JavaScript">
Location = "/cgi-bin/viewcvs. cgi"
</SCRIPT>

CP-F/etc/apache2/httpd. conf-example/etc/apache2/httpd. conf

Pkill-9 httpd
Svcadm enable svc:/Network/HTTP: apache2

You can access your project site from URL: http: // [hostname]

3. viewcvs setup3.1. for developer

* Install a subverion Client

Please see section 1.1 above.

* Start work with subversion

Get project URL of Subversion server from keeper

Check out source code:

SVN checkout-R [version name] SVN: // [hostname]/[project name]

After check out, a local work directory is created, you can do following things:

Check recent change log anytime:

SVN log

Update your local work copy to a specified version:

SVN Update-R [version name]

Check local work dir status, compare them with server side:

SVN status

Diff a file current version with specified version

SVN diff-R [version name]

Add a new dir

SVN mkdir [dir name]

Add a new file

SVN add

Of course, you can modify a existed file anytime.

When a change is occurred, don't forget commit your change:

SVN commit

* Get Help for command:

SVN help

* Get a certain release of project?

Need know realse name first.

Switch local work dir to a certain branch, tag and release:

SVN switch SVN: // [hostname]/[project name]/tags/[tag name or release name]
3.2. For keeper

* Create repository for a new project and setting access policy of repository

Create repository for a new project

Svnadmin create -- FS-type fsfs/export/home/SVN/[project name]

Import Source Code into repository:

CD [/path/to/source/tree]
SVN import file: // export/home/SVN/[project name]

Set access policy of repository:

VI/export/home/SVN/[project name]/CONF/svnserve. conf

[General]
Anon-access = read
Auth-access = write
Password-DB = passwd. conf
Realm =/[project name]

Create User Password Database:

VI/export/home/SVN/[project name]/CONF/passwd. conf

[Users]
Username1 = passwd1
.......

Setting access permission for Subversion server:

Chown-r SVN: SVN/export/home/SVN/[project name]
Chmod-r g + w/export/home/SVN/[project name]
Chmod g + S/export/home/SVN/[project name]/DB

* Add new project into viewcvs:

VI/usr/local/viewcvs-1.0-dev/viewcvs. conf

Svn_roots = [project name1]:/export/home/SVN/[project name1],
[Project name2]:/export/home/SVN/[project name2],
[Project name3]:/export/home/SVN/[project name3]

* Create new tag or branch for Project

SVN mkdir-M "[comment]" SVN: // [hostname]/[project name]/tags
SVN copy-M "[comment]" [local work copy dir] SVN: // [hostname]/[project name]/tags/[tag name]

* Backup and Restore Repository

Make a full backup for a subversion project:

Svnadmin dump/export/home/SVN/[project name]> [name of path]/[project name]. full_dumpfile

If workspace is damaged, restore a project workspace from a full backup file:

Svnadmin load/export/home/SVN/[project name] <[name of path]/[project name]. full_dumpfile

* Create hook scripts for Project

Enter hook dir on subverion Server:

CD/export/home/SVN/[project name]/hooks

Change the *. tmpl file to a executable script, take post-commit.tmpl for example:

Cppost-commit.tmpl post-commit
Chown SVN: SVN post-commit
Chmod 754 post-commit

Customize post-commit to invoke your own commands, please refer to sample script below:

#!/bin/sh

REPOS="$1"
REV="$2"

SVNLOOK=/opt/csw/bin/svnlook
CONTENT=/tmp/mail_content.$

echo "Event: putback-to" >> $CONTENT
echo "Repository: $REPOS" >> $CONTENT
echo "Reversion: $REV" >> $CONTENT

CHANGED=`$SVNLOOK changed -r $REV $REPOS`
AUTHOR=`$SVNLOOK author -r $REV $REPOS`
DATE=`$SVNLOOK date -r $REV $REPOS`
LOG=`$SVNLOOK log -r $REV $REPOS`

echo "User: $AUTHOR" >> $CONTENT
echo "Date: $DATE/n/n" >> $CONTENT
echo "Files:/n$CHANGED/n" >> $CONTENT
echo "Comments:/n$LOG/n" >> $CONTENT

mailx -s "Code change notification mail" -r $AUTHOR@[domain.com][mail list address]< $CONTENT

4. Related resource

Subversion book
Viewcvs site
Installation and setup of the development environment on Solaris

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.