Open Source Software Technical Articles

Want the Best of the Wazi Blogs Delivered Directly to your Inbox?

Subscribe to Wazi by Email

Your email:

Connect with Us!

Current Articles | RSS Feed RSS Feed

ViewVC Helps CVS and SVN Go GUI

  
  
  

Almost everyone who works with version control systems (VCS) feels the need, sooner or later, for a graphical interface, because sometimes a GUI makes your life easier. ViewVC is a full-featured browser interface that's portable as can be, given the design choice (web-based) and the programming language (Python). It was originally created for CVS users and later extended to support Subversion as well.



You need to install ViewVC on a server on your network. My choice for the server is a x86_64 machine running CentOS 6.2, which will host both the web server and read-only copies of one CVS and one Subversion repository, since ViewVC needs physical access to repositories. I will presume that you already have the operating system installed. To install the Apache web server, just run yum install httpd as root.



Before configuring the ViewVC web interface, you need the CVS and Subversion repositories in place. Let's suppose you want to work on porting some feature from FreeBSD and NetBSD to Linux. The former uses Subversion for anonymous access to its source code, while the latter uses CVS. Let's make sure we have all the packages in place:











What's in a Name?
ViewVC was initially called ViewCVS, but when it was expanded to support Subversion, the developers changed the name.




yum install cvs subversion viewvc


Alternatively, you can install ViewVC from source. After unpacking the tarball, run the viewvc-install script, which asks where you want to install the application. After I chose /usr/local/viewvc-1.1.13, which is the same version and place CentOS uses when you get ViewVC via the RPMForge repository, the script did the rest of the job. You can put the files anywhere, but unless you have a good reason to change, stay with the default, /usr/local.



Next, you can check out the FreeBSD source tree with the command svn co svn://svn.freebsd.org/base/stable/9 /usr/src. Since we are doing this just to have access to the source code, not for actually compiling the system, I suggest changing the destination directory from /usr/src to a location in your home directory.



Once FreeBSD is ready, it's NetBSD's turn. Again, create a directory inside your $HOME and check out to there:




cvs -qdanoncvs@anoncvs.netbsd.org:/cvsroot -r netbsd-5 co src # after you changed to the destination directory


Now we're ready to configure ViewVC. If you installed it from the package CentOS provides, you can find the ViewVC files by typing rpm -ql viewvc | less at a terminal. Regardless of the files' location, you should have the source code downloaded and unpacked somewhere convenient so you can have access to the installation documentation, especially since the CentOS RPM doesn't seem to offer any man or info pages. One particular document you should read is the INSTALL file, which, besides installation instructions, offers useful tips and troubleshooting info.



Make sure you also have installed the rcs and diffutils RPMs. You also need Python, but since yum is Python-based, you presumably already have Python installed even on the most minimal of installations. Optionally, you might want to install MySQL for creating a database of available commits, and Enscript for nice, colorized output of your code. If you choose not to use Apache as a web server, make sure your web server of choice supports CGI.



In ViewVC's bin/ directory, find the executable Python script named standalone.py, which you can run to do some preliminary testing:




cd /usr/local/viewvc-1.1.13 # change this to reflect your location
./bin/standalone.py -r /home/user/mycvsrepository # same as above


The link to the standalone test web server will be given to you after the script starts. Pay attention, however: In 1.1.13 the port it runs on is 49152, but the documentation says the port is 7467.



Now you can configure ViewVC and the web server, in that order. I used /usr/local/ (the default) for ViewVC and Apache as the web server, so all ViewVC file locations and web server config options below are oriented around those two variables.



Edit /usr/local/viewvc-1.1.13/viewvc.conf to modify a few items. It is a well-commented file, so you will not feel lost. The main variables that have to be edited, and sometimes uncommented, are the ones that tell ViewVC about the locations of the files it needs for CVS, Subversion, RCS, and so on. For instance:




# BASIC CONFIGURATION
#
# For correct operation, you will probably need to change the following
# configuration variables:
#
# cvs_roots (for CVS)
# svn_roots (for Subversion)
# root_parents (for CVS or Subversion)
# default_root
# rcs_path or cvsnt_exe_path
# mime_types_file


The first two variables, the ones ending in _roots, point ViewVC toward the CVS and Subversion repositories, which in our case are /home/user/netbsd and /home/user/freebsd. Adjust to taste, of course. root_parents only makes sense if, unlike our case, you have more than one repository contained in a directory; for example, if the netbsd/ directory contained the system sources and the pkgsrc tree, which allows NetBSD users to install third-party software from source. This option refers to multiple containers, which helps you not have to add or take away entries from *_roots. default_root makes sense only if root_parents is uncommented. For example, if




root_parents = /home/user/svnrepos : svn
/home/user/cvsrepos : cvs


then default_root can be svn or cvs, depending on your choice.



rcs_path needs to be uncommented only if the RCS executable is not in /usr/bin. Since we're using CentOS and installed rcs from a package, the executable is there, so this option remains commented. The same applies to other _path variables: Leave them commented if the executables they refer to are in /usr/bin. The last variable, mime_types_file, has a default value that makes sense on systems where you install from source. If you did, uncomment it and set the value that makes sense on your system. I recommend you take a look inside /etc first if you installed from packages.



Depending on how you want to use ViewVC, you might want to change the address variable, which points to the contact information for the repositories maintainer. You can also configure the database back end, should you need it. Make sure you have MySQL up and running with basic access set up, then search the viewvc.conf file for the [cvsdb] section. Make sure it reads enabled = 1 and configure the data for the database, such as host, user, port, and password.


19a98812-f823-48dc-841e-bf029c63c6d7

All that's left now is configuring Apache to support CGI and to follow symlinks. The latter part is optional if you want to create a symbolic link from ViewVC's installation directory to a location Apache is configured to know about for CGI scripts. The documentation (check the "APACHE CONFIGURATION" section) offers more than one method of letting Apache know about scripts; I prefer the first. Find the configuration file for Apache (on CentOS 6 it's /etc/httpd/conf/httpd.conf) and insert the following in the section where you see other ScriptAlias directives:




ScriptAlias /viewvc /usr/local/viewvc-1.1.13/bin/cgi/viewvc.cgi


If you need other CGI acripts from ViewVC, just add other lines similar to the one above.



Now you're finally all set up. Point your browser to http://webservers.addr.ess/viewvc to take advantage of the example above. You'll find using ViewVC is simple. The application offers colorized output, panes, side-by-side differences, and much more.



Security Considerations



Since ViewVC's purpose in life is to show you the files from a CVS or SVN repository in a web browser via a web server, you might wonder: What if your repository contains HTML files? Those HTML files will be accesible under ViewVC just as if they were part of your website, with links and references, making your site writable by anyone with commit access to the repositories. The workaround suggested by the developers involves adding two lines of code to lib/viewvc.py that will return a "403 Forbidden" error when someone tries to open files in checkout mode:




def view_checkout(request):
>> raise debug.ViewVCException('Checkout view is disabled',
>> '403 Forbidden')
path, rev = _orig_path(request)
fp, revision = request.repos.openfile(path, rev)


Fortunately, this seems to be a problem only to versions prior to 1.1.13; from that version on, blocking write access is the default behavior.



ViewVC makes for a nice small to medium-size development environment for work on projects more oriented toward reading and viewing than editing, or even for a single developer. It provides a good way to compare source code, be it revisions of the same code or different implementations.




This work is licensed under a Creative Commons Attribution 3.0 Unported License
Creative Commons License.


This work is licensed under a Creative Commons Attribution 3.0 Unported License
Creative Commons License.

Comments

A further superb to uncover the most effective Rolex different watches is to try using dior replica sale. The ebay affiliate network is a top rated internet public auction web-site plus theres couple superb Rolex vendors this apply the ebay affiliate network so that you can sell a Rolex different watches they may have. It will help you not spend as much, choose a extra exceptional and also mature Rolex, and you could have a good time bidding process for cartier replica sale in addition. Sometimes any time a entrepreneur results in your Rolex every time they currently have invested in your storage area component and also could hidden knowledge common box they should variety them while in the newspaper frequently internet and also while in the gucci replica handbags sale. Oftentimes you can get an awesome timepiece out of Rolex while in the deemed if you ever have successful. Additionally you can look at a Rolex webpage plus opt for a look at you wish. In that case, you can use a super easy search on its webpage to uncover the car dealership that is definitely nearby back plus provide you with a look at within your rolex replica sale. This is certainly a further gucci replica handbags to move instantly to a car dealership to get a different look at this is undoubtedly an highly-priced method.
Posted @ Tuesday, October 14, 2014 1:44 AM by sdfsdguxxxxanwei
ralph polo outlet, michael kors outlet, louis vuitton online, juicy couture outlet, jordan 3, Ralph lauren Polo, iphone cases for 5S, louis vuitton online outlet, ralph lauren outlet, toms online, air jordan shoes, Tiffany co Bracelets, north face outlet, wholesale nfl, north face outlet, louis vuitton online store, ralph lauren outlet, ralph lauren polo outlet, toms outlet store, new york, Ralph lauren men, north face outlet, ralph lauren coupon, cheap nfl jersey, cheap toms, north face outlet, louis vuitton outlet online, louis vuitton outlet, toms on sale, wholesale jerseys nfl, ralph lauren outlets, north face outlet, ralph lauren clothes, toms outlet online, polo shirts for women, iphone cases for 5, abercrombie outlet, Hollister Online Shop, jordan 11, ralph lauren polo women, Cheap North Face, Hollister Jeans, tiffany wedding rings, mens ralph lauren, tiffany rings, tiffany lamps, outlet polo ralph lauren, toms outlet, ralph lauren for code, Ralph Polo, Seattle Seahawks outlet, Seattle Seahawks jersey, gucci outlet store, ralph lauren pony, polo shirts ralph lauren, gucci outlet, north face outlet, tiffany alvord, hollister california, michael kors outlet, louis vuitton outlet store, north face outlet, toms promo code, iphone cases for 5C, ralph lauren promo code, louis vuitton online, wholesale toms shoes, jordan outlet, north face outlet, ralph lauren outlet, north face denali, toms outlet, gucci outlet online, ralph lauren outlet online, iphone 5C cases, cheap ralph lauren polo, ralph lauren outlet, louis vuitton Mini, ralph lauren coupon, iphone cases 5, ralph outlet, nfl store, north face outlet, toms shoes online, polo sale, nfl shop, toms outlet, ugg outlet, ralph lauren t shirt, wedding jewelry, iphone cases, iphone cases, shop Ralph lauren, toms outlet, ralph outlet, north face outlet, ralph lauren cheap, toms on sale, nfl jersey, toms outlet, iphone cases 5, ralph outlet, toms shoes outlet, north face outlet, north face outlet, toms outlet, louis vuitton Damier, ralph lauren shop, north face sale, women polo shirts, uggs outlet, north face outlet, iphone cases 5S, toms coupon codes, Hollister Outlet, Tiffany co Bangles, jordan 4, ralph lauren black, nfl outlet, michael kors store, michael kors outlet, polo lauren outlet, michael kors outlet, tiffany outlet, iphone cases 5C, wholesale toms, iphone 4 cases, the north face outlet, toms wholesale, iphone 5 cases, tiffany outlet, clothing ralph lauren, ralph lauren outlet, louis vuitton Monogram, polo shirts for men, ralph lauren factory store, north face outlet, ralph lauren online, north face outlet, louis vuitton outlet, polo ralph lauren store, Ralph Lauren Outlet, polo online, north face outlet, louis vuitton Monogram, cheap ralph polo, tiffany engagement rings, michael kors online, polo shirts men, ralph lauren store, louis vuitton outlet online, north face for sale, nfl jersey sale, juicy couture outlet, tiffany jewelry, polo ralph lauren outlet, Ralph lauren women, ralph lauren for cheap, iphone cases 5S, iphone 5S cases, silver jewelry, ralph polo, louis vuitton Leather bags, polo outlet, ralph lauren outlet, iphone 5 cases, tiffany outlet, iphone 5 cases, gucci outlet, jordan 6, polo store, juicy couture outlet, polo lauren, uggs on sale, ralph lauren coupon code, Ralph Lauren Outlet, north face outlet, polo ralph lauren men, ralph polo, nfl jerseys, ralph lauren polo shirts, north face sale, iphone 5C cases, Hollister Clothing, ralph lauren home, iphone 5S cases, iphone cases for 5C, ralph lauren outlet, tiffany outlet, polo outlet online, louis vuitton store, Seattle Seahawks sale, buy nfl jersey, the north face outlet, north face outlet, iphone cases for 5, ugg boots on sale, Seattle Seahawks online, blue ralph lauren, toms online store, iphone cases 5C, iphone cases for 5S, north face outlet, north face outlet, wholesale nfl jerseys, toms outlet, tiffany necklace
Posted @ Wednesday, October 15, 2014 12:45 AM by asd123
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics