Mercurial DVCS presentation to DevJam 11/4/2009
Upcoming SlideShare
Loading in...5
×
 

Mercurial DVCS presentation to DevJam 11/4/2009

on

  • 5,808 views

Mercurial DVCS presentation given to Minneapolis, MN DevJam meeting on 11/4/2009.

Mercurial DVCS presentation given to Minneapolis, MN DevJam meeting on 11/4/2009.

Statistics

Views

Total Views
5,808
Views on SlideShare
5,385
Embed Views
423

Actions

Likes
14
Downloads
152
Comments
1

5 Embeds 423

http://naleid.com 408
http://www.slideshare.net 9
http://www.linkedin.com 3
http://115.112.206.131 2
http://www.techgig.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Mercurial DVCS presentation to DevJam 11/4/2009 Mercurial DVCS presentation to DevJam 11/4/2009 Presentation Transcript

  • distributed version control with mercurial or: how I learned to stop worrying and love the merge Presented by Ted Naleid Wednesday, November 4, 2009
  • overview robust and mature “centralized” and “distributed” advantages over subversion why svn merging is broken subversion’s advantages comparison to git concepts basic usage how to get started Wednesday, November 4, 2009
  • mercurial is robust and mature Wednesday, November 4, 2009
  • large projects Python Mozilla NetBeans OpenOffice OpenSolaris OpenJDK Symbian OS Xen Hypervisor Wednesday, November 4, 2009
  • cross platform support great command line on win/mac/linux standalone GUIs windows - TortiseHG mac - murky linux - hgk Wednesday, November 4, 2009
  • IDE support IntelliJ Eclipse NetBeans Visual Studio TextMate BBEdit emacs vi Wednesday, November 4, 2009
  • continuous integration and bug tracking Hudson Cruise Control BuildBot Bamboo TeamCity JIRA Trac FogBugz/Kiln + support in maven and ant Wednesday, November 4, 2009
  • internet hosting bitbucket Google Code SourceForge kenai (Sun) Wednesday, November 4, 2009
  • Build Server commit Remote update Repo centralized version control systems Wednesday, November 4, 2009
  • Build Server Build Repo sh pu ll pu commit Alice's Carl's update Repo Repo Bob's Repo distributed version control system Wednesday, November 4, 2009
  • Build Server Build Repo sh pu ll pu commit push Alice's Carl's update Repo pull Repo pu sh pu ll Bob's Repo distributed version control system Wednesday, November 4, 2009
  • subversion limitations mercurial strengths Wednesday, November 4, 2009
  • shared remote repository owned local repository Wednesday, November 4, 2009
  • requires active net connection always available Wednesday, November 4, 2009
  • slow over-the-wire access speedy local access Wednesday, November 4, 2009
  • single point of failure multiple redundant copies Wednesday, November 4, 2009
  • working with branches is slow and painful simple, in-place branch switching hg update branch_name Wednesday, November 4, 2009
  • expensive public branches discourage experimentation cheap, easy branches encourage experimentation Wednesday, November 4, 2009
  • saving state is intertwined with releasing save whenever, push out when it’s ready Wednesday, November 4, 2009
  • would you use a word processor that only let you save at the end of a paragraph? Wednesday, November 4, 2009
  • litters workspace with .svn directories single .hg directory at project root Wednesday, November 4, 2009
  • time to set up new repository limits use instant setup enables new uses hg init hg add hg commit -m “first commit” Wednesday, November 4, 2009
  • merging is messy, dangerous and often avoided merging is the core operation so it’s done well Wednesday, November 4, 2009
  • why is subversion merging so broken and scary? Wednesday, November 4, 2009
  • #1 when there are conflicts, you’re forced to merge into an unsaved working copy Wednesday, November 4, 2009
  • #2 when there are no conflicts, you aren’t forced to merge this is a bug, not a feature Wednesday, November 4, 2009
  • in mercurial, you commit before pulling new code only fully formed changes get pushed out history is always preserved Wednesday, November 4, 2009
  • merging is a common, trivial operation a merge occurs every time you pull down new code Wednesday, November 4, 2009
  • subversion strengths mercurial limitations Wednesday, November 4, 2009
  • familiar new ideas require understanding Wednesday, November 4, 2009
  • very strong tool support tool support not as mature Wednesday, November 4, 2009
  • better choice for lots of huge binary files not optimal for huge binary files Wednesday, November 4, 2009
  • everyone knows where the canonical repository is convention defines where to push/pull from Wednesday, November 4, 2009
  • checking out part of a repository is easy no easy way to get only part of a repository Wednesday, November 4, 2009
  • allows empty directories tracks files, so empty directories aren’t saved Wednesday, November 4, 2009
  • subversion is the clear leader in free centralized version control annoying holy war raging over hg vs. git Wednesday, November 4, 2009
  • mercurial git Wednesday, November 4, 2009
  • easy local md5 is easy, revision numbers right? Wednesday, November 4, 2009
  • plugin design with kitchen sink basic default functionality design Wednesday, November 4, 2009
  • better slower http performance over performance, no http, built-in quick easy built-in server serverhg serve Wednesday, November 4, 2009
  • works well on windows support windows, mac, is lacking and and linux low priority Wednesday, November 4, 2009
  • history is rewriting history sacred is a badge of (though you can commit sacrilege with plugins) honor Wednesday, November 4, 2009
  • mercurial concepts Wednesday, November 4, 2009
  • change sets are stored as nodes in a DAG (directed acyclic graph) tip newest r3 file system version r2 time r1 oldest r0 Wednesday, November 4, 2009
  • a change set with no children is a “head” r3 r2 r1 r0 Wednesday, November 4, 2009
  • change sets have zero, one or two parents Wednesday, November 4, 2009
  • the root has zero parents r4 r3 r2 r1 r0 Wednesday, November 4, 2009
  • normal commits have one parent r4 r3 r2 r1 r0 Wednesday, November 4, 2009
  • merges have two parents r4 r3 r2 r1 r0 Wednesday, November 4, 2009
  • branch name is determined by the first parent r4 branch: default r4 branch: release_1.x r3 branch: release_1.x r3 branch: release_1.x r2 branch: default r2 branch: default r1 r1 r0 r0 first parent is r2 first parent is r3 Wednesday, November 4, 2009
  • history is immutable Wednesday, November 4, 2009
  • merging only happens in your local repository Wednesday, November 4, 2009
  • that’s it! Wednesday, November 4, 2009
  • mercurial usage Wednesday, November 4, 2009
  • hg status <-> svn status hg log <-> svn log hg diff <-> svn diff hg cat <-> svn cat familiar basic hg hg blame add <-> <-> svn svn blame add commands hg hg hg remove rename update <-> <-> <-> svn svn svn remove rename update hg resolve <-> svn resolve hg commit <-> svn commit hg merge <-> svn merge Wednesday, November 4, 2009
  • hg init hg add hg commit -m “project start” create a new r0 “project start” repository Wednesday, November 4, 2009
  • <changes ...> hg commit -m “created domain” commit changes to your r1 “created domain” local repository r0 “project start” Wednesday, November 4, 2009
  • <more changes...> hg commit -m “updated user” commit changes to your r2 “updated user” local repository r1 “created domain” r0 “project start” Wednesday, November 4, 2009
  • hg update -r 1 switch your file system to a r2 “updated user” different revision r1 “created domain” r0 “project start” Wednesday, November 4, 2009
  • hg branch release_1.0.x <changes...> hg commit -m “fix role” “fix role” r3 branch: release_1.x create a branch r2 “updated user” branch: default “created domain” r1 branch: default “project start” r0 branch: default Wednesday, November 4, 2009
  • hg update default “fix role” r3 branch: release_1.x merge changes r2 “updated user” branch: default from a branch r1 “created domain” branch: default “project start” r0 branch: default Wednesday, November 4, 2009
  • hg merge release_1.x <resolve any conflicts> hg commit -m “merged branch” r4 “merged branch” “fix role” r3 branch: release_1.x merge changes r2 “updated user” from a branch r1 “created domain” r0 “project start” Wednesday, November 4, 2009
  • hg clone http://path.to.repo get an existing b b repository a a remote local Wednesday, November 4, 2009
  • hg pull get the latest c changes from b b another repository a remote a local Wednesday, November 4, 2009
  • hg pull pull adds c c changes but b b doesn’t modify file system a remote a local Wednesday, November 4, 2009
  • hg update update your c c working directory b b with the changes a a remote local Wednesday, November 4, 2009
  • what if you’ve already made a change in your repository? Wednesday, November 4, 2009
  • hg pull we added c to b d c b b they added d to b a a remote local Wednesday, November 4, 2009
  • hg pull d d c pulling in d gives b b us a new head a a remote local Wednesday, November 4, 2009
  • hg update # abort, crosses branches d when we try to d c update to the tip, b b hg says you need to merge a remote a local Wednesday, November 4, 2009
  • hg merge <resolve any conflicts> hg commit -m “merge done” e d d c merge the b b changes together a a remote local hg fetch does all this in one command (pull, update, merge, commit) use that instead Wednesday, November 4, 2009
  • hg push e d d c push changes b b back out a a remote local Wednesday, November 4, 2009
  • hg push e e d d c c push changes b b back out a a remote local Wednesday, November 4, 2009
  • how to get started with mercurial Wednesday, November 4, 2009
  • watch the peepcode screencast $9, cheap! Wednesday, November 4, 2009
  • read the book free online! Wednesday, November 4, 2009
  • install it Wednesday, November 4, 2009
  • start small Wednesday, November 4, 2009
  • convert your existing repository Wednesday, November 4, 2009
  • commit and share often Wednesday, November 4, 2009
  • install and learn to use a 3-way merge tool Wednesday, November 4, 2009
  • profit! Wednesday, November 4, 2009
  • links mercurial wiki/download http://mercurial.selenic.com O’Reilly’s Mercurial - The Definitive Guide http://hgbook.red-bean.com/ (free!) peepcode intro screencast ($9) http://peepcode.com/products/meet-mercurial mercurial branching info http://stevelosh.com/blog/entry/2009/8/30/a-guide-to-branching-in-mercurial/ ACM article on DVCS http://preview.tinyurl.com/qezmta Wednesday, November 4, 2009
  • Questions? Wednesday, November 4, 2009