Top Banner
Version Control at UCB Version control with Subversion and Subclipse
35

Version Control at UCB Version control with Subversion and Subclipse.

Dec 22, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Version Control at UCB Version control with Subversion and Subclipse.

Version Control at UCB

Version control with Subversion and Subclipse

Page 2: Version Control at UCB Version control with Subversion and Subclipse.

Summary

• Version control in general

• Subversion in particular

• Version control at UCB– In IST-WA

Page 3: Version Control at UCB Version control with Subversion and Subclipse.

What is version control?

• Keep track of revisions

• Investigate changes and revert

• Several people working on project (file) simultaneously

• Merge changes

Page 4: Version Control at UCB Version control with Subversion and Subclipse.

Why do I need version control?

• A place to store your code

• Historical record of what was done over time

• Synchronization between developers

Page 5: Version Control at UCB Version control with Subversion and Subclipse.

Why (cont.)?

• Standardized application layout

• Facilitates automated build, test, deploy– No machine-specific dependencies

• Developer not tied to one machine– Work from home– Work from any machine

Page 6: Version Control at UCB Version control with Subversion and Subclipse.

Why (cont.)?

• Best practice

• Director priority

• We’ve had problems

Page 7: Version Control at UCB Version control with Subversion and Subclipse.

Typical client/server system

Page 8: Version Control at UCB Version control with Subversion and Subclipse.

The problem to avoid

Page 9: Version Control at UCB Version control with Subversion and Subclipse.

Lock-modify-unlock

Page 10: Version Control at UCB Version control with Subversion and Subclipse.

Copy-modify-merge

Page 11: Version Control at UCB Version control with Subversion and Subclipse.

Copy-modify-merge (cont.)

Page 12: Version Control at UCB Version control with Subversion and Subclipse.

Standard Cycle

• Checkout/update

• Edit

• Update (merge)

• Commit

Page 13: Version Control at UCB Version control with Subversion and Subclipse.

Standard Cycle - Ideal

• Checkout/update and run tests

• Edit and run tests

• Update (merge) and run tests

• Commit

• Deploy to dev integration environment– And run tests

Page 14: Version Control at UCB Version control with Subversion and Subclipse.

Best Practices

• Commit early and often

• Commit logical units

• Don’t break the build (unit tests must run)

• Communicate with team members– JIRA

Page 15: Version Control at UCB Version control with Subversion and Subclipse.

What to store?

• Source code

• HTML, CSS, Javascript

• Images

• Configuration files

• Unit and other automated tests

• Everything required for your app to run

Page 16: Version Control at UCB Version control with Subversion and Subclipse.

What to store (cont.)?

• Requirements documents

• Documentation – user

• Most documents/files related to your project

Page 17: Version Control at UCB Version control with Subversion and Subclipse.

What not to store

• Compiled code

• Generated code

• Generated documentation

• Secured information (TBD)– Id/password files– License keys

Page 18: Version Control at UCB Version control with Subversion and Subclipse.

Commercial Tools

• Bitkeeper

• Visual SourceSafe

• Rational Clearcase

• Perforce

Page 19: Version Control at UCB Version control with Subversion and Subclipse.

Open Source Tools

• CVS

• Subversion

• Many others

Page 20: Version Control at UCB Version control with Subversion and Subclipse.

Why SVN over CVS?

• Versioning for Files, Directories and Metadata

• Atomic commits

• Excellent network support (speed)

• Cheap Branching, Tagging, and Merging

• True Cross-Platform Support (runs very well on Windows)

Page 21: Version Control at UCB Version control with Subversion and Subclipse.

SVN Over CVS (cont.)

• Same developers as CVS

• Solve CVS’s problems

• Majority of open source projects– Are using SVN– Are planning to migrate to SVN

“The goal of the Subversion project is to build a version control system that is a compelling replacement for CVS in the open source community.”

Page 22: Version Control at UCB Version control with Subversion and Subclipse.

Build Tool Integration

• Java – Ant task SvnAnt

• Ruby on Rails– Capistrano

• Other environments can use the command line API

Page 23: Version Control at UCB Version control with Subversion and Subclipse.

Source Control at UCB

• CVS– Heavy use in former SIS– Other in IST– Other on Campus– Conversion schedule TBD

• SVN– Early days in Application Services– Sakai project

• Alchemist

Page 24: Version Control at UCB Version control with Subversion and Subclipse.

Subversion’s Architecture

Page 25: Version Control at UCB Version control with Subversion and Subclipse.

Subversion’s Architecture

Page 26: Version Control at UCB Version control with Subversion and Subclipse.

Subversion Clients

• Subclipse

• TortoiseSVN

• Command line

Page 27: Version Control at UCB Version control with Subversion and Subclipse.

Command Line

$ svn import /tmp/myproject file:///path/to/repos/myproject -m "initial import"

Adding /tmp/myproject/branches

Adding /tmp/myproject/tags

Adding /tmp/myproject/trunk

Adding /tmp/myproject/trunk/foo.c

Adding /tmp/myproject/trunk/bar.c

Adding /tmp/myproject/trunk/Makefile

Committed revision 1.

$

Page 28: Version Control at UCB Version control with Subversion and Subclipse.

TortoiseSVN

• Context menus in Windows Explorer– http://tortoisesvn.tigris.org/

ExplorerIntegration.html

• Texas A&M tutorial– http://tagd.cs.tamu.edu/resources/

WeeklyStuff/source_control.ppt

Page 29: Version Control at UCB Version control with Subversion and Subclipse.

Subclipse

Page 30: Version Control at UCB Version control with Subversion and Subclipse.

Repository Organization

• Per-project directories

• Three sub-directories– Trunk– Tags– Branches

• Fine-grained security

Page 31: Version Control at UCB Version control with Subversion and Subclipse.

Security

• Write to your projects

• Read everything (some exceptions)– Code sharing/snooping– No more broken windows– How did she do that?

• No “security by obscurity”

Page 32: Version Control at UCB Version control with Subversion and Subclipse.

Campus Proposal

• Free SVN repository to anyone on campus

• Part of IST/AS/AG campus outreach

• Easy win, concrete accomplishment

• Facilitate sharing of code

Page 33: Version Control at UCB Version control with Subversion and Subclipse.

Getting Started

• http://ist.berkeley.edu/as/ag/– Tools > Dev Box Setup– Install Eclipse and plugins– Install Subclipse

• Get userid

• Play in sandbox

Page 34: Version Control at UCB Version control with Subversion and Subclipse.

Resources - Links• This document

– http://ist.berkeley.edu/as/ag/pub/pdf/VersionControlAtUCB.pdf– http://ist.berkeley.edu/as/ag/pub/ppt/VersionControlAtUCB.ppt

• Application Services – Architecture Group Web Site– http://ist.berkeley.edu/as/ag/

• Subversion book– http://svnbook.red-bean.com/

• Online version of Subclipse documentation– http://svn.collab.net/subclipse/help/index.jsp

• TortoiseSVN– http://tortoisesvn.tigris.org/

Page 35: Version Control at UCB Version control with Subversion and Subclipse.

Resources - Books

• Version Control with Subversion– http://safari.oreilly.com/

– http://svnbook.red-bean.com/

• Pragmatic Version Control Using Subversion– http://www.pragmaticprogrammer.com/titles/svn2/index.html