Introduction to CVS. Sivan Toledo Tel-Aviv University

Similar documents
CVS for Moodle Developers

Portions adapted from A Visual Guide to Version Control. Introduction to CVS

Version control with RCS and CVS An introduction. Markus Bjartveit Krüger

Source Control. Comp-206 : Introduction to Software Systems Lecture 21. Alexandre Denault Computer Science McGill University Fall 2006

Software Development. Hack, hack, hack, hack, hack. Sorta works. Main.c. COMP s1

A CVS Repository for the RNB Group

About CVS. 1 Version Control - what is it? why is it useful?

CVS Application. William Jiang

WinCvs Version 1.1. Users Guide. Don Harper

A Gentle Introduction to CMSC311 labs and CVS Or How I learned to use CVS in CMSC311. William Arbaugh September 2, 2004

CSE 374 Programming Concepts & Tools. Hal Perkins Winter 2012 Lecture 16 Version control and svn

Managing Source Code With Subversion

Team Support and Versioning with ClearCase and CVS in WebSphere Business Modeler V7

Introduction to version control. David Rey DREAM

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

Concurrent Versions System (cvs( cvs) Adviser Date August 31, 2004

Using CVS Repositories with SAS

Chapter 3. Revision Control

Revision Control. Software Engineering SS 2007

Common Configuration Management Tasks: How to Do Them with Subversion

Task-Oriented Solutions to Over 175 Common Problems. Covers. Eclipse 3.0. Eclipse CookbookTM. Steve Holzner

CVS How-to. 17th July 2003

CVS for the developer or amateur

CS108, Stanford Handout #37. Source Control CVS

File Control System 1.0 Product Requirements Document (PRD)

Table of Contents LEGAL NOTICES...A ACKNOWLEDGEMENTS...C WHO SHOULD READ THIS BOOK...C TABLE OF CONTENTS...1

CVS. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 21

Source control with Subversion A user perspective

Version Control. Kyungbaek Kim. Chonnam National University School of Electronics and Computer Engineering. Original slides from James Brucker

Using CVS 1 of 18. Using CVS. C oncurrent V ersions System - Jeremy Mates

Home Page. Title Page. Contents. Page 1 of 17. Version Control. Go Back. Ken Bloom. Full Screen. Linux User Group of Davis March 1, Close.

2/8/18. Overview. Project Management. The First Law. What is Project Management? What Are These Changes? Software Configuration Management (SCM)

Department of Computer Science College of Engineering Boise State University

Project Management. Overview

Tools for software development:

Using CVS to Manage Source RTL

Common CVS Command Summary


Outline The three W s Overview of gits structure Using git Final stuff. Git. A fast distributed revision control system

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 17, 2018

Version Control Systems

Using Subversion with LeMANS and MONACO

Physics REU Unix Tutorial

Version Control Systems

CS2720 Practical Software Development

Git. A fast distributed revision control system. Nils Moschüring PhD Student (LMU)

[Software Development] Development Tools. Davide Balzarotti. Eurecom Sophia Antipolis, France

Version Control. 1 Version Control Systems. Ken Bloom. Linux User Group of Davis March 1, 2005

Draft: MLDesigner and LinCVS

6 Git & Modularization

Revision control systems (RCS) and. Subversion

Tutorial: Getting Started with Git. Introduction to version control Benefits of using Git Basic commands Workflow

Programming in the large. Lecture 22: Configuration Management. Agenda for today. Bertrand Meyer. Bernd Schoeller

Subversion. CS 490MT/5555, Fall 2015, Yongjie Zheng

TDDC88 Lab 4 Software Configuration Management

Users Guide Don Harper November 1, 2001

Version Control: Gitting Started

Revision control. INF5750/ Lecture 2 (Part I)

CS480. Compilers Eclipse, SVN, Makefile examples

Git Tutorial. Version: 0.2. Anders Nilsson April 1, 2014

at Rocket Software Mainframe CVS z/os Unix System Services CVS client Extending the functionality of the Lisa Bates

And check out a copy of your group's source tree, where N is your one-digit group number and user is your rss username

Subversion FOUR. 4.1 What is Version Control? 4.2 What is Subversion? Types of Version Control SESSION

Using Git to Manage Source RTL

Revision Control. An Introduction Using Git 1/15

Version Control. DIFF Example. Version Control, continued. Lecture 12: Version Control & RCS. Things change

Introduction to the UNIX command line

2/9/2013 LAB OUTLINE INTRODUCTION TO VCS WHY VERSION CONTROL SYSTEM(VCS)? II SENG 371 SOFTWARE EVOLUTION VERSION CONTROL SYSTEMS

Version Control Systems (VCS)

What is Subversion and what does it do?

CSCI 4152/6509 Natural Language Processing. Lab 1: FCS Computing Environment

Development tools: Version control, build tools, and integrated development environments 1

GIT. CS 490MT/5555, Spring 2017, Yongjie Zheng

Next Generation Software Configuration Management with Subversion

Git. CSCI 5828: Foundations of Software Engineering Lecture 02a 08/27/2015

Submitting your Work using GIT

Revision Control II. - svn

CVS Workshop. How to manage your projects, source code, and associated files using the Concurrent Versioning System

2 Initialize a git repository on your machine, add a README file, commit and push

Human Version Control

CSC 2700: Scientific Computing

Part I Part 1 Version Control Systems (VCSs)

Version Control Systems

Version Control. Version Control. Human Version Control. Version Control Systems

CS 390 Software Engineering Lecture 5 More Git

Project Build Process. Abhijit Bhosale M.Tech (IT) School of Information Technology, IIT Kharagpur

9 and 11-Jan CSCI 4152/6509 Natural Language Processing Lab 1: FCS Computing Environment, SVN Tutorial. FCS Computing Environment, SVN Tutorial

A quick (and maybe practical) guide to Git and version control. By Jay Johnson

Part I Part 1 Version Control Systems (VCSs)

Part I Part 1 Version Control Systems (VCSs)

VSO. Configuration Management

How to version control like a pro: a roadmap to your reproducible & collaborative research

Source Code Management

Subversion. An open source version control system. W. Miah escience Rutherford Appleton Laboratory

Lab #2 Physics 91SI Spring 2013

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

Some Linux (Unix) Commands that might help you in ENSC351

Common Git Commands. Git Crash Course. Teon Banek April 7, Teon Banek (TakeLab) Common Git Commands TakeLab 1 / 18

Computational Physics Compiling a C++ program

Revision Control and GIT

Transcription:

Introduction to CVS Sivan Toledo Tel-Aviv University

Goals of Source Management Ability to roll a project back if a bug was introduced Release tagging Multiple developers Locking Or concurrent updates with merging Branches to fix bugs in old releases

Non Goals Not a build/configuration system (make, autoconf/automake, MSVC projects, etc) Not a substitute for human management Who does what (concurrent updates hurt) When to commit changes, who gets notified when to release, etc Not a substitute for testing, QA, bug tracking A defect in CVS: we want to track changes to several sources, but can t

The CVS Approach CVS=Concurrent Versions System Sources and their history are stored in a repository Modules are checked out by developers Developers work on their local copies and then commit changes to the repository Other developers can then update their local copies

The Repository

Creating a Repository cvs -d /home/stoledo/.../cvsroot init Creates an empty repository (will not delete things in an existing repository) -d argument is the root; can specify a default using CVSROOT environment variable

More on Repositories You can access a repository using Direct access to files /home/stoledo/.../cvsroot w:\cvsroot A remote shell setenv CVS_RSH ssh :ext:dan@zoot.tau.ac.il/home/dan/cvsroot A CVS server (must be running) :pserver:anoncvs@anoncvs.us.lyx.org/cvs/lyx cvs login (type password, lyx in this case)

Basic CVS Usage

Starting a Project Create a directory with just the files you want to source-manage images/ main.cpp richedit.pro richedit.ui richedit.ui.h richedit_he.ts but not richedit.cpp since it was generated by designer cd to this directory & setenv CVSROOT Import the files and directories cvs import m "initial import" richedit sivan start "initial import" is the log message for the operation richedit is the path in the repository sivan is a vendor tag (not really important) start is a release tag

Checking Out a Project Move to a working directory cvs checkout richedit This creates a subdirectory richedit which contains a copy of the project Each project directory also contains a CVS subdirectory with CVS information; don't touch these files The CVS directories contais a pointer to the repository, so you don't need to specify CVSROOT any more

Build and Test Now cd to the project's working directory Try to build: qmake richedit.pro; make or whatever the build command is Hopefully this will work Run cvs update to update your sources CVS will list files that are not up-to-date with respect to the repository, and in particular all the generated files (objects, etc) with a? prefix: it knows nothing about them

Modify and Commit Add some great feature to the program Run cvs update to update your sources Files that were updated by others but not by you will be marked with a U prefix Files that you updated and were not touched in the repository, or were updated by others and the changes were successfully merged (changed to different lines) are marked M Failed merges are marked C; will discuss these later

Modify and Commit (Cont.) let's assume there were not conflics (C's) Build and test again if there were merges; perhaps the merges resulted in sources that don't compile or in bugs If everything works, cvs commit Like most CVS commands, commit works recursively and will commit all your changes; You can commit one by one You'll need to supply a log message using m or using a text editor

Revisions and Releases

Revisions of Files CVS takes a snapshot of each version of a file that is committed or added. These are called revisions and have numeric values, starting at 1.1 (next comes 1.2, etc) You can retrieve any old revision using cvs update -r 1.4 main.cpp CVS does not know about intermediate states in your working directory CVS stores revisions compactly

Releases and Tags You can assign a symbolic name, called a tag, to a particular revision of a file Particularly useful for tagging the current revisions of all files of a project that participate in a release of the product E.g., tag everything as belonging to release 2.0 cvs tag -c release-2-0 This tags everything and ensures (-c) that the version we tag (in the repository) is identical to the files in the working directory

More on Tags A single tag will correspond to a different revision of each file, e.g., to 1.4 of main.cpp and to 1.1 of richedit.pro You can checkout an old release cvs checkout -r release-2-0 richedit for example, to fix a bug in an old release of your software

Branches The revisions of a file need not be a simple chain; they can form a tree Suppose we are working on release 2.0 but a customer discovered a bug in release 1.0 that must be fixed We create a branch at the release 2.0 tag Release 2.0 revisions have two children revisions in the chain leading to the 2.0 release revisions that are 1.0 bug fixes

Branches and Merging CVS allows you to merge branches E.g., to port a new feature of 2.0 back into release 1.0 (perhaps a customer needs the feature but cannot upgrade for some technical reason) Don't count on this in your project planning: you'll have to resolve conflicts More on branches and merging in the manual; this is an advanced feature

Adding and Removing Files

Adding Files to the Repository cvs add newclass.cpp Not recursive! you can't cvs add src/newclass.cpp, you must be in that directory Still not in the repository cvs commit newclass.cpp (cvs commit src/newclass.cpp will work)

Removing Files from the Repository rm oldclass.cpp cvs remove newclass.cpp Will only remove non-existing files, or cvs remove f oldclass.cpp Still not in the repository cvs commit To rename, remove then add and commit

Removing Files from the Working Directory Use cvs update dp to ensure that files that were deleted in the repository are deleted in your working directory and that empty directories are removed

Conflicts and How to Resolve Them

Conflicts If CVS discovers during update that your changes overlap changes made in the repository (relative to your revision), it will put both changes in the file and ask you to resolve... <<<<<<< main.cpp file name exit(error==0? SUCCESS : FAILURE); your code ======= exit(!!error); new code >>>>>>> 1.5 repository rev

Resolving Conflicts Select one version or the other, or write new code to replace the conflicting code exit(error==0? SUCCESS : FAILURE); CVS will not commit the file until all the conflict markers are gone (<<<<<<< etc) As in other situations, it's best to avoid conflicts altogether CVS helps, but you still have to do the hard work

Text Files, Binary Files

CVS assumes that files contain text it automatically converts between line separators (\n in linux and unix, \r\n in windows, \r in MacOS) it assumes changes don't conflict if they are on different lines it performs keyword substitution $Author$, $Revision$, $Id$, etc it modifies your local copy to show conflicts and to allow you to resolve them

This Can Cause Trouble A binary file (e.g. an image or sound file) may become corrupted by line-separator substitution A binary file may become corrupted by keyword substitution; e.g., PDF files have pointers in them

Or May be Useless Some files are text, but are not meant to be edited by a text editor Qt Designer.ui files; these are xml files (text), but are meant to be edited in Qt Designer you probably won't be able to resolve the conflict in a text editor

Dealing with Binary Files Specify -kb flag to commands to prevent substitution and merging Better yet, specify as a sticky tag: a tag that gets propagated through revisions, and that gets used as a command option cvs admin -kb images/textleft.png or cvs add -kb images/textleft.png

Other CVS Tools

Additional CVS Commands cvs admin cvs diff cvs export cvs history/annotate/log/status/ editors/watchers cvs edit/unedit/watch cvs rdiff cvs rtag cvs release

.cvsrc A.cvsrc file in your home directory allows you to specify default options to cvs and its subcommands cvs -z6 update -dp diff -u

Reservations and Notifications CVS supports reserved checkouts (locking) but not very well cvs admin -l CVS supports notification about who is editing a file, when it is checked in, etc cvs watch on cvs edit cvs unedit

CVS and other Source Management Systems

Other Systems SourceSafe: MicroSoft product, integrated with Visual Studio ClearCase: transparent, takes over filesystem functionality, commercial BitKeeper: new, now used to manage Linux, both free and commercial licenses Aegis: free, better change control than CVS...

CVS s Advantages Already installed on most Linux/Unix systems; means you can always grab a copy, fix it, and commit, even at a customer s site Available for Windows and MacOS Free Mature; used since approximately 1986 GUI interfaces Web interfaces

That s it, folks