Revision Control Software Engineering SS 2007 Agenda Revision

  • Slides: 20
Download presentation
Revision Control Software Engineering SS 2007

Revision Control Software Engineering SS 2007

Agenda Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links

Agenda Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links Objectives - Use revision control system for collaboration

Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links

Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links

Motivation Usually several developers work on code Common problems: Who owns master version How

Motivation Usually several developers work on code Common problems: Who owns master version How to collect current version How to keep code changes consistent How to roll back bad code changes Which file versions form Release Candidate 3

Revision Control Main purpose Coordinate work from different contributors Other benefits Track changes Access

Revision Control Main purpose Coordinate work from different contributors Other benefits Track changes Access older versions Name specific set of versions Split work into different versions

Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links

Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links

Different flavours File locking Only one user can modify a file at any time

Different flavours File locking Only one user can modify a file at any time No conflicts, but dead-locks between contributors Example: Clear. Case Version merging All users can modify all files simultaneously Conflicts need to be resolved (merging) Examples: CVS, subversion

File locations Repository Directory or data base on server Contains all file versions and

File locations Repository Directory or data base on server Contains all file versions and information on versions Never manipulated manually Working copy Copy of (part of) repository on local disk Used to change and add files

Important operations Check-Out Copy all files from repository to local disk Commit (Check-In) Copy

Important operations Check-Out Copy all files from repository to local disk Commit (Check-In) Copy changes in working copy to repository Update Copy changes in repository to working copy Merge Resolve conflicts between working copy and repository Tag Name a revision (set of files with versions)

Branch & Merge Branch Split off new version Used for maintenance releases (bugfix) HEAD:

Branch & Merge Branch Split off new version Used for maintenance releases (bugfix) HEAD: main version Merge Add changes from one branch to another Tag branches after merging! Software Engineering, lecture #: Topic 10

Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links

Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links

CVS: Concurrent Versions System Repository in file system Requirements CVS client installed Write access

CVS: Concurrent Versions System Repository in file system Requirements CVS client installed Write access on server (via shell or NFS) Front-ends Cross. VC: Windows, Linux, Mac Tortoise. CVS: plug-in for Windows explorer Eclipse: IDE with built-in CVS

Subversion Repository in data base “Next version” of CVS Requirements subversion client installed subversion

Subversion Repository in data base “Next version” of CVS Requirements subversion client installed subversion server (standalone or Apache module) Front-ends Cross. VC: Windows, Linux, Mac Tortoise. SVN: plug-in for Windows explorer Subclipse: plug-in for Eclipse

Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links

Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links

CVS/SVN: First Steps Create directory on server for repository CVS: cvs -d /home/me/cvs init

CVS/SVN: First Steps Create directory on server for repository CVS: cvs -d /home/me/cvs init SVN: open https: //svn. vis. ethz. ch/, follow instructions Create local directory with initial files Move initial files to repository “Make new module” (Tortoise. CVS) “Import” (Cross. VC, Tortoise. SVN) CVS/SVN demo with Tortoise and/or Cross. VC

Good Practice Keep code in repository consistent! When feature implemented / bug fixed: Update

Good Practice Keep code in repository consistent! When feature implemented / bug fixed: Update Compile Run automated module tests Fix bugs Iterate until no bugs found Commit

Combining Tools Use build tool to compile run automated tests Always provide Bug Report

Combining Tools Use build tool to compile run automated tests Always provide Bug Report ID in commit comment register requirements as issues/bugs Software Engineering, lecture #: Topic 17

Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links

Revision Control 1. Motivation 2. Overview 3. Tools 4. First Steps 5. Links

Links Cross. VC http: //www. crossvc. com/ Tortoise. CVS, Tortoise. SVN http: //www. tortoisecvs.

Links Cross. VC http: //www. crossvc. com/ Tortoise. CVS, Tortoise. SVN http: //www. tortoisecvs. org/ http: //tortoisesvn. net/ Eclipse http: //www. eclipse. org/ http: //subclipse. tigris. org/

Repositories CVS directory on nethz account accessible via samba (: local: ) or secure

Repositories CVS directory on nethz account accessible via samba (: local: ) or secure shell (: ext: ) Subversion server provided by VIS https: //svn. vis. ethz. ch Software Engineering, lecture #: Topic 20