revision control drupalcampla

48
presentation by: Tom Friedhof Revision Control

Upload: tom-friedhof

Post on 05-Dec-2014

2.767 views

Category:

Technology


0 download

DESCRIPTION

Talk by Tom Friedhof at DrupalCampLA 2008, LA Convention Center

TRANSCRIPT

Page 1: Revision Control DrupalCampLA

presentation by: Tom Friedhof

Revision Control

Page 2: Revision Control DrupalCampLA

What I’ll cover today.

• I’ll talk about Revision Control Concepts

• CVS, SVN, git

• How Drupal Ninjas Install Drupal and Contrib Modules (from CVS).

• How Drupal’s release system works.

• (i.e. Branches and Tags)

Page 3: Revision Control DrupalCampLA

What I’ll cover today. (cont.)

• Installing Updates.

• Creating Patches and Applying Patches

• Managing Your Development Environment and Custom Changes with CVS and SVN.

• Demo (if we have time)

Page 4: Revision Control DrupalCampLA

What is Revision Control?

• A software system for sharing information

• Keeps Track all changes made to a set of files.

• Allows for collaborative editing of data.

Page 5: Revision Control DrupalCampLA

Centralized vs.

De-centralized

Page 6: Revision Control DrupalCampLA

Centralized Version Control

Centralized

Repository

Developer 1 Developer 2 Developer 3

Staging Server

checkout

add

commit

update

delete

checkout

update

Page 7: Revision Control DrupalCampLA

Decentralized Version Control

Developer 3

Repository

Developer 3

Staging Server

Staging

Repository

Developer 2

Repository

Developer 2

Developer 1

Repository

Developer 1

push

pull

Page 8: Revision Control DrupalCampLA

Advantage's to being decentralized.

• You have a repository whether you have a network connection or not.

• Fast. The repository is local.

• Sharing with selected people is easy.

• You can create branches and never push them out. Promotes Experimentation.

Page 9: Revision Control DrupalCampLA

CVS(Concurrent Versions System)

Page 10: Revision Control DrupalCampLA

CVS Facts

• The Drupal Project uses CVS.

• It’s been around since 1986.

• CVS has some limitations

Page 11: Revision Control DrupalCampLA

What’s wrong with CVS?

Page 12: Revision Control DrupalCampLA

CVS Limitations

• Too hard to move or rename files.

• No atomic commits.

• CVS treats all files as text.

• (cvs add -kb image.jpg)

• It’s not a distributed system.

Page 13: Revision Control DrupalCampLA

Then there is . . .

Page 14: Revision Control DrupalCampLA

SVN(Subversion)

Page 15: Revision Control DrupalCampLA

SVN Facts

• Was designed to replace CVS.

• Overcame pretty much all CVS limitations.

Keywords

Page 16: Revision Control DrupalCampLA

SVNis still not a distributed

system.

Page 17: Revision Control DrupalCampLA

git

Page 18: Revision Control DrupalCampLA

git Facts

• Developed by Linus Torvalds in 2005

• It’s a distributed version control system

• Not as easy to grasp as CVS or SVN

Page 19: Revision Control DrupalCampLA

What’s all this have to do with Drupal?

Page 20: Revision Control DrupalCampLA

We’re getting there...

... but first some simple commands

Page 21: Revision Control DrupalCampLA

import

Page 22: Revision Control DrupalCampLA

checkout

Page 23: Revision Control DrupalCampLA

add

Page 24: Revision Control DrupalCampLA

commit

Page 25: Revision Control DrupalCampLA

update

Page 26: Revision Control DrupalCampLA

delete

Page 27: Revision Control DrupalCampLA

How Ninjas install Drupal.

cvs -d:pserver:anonymous:[email protected]:/cvs/drupal checkout drupal

Page 28: Revision Control DrupalCampLA

Well that would get us the HEAD version of Drupal.

A NINJA WOULDN’T DO THAT

Page 29: Revision Control DrupalCampLA

HEAD, Branches, TagsHEAD

DRUPAL-6

DRUPAL-5

DRUPAL-6-4

This is how Drupal handles version releases.

Page 30: Revision Control DrupalCampLA

How Ninjas install Drupal.

cvs -z6 -d:pserver:anonymous:[email protected]:/cvs/drupal co -d local_directory -r DRUPAL-6-4 drupal

REAL

(http://drupal.org/node/320)

Page 31: Revision Control DrupalCampLA

Let’s add some modules to the mix.

Page 32: Revision Control DrupalCampLA

Two Drupal Repositories

• /cvs/drupal

• /cvs/drupal-contrib

• Contributed Modules and Themes

Page 33: Revision Control DrupalCampLA

Let’s Download CCK

cvs -z6 -d:pserver:anonymous:[email protected]:/cvs/drupal-contrib co -d sites/all/modules/cck -r DRUPAL-6-4--2-0-RC6 contributions/modules/cck

Page 34: Revision Control DrupalCampLA

Browsing the CVS Repository

Page 35: Revision Control DrupalCampLA

Installing Updates

cvs update -dP

cvs up -dP /* For Lazy People */

cvs up -dP -r DRUPAL-6--2-0-RC7

Page 36: Revision Control DrupalCampLA
Page 37: Revision Control DrupalCampLA

Creating Patches

• Patch files contain the differences between two different files.

• cvs diff

• diff (Unix utility)

• Core patches should ALWAYS be made from Drupal root.

• Contrib patches can be made from the root module directory

Page 38: Revision Control DrupalCampLA

Creating patches

cvs diff -uRp > patchfile.patch

diff -urp original_directory new_directory > patchfile.patch

(http://drupal.org/patch/create)

Page 39: Revision Control DrupalCampLA
Page 40: Revision Control DrupalCampLA

Applying patches

patch -p0 < patchfile.patch

(http://drupal.org/patch/apply)

Page 41: Revision Control DrupalCampLA

How do I keep track of all my local changes?

Page 42: Revision Control DrupalCampLA

SubversionOr any other version control software, not CVS.

Page 43: Revision Control DrupalCampLA

Software Project ManagementGit and Subversion Hosting

Helping you and your team do things right.

(http://unfuddle.com/)

Page 44: Revision Control DrupalCampLA

SVN(unfuddle)

CVS(cvs.drupal.org)

Developer

Page 45: Revision Control DrupalCampLA

What I covered.

• I talked about Revision Control Concepts

• Installing Drupal and Modules from CVS.

• Drupal’s release system.

• Installing Updates from CVS.

• Creating Patches and Applying Patches

• Managing Your Development Environment and Custom Changes with CVS and SVN.

Page 46: Revision Control DrupalCampLA

Demo(if we have time)

Page 47: Revision Control DrupalCampLA

Questions?

Page 48: Revision Control DrupalCampLA

Enjoy the rest of

Enjoy the rest of

Thanks!Presented by: Tom Friedhof