26

Concurrent Versions System Lecture 5

  • Upload
    ford

  • View
    52

  • Download
    1

Embed Size (px)

DESCRIPTION

Concurrent Versions System Lecture 5. Course Name: High Level Programming Language Year : 2010. Learning Outcomes. At the end of this lecture, students are capable of: Using CVS (Concurrent Version System). Outline Materi. Problem in creating a good program Solution to the above problem - PowerPoint PPT Presentation

Citation preview

Page 1: Concurrent Versions System Lecture 5
Page 2: Concurrent Versions System Lecture 5

Concurrent Versions SystemLecture 5

Course Name: High Level Programming LanguageYear : 2010

Page 3: Concurrent Versions System Lecture 5

3

Learning Outcomes

At the end of this lecture, students are capable of:

• Using CVS (Concurrent Version System)

Page 4: Concurrent Versions System Lecture 5

4

Outline Materi

• Problem in creating a good program• Solution to the above problem• What is CVS?• Software Cyclus• Using winCVS

Page 5: Concurrent Versions System Lecture 5

5

Problem in creating a good program

Page 6: Concurrent Versions System Lecture 5

6

Problem in creating a good program

• Bugs that has already been fixed, suddenly reappearing

• Do not know the last version of a particular version of the program

• The last version, apparently erased with the older version

Page 7: Concurrent Versions System Lecture 5

7

• The documentation is not inline with the program that is being made

• Do not know whether the changes that have been proposed, had been implemented or not in that particular program

Problem in creating a good program

Page 8: Concurrent Versions System Lecture 5

8

• Which version that need to be used?

• I have lost my last revision of my program

Problem in creating a good program

Page 9: Concurrent Versions System Lecture 5

9

Solution

• You need to learn a revision control software, which is called CVS– Concurrent

Version System

Page 10: Concurrent Versions System Lecture 5

10

What is CVS?

• A process that identifies and combines files that are part of the whole one result software. By controlling the changes that were made during the creation of that software.

• To arrange different version in that software’s project.

• To be able to return to the previous version of that software (because it can be happened that the previous version is better than the newer one)

Page 11: Concurrent Versions System Lecture 5

11

Software Cyclus

Specification Design

Analysis of Users Requests Specifies the goals of the Software

Design of Software

Coding

TestingTest function and data

Operasional System

Code Program

Implementation

Page 12: Concurrent Versions System Lecture 5

12

Using winCVS

• Setting up winCVS• Projek in winCVS• Using winCVS

Page 13: Concurrent Versions System Lecture 5

13

RCS and History from Control Versioning System

• RCS: – Design by Walter Tichy, Faculty of

Computer Science, Universitay of Purdue. – RCS is a software tool for Unix’s machine,

that allows us to control a system that “has a lot of revision, e.g.: text, program or even documents”

Page 14: Concurrent Versions System Lecture 5

14

CVS is system that control versioning or revision of program or data.CVS is used to record history of program’s files.

Bugs can happen during software’s modification, and probably will not be detected after a long time after that modification was done. With CVS, you can open an old file record, before that modification and finding out what causes the bugs.

CVS can also be useful for a project that is being done by a couple of people, in which the repository can be overlapped easily between one’s work and the others. CVS can handle this problem by providing each of the developers their own directories. And later on ask CVS to do merging from the results of each developer. CVS files are recorded using RCS systems, in which RCS is an abbreviation of Revision Control System.

About Concurrent Versions System (CVS)

Page 15: Concurrent Versions System Lecture 5

15

Model Check In - Check Out

• Each programmer works in his/her own local area.

• After the program is revised, then that program has to check-in to a central repository.

• Program insides the central repository has to be checked-out first, before they can be modified.

Page 16: Concurrent Versions System Lecture 5

16

Example of File CVS *,v

– edit helloworld.c,v 1.1log @Initial revision @ text @#include void main(void) { printf("Hello, world!\n") }

@

Page 17: Concurrent Versions System Lecture 5

17

Setting Up CVS

– First, set variable CVSROOT to …/`username`/…/cvsroot

– (c:\cvsroot )• Run program wincvs.

• And then run cvs -d :local:c:\cvsroot init • The action above will create cvsroot’s directory as

the central repository

Page 18: Concurrent Versions System Lecture 5

18

Placing a Project File into the CVS Repository

– Supposed you have a file in c:\HelloWorldCVS

– Then type: cd HelloWorldCVS– After that do Remote: Import module

cvs import -I ! -I CVS -m "Importing data to repository central CVS" HelloWorldCVS avendor arelease (in directory C:\HelloWorldCVS\)

Page 19: Concurrent Versions System Lecture 5

19

Accessing CVS Repository

– cd to your local directory, in which you are working with (cd HelloWorldCVS)

– cvs checkout -P HelloWorldCVS (in directory C:\HelloWorldCVS)

– Creates a project directory inside HelloWorldCVS and put the newest file from the repository

– Make changes to that file– And then do: cvs commit -m “Add new

coding" hello.c

Page 20: Concurrent Versions System Lecture 5

20

Updating Local Area in CVS

– cvs update <filename>• To compare files in working copy with the one

in the repository.

• cvs update -P hello.c (in directory C:\HelloWorldCVS\HelloWorldCVS\)

• M hello.c

• Modified: means that file hello.c has been changed to a working copy

Page 21: Concurrent Versions System Lecture 5

21

Updating Area Lokal dalam CVS– To see differences made between files in

working directory and in repository, you can use a command: diff(erent)

– cd ke projek direktori lokal – cvs diff

cvs diff hello.c (in directory C:\HelloWorldCVS\HelloWorldCVS\)Index: hello.c===================================================================RCS file: c:/cvsroot/HelloWorldCVS/hello.c,vretrieving revision 1.1.1.1diff -r1.1.1.1 hello.c3a4> printf ("Goodbye, world!\n");

Page 22: Concurrent Versions System Lecture 5

22

Add/Delete file in CVS

– Add a new file• Get a working copy of the module. • Create the new file inside your working

copy. •cvs add filename : CVS version

controls it•cvs commit filename : add it to

repository

– Delete a file• rm filename•cvs remove filename •cvs commit filename

Page 23: Concurrent Versions System Lecture 5

23

The Achieved Objectivites– Now, You have been able to:

• Setup CVS – creating a repository• Placing a project inside CVS repository• Using CVS.

– Next Exercises:• What does it mean by branching and why is it

useful?• Explain the following cvs commands: cvs tag

release-1, cvs checkout -r release-1 project, cvs release -d project, cvs rtag -b -r release-1 release-1-patches project, cvs checkout -r release-1-patches project, cvs checkout -j release-1-patches project, cvs commit -m “Merged patch”,…

Page 24: Concurrent Versions System Lecture 5

Conclusion• In order to create a complex software with a

groups of software engineers, we need a CVS software to control our versioning.

• WinCVS is one such software that implements CVS mechanism, such as create repository, check in, check out, etc.

24

Page 25: Concurrent Versions System Lecture 5

25

Topic For Next Week

• Classes• Assignment (taken from book “Cpp

Essentials.pdf” page 113, chapter 6 – Classes):1. Define a class named “Complex” for representing

complex numbers. A complex number has the general form a + ib, where a is the real part and b is the imaginary part (I stands for imaginary). Complex arithmetic rules are as follows:

Page 26: Concurrent Versions System Lecture 5

Topic For Next Week

(a + ib) + (c + id) = (a + c) + i(b + d)(a + ib) - (c + id) = (a + c) - i(b + d)(a + ib) * (c + id) = (ac - bd) + i(bc + ad)

Define this operations as member functions of class “Complex”.

26