The Design Workshop Introduction to Version Control 1.

Slides:



Advertisements
Similar presentations
TortoiseSVN By Group 1 Team B. Installing TortoiseSVN.
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.
 Please sit next to your partner.  If you don’t have a partner, please find one now.
1. What is Subversion? Why do we need CM? Basic concepts Repositories Options Setup Clients Options Setup Operation Troubleshooting Slide 2.
Version Control System (Sub)Version Control (SVN).
Version Control 1.  Version control (or revision control) is the term for the management of source files, and all of the intermediate stages as development.
Software Configuration Management Donna Albino LIS489, December 3, 2014.
David Notkin Autumn 2009 CSE303 Lecture 22 Subversion is an open source version control system. Social Implications Friday version control system.
Concepts of Version Control A Technology-Independent View.
2/6/2008Prof. Hilfinger CS164 Lecture 71 Version Control Lecture 7.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
Source Code Revision Control with Subversion Christophe Dupré May 13, 2005 Update KEJ May 10, 2006 Scientific Computation Research Center Rensselaer Polytechnic.
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
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.
Software Configuration Management (SCM)
Version control Using Git 1Version control, using Git.
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.
Subversion. What is Subversion? A Version Control System A successor to CVS and SourceSafe Essentially gives you a tracked, shared file system.
Version Control with Subversion Quick Reference of Subversion.
Introduction to Versioning
Subversion Code Deployment LifeCycle August 2011.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
Version control Using Git Version control, using Git1.
Subversion (SVN) Tutorial Source:
…using Git/Tortoise Git
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
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.
Version Control Menggunakan TortoiseSVN
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?
SENG 403 Tutorial 1 1SENG 403 – Winter Agenda Version Control Basics Subversion Basic actions in Subversion Some examples 2SENG 403 – Winter 2012.
DireXions – Your Tool Box just got Bigger PxPlus Version Control System Using TortoiseSVN Presented by: Jane Raymond.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
CSE 219 Computer Science III CVS
Refactoring and Synchronization with the StarTeam Plug-in for Eclipse  Jim Wogulis  Principal Architect, Borland Software Corporation.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
Version Control Reducing risk with version control Jon Austin
Copyright © Curt Hill Tortoise SVN A Subversion Client.
L.T.E :: Learning Through Experimenting Using google-svn for MtM Docs Development Denis Thibault Version 3.2 Mar 12 th, 2009.
Sabriansyah R.A Version Control. The Repository Subversion adalah sistem tersentralisasi untuk informasi sharing Repository adalah pusat penyimpanan data.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
Part 4: FCM and the UM University of Reading, December 2015.
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.
WinCVS Training è Basic Concepts è Download & Setup è Importing a new module into CVS Repository è Getting new module from CVS è Getting Latest version.
1 CSE 303 Lecture 19 Version control and Subversion ( svn ) slides created by Marty Stepp
(1) Introduction to Subversion (SVN) and Google Project Hosting Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences.
(1) Introduction to Subversion (SVN) and Google Project Hosting Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Source Control Repositories for Enabling Team Working Doncho Minkov Telerik Corporation
1 Subversion Kate Hedstrom April Version Control Software System for managing source files –For groups of people working on the same code –When.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 28-Jun-16.
CompSci 230 Software Construction
Version Control with Subversion
SVN intro (review).
Version control, using Git
Software Engineering for Data Scientists
Concurrent Version Control
Version Control System
LECTURE 3: Software Configuration Management
slides borrowed and adapted from Alex Mariakis and CSE 390a
Concurrent Version System (CVS)
Subversion Basics Guide
Systems Analysis and Design I
Presentation transcript:

The Design Workshop Introduction to Version Control 1

Agenda Introduction to Version Control Exercise 1: Project Initialization Exercise 2: Project Modification (Automatic Merge) Exercise 3: Project Modification (Manual Merge) Closing Comments 2

Motivation for Version Control The project based work requires several developers to access the same files at the same time, hence some sort of coordination is needed Several tools are available for this purpose, amongst others Subversion (SVN), which enables a group of developers to work seamlessly on a set of source files (if used properly) The Subversion architecture is a based on a centralized model, where the version control functions are performed on a shared server. A free hosting service is provided by Google, offering a Subversion interface An open source graphical client (tortoiseSVN) that integrates into Windows Explorer is available from 3

Version Control Terminology Basic Setup Repository: The database storing the files Working Set/Working Copy: Your local directory of files, where you make changes. Trunk/Main: The “primary” location for code in the repository. Think of code as a family tree – the “trunk” is the main line. Head: The latest revision in the repo. Basic actions Check out: Retrieve a copy of the project source from the repository Update: “Resync” your local copy to reflect the development from the repository Commit: “Push” your local modifications to the repository Resolve Conflict: When two developers make contradicting modifications (same file, same line) the SVN server is not able to merge automatically, and a conflict appears. The developer needs to resolve this conflict (through a manual merge) 4

Example: The Grocery List 5 An example is used for describing the concept. The life cycle of a text file describing the grocery list for a restaurant is tracked. Firstly, basic ingredients for existing menus are added to the grocery list producing new revisions of the file.

Example: The Grocery List 6 At each modification the file is checked out, modified, and subsequently checked in. The modification could also be discarded by reverting to the previous version.

Example: The Grocery List 7 The trunk has a history of changes as a file evolves. Diffs are the changes you made while editing: imagine you can “peel” them off and apply them to a file. For example, to go from r1 to r2, we add eggs (+Eggs). Imagine peeling off that red sticker and placing it on r1, to get r2.

Example: The Grocery List 8 Branches let us copy code into a separate folder so we can modify it separately. For example, we can create a branch for new, experimental ideas for our list: crazy things like Rice or Eggo waffles.

Example: The Grocery List 9 When merging back we only want to apply the changes that happened in the branch. That means we diff r5 and r6, and apply that to the trunk.

Example: The Grocery List 10 Conflicts arise when contradicting modifications are merged. Joe wants to remove eggs and replace it with cheese (-eggs, +cheese), and Sue wants to replace eggs with a hot dog (-eggs, +hot dog).

Example: The Grocery List 11 At this point it’s a race: if Joe checks in first, that’s the change that goes through (and Sue can’t make her change). When changes overlap and contradict like this, SVN reports a conflict and won’t let you check in – it’s up to you to check in a newer version that resolves this dilemma, coordinate with the other developer. Conflicts are infrequent but can be a challenge.

Example: The Grocery List 12 Tags are principally just branches that you agree not to edit, which enables a tag (label) to be applied any revision for easy reference. This way you can refer to “Release 1.0″ instead of a particular revision.

Example: Life Cycle For the purpose of this workshop (and probably the next ones as well) branching and tagging is discouraged. Do all your development within the trunk, and thereby simplify the use of version control. 13

Agenda Introduction to Version Control Exercise 1: Project Initialization Exercise 2: Project Modification (Automatic Merge) Exercise 3: Project Modification (Manual Merge) Closing Comments 14

Prerequisites 15 Server Side (Google Hosting) Google Account (one per developer)Google Account Find your personal password from “Profile”  “Settings” when logged in Software Project (one per group)Software Project Choose an “owner” that creates the project (choose Subversion as version control system) and adds the other group members from “Project Home”  “People” Project name ucn-workshop-design-dmXX-groupY (XX = class no, Y = group no) Client Side (TortoiseSVN) TortoiseSVN (needs to be installed on each developers computer)TortoiseSVN SCPlugin (Mac OS X variant – appears not to work flawlessly with OS X 10.6)SCPlugin

Checking out the Project 16 When signed in (at Project Hosting) go to the project page and further to the Source tab. The URL of the project is in the formProject Hosting Use TortoiseSVN to check out the project, and add the above URL Right click  “SVN Checkout…” and enter your credentials when requested Ensure all group members have checked out the project before proceeding

Adding Files to the Project 17 One of the group members copies the framework files to the SVN folder (where the project is checked out) and right clicks all the files  “TortoiseSVN”  “Add…” 

Adding Files to the Project 18 At the moment the files are only “marked for addition”, commit to push this modification to the repository (right click  “SVN commit”)

Distributing the Files 19 The framework files should now be present at the repository, and all developers now need to “update” to achieve a working copy of the files. Make a new BlueJ project based on the files, and ensure that the two packages appear within the project.

Agenda Introduction to Version Control Exercise 1: Project Initialization Exercise 2: Project Modification (Automatic Merge) Exercise 3: Project Modification (Manual Merge) Closing Comments 20

Project Modification (Automatic Merge) The purpose of this exercise is to have two developers modify the same file, which is then automatically merged when subsequently committed to the repository. Each group is thus to be split in two – representing two developers refactoring source code independently of each other. Ensure that both developers share the same project revision Update on both computers and check the revision number 21

Project Modification (Automatic Merge) The refactoring is now to begin from within the file “AddressCtr.java”: Developer1 renames the method “createPerson” to “createPersonDeveloper1” Developer2 renames the method “deletePerson” to “deletePersonDeveloper2” Developer1 now commits the modification to the repository, and developer2 discovers that an update is required before a commit can take place 22

Project Modification (Automatic Merge) At an update (by developer2), developer1’s modification is successfully merged into developer2’s local copy A subsequent commit (by developer2) will now create revision 8 within the repository, containing both modifications 23

Agenda Introduction to Version Control Exercise 1: Project Initialization Exercise 2: Project Modification (Automatic Merge) Exercise 3: Project Modification (Manual Merge) Closing Comments 24

Project Modification (Manual Merge) Once again, the purpose is to have two developers modify the same file, however now within the same line. SVN will not be able to merge this automatically, and a manual resolution is required. Once again ensure that both developers share the same project revision by comparing the revision information at the update procedure. The refactoring is now to begin from within the file “AddressCtr.java”: Developer1 renames the method “createPersonDeveloper1” back to the original “createPerson”, and commits subsequently Developer2 renames the method “deletePersonDeveloper2” back to the original “deletePerson”, and renames “createPersonDeveloper1” to “createPersonDeveloper2”, and attempts a commit (after the required update) 25

Project Modification (Manual Merge) As the two developers have modified the same file within the same line a conflict is to be created  right click the file and choose TortoiseSVN  “Edit Conflict” 26 Developer1’s modifications Developer2’s modifications Merge result Use blue arrows for the resolution Mark as resolved when done

Project Modification (Manual Merge) Let us accept developer1’s modification (“use theirs”), and mark the conflict as resolved. To ensure subsequently that the conflict has been correctly resolved, right click (in explorer)  “TortoiseSVN”  “Check for modifications” The status should be “modified” and a sanity check can be made by “Compare with base”. The modification can now be committed, and we are back to square 27

Agenda Introduction to Version Control Exercise 1: Project Initialization Exercise 2: Project Modification (Automatic Merge) Exercise 3: Project Modification (Manual Merge) Closing Comments 28

Subversion Best Practices Always update before modification (working from the head of the development reduces the risk of conflicts) Avoid adding auto-generated files to SVN (conflict are likely to appear in the nature of things) During the initial trials of SVN usage, backup the local copy before interfacing the server Always test your modification prior to committing to the repository Ensure a stable trunk – no one likes fixing other developers’ bugs! Agree within the group upon a “quality gate” e.g. successful compilation or successful execution of a set of test cases When applying SVN commands work from the top level folder of the project to ensure that all modifications are committed 29

Subversion Best Practices … and probably the most important Prior to committing, do a “diff” on the changeset, to ensure only intended modifications are committed (or use the “Check for modifications” along the way) 30