Dvcs With Mercurial (No Notes)

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Dvcs With Mercurial (No Notes) - Presentation Transcript

    1. Distributed Source Control With Mercurial Or, How I Learned to Stop Worrying and Love the Merge Ted Naleid - Lead Developer at Carol.com
    2. Overview • Introduction • SVN (centralized VCS) vs DVCS • Current Popular DVCS Alternatives • Mercurial (hg) examples • Hands on with hg
    3. checkout add remove update remote log central commit repos merge ... Build Server Centralized VCS (SVN)
    4. Alice's repos push add pull remove update push Dave's log Bob's pull repos commit repos diff push merge pull ... build repos Build Server Distributed VCS (Mercurial)
    5. SVN Limitations DVCS/Mercurial Strengths
    6. Branching is easy, but merging is painful Branching is easy, merging is (relatively) easy
    7. Active net connection required to interact If your computer is on, you have access to the repository
    8. Unable to share changes with others without sharing with everyone (including the build server) Sharing changes with selected people is easy (hg serve/hg push/hg pull)
    9. Fails to merge changes when something is renamed Aware of file history and can merge into renamed file
    10. .svn files are littered throughout your source tree Single .hg directory at root of source tree
    11. Slow over-the-wire performance Fast performance; you’re working on local filesystem
    12. Discourages experimentation Cheap to create/throw away local experimental branch
    13. SVN Strengths DVCS/Mercurial Limitations
    14. Familiar to most developers Most developers will need to learn to think differently
    15. Relatively easy to grasp Better understanding of version control concepts required
    16. Everyone knows where the trunk is because there’s only one server Need to define and adhere to convention to know where the trunk is
    17. Well established tool support and integration Tool support and integration isn’t quite as far along
    18. There is a winner among free, centralized VCS systems: Subversion DVCS systems are still new and a clear winner has not been established
    19. Popular 2nd Gen DVCS Systems Git - Bazaar - Mercurial
    20. Git Created by Linus Torvalds in 2005 after the BitKeeper “debacle”
    21. Git - Website & Hosting • Website: http://git.or.cz/ • Hosting: • http://github.com • http://repo.or.cz
    22. Git - Use in the Wild • Linux Kernel • One Laptop Per Child (OLPC) • Ruby on Rails • Lots of other Ruby stuff • Written mostly in C
    23. Git - Common Wisdom • Fastest of the DVCS systems • Unfriendly to non-Linux/Unix systems • Complex, with ~150 commands added to path • Very popular in the Linux/Ruby communities • Probably the most “buzz” off all DVCS systems right now
    24. Bazaar (bzr) Created by Canonical, Ltd. (creators of Ubuntu) in 2005
    25. Bazaar - Website & Hosting • Website: http://bazaar-vcs.org/ • Hosting: https://launchpad.net/
    26. Bazaar - Use in the Wild • Ubuntu • Drupal • Fairly big in Python community • it’s written mostly in Python
    27. Bazaar - Common Wisdom • Has gone through lots of revisions/changed formats • Slowest of the 3 • Migration of an existing SVN repository is REALLY slow • Made to be friendly, similar to SVN • Smallest market share
    28. Mercurial (hg) Created by Matt Mackall in 2005 after the BitKeeper “debacle”
    29. Mercurial - Website & Hosting • Website: http://www.selenic.com/mercurial/ • Hosting: • http://freehg.org/ • http://sharesource.org/
    30. Mercurial - Use in the Wild • OpenJDK (Java) • OpenSolaris • Mozilla • NetBeans • Many others (largely Java/Python related) • Like Bazaar, it’s mostly written in Python
    31. Mercurial - Common Wisdom • Similar syntax to SVN • Slightly slower than Git, but faster than Bazaar • Good cross-platform support • Getting good support from large Java projects (OpenJDK, NetBeans, etc) • Lower maintenance and easier learning curve than Git
    32. Why did I choose Mercurial over Git/Bazaar?
    33. Similar commands to SVN • hg add • hg remove • hg update • hg log • hg status • It’s like SVN but with the ability to “push” and “pull”
    34. Better cross platform support and growing tool integration
    35. No “packing” of the repository is necessary
    36. Local revision numbers are “friendly”
    37. It’s used by a number of big Java projects
    38. It’s the first one I tried :)
    39. All 3 of these tools look fantastic.
    40. Mercurial Usage Examples How do I do X?
    41. portal/** portal/.hg hg init local local file hg addremove repos system hg commit Create a new repository
    42. portal/** portal/.hg http://hg01/repos/portal local creates tip files local remote file hg clone on filesystem repos repos system hg clone http://hg01/repos/portal “Checkout” an Existing Repository
    43. portal/** portal/.hg http://hg01/repos/portal local hg pull local remote file hg update repos repos system \"hg pull -u\" will do this in one command Pull down the latest changes (no conflicts with local changes)
    44. local file changes portal/.hg http://hg01/repos/portal hg commit conflict! hg pull local files unchanged! hg update local remote file hg merge repos repos system hg commit \"hg fetch\" will pull->update->merge->commit in one command Pull down the latest changes (conflicts detected with local changes)
    45. local file changes portal/.hg http://hg01/repos/portal hg add local hg remove hg addremove local remote file repos hg commit repos system hg push Push changes to another repository (by default, push will refuse to run if it would require a merge)
    46. http://hg01/repos/portal portal/.hg hg incoming remote local repos repos hg outgoing Do a push/pull dry run
    47. portal/.hg local Branching is done by repos simply cloning a repository hg clone hg clone portal portal-clone portal-clone/** portal-clone/.hg local creates tip files local file on filesystem repos system Create a new “branch” (experimenting is cheap and easy)
    48. local file changes portal/.hg local hg diff file hg status local system hg identify repos Compare file system with repository
    49. portal/.hg hg log hg annotate hg cat local hg grep repos hg serve Query repository for info
    50. Hands on with Hg
    51. Creating new repository
    52. Cloning repository/ branching
    53. Pushing changes to another repository
    54. Merging conflicting changes
    55. Creating a tag
    56. Searching through history
    57. Viewing repository through a web browser
    58. A quick way to stick your toes in and try Mercurial out: use it as a “Super Client” for SVN
    59. Web Resources • Choosing a distributed version control system http://www.dribin.org/dave/blog/archives/2007/12/28/dvcs/ • Understanding Mercurial http://www.selenic.com/mercurial/wiki/index.cgi/UnderstandingMercurial • Version Control and the “80%” (DVCS counterpoint) http://blog.red-bean.com/sussman/?p=79 • Mercurial Book http://hgbook.red-bean.com/hgbook.html • Video of Bryan O’Sullivan (creator of the Mercurial Book) http://video.google.com/videoplay?docid=-7724296011317502612
    60. Questions?

    + tednaleidtednaleid, 2 years ago

    custom

    2764 views, 0 favs, 4 embeds more stats

    Distributed Version Control with Mercurial presenta more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 2764
      • 1938 on SlideShare
      • 826 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 59
    Most viewed embeds
    • 820 views on http://naleid.com
    • 4 views on http://static.slideshare.net
    • 1 views on http://tednaleid.wordpress.com
    • 1 views on http://64.233.179.104

    more

    All embeds
    • 820 views on http://naleid.com
    • 4 views on http://static.slideshare.net
    • 1 views on http://tednaleid.wordpress.com
    • 1 views on http://64.233.179.104

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories