revision control drupalcampla
DESCRIPTION
Talk by Tom Friedhof at DrupalCampLA 2008, LA Convention CenterTRANSCRIPT
![Page 1: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/1.jpg)
presentation by: Tom Friedhof
Revision Control
![Page 2: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/2.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/3.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/4.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/5.jpg)
Centralized vs.
De-centralized
![Page 6: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/6.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/7.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/8.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/9.jpg)
CVS(Concurrent Versions System)
![Page 10: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/10.jpg)
CVS Facts
• The Drupal Project uses CVS.
• It’s been around since 1986.
• CVS has some limitations
![Page 11: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/11.jpg)
What’s wrong with CVS?
![Page 12: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/12.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/13.jpg)
Then there is . . .
![Page 14: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/14.jpg)
SVN(Subversion)
![Page 15: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/15.jpg)
SVN Facts
• Was designed to replace CVS.
• Overcame pretty much all CVS limitations.
Keywords
![Page 16: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/16.jpg)
SVNis still not a distributed
system.
![Page 17: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/17.jpg)
git
![Page 18: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/18.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/19.jpg)
What’s all this have to do with Drupal?
![Page 20: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/20.jpg)
We’re getting there...
... but first some simple commands
![Page 21: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/21.jpg)
import
![Page 22: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/22.jpg)
checkout
![Page 23: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/23.jpg)
add
![Page 24: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/24.jpg)
commit
![Page 25: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/25.jpg)
update
![Page 26: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/26.jpg)
delete
![Page 28: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/28.jpg)
Well that would get us the HEAD version of Drupal.
A NINJA WOULDN’T DO THAT
![Page 29: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/29.jpg)
HEAD, Branches, TagsHEAD
DRUPAL-6
DRUPAL-5
DRUPAL-6-4
This is how Drupal handles version releases.
![Page 30: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/30.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/31.jpg)
Let’s add some modules to the mix.
![Page 32: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/32.jpg)
Two Drupal Repositories
• /cvs/drupal
• /cvs/drupal-contrib
• Contributed Modules and Themes
![Page 33: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/33.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/34.jpg)
Browsing the CVS Repository
![Page 35: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/35.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/36.jpg)
![Page 37: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/37.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/38.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/39.jpg)
![Page 40: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/40.jpg)
Applying patches
patch -p0 < patchfile.patch
(http://drupal.org/patch/apply)
![Page 41: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/41.jpg)
How do I keep track of all my local changes?
![Page 42: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/42.jpg)
SubversionOr any other version control software, not CVS.
![Page 43: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/43.jpg)
Software Project ManagementGit and Subversion Hosting
Helping you and your team do things right.
(http://unfuddle.com/)
![Page 44: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/44.jpg)
SVN(unfuddle)
CVS(cvs.drupal.org)
Developer
![Page 45: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/45.jpg)
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](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/46.jpg)
Demo(if we have time)
![Page 47: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/47.jpg)
Questions?
![Page 48: Revision Control DrupalCampLA](https://reader033.vdocuments.site/reader033/viewer/2022051817/548491beb47959ec0c8b4c8e/html5/thumbnails/48.jpg)
Enjoy the rest of
Enjoy the rest of
Thanks!Presented by: Tom Friedhof