Upload
john-paulett
View
3.271
Download
4
Embed Size (px)
DESCRIPTION
Discussion on Mercurial and migration from CVS.
Citation preview
Mercurial
John Paulett
April 5, 2010
Modern Source Control Management
Overview
CVS Issues
Modern Alternatives
Distributed Version Control
Mercurial
Next Steps
2010.04.05 3
CVS Shortcomings
Network connectivity required
Lack of support for renaming/moving
Lack of atomic commits
Single point of failure
Expensive branch operations
Day-long merges
2010.04.05 4
CVS Replacements
Subversion (2000) - svn● “CVS done right”
Git (2005) – git ● Created by Linus Torvalds for kernel
development
Mercurial (2005) – hg ● Created after Linux-Bitkeeper incident
Bazaar, darcs, monotone ...
2010.04.05 5
Distributed Version Control (DVCS)
Complete, local repository
Branching & merging are trivial
Central server for sharing repositories
2010.04.05 6
Mercurial
mercurial.selenic.com
Changesets, not files
Mozilla, OpenJDK, OpenSolaris, Python, Zen, OpenOffice, NetBeans
2010.04.05 7
Create a new repository
$ hg init demo
$ cd demo
$ ls -a
. .. .hg
2010.04.05 8
Add a file
$ echo "Hello world" > README
$ hg add README
$ hg status
A README
2010.04.05 9
Commit the changeset
$ hg commit -m "Adding basic README"
$ hg log
0[tip] 9b1b9c995571 2010-01-13 12:37 -0600 jpaulett
Adding basic README
2010.04.05 10
Push to remote repository
$ hg push ssh://[email protected]/nrg/demo/
pushing to ssh://[email protected]/nrg/demo/
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 1 changes to 1 files
...
2010.04.05 11
Clone Existing Repository
$ hg clone http://bitbucket.org/nrg/demo/
destination directory: demo
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2010.04.05 12
Get Updates
$ hg pull
pulling from https://[email protected]/nrg/demo/
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
$ hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2010.04.05 13
Workflow
Multiple workflows are possible
“Integration Manager”
http://whygitisbetterthanx.com/#any-workflow
blessedrepository
integrationmanager
developerpublic
developerpublic
developerprivate
developerprivate
2010.04.05 14
Workflow
mainline
cndajohn
1.4.1
1.4.2
changeset
repository
tag
2010.04.05 15
Hosting
bitbucket.org
Self-hosted via Apache & SSH ● hg.xnat.org
Google Code / Sourceforge
2010.04.05 16
Tools
$ hg
MercurialEclipse
TortoiseHg
CuteHg
2010.04.05 17
Resources
mercurial.selenic.com
hgbook.red-bean.com
hginit.com
2010.04.05 18
Resources
http://nrg.wikispaces.com/Mercurial
http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/
http://code.google.com/p/support/wiki/DVCSAnalysis
2010.04.05 19
hg Advantages
Easy learning curve coming from CVS/SVN
Allows 3rd parties to more easily contribute
No more day long merges
2010.04.05 20
Next Steps
Try out Mercurial:● bitbucket.org/nrg
2010.04.05 21