![Page 1: Introduction to Mercurial, or "Why we're switching from SVN no matter what"](https://reader036.vdocument.in/reader036/viewer/2022081907/54c208a74a7959e6068b4605/html5/thumbnails/1.jpg)
Getting in touch with your Mercurial side:How you’ll be happier, more productive,and less ragey.
Adam Pah
With contributions from:Dan McClaryIrmak Sirer
1Monday, January 28, 13
![Page 2: Introduction to Mercurial, or "Why we're switching from SVN no matter what"](https://reader036.vdocument.in/reader036/viewer/2022081907/54c208a74a7959e6068b4605/html5/thumbnails/2.jpg)
So what is Mercurial?
• Mercurial is a Distributed Version Control System (DVCS)
• Mercurial (along with Git and Bazaar) is a part of the next generation version control systems
• These systems have been designed to address problems, annoyances, and failings in SVN
2Monday, January 28, 13
![Page 3: Introduction to Mercurial, or "Why we're switching from SVN no matter what"](https://reader036.vdocument.in/reader036/viewer/2022081907/54c208a74a7959e6068b4605/html5/thumbnails/3.jpg)
So why are we switching?
• SVN is frustrating when you try to use it in a more advanced fashion or in a large collaboration.
• Sometimes it’s just frustrating when it’s only you.
• SVN is slow once repositories get large.
• This leads to using it less or only once a stopping point in the work is reached, defeating the purpose of version control.
• SVN is not smart.
• SVN could not merge it’s way out of a paper bag, let alone keep track of constantly changing files.
• Did I mention that SVN is frustrating?
3Monday, January 28, 13
![Page 4: Introduction to Mercurial, or "Why we're switching from SVN no matter what"](https://reader036.vdocument.in/reader036/viewer/2022081907/54c208a74a7959e6068b4605/html5/thumbnails/4.jpg)
Differences between SVN and Mercurial: Paradigm
Source: http://www.hginit.com
SVN
4Monday, January 28, 13
![Page 5: Introduction to Mercurial, or "Why we're switching from SVN no matter what"](https://reader036.vdocument.in/reader036/viewer/2022081907/54c208a74a7959e6068b4605/html5/thumbnails/5.jpg)
Differences between SVN and Mercurial: Paradigm
Source: http://www.hginit.com
Mercurial
5Monday, January 28, 13
![Page 6: Introduction to Mercurial, or "Why we're switching from SVN no matter what"](https://reader036.vdocument.in/reader036/viewer/2022081907/54c208a74a7959e6068b4605/html5/thumbnails/6.jpg)
Differences: Nitty Gritty
• SVN keeps revisions of each commit
• Mercurial keeps changesets at each commit
• So what is the difference?
• If you and I were both working on the same repository, we both makes lots of changes and go our own way.
• When we inevitably have to put everything back together SVN looks at the both of our last revisions and tries to mash them together.
• This typically does not work.
• Mercurial keeps track of every change in each file.
• When we merge back together it just sums all the changes in the changesets on its own and applies them the best it can.
6Monday, January 28, 13
![Page 7: Introduction to Mercurial, or "Why we're switching from SVN no matter what"](https://reader036.vdocument.in/reader036/viewer/2022081907/54c208a74a7959e6068b4605/html5/thumbnails/7.jpg)
Differences: Nitty Gritty
• But wait a minute!!!! Merging is the devil!SVN taught me that over and over again.
• Mercurial is different, it accepts merging and does it intelligently.
• This is for two main reasons:
• Keeping track of changesets is one integral reason, it has more of an idea what has changed
• Separating commits from pushing to others forces it to have a more robust tool set to merge. Branching and merging are the common tools of a Mercurial workflow.
7Monday, January 28, 13
![Page 8: Introduction to Mercurial, or "Why we're switching from SVN no matter what"](https://reader036.vdocument.in/reader036/viewer/2022081907/54c208a74a7959e6068b4605/html5/thumbnails/8.jpg)
Mercurial Workflows
All alone
8Monday, January 28, 13
![Page 9: Introduction to Mercurial, or "Why we're switching from SVN no matter what"](https://reader036.vdocument.in/reader036/viewer/2022081907/54c208a74a7959e6068b4605/html5/thumbnails/9.jpg)
Mercurial Workflows
Anarchy
Adam DanIrmak
9Monday, January 28, 13
![Page 10: Introduction to Mercurial, or "Why we're switching from SVN no matter what"](https://reader036.vdocument.in/reader036/viewer/2022081907/54c208a74a7959e6068b4605/html5/thumbnails/10.jpg)
Mercurial Workflows
Centralized Store
Adam
DanIrmakText
10Monday, January 28, 13
![Page 11: Introduction to Mercurial, or "Why we're switching from SVN no matter what"](https://reader036.vdocument.in/reader036/viewer/2022081907/54c208a74a7959e6068b4605/html5/thumbnails/11.jpg)
A config all to myself
• Just like vi or emacs, mercurial has a configuration file in your home directory
• You can edit this file at ~/.hgrc
• You will need to set your username and e-mail in it (Mercurial won’t work without it)
• You can also enable new extensions in this file, such as hg fetch or hg convert
11Monday, January 28, 13