viewvc – serve current directory in web interface.

Here is the description of viewvc:

ViewVC is a browser interface for CVS and Subversion version control
repositories. It generates templatized HTML to present navigable directory,
revision, and change log listings. It can display specific versions of files
as well as diffs between those versions. Basically, ViewVC provides the bulk
of the report-like functionality you expect out of your version control tool,
but much more prettily than the average textual command-line program output.

and to install, just execute:

sudo yum install viewvc

And when you want to serve the current directory in the web browser, you just need to execute the following command in that directory:

/usr/lib/python2.7/site-packages/viewvc/bin/standalone.py -r $PWD

 

Enhanced by Zemanta

meld – cvs diff with ease

Visualization of the "history tree" ...
Visualization of the “history tree” of a revision controlled project, showing branching, merging, tagging, etc. (Photo credit: Wikipedia)

There are couple of ways to make life easier with CVS diff. But here is one that is really good.
First if you haven’t, install meld:

sudo yum install meld

meld is basically a diff viewer and pretty good at it 😉

Now open meld from the menu or from the terminal. And then select New. In the dialog box that appears select “Version Control Browser”. In the Directory box, browse to the folder where you have the code checked out and select ok. And you are all set.

To see the diff with cvs version just double click.

Note: If you are getting issues when you double click, ensure that you do not have any commands for diff in .cvsrc file.

There are other ways of doing this, but thats for some other day.

Enhanced by Zemanta

Backup of files in the directory.

I was working on some scripts and the changes that I was making in the scripts was very dynamic, which I did want to keep backing up in the version control system. But for the peace of my mind, I wanted to keep a copy of the scripts, whenever it was in working state.

Since I had multiple files, so it would make more sense to have a script that could copy all the files in the current directory to “old” directory without over-writing the existing files. So, I wrote a script that would postfix the files with a number. With this approach, finally what I had was the following:

#!/bin/bash -
#===============================================================================
#
#          FILE:  backup.sh
#
#         USAGE:  ./backup.sh
#
#   DESCRIPTION:  Backup all the current files.
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: Amit Agarwal (aka), amit.agarwal@roamware.com
#       COMPANY:
#       CREATED: 08/19/2011 02:43:32 PM IST
#      REVISION:  ---
#===============================================================================

count=$(cat old/count)
if [[ ! -f old/count ]]
then
  count=$(ls -1 old |sed 's/.*\.//'|grep -vi "[a-z]"|sort|tail -1)
fi
((count++))
echo $count >old/count
[[ ! -d old ]] && mkdir old
for i in *
do
	[[ -f $i ]] && cp $i old/${i%%.*}.$count
done
echo "Backed up to $count"
Enhanced by Zemanta