Subversion Source Code Management System Blair Zajac OrcaWare Consulting August 21, 2002.

Slides:



Advertisements
Similar presentations
Week 2 DUE This Week: Safety Form and Model Release DUE Next Week: Project Timelines and Website Notebooks Lab Access SharePoint Usage Subversion Software.
Advertisements

TortoiseSVN By Group 1 Team B. Installing TortoiseSVN.
Introduction To GIT Rob Di Marco Philly Linux Users Group July 14, 2008.
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.
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.
Revision Control Systems Amin Tootoonchian Kian Mirjalali.
Dedi Rahmawan Putra  Shared Document  Conventional Ways  Common Problems  What is TortoiseSVN  Advantages over another tools  Basic Concepts.
David Notkin Autumn 2009 CSE303 Lecture 22 Subversion is an open source version control system. Social Implications Friday version control system.
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.
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.
David Stotts UNC Computer Science (2013) with slides from a talk by Karsten Dambekalns (2005)
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)
Source Code Revision Control Software CVS and Subversion (svn)
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 ▪Version control is a system that records changes to a file or set of files over time so.
The Design Workshop Introduction to Version Control 1.
The new version control system. Kiril Karaatanasov, July 2006 What is Subversion Subversion is a newly developed open source version control system Subversion.
Version Control with Subversion Quick Reference of Subversion.
Git A distributed version control system Powerpoint credited to University of PA And modified by Pepper 8-Oct-15.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
…using Git/Tortoise Git
SWEN 302: AGILE METHODS Roma Klapaukh & Alex Potanin.
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.
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.
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
1 CSE306 Operating Systems Projects CVS/SSH tutorial.
CVS: Concurrent Version System Lecturer: Prof. Andrzej (AJ) Bieszczad Phone: “UNIX for Programmers and Users” Third.
GIT.
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.
Version Control *Slides are modified from Prof. Necula from CS169.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
Part 4: FCM and the UM University of Reading, December 2015.
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.
© CGI Group Inc. User Guide Subversion client TortoiseSVN.
Using Subversion for Source Code Control Michael McLennan HUBzero® Platform for Scientific Collaboration Purdue University This work licensed under Creative.
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.
Introduction to Subversion Getting started with svn Matteo Vescovi 19/02/2010.
Source Control Dr. Scott Schaefer. Version Control Systems Allow for maintenance and archiving of multiple versions of code / other files Designed for.
Subversion Subversion is a brand of version control software that is frequently used to store the code and documentation of a project so as to permit.
SVN intro (review).
Source Control Dr. Scott Schaefer.
CSE 303 Concepts and Tools for Software Development
Subversion.
Version Control System
Git CS Fall 2018.
Prof. Hilfinger CS164 Lecture 4
Concurrent Versions System
Presentation transcript:

Subversion Source Code Management System Blair Zajac OrcaWare Consulting August 21, 2002

Why Use Subversion? (CVS vs SVN)  Functional replacement for CVS  Directory versioning (renames and moves)  Atomic commits (all or nothing)  Faster network access (binary diffs)  File & directory meta-data  Requires less network access

Subversion Client Side  Each working directory has a.svn directory  Similar to CVS’s CVS directory  Repository password stored in each.svn  Stores a pristine copy of each file in directory

Subversion Architecture  Two locations of SVN repositories On a local filesystem  Typically used for a single developer  Accessed via direct file read/write access  Requires that users have local accounts  Uses filesystem and user/group security On a remote system  Accessed via a HTTP or HTTPS connection  Does not require that users have accounts on the server  Use Apache style authentication

Subversion Server Design  Server uses Apache web server Browse repository with Internet Explorer or Netscape With mod_deflate, compression can be used between client and server  Repository uses Berkeley Database Data integrity Atomic writes Recoverability Hot backups

Subversion Command Line Differences  CVS Argument position matters % cvs –d /export/home1/cvs update –d  SVN Argument position does not matter % svn log –r 123 foo.c % svn log foo.c –r 123

How Do Revisions Work? (Part 1)  Revision numbers are applied to an object to identify a unique version of that object  Example files % ls bar.c foo.c  CVS Revision numbers are per file A revision number from one file does not necessarily have any meaning to another file with the same revision number A commit only updates the revision numbers of files that were modified bar.c may be at revision 1.2 and foo.c at 1.10 Updates to bar.c will not change foo.c’s revision number

How Do Revisions Work? (Part 2)  Subversion Revision numbers are global across the whole repository Identify how the entire repository looks at that instant in time A commit creates a snapshot of the entire tree in the repository at that revision number Allows users to say, “Hey so-and-so, go get revision 1432 of XYZ and try to compile it.” Before an update, both bar.c and foo.c are at revision 25 Modify bar.c and commit Then update the working copy Now bar.c and foo.c are at revision 26, except that foo.c in revision 25 and 26 are identical No additional space in repository required, i.e. a cheap copy or a symbolic link is made

How Do Revisions Work? (Part 3)  Example revision update Check out tree % svn co A Makefile A document.c A search.c Checked out revision 4. Edit search.c % vi search.c Commit the edit % svn commit –m “Add better search” Sending search.c Transmitting data… Committed revision 5.

How Do Revisions Work? (Part 4)  Status of files and directories Directory `.’ is at 4 but revision 5 exists in the repository Makefile is at 4 document.c is at 4 search.c is at 5  Get info on a particular file or directory % svn info. Path:. Url: file:////tmp/repos/demo Revision: 4 Node Kind: directory Schedule: normal Last Changed Author: blair Last Changed Rev: 4 Last Changed Date: :20: (Thu, 08 Aug 2002)

How Do Revisions Work? (Part 5)  Now Felix updates document.c  Update working copy % svn update U./document.c At revision 6.

Basic Work Cycle (Part 1)  Checkout a working copy  Update working copy  Make changes  Examine your changes  Merge other’s changes  Commit your changes

Basic Work Cycle (Part 2)  Checkout a working copy % svn co % cd svn/doc  Update working copy Update all files and directories to the most current version % svn update Go to a particular older revision for all files and directories % svn update –r 1345 I want an even older version of svn-doc.el % svn update –r 999 svn-doc.el  Update output U `foo'  File `foo' was (U)pdated (received changes from the server.) A `foo'  File or directory `foo' was (A)dded to your working copy. D `foo'  File or directory `foo' was (D)eleted from your working copy. R `foo'  File or directory `foo' was (R)eplaced in your working copy; that is, `foo' was deleted, and a new item with the same name was added. While they may have the same name, the repository considers them to be distinct objects with distinct histories. G `foo'  File `foo' received new changes, but also had changes of your own to begin with. The changes did not intersect, however, so Subversion has mer(G)ed the repository's changes into the file without a problem. C `foo'  File `foo' received (C)onflicting changes from the server. The changes from the server directly overlap your own changes to the file. No need to panic, though. This overlap needs to be resolved by a human (you).

Basic Work Cycle (Part 3)  Make changes Add new files and directories % xemacs blair_super_algorithm.c % mkdir data-files % touch data-files/file1 % svn add blair_super_algorithm.c data-files # data-files/file1 not added unless –R passed to svn add Delete files % svn rm foo what_do_they_know.c Rename file % svn mv README.txt README_OLD.txt # This is identical to % svn cp README.txt README_OLD.txt; svn rm README.txt Copy files and directories % svn cp test_datafiles test_datafiles_new # If test_datafiles is a directory, then test_datafiles_new # is an exact copy of test_datafiles

Basic Work Cycle (Part 4)  Examine your changes svn status: Normal amount of information % svn status _ L./abc.c [svn has a lock in its.svn directory for abc.c] M./bar.c [the content in bar.c has local modifications] _M./baz.c [baz.c has property but no content modifications] ?./foo.o [svn doesn't manage foo.o] !./foo.c [svn knows foo.c but a non-svn program deleted it] ~./qux [versioned as dir, but is file, or vice versa] A +./moved_dir [added with history of where it came from] M +./moved_dir/README [added with history and has local modifications] D./stuff/fish.c [this file is scheduled for deletion] A./stuff/things/bloo.h [this file is scheduled for addition]

Basic Work Cycle (Part 5)  Examine your changes svn status: More information with -v  First column the same  Second column, working revision  Third column, last changed revision  Fourth column, who changed it % svn status -v M joe./README _ frank./INSTALL M frank./bar.c _ joe./stuff _ mary./stuff/trout.c D frank./stuff/fish.c _ mary./stuff/things A 0 ? ?./stuff/things/bloo.h _ joe./stuff/things/gloo.c

Basic Work Cycle (Part 6)  Examine your changes svn status: Even more information with -u  Asterisks show if the file would be updated if svn update were run  Requires network access to the repository % svn status -u -v M * joe./README M frank./bar.c _ * mary./stuff/trout.c D frank./stuff/fish.c A 0 ? ?./stuff/things/bloo.h

Basic Work Cycle (Part 7)  Examine your changes svn diff: Show your modifications  Even shows modifications in properties  Show all differences in files and directories in local working copy % svn diff  Diff between revision 3 of foo.c in repository and local working foo.c % svn diff –r 3 foo.c  Diff between revisions 2 and 3 of foo.c in the repository without even touching local foo.c % svn diff –r 2:3 foo.c  Revert or undo your changes Does not require network access % svn revert  Commit your changes Generate a log message containing the files and directories that have been modified % svn status | cut -d/ -f2- >../message % vi../message % svn commit –F../message

Conflict Resolution  Look for the ‘C’ when you run svn update  Better than CVS Conflict markers are placed into the file, to visibly demonstrate the overlapping areas. This matches CVS' behavior. Three fulltext files starting with `tmp' are created; these files are the original three files that could not be merged together. This is better than CVS, because it allows users to directly examine all three files, and even use 3rd-party merge tools (as an alternative to conflict markers.) Another improvement over CVS conflict handling: Subversion will not allow you to "accidentally" commit conflict markers, as so often happens in CVS. Unlike CVS, Subversion remembers that a file remains in conflict, and requires definite action from the user to undo this state before it will allow the item to be committed again.  Solutions to resolve Hand-merge the conflicted text Copy one of the tmpfiles on top of your working file Run svn revert to toss all of your changes  Once resolved, you need to tell SVN that the conflict has been resolve Run svn resolve This deletes the tmp files

Log Messages (Part 1)  Log messages are not embedded in files, like CVS  Messages are associated with a single commit  Possible to change log message after commit  View log messages with svn log command

Log Messages (Part 2)  See all log messages % svn log rev 3: fitz | Mon, 15 Jul :03: | 1 line Added include lines and corrected # of cheese slices rev 2: someguy | Mon, 15 Jul :47: | 1 line Added main() methods rev 1: fitz | Mon, 15 Jul :40: | 2 lines Initial import  Limit the range of log messages % svn log -r 5:19... # shows logs 5 through 19 in chronological order % svn log -r 19:5... # shows logs 5 through 19 in reverse order % svn log -r 8...  See logs for a single file % svn log foo.c... # shows log messages only for those revisions that foo.c changed

File & Directory Properties (Part 1)  Each files and directory has associated with it a hash, otherwise known as a associative array, of properties  Store any information in the hash  Subversion uses hash key names prefixed with svn: for its own use  In these examples, svn:XXX is a hash key name, it is not a hash key and value pair  Listing properties % svn proplist README.txt Properties on ‘README.txt': svn:eol-style  Getting property value % svn propget svn:eol-style repos_admin.texi native

File & Directory Properties (Part 2)  Setting a property via the command line For simple properties, just use the command line interface % svn propset svn:eol-style CRLF README.txt property `svn:eol-style' set on ‘README.txt'  Setting a property via the editor For complicated values, such as the list of files and subdirectories to ignore which contain a list across multiple lines, load the values into an editor: % svn propedit svn:ignore. Set new value for property `svn:ignore' on `.'

Subversion Specific Properties (Part 1)  svn:executable For files only, sets the executable bit Useful for scripts and programs The executable bit is set when the property is applied to the file, not when the commit is performed The executable bit is removed when this property is removed from the file The property value does not matter, any value will do  svn:mime-type SVN assumes a text file if svn:mime-type is not set or is set and matches “text/*”, otherwise it is a binary file If a file is a text file, SVN can use diff and patch to update changes from the repository Useful for setting the MIME type of a file for web browsing

Subversion Specific Properties (Part 2)  svn:ignore For directories only Tells SVN which files and subdirectories to ignore Equivalent to CVS’s.cvsignore file  svn:keywords Keyword substitution in files The only available keyword substitutions are LastChangedDate, LastChangedRevision, LastChangedBy and HeadURL Only the keywords listed in the svn:keywords property value are replaced in the file $LastChangedDate: :42: (Mon, 22 Jul 2002) $ $LastChangedRevision: 144 $ $LastChangedBy: joe $ $HeadURL: $

Subversion Specific Properties (Part 3)  svn:eol-style How to handle end of line differences.  Property not set, this is the default when a file is added  Do not change end of lines upon check in or update  Native  Convert all CR, CRLF and LF’s to the system’s native eol  CR  Convert all CRLF and LF’s to CR’s  CRLF  Convert all CR and LF’s to CRLF’s  LF  Convert all CR and CRLF’s to LF’s

OrcaWare Repository Structure (Part 1)  Vendor releases all go in /vendor/PRODUCTNAME, i.e. /vendor/super-orca2  These are unmodified releases  The current vendor release is in /vendor/PRODUCTNAME/current  Older releases are in /vendor/PRODUCTNAME/VERSION  The main OrcaWare trunk is in /orcaware/trunk/PRODUCTNAME, i.e. /orcaware/trunk/super-orca2  Tagged releases of the trunk are in /orcaware/tags/PRODUCTNAME/VERSION  Each developer gets their own branch in /orcaware/branches/USERNAME-PRODUCTNAME-DESCRIPTION

OrcaWare Repository Structure (Part 2) orcaware branches blair-super-orca2-working-on-rehat-9.0 tags orcaware super-orca2 trunk orcaware super-orca2 build docs emacs-style... vendor super-orca2 current build docs emacs-style... super-orca super-orca super-orca super-orca super-orca

OrcaWare Working Style  Developer copies trunk to a new branch and notes revision of trunk % svn cp –m “Creating branch for working on super orca 2” \ \ % svn log -v # Prints revision number, say 123 % svn co  Work progresses in the branch  Time to merge work into trunk  But first, merge trunk changes to branch % svn merge –r 123:HEAD # Test new code. % svn commit –F message_file1 # Revision 256.  Tree admin now merge changes into trunk % cd /tmp % svn co % cd super-orca2 % svn merge. % svn commit –F message_file2

For More Information  Subversion home  Subversion handbook handbook.html handbook.html  Subversion quick reference guide  Subversion document folder  Subversion project status  Subversion source code and binary downloads

Thanks To  Blair Zajac who wrote this document Blair Zajac OrcaWare Consulting  The Subversion development team who built a great tool