Computer Labs: Version Control with Subversion

Similar documents
Computer Labs: Version Control with Subversion

Version Control System. -- base on Subversion 1.4

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

Using Subversion with LeMANS and MONACO

What is Subversion and what does it do?

Apache Subversion Tutorial

Computational Physics Compiling a C++ program

Chapter 3. Revision Control

CSCI 2132: Software Development. Norbert Zeh. Faculty of Computer Science Dalhousie University. Subversion (and Git) Winter 2019

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

VSO. Configuration Management

Software Tools Subversion

Tools for software development:

Working with CVS in Eclipse

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

Subversion Repository Layout

Version Control Systems (VCS)

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

Revision Control. Software Engineering SS 2007

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

An Introduction to Subversion

Manage quality processes with Bugzilla

Managing your code: version control

MNXB Working with SVN. Florido Paganelli Lund University Tutorial 2b

Revision control systems (RCS) and. Subversion

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

Subversion. Network Monitoring & Management

Assembla & TortoiseSVN

Source Code Management

Version Control Systems

Department of Computer Science College of Engineering Boise State University

Version Control System GIT

COSC345 Software Engineering. Version Control

Using Git to Manage Source RTL

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

A Short Introduction to Subversion

CSC 2700: Scientific Computing

CSE 160: Introduction to Parallel Computation

Importing Files and Directories $ svnadmin create \

Introduction to Revision Control

Systems Programming Advanced Software Development

Software Development. Using GIT. Pr. Olivier Gruber. Laboratoire d'informatique de Grenoble Université de Grenoble-Alpes

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

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

Apache Subversion (SVN)

Project Management. Overview

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

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

Yinghui Wang

CS108, Stanford Handout #37. Source Control CVS

Warmup. A programmer s wife tells him, Would you mind going to the store and picking up a loaf of bread? Also, if they have eggs, get a dozen.

Apache Subversion (SVN)

Using Assembla in PracTEX Production

Working with GIT. Florido Paganelli Lund University MNXB Florido Paganelli MNXB Working with git 1/47

Source control with Subversion A user perspective

Using CVS to Manage Source RTL

FEEG Applied Programming 3 - Version Control and Git II

Decentralized Version Control Systems

CS 320 Introduction to Software Engineering Spring February 06, 2017

Introduction to Version Control

Version Control. Version Control

Version Control. Version Control

Computer Labs: Debugging

Version Control. CSC207 Fall 2014

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

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

TDDC88 Lab 4 Software Configuration Management

Revision Control. An Introduction Using Git 1/15

Handout 4: Version Control Reference

Working with EGL and Subversion Using RDi with RBD

CSE 390 Lecture 9. Version control and Subversion (svn)

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

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

CS2720 Practical Software Development

CVS Application. William Jiang

Github/Git Primer. Tyler Hague

Assumptions. GIT Commands. OS Commands

GIT TUTORIAL. Creative Software Architectures for Collaborative Projects CS 130 Donald J. Patterson

Integrating PowerBuilder & SVN

Technology Background Development environment, Skeleton and Libraries

Using Subversion for Source Code Control

12/7/09. How is a programming language processed? Picasso Design. Collaborating with Subversion Discussion of Preparation Analyses.

Computer Labs: Lab 5 & Sprites

A BASIC UNDERSTANDING OF VERSION CONTROL

Bazaar VCS. Concepts and Workflows

Section 2: Developer tools and you. Alex Mariakakis (staff-wide)

Agenda. - Final Project Info. - All things Git. - Make sure to come to lab for Python next week

Version control CSE 403

Table of Contents: Tortoise SVN is used as a source control for FpML.

GIT TO DA REPO! VERSION CONTROL, GITLAB, AND ISU

Subversion Branching and Merging. Jan Skalický

Autodesk Vault and Data Management Questions and Answers

Branches in Subversion, Debugging, scmbug

Exercise 3: Adding a file to the master directory

Versioning. Jurriaan Hage homepage: Slides stolen from Eelco Dolstra.

Version Control with CVS

Workshop: High-performance computing for economists

Managing Source Code With Subversion

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

Submitting your Work using GIT

Transcription:

Computer Labs: Version Control with Subversion 2 o MIEIC Pedro F. Souto (pfs@fe.up.pt) November 21, 2010

The Problem $edit foo.c, make, run, edit, make, run,... OK! Now that it enters in graphic mode, let s make a backup $copy foo.c foo.v1.c $edit foo.c, make, run, edit, make, run,... OK! Now that it maps graphic memory, let s make another backup $copy foo.c foo.v2.c $edit foo.c, make, run, edit, make, run,... OK! Now that it draws a pixel, let s make another backup $copy foo.c foo.v3.c $edit foo.c, make, run, edit, make, run,... Oops! Does not leave graphics mode, let s retrieve the backup $copy foo.v7.c fooc. Hmm! This is not the version I want. Should it be v3?... Oops, deleted the last version!@ #%/#*&$@

The Solution? Subversion! (SVN) Subversion is a version control system that is able to: Keep several versions of an entire (development) directory tree Restore any of the versions it keeps in a consistent way Furthermore, it: supports concurrent access to the different files or directories in the tree by several users; keeps a log of the changes performed to each file/directory that can be used to document/keep track of the main changes between versions allows to create new branches, i.e. to keep track of the evolution of multiple directory trees that have a common ancestor (i.e. a tree of directory trees)

SVN Key Concepts Repository This is the central store (and the server program) that keeps the different versions of the data It usually keeps data for different projects We ll refer to the data of a project kept in the repository as... the repository Working Copy This is a copy of one version of the data of a project. The working copy is kept in a client computer, which is usually different from the computer that keeps the repository The working copy is a standard directory tree Other programs, like editors and compilers, do not need to be version-control-aware There may be several working copies of a given repository (project), thus supporting the collaboration of multiple programmers in a project Revision A new revision (version) is created by committing to the repository the changes done in a working copy

SVN: The Repository and Working Copies Source: Ben-Collins-Sussman et al. Version Control with Subversion

SVN: Revisions Revision A new revision (version) is created by committing to the repository the changes done in a working copy Source: Ben-Collins-Sussman et al. Version Control with Subversion

SVN: Multiple Projects Source: Ben-Collins-Sussman et al. Version Control with Subversion

SVN: Basic Usage Generate a working copy using checkout Repository checkout Working copy

SVN: Basic Usage Change the working copy with your favorite editor Repository Working copy

SVN: Basic Usage Publish your changes on the repository with commit Repository commit Working copy

SVN: Multiple Users Often several users work concurrently on their own working copies, normally on different files Repository A B A B A B Working copy 1 Working copy 2

SVN: Multiple Users When a user commits its changes, the working copies of the remaining users become outdated Repository A B commit A B A B Working copy 1 Working copy 2

SVN: Multiple Users To bring its working copy in sync with the latest version of the repository a user must update it Repository A B update A B A B Working copy 1 Working copy 2

SVN: Conflicts with Multiple Users Source: Ben-Collins-Sussman et al. Version Control with Subversion To address this problem SVN uses a versioning approach known as Copy-Modify-Merge

SVN: Automatic Conflict Detection Source: Ben-Collins-Sussman et al. Version Control with Subversion

SVN: Manual Conflict Resolution Source: Ben-Collins-Sussman et al. Version Control with Subversion

SVN: Main Commands checkout create a working copy add add a file/directory to the working copy delete remove a file/directory to the working copy move rename a file in the repository status list changes made to the working copy diff show differences between the working copy and the repository, or between revisions in the repository update update the working copy commit update the repository log list messages with date and author information attached to revisions and which paths changed in each revision Other commands include mkdir and copy, but they do little more than add

SVN Session: Creating a Repository and Adding a File First, let s check out empty repository (which was previously created) $ svn checkout file:///home/pedro/svn/at/ A at Checked out revision 1. $ cd at $edit foo.c, make, run, edit, make, run,... OK! Now that it enters in graphic mode, let s make a backup $svn add foo.c A foo.c $svn commit -m "Enters graphic mode" foo.c Adding foo.c Transmitting file data. Committed revision 2. $edit foo.c, make, run, edit, make, run,...

SVN Session: Committing Chantes to a File OK! Now that it maps graphics memory, let s make another backup $ svn commit -m "Memory maps graphics memory" foo.c Sending foo.c Transmitting file data. Committed revision 3. $edit foo.c, make, run, edit, make, run,... Hmmm, let s see version 2 $ svn update -r 2 foo.c U foo.c Updated to revision 2. $edit foo.c OK! Let s retrieve the latest version $ svn update foo.c U foo.c Updated to revision 3. $edit foo.c

SVN Session: Modification History Hmm, in which version was memory mapping added? $ svn log foo.c ---------------------------------------------------------------------- r4 pedro 2010-11-16 17:04:14 +0000 (Tue, 16 Nov 2010) 1 line Draws pixel ---------------------------------------------------------------------- r3 pedro 2010-11-16 16:48:41 +0000 (Tue, 16 Nov 2010) 1 line Memory maps graphics memory ---------------------------------------------------------------------- r2 pedro 2010-11-16 16:40:41 +0000 (Tue, 16 Nov 2010) 1 line Enters in graphics mode ----------------------------------------------------------------------

SVN: Checkout and Log Weekend and I have forgotten LCOM s project! (#%@&#$ ) Wait... Sem problemas : $svn checkout <URL>/svn/at/ foo.c A foo.c/foo.c Checked out revision 4. Did Zé add something new? $ svn log foo.c ---------------------------------------------------------------------- r5 zemanel 2010-11-16 17:15:41 +0000 (Tue, 16 Nov 2010) 1 line Draws line ---------------------------------------------------------------------- r4 pedro 2010-11-16 17:04:14 +0000 (Tue, 16 Nov 2010) 1 line Draws pixel [...]

SVN Session: Diff and Update What did Zé do? $ svn diff -r 5:4 foo.c Index: foo.c =============================================================== --- foo.c (revision 5) +++ foo.c (revision 4) @@ -16,7 +16,3 @@ void draw_pixel() { } - -void draw_line() { - -} Great! Let s update my copy: $svn update Conflict discovered in foo.c. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: r G foo.c Updated to revision 5.

SVN Session: Status Not exactly what we were expecting:... void draw_pixel() { } +<<<<<<<.mine + +void draw_rectangle() { +} +======= + +void draw_line() { +} +>>>>>>>.r5 but it can be fixed... OK! What s the current status of our working copy? $ svn status -u -v foo.c M 5 5 pedro foo.c Status against revision: 5

SVN: Advantages It provides automatic backup It makes it easy to restore a previous version It is supported by most IDEs Users can work on any computer Members of a team can work simultaneously and independently on the same project It logs who did/committed what and when By using appropriate messages or comments, it is also possible to know why It is possible to try a new approach, and continue development on the older one

TortoiseSVN-1

TortoiseSVN-2

TortoiseSVN-3

Thanks to: I.e. shamelessly translated material by: João Cardoso (jcard@fe.up.pt)

Further Reading Serch the web for the right tutorial for you on SVN TortoiseSVN Ben Collins-Sussman et. al Version Control with Subversion [DRAFT] For Subversion 1.6