Using Subversion for Source Code Control. Michael McLennan Software Architect Network for Computational Nanotechnology



Similar documents
Version Control with Subversion

Developing Tools for nanohub.org. Michael McLennan Software Architect Network for Computational Nanotechnology

Software Configuration Management AE6382

Version control. HEAD is the name of the latest revision in the repository. It can be used in subversion rather than the latest revision number.

Using SVN to Manage Source RTL

CSE 374 Programming Concepts & Tools. Laura Campbell (Thanks to Hal Perkins) Winter 2014 Lecture 16 Version control and svn

Version Control with Subversion and Xcode

Using SVN to Manage Source RTL

Managing Source Code With Subversion

Revision control systems (RCS) and

Software Delivery Integration and Source Code Management. for Suppliers

Version Control Using Subversion. Version Control Using Subversion 1 / 27

Using Subversion in Computer Science

CSE 70: Software Development Pipeline Build Process, XML, Repositories

Version Control with Subversion

Version Control. Luka Milovanov

Introduction to Subversion

Source code management systems

CS 103 Lab Linux and Virtual Machines

Modulo II Software Configuration Management - SCM

INF 111 / CSE 121. Homework 4: Subversion Due Tuesday, July 14, 2009

Technical Writing - Advantages of Version Control Systems

Version Control with Svn, Git and git-svn. Kate Hedstrom ARSC, UAF

PxPlus Version Control System Using TortoiseSVN. Jane Raymond

Version Control Systems

Introduction to Git. Markus Kötter Notes. Leinelab Workshop July 28, 2015

Week G Versioning with svn

Version Control with. Ben Morgan

SVN Starter s Guide Compiled by Pearl Guterman June 2005

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

Managing Software Projects Like a Boss with Subversion and Trac

What is Subversion? Revision Control System made to replace CVS

Version control with Subversion

CS108, Stanford Handout #33. CVS in Eclipse

Version Control with Subversion

Version Control with Git. Dylan Nugent

COSC Software Engineering. Lecture 7: Version Control

Version control with GIT

CISC 275: Introduction to Software Engineering. Lab 5: Introduction to Revision Control with. Charlie Greenbacker University of Delaware Fall 2011

Subversion workflow guide

Introducing Xcode Source Control

Flumes Short User Guide to Subversion

Setting up a local working copy with SVN, MAMP and rsync. Agentic

Introduction to Subversion

using version control in system administration

Version Control Tools

Subversion. Nadir SOUALEM. Linux Users subversion client svn or higher. Windows users subversion client Tortoise 1.6.

INTERNATIONAL GAMMA-RAY ASTROPHYSICS LABORATORY (INTEGRAL) Science Operations Centre Software Configuration Control Procedures (ISOC SCCP)

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

A Tutorial on installing and using Eclipse

Version Control with Git. Kate Hedstrom ARSC, UAF

Slides prepared by : Farzana Rahman. SUBVERSION A version control tool

Tuesday, October 18. Configuration Management (Version Control)

Version Control! Scenarios, Working with Git!

UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger

Data management on HPC platforms

DAVE Usage with SVN. Presentation and Tutorial v 2.0. May, 2014

Version Control Script

[PRAKTISCHE ASPEKTE DER INFORMATIK WS 13/14]

Git Basics. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 22

Introduction to Version Control

Derived from Chris Cannam's original at, an.

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

TOAD and SubVersion - A Quick How To. Norman Dunbar of Dunbar IT Consultants Ltd.

Q N X S O F T W A R E D E V E L O P M E N T P L A T F O R M v Steps to Developing a QNX Program Quickstart Guide

Putting It All Together. Vagrant Drush Version Control

CPSC 491. Today: Source code control. Source Code (Version) Control. Exercise: g., no git, subversion, cvs, etc.)

How to Write a Simple Makefile

Code Management With CVS Or Submission With Subversion. Gary Kedziora ANL August 19, 2005

Subversion Integration for Visual Studio

Moves and Renames in Apache Subversion 1.8 Stefan Sperling SVN Day 2012 (Jun 14)

MATLAB & Git Versioning: The Very Basics

FEEG Applied Programming 3 - Version Control and Git II

Version Control Systems (Part 2)

Mercurial. Why version control (Single users)

Git Basics. Christian Hanser. Institute for Applied Information Processing and Communications Graz University of Technology. 6.

Step By Step Guide for Starting "Hello, World!" on OpenWRT

XenClient Enterprise Synchronizer Migration

Using Git for Project Management with µvision

Version control tracks multiple versions. Configuration Management. Version Control. V Software Engineering Lecture 12, Spring 2008

Xcode Source Management Guide. (Legacy)

Integrating Apache Web Server with Tomcat Application Server

Lab 0: Version control

Linux Labs: mini survival guide

Source Control Systems

Linux Overview. Local facilities. Linux commands. The vi (gvim) editor

The Bazaar Version Control System. Michael Hudson, Canonical Ltd

Version control. with git and GitHub. Karl Broman. Biostatistics & Medical Informatics, UW Madison

Browser Tutorial Development (en) Browser - TYPO3 without PHP

Introduction to Source Control Management in OO 10

Distributed Version Control

Installing the JDeveloper Subversion VCS extension

EAE-MS SCCAPI based Version Control System

Source Control Guide: Git

An Introduction to Mercurial Version Control Software

University of Toronto

Configuring IBM Cognos Controller 8 to use Single Sign- On

QUICK START BASIC LINUX AND G++ COMMANDS. Prepared By: Pn. Azura Bt Ishak

BlueJ Teamwork Tutorial

An Introduction to Using the Command Line Interface (CLI) to Work with Files and Directories

Transcription:

Using Subversion for Source Code Control Michael McLennan Software Architect Network for Computational Nanotechnology

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: http://subversion.tigris.org/ Client/Server model: Upload: add/commit Subversion repository Clients Download: checkout Server

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

Top 5 reasons why you should use Subversion It s better than CVS svn commands are nearly identical to cvs commands You ll feel more secure SSL transport between client/server; repository is backed up Where did I put that It s in the repository SSL Who broke the build? Look at the revision history Subversion repository Your hard drive just died No problem, your code is in the repository hamlet NCSA

If you re using Subversion on your own machine Get your files together mkdir initial mkdir initial/trunk mkdir initial/branches mkdir initial/tags mv /home/src/*.c initial/trunk Getting Started put all of your files in the trunk Create a repository and import your files svnadmin create --fs-type fsfs /usr/local/svn/repo svn import initial file:///usr/local/svn/repo -m "initial content" trunk branches tags Subversion repository

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

Check out your code svn checkout https://repo.nanohub.org/svn/app-yourtool/trunk app-yourtool A app-yourtool/rappture A app-yourtool/doc A app-yourtool/src A app-yourtool/bin A app-yourtool/data A app-yourtool/middleware A app-yourtool/examples Checked out revision 1. mkdir examples/ex1 vi examples/ex1/readme svn add examples/ex1 A examples/ex1 A examples/ex1/readme From any machine Instructions in your project area at wiki/gettingstarted

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

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

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

Editing and updating svn commit edit: Makefile all: gcc -g hello.c gcc -O hello.c svn update svn commit all: gcc -O hello.c svn checkout https://repo.nanohub.org/svn/app-yourtool/trunk app-yourtool Copy code around Move code to new machines with svn checkout Move changes around with svn commit and svn update

Looking for differences and reverting Can also revert directory changes (adding/deleting files) 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'

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

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

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

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

Retrieving an old version Get the whole distribution svn checkout r 3 https://repo.nanohub.org/svn/app-yourtool/trunk app-yourtool get revision 3 Get a particular file svn cat r 5 Makefile svn cat r 5 Makefile > Makefile Which revision? svn log Makefile svn log show me revision 5 replace current file with revision 5 show me revisions for this file show me revisions for current directory

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 Binary files Recognized as a binary file: no CR/LF translation no merges, only replacements svn propset svn:mime-type application/octet-stream examples/demo.dat svn propdel svn:eol-style examples/demo.dat more about properties on this page

Branching and Tagging Think of your source code repository as a tree Tag important versions: svn copy trunk tags/release1.0 Merging between branches is a pain! If you need that, use svk. trunk no /trunk Create a branch: svn checkout https://repo /app-yourtool app-yourtool-all cd app-yourtool-all svn copy trunk branches/mclennan svn commit m created private branch for mclennan svn checkout https://repo /app-yourtool/branches/mclennan app-yourtool-mcl instead of /trunk

More Information Web site: http://subversion.tigris.org/ Subversion Book From O Reilly & Associates, and also online Quick-start guide for your project: https://developer.nanohub.org/projects/app-yourtool/wiki/gettingstarted