2. Introduction to Mercurial (Hg)
Distributed Version
Control System
Practical demo
Under the hood
(if time permits)
Friday, March 09, 2012 1Hosam Aly, JDC 2012
4. Centralized Version Control
When you check new code in,
everybody else gets it.
You can check in buggy code and drive
everyone else crazy, or...
You can avoid checking it in until it’s fully
debugged, even if it takes weeks.
You lose the benefit
of version control!
Friday, March 09, 2012 3Hosam Aly, JDC 2012
5. Centralized Version Control
Different Versions / New Features:
Branch and Merge
But SVN has a bad merging reputation!
From the SVN Book v1.6 (§4.4.11):
The bottom line is that Subversion's merge-
tracking feature has an extremely complex
internal implementation. Because the
feature is relatively new, a numbers of edge
cases and possible unexpected behaviors
may pop up.
Friday, March 09, 2012 4Hosam Aly, JDC 2012
9. Mercurial Advantages
Locally accessible repository
History information available all the time
Fast operations using local data
Backup on every machine!
Easy branching and merging
Branches can be named or unnamed
Using changesets makes merging painless
Encourages quick, throw-away prototyping
Guarantees data integrity
Friday, March 09, 2012 8Hosam Aly, JDC 2012
10. Mercurial Advantages (2)
Very easy sharing, even without a
server!
Safety of user’s changes when updating
Sane history management
Ability to recover from unpublished mistakes
Ability to revert (backout) an old changeset
Cross-platform first-class tool support
With plugins for many IDEs
Friday, March 09, 2012 9Hosam Aly, JDC 2012
11. Mercurial Advantages (3)
Efficient management of tiered repositories
Friday, March 09, 2012 10Hosam Aly, JDC 2012
16. Resources
Official Mercurial Wiki
http://mercurial.selenic.com/wiki/
HgInit, Joel Spolsky’s tutorial
http://hginit.com
Martin Geisler’s Presentations
http://cdn.bitbucket.org/mg/mercurial-talk/downloads/ibm-
2010-09-16.pdf
Mercurial: The Definitive Guide book
http://hgbook.red-bean.com/
More Presentations and Publications
http://mercurial.selenic.com/wiki/Presentations
Source Control Made Easy, an excellent podcast about
DVCS Internals by Jim Weirich
http://pragprog.com/screencasts/v-jwsceasy/source-
control-made-easy
Friday, March 09, 2012 Hosam Aly, JDC 2012 15
17. Acknowledgement
Most of the materials presented in this
presentation were aided by existing
content from Joel Spolsky, Martin
Geisler and Jim Weirich. I owe much of
my knowledge about Mercurial and
DVCS to them. If it weren’t for their
publicly available content, this
presentation would have been much
less useful. Many thanks.
Friday, March 09, 2012 Hosam Aly, JDC 2012 16
Quote taken from the book Version Control with Subversion for Subversion 1.6, Chapter 4, Section 4.4.11: The Final Word on Merge Tracking
http://svnbook.red-bean.com/en/1.6/svn.branchmerge.advanced.html#svn.branchmerge.advanced.finalword
Martin Fowler, Version Control Tools, 17 Feb 2010
http://martinfowler.com/bliki/VersionControlTools.html