using source code control effectively

23
Using Source Code Control Effectively Gang Cheng [email protected]

Upload: dima

Post on 23-Feb-2016

87 views

Category:

Documents


0 download

DESCRIPTION

Using Source Code Control Effectively. Gang Cheng [email protected]. Why?. Why we need source code control? Keep track of code changes Prevent code loss Retrieve older versions of software that customers are currently using to examine problems they are having. Three Levels. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Using Source Code Control Effectively

Using Source Code Control Effectively

Gang [email protected]

Page 2: Using Source Code Control Effectively

Why?

Why we need source code control?– Keep track of code changes– Prevent code loss– Retrieve older versions of software

that customers are currently using to examine problems they are having

Page 3: Using Source Code Control Effectively

Three Levels

Level 1: Opening Your Eyes Level 2: The SCC Journeyman Level 3: Experts Only

Page 4: Using Source Code Control Effectively

Level 1

Opening Your Eyes– Create: creates a new area in the repository– Add: adds a file to the repository– Get: gets the current version of a file from

the repository– Checkout: works on a particular file actively– Undo Checkout: throws away any changes

and unlocks the file– Checkin: puts the current version of the file

back to the repository

Page 5: Using Source Code Control Effectively

Level 2

The SCC Journeyman– Label: assigns a name to a specific version

of a file– Share: allows a file to appear in more than

one project– Branch: lets development diverge– Merge: takes changes from one branch and

applies them to another branch

Page 6: Using Source Code Control Effectively

Level 3

Experts Only– Cloak: hides a project in the repository– Delete: removes a file from the repository– Move: relocates a file or subproject to a new

parent project– Pin: freezes a shared file at a particular

version– Rename: rename a file or project– Rollback: reverts a file to an earlier version

Page 7: Using Source Code Control Effectively

SCC Alternatives

Some Representative SCC– AccuRev www.accurev.com– BitKeeper www.bitkeeper.com– ClearCase www.rational.com/products/clearcase– CVS www.cvshome.org– Perforce www.perforce.com– StarTeam www.borland.com/starteam/– Subversion http://subversion.tigris.org/– Vault www.sourcegear.com/vault/index.asp– Visual Source Safe http://msdn.microsoft.com/ssafe

Page 8: Using Source Code Control Effectively

Choose?

Price Concurrent Development Style

– Checkout/edit/checkin (VSS)– Edit/merge/commit (CVS)

The repository Internet Friendliness IDE Integration Advanced Commands Cross-Platform Support

Page 9: Using Source Code Control Effectively

Discussion

SCC Etiquette– Work with as few files as possible at one time– Two styles compare

Proper use of Label (Tags)– Easy to remember and find– At significant points

Branching Discipline– When different developers in the same project

follows different rules– Create only when needed– Handles branching by actually creating branches

Miscellaneous Rules– Use the integration– Chapter 9 “Tracking and Squashing Bugs”

Page 10: Using Source Code Control Effectively

SCC Checklist

Use it Use command efficiently Choose your SCC Place all dev. Artifacts to SCC Checkout only when you need it Comment changes when checkin Label at significant points Create a branch whenever the rules

change Use SCC with bug tracking

Page 11: Using Source Code Control Effectively

CVS

General– CVS Homepage https://www.cvshome.org/– Introducton ppt

http://www.geocities.com/durairaj_77/wincvs.ppt– CVS Book http://cvsbook.red-bean.com/cvsbook.html– CVS Commmand http://www.cvsnt.org/wiki/CvsCommand

CVSNT (CVS Window Server)– CVSNT Homepage http://www.cvsnt.org– Installation Guide

http://w1.862.telia.com/~u86216121/InstallCVSNT.html WinCVS (CVS Window Client)

– WinCVS Homepage http://www.wincvs.org/index.html– Installation & Config Guide

http://www.cmcrossroads.com/ubbthreads/showflat.php?Cat=0&Number=31083&page=0&view=collapsed&sb=2&o=&fpart=1

Page 12: Using Source Code Control Effectively

CVS

RCS (Revision Control System)– By Walter Tichy, Purdue University– software tool for UNIX systems which lets people

work on system control– Reference

http://www.csc.calpoly.edu/~dbutler/tutorials/winter96/rcs/

SharpCVSLib (CVS Client Library)– A Client API for the CVS protocol, written in C#– SCVSLib Homepage

http://sharpcvslib.sourceforge.net/

Page 13: Using Source Code Control Effectively

CVS

CVSNT Running

Page 14: Using Source Code Control Effectively

CVS WinCVS Login

Page 15: Using Source Code Control Effectively

CVS WinCVS: User Gang Import module

Page 16: Using Source Code Control Effectively

CVS WinCVS: User Charlie checkout module

Page 17: Using Source Code Control Effectively

CVS WinCVS: User Charlie Edit a file

Page 18: Using Source Code Control Effectively

CVS WinCVS: User Charlie commits the file

Page 19: Using Source Code Control Effectively

CVS WinCVS: User Gang edits the same file,

commits his version and causes a conflict

Page 20: Using Source Code Control Effectively

CVS WinCVS: User Gang checks version tree

Page 21: Using Source Code Control Effectively

CVS WinCVS: User Gang retrieves the old version

Page 22: Using Source Code Control Effectively

RCS File head 1.3; access; symbols arelease:1.1.1.1 avendor:1.1.1; locks; strict; comment @# @;

1.3 date 2004.10.07.19.40.04;

author Gang; state Exp;

branches; next 1.2; deltatype text; permissions 644; commitid af041659b940c05; kopt kv; filename @Please read me.txt@;

1.2 date 2004.10.07.19.14.13;

author Charlie; state Exp;

branches; next 1.1; deltatype text; permissions 644; commitid d0416595847838; kopt kv; filename @Please read me.txt@;

……

Page 23: Using Source Code Control Effectively

End of Presentation