Difficult to keep track of different versions of a file if several people are making updates

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

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

COSC345 Software Engineering. Version Control

Make. Dependency Graphs

RCS Tutorial. Dongsoo S. Kim

CS2720 Practical Software Development

Versioning. Terms. Configuration item (CI) Version Configuration Management aggregate Configuration Baseline

Source Code Revision Control Procedures

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

WinCvs Version 1.1. Users Guide. Don Harper

This document covers the most frequently used procedures in ClearCase. It contains the following sections:

27-Sep CSCI 2132 Software Development Lab 4: Exploring bash and C Compilation. Faculty of Computer Science, Dalhousie University

DICE and LCFG Software Guidelines

Outline. Configuration management. Main Phases MOTIVATION

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

Laboratorio di Programmazione. Prof. Marco Bertini

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

CPSC 491. Lecture 19 & 20: Source Code Version Control. VCS = Version Control Software SCM = Source Code Management

Chapter 3. Revision Control

Exploring UNIX: Session 3

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

Configuration. Monday, November 30, :28 AM. Configuration

AccuBridge for IntelliJ IDEA. User s Guide. Version March 2011

Terminal Windows, Emacs, Subversion and Make

Working in Base ClearCase

USE OF BASELINES. Definition, reasons and examples. RD.11/######.#

Source Control: Perforce

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

Version Control Systems: Overview

Enterprise Architect. User Guide Series. Change Management. Author: Sparx Systems. Date: 19/03/2018. Version: 1.0 CREATED WITH

Systems Software. Recitation 1: Intro & Revision Control. Quite different from 213. Our Philosophy. Partly-free lunch

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

Build. System building

Introduction to Version Control

Review of Versioning. Configuration Management. Relation of Versioning to CM. Lecture 14: Configuration Management & Midterm Review

Using CVS to Manage Source RTL

Revision Control II. - svn

P4EXP Help January 2018

Case Studies in Access Control

Revision Control. How can 4. Slides #4 CMPT 276 Dr. B. Fraser. Local Topology Simplified. Git Basics. Revision Control:

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

Cisco IOS Shell. Finding Feature Information. Prerequisites for Cisco IOS.sh. Last Updated: December 14, 2012

Department of Computer Science College of Engineering Boise State University

Lecture: Consistency Models, TM. Topics: consistency models, TM intro (Section 5.6)

git-flow Documentation

Configuration Management

TDDC88 Lab 4 Software Configuration Management

As a first-time user, when you log in you won t have any files in your directory yet.

Introduction, Instructions and Conventions

Subversion Branching and Merging. Jan Skalický

Version Control Systems (Part 1)

Enterprise Architect. User Guide Series. Change Management

Welcome! Virtual tutorial starts at 15:00 GMT. Please leave feedback afterwards at:

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

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

Version Control Systems

Introduction to Supercomputing

Access Permissions. Agenda. chmod Command (Relative Method) File / Directory Permissions

Lecture 21: Transactional Memory. Topics: consistency model recap, introduction to transactional memory

Eli System Administration Guide

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

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

Common Configuration Management Tasks: How to Do Them with Subversion

Towards A Better SCM: Matt Mackall Selenic Consulting

Case Study: Access Control. Steven M. Bellovin October 4,

Git version control with Eclipse (EGit) Tutorial

Debugging (Part 1) The material for this lecture is drawn, in part, from The Practice of Programming (Kernighan & Pike) Chapter 5

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

1/20/13 Git tutorial. Git tutorial. Mike Nolta. file:///users/nolta/github/reveal.js/git.html?print-paper#/ 1/31

Lecture: Consistency Models, TM

Project Management. Overview

Version Control Systems

Software Testing and Maintenance 1. Introduction Product & Version Space Interplay of Product and Version Space Intensional Versioning Conclusion

Handout 4: Version Control Reference

Human Version Control

You Can t Move Forward Unless You Can Roll Back. By: Michael Black

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

GLIMMER, Version Control and Build Systems

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

From: Sudarshan N Raghavan (770)

The print queue was too long. The print queue is always too long shortly before assignments are due. Print your documentation

Using Subversion with LeMANS and MONACO

Computer Labs: Version Control with Subversion

Revision control systems (RCS) and. Subversion

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

IBM VisualAge for Java,Version3.5. External Version Control

Revision Control and GIT

How to build Simbody 2.2 from source on Windows

Lecture 12: Hardware/Software Trade-Offs. Topics: COMA, Software Virtual Memory

Linux Refresher (1) 310/ Fourth Workshop on Distributed Laboratory Instrumentation Systems (30 October - 24 November 2006)

LSF Make. Platform Computing Corporation

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

Dec2005: Released with v6.u1u1. Other than the title, the document is unchanged relative to v6.1.

Source control with Subversion A user perspective

How To Use GrandMaster Suite. Backup and Restore. Suite

Version Control with GIT

Index. Alias syntax, 31 Author and commit attributes, 334

Contents. Error Message Descriptions... 7

Submitting your Work using GIT

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages

Transcription:

Revision Control System (RCS) Project management Difficult to keep track of different versions of a file if several people are making updates Source code and documentation files change frequently Bugs need to be fixed (but keep a copy of the older working program) Programs may need to be enhanced Software is released at non-regular intervals Problem is harder if there is more than one version of the program in circulation Different people may attempt to fix different bugs by modifying different parts in the same file Problems solved by utilities to manage and track changes in the files sccs and rcs Record a specific version or revision of the file so that it can be recovered in the event of a problem in that version Usable for managing source code and software documentation Control the set of people allowed to update a file Record the name of the person who made the change, and a comment about what was changed (log commentary) Provide control over new revision creation (major or minor revision), depending upon the version Possible to regenerate any version of the file that was saved Make sure that only one person can modify the file at any time Goals of project control Ability to group files by revision (snapshot) Support for product abstraction Structuring a group of source files Support for concurrent development Ability to rebuild product revisions Support for multiple target platforms Control of released files Evolution of an RCS file Version number Consists of two parts release number and level number Upon creation, a file gets the version number 1.1 by default The default subsequent version numbers are 1.2, 1.3,..., but either of the two parts can be changed by the user

Revision Control System (RCS) 2 Release number is generally changed only when the file has undergone a major revision Any version number can be retrieved and changed May lead to a branch Version numbers from that branch (assuming x.y version being branched) are x.y.1.1, x.y.1.2,... Branch adds branch number and sequence number to the version number rcs keeps the latest version number of the file in full If an earlier version is requested, it works backwards, undoing the changes that were applied since the version was saved sccs keeps the original and the changes, and has to apply all the changes to retrieve the latest version Multi-level branches RCS can generate a sub-branch from a branch, leading to revision numbers 1.5.1.3.x.y SCCS cannot go beyond two-levels in branching, limiting the versions to 1.5.1.3 The RCS subdirectory Project control subdirectory Create a subdirectory called RCS in the directory containing the files to go under rcs rcs uses this directory to keep the rcs-encoded files rcs-encoded files, also known as archive files, have special names and end with the two-character suffix,v.,v refers to the multiple versions of the source file stored in the archive file Files to go under revision control Source files Files that serve as the input to the build/compilation process Cannot be constructed from other files Go under revision control Examples.c files,.h files, Makefile Derived files Files produced by or during the build process Can always be reproduced from the source files Do not go under revision control Examples.o files, executables Put the dynamically modified source files under revision control Things needed to reconstruct derived files Compiler used Header files, and their revision numbers Object file libraries linked against, and their revision number Shared library images used with the derived files at run time Possible to tweak the Makefile to keep track of revision numbers for each release Archive file or rcs file The file that contains all the sources, and their modifications, along with the revision numbers Also contains a history or log of changes, including why those changes were made Also contains some administrative information, such as the users who are authorized to change the file Creating an rcs file

Revision Control System (RCS) 3 An rcs file is created by using the ci (check in) command as follows: % ci foo.c RCS/foo.c,v < foo.c enter description, terminated with a single. or end of file: NOTE: This is NOT the log message! >> File to illustrate the checking in for RCS >>. initial revision: 1.1 done % Check in is used to refer to the addition of a new revision to an rcs file If the RCS directory does not exist, the archive file is created in the current directory Retrieving and recording changes to an rcs file An rcs file is retrieved by using the co (check out) command as follows % co foo.c RCS/foo.c,v > foo.c revision: 1.1 done % The command co by itself recovers the file in read-only mode and the file checked out in this fashion cannot be modified If you want to check out the file for modification, you need to ask rcs to lock it for you (so that others cannot modify it at the same time) as follows: % co -l foo.c RCS/foo.c,v > foo.c revision: 1.1 (locked) done % Once you have locked a file, rcs will not allow you to overwrite it % co foo.c RCS/foo.c,v > foo.c revision: 1.1 writable foo.c exists; remove it? [ny](n): n co: checkout aborted % Notice that n is the default response to the question about file removal Eager locking vs. lazy locking Eager locking is default in both RCS and SCCS Lazy locking is useful when two or more developers check out the same file for modification; uses three-way merge to save the changes from all checked out revisions Checking the file back in after changes Checking in at the same major revision number ci foo.c Checking in at a new major revision number ci -r2 foo.c Checking out an older revision co -l -r1.2 foo.c Deleting a revision rcs -o1.1 foo.c Cannot remove branch points

Revision Control System (RCS) 4 Getting the history of an rcs file Use the rlog command Restricting access to an rcs file rlog foo.c The rcs command can be used to add or subtract users into the access list By default, anyone can check in an rcs file, as long as this user has write permission into the RCS directory The restricted list of users allowed to check in a file is created by rcs -asanjiv,welland,simon foo.c The above command allows only the users sanjiv, welland, and simon to access the file for modification and denies permission to everyone else Do not forget to include yourself in the list, or you will not be able to check out the files The -e option removes a user from the list rcs -esimon foo.c Keyword substitution Keyword variables in the working files are used to keep the revision notes as a part of the file The notes (keywords) are used as embedded comments in the working file The keywords are added into the working file as The keywords are expanded as $keyword$ $keyword: value$ The check-in and check-out procedures automatically update the keyword values The keywords for use with rcs are $Author$ $Date$ $Header$ $Id$ $Locker$ $Log$ $RCSfile$ $Revision$ $Source$ $State$ Checking the RCS keywords in a file Use the ident command % ident foo.c Username of the person who checked in revision Date and time of check in A title that includes rcs file s full pathname, revision number, date, author, state, and (if locked) the person who locked the file Same as $Header$, but exclude the full pathname of the rcs file Username of the person who locked the revision; if the file is not locked, this value is empty The message that was typed in to describe the file; preceded by the rcs filename, revision number, author, and date; Log messages are accumulated and are not overwritten The rcs filename, without its pathname The assigned revision number The rcs filename, including its pathname The state assigned by the -s option of ci or rcs commands The file must be checked out to check the current value of the keywords If the file is not checked out, you can see the keywords by % co -p foo ident Also works with the object files generated from the source files if the source contains the following code:

Revision Control System (RCS) 5 char rcsid[] = "$Author: sanjiv$ Command line options The description and log messages can be entered over the command line as a part of the command when a file is checked in % ci -m"added the extra feature to read 3D vector and \? to operate on the same." vector.c The description message is added by using the -t option % ci -t"the file to perform all the vector operations in the world." vector.c If the description message is contained in a file, you can just specify the file name where desc contains the description message ci -tdesc vector.c The -l option with ci checks out the file and locks it while it is checked in The -u option with ci checks out the file and does not lock it while it is checked in The -w option with ci sets the $Author$ keyword to a specified user ci -wsmith foo Using the -w option with co retrieves the latest version checked in by the specified user co -wsmith foo If a user is not specified, it defaults to the user who invokes the command Files in unrelated directories If the archive files are not in the RCS directory, they can be checked out by specifying the location of the RCS directory co foo.c /v3/sanjiv/top_sktch/jpeg/rcs/foo.c,v Similarly, they can be checked back in ci foo.c /v3/sanjiv/top_sktch/jpeg/rcs/foo.c,v In both of the above commands, the order of files does not matter Comparing a working file to its RCS file The rcsdiff command compares the working file with the last checked in revision By default, rcsdiff foo.c compares foo.c with the last revision The older revisions can be checked by specifying the revision number as a command line option rcsdiff -r1.2 foo.c

Revision Control System (RCS) 6 The difference between two checked in revisions can be found by rcsdiff -r1.2 -r2.1 foo.c Discarding a working file The file can be discarded by using the administrative command rcs with the option -u for unlock Just removing the working file by using the rm command may not be enough as you have to unset any locks The general command to do the same is rcs -u foo.c If you want to unlock a particular revision, you can do the same by rcs -u1.2 foo.c To discard a working file and replace it with its original version, the command is co -f -u foo.c Cleaning up an RCS source directory The checked out files that have not been modified can be removed by using the rcsclean command With -u option, the working file is removed if it matches the corresponding revision and the lock is removed as well The commands executed by rcsclean are echoed to stdout The -n option lets you see the commands to be executed by rcsclean without actually executing them Extending source control to multiple releases The files for a release are shared between different persons involved in the development process, with the following conditions The word public implies group or world depending upon the persons to whom we want to allow access to the files The files must be publicly read/write-able The RCS directory itself must have public read/write/execute permissions The users should be able to go over the entire path, i.e., all the directories leading to the RCS directory should be publicly readable You must keep track of the specific revision of each file that contributes to a given release This information (specific revision number of each file) is called a snapshot of the source files Virtual snapshot Release numbers of the files in rcs directory Compared with physical snapshots Three-way merge

Revision Control System (RCS) 7 Phenomenon where you apply the same changes to more than one branch of the source tree in parallel The revisions 1.3.1.1 and 1.4 in such a case will lead to revision 1.5 Merge depends on finding a common ancestor of the two revisions (1.3) The changes applied to 1.3.1.1 are also applied to 1.4 and the new release is the result of the merge Problems with the three-way merge Results may be semantically, or textually, incorrect Some lines may have been changed in both the revisions, and in a different manner in each of them This may lead to loss of some changes in one of the revisions Working with views View is a virtual snapshot Private view Snapshot for the developer Everything the developer has currently checked out plus public revisions from each file that is not being modified by him Experimental view with the parts under modification being private for the developer Latest view Head revision of the main line of each file Available to anyone who can access the project More stable than the private view as only the tested portions are checked in Release Patch Revision of each source file that is included in a given release Files that are changed to fix bug(s)