Basic Source Control With Subversion

16

Click here to load reader

description

A talk I gave at Torque on 6th Sep, 2007

Transcript of Basic Source Control With Subversion

Page 1: Basic Source Control With Subversion

Basic SCM with Subversion & Trac

Vishnu Gopalwww.vish.in

Page 2: Basic Source Control With Subversion

Contents

• What, Why and How?

• Subversion Commands

• Demo: Command-line tools

• GUI tools

• Project Layout

• Trac: overview

Page 3: Basic Source Control With Subversion

What?

• Subversion maintains snapshots of the code repository.

• Allows many people to concurrently work on a codebase.

• Subversion is source control with a central repository.

• Usually integrates with a frontend: Trac

Page 4: Basic Source Control With Subversion

Why?

• Continuous incremental backup.

• Ability to recall older code.

• Distributed development.

• Various versions of a single project.

• Tracking bugs, timeline, goals and releases.

Page 5: Basic Source Control With Subversion

Central Repository

Page 6: Basic Source Control With Subversion

How?

• Developers checkout code from the repository to a local working-copy.

• After making edits, they commit changes.

• At any point, they can revert to an older version of the codebase.

• They update their local working copy frequently to keep up with changes.

Page 7: Basic Source Control With Subversion

Work with Subversion

Page 8: Basic Source Control With Subversion

But how does Subversion work?

• A system to track changes in files.

• The code is initially imported into the repository.

• Then a special “subversion-aware” directory is checked-out.

• Developers commit and update.

• Subversion tracks the changesets and the commit-log.

Page 9: Basic Source Control With Subversion

Common Subversion Commands

• checkout: Obtain a new working copy.

• import: Import code into repository initially.

• commit: Update repository with changes.

• update: Update working-copy with changes.

• Other commands: revert, move, copy, merge.

Page 10: Basic Source Control With Subversion

Subversion: Demo

Page 11: Basic Source Control With Subversion

GUI Tools

• TortoiseSVN in Windows

• Right-click a directory: get a context-menu with everything in there.

• Useful Integration with diff and patch.

• Reasonably fast.

Page 12: Basic Source Control With Subversion

Project Layout

• trunk

• All constant development happens here.

• branches

• Special purpose development here.

• tags

• Releases are “tagged” for archiving.

Page 13: Basic Source Control With Subversion

Trac: Demo

Page 14: Basic Source Control With Subversion

Major features of Trac

• Frontend to a Subversion repository.

• Shows the changesets and timeline.

• Has a bug tracker which integrates with the Subversion commit-log.

• Simple project management.

Page 15: Basic Source Control With Subversion

Some good Subversion practices

• Follow the branches, tags, trunk structure.

• All code should be in the repository!

• Update code at the start of every day.

• Only commit coherent changes.

• The central repository should always be consistent.

• Branch as less as possible.

Page 16: Basic Source Control With Subversion

FinisThe end. Questions?