CVS: Concurrent Version System Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: 818-677-4954 “UNIX for Programmers and Users” Third.

Slides:



Advertisements
Similar presentations
1. What is Subversion? Why do we need CM? Basic concepts Repositories Options Setup Clients Options Setup Operation Troubleshooting Slide 2.
Advertisements

Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Concurrent Versions System Overview of CVS architecture. Repository structure.
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Concurrent Versions System Overview of CVS architecture. Repository structure.
Version Control System Sui Huang, McMaster University Version Control SystemSui Huang, McMaster University Version Control System -- base on Subversion.
Revision Control Systems Amin Tootoonchian Kian Mirjalali.
Ar: Unix Archiver Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third Edition, Prentice-Hall,
2/6/2008Prof. Hilfinger CS164 Lecture 71 Version Control Lecture 7.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
Version Control using Subversion Albert Young-Sun Kim November 2 nd, 2005 Available at entations/ subversion/
Source Code Revision Control with Subversion Christophe Dupré May 13, 2005 Update KEJ May 10, 2006 Scientific Computation Research Center Rensselaer Polytechnic.
Concurrent Versioning System Chapter 8 (ALBING’s).
CVS II: Parallelizing Software Development Author: Brian Berliner John Tully.
6/27/20151 Doris Lee Concurrent Version System (CVS)
CVS Workshop I Arthur Chan. This workshop CVS overview (10%) Basic CVS commands (40%) Practical Issues in using CVS (50%) My experience in real-life For.
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Source Control Repositories for Enabling Team Working Svetlin Nakov Telerik Corporation
David Stotts UNC Computer Science (2013) with slides from a talk by Karsten Dambekalns (2005)
Introduction to CVS Portions adapted from A Visual Guide to Version ControlA Visual Guide to Version Control.
SubVersioN – the new Central Service at DESY by Marian Gawron.
Version Control. What is Version Control? Manages file sharing for Concurrent Development Keeps track of changes with Version Control SubVersion (SVN)
Source Code Revision Control Software CVS and Subversion (svn)
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
Version Control with Subversion Quick Reference of Subversion.
With Mercurial and Progress.   Introduction  What is version control ?  Why use version control ?  Centralised vs. Distributed  Why Mercurial ?
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
CVS 簡介 數位芝麻網路公司蔡志展 2001/8/18 大綱 • CVS 簡介 • CVS 安裝 • CVS 設定 (Linux/Windows) • CVS 指令簡介 • CVS 多人環境的應用.
Drexel University Software Engineering Research Group Git for SE101 1.
Chris Onions Getting started with CVS in ATLAS 11 Getting started with CVS in ATLAS Chris Onions (Tutorial based on that of Raúl Ramos Pollán CERN / IT.
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
An Intro to Concurrent Versions System (CVS) ECE 417/617: Elements of Software Engineering Stan Birchfield Clemson University.
Subversion (SVN) A Revision Control System Successor to CVS Carlos Armas Hervey Allen.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
CSE 219 Computer Science III CVS
CVS – concurrent versions system AROC Guatemala July 19-23, 2010 Guatemala City, Guatemala.
1 CSE306 Operating Systems Projects CVS/SSH tutorial.
GIT.
Version Control *Slides are modified from Prof. Necula from CS169.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
Version Control System
Presentation OLOMOLA,Afolabi( ). Update Changes in CSV/SVN.
Make: File Dependency System Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third.
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
WinCVS Training è Basic Concepts è Download & Setup è Importing a new module into CVS Repository è Getting new module from CVS è Getting Latest version.
Recitation 2: Abhijit Warkhedi2/25/20161 Today’s Agenda u CVS u GDB.
SVN code server for AliRoot P.Hristov 18/10/2007.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
Warren Jones, Fluke Co., Eugene Kramer, Remedy Co. Introduction to CVS 1999 Revised by David Svoboda 2003 Concurrent Versions System Overview of CVS architecture.
Source Control Repositories for Enabling Team Working Doncho Minkov Telerik Corporation
NALINI S. NAUTIYAL SYSTEM SOFTWARE DIVISION Subversion.
CS520 Web Programming Version Control with Subversion Chengyu Sun California State University, Los Angeles.
1 Subversion Kate Hedstrom April Version Control Software System for managing source files –For groups of people working on the same code –When.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
Source Control Dr. Scott Schaefer. Version Control Systems Allow for maintenance and archiving of multiple versions of code / other files Designed for.
Ar: Unix Archiver Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third Edition, Prentice-Hall,
CVS – concurrent versions system
CVS – concurrent versions system
SVN intro (review).
Source Control Dr. Scott Schaefer.
An Intro to Concurrent Versions System (CVS)
Version Control System
Concurrent Version System (CVS)
CVS Concurrent Versioning System
Concurrent Versions System
Presentation transcript:

CVS: Concurrent Version System Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third Edition, Prentice-Hall, GRAHAM GLASS, KING ABLES Slides partially adapted from Kumoh National University of Technology (Korea) and NYU

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: UNIX Version Control Systems Keep versions of source code –on a per file basis; grouping by tagging Any version is accessible Allow for parallel development Support multiple software releases SCCS: UNIX Source Code Control System –Rochkind, Bell Labs, RCS: Revision Control System –Tichy, Purdue, 1980s. CVS: Concurrent Versions System –Berliner, Subversion (SVN) –a compelling replacement for CVS –Jostein Chr. Andersen, 2003

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: CVS Major Features Client/Server model –Distributed software development No exclusive locks (like SCCS/RCS) –No waiting around for other developers –No hurrying to make changes while others wait –Avoid the “lost update” problem file locked; get the file, edit when file unlocked, checkout again, overwrite with your version and check in have you destroyed some edits made between the time you grabbed the file first time and the sec ond time? All revisions of a file in the project are in the repository (using RCS) Work is done on the checkout (working copy) Top-level directories are modules; checkout operates on modules Different ways to connect

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: CVS Revision Control The history of each file is tracked with an incrementing revision number For each revision there is a log entry RCS version numbering is used; CVS user does not have to use these numbers directly (through tagging and branching - more later) Revision numbers have the format 1.25 if they’re on the main trunk, branches have something like merge main trunk branch

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Getting Started cvs [basic-options] [cmd-options] [files] Basic options: -d Specifies CVSROOT - repository location -H Help on command -n Dry run (just try the command) Commands init import checkout update commit add remove status diff log tag …

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Getting Started Creating a repository $ cd $HOME $ mkdir cvs $ chmod 700 cvs $ cvs -d /home/userNN/userID init Environment variable: CVSROOT Location of Repository Can take different forms: –Local file system: /usr/usersNN/userID/cvs –Remote Shell: –Client/Server: We will play with the local repository $ export CVSROOT=/home/usersNN/userID $ cvs init

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Getting Started Remote access via SSH: $ export CVS_RSH=/usr/bin/ssh $ cvs -d $ _ or $ export CVS_RSH=/usr/bin/ssh $ export $ cvs $ _

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Setting up a Project in CVS Importing source –generates a new CVS module (project) cd into source directory to import all project files: cvs –d import cvs –d checkout $ cd comp421/reverse-initial $ cvs import -m “Initial deposition of sources” reverse userID start Password: N reverse/reverse.c N reverse/reverse.h N reverse/reversefirst.c $ mkdir../reverse $ cd../reverse $ cvs checkout reverse---> now we have a copy in a working directory $ _

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: The CVS Root Directory $ ls $CVSROOT CVSROOT reverse $ ls $CVSROOT/reverse/ Attic reverse.c,v reverse.h,v reversefirst.c,v $ cat $CVSROOT/reverse.h,v head 1.1; branch 1.1.1; access ; symbols start: userID:1.1.1; locks ; strict; … DO NOT TOUCH!!!

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: The Project CVS Directory Contains information on: –where the server is –version of checked out files –locally removed/added files $ ls CVS Entries Repository Root $ cat -n CVS/Entries 1 /reverse.c/ /Fri Nov 19 18:50: // 2 /reverse.h/ /Fri Nov 19 18:50: // 3 /reversefirst.c/ /Fri Nov 19 18:50: // 4 /descr.txt/1.1/Fri Nov 19 19:17: // 5 D $ cat -n CVS/Repository 1 reverse $ cat -n 1 CVS/Root /home/usersNN/userID/cvs $ _

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Adding Individual files Add files: add (cvs add ) $ vi descr.txt … … $ cvs add descr.txt cvs add: scheduling file `descr.txt' for addition cvs add: use 'cvs commit' to add this file permanently $ _ The file is not in the repository yet!

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Committing Changes Put changed (or newly added) version into repository: commit –Fails if repository has newer version (need update first) $ cvs commit cvs commit: Examining. "/tmp/cvsa18990" 8 lines, 291 characters vi session opens

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Documenting Changes Added initial description---> you have to add the commentary CVS: CVS: Enter Log. Lines beginning with `CVS:' are removed automatically CVS: CVS: Committing in. CVS: CVS: Added Files: CVS: descr.txt CVS: ~ "/tmp/cvsa18990" 9 lines, 317 characters ZZ---> save file and quit vi (a nice shortcut) ---> upper case “ZZ”!

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: File Revisions $RCS file: /home/usersNN/userID/cvs/reverse/descr.txt,v done Checking in descr.txt; /home/usersNN/userID/cvs/reverse/descr.txt,v <-- descr.txt initial revision: 1.1 done $ ls $CVSROOT/reverse Attic reverse.c,v reversefirst.c,v descr.txt,v reverse.h,v $ cat $CVSROOT/reverse/descr.txt,v

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: File Revisions head 1.1; access; symbols; locks; 1.1 date ; author userID; state Exp; branches; next ; desc 1.1 initial is a description - line

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Obtaining Status Information $ cvs status descr.txt ============================================================= File: descr.txt Status: Up-to-date Working revision: 1.1 Fri Nov 19 20:56: Repository revision: 1.1 /home/usersNN/userID/cvs/reverse/descr.txt,v Sticky Tag: (none) Sticky Date: (none) Sticky Options: (none) $ _

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Comparing Versions $ vi descr.txt $ cvs commit descr.txt $ cat $CVSROOT/reverse/descr.txt,v $ cvs diff –r1.1 –r1.2 descr.txt cvs diff -r1.1 -r1.2 descr.txt Index: descr.txt ============================================================= RCS file: /home/users13/andrzej/cvs/reverse/descr.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -r1.1 -r1.2 1a2 > Line 2 has been added. $ _

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Removing Files from Repository Remove files: remove (cvs remove ) $ cvs remove descr.txt cvs remove: file `descr.txt' still in working directory cvs remove: 1 file exists; remove it first $ rm descr.txt $ cvs remove descr.txt cvs remove: scheduling `descr.txt' for removal cvs remove: use 'cvs commit' to remove this file permanently $ cvs commit descr.txt $ _ Things do not disappear from CVS! $ cvs add descr.txt cvs add: re-adding file `descr.txt' (in place of dead revision 1.3) cvs add: use 'cvs commit' to add this file permanently $ cvs commit descr.txt

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Accessing File Change Log $ cvs log descr.txt RCS file: /home/usersNN/userID/cvs/reverse/descr.txt,v Working file: descr.txt head: 1.4 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 4; selected revisions: 4 description: revision 1.4 date: 2004/11/19 21:29:35; author: userID; state: Exp; lines: re-added the file revision 1.3 date: 2004/11/19 21:23:19; author: userID; state: dead; lines: File deleted revision 1.2 date: 2004/11/19 21:15:16; author: userID; state: Exp; lines: Line 2 added to the file revision 1.1 date: 2004/11/19 21:01:41; author: userID; state: Exp; Added initial description ==================================================================== $ _

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Managing files Get latest version from repository: update –if out of sync, merges changes Possible conflicts! –one developer changes a line to something –another developer changes the same line to something else and commits the change –when the first developer wants to update - conflict Conflict resolution is manual –developers have to meet and resolve the issue local ver2 1.3 update (merge) another developer changes the main trunk Line 5: int I = 20; Line 5: int I = 55; local ver1

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Change Conflicts $ vi descr.txt $ cvs checkout -d anotherReverse reverse---> “another developer” $ cd anotherReverse $ vi descr.txt $ cvs commit $ cd..---> back to the first developer’s workspace

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Conflict Resolution $ cvs update ---> in the original working directory cvs update cvs update: Updating. RCS file: /home/usersNN/userID/cvs/reverse/descr.txt,v retrieving revision 1.2 retrieving revision 1.3 Merging differences between 1.2 and 1.3 into descr.txt rcsmerge: warning: conflicts during merge cvs update: conflicts found in descr.txt C descr.txt $ cat descr.txt ---> the merged file may include conflicts This is a description - line 1. This is my line 2 conflict! This is my line 3 ======= This is another developer’s change to line 3 >>>>>>> > end of conflict $ vi descr.txt

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Tags A tag is a symbolic name for a specific revision Tagging all files in one directory or module marks the current stage Can be used as a synonym for a revision in CVS commands cvs tag applies the tag to current revision of each file $ cvs tag rel file file2 beta-1 rel-2 rel-1 beta-1 rel-2

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Branches A branch is a sticky tag. It is a symbolic name which always sticks to the HEAD of the branch in question (MAIN is a special branch reserved for the main trunk) To start a branch: $ cvs rtag –b –r rel-1 release-1---> off a tag $ cvs tag –b release-2---> off current copy release-1 research MAIN release-2 maintenance branch main development trunk rel-1 research branch experimental branch experimental

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Finding Differences between Tagged Versions $ cvs diff -r release1 -r release-2 descr.txt Index: descr.txt ============================================================= RCS file: /home/usersNN/userID/cvs/reverse/descr.txt,v retrieving revision retrieving revision diff -r r c3 < This is another developer’s change to line > This is my line 3 $ _ You can also use cvs -n that only tries what the processing would be like

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Keyword Substitution Source files can contain keywords Keywords are filled on checkout/update Some useful keywords: –$Id$ –$Revision$ –$Date$ For example, $Id$ expands to something like: $Id: prog.c, v /10/14 14:32:21 userID Exp$ Can be used in program source

CVS: Concurrent Version System Prof. Andrzej (AJ) Bieszczad Phone: Subversion: New Open Source Standard Most current CVS features. Directories, renames, and file meta-data are versioned Commits are truly atomic. Apache network server option, with WebDAV/DeltaV protocol. Standalone server option. Branching and tagging are cheap (constant time) operations Natively client/server, layered library design Client/server protocol sends diffs in both directions Costs are proportional to change size, not data size Choice of database or plain-file repository implementations Versioning of symbolic links Efficient handling of binary files Parseable output Localized messages