How CVS will help to Realtime Developers ?

how-cvs-will-help-to-realtime-developers

CVS Tips & Tricks

The CVS commands here assume that you are using the command line version of CVS. Tips and tricks for a specific CVS GUI are specific to each GUI and do not really belong here.

Viewing the commit log of a file.

$ cvs log filename

Show current status of a file.

The status command will show you the latest version, the version in your working directory and if your local copy has been modified.

$ cvs status filename

Performing a CVS diff

After developers have checked in updates to the code it may be beneficial to see what has changed, either to help solve bugs or to track changes. There are several option to do this.

  1. Perform a diff between complete branches:
$ cvs -q diff -u -r BRANCH1 -r BRANCH2
  1. Perform a diff between a single file in two branches:
$ cvs -q diff -u -r BRANCH1 -r BRANCH2 filename
  1. Perform a diff between different versions of a file:
$ cvs -q diff -u -r version1 -r version2 filename
  1. Perform a diff between working version and most up to date file in database:
$ cvs -q diff -u filename
  1. Perform a diff between working version and a specific database version:
$ cvs -q diff -u -r version filename

Retrieving CVS Information on Files

To retrieve the current version and other relevant information about a file run:

$ cvs status filename

To retrieve the entire change log pertaining to a file run:

$ cvs log filename

Retrieving CVS Files Based Upon Revision

To retrieve a file from CVS based upon a revision number perform the following:

$ cvs -q up -Pd -r revision filename
  • To get the revision number use the log command above

Tag file in CVS as a Release

To tag files in CVS as a release perform the following:

$ cvs tag
  • Run the command from within the release source dir.

Creating a Branch

I like to do the following before creating a branch:

See what tags are available and pick one.

$ cvs -q log filename

Revert to a tagged version of HEAD.

$ cvs -q up -r TAG_Version

To create a branch in CVS perform the following:

$ cvs tag -b

Run the command from within the release source dir. This should be done in the top level directory of the project. The chosen_branch is something like BRANCH_36_BUG_.

cvs -q up -r
$ cvs -q status <– confirm that the branch has specified as the tag
$ cvs tag _mm_day_year <– eg: BRANCH_12_BUG_12345_07_17_2009

Reverting to a Branch

To revert to a branch in CVS perform the following:

$ cvs -q up –r
  • Run the command from within the release source dir. This should be done in the top level directory of the project. The chosen_branch is something like BRANCH_BUG_.

Verifying you are in a branch

To verify you are in a branch

$ cvs -q status

You will see that the branch is a sticky tag.

Merge Current Branch with HEAD

Ensure that you are in the branch by reverting to the branch and Verifying that you are in the branch.

$ cvs update -j

This will ensure that you are your branch is getting merged properly with HEAD so the only differences you see between your branch and the are changes that you made. You can verify this from your branch with:

$ cvs -q diff -u -r | less

You will eventually have to commit your changes you should always do a tag on the branch after your commit.

$ cvs tag

Merge HEAD into Current Branch Multiple Times (with tags) and without -kk option

$ cvs update -j -j

This command will unfortunenately result in a lot of your ID tags getting changed at the top. Using the –kk option will avoid this problem. But then you won’t see which files have changed and You won’t know who last modified a file easily. After you run this command I recommend:

$ vim `cvs up -d | grep '^C' | sed -e 's/^C //'`

You may find the following page interesting as well: http://kb.wisc.edu/middleware/page.php?id=4087

This will grab all of the conflicting files. You can save them with :w. And step through them with :bn. You can easily close them all with :wq!.

Merge HEAD into Current Branch Multiple Times (with tags)

To merge current HEAD into a branch that has already had HEAD merged into it once, the differences between that last merge and current HEAD need to be gathered and applied to the branch. This is done by finding out when the last time HEAD was merged with the branch. Hopefully you tagged your branch. Repeat steps 1 and 2 from the previous section to create a tag for HEAD and to create a tag for your branch so you can have a backup/reference point. Then, perform the following if you have tagged the branch when merging the last time:

$ cvs update -kk -j -j
  • Run the command from within the branched version. is the old tag in HEAD from the last time you merged (the tag that you created in Step one from the previous section). If you in this case, the format will likely be the following:
$ cvs update -kk -j UPDATE_HEAD_36_BUG__06_16_2008 -j UPDATE_HEAD_36_BUG__07_23_2008

The first tag is the one created the last time HEAD was merged into the branch. The second tag is one that should have been just created. This will take all the differences between the two tags, and bring them into the branch. The next time a merge from HEAD into the branch occurs, this latest tag will be the “old” tag, and the new tag will be created at the time of the merge.

The reason for tagging the branch before a join/merge like this is to create a reference point to revert to if the need ever arises. The -kk option removes rcsid tags so that the cvs tag at the top doesn’t get flagged as a conflict on every merge/join.

Merge HEAD into Current Branch Multiple Times (without tags)

If no tags have been created for the branch when HEAD was merged into a branch at a previous time, an alternative is to use the daily build tag. Find the commit message of the last time HEAD was merged into the branch and was committed and select the daily build tag the day BEFORE that one (but only if the commit was before the daily build that day, i.e. before lunch time for GMT -06:00). An example is provided below on how to merge without tagging:

$ cvs update -kk -j Tag_Branch -j HEAD>

Run the command from within the branched version.

———————————-
To Avoide network confusion :-

use :- alias cvs=`cvs -z9`

causes cvs to use compression level 6.

Good links for it:-

  • http://datagrams.blogspot.com/2009/01/how-to-deploy-cvs-concurrent-versions.html
  • http://kb.wisc.edu/middleware/page.php?id=4087
  • http://ximbiot.com/cvs/manual/cvs-1.11.21/cvs_10.html#SEC85
  • http://ximbiot.com/cvs/wiki/Special/Index
  • More Help!!

Refer for more on This:-

          Click Me!!

Thanks,

-Amaresh Das

Tagged : / / / / / / / / / / / /

What are the Best Practices of CVS?

cvs-best-practices

CVS Best Practices

 

These are list of CVS Best Practices:

* Don’t share workspaces

Sharing workspaces compromises CVS’s ability to track activity by user or task.

* Don’t work outside of managed workspaces

CVS can only track work in progress when it takes place within managed workspaces. Never copy files from others sandboxes or even from outside your sandbox since you may overwrite somebody else’s code.

* Don’t use jello views

A file in your workspace should not change unless you explicitly cause the change. A “jello view” is a workspace where file changes are caused by external events beyond your control e.g. workspace built upon a tree of symbolic links to files in another workspace.

* Stay in sync with the codeline

The quality of your work depends largely on how well it meshes with others work. In other words, as changes are checked into the codeline, you should update your workspace and integrate those changes with yours. Update your code at least once in the morning daily.

* Checkin code daily

Integrating your development work with other peoples’ work also requires you to check in your changes regularly. Don’t keep your new code lying in your workspace for many days at a time. This may lead to many conflicts at a later stage when you try to merge.

* Never check in without compiling and testing your code

* Always update your modules/ files and resolve any conflicts before committing

* After committing changes, diff with previous version to make sure you did not accidentally overwrite anybody else’s code

* If you overwrite somebody else’s code, rollback

* Always communicate any changes you commit, to all those concerned with the module/ file that was changed

* Always add comments when committing changes

Good and meaningful comments make it easy for others to know exactly what was changed. For e.g. if it’s a bug fix it should have a Bug Number.

* Add whitespaces with discretion

Changes to whitespaces cause unnecessary updates to happen and may show conflicts during merges

Tagged : / / / / / / / / / / / / / / /

CVS Best Practices – List of CVS Best Practices – CVS Tips

cvs-best-practices

CVS Best Practices

These are list of CVS Best Practices:

* Don’t share workspaces

Sharing workspaces compromises CVS’s ability to track activity by user or task.

* Don’t work outside of managed workspaces

CVS can only track work in progress when it takes place within managed workspaces. Never copy files from others sandboxes or even from outside your sandbox since you may overwrite somebody else’s code.

* Don’t use jello views

A file in your workspace should not change unless you explicitly cause the change. A “jello view” is a workspace where file changes are caused by external events beyond your control e.g. workspace built upon a tree of symbolic links to files in another workspace.

* Stay in sync with the codeline

The quality of your work depends largely on how well it meshes with others work. In other words, as changes are checked into the codeline, you should update your workspace and integrate those changes with yours. Update your code at least once in the morning daily.

* Checkin code daily

Integrating your development work with other peoples’ work also requires you to check in your changes regularly. Don’t keep your new code lying in your workspace for many days at a time. This may lead to many conflicts at a later stage when you try to merge.

* Never check in without compiling and testing your code

* Always update your modules/ files and resolve any conflicts before committing

* After committing changes, diff with previous version to make sure you did not accidentally overwrite anybody else’s code

* If you overwrite somebody else’s code, rollback

* Always communicate any changes you commit, to all those concerned with the module/ file that was changed

* Always add comments when committing changes

Good and meaningful comments make it easy for others to know exactly what was changed. For e.g. if it’s a bug fix it should have a Bug Number.

* Add whitespaces with discretion

Changes to whitespaces cause unnecessary updates to happen and may show conflicts during merges

Tagged : / / / / / / / / / / / / / /

Process to Install CollabNet SVN Command Line Client in Windows

install-collabnet-svn-command-line-client-in-windows

Link: http://www.collab.net/downloads/subversion/

1. Platform and configuration

   Product: CollabNet Subversion server

   Certified platforms: Windows XP SP2, Win 2003(Standard Edition) R2

   Apache version: 2.2.8

   ViewVC: 1.0.5 (requires ActiveState Python 2.5)

   Repository format: fsfs (bdb support not included)

   Prerequisite: The user needs administrative privileges to install

   and uninstall CollabNet Subversion.

2. IMPORTANT: Apache version upgraded from 2.0 to 2.2

   With the CollabNet Subversion 1.5.0 release, we have upgraded the included

   Apache server version from 2.0 to 2.2. This is consistent with the

   packages we provide for other operating systems, and also upgrades our

   package to the best available version of Apache.

   This is important to existing users because your current Apache 2.0 server

   configuration cannot be automatically updated to the format of the Apache

   2.2 configuration file. If you allow the installer to upgrade your existing

   installation, it backs up your Apache conf, logs, and htdocs folders so

   that you can refer to your previous configuration when configuring your new

   server.

3. Installation tips

     If you install an Apache server, the installer asks you for a

     “Repository URL.” This represents the prefix of the URL which users can

     use to connect to Subversion. If you set this URL to ‘/svn’, then users

     can checkout their repository from:

        http://hostname/svn/repos-name

     We recommend that you use ‘/svn’ as your URL prefix, as this is common

     practice.

4. ViewVC installation

   Users of the Apache web server option can now also have ViewVC automatically

   installed and configured as part of the installation. You must have

   ActiveState’s ActivePython 2.5 installed before installing CollabNet Subversion.

   Download a free version of ActivePython from:

   http://www.activestate.com/Products/activepython/index.mhtml

   You must install version 2.5.x.

5. Upgrade procedure

   When the installer detects a previous version, it offers to upgrade your existing

   installation. However, if you want to add ViewVC to your installation, we

   recommend you use the following process for an upgrade. In general, this is

   the best process for any upgrade scenario:

   1. Stop Apache or Subversion Server services, if running.

   2. Copy/back up any customizations that were done to your Apache installation.

     (For example, your httpd.conf file, a password database, any content you

      added to the htdocs folder, and so on.)

   3. Uninstall the currently installed version.

   4. Manually delete the existing folder if the installer did not remove it. The

      uninstall process does not remove files that were added or modified after

      installation.

   5. Follow the normal install instructions for 1.5.

   6. Manually put back your Apache customizations. NOTE:  You cannot simply copy

      back the previous configuration file. You must make the appropriate edits

      to your new Apache 2.2 version of the configuration file.

6. Post-installation instructions

   The installer created a folder to store your repositories. You are not required

   to use this folder, but if you let the installer install the server to run as a

   service, then the server has also been configured to serve repositories from this

   location. It is a good idea to use the location you specified in the installer.

   A. Using svnserve

      ==============

   To use svnserve as your server, follow these steps:

     1. Open a new terminal (command prompt).

        NOTE: If you have an old command prompt open (prior to the Subversion

              installation), remember to open a brand new command prompt.

     2. Create a subversion repository.

        cd <Repository_Path>

        svnadmin create <Repository_Name>

        For example:

        cd \repositories

        svnadmin create my-first-repos

     3. Setup a password database.

        Using notepad, edit the svnserve.conf file inside the conf directory of your

        repository.

        For example:

        If your repository is C:\repositories\my-first-repos

        svnserve.conf is:

        C:\repositories\my-first-repos\conf\svnserve.conf

        Inside svnserve.conf, you see the following information:

         ### The password-db option controls the location of the password

         ### database file.  Unless you specify a path starting with a /,

         ### the file’s location is relative to the conf directory.

         ### Uncomment the line below to use the default password file.

         #password-db = passwd

       Follow the above instructions, and uncomment the “password-db=passwd”

       line, so that it simply says:

          password-db = passwd

     4. Setup usernames and passwords.

       Next, edit the passwd file. This passwd file is located in the

       same directory as svnserve.conf.

       Inside the passwd file, you see the following information:

       ### This file is an example password file for svnserve.

       ### Its format is similar to that of svnserve.conf. As shown in the

       ### example below it contains one section labelled [users].

       ### The name and password for each user follow, one account per line.

       [users]

       #harry = harryssecret

       #sally = sallyssecret

       To add a new user account, add your own username and password

       inside the [users] section. For example, if your name is “joe”,

       and you want to set your password to “super-secret”, add a

       new line like this:

         joe = super-secret

       Add as many users as you like.

     5. Open Port on Windows firewall.

        Before starting the server, the firewall must be notified that

        this particular port is going to be used. To enable this port in the

        Windows firewall, follow the instructions found here:

    http://www.microsoft.com/windowsxp/using/security/internet/sp2_wfexceptions.mspx

        Note: svnserve.exe is the program name which needs to be added to the

        exceptions list. Alternatively, you can also use the port where

        you decide to run the server. By default, svnserve runs on 3690.

     6. Start svnserve.

        If you elected to have the installer setup svnserve as a service, then open

        the Services application, find the entry for the Subversion server, and take

        the Start option. The service has been configured to start automatically

        on reboot. You can also run this command from the command line:

        net start svnserve

        If you did not install svnserve as a service and want to start the server

        manually, run this command:

        svnserve -d -r <Repository_Path>

        For example: svnserve -d -r C:\repositories

     7. To provide read and write access to anonymous users, modify the

        conf/svnserve.conf file inside the repository.

        anon-access = write

        To restrict an anonymous user from the repository:

        anon-access = none

     8. Check out the repository.

        svn co svn://localhost/<Repository_Name>

        For example: svn co svn://localhost/my-first-repos

     Tip: If you check out your Subversion repository from a different computer,

     replace ‘localhost’ with the IP address or hostname of the machine which

     hosts the Subversion repository.

   B. Using Apache

      ============

   To use Apache as your server, follow these steps:

     1. Configure Apache.

        The installer did these steps automatically based on the repository location

        entered in the installer. This information is only presented if you want to

        manually modify the configuration.

        Use notepad to edit the httpd.conf file inside the httpd\conf directory of your

        CollabNet Subversion Server installation.

        Tip: By default, httpd.conf is in the following directory:

             C:\Program Files\CollabNet Subversion Server\httpd\conf\httpd.conf

        At the bottom of the httpd.conf file, you see a location directive that looks

        something like this:

          <Location /svn>

            DAV svn

            SVNParentPath C:\repositories

          </Location>

        Change the above section to look like the following:

          <Location /svn>

            DAV svn

            SVNParentPath C:\repositories

            SVNListParentPath On

            Require valid-user

            AuthType Basic

            AuthName “Subversion repository”

            AuthUserFile C:\repositories\password-file

          </Location>

     2. Open a new terminal (command prompt).

        NOTE: If you have an old command prompt open (prior to the Subversion

              installation), remember to open a new command prompt.

     3. Create Subversion users.

        Now create usernames with passwords that can be used to authenticate with

        Apache. Use the htpasswd command to create usernames and passwords for the

        Apache server.

        Type the following at the command prompt:

          htpasswd -cm <password-file> <username>

        This command prompts you for a password for the user. Enter the

        password and retype the password when prompted.

        For example: If you want to create a user ‘joe’, and the file at

        “C:\repositories\password-file”, type the following at the

         command prompt:

               htpasswd -cm C:\repositories\password-file joe

        Enter the desired password for the user and retype the password

        when prompted.

        For additional users, use the following command at the command prompt:

        htpasswd -m C:\repositories\password-file joe

     4. Create a Subversion repository.

        svnadmin create <Repository_Path>\<Repository_Name>

        For example: svnadmin create C:\repositories\my-first-repos

     5. Open Port on Windows firewall.

        Before starting the server, the firewall must be notified that

        this particular port is going to be used. To enable this port in the

        Windows firewall, follow the instructions found here:

    http://www.microsoft.com/windowsxp/using/security/internet/sp2_wfexceptions.mspx

        Note: apache.exe is the program name which you need add to the

        exceptions list. Alternatively, you can also use the port where

        you decide to run the server. By default, apache is run on 80.

     6. Start Apache.

        If you elected to have the installer set up Apache as a service, then open

        the Services application, find the entry for Apache/2, and take

        the Start option. The service was configured to start automatically

        on reboot. You can also run this command from the command line:

        net start apache2

        To start the server manually, run the following at the command prompt:

        apache

     7. Checkout the repository.

        svn co http://localhost/svn/<Repository_Name>

        For example: svn co http://localhost/svn/my-first-repos

        Tip: If you check out your Subversion repository from a different

        computer, replace ‘localhost’ with the IP address or hostname

        of the machine which hosts the Subversion repository.

7. Known issues

   When trying to access a repository via ViewVC, you might see an error

   trace that ends with this message:

      ImportError: DLL load failed with error code 182

   This error occurs when you have an older version of the OpenSSL DLLs in your

   PATH ahead of the CollabNet Subversion bin folder. Many Windows applications

   ship the OpenSSL DLLs and many of them also use older versions. To fix this

   problem:

      1. Edit your PATH so that the CollabNet Subversion bin folder is at or

         near the beginning of your PATH.

      2. Reboot so that your Apache service can pick up the change.

8. Back-end support

  If you try to access an existing BDB (Berkeley DB) based repository through

  CollabNet Subversion, then you might receive an alert “Failed to load module

  for FS type ‘bdb’.” This is because CollabNet Subversion does not support BDB.

  CollabNet recommends FSFS over BDB for ease of maintenance and supportability.

9. Support for CollabNet Subversion

   Find out about CollabNet Technical Support at

   http://www.collab.net/services/subversion/

   Information about CollabNet Training, Consulting, and Migration

   services is at http://www.collab.net/services/subversion/training.html

   Join openCollabNet for community support: http://open.collab.net

10 About Subversion and CollabNet

   CollabNet launched the Subversion project in 2000 in response to the demand

   for an open standard for Web-based software configuration management that

   could support distributed development. CollabNet continues to be strongly

   involved with the Subversion project and offers CollabNet Subversion Support,

   Training, and Consulting services.

   CollabNet also provides the most widely used collaborative development

   environment in the world. More than 1,400,000 developers and IT projects

   managers collaborate online through CollabNet. The company is transforming

   the way software is developed by enabling organizations to leverage global

   development talents to deliver better products and innovate faster.

   Visit CollabNet at http://www.collab.net for more information.

Tagged : / / / / / / / / / / / / / / / / / / /

How to Install CollabNet SVN Command Line Client in Solaris?

collabnet-svn-command-line

Link: http://www.collab.net/downloads/subversion/solaris.html

1. Platform and configuration

Product: CollabNet Subversion client

Platforms: Solaris 10 SPARC

Prerequisite: You must be a superuser (root) to install and uninstall

CollabNet Subversion.

2. Import/Update CollabNet certificate

CollabNet Subversion Solaris packages are signed. As a one-time task,

import the CollabNet certificate using the command:

    sudo pkgadm addcert -ty certificate.pem

The CollabNet certificate is available for download at:

http://www.collab.net/nonav/downloads/subversion/certificate/certificate.pem

NOTE: the certificate has changed between 1.5.0 and 1.5.1 release.  The

certificate used for 1.5.0 had a short expiration date so we have created

a new certificate.  If you have previously installed the 1.5.0 certificate,

you must remove it before installing the new one:

    sudo pkgadm removecert “Alexander Thomas(AT)”

Once it is removed you can install the new certificate.

3. First installation

The command to install the CollabNet Subversion client, if a previous version

has not already been installed, is:

    sudo pkgadd -d /path/to/client-sparc-local

4. Updating an existing installation

The proper way to update a Solaris package is to remove the current version

and then install the new version.  If you have the CollabNet Subversion server

installed, you will need to remove it first.  Again, refer to the readme for

that package before proceeding.

    sudo pkgrm CSVNclnt

    sudo pkgadd -d /path/to/client-sparc-local

5. Post-installation instructions

A. CollabNet Subversion installs into /opt/CollabNet_Subversion, which is

   probably not on the executable search path for your system. Add the directory

   /opt/CollabNet_Subversion/bin to your $PATH environment variable. In order to

   make this change affect all users of your system and persists across reboots,

   add the following line to /etc/profile:

    PATH=/opt/CollabNet_Subversion/bin:$PATH

B. CollabNet Subversion provides man pages and localizations for several

   languages. To take advantage of these features, update your MANPATH and/or

   LOCPATH environment variables to include the CollabNet Subversion directories.

   For example:

    export MANPATH=/opt/CollabNet_Subversion/share/man:$MANPATH

    export LOCPATH=/opt/CollabNet_Subversion/share/locale:$LOCPATH

6. Support for CollabNet Subversion

Find out about CollabNet Technical Support at

http://www.collab.net/services/subversion/

Information about CollabNet Training, Consulting, and Migration

services is at http://www.collab.net/services/subversion/training.html

Join openCollabNet for community support: http://open.collab.net

7. About Subversion and CollabNet

CollabNet launched the Subversion project in 2000 in response to the demand

for an open standard for Web-based software configuration management that

could support distributed development. CollabNet continues to be strongly

involved with the Subversion project and offers CollabNet Subversion Support,

Training, and Consulting services.

CollabNet also provides the most widely used collaborative development

environment in the world. More than 1,400,000 developers and IT projects

managers collaborate online through CollabNet. The company is transforming

the way software is developed by enabling organizations to leverage global

development talents to deliver better products and innovate faster.

Visit CollabNet at http://www.collab.net for more information

Tagged : / / / / / / / / / / / / / / / / / / / / /