MESSAGE
DATE | 2002-10-12 |
FROM | Ruben Safir
|
SUBJECT | Subject: [hangout] Ari Jort article for journal
|
The Use of CVS on Free Operating Systems
as presented by Ari Jort NYLXS In Service Presentation: September 2002
Why CVS; Why is it important to discuss CVS Usage?
CVS is the most commonly used Revision Control Software used with Free Software today. With an eye towards collaberation, CVS allows multiples of developers to work on and maintain software and documents. CVS allows developers world wide to work on the same project and is key to leveraging the internet as a tool for remote developement.
CVS is most useful for Free Software Projects which have programmers on several remote locations. Under this condition, an easy way to merge multiple changes and patches for whole developement trees becomes paramont for developing a usable program and code base. In addition, CVS becomes a primary distribution mechanism for end users to get updates and new fixes for their programs and code.
CVS is underutilized for a number of reasons. CVS takes a small learning curve to use correctly, and often developers don't take the time to learn it's proper use. In addition, many projects are started without the intent for collaberation, only later needing to play catch-up. More to the point, developers don't always make for good project managers, and often overlook the importance of version control.
What are the basic building blocks to CVS?:
Repository and Working Environments:
CVS has a client server model. Although CVS was not originally developed with a client server model, it has grown to be dependent on this ability. Unfortunately, the model is not implemented well, as can be by the source code and the interface. Never the less, despite its shortcomings, CVS has proven to be useful and vital. Much of CVS is inhereted from RCS. While we will not discuss RCS, we might note that RCS allows for file versioning, logging and patching of files.
A CVS repository is a location on a computer where all versions of all the files to a project exist, including the logs of all the changes to the files.
A CVS working environment is a snap shot of a CVS repository version, with possible alterations, on either a remote workstation or in another location on the computer which holds the repository.
When work is finished on the Working environment, it is sent back to the repository. Working environments and Repositories can interact in a number of ways. An 'update' for example, is a call to the repository for just patches. Branching is creating a space where work is done from the main line of developement. Mergers join together new work to a branch or the main deleopement line.
Every Branch has a version number. By default a version starts with 1.1 on check in. This versioning system gives us a major and minor number. For example the version number 1.12 would be a branch. If we create a new branch, we would get version 1.12.1.1. The 1.12.1 consists of the new branch and 1.12 is the trunk. The last .1 is the increment.
CVS also has the very useful facility called tags. Tags allow you to create a selectable label for sets of files and versions. By convention, tags use all capital letters for their easy identification. The default tag is HEAD.
Creating a CVS Environment:
There is 3 steps to creating a CVS environment:
A - Create an iniital CVS Root Path:
Create a directory for your CVS repository. Traditionally this is called CVS root.
su mkdir /usr/local/cvsroot chmod 777 /usr/local/cvsroot
It is important for this path to be defined in the environmental variables of your shell. You can do this in ~/.bashrc or ./.profile with the bash shell.
Add the following line in your startup script:
export CVSROOT=/usr/local/cvsroot
change to the root user and create your CVSROOT directory:
Not run the cvs init command:
cvs init
or
cvs init -d /path/to/cvsroot
if you wish to not use the CVSROOT environmental variable.
B- Populate the repository
Before Populating your repository, make sure your shell environment is correct:
CVSROOT should be set to the proper path. If remote access is desired, make sure CVSROOT_RSH is set to ssh for secure communications:
CVSROOT_RSH=ssh
Server roots can be remote:
CVSROOT = www.nylxs.com:/usr/local/cvsroot l environment is correct:
CVSROOT should be set to the proper path. If remote access is desired, make sure CVSROOT_RSH is set to ssh for secure communications:
CVSROOT_RSH=ssh
Server roots can be remote:
CVSROOT = user-at-www.nylxs.com:/usr/local/cvsroot
Now you can populate your repository by using the cvs import command. for example: In a source code tree of /home/user/backup_prog/ we run the command:
cvs -t import BACKUP enterprise 'R&M' 'GTK_BACKUP'
This imports the BACKUP repository with the 'R&M' venodr tag and 'GTK_BACKUP' relese tag. All the files in /home/user/back_prog/ are imported into the repository directory.
Once your environment is set, you need to go to the directory where the files you want moved into the repository are located.
Now we are ready to create a working copy of the CVS repository. This working copy is the backbone of your working environment:
$: mkdir ~/src/project $: cd ~/src/project $: cvs -t co BACKUP
Now check out your new source code tree.
$: cd ./BACKUP/ $: ls CVS backprog.c errors rmbackup tarlib.c Makefile backprog.h main rmbackup.c tarlib.h
Once you have your source code tree, it might be necessary from time to time to update the source code from the repository. Remember that several people can be working on the code simutaneously. bug fixes and security updates are common. If you use 'update', you only get patches.
$cvs -t update enterprise:ruben:backprog2: $ cvs -t update -> main loop with CVSROOT=/usr/local/cvsroot cvs update: Updating BACKUP -> rename(backprog.c,CVS/,,backprog.c) -> checkout (/usr/local/cvsroot/BACKUP/backprog.c,v, 1.2, , backprog.c) -> chmod(backprog.c,100664) -> Register(backprog.c, 1.2, Wed Oct 9 20:11:31 2002, , ) -> fopen(/usr/local/cvsroot/CVSROOT/history,a) U BACKUP/backprog.c -> unlink_file_dir(CVS/,,backprog.c) -> rename(CVS/Entries.Backup,CVS/Entries) -> unlink_file(CVS/Entries.Log)
This added a patch to backprog.c from the repository.
While a checkout brings files from the repository to your work area, the commit command places your changes into the repository. You can commit a single file, or a whole environment. Let's first change a file in our source tree.
$: vim ./backprog.c
#include #include #include "backprog.h" #include "tarlib.h"
/* This makes Toggles */ /* This is our change to CVS - maketoggles make toggle buttons for our */ / * application */
struct s1 maketoggles(){ static struct s1 handle; GtkWidget *button; GtkWidget *vbox; GtkWidget *label;
vbox = gtk_vbox_new(TRUE, 0);
label = gtk_label_new("Choose an Option");
gtk_widget_show(label);
...
:wq
$: cvs -t commit Added some useful documentation
CVS: ---------------------------------------------------------------------- CVS: Enter Log. Lines beginning with `CVS:' are removed automatically CVS: CVS: Committing in . CVS: CVS: Modified Files: CVS: backprog.c CVS: ---------------------------------------------------------------------- ~ ~
$: cvs -t commit -> main loop with CVSROOT=/usr/local/cvsroot cvs commit: Examining . -> checkout (/usr/local/cvsroot/BACKUP/backprog.c,v, 1.2, , (function)) -> ParseInfo(/usr/local/cvsroot/CVSROOT/commitinfo, BACKUP, ALL) -> ParseInfo(/usr/local/cvsroot/CVSROOT/rcsinfo, BACKUP, ALL) -> ParseInfo(/usr/local/cvsroot/CVSROOT/editinfo, BACKUP, not ALL) -> system('vi' '/tmp/cvszhcteG') -> unlink_file(/tmp/cvszhcteG) -> ParseInfo(/usr/local/cvsroot/CVSROOT/verifymsg, BACKUP, not ALL) -> unlink_file(/tmp/cvsqFJWwf) Checking in backprog.c; /usr/local/cvsroot/BACKUP/backprog.c,v <-- backprog.c -> checkout (/usr/local/cvsroot/BACKUP/backprog.c,v, 1.2, -ko, /tmp/cvsvG5tAQ) new revision: 1.3; previous revision: 1.2 -> rename(/usr/local/cvsroot/BACKUP/,backprog.c,,/usr/local/cvsroot/BACKUP/backprog.c,v) -> unlink_file(/tmp/cvsvG5tAQ) -> unlink_file(/tmp/cvsOwAEzr) done -> checkout (/usr/local/cvsroot/BACKUP/backprog.c,v, , , (function)) -> Register(backprog.c, 1.3, Wed Oct 9 20:24:56 2002, , ) -> fopen(/usr/local/cvsroot/CVSROOT/history,a) -> unlink_file(CVS/Base/backprog.c) -> ParseInfo(/usr/local/cvsroot/CVSROOT/loginfo, BACKUP, ALL) -> rename(CVS/Entries.Backup,CVS/Entries) -> unlink_file(CVS/Entries.Log)
Now we can check the status of our updated repository:
$: cvs status ....
=================================================================== File: backprog.c Status: Up-to-date
Working revision: 1.3 Wed Oct 9 20:26:29 2002 Repository revision: 1.3 /usr/local/cvsroot/BACKUP/backprog.c,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none)
=================================================================== File: backprog.h Status: Up-to-date
Working revision: 1.1.1.1 Wed Oct 9 15:23:24 2002 Repository revision: 1.1.1.1 /usr/local/cvsroot/BACKUP/backprog.h,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none)
=================================================================== ....
Or we can review the log of changes to the repository.
RCS file: /usr/local/cvsroot/BACKUP/Makefile,v Working file: Makefile head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:23; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:23; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/backprog.c,v Working file: backprog.c head: 1.3 branch: locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 4; selected revisions: 4 description: ---------------------------- revision 1.3 date: 2002/10/09 20:26:29; author: ruben; state: Exp; lines: +3 -1 Added some useful documentation ---------------------------- revision 1.2 date: 2002/10/09 20:09:59; author: ruben; state: Exp; lines: +1 -1 Add some comments to backprog.c ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/backprog.h,v Working file: backprog.h head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/errors,v Working file: errors head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/main,v Working file: main head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/rmbackup,v Working file: rmbackup head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/rmbackup.c,v Working file: rmbackup.c head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/tarlib.c,v Working file: tarlib.c head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/tarlib.h,v Working file: tarlib.h head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/Makefile,v Working file: BACKUP/Makefile head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:23; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:23; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/backprog.c,v Working file: BACKUP/backprog.c head: 1.3 branch: locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 4; selected revisions: 4 description: ---------------------------- revision 1.3 date: 2002/10/09 20:26:29; author: ruben; state: Exp; lines: +3 -1 Added some useful documentation ---------------------------- revision 1.2 date: 2002/10/09 20:09:59; author: ruben; state: Exp; lines: +1 -1 Add some comments to backprog.c ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/backprog.h,v Working file: BACKUP/backprog.h head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/errors,v Working file: BACKUP/errors head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/main,v Working file: BACKUP/main head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/rmbackup,v Working file: BACKUP/rmbackup head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/rmbackup.c,v Working file: BACKUP/rmbackup.c head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/tarlib.c,v Working file: BACKUP/tarlib.c head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
=============================================================================
RCS file: /usr/local/cvsroot/BACKUP/tarlib.h,v Working file: BACKUP/tarlib.h head: 1.1 branch: 1.1.1 locks: strict access list: symbolic names: GTK_BACKUP: 1.1.1.1 R&M: 1.1.1.1 enterprise: 1.1.1 keyword substitution: kv total revisions: 2; selected revisions: 2 description: ---------------------------- revision 1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; branches: 1.1.1; Initial revision ---------------------------- revision 1.1.1.1 date: 2002/10/09 15:23:24; author: ruben; state: Exp; lines: +0 -0 This is the Rosenzweig and Maffia Backup Program
.....
Branches and Mergers:
A Branch is a space where work is done off the main line of deveolopement
A Merge is done to combine the changes of a branch to the main trunck or another branch of developement.
Each repository asset has a revision number. By default, the main trunk is called 1.1
Each entry into a repository is assigned a version number. The default number is 1.1 As new revisions to a file is added, the first number remains the same and the second number is increased. The first number its the trunk, the second number (or minor number) is the revision of the trunk. As one branched, more digits are added to the revision number, depending upon where the branch was split off the main developement path.
Keep in mind that each file has a revision number asigned to it by CVS. If you add a new file, it starts with the highest revision number which the branch your adding to has. So if one file in your project has a revision number 1.17, then, then a new file would start fresh with the revision number 1.17. A '-r' option to the commit command updates the revision number to the expressed revision number given as an argument on the command line. For example:
$: cvs commit -r 2.0
Fresh Revision of the Backup Program into the repository.
CVS: ---------------------------------------------------------------------- CVS: Enter Log. Lines beginning with `CVS:' are removed automatically CVS: CVS: Committing in BACKUP CVS: CVS: Modified Files: CVS: Tag: 2.0 CVS: Makefile backprog.c backprog.h errors main rmbackup rmbackup.c CVS: tarlib.c tarlib.h CVS: ---------------------------------------------------------------------- ~ ~ $: cvs status cvs status: Examining BACKUP =================================================================== File: Makefile Status: Up-to-date
Working revision: 2.0 Wed Oct 9 15:23:23 2002 Repository revision: 2.0 /usr/local/cvsroot/BACKUP/Makefile,v Sticky Tag: 2.0 Sticky Date: (none) Sticky Options: (none)
=================================================================== File: backprog.c Status: Up-to-date
Working revision: 2.0 Wed Oct 9 20:24:56 2002 Repository revision: 2.0 /usr/local/cvsroot/BACKUP/backprog.c,v Sticky Tag: 2.0 Sticky Date: (none) Sticky Options: (none)
=================================================================== File: backprog.h Status: Up-to-date
Working revision: 2.0 Wed Oct 9 15:23:24 2002 Repository revision: 2.0 /usr/local/cvsroot/BACKUP/backprog.h,v Sticky Tag: 2.0 Sticky Date: (none) Sticky Options: (none)
=================================================================== File: errors Status: Up-to-date
Working revision: 2.0 Wed Oct 9 15:23:24 2002 Repository revision: 2.0 /usr/local/cvsroot/BACKUP/errors,v Sticky Tag: 2.0 Sticky Date: (none) Sticky Options: (none)
...
While reivsions are important, they may not adequately describe the release of a project well, or make an adequate description of the entirity of a project. It is therefor preferable to work with tags when describing a whole project.
When working with different branches, it comes to a point where one needs to merge one branch into a main tree. Under this condition you can merge the branches with the 'update -j' command to CVS. This effects your working copy of the repository. We will look at an example of this after looking at TAGS.
TAGS Tags are a selectable label for a set of files and versions. Tags are generally all CAPITAL letters out of convention.
$: cvs tag BACKPROG-1_0 ./BACKUP/ cvs tag: Tagging ./BACKUP/ T ./BACKUP//Makefile T ./BACKUP//backprog.c T ./BACKUP//backprog.h T ./BACKUP//errors T ./BACKUP//main T ./BACKUP//rmbackup T ./BACKUP//rmbackup.c T ./BACKUP//tarlib.c T ./BACKUP//tarlib.h
Now you can checkup this revision by it's tag, including all it's files:
$: cvs checkout -r BACKPROG-1_0 BACKUP cvs checkout: Updating BACKUP U BACKUP/Makefile U BACKUP/backprog.c U BACKUP/backprog.h U BACKUP/errors U BACKUP/main U BACKUP/rmbackup U BACKUP/rmbackup.c U BACKUP/tarlib.c U BACKUP/tarlib.h
Now let's create a new branch which adds a search to our program. Create a few source code file for the program in your working directory. And then create a new branck
$: vi seach.c
Creat out Branch
$: cvs rtag -b -r BACKPROG-1_0 BACKPROG-1_0-branch BACKUP Add our new file to the working version of the branch
:$ cvs add serach.c
Commit the Branch to the repository: cvs -t commit -r BACKPROG-1_0-branch
:$ cvs status serach.c =================================================================== File: serach.c Status: Up-to-date
Working revision: 1.1.2.2 Sat Oct 12 21:30:13 2002 Repository revision: 1.1.2.2 /usr/local/cvsroot/BACKUP/Attic/serach.c,v Sticky Tag: BACKPROG-1_0-branch (branch: 1.1.2) Sticky Date: (none) Sticky Options: (none)
Now that our changes are commited to the repoitories branch. We can merge the branch with update and -j like this:
:$ cvs update -j BACKPROG-1_0-branch cvs update: Updating BACKUP
:$ cvs commit -m 'MERGED BRANCH' -m adds the log entry.
We now have merged the branch to the trunk. Run status to see.
____________________________ New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless....
|
|