Mercurial presentation


Published on

by Illia Gryshkevych

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Mercurial presentation

  1. 1. DVCS with Mercurial<br />Feb 2011<br />
  2. 2. Agenda<br />What is DVCS?<br />How does it work?<br />Mercurial features<br />Extensions<br />Why not SVN? (SVN vs Mercurial)<br />Questions<br />
  3. 3. What is DVCS?<br />
  4. 4. What is DVCS?<br />DVCS - A distributed revision control, distributed version control system (DVCS) keeps track of software revisions and allows many developers to work on a given project independent of network access or a central server. Committing, branching and merging are fast.<br />
  5. 5. DVCS is…<br /> Distributed version control system (DVCS) takes a peer-to-peer approach, as opposed to the client-server approach of centralized systems. Rather than a single, central repository on which clients synchronize, each peer's working copy of the codebase is a bona-fide repository. Distributed version control conducts synchronization by exchanging patches (change-sets) from peer to peer<br />
  6. 6. Currently in SVN<br />
  7. 7. Currently in Mercurial<br />
  8. 8. DVCS - Advantages<br />Fast<br />Mercurials implementation and data structures are designed to be fast. You can generate diffs between revisions, or jump back in time within seconds. <br />Platform independent<br /> Mercurial was written with platform independence in mind. Therefore most of Mercurial is written in Python, with a small part in portable C for performance reasons. As a result, binary releases are available on all major platforms.<br />Extensible<br /> The functionality of Mercurial can be increased with extensions, either by activating the official ones which are shipped with Mercurial or downloading some from the wiki or by writing your own. Extensions are written in Python and can change the workings of the basic commands, add new commands and access all the core functions of Mercurial.<br />Open Source<br /> Mercurial is free software licensed under the terms of the GNU General Public License Version 2.<br />
  9. 9. How does it work?<br />or how it works with TortoiseHG<br />
  10. 10. You have:<br /><ul><li>A working copy. The files you are currently editing.
  11. 11. A repository. A directory (.hg in Mercurial) containing all patches and metadata (comments, guids, dates, etc.). There’s no central server so the data stays with you.</li></li></ul><li>How does it work? – Merge<br />
  12. 12. How does it work? – Changesets!<br /><ul><li>Like in Subversion, history consists of a number of commits. They're called changesets in Mercurial.
  13. 13. A changeset is an atomic collection of changes to files in a repository.
  14. 14. It contains all recorded local files modification and:
  15. 15. information about who made the change (the "committer"), why ("comments") and when (date/time, timezone)
  16. 16. the name of the branch ("default", if omitted or not set)
  17. 17. A changeset is identified uniquely by a changeset ID (1ef7872431f9c64908c732f0bcd4db5700b4cb70 ). In a single repository, you can identify it using a revision number. </li></li></ul><li>How does it work? – Csets tree!<br />
  18. 18. How does it work? – Csets tree!<br />
  19. 19. How does it work? – Push to stable!<br />
  20. 20. How does it work? – Push to stable!<br />
  21. 21. How does it work? – Push to stable!<br />
  22. 22. Mercurial features <br /><ul><li>Pushing changes to another repository
  23. 23. Merging conflicting changes
  24. 24. Searching through history
  25. 25. Viewing repository through a web browser
  26. 26. Using Mercurial as a “super client” for Subversion</li></li></ul><li>Mercurial Features – Merge conflicts<br />
  27. 27. Mercurial Features – Merge conflicts<br />
  28. 28. Mercurial Features – web browser<br />
  29. 29. How does it work? - basic commands<br />Commit selected diffs in checked files.<br />Undo (rollback) last immediate commit. <br />VisualDiff checked files.<br />Revert checked files to last revisioned state<br />Add checked files<br />Move checked files<br />Remove checked files<br />Forget checked files<br />Pull all changes from another repository into the current one <br />Push all changes from your repository into another one <br />Shelve changes when they not needed and get them back in future<br />
  30. 30. Extensions<br />
  31. 31. Extensions - Enabling<br />
  32. 32. Extensions - rebase<br />
  33. 33. Extensions – Shelve <br />The shelve extension lets you to choose which parts of the changes in a working directory you'd like to set aside temporarily, at the granularity of patch hunks. You can later restore the shelved patch hunks using the unshelve command.<br />
  34. 34. Extensions – more and more<br />Purge – deletes all files and directories in the repository that are not being tracked by Mercurial <br />Notify – Send email to subscribed addresses to notify repository changes <br />Convert – convert repositories from other SCMs into Mercurial <br />Highlight – Highlight syntax in the file revision view of hgweb<br />Bisect – Quickly find the revision that introduces a bug or feature bisecting the history tree<br />… <br />
  35. 35. Why not SVN?<br />
  36. 36. SVN Limitations<br />DVCS/Mercurial Strengths<br /><ul><li>Branching is easy, merging is easy
  37. 37. If your computer is on, you have access to the repository
  38. 38. Sharing changes with</li></ul> selected people is easy <br /> (hg serve/hg push/hg pull)<br /><ul><li>Aware of file history and</li></ul> can merge into renamed file<br /><ul><li>Single .hg directory at root of source tree
  39. 39. Fast performance; you’re working on local filesystem
  40. 40. Cheap to create/throw away local experimental branch
  41. 41. Branching is easy, but merging is painful
  42. 42. Active net connection</li></ul> required to interact<br /><ul><li>Unable to share changes</li></ul> with others without sharing with everyone (including the build server)<br /><ul><li>Fails to merge changes when</li></ul> something is renamed<br /><ul><li>.svn files are littered </li></ul> throughout your source tree<br /><ul><li>Slow over-the-wire performance
  43. 43. Discourages experimentation</li></li></ul><li>SVN Strengths<br />DVCS/Mercurial limitations<br /><ul><li>Most developers will need to learn to think differently
  44. 44. Better understanding of version control concepts required
  45. 45. Need to define and adhere to convention to know where the trunk is
  46. 46. Familiar to most developers
  47. 47. Relatively easy to grasp
  48. 48. Everyone knows where the trunk is because there’s only one server</li></li></ul><li>Projects using mercurial<br />Mozilla<br />OpenJDK<br />OpenSolaris<br /><br />Symbian OS<br />Adium<br />Audacious<br />Coin3D<br />OSSEC<br />CubicWeb<br />Dovecot IMAP server<br />GeeXboX<br />RabbitMQ<br />Go programming language<br />GNU Octave<br />GNU Multi-Precision Library<br />Growl<br />LEMON<br />LinuxTV/Video4Linux<br />LuxRender 3D Render Engine<br />Mercurial<br />MoinMoin wiki software<br />Mutt<br />Netbeans<br />Nuxeo<br />Ogre3D<br />SAGE<br />Vim<br />Lugaru HD<br />Tryton<br />Tuenti<br />
  49. 49. Usefull links<br />Download Mercurial:<br />Dvcs With Mercurial presentation:<br />Migrating from and VCS:<br />VS Plugin:<br />Mercurial as a “super client” for Subversion:<br /><br />
  50. 50. Questions?<br />