Upload
robert-maclean
View
1.064
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Mercurial is part of a modern way of thinking about source control where the system is distributed among developers compared to the client server model of things like SubVersion. This presentation covers what that means to developers.
Citation preview
Mercurial
• April 2005• Created for Linux Kernel • DVCS– Distributed Version Control System
• It’s just source control, so what you know is still relevant
Client/Server Source Control
SVN
All code, all history, all
settings
Just working set
Merge has only working set knowledge
Connection to server needed
Cannot share between people
without the server
Server is unaware of renaming
.svn pollution
Good & established tool
(build, WI) integration
LOCKS?! ARRGGHH!
Central management
DVCS
hg
hg
hg
hg
hg
hg
Everyone has full repo
Merge has full
knowledge
Can work disconnecte
d
Aware of renaming
Easy to share between people
Single .hg directory
No locking
Tool integration is still growing
So it is perfect?
• Some management (users) issues– Can be solved on the transport
• Maturity needed– No reason not to check-in ALL the time– Backups?– Can’t delete branches
• Performance issues– Can’t pull a working set
• Workflows need to change
Workflow chaos
hg
hg
hg
hg
hg
hg • Where is the trunk?
• Run testing, deployment builds
• What happens if you go dark?• What about security?
• How do I add or remove users?
• Where is the backup that we will use when the building burns down?
hg
The Blessed Repo Workflow
hg
hg
hg
hg
hg
hg
Build server runs against blessed
repo
WI against this
Backup this
Central Management
Here
Familiar model
The Hybrid Blessed Repo Workflow
SVN
hg
hg
hg
hg
hg
hg
Mercu
rial to
SV
N
Brid
ge
Network of Trust Workflow
hg
hg
hg
hg
hg
hg
King
Lie
ute
nan
tsU
nw
ash
ed
Masses
Graphics Networks Disk Penguins
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
Corporate Network of Trust Workflow
hg
hg
hg
hg
hg
Seniors
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
Juniors
hg
hg
hg
hg
hg
hg
hg
hg
Intermediates
Deployment Team Workflow
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
hg
Deploy
Development
Pre-Prod
hg
hg
hg
hg
hg
hg
Can run own workflows
Can have own build and ship quality
gates
Can have own branching strategy
Proven Practises Alignment?Branching
Plan your branchingOwn the mergeLook after branches
RepoDon’t break the buildSeparate your repoDon’t forget to shelveUse labels
TechTry concurrent accessDon’t be afraid of branching conceptsAuto merge for checkout only
ManagementDon’t use the audit trail for blameUseful & meaningful check in messages
YouBe light and quick with checkoutsKeep up to dateDon’t check in unneeded binariesWorking folders should be disposableUse undo/revert sparingly
Commands (51)
Add, AddRemove, Remove [rm]Annotate [Blame]ArchiveBackoutBisectBookmarksBranch & BranchesBundle & UnbundleCatCloneCommit [ci]Copy [cp] & Rename [move, mv]Diff
Export & Import [patch]ForgetGrepHeadsHelpIdentify [id]Incoming [in] & Outgoing [out]InitLocateLog [history]ManifestMerge & ResolveParentsPath
Pull & PushRecoverRevertRollbackRootServeShowConfig [debugconfig]Status [st]Summary [sum]Tag & TagsTipUpdate [up, checkout, co]VerifyVersion
Command Cheat Sheet
Other DVCS Options
• Git– Linus Torvalds– Linux Kernal– Requires packing
maintenance– Unfriendly version numbers– FAST– Linux & Mac– Different patching ideology – No working set issue– Can delete branches
• Bazaar– Canonicial– Ubuntu– Slow– Closer to SVN
• Monotone, Darcs, Plastic, SVK, Codeville, GNU arch, Bitkeeper
Questions?