CVS – concurrent versions system AROC Guatemala July 19-23, 2010 Guatemala City, Guatemala.

Slides:



Advertisements
Similar presentations
Introduction To GIT Rob Di Marco Philly Linux Users Group July 14, 2008.
Advertisements

Intro to Version Control Have you ever …? Had an application crash and lose ALL of your work Made changes to a file for the worse and wished you could.
1. What is Subversion? Why do we need CM? Basic concepts Repositories Options Setup Clients Options Setup Operation Troubleshooting Slide 2.
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.
2/6/2008Prof. Hilfinger CS164 Lecture 71 Version Control Lecture 7.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
CVS Selim Çıracı Ahmet Kara Metin Tekkalmaz. CVS – Open Source Version Control System Outline What are Version Control Systems? And why do we need them?
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Introductory Concurrent Version System (CVS) UCR Technical Seminar 10/23/03 Dan Berger
Source Code Management Or Configuration Management: How I learned to Stop Worrying and Hate My Co-workers Less.
Source Control Repositories for Enabling Team Working Svetlin Nakov Telerik Corporation
SubVersioN – the new Central Service at DESY by Marian Gawron.
By Steven Campbell and Erik Boone.  Sharing projects by putting them into a central repository.  Checking out copies of projects from the repository.
Version Control. What is Version Control? Manages file sharing for Concurrent Development Keeps track of changes with Version Control SubVersion (SVN)
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
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.
Linux Operations and Administration
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
Sumedha Rubasinghe October,2009 Introduction to Programming Tools.
علیرضا فراهانی استاد درس: جعفری نژاد مهر Version Control ▪Version control is a system that records changes to a file or set of files over time so.
With Mercurial and Progress.   Introduction  What is version control ?  Why use version control ?  Centralised vs. Distributed  Why Mercurial ?
Unix Basics Chapter 4.
Git – versioning and managing your software L. Grewe.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
CVS 簡介 數位芝麻網路公司蔡志展 2001/8/18 大綱 • CVS 簡介 • CVS 安裝 • CVS 設定 (Linux/Windows) • CVS 指令簡介 • CVS 多人環境的應用.
Object-Oriented Software Engineering Using UNIX groups and Subversion Estimated Time: minutes “Unix is user-friendly. It's just very selective about.
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
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?
Progress with migration to SVN Part3: How to work with g4svn and geant4tags tools. Geant4.
Computer Science and Engineering The Ohio State University  Widely used, especially in the opensource community, to track all changes to a project and.
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
CSE 219 Computer Science III CVS
Version Control with SVN Images from TortoiseSVN documentation
1 CSE306 Operating Systems Projects CVS/SSH tutorial.
WinCvs. WinCVS WinCvs is a window based version control system. Use WinCvs when  You want to save every version of your file you have ever created. CVS.
CVS: Concurrent Version System Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third.
GIT.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
Version Control System
Part 4: FCM and the UM University of Reading, December 2015.
Presentation OLOMOLA,Afolabi( ). Update Changes in CSV/SVN.
Version Control and SVN ECE 297. Why Do We Need Version Control?
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
It’s not just an insult from Harry Potter!. What is Git? Distributed Version Control System (DVCS) – Compared to a Centralized Version Control System.
DIGITAL REPOSITORIES CGDD Job Description… Senior Tools Programmer – pulled August 4 th, 2011 from Gamasutra.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
GIT Version control. Version Control Sharing code via a centralized DB Also provides for Backtracking (going back to a previous version of code), Branching.
Version Control Systems
Version Control with Subversion
CVS – concurrent versions system
CVS – concurrent versions system
An Intro to Concurrent Versions System (CVS)
Subversion.
Version Control Systems
An introduction to version control systems with Git
Compilers, Make and SubVersion
CVS Concurrent Versioning System
Version control with Git
Concurrent Versions System
Presentation transcript:

CVS – concurrent versions system AROC Guatemala July 19-23, 2010 Guatemala City, Guatemala

Overview – what is CVS?  CVS is a Version Control System (VCS)  CVS == Concurrent Versioning System

Contents Part I  Version control and change managements  Introduction to CVS – principles, commands  Examples  Setting up a repository  Accessing the repository  Importing a project  Creating modules

Contents – cont'd Part II  The CVSROOT/ directory and its files  Pre- and post- jobs  The big picture: mail notifications, cvsweb, and lists  Putting it all together  Automated scenarios

Overview – what is version control Version control, and change management  Keep track of changes (revisions)  Share changes with others (public repository)  Maintain multiple versions of a same set of data (branches) What kind of data?  Source code  Documentation  Configuration files  Binary data as well (less efficient)

CVS terminology repository  Central, master copy containing all files being versioned. Directory structured working copy  Local copy of a project, checked out from a repository. Contains special directories (CVS) with information about which files are under CVS control, where they files come from and where they should be committed. module  A set of directories, files or other modules under a common “shortcut” name

CVS principles CVS uses a centralized “master copy”: the repository All work is done in a working copy Changes are committed back to the repository Special directory, CVS

CVS – the repository CVS is a centralized VCS (1 repository) The repository contains files in the RCS format, all ending in ',v ' Each RCS file contains a complete history, with change log, of the file being versioned Well adapted to text files The repository is NEVER edited by hand A number of tools exist to analyze or browse the repository  cvsweb/webcvs

CVS – the repository Clients can access the repository locally or over the network. The repository is indicated (UNIX) using the CVSROOT environment variable: CVSROOT=  /cvs/myprojects # local disk  :pserver:myserver.com:/cvs/myprojects # via pserver  # via SSH Allows for distributed work over LAN/WAN

CVS – example workflow Initial checkout  cvs co projectnameinitial checkout  vi filename... work...  cvs commit [filename]record changes Later:  cvs upupdate working copy from repository  vi filename... work...  cvs commit [filename]record changes

CVS – example workflow – cont'd

CVS clients Exist for most operating systems  cvs command line (UNIX, Win32)  TortoiseCVS – embeds in Explorer (Win32)  WinCVS (Win32) ... Access the repository over the network or locally Can access CVS via software such as Trac

CVS commands – action commands import  import a new project into an existing repository checkout (co)  check out a working copy of a project/file/module from the repository update (up)  update a working copy from the CVS version commit  commit changes back to the repository (incl. new files)

CVS commands – action commands cont'd add  add a new file in the working copy, ready to commit delete (del)  remove a file from the working copy, ready to commit

CVS command – status commands status  see the status and version of a given file or by default all files diff  show the difference between a given revision (by default: the last one) of the named file and the file in the working repository log  show revision history for one or more files

A working example % CVSROOT=:ext:server.name:/data/cvs % export CVSROOT % cvs co someproject Password: ******* cvs server: Updating someproject U dir/file1 U dir/file2... % ls -l dir/ -rwxr-xr-x 2 netmanage staff 512 Dec 20 15:44 CVS/ -rw-r--r-- 1 netmanage staff 1244 Nov 17 14:21 file1 -rw-r--r-- 1 netmanage staff 341 Dec 3 21:04 file2... % vi file1... % cvs commit file1

A working example – cont'd editor / Bugfix -- Modified file1 to fix bug / \ / CVS: / \ CVS: Enter Log. Lines beginning with `CVS:' are \ / CVS: removed automatically / \ CVS: \ / CVS: Modified Files: / \ CVS: file1 \ / CVS: / \ \ /tmp/cvsUABnYm: 8 lines, 290 characters Checking in file1; /data/cvs/dir/file1,v <-- file1 new revision: 1.2; previous revision: 1.1 done %

What's in the CVS/ directory ? Entries  existing files, and newly added files Root  where the repository is located Repository  name of module or path in the repository

The CVS $Id$ directive In an existing file, adding a single line with: $Id$... will automatically insert the file version in the file at the next commit.

Setting up a new repository Anyone can create a repository, anywhere Done using the cvs init command Example:  mkdir /home/tldadmin/cvs  export CVSROOT=/home/tldadmin/cvs  cvs [-d /home/tldadmin/cvs] init  ls -l /home/tldadmin/cvs drwxrwxr-x 3 cvs staff 1024 Dec 20 15:45 CVSROOT/

Accessing the new repository Locally  cvs -d /home/netmanage/cvs... Not necessary to specify -d if CVSROOT is defined Remotely  cvs -d :ext:servername:/home/tldadmin/cvs...  SSH must be available! Ready for import!

Importing a new project... % CVSROOT=/home/tldadmin/cvs; export CVSROOT % cd someplace/myproject/ % cvs import my/new/project before_cvs start editor / Import pre-CVS version of my new project / \ / CVS: / \ CVS: Enter Log. Lines beginning with `CVS:' are \ / CVS: removed automatically / \ \ N my/new/project/file1 N my/new/project/file2... No conflicts created by this import %

Importing a new project...cont'd The location for this project in the repository is now my/new/project, under the /data/cvs repository i.e.:  /home/tldadmin/cvs/my/new/project Let's test that we can check out the project: % cvs co new/project U my/new/project/file1 U my/new/project/file2 % cd my/new/project % ls -l...

Modules my/new/project is maybe too long as a project name solution: modules, which are shorter names for directories or groups of directories and other modules. For example: projectmy/new/project With such a module defined, it will be possible to checkout, commit, etc... using the simple name “project” cvs -d :ext:/data/cvs co project We'll see how to define modules later.

The CVSROOT/ directory A default module is always created when one inits a repository: CVSROOT % cvs co CVSROOT U CVSROOT/checkoutlist U CVSROOT/commitinfo U CVSROOT/config U CVSROOT/cvswrappers U CVSROOT/editinfo U CVSROOT/loginfo U CVSROOT/modules U CVSROOT/notify U CVSROOT/rcsinfo U CVSROOT/taginfo U CVSROOT/verifymsg

The CVSROOT/ directory – cont'd Files described in cvs(5)  man 5 cvs Most relevant:  modulesdefine modules  commitinfopre-commit scripts  cvswrappershandle special files  loginfopost-commit scripts

Pre- and post- jobs Using commitinfo and loginfo, it is possible to have automatic jobs run before and after each commit, for instance: pre-commit stage (commitinfo)  verify that a user is allowed to modify a given file  check syntax for a file ... post-commit stage (loginfo)  send update as a mail  append it to a log ...

The big picture: mail, cvsweb, lists

Putting it all together...

CVS shortcomings Symlinks and ownership of files are not recorded No renaming of files (copy + delete) No changesets  each file has 1 version, need post-processing work to figure out “all files for this commit” No disconnected operation  add, remove, commit,... all need access to the server Branching/merging is quite complicated

Subversion (SVN) Subversion (SVN) is now the more popular choice for revision control than CVS "Enterprise-class centralized version control for the masses” Subversion is essentially a superset of CVS. Current feature descriptions are here: - This materials for this class were developed using Subversion… 4 people, 4 continents, 1 repository…

Automated scenarios Idea: automate configuration management tasks so that configuration files are automatically versioned using CVS even when the sysadmin forgets :) Implementation – cron job  look at all files in a given directory  if they exist in the repository already -> commit  if they don't, add, then commit

Automated scenarios – cont'd Already exists for network equipment: RANCID  Simple concept to implement for all relevant files in /etc Subscribe all admins to the alias mailing list, so everyone receives a notification when a change takes place – whether planned or not!

References CVS Project Main Page CVSweb Main Page Free Book (350 Pages) on CVS Free Windows Client for CVS