Using Subversion for Source Code Control Michael McLennan HUBzero® Platform for Scientific Collaboration Purdue University This work licensed under Creative.

Slides:



Advertisements
Similar presentations
TortoiseSVN By Group 1 Team B. Installing TortoiseSVN.
Advertisements

Introduction To GIT Rob Di Marco Philly Linux Users Group July 14, 2008.
 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.
Using Subversion for Source Code Control Michael McLennan Software Architect Network for Computational Nanotechnology.
Version Control System Sui Huang, McMaster University Version Control SystemSui Huang, McMaster University Version Control System -- base on Subversion.
Version Control with CVS Peter Dinda Department of Computer Science Northwestern University.
2/6/2008Prof. Hilfinger CS164 Lecture 71 Version Control Lecture 7.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
Version Control using Subversion Albert Young-Sun Kim November 2 nd, 2005 Available at entations/ subversion/
Source Code Revision Control with Subversion Christophe Dupré May 13, 2005 Update KEJ May 10, 2006 Scientific Computation Research Center Rensselaer Polytechnic.
Subversion Takes Back the Night How Version Control makes web development better.
CS311 – Lecture 08 Outline Subversion (SVN) *All information taken from “SVN Book” O’Reilly Lecture 081CS Operating Systems I.
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Introductory Concurrent Version System (CVS) UCR Technical Seminar 10/23/03 Dan Berger
1 Using Workspaces to Develop Simulation Tools Michael McLennan Software Architect HUBzero™ Platform for Scientific Collaboration This work licensed under.
Subversion Source Code Management System Blair Zajac OrcaWare Consulting August 21, 2002.
SubVersioN – the new Central Service at DESY by Marian Gawron.
Version Control Systems and the Subversion Kloimstein Dominik.
Version Control. What is Version Control? Manages file sharing for Concurrent Development Keeps track of changes with Version Control SubVersion (SVN)
1 Uploading and Publishing New Tools Michael McLennan Software Architect HUBzero™ Platform for Scientific Collaboration This work licensed under Creative.
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.
NEEDS Berkeley Workshop 2014 NEEDS Compact Model Development Process Michael McLennan Director, HUBzero® Platform for Scientific Collaboration Purdue University.
Source Code Management with CVS Kurt Wiersma December 2004.
Subversion Code Deployment LifeCycle August 2011.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
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.” The programmer.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
Object-Oriented Analysis & Design Subversion. Contents  Configuration management  The repository  Versioning  Tags  Branches  Subversion 2.
(Sub)Version Control. 2 Keep large teams working on the same code Back up your work so you don't lose it all Compare changes to previous versions Revert.
Subversion (SVN) A Revision Control System Successor to CVS Carlos Armas Hervey Allen.
Progress with migration to SVN Part3: How to work with g4svn and geant4tags tools. Geant4.
SENG 403 Tutorial 1 1SENG 403 – Winter Agenda Version Control Basics Subversion Basic actions in Subversion Some examples 2SENG 403 – Winter 2012.
CSE 219 Computer Science III CVS
Version Control Systems. Version Control Manage changes to software code – Preserve history – Facilitate multiple users / versions.
Version Control Reducing risk with version control Jon Austin
1 CSE306 Operating Systems Projects CVS/SSH tutorial.
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)
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
1 CSE 303 Lecture 19 Version control and Subversion ( svn ) slides created by Marty Stepp
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 16 – Version control and git.
Subversion (SVN) Tutorial for CS421 Dan Fleck Spring 2010.
GIT: What, how and why ? Part 1: Basics. What do I know about git? Started using it for experiments on April 2009 Moved all voms development on git on.
© CGI Group Inc. User Guide Subversion client TortoiseSVN.
CS520 Web Programming Version Control with Subversion Chengyu Sun California State University, Los Angeles.
Software Testing and Maintenance 1 Subversion  Fundamental Concepts  Basic Usage.
DIGITAL REPOSITORIES CGDD Job Description… Senior Tools Programmer – pulled August 4 th, 2011 from Gamasutra.
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.
Problem Solving With C++ SVN ( Version Control ) April 2016.
CS491A Software Design Lab Version Control with CVS and Subversion Chengyu Sun California State University, Los Angeles.
Version Control Using Subversion Tom Hilinski Natural Resource Ecology Laboratory Colorado State University October 2007
CS1010: Intro Workshop.
SVN intro (review).
Subversion Reasons to use How it works Subversion important commands
Version Control with Subversion (SVN)
Subversion.
Distributed Version Control with git
slides borrowed and adapted from Alex Mariakis and CSE 390a
Compilers, Make and SubVersion
User Guide Subversion client TortoiseSVN
Subversion Basics Guide
Git started with git: 2018 edition
Prof. Hilfinger CS164 Lecture 4
Presentation transcript:

Using Subversion for Source Code Control Michael McLennan HUBzero® Platform for Scientific Collaboration Purdue University This work licensed under Creative Commons See license online: by-nc-sa/3.0

Client/Server model: Subversion repository Server Clients What is Subversion? CVS on steroids Created by developers at CollabNet In development since 2000 In production (version 1.0) since Feb 2004 Open source (Apache/BSD-style license) Unix/Linux, Win32, BeOS, OS/2, MacOS X Home page: Upload: add/commit Download: checkout

working x1 x2 Why bother with Subversion? Does this sound familiar? NCSA hamlet test CPU: 420sCPU: 340s v1 = v2 = v1 = v2 = x2 output v1 = v2 = v1 = v2 = x3.1a output x2 x2.1 x2.2 x2 x3 x3.1 ?

Top 5: Why you should use Subversion It’s easy to learn A little simpler than Git You’ll feel more secure SSL transport between client/server; repository is backed up Where did I put that… It’s in the repository Who broke the build? Look at the revision history Your hard drive just died No problem, your code is in the repository Subversion repository SSL carter NCSA 4

Getting Started Once you register your tool, your repository is created automatically trunk Subversion repository yourtool branches tags

svn checkout yourtool A yourtool/rappture A yourtool/doc A yourtool/src A yourtool/bin A yourtool/data A yourtool/middleware A yourtool/examples Checked out revision 1. mkdir examples/ex1 vi examples/ex1/README svn add examples/ex1 A examples/ex1 A examples/ex1/README svn checkout yourtool A yourtool/rappture A yourtool/doc A yourtool/src A yourtool/bin A yourtool/data A yourtool/middleware A yourtool/examples Checked out revision 1. mkdir examples/ex1 vi examples/ex1/README svn add examples/ex1 A examples/ex1 A examples/ex1/README Check out your code Instructions in your project area at wiki/GettingStarted From any machine…

Commit your changes cd yourtool svn status A examples/ex1 A examples/ex1/README ? a.out svn commit Adding examples/ex1 Adding examples/ex1/README Transmitting file data. Committed revision 2. cd yourtool svn status A examples/ex1 A examples/ex1/README ? a.out svn commit Adding examples/ex1 Adding examples/ex1/README Transmitting file data. Committed revision 2. Instructions in your project area at wiki/GettingStarted brings up your favorite editor: Created ex1 directory and added the README file. --This line, and those below, will be ignored-- A examples/ex1 A examples/ex1/README commit at the top level, so you don’t miss anything

Like any other file on your Desktop, but icon shows Subversion control What about Windows? More info: Puts svn commands onto the right-mouse-button menu:

cd examples/ex1 svn mv README README.txt A README.txt D README cd../.. svn delete doc D doc svn status D doc A + examples/ex1/README.txt D examples/ex1/README svn commit cd examples/ex1 svn mv README README.txt A README.txt D README cd../.. svn delete doc D doc svn status D doc A + examples/ex1/README.txt D examples/ex1/README svn commit Moving and removing files brings up your favorite editor: Moved some files around. --This line, and those below, will be ignored-- D doc A examples/ex1/README.txt D examples/ex1/README What are these secret codes? See this page.this page

Editing and updating svn commit svn checkout yourtool edit: Makefile svn update svn commit Copy code around Move code to new machines with “svn checkout” Move changes around with “svn commit” and “svn update” all: gcc -O hello.c all: gcc -O hello.c all: gcc -g hello.c gcc -O hello.c all: gcc -g hello.c gcc -O hello.c

Looking for differences and reverting svn status M src/hello.c svn diff src/hello.c Index: src/hello.c ===================================================== ============== --- src/hello.c (revision 4) +++ src/hello.c (working copy) -4,6 +4,7 int main(int argc, char **argv) { - printf("Hello, World!\n"); + /* say hello to everyone */ + printf("Hello, Universe!\n"); exit(0); } svn revert hello.c Reverted 'hello.c' svn status M src/hello.c svn diff src/hello.c Index: src/hello.c ===================================================== ============== --- src/hello.c (revision 4) +++ src/hello.c (working copy) -4,6 +4,7 int main(int argc, char **argv) { - printf("Hello, World!\n"); + /* say hello to everyone */ + printf("Hello, Universe!\n"); exit(0); } svn revert hello.c Reverted 'hello.c' Can also revert directory changes (adding/deleting files)

Merging changes Whoever checks in first has no problem Next “svn update” integrates compatible changes CC=gcc all: $(CC) -O hello.c CC=gcc all: $(CC) -O hello.c svn commit edit: Makefile all: gcc –O hello.c clean: rm –f *.o a.out all: gcc –O hello.c clean: rm –f *.o a.out

Merging changes Whoever checks in first has no problem Next “svn update” integrates compatible changes Use “svn commit” to commit the merged changes svn update edit: Makefile all: gcc –O hello.c clean: rm –f *.o a.out all: gcc –O hello.c clean: rm –f *.o a.out CC=gcc all: $(CC) -O hello.c clean: rm –f *.o a.out CC=gcc all: $(CC) -O hello.c clean: rm –f *.o a.out svn commit

Resolving merge conflicts Whoever checks in first has no problem Next “svn update” integrates changes CC=gcc all: $(CC) -O hello.c CC=gcc all: $(CC) -O hello.c svn commit edit: Makefile all: gcc –O hello.c –o hello clean: rm –f *.o a.out all: gcc –O hello.c –o hello clean: rm –f *.o a.out gcc –O hello.c –o hello $(CC) -O hello.c Problem here: both change the same line

Resolving merge conflicts svn update C Makefile Updated to revision 6. svn commit svn: Commit failed (details follow): svn: Aborting commit: 'Makefile' remains in conflict svn status ? Makefile.r5 ? Makefile.r6 ? Makefile.mine C Makefile svn update C Makefile Updated to revision 6. svn commit svn: Commit failed (details follow): svn: Aborting commit: 'Makefile' remains in conflict svn status ? Makefile.r5 ? Makefile.r6 ? Makefile.mine C Makefile conflict! best guess at integrated changes

Resolving merge conflicts vi Makefile CC=gcc all: <<<<<<<.mine $(CC) -O hello.c ======= gcc -O hello.c -o hello clean: rm -f *.o a.out >>>>>>>.r6

Resolving merge conflicts vi Makefile CC=gcc all: <<<<<<<.mine $(CC) -O hello.c ======= gcc -O hello.c -o hello clean: rm -f *.o a.out >>>>>>>.r6

Resolving merge conflicts vi Makefile svn resolved Makefile Resolved conflicted state of 'Makefile' svn commit Sending src/Makefile Transmitting file data. Committed revision 7. vi Makefile svn resolved Makefile Resolved conflicted state of 'Makefile' svn commit Sending src/Makefile Transmitting file data. Committed revision 7. CC=gcc all: $(CC) -O hello.c -o hello clean: rm -f *.o a.out

Retrieving an old version Get the whole distribution svn checkout –r 3 yourtool get revision 3 Get a particular file svn cat –r 5 Makefile svn cat –r 5 Makefile > Makefile show me revision 5 replace current file with revision 5 Which revision? svn log Makefile svn log show me revisions for this file show me revisions for current directory

Binary files Good defaults. Subversion usually does the right thing: cp diagram.jpg examples svn add examples/diagram.jpg A (bin) examples/diagram.jpg svn commit Adding (bin) examples/diagram.jpg Transmitting file data. Committed revision 8. When it fails, set properties yourself: cp demo.dat examples svn add examples/demo.dat A examples/demo.dat svn propset svn:mime-type application/octet-stream examples/demo.dat svn propdel svn:eol-style examples/demo.dat Recognized as a binary file: no CR/LF translation no merges, only replacements more about properties on this pagethis page

More Information Web site: Subversion Book From O’Reilly & Associates, and also onlineO’Reilly & Associatesonline Quick-start guide for your project: